/** * Creates a combo box as a part of the form. * * @param parent * the combo box parent. * @return the combo box. */ public CCombo createCCombo(Composite parent) { return createCCombo(parent, SWT.FLAT | SWT.READ_ONLY); }
/** * Creates a label as a part of the form. * * @param parent * the label parent. * @param text * the label text. * @return the label. */ public CLabel createCLabel(Composite parent, String text) { return createCLabel(parent, text, SWT.NONE); }
public Control createControl(Composite parent) composite = factory.createFlatFormComposite(parent); GridData data = new GridData(); composite.setLayout(gridLayout); constraintsTableViewer = new ConstraintsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION)); constraintsTableViewer.setInput(input); Table table = constraintsTableViewer.getTable(); Composite buttonComposite = getWidgetFactory().createComposite(composite, SWT.FLAT); GridLayout buttonCompositeLayout = new GridLayout(); buttonCompositeLayout.marginTop = 0; addButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_ADD, SWT.PUSH); data = new GridData(); data.grabExcessHorizontalSpace = true; addUsingDialogButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_ADD_WITH_DOTS, SWT.PUSH); data = new GridData(); data.grabExcessHorizontalSpace = true; editButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_EDIT_WITH_DOTS, SWT.PUSH); data = new GridData(); data.grabExcessHorizontalSpace = true; deleteButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_DELETE, SWT.PUSH);
/** * Creates a combo box as a part of the form. * * @param parent * the combo box parent. * @param comboStyle * the combo box style. * @return the combo box. */ public CCombo createCCombo(Composite parent, int comboStyle) { CCombo combo = new CCombo(parent, comboStyle); adapt(combo, true, false); // Bugzilla 145837 - workaround for no borders on Windows XP if (getBorderStyle() == SWT.BORDER) { combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); } return combo; }
protected void createContents(Composite parent) composite = getWidgetFactory().createFlatFormComposite(parent); data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING; data.grabExcessHorizontalSpace = false; CLabel refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":"); //$NON-NLS-1$ refLabel.setLayoutData(data); data.horizontalAlignment = GridData.FILL; refCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT); refCombo.addSelectionListener(this); refCombo.setLayoutData(data); data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING; data.grabExcessHorizontalSpace = false; CLabel nameLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_NAME); nameLabel.setLayoutData(data); data.grabExcessHorizontalSpace = true; data.horizontalAlignment = GridData.FILL; nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$ nameText.setLayoutData(data); applyAllListeners(nameText);
composite = getWidgetFactory().createFlatFormComposite(parent); CLabel abstractLabel = getWidgetFactory().createCLabel(composite, XSDConstants.ABSTRACT_ATTRIBUTE + ":"); abstractLabel.setLayoutData(data); data.grabExcessHorizontalSpace = true; data.horizontalAlignment = GridData.FILL; abstractCombo = getWidgetFactory().createCCombo(composite); abstractCombo.setLayoutData(data); abstractCombo.setEditable(false); CLabel blockLabel = getWidgetFactory().createCLabel(composite, XSDConstants.BLOCK_ATTRIBUTE + ":"); blockLabel.setLayoutData(data); data.grabExcessHorizontalSpace = true; data.horizontalAlignment = GridData.FILL; blockCombo = getWidgetFactory().createCCombo(composite); blockCombo.setLayoutData(data); blockCombo.setEditable(false); CLabel finalLabel = getWidgetFactory().createCLabel(composite, XSDConstants.FINAL_ATTRIBUTE + ":"); finalLabel.setLayoutData(data); data.grabExcessHorizontalSpace = true; data.horizontalAlignment = GridData.FILL; finalCombo = getWidgetFactory().createCCombo(composite); finalCombo.setLayoutData(data); finalCombo.setEditable(false);
composite = factory.createFlatFormComposite(parent); title = factory.createCLabel(composite, ""); //$NON-NLS-1$ FontData fontData = composite.getFont().getFontData()[0]; title.setFont(JFaceResources.getFontRegistry().getBold(fontData.getName())); title.setText(titleString + (isReadOnly ? " - " + Messages._UI_LABEL_READONLY : "")); //$NON-NLS-1$ //$NON-NLS-2$ Composite facetComposite = factory.createComposite(composite, SWT.FLAT); simpleTypeModifierGroup = getWidgetFactory().createGroup(facetComposite, simpleTypeModifierGroupTitle); GridLayout groupGrid = new GridLayout(); groupGrid.marginTop = 0; Composite simpleTypeModifierComposite = getWidgetFactory().createFlatFormComposite(simpleTypeModifierGroup); data = new GridData(); data.grabExcessVerticalSpace = true; minLengthLabel = factory.createLabel(simpleTypeModifierComposite, minLengthString); minLengthText = factory.createText(simpleTypeModifierComposite, ""); //$NON-NLS-1$ if (isLinux) minGridData.widthHint = 100; minLengthText.setLayoutData(minGridData); minimumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_INCLUSIVE, SWT.CHECK); minimumInclusiveCheckbox.addSelectionListener(this); maxLengthLabel = factory.createLabel(simpleTypeModifierComposite, maxLengthString); maxLengthText = factory.createText(simpleTypeModifierComposite, ""); //$NON-NLS-1$ if (isLinux)
composite = getWidgetFactory().createFlatFormComposite(parent); CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$ data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING; data.grabExcessHorizontalSpace = false; schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$ schemaLocationText.setEditable(true); applyAllListeners(schemaLocationText); wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$ wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$ data = new GridData();
composite = getWidgetFactory().createFlatFormComposite(parent); page = getWidgetFactory().createComposite(composite); gridLayout = new GridLayout(); gridLayout.marginTop = 0; Composite leftContent = getWidgetFactory().createComposite(sashForm, SWT.FLAT); gridLayout = new GridLayout(); gridLayout.numColumns = 1; leftContent.setLayout(gridLayout); Section section = getWidgetFactory().createSection(leftContent, SWT.FLAT | ExpandableComposite.TITLE_BAR); section.setText(Messages._UI_LABEL_EXTENSIONS); section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite tableAndButtonComposite = getWidgetFactory().createComposite(leftContent, SWT.FLAT); tableAndButtonComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); gridLayout = new GridLayout(); Composite buttonComposite = getWidgetFactory().createComposite(tableAndButtonComposite, SWT.FLAT); addButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_ADD_WITH_DOTS, SWT.FLAT); addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); addButton.addSelectionListener(this); removeButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_DELETE, SWT.FLAT); removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); removeButton.addSelectionListener(this);
@Override public void dispose() { if (getColors() != null) { super.dispose(); } } }
@Override public Composite createComposite(Composite parent) { Composite c = createComposite(parent, SWT.NONE); return c; }
public void createContents(Composite parent) 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); addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH); //$NON-NLS-1$ addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH); //$NON-NLS-1$ //$NON-NLS-2$ deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
factory.getColors().initializeSectionToolBarColors(); setBackground(factory.getColors().getBackground()); setForeground(factory.getColors().getForeground()); label = factory.createCLabel(this, BLANK); label.setBackground(new Color[] { factory.getColors().getColor(IFormColors.H_GRADIENT_END), factory.getColors().getColor(IFormColors.H_GRADIENT_START) }, new int[] { 100 }, true); label.setFont(font); label.setForeground(factory.getColors().getColor(IFormColors.TITLE)); FormData data = new FormData(); data.left = new FormAttachment(0, 0);
composite = widgetFactory.createComposite(control); composite.setBackground(ColorConstants.white); GridLayout gridLayout = new GridLayout(); Label label = widgetFactory.createLabel(composite, name + ":"); //$NON-NLS-1$ label.setLayoutData(new GridData()); createTextOrComboControl(item, composite);
public void resetSectionToolBarColors() { TabbedPropertySheetWidgetFactory f = new TabbedPropertySheetWidgetFactory(); FormColors defaultColors = f.getColors(); defaultColors.initializeSectionToolBarColors(); FormColors colors = factory.getColors(); colors.createColor(IFormColors.H_GRADIENT_START, defaultColors.getColor(IFormColors.H_GRADIENT_START).getRGB()); colors.createColor(IFormColors.H_GRADIENT_END, defaultColors.getColor(IFormColors.H_GRADIENT_END).getRGB()); colors.createColor(IFormColors.H_BOTTOM_KEYLINE1, defaultColors.getColor(IFormColors.H_BOTTOM_KEYLINE1).getRGB()); colors.createColor(IFormColors.H_BOTTOM_KEYLINE2, defaultColors.getColor(IFormColors.H_BOTTOM_KEYLINE2).getRGB()); } }
public void createContents(Composite parent) { composite = getWidgetFactory().createFlatFormComposite(parent); simpleText = getWidgetFactory().createText(composite, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$ simpleText.addListener(SWT.Modify, this); PlatformUI.getWorkbench().getHelpSystem().setHelp(simpleText, XSDEditorCSHelpIds.DOCUMENTATION_TAB__NO_LABEL); FormData data = new FormData(); data.left = new FormAttachment(0, 1); data.right = new FormAttachment(100, -1); data.top = new FormAttachment(0, 1); data.bottom = new FormAttachment(100, -1); simpleText.setLayoutData(data); }
CCombo combo = widgetFactory.createCCombo(composite); combo.setText(value); Object[] values = configuration.getValues(item); Text text = widgetFactory.createText(composite,value); text.addKeyListener(internalControlListener); control = text;
leftComposite = factory.createComposite(mainComposite, SWT.NO_FOCUS); leftComposite.setLayout(new FormLayout()); scrolledComposite = factory.createScrolledComposite(mainComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS); leftComposite.setLayoutData(formData); tabComposite = factory.createComposite(scrolledComposite, SWT.NO_FOCUS); tabComposite.setLayout(new FormLayout());
/** * @see org.eclipse.ui.views.properties.tabbed.ISection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ @Override public void createControls(Composite parent, final TabbedPropertySheetPage atabbedPropertySheetPage) { super.createControls(parent, atabbedPropertySheetPage); Composite composite = getWidgetFactory() .createFlatFormComposite(parent); page = new PropertySheetPage(); page.createControl(composite); FormData data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(100, 0); data.top = new FormAttachment(0, 0); data.bottom = new FormAttachment(100, 0); page.getControl().setLayoutData(data); page.getControl().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { atabbedPropertySheetPage.resizeScrolledComposite(); } }); }
widgetFactory = new TabbedPropertySheetWidgetFactory(); tabbedPropertyComposite = new TabbedPropertyComposite(parent, widgetFactory, hasTitleBar); widgetFactory.paintBordersFor(tabbedPropertyComposite); tabbedPropertyComposite.setLayout(new FormLayout()); FormData formData = new FormData();