private static GridDataFactory getGrabBothGridData() { if (grabBothGridDataFactory == null) { grabBothGridDataFactory = GridDataFactory.fillDefaults().grab(true, true); } return grabBothGridDataFactory; }
@Override protected Control createTitleControl(Composite parent) { Text fileterText = new Text(parent, SWT.SEARCH); GridDataFactory.fillDefaults().grab(true, false).applyTo(fileterText); return fileterText; }
private void createContainer() { container = new Composite(parent, SWT.NONE); setInfoBackgroundColor(container); container.setLayout(new GridLayout()); container.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); }
public static Text createTextArea(final Composite parent, final String text, final int height, final int width) { final Text textComponent = new Text(parent, SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL); textComponent.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).hint(width, height).create()); textComponent.setText(text); return textComponent; }
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 }
@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; }
@Override protected Control createCustomArea(Composite parent) { Composite main = new Composite(parent, SWT.NONE); main.setLayout(new GridLayout(1, false)); GridDataFactory.fillDefaults().indent(0, 0).grab(true, true) .applyTo(main); new NonDeletedFilesTree(main, repository, this.conflicts); applyDialogFont(main); return main; }
@Override protected Control createCustomArea(Composite parent) { Composite main = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().indent(0, 0).grab(true, true).applyTo( main); main.setLayout(new GridLayout(1, false)); tree = new NonDeletedFilesTree(main, repository, filePaths); applyDialogFont(main); return main; }
private static void attachGridData(Control c) { GridDataFactory .defaultsFor(c) .align(SWT.FILL, SWT.CENTER) .grab(true, false) .applyTo(c); } }
private static Text createIndentedLabel(Composite main, String text) { Text widget = UIUtils.createSelectableLabel(main, 0); widget.setText(text); // Eclipse 4.3: Use LayoutConstants.getIndent once we depend on 4.3 int indent = 20; GridDataFactory.fillDefaults().grab(true, false).indent(indent, 0) .applyTo(widget); return widget; }
@Override protected Control createCustomArea(Composite parent) { Composite main = new Composite(parent, SWT.NONE); main.setLayout(new GridLayout(1, false)); GridDataFactory.fillDefaults().indent(0, 0).grab(true, true) .applyTo(main); new NonDeletedFilesTree(main, repository, this.result.getConflictList()); applyDialogFont(main); 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 void addToolbar(Composite parent) { ToolBar toolbar = new ToolBar(parent, SWT.VERTICAL); GridDataFactory.fillDefaults().grab(false, true).applyTo(toolbar); UIUtils.addExpansionItems(toolbar, treeViewer); }
private void addToolbar(Composite parent) { ToolBar toolbar = new ToolBar(parent, SWT.VERTICAL); GridDataFactory.fillDefaults().grab(false, true).applyTo(toolbar); UIUtils.addExpansionItems(toolbar, treeViewer); }
private Section createSection(Composite parent, FormToolkit toolkit, int span) { Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); GridDataFactory.fillDefaults().span(span, 1).grab(true, true) .applyTo(section); return section; }
@Override protected Control createTitleControl(Composite parent) { filterText = new Text(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false) .applyTo(filterText); contents.hookFilterText(filterText); filterText.addKeyListener(getKeyAdapter()); return filterText; }
/** * @param control * the <code>Control</code> to lay out. * @since 3.0 */ protected void layoutTreeAreaControl(Control control) { GridDataFactory.fillDefaults().hint(getLastRightWidth(), convertVerticalDLUsToPixels(120)).grab(false, true) .applyTo(control); }
private void createSash(final Composite parent) { sash = new SashForm(parent, SWT.SMOOTH); sash.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); sash.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(final DisposeEvent e) { preferences.storeSashWeights(sash.getWeights()); } }); }
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; }