/** * Creates a new composite that can contain a set of expandable * sections. A <code>ScrolledPageComposite</code> is created and a new * composite within that, to ensure that expanding the sections will * always have enough space, unless there already is a * <code>ScrolledComposite</code> along the parent chain of * <code>parent</code>, in which case a normal <code>Composite</code> * is created. * <p> * The receiver keeps a reference to the inner body composite, so that * new sections can be added via <code>createSection</code>. * </p> * * @param parent the parent composite * @return the newly created composite */ public Composite createSectionComposite(Composite parent) { Assert.isTrue(fBody == null); boolean isNested= isNestedInScrolledComposite(parent); Composite composite; if (isNested) { composite= new Composite(parent, SWT.NONE); fBody= composite; } else { composite= new ScrolledPageContent(parent); fBody= ((ScrolledPageContent) composite).getBody(); } fBody.setLayout(new GridLayout()); return composite; }
private void makeScrollableCompositeAware(Control control) { ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(control); if (parentScrolledComposite != null) { parentScrolledComposite.adaptChild(control); } }
@Override public void reflow(boolean flushCache) { if (fReflow) super.reflow(flushCache); } }
private void createScrolledArea() { fScrolledPageContent= new ScrolledPageContent(fParentComposite); fScrolledPageContent.addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { fScrolledPageContent.getVerticalBar().setVisible(true); } }); }
@Override protected Control createContents(Composite ancestor) { ScrolledPageContent scrolled= new ScrolledPageContent(ancestor, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Control control= super.createContents(scrolled); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
private void createNoMatchFoundLabel() { fNoMatchFoundLabel= new Label(fScrolledPageContent.getBody(), SWT.NONE); GridData gd= new GridData(SWT.BEGINNING, SWT.CENTER, true, false); gd.horizontalSpan= 3; fNoMatchFoundLabel.setLayoutData(gd); fNoMatchFoundLabel.setFont(fScrolledPageContent.getFont()); fNoMatchFoundLabel.setText(PreferencesMessages.OptionsConfigurationBlock_NoOptionMatchesTheFilter); setVisible(fNoMatchFoundLabel, false); }
ScrolledPageContent spc= new ScrolledPageContent(fTopComposite, SWT.V_SCROLL); spc.getVerticalBar().setIncrement(5); spc.setLayoutData(gridData); childComposite= spc.getBody(); TableWrapLayout tableWrapLayout= new TableWrapLayout(); tableWrapLayout.leftMargin= 0; spc.reflow(true);
public ScrolledPageContent(Composite parent, int style) { super(parent, style); setFont(parent.getFont()); fToolkit= JavaPlugin.getDefault().getDialogsFormToolkit(); setExpandHorizontal(true); setExpandVertical(true); Composite body= new Composite(this, SWT.NONE); body.setFont(parent.getFont()); setContent(body); }
private Composite getParentComposite(PreferenceTreeNode<?> parent) { while (parent != null) { if (parent instanceof Section) return ((Section) parent).fInnerComposite; parent= parent.getParent(); } return getScrolledPageContent().getBody(); }
public Composite getBody() { return (Composite) getContent(); }
@Override public void controlResized(ControlEvent e) { fScrolledPageContent.getVerticalBar().setVisible(true); } });
@Override protected Control createContents(Composite ancestor) { ScrolledPageContent scrolled= new ScrolledPageContent(ancestor, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Control control= super.createContents(scrolled); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
ScrolledPageContent spc= new ScrolledPageContent(fTopComposite, SWT.V_SCROLL); spc.getVerticalBar().setIncrement(5); spc.setLayoutData(gridData); childComposite= spc.getBody(); TableWrapLayout tableWrapLayout= new TableWrapLayout(); tableWrapLayout.leftMargin= 0; spc.reflow(true);
public ScrolledPageContent(Composite parent, int style) { super(parent, style); setFont(parent.getFont()); fToolkit= JavaPlugin.getDefault().getDialogsFormToolkit(); setExpandHorizontal(true); setExpandVertical(true); Composite body= new Composite(this, SWT.NONE); body.setFont(parent.getFont()); setContent(body); }
protected void createPreferenceTree(Composite parent) { Composite mainComp= new Composite(parent, SWT.NONE); mainComp.setFont(parent.getFont()); mainComp.setLayout(new GridLayout(2, false)); fTree= new ProfilePreferenceTree(mainComp); GridLayout layout= new GridLayout(); layout.verticalSpacing= 0; layout.marginLeft= layout.marginWidth - 1; layout.marginWidth= 1; fTree.getScrolledPageContent().getBody().setLayout(layout); fTree.setConcatAncestorLabels(true); fTree.setExpectMultiWordValueMatch(true); // restoring scroll position must wait until layout is complete Display.getCurrent().asyncExec(fTree::restoreScrollPosition); }
public Composite getBody() { return (Composite) getContent(); }
protected Control createContents(Composite ancestor) { ScrolledPageContent scrolled= new ScrolledPageContent(ancestor, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Control control= super.createContents(scrolled); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
/** * Creates a new composite that can contain a set of expandable * sections. A <code>ScrolledPageComposite</code> is created and a new * composite within that, to ensure that expanding the sections will * always have enough space, unless there already is a * <code>ScrolledComposite</code> along the parent chain of * <code>parent</code>, in which case a normal <code>Composite</code> * is created. * <p> * The receiver keeps a reference to the inner body composite, so that * new sections can be added via <code>createSection</code>. * </p> * * @param parent the parent composite * @return the newly created composite */ public Composite createSectionComposite(Composite parent) { Assert.isTrue(fBody == null); boolean isNested= isNestedInScrolledComposite(parent); Composite composite; if (isNested) { composite= new Composite(parent, SWT.NONE); fBody= composite; } else { composite= new ScrolledPageContent(parent); fBody= ((ScrolledPageContent) composite).getBody(); } fBody.setLayout(new GridLayout()); return composite; }
ScrolledPageContent spc= new ScrolledPageContent(fTopComposite, SWT.V_SCROLL); spc.getVerticalBar().setIncrement(5); spc.setLayoutData(gridData); childComposite= spc.getBody(); TableWrapLayout tableWrapLayout= new TableWrapLayout(); tableWrapLayout.leftMargin= 0;
public ScrolledPageContent(Composite parent, int style) { super(parent, style); setFont(parent.getFont()); fToolkit= JavaPlugin.getDefault().getDialogsFormToolkit(); setExpandHorizontal(true); setExpandVertical(true); Composite body= new Composite(this, SWT.NONE); body.setFont(parent.getFont()); setContent(body); }