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 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); }
/** * @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); }
@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 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); }
protected Control createSeparator(Composite parent, IntroSeparator sep) { String key = sep.getParentPage().getId()+".separator.fg"; //$NON-NLS-1$ Color fg = styleManager.getColor(toolkit, key); //Composite l = toolkit.createCompositeSeparator(parent); Composite l = new Composite(parent, SWT.NULL); if (fg!=null) l.setBackground(fg); else l.setBackground(toolkit.getColors().getColor(IFormColors.SEPARATOR)); TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.FILL); td.grabHorizontal = true; td.maxHeight = 1; l.setLayoutData(td); return l; }
protected final Section createStaticSection(FormToolkit toolkit, Composite parent, String text) { Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR); section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; section.setText(text); section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); section.setLayoutData(data); return section; }
private void createAdvancedLink(Composite parent, FormToolkit toolkit) { advancedLink = toolkit.createHyperlink(parent, Messages.FederatedSearchPart_advanced, SWT.NULL); advancedLink.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { doAdvanced(); } }); TableWrapData td = new TableWrapData(); td.colspan = 2; advancedLink.setLayoutData(td); }
private FormText createClient(Section section, String content, FormToolkit toolkit) { FormText text = toolkit.createFormText(section, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } section.setClient(text); section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); text.addHyperlinkListener(this); return text; }
private FormText createText(Section section, String content, FormToolkit toolkit) { Composite container = toolkit.createComposite(section, SWT.NONE); container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 1)); section.setClient(container); FormText text = toolkit.createFormText(container, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); data.maxWidth = 250; text.setLayoutData(data); text.addHyperlinkListener(this); return text; }