protected Composite createStaticSectionClient(FormToolkit toolkit, Composite parent) { Composite container = toolkit.createComposite(parent, SWT.NONE); container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 1)); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); container.setLayoutData(data); return container; }
private void createLabel(Composite parent, FormToolkit toolkit, String text, int span) { Label label = toolkit.createLabel(parent, text, SWT.WRAP); Layout layout = parent.getLayout(); if (layout instanceof GridLayout) { GridData gd = new GridData(); gd.horizontalSpan = span; label.setLayoutData(gd); } else if (layout instanceof TableWrapLayout) { TableWrapData td = new TableWrapData(); td.colspan = span; label.setLayoutData(td); } }
private void addSeparator() { Label pad = page.getToolkit().createLabel(buttonComposite, null); TableWrapData padData = new TableWrapData(); padData.maxWidth = 0; pad.setLayoutData(padData); Label separator = new Label(buttonComposite, SWT.SEPARATOR + SWT.HORIZONTAL); TableWrapData separatorData = new TableWrapData(); separatorData.align = TableWrapData.FILL; separatorData.grabHorizontal = true; separatorData.maxHeight = 1; separatorData.valign = TableWrapData.MIDDLE; separator.setLayoutData(separatorData); for (int i = 3; i <= SUBITEM_COLUMNS; i++) { Label filler = page.getToolkit().createLabel(buttonComposite, null); TableWrapData fillerData = new TableWrapData(); fillerData.maxWidth = 0; filler.setLayoutData(fillerData); } }
private void createButtonComposite() { buttonComposite = page.getToolkit().createComposite(bodyWrapperComposite); GridLayout buttonlayout = new GridLayout(1, false); buttonlayout.marginHeight = 2; buttonlayout.marginWidth = 2; buttonlayout.verticalSpacing = 2; TableWrapData buttonData = new TableWrapData(TableWrapData.FILL); buttonComposite.setLayout(buttonlayout); buttonComposite.setLayoutData(buttonData); buttonComposite.setBackground(itemColor); }
/** * Creates section client * * @param toolkit Toolkit for the new section * @param parent Parent of the new section * @return the new section client */ public static Composite createStaticSectionClient(FormToolkit toolkit, Composite parent) { Composite container = toolkit.createComposite(parent, SWT.NONE); container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 1)); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); container.setLayoutData(data); return container; } }
/** * @param cellContent * {@link DetailsCellContent} * @return Returns the {@link TableWrapData} based in the information in the * {@link DetailsCellContent}. */ private TableWrapData getLayoutData(DetailsCellContent cellContent) { TableWrapData tableWrapData = new TableWrapData(TableWrapData.FILL); tableWrapData.colspan = cellContent.getColspan(); tableWrapData.grabHorizontal = cellContent.isGrab(); return tableWrapData; }
protected void createSingleton(Composite parent, FormToolkit toolkit, IActionBars actionBars, String label) { fSingleton = toolkit.createButton(parent, label, SWT.CHECK); TableWrapData td = new TableWrapData(); td.colspan = 3; fSingleton.setLayoutData(td); fSingleton.setEnabled(isEditable()); fSingleton.addSelectionListener(widgetSelectedAdapter(e -> { IManifestHeader header = getSingletonHeader(); if (header instanceof BundleSymbolicNameHeader) ((BundleSymbolicNameHeader) header).setSingleton(fSingleton.getSelection()); })); }
private void createSubItemButtonComposite() { buttonComposite = page.getToolkit().createComposite(bodyWrapperComposite); TableWrapLayout xbuttonlayout = new TableWrapLayout(); xbuttonlayout.numColumns = SUBITEM_COLUMNS; xbuttonlayout.leftMargin = 0; xbuttonlayout.rightMargin = 0; xbuttonlayout.horizontalSpacing = 0; TableWrapData xbuttonData = new TableWrapData(TableWrapData.FILL); buttonComposite.setLayout(xbuttonlayout); buttonComposite.setLayoutData(xbuttonData); buttonComposite.setBackground(itemColor); }
@Override public void create(Composite parent, boolean enabled) { checkbox = fBlock.getToolkit().createButton(parent, getLabel(), SWT.CHECK); TableWrapData td = new TableWrapData(); td.colspan = 2; checkbox.setLayoutData(td); checkbox.setEnabled(enabled); createCommentDecorator(checkbox, enabled); }
public void run() { Control c = er.createControl(innerForm.getBody(), innerToolkit); c.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); } });
void initializeLayoutData(Composite composite) { Control[] children = composite.getChildren(); for (Control child : children) { if (child.getLayoutData() == null) { child.setLayoutData(new TableWrapData()); } } } }
void initializeLayoutData(Composite composite) { Control[] children = composite.getChildren(); for (Control child : children) { if (child.getLayoutData() == null) { child.setLayoutData(new TableWrapData()); } } } }
private void add(EngineDescriptor ed) { final EngineResultSection er = new EngineResultSection(this, ed); Control c = er.createControl(innerForm.getBody(), innerToolkit); c.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); results.add(er); }
private void showStatus(IStatus status) { StatusSorter sorter = new StatusSorter(status); List<IStatus> sorted = sorter.getSortedStatus(); for (Iterator<IStatus> iter = sorted.iterator(); iter.hasNext();) { IStatus nextStatus = iter.next(); Label imageLabel = toolkit.createLabel(form.getBody(), ""); //$NON-NLS-1$ imageLabel.setImage(getImage(nextStatus.getSeverity())); Label messageLabel = toolkit.createLabel(form.getBody(), nextStatus.getMessage(), SWT.WRAP); TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB); layoutData.indent = 10; messageLabel.setLayoutData(layoutData); } }
@Override public void create(Composite parent, boolean enabled) { Label label = fBlock.getToolkit().createLabel(parent, getLabel()); label.setEnabled(enabled); TableWrapData td = new TableWrapData(); td.valign = TableWrapData.MIDDLE; label.setLayoutData(td); text = fBlock.getToolkit().createText(parent, ""); //$NON-NLS-1$ td = new TableWrapData(TableWrapData.FILL_GRAB); //gd.widthHint = 100; text.setLayoutData(td); text.setEnabled(enabled); createCommentDecorator(label, enabled); }
/** * {@inheritDoc} */ @Override public void createContents(Composite parent) { TableWrapLayout parentLayout = new TableWrapLayout(); parentLayout.topMargin = 5; parentLayout.leftMargin = 5; parentLayout.rightMargin = 2; parentLayout.bottomMargin = 2; parentLayout.numColumns = 2; parentLayout.makeColumnsEqualWidth = true; parent.setLayout(parentLayout); FormToolkit toolkit = managedForm.getToolkit(); // title FormText title = createTitle(parent, toolkit); TableWrapData twd = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP); twd.colspan = 2; title.setLayoutData(twd); super.createContents(parent); // create help to correctly layout twd = new TableWrapData(); twd.grabHorizontal = true; toolkit.createLabel(parent, "", SWT.NONE).setLayoutData(twd); }
@Override public void createPart(Composite parent) { super.createPart(parent); if (status != null) { showStatus(status); } else { String errorString = null; if(message == null) { errorString = Messages.ERROR_PAGE_MESSAGE; } else { errorString = message; } Label errorLabel = toolkit.createLabel(form.getBody(), errorString, SWT.WRAP); errorLabel.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); } }
private void createLazyStart(Composite parent, FormToolkit toolkit, IActionBars actionBars) { fLazyStart = toolkit.createButton(parent, PDEUIMessages.PluginGeneralInfoSection_lazyStart, SWT.CHECK); TableWrapData td = new TableWrapData(); td.colspan = 3; fLazyStart.setLayoutData(td); fLazyStart.setEnabled(isEditable()); fLazyStart.addSelectionListener(widgetSelectedAdapter(e -> { LazyStartHeader[] headers = getLazyStartHeaders(); // must block the refresh otherwise we have problems with multiple activation headers. fBlockListener = true; for (LazyStartHeader header : headers) header.setLazyStart(fLazyStart.getSelection()); if (headers.length == 0) getBundle().setHeader(getLazyStartHeaderName(), getLazyStateHeaderValue(fLazyStart.getSelection())); fBlockListener = false; })); }
private synchronized EngineResultSection findEngineResult( EngineDescriptor ed) { for (int i = 0; i < results.size(); i++) { EngineResultSection er = (EngineResultSection) results.get(i); if (er.matches(ed)) return er; } final EngineResultSection er = new EngineResultSection(this, ed); Display display = parent.getForm().getToolkit().getColors() .getDisplay(); display.syncExec(new Runnable() { public void run() { Control c = er.createControl(innerForm.getBody(), innerToolkit); c.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); } }); results.add(er); return er; }
private void updateLayoutData(Control c, AbstractIntroElement element) { TableWrapData currentTd = (TableWrapData) c.getLayoutData(); if (currentTd == null) { currentTd = new TableWrapData(TableWrapData.FILL, TableWrapData.FILL); currentTd.grabHorizontal = true; c.setLayoutData(currentTd); } currentTd.colspan = styleManager .getColSpan((AbstractBaseIntroElement) element); currentTd.rowspan = styleManager .getRowSpan((AbstractBaseIntroElement) element); }