/** * Returns the margin required around the children whose border is being * painted by the toolkit using {@link #paintBordersFor(Composite)}. Since * the border is painted around the controls on the parent, a number of * pixels needs to be reserved for this border. For windowing systems where * the native border is used, this margin is 0. * * @return the margin in the parent when children have their border painted * @since 3.3 */ public int getBorderMargin() { return getBorderStyle() == SWT.BORDER ? 0 : 2; }
/** * Returns the margin required around the children whose border is being * painted by the toolkit using {@link #paintBordersFor(Composite)}. Since * the border is painted around the controls on the parent, a number of * pixels needs to be reserved for this border. For windowing systems where * the native border is used, this margin is 0. * * @return the margin in the parent when children have their border painted * @since 3.3 */ public int getBorderMargin() { checkDisposed(); return getBorderStyle() == SWT.BORDER ? 0 : 2; }
public void createControl(Composite parent, FormToolkit toolkit, int style) { if (toolkit.getBorderStyle() == SWT.BORDER) combo = new Combo(parent, style | SWT.BORDER); else combo = new CCombo(parent, style | SWT.FLAT); toolkit.adapt(combo, true, false); }
public void createControl(Composite parent, FormToolkit toolkit, int style) { if (toolkit.getBorderStyle() == SWT.BORDER) combo = new Combo(parent, style | SWT.BORDER); else combo = new CCombo(parent, style | SWT.FLAT); toolkit.adapt(combo, true, true); }
@Override protected TreeViewer doCreateTreeViewer(Composite parent, int style) { TreeViewer viewer = super.doCreateTreeViewer(parent, toolkit.getBorderStyle() | style); toolkit.paintBordersFor(viewer.getTree().getParent()); return viewer; }
protected int createPropertySheet(Composite parent) { fToolkit = new FormToolkit(parent.getDisplay()); int toolkitBorderStyle = fToolkit.getBorderStyle(); int style = toolkitBorderStyle == SWT.BORDER ? SWT.NULL : SWT.BORDER; Composite container = new Composite(parent, style); FillLayout flayout = new FillLayout(); flayout.marginWidth = 1; flayout.marginHeight = 1; container.setLayout(flayout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); fPageBook = new ScrolledPageBook(container, style | SWT.V_SCROLL | SWT.H_SCROLL); fToolkit.adapt(fPageBook, false, false); createRestoreButtonSection(parent); if (style == SWT.NULL) { fPageBook.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); fToolkit.paintBordersFor(container); } return style == SWT.NULL ? 2 : 0; }
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) style |= SWT.BORDER; else style |= toolkit.getBorderStyle(); TreeViewer treeViewer = createTreeViewer(parent, style); treeViewer.addSelectionChangedListener(e -> TreePart.this.selectionChanged(e.getStructuredSelection())); treeViewer.addDoubleClickListener(e -> TreePart.this.handleDoubleClick((IStructuredSelection) e.getSelection())); return treeViewer; }
public void createControl(Composite parent, FormToolkit toolkit, int style) { if (toolkit.getBorderStyle() == SWT.BORDER) { fCombo = new Combo(parent, style | SWT.BORDER); fComboViewer = new ComboViewer((Combo) fCombo); } else { fCombo = new CCombo(parent, style | SWT.FLAT); fComboViewer = new ComboViewer((CCombo) fCombo); } fObjects = new ArrayList<>(); fComboViewer.setLabelProvider(new LabelProvider()); fComboViewer.setContentProvider(ArrayContentProvider.getInstance()); fComboViewer.setInput(fObjects); }
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) style |= SWT.BORDER; else style |= toolkit.getBorderStyle(); TableViewer tableViewer = new TableViewer(parent, style); tableViewer.addSelectionChangedListener(e -> TablePart.this.selectionChanged(e.getStructuredSelection())); tableViewer.addDoubleClickListener(e -> TablePart.this.handleDoubleClick((IStructuredSelection) e.getSelection())); return tableViewer; }
int borderStyle = toolkit.getBorderStyle(); toolkit.setBorderStyle(SWT.NULL); Text text = toolkit.createText(contentComposite, cellContent.getText(), style);
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) { style |= SWT.BORDER; } else { style |= toolkit.getBorderStyle(); } CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, style); tableViewer .addSelectionChangedListener(e -> CheckboxTablePart.this.selectionChanged(e.getStructuredSelection())); tableViewer.addCheckStateListener(event -> elementChecked(event.getElement(), event.getChecked())); return tableViewer; }
@Override protected Text doCreateFilterText(Composite parent) { int borderStyle = toolkit.getBorderStyle(); toolkit.setBorderStyle(SWT.NONE); // we don't want Forms border around tree filter Text temp = super.doCreateFilterText(parent); int style = temp.getStyle(); temp.dispose(); fEntryFilter = new FormEntry(parent, toolkit, null, style); toolkit.setBorderStyle(borderStyle); // restore Forms border settings setBackground(toolkit.getColors().getBackground()); return fEntryFilter.getText(); }
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) { style |= SWT.BORDER; } else { style |= toolkit.getBorderStyle(); } filteredTree = new FilteredCheckboxTree(parent, toolkit, style); CheckboxTreeViewer treeViewer = filteredTree.getCheckboxTreeViewer(); treeViewer.addSelectionChangedListener(event -> { CheckboxTreePart.this.selectionChanged(event.getStructuredSelection()); }); treeViewer.addCheckStateListener(event -> { elementChecked(event.getElement(), event.getChecked()); }); return treeViewer; }
textBorder = true; if (getBorderStyle() == SWT.BORDER) { if (!inactiveBorder && !textBorder) { continue;
textBorder = true; if (getBorderStyle() == SWT.BORDER) { if (!inactiveBorder && !textBorder) { continue;
messageArea, message, true, toolkit.getBorderStyle()) { if ((toolkit.getBorderStyle() & SWT.BORDER) == 0) textContent.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
toolkit.decorateFormHeading(mainForm); int borderStyle = toolkit.getBorderStyle(); toolkit.setBorderStyle(SWT.NULL); Tree tree = toolkit.createTree(mainForm.getBody(), SWT.V_SCROLL | SWT.H_SCROLL);
FormToolkit toolkit = managedForm.getToolkit(); int borderStyle = toolkit.getBorderStyle(); toolkit.setBorderStyle(SWT.BORDER); Composite mainComposite = toolkit.createComposite(parent);
public void createControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); int borderStyle = toolkit.getBorderStyle() == SWT.BORDER ? SWT.NULL : SWT.BORDER; container = new Composite(parent, borderStyle); FillLayout flayout = new FillLayout();
private void createFilesArea(Composite parent, FormToolkit toolkit, int span) { diffSection = createSection(parent, toolkit, span); diffSection.setText(UIText.CommitEditorPage_SectionFilesEmpty); Composite filesArea = createSectionClient(diffSection, toolkit); diffViewer = new CommitFileDiffViewer(filesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle()); diffViewer.getTable().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 80) .applyTo(diffViewer.getControl()); diffViewer.setContentProvider(ArrayContentProvider.getInstance()); diffViewer.setTreeWalk(getCommit().getRepository(), null); updateSectionClient(diffSection, filesArea, toolkit); }