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 CounterPanel(Composite parent) { super(parent, SWT.NONE); GridLayoutFactory.swtDefaults().margins(0, 0).spacing(0, 0).applyTo(this); createReportUpperRow(); addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { disposeIcons(); } }); }
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; }
private static GridLayoutFactory getPopupLayout() { if (popupLayoutFactory == null) { popupLayoutFactory = GridLayoutFactory.fillDefaults() .margins(POPUP_MARGINWIDTH, POPUP_MARGINHEIGHT) .spacing(POPUP_HORIZONTALSPACING, POPUP_VERTICALSPACING); } return popupLayoutFactory; }
/** * Creates a copy of the reciever. * * @return a copy of the reciever */ public GridLayoutFactory copy() { return new GridLayoutFactory(create()); }
private Composite createSectionClient(Section parent, FormToolkit toolkit) { Composite client = toolkit.createComposite(parent); GridLayoutFactory.fillDefaults().extendedMargins(2, 2, 2, 2) .applyTo(client); return client; }
@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; }
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; }
protected Control createExtendedContentArea(Composite parent) { Composite displayArea = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().applyTo(displayArea); Link link = new Link(displayArea, SWT.NONE); link.setText(UIText.CommitSelectionDialog_LinkSearch); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { close(); NewSearchUI.openSearchDialog(PlatformUI.getWorkbench() .getActiveWorkbenchWindow(), CommitSearchPage.ID); } }); return displayArea; }
@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(); } }
public void createContents(Composite parent) { GridLayoutFactory.swtDefaults().applyTo(parent); Section notesSection = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR); notesSection.setText(UIText.NoteDetailsPage_ContentSection); GridDataFactory.fillDefaults().grab(true, true).applyTo(notesSection); Composite notesArea = toolkit.createComposite(notesSection); toolkit.paintBordersFor(notesArea); notesSection.setClient(notesArea); GridLayoutFactory.fillDefaults().extendedMargins(2, 2, 2, 2) .applyTo(notesArea); notesText = new SpellcheckableMessageArea(notesArea, "", SWT.NONE) { //$NON-NLS-1$ protected void createMarginPainter() { // Disabled intentionally } }; notesText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); StyledText text = notesText.getTextWidget(); text.setEditable(false); text.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); text.setForeground(text.getDisplay().getSystemColor( SWT.COLOR_INFO_FOREGROUND)); text.setBackground(text.getDisplay().getSystemColor( SWT.COLOR_INFO_BACKGROUND)); GridDataFactory.fillDefaults().grab(true, true).applyTo(notesText); }
private void layoutControls( Composite composite ) { composite.setLayout( GridLayoutFactory.fillDefaults().margins( 3, 0 ).create() ); progressBar.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) ); }
buttonComposite.setFont(parent.getFont()); buttonComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(0).equalWidth(true).create());
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); }
@Override public void createPartControl(Composite parent) { Composite main = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().spacing(0, 0).applyTo(main); GridDataFactory.fillDefaults().grab(true, true).applyTo(main); tree = new TreeViewer(main, SWT.MULTI); tree.setContentProvider(new PathNodeContentProvider()); GridDataFactory.fillDefaults().grab(true, true).applyTo(tree.getTree()); tree.addOpenListener(new IOpenListener() { public void open(OpenEvent event) { reactOnOpen(event); } }); tree.getTree().setEnabled(false); createActions(); getViewSite().setSelectionProvider(tree); createContextMenu(); }
@Override protected Composite createToolTipContentArea(Event event, Composite parent) { // Create the content area Composite composite = new Composite(parent, SWT.NONE); Color fg = parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND); Color bg = parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND); composite.setForeground(fg); composite.setBackground(bg); Text text = new Text(composite, SWT.READ_ONLY); text.setForeground(fg); text.setBackground(bg); String info = NLS.bind(ContributionInfoMessages.ContributionInfo_ContributedBy, contributionInfo.getElementType(), contributionInfo.getBundleId()); text.setText(info); GridLayoutFactory.fillDefaults().margins(2, 2).generateLayout(composite); return composite; } };
@Override protected Control createDialogArea(Composite parent2) { Composite comp = (Composite) super.createDialogArea(parent2); GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(comp); GridLayoutFactory.fillDefaults().applyTo(c); GridDataFactory.fillDefaults().applyTo(c);
/** * This method is responsible for creating details area on the specified * Composite and displaying specified StatusAdapter * * @param parent * A composite on which should be the details area created. * @param statusAdapter * StatusAdapter for which should be the details area * created. */ public void createDetailsArea(Composite parent, StatusAdapter statusAdapter) { Composite container = new Composite(parent, SWT.NONE); container.setLayout(GridLayoutFactory.fillDefaults().create()); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); getProvider().createSupportArea(container, statusAdapter); control = container; }
/** * Creates the title and menu area. Subclasses typically need not override * this method, but instead should use the constructor parameters * <code>showDialogMenu</code> and <code>showPersistAction</code> to * indicate whether a menu should be shown, and * <code>createTitleControl</code> to to customize the presentation of the * title. * * <p> * If this method is overridden, the returned control's layout data must be * an instance of <code>GridData</code>. This method must not modify the * parent's layout. * * @param parent * The parent composite. * @return The Control representing the title and menu area. */ protected Control createTitleMenuArea(Composite parent) { Composite titleAreaComposite = new Composite(parent, SWT.NONE); getPopupLayout().copy().numColumns(2).applyTo(titleAreaComposite); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(titleAreaComposite); createTitleControl(titleAreaComposite); if (showDialogMenu) { createDialogMenu(titleAreaComposite); } return titleAreaComposite; }