private void createHandlerLocationControls(Composite parent) { handlerComposite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(2).applyTo(handlerComposite); GridDataFactory.fillDefaults().grab(true, false).applyTo(handlerComposite); new Label(handlerComposite, SWT.NONE).setText(IDEWorkbenchMessages.UrlHandlerPreferencePage_Handler_Label); handlerLocation = new Text(handlerComposite, SWT.READ_ONLY | SWT.BORDER); handlerLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); handlerComposite.setVisible(false); // set visible on table selection }
public static Composite createGridComposite(final Composite parent, final int columns, final int hSpacing, final int vSpacing, final int hMargin, final int vMargin) { final Composite composite = new Composite(parent, SWT.NONE); setInfoBackgroundColor(composite); final GridLayout layout = GridLayoutFactory.swtDefaults().numColumns(columns).margins(hMargin, vMargin) .spacing(hSpacing, vSpacing).create(); composite.setLayout(layout); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); return composite; }
public static Composite createComposite(final Composite parent, final int numColumns) { final Composite container = new Composite(parent, SWT.NONE); setInfoBackgroundColor(container); container.setLayout(GridLayoutFactory.fillDefaults().margins(10, 0).spacing(0, 0).numColumns(numColumns) .create()); container.setLayoutData(GridDataFactory.fillDefaults().create()); return container; }
@Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite) super.createDialogArea(parent); Composite contents = new Composite(parentComposite, SWT.NONE); contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); setTitle(headerTitle); setMessage(message2); new Label(contents, SWT.LEFT) .setText(label); filenameField = new Text(contents, SWT.SINGLE | SWT.BORDER); if (initialValue != null) { filenameField.setText(initialValue); } filenameField.addModifyListener(event -> { if (event.widget == filenameField) { filename = filenameField.getText().trim(); okButton.setEnabled(validateFileType()); } }); filenameField.setFocus(); Dialog.applyDialogFont(parentComposite); Point defaultMargins = LayoutConstants.getMargins(); GridLayoutFactory.fillDefaults().numColumns(2).margins( defaultMargins.x, defaultMargins.y).generateLayout(contents); return contents; }
@Override protected Control createDialogArea(Composite parent) { Composite main = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).applyTo(main); GridLayoutFactory.fillDefaults().numColumns(2).margins(5, 5) .applyTo(main); new Label(main, SWT.NONE) .setText(UIText.BranchRenameDialog_NewNameLabel); name = new Text(main, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(name); return main; }
private void createConfigurationBlock(final Composite composite) { enablement = new ContentAssistEnablementBlock(composite, Messages.PREFPAGE_ENABLE_CALL_COMPLETION, CallsCompletionProposalComputer.CATEGORY_ID); final Composite group = new Composite(composite, SWT.NONE); group.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create()); group.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); maxProposals = createIntegerField(group, ID_MAX_PROPOSALS, Messages.PREFPAGE_MAX_NUMBER_OF_PROPOSALS, 1, 100); minProbability = createIntegerField(group, ID_MIN_PROBABILITY, Messages.PREFPAGE_MIN_PROBABILITY_OF_PROPOSAL, 1, 100); }
private static Composite createComposite(Composite parent) { Composite main = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().indent(0, 0).grab(true, true) .applyTo(main); GridLayoutFactory.fillDefaults().spacing(0, 0).numColumns(2) .applyTo(main); return main; } }
public void createContents(Composite parent, int numColumns) { if (fFormatters.length <= 1) { return; // No selector is needed since there is only one formatter. } Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(GridLayoutFactory.fillDefaults().margins(0, 10).numColumns(2).create()); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= numColumns; composite.setLayoutData(gd); composite.setFont(parent.getFont()); Label label= new Label(composite, SWT.NONE); label.setText(FormatterMessages.CustomCodeFormatterBlock_formatter_name); fFormatterCombo= new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY); fFormatterCombo.setFont(composite.getFont()); fFormatterCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleFormatterChanged(); } }); for (FormatterContribution formatter : fFormatters) { fFormatterCombo.add(formatter.fName); } initDefault(); }
public void createControl(Composite parent) { Composite displayArea = new Composite(parent, SWT.NONE); GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false) .applyTo(displayArea); GridDataFactory.fillDefaults().grab(true, true).applyTo(displayArea); new Label(displayArea, SWT.NONE) .setText(UIText.SubmodulePathWizardPage_PathLabel); pathText = new Text(displayArea, SWT.SINGLE | SWT.BORDER); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER) .grab(true, false).applyTo(pathText); pathText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validate(); } }); setControl(displayArea); setTitle(UIText.SubmodulePathWizardPage_Title); setMessage(UIText.SubmodulePathWizardPage_Message); setPageComplete(false); }
protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(0) // this is incremented // by createButton .equalWidth(true).applyTo(composite); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1) .applyTo(composite); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(0) // this is incremented // by createButton .equalWidth(true).applyTo(composite); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1) .applyTo(composite); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(0) // this is incremented // by createButton .equalWidth(true).applyTo(composite); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1) .applyTo(composite); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
@Override protected void createFormContent(IManagedForm managedForm) { Composite body = managedForm.getForm().getBody(); GridLayoutFactory.swtDefaults().numColumns(1).applyTo(body); NotesBlock block = new NotesBlock(getCommit()); block.createContent(managedForm, body); block.selectFirstNote(); } }
@Override public Control createContents(Composite parent) { ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL) { @Override public Point computeSize(int hint, int hint2, boolean changed) { return new Point(64, 64); } }; scrolledComposite.setExpandHorizontal(true); scrolledComposite.setExpandVertical(true); Composite body = new Composite(scrolledComposite, SWT.NONE); scrolledComposite.setContent(body); GridLayoutFactory.fillDefaults().margins(0, 0).numColumns(1).applyTo(body); Control contents = super.createContents(body); GridDataFactory.fillDefaults().grab(true, true).applyTo(contents); scrolledComposite.setMinSize(body.computeSize(SWT.DEFAULT, SWT.DEFAULT, true)); return scrolledComposite; }
protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
@Override protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
@Override protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
private void fillTags(FormToolkit toolkit, List<Ref> tags) { for (Control child : tagLabelArea.getChildren()) child.dispose(); GridLayoutFactory.fillDefaults().spacing(1, 1).numColumns(tags.size()) .applyTo(tagLabelArea); for (Ref tag : tags) { ObjectId id = tag.getPeeledObjectId(); boolean annotated = id != null; if (id == null) id = tag.getObjectId(); CLabel tagLabel = new CLabel(tagLabelArea, SWT.NONE); toolkit.adapt(tagLabel, false, false); if (annotated) tagLabel.setImage(getImage(UIIcons.TAG_ANNOTATED)); else tagLabel.setImage(getImage(UIIcons.TAG)); tagLabel.setText(Repository.shortenRefName(tag.getName())); } }
public void createControl(Composite parent) { readConfiguration(); initializeDialogUnits(parent); SearchComposite result = new SearchComposite(parent, SWT.NONE); result.setFont(parent.getFont()); GridDataFactory.fillDefaults().grab(true, true).applyTo(result); GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false) .applyTo(result); addTextPatternControls(result); addScopeControls(result); addRepositoryControl(result); setControl(result); Dialog.applyDialogFont(result); }
private void createTagsArea(Composite parent, FormToolkit toolkit, int span) { Composite tagArea = toolkit.createComposite(parent); GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false) .applyTo(tagArea); GridDataFactory.fillDefaults().span(span, 1).grab(true, false) .applyTo(tagArea); toolkit.createLabel(tagArea, UIText.CommitEditorPage_LabelTags) .setForeground( toolkit.getColors().getColor(IFormColors.TB_TOGGLE)); tagLabelArea = toolkit.createComposite(tagArea); GridDataFactory.fillDefaults().grab(true, true).applyTo(tagLabelArea); GridLayoutFactory.fillDefaults().spacing(1, 1).applyTo(tagLabelArea); }