scrollpane.setMinSize( mainPanel.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); BaseStepDialog.setSize( shell, 250, 400, false );
sc.setMinSize( wTabFolder.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); sc.setExpandHorizontal( true ); sc.setExpandVertical( true );
ScrolledComposite sc = new ScrolledComposite(content, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); Composite composite = new Composite(sc, SWT.NONE); composite.setLayout(new FillLayout(SWT.VERTICAL)); new Label(composite, SWT.NONE).setText("1111"); new Label(composite, SWT.NONE).setText("2222"); new Label(composite, SWT.NONE).setText("3333"); new Label(composite, SWT.NONE).setText("4444"); new Label(composite, SWT.NONE).setText("5555"); new Label(composite, SWT.NONE).setText("6666"); new Label(composite, SWT.NONE).setText("7777"); sc.setContent(composite); sc.setExpandHorizontal(true); sc.setExpandVertical(true); sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
@Override public void controlResized(ControlEvent e) { legend_panel_sc.setMinSize(legend_panel.computeSize(SWT.DEFAULT, SWT.DEFAULT )); } });
/** * Update the minimum size for scrolled composite. */ private void updateSize() { Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT); size.x += IDialogConstants.HORIZONTAL_SPACING; size.y += IDialogConstants.VERTICAL_SPACING; scrolled.setMinSize(size); }
@Override public void controlResized(ControlEvent e) { sc.setMinSize(img_comp.computeSize(SWT.DEFAULT, SWT.DEFAULT )); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = sc.getClientArea(); Point size = cMainComposite.computeSize(r.width, SWT.DEFAULT); sc.setMinSize(size); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = sc.getClientArea(); Point size = cMainComposite.computeSize(r.width, SWT.DEFAULT); sc.setMinSize(size); } });
@Override public void handleEvent(Event event) { int width = sc.getClientArea().width; Point size = parent.computeSize( width, SWT.DEFAULT ); sc.setMinSize( size ); } } );
@Override public void controlResized(ControlEvent e) { Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(main.computeSize(r.width, SWT.DEFAULT )); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(scrollChild.computeSize(SWT.DEFAULT, SWT.DEFAULT)); } });
@Override public void controlResized(final ControlEvent e) { Rectangle r = scrolledComposite.getClientArea(); scrolledComposite.setMinSize(imageComposite.computeSize(r.width, SWT.DEFAULT)); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(scrollChild.computeSize(r.width, SWT.DEFAULT)); } });
@Override public void run() { Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrollable.setMinSize(size); content.layout(); // content.setRedraw(true); } });
public void setCanvasSize(int canvasWidth, int canvasHeight) { if(canvasWidth > width || this.canvasWidth <= 0) { this.canvasWidth = canvasWidth; } if(canvasHeight > height || this.canvasHeight <= 0) { this.canvasHeight = canvasHeight; } if(canvasHeight > 0 && canvasWidth > 0){ imageCanvas.setSize(this.canvasWidth, this.canvasHeight); scrollComposite.setMinSize(this.canvasWidth, this.canvasHeight); scrollComposite.layout(); } }
ScrolledComposite scroller = new ScrolledComposite(tabs, SWT.BORDER | SWT.V_SCROLL); Composite tabArea = new Composite(scroller, SWT.NONE); scroller.setContent(tabArea); // create some controls in TabArea and assign a layout to TabArea scroller.setExpandVertical(true); scroller.setExpandHorizontal(true); scroller.setMinSize(tabArea.computeSize(SWT.DEFAULT, SWT.DEFAULT)); tab.setControl(scroller);
public static ScrolledComposite createScrollable(Composite parent, Consumer<Composite> scrollableContentCreator) { ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); Composite composite = new Composite(sc, SWT.NONE); sc.setContent(composite); scrollableContentCreator.accept(composite); sc.setExpandHorizontal(true); sc.setExpandVertical(true); sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); return sc; }
TabItem firstTab = new TabItem(folder, SWT.NONE); ScrolledComposite sc = new ScrolledComposite(folder, SWT.V_SCROLL | SWT.H_SCROLL); sc.setExpandHorizontal(true); sc.setExpandVertical(true); Composite body = // TODO create all body controls of the tab sc.setContent(body); sc.setMinSize(body.computeSize(SWT.DEFAULT, SWT.DEFAULT)); firstTab.setControl(sc);
public static void updateScrolledComposite(ScrolledComposite sc) { Control content = sc.getContent(); if (content != null && !content.isDisposed()) { Rectangle r = sc.getClientArea(); sc.setMinSize(content.computeSize(r.width, SWT.DEFAULT )); } }
protected void handlePropertyChange(PropertyChangeEvent event) { if (fHeader != null) fHeader.setFont(JFaceResources.getHeaderFont()); if (fBanner != null) fBanner.setFont(JFaceResources.getBannerFont()); Control control= fScrolledComposite.getContent(); fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT)); fScrolledComposite.setContent(control); fScrolledComposite.layout(true); fScrolledComposite.redraw(); }