01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.tests.views.properties.tabbed.text;
11:
12: import org.eclipse.swt.custom.CLabel;
13: import org.eclipse.swt.layout.FormAttachment;
14: import org.eclipse.swt.layout.FormData;
15: import org.eclipse.swt.widgets.Composite;
16: import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
17: import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
18:
19: /**
20: * A section for the text test view.
21: *
22: * @author Anthony Hunter
23: */
24: public class TextTestsLabelSection extends AbstractPropertySection {
25:
26: protected String label;
27:
28: public TextTestsLabelSection(String word) {
29: super ();
30: label = "A simple section for a selected word \"" + word + "\".";//$NON-NLS-1$//$NON-NLS-2$
31: }
32:
33: public void createControls(Composite parent,
34: TabbedPropertySheetPage aTabbedPropertySheetPage) {
35: super .createControls(parent, aTabbedPropertySheetPage);
36: Composite composite = getWidgetFactory()
37: .createFlatFormComposite(parent);
38:
39: CLabel nameLabel = getWidgetFactory().createCLabel(composite,
40: label);
41: FormData data = new FormData();
42: data.left = new FormAttachment(0, 0);
43: data.right = new FormAttachment(100, 0);
44: data.top = new FormAttachment(0, 0);
45: nameLabel.setLayoutData(data);
46: }
47:
48: }
|