use of org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory in project webtools.sourceediting by eclipse.
the class XSDFacetSection method createContents.
protected void createContents(Composite parent) {
TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
composite = factory.createFlatFormComposite(parent);
GridLayout gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 1;
composite.setLayout(gridLayout);
// $NON-NLS-1$
title = factory.createCLabel(composite, "");
FontData fontData = composite.getFont().getFontData()[0];
title.setFont(JFaceResources.getFontRegistry().getBold(fontData.getName()));
// $NON-NLS-1$ //$NON-NLS-2$
title.setText(titleString + (isReadOnly ? " - " + Messages._UI_LABEL_READONLY : ""));
Composite facetComposite = factory.createComposite(composite, SWT.FLAT);
GridData data = new GridData();
gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 2;
facetComposite.setLayout(gridLayout);
data.grabExcessVerticalSpace = true;
data.grabExcessHorizontalSpace = true;
data.verticalAlignment = GridData.FILL;
data.horizontalAlignment = GridData.FILL;
facetComposite.setLayoutData(data);
data = new GridData();
data.grabExcessVerticalSpace = true;
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
simpleTypeModifierGroup = getWidgetFactory().createGroup(facetComposite, simpleTypeModifierGroupTitle);
GridLayout groupGrid = new GridLayout();
groupGrid.marginTop = 0;
groupGrid.marginBottom = 0;
groupGrid.numColumns = 1;
simpleTypeModifierGroup.setLayoutData(data);
simpleTypeModifierGroup.setLayout(groupGrid);
Composite simpleTypeModifierComposite = getWidgetFactory().createFlatFormComposite(simpleTypeModifierGroup);
data = new GridData();
data.grabExcessVerticalSpace = true;
data.verticalAlignment = GridData.FILL;
data.horizontalAlignment = GridData.FILL;
GridLayout grid = new GridLayout();
grid.marginTop = 0;
grid.marginBottom = 0;
grid.numColumns = 3;
simpleTypeModifierComposite.setLayout(grid);
simpleTypeModifierComposite.setLayoutData(data);
if (hasMaxMinFacets) {
boolean isLinux = java.io.File.separator.equals("/");
minLengthLabel = factory.createLabel(simpleTypeModifierComposite, minLengthString);
// $NON-NLS-1$
minLengthText = factory.createText(simpleTypeModifierComposite, "");
if (isLinux) {
minLengthText.addListener(SWT.Modify, customListener);
minLengthText.addListener(SWT.KeyDown, customListener);
minLengthText.addListener(SWT.FocusOut, customListener);
} else
applyAllListeners(minLengthText);
PlatformUI.getWorkbench().getHelpSystem().setHelp(minLengthText, XSDEditorCSHelpIds.CONSTRAINTS_TAB__MINIMUM_LENGTH);
GridData minGridData = new GridData();
minGridData.widthHint = 100;
minLengthText.setLayoutData(minGridData);
minimumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_INCLUSIVE, SWT.CHECK);
minimumInclusiveCheckbox.addSelectionListener(this);
maxLengthLabel = factory.createLabel(simpleTypeModifierComposite, maxLengthString);
// $NON-NLS-1$
maxLengthText = factory.createText(simpleTypeModifierComposite, "");
if (isLinux) {
maxLengthText.addListener(SWT.Modify, customListener);
maxLengthText.addListener(SWT.KeyDown, customListener);
maxLengthText.addListener(SWT.FocusOut, customListener);
} else
applyAllListeners(maxLengthText);
PlatformUI.getWorkbench().getHelpSystem().setHelp(maxLengthText, XSDEditorCSHelpIds.CONSTRAINTS_TAB__MAXIMUM_LENGTH);
GridData maxGridData = new GridData();
maxGridData.widthHint = 100;
maxLengthText.setLayoutData(maxGridData);
maximumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_INCLUSIVE, SWT.CHECK);
maximumInclusiveCheckbox.addSelectionListener(this);
minimumInclusiveCheckbox.setVisible(isNumericBaseType);
maximumInclusiveCheckbox.setVisible(isNumericBaseType);
}
collapseWhitespaceButton = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_COLLAPSE_WHITESPACE, SWT.CHECK);
collapseWhitespaceButton.addSelectionListener(this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(collapseWhitespaceButton, XSDEditorCSHelpIds.CONSTRAINTS_TAB__COLLAPSE_WHITESPACE);
Group specificValueConstraintsGroup = factory.createGroup(facetComposite, Messages._UI_LABEL_SPECIFIC_CONSTRAINT_VALUES);
gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 2;
specificValueConstraintsGroup.setLayout(gridLayout);
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
specificValueConstraintsGroup.setLayoutData(data);
Composite compositeForButtons = factory.createFlatFormComposite(specificValueConstraintsGroup);
gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.verticalSpacing = 1;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 1;
compositeForButtons.setLayout(gridLayout);
data = new GridData();
data.verticalAlignment = GridData.BEGINNING;
compositeForButtons.setLayoutData(data);
factory.createCLabel(compositeForButtons, Messages._UI_LABEL_RESTRICT_VALUES_BY);
// useDefinedValuesButton = factory.createButton(compositeForButtons, "Only permit certain values", SWT.CHECK);
// useDefinedValuesButton.addSelectionListener(this);
Composite compositeForRadioButtons = factory.createFlatFormComposite(compositeForButtons);
gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginLeft = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 1;
compositeForRadioButtons.setLayout(gridLayout);
useEnumerationsButton = factory.createButton(compositeForRadioButtons, Messages._UI_LABEL_ENUMERATIONS, SWT.RADIO);
useEnumerationsButton.addSelectionListener(this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(useEnumerationsButton, XSDEditorCSHelpIds.CONSTRAINTS_TAB__ENUMERATIONS);
usePatternsButton = factory.createButton(compositeForRadioButtons, Messages._UI_LABEL_PATTERNS, SWT.RADIO);
usePatternsButton.addSelectionListener(this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(usePatternsButton, XSDEditorCSHelpIds.CONSTRAINTS_TAB__PATTERNS);
constraintsWidget = new SpecificConstraintsWidget(specificValueConstraintsGroup, factory, (input instanceof XSDFeature) ? (XSDFeature) input : null, xsdSimpleTypeDefinition, this, constraintKind);
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
constraintsWidget.getControl().setLayoutData(data);
PlatformUI.getWorkbench().getHelpSystem().setHelp(constraintsWidget.getControl(), XSDEditorCSHelpIds.CONSTRAINTS_TAB__NO_LABEL);
}
use of org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory in project webtools.sourceediting by eclipse.
the class XSDElementDeclarationSection method createContents.
/**
* Contents of the property tab
*/
public void createContents(Composite parent) {
composite = getWidgetFactory().createFlatFormComposite(parent);
TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
// $NON-NLS-1$
String typeLabel = Messages.UI_LABEL_TYPE;
GridData data = new GridData();
GridLayout gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 3;
composite.setLayout(gridLayout);
// ------------------------------------------------------------------
// NameLabel
// ------------------------------------------------------------------
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
CLabel nameLabel = factory.createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NAME);
nameLabel.setLayoutData(data);
// ------------------------------------------------------------------
// NameText
// ------------------------------------------------------------------
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
// $NON-NLS-1$
nameText = getWidgetFactory().createText(composite, "");
nameText.setLayoutData(data);
nameText.setEnabled(!isElementReference);
applyAllListeners(nameText);
PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText, XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__NAME);
// ------------------------------------------------------------------
if (!hideHyperLink) {
createRenameHyperlink(composite);
setRenameHyperlinkEnabled(!isElementReference);
} else {
getWidgetFactory().createCLabel(composite, "");
}
// ------------------------------------------------------------------
if (isElementReference) {
data = new GridData();
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
CLabel refLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_REFERENCE);
refLabel.setLayoutData(data);
// ------------------------------------------------------------------
// Ref Combo
// ------------------------------------------------------------------
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
componentNameCombo.addSelectionListener(this);
componentNameCombo.addListener(SWT.Traverse, this);
componentNameCombo.setLayoutData(data);
PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameCombo, XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__REFERENCE);
// dummy
// $NON-NLS-1$
getWidgetFactory().createCLabel(composite, "");
}
// ------------------------------------------------------------------
// typeLabel
// ------------------------------------------------------------------
getWidgetFactory().createCLabel(composite, typeLabel);
// ------------------------------------------------------------------
// typeCombo
// ------------------------------------------------------------------
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
// $NON-NLS-1$
typeCombo = getWidgetFactory().createCCombo(composite);
typeCombo.setEditable(false);
typeCombo.setLayoutData(data);
typeCombo.addSelectionListener(this);
typeCombo.addListener(SWT.Traverse, this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(typeCombo, XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__TYPE);
// ------------------------------------------------------------------
// DummyLabel
// ------------------------------------------------------------------
data = new GridData();
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
// $NON-NLS-1$
getWidgetFactory().createCLabel(composite, "");
// ------------------------------------------------------------------
// min property
// ------------------------------------------------------------------
getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MINOCCURS);
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
minCombo.setLayoutData(data);
// $NON-NLS-1$
minCombo.add("0");
// $NON-NLS-1$
minCombo.add("1");
applyAllListeners(minCombo);
minCombo.addSelectionListener(this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(minCombo, XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__MIN_OCCURENCE);
// ------------------------------------------------------------------
// DummyLabel
// ------------------------------------------------------------------
data = new GridData();
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
// $NON-NLS-1$
getWidgetFactory().createCLabel(composite, "");
// ------------------------------------------------------------------
// max property
// ------------------------------------------------------------------
getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MAXOCCURS);
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
maxCombo.setLayoutData(data);
// $NON-NLS-1$
maxCombo.add("0");
// $NON-NLS-1$
maxCombo.add("1");
// $NON-NLS-1$
maxCombo.add("unbounded");
applyAllListeners(maxCombo);
maxCombo.addSelectionListener(this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(maxCombo, XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__MAX_OCCURENCE);
}
use of org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory in project webtools.sourceediting by eclipse.
the class XSDSimpleTypeSection method createContents.
protected void createContents(Composite parent) {
TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
composite = factory.createFlatFormComposite(parent);
GridData data = new GridData();
GridLayout gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 3;
composite.setLayout(gridLayout);
// ------------------------------------------------------------------
// NameLabel
// ------------------------------------------------------------------
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
CLabel nameLabel = factory.createCLabel(composite, Messages.UI_LABEL_NAME);
nameLabel.setLayoutData(data);
// ------------------------------------------------------------------
// NameText
// ------------------------------------------------------------------
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
// $NON-NLS-1$
nameText = getWidgetFactory().createText(composite, "");
nameText.setLayoutData(data);
applyAllListeners(nameText);
PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText, XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__NAME);
// ------------------------------------------------------------------
// Refactor/rename hyperlink
// ------------------------------------------------------------------
createRenameHyperlink(composite);
// Variety Label
// $NON-NLS-1$
CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY"));
// Variety Combo
data = new GridData();
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
label.setLayoutData(data);
varietyCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
List list = XSDVariety.VALUES;
Iterator iter = list.iterator();
while (iter.hasNext()) {
varietyCombo.add(((XSDVariety) iter.next()).getName());
}
varietyCombo.addSelectionListener(this);
varietyCombo.setLayoutData(data);
PlatformUI.getWorkbench().getHelpSystem().setHelp(varietyCombo, XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__VARIETY);
// ------------------------------------------------------------------
// DummyLabel
// ------------------------------------------------------------------
// $NON-NLS-1$
getWidgetFactory().createCLabel(composite, "");
// ------------------------------------------------------------------
// Types Label
// ------------------------------------------------------------------
// $NON-NLS-1$
typesLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES"));
// ------------------------------------------------------------------
// Types Combo
// ------------------------------------------------------------------
typesCombo = getWidgetFactory().createCCombo(composite);
typesCombo.setEditable(false);
typesCombo.setLayoutData(data);
typesCombo.addSelectionListener(this);
typesCombo.addListener(SWT.Traverse, this);
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
typesCombo.setLayoutData(data);
PlatformUI.getWorkbench().getHelpSystem().setHelp(typesCombo, XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__BASE_TYPE);
}
use of org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory in project webtools.sourceediting by eclipse.
the class EnumerationsSection method createContents.
public void createContents(Composite parent) {
TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
composite = factory.createFlatFormComposite(parent);
enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
enumerationsTable.setInput(input);
Table table = enumerationsTable.getTable();
table.addSelectionListener(this);
// $NON-NLS-1$
addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH);
// $NON-NLS-1$ //$NON-NLS-2$
addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH);
// $NON-NLS-1$
deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH);
FormData data2 = new FormData();
data2.top = new FormAttachment(0, 0);
data2.left = new FormAttachment(100, -100);
data2.right = new FormAttachment(100, 0);
// data2.width = 50;
addButton.setLayoutData(data2);
addButton.addSelectionListener(this);
FormData data = new FormData();
data.left = new FormAttachment(addButton, 0, SWT.LEFT);
data.right = new FormAttachment(100, 0);
data.top = new FormAttachment(addButton, 0);
addManyButton.setLayoutData(data);
addManyButton.addSelectionListener(this);
data = new FormData();
data.left = new FormAttachment(addButton, 0, SWT.LEFT);
data.right = new FormAttachment(100, 0);
data.top = new FormAttachment(addManyButton, 0);
deleteButton.setLayoutData(data);
deleteButton.setEnabled(false);
deleteButton.addSelectionListener(this);
data = new FormData();
data.top = new FormAttachment(0, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(addButton, 0);
data.bottom = new FormAttachment(100, 0);
data.width = 50;
table.setLayoutData(data);
table.addListener(SWT.Resize, this);
}
use of org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory in project webtools.sourceediting by eclipse.
the class XSDEnumerationFacetSection method createContents.
protected void createContents(Composite parent) {
TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
composite = factory.createFlatFormComposite(parent);
GridData data = new GridData();
GridLayout gridLayout = new GridLayout();
gridLayout.marginTop = 0;
gridLayout.marginBottom = 0;
gridLayout.numColumns = 3;
composite.setLayout(gridLayout);
// ------------------------------------------------------------------
// ValueLabel
// ------------------------------------------------------------------
data = new GridData();
data = new GridData();
data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
data.grabExcessHorizontalSpace = false;
CLabel valueLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_VALUE);
valueLabel.setLayoutData(data);
// ------------------------------------------------------------------
// ValueText
// ------------------------------------------------------------------
data = new GridData();
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
// $NON-NLS-1$
valueText = getWidgetFactory().createText(composite, "");
valueText.setLayoutData(data);
applyAllListeners(valueText);
PlatformUI.getWorkbench().getHelpSystem().setHelp(valueText, XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__NAME);
}
Aggregations