public String open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); shell.setLayout( shellLayout ); margin = Const.MARGIN; sComp = new ScrolledComposite( sCompParent, SWT.V_SCROLL | SWT.H_SCROLL ); sComp.setLayout( new FormLayout() ); sComp.setExpandHorizontal( true ); sComp.setExpandVertical( true ); GridData helpCompData = new GridData(); helpCompData.grabExcessHorizontalSpace = true; helpCompData.grabExcessVerticalSpace = false; sComp.setContent( comp ); sComp.setExpandHorizontal( true ); sComp.setExpandVertical( true ); sComp.setMinWidth( bounds.width ); sComp.setMinHeight( bounds.height ); if ( !display.readAndDispatch() ) { display.sleep();
public void open() { final Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); ScrolledComposite scrollpane = new ScrolledComposite( shell, SWT.BORDER | SWT.V_SCROLL ); treeFormData.right = new FormAttachment( 100, 0 ); treeFormData.bottom = new FormAttachment( closeButton, -margin * 2 ); scrollpane.setLayoutData( treeFormData ); scrollpane.setExpandVertical( true ); scrollpane.setExpandHorizontal( true ); scrollpane.setAlwaysShowScrollBars( true ); Composite mainPanel = new Composite( scrollpane, SWT.NONE ); scrollpane.setContent( mainPanel ); scrollpane.setSize( 250, 400 ); mainPanel.setLayout( new GridLayout( 1, false ) ); mainPanel.setSize( mainPanel.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); scrollpane.setMinSize( mainPanel.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); BaseStepDialog.setSize( shell, 250, 400, false ); if ( !display.readAndDispatch() ) { display.sleep();
new SWTGC( Display.getCurrent(), new Point( bounds.width, bounds.height ), PropsUI .getInstance().getIconSize() ); MetricsPainter painter = new MetricsPainter( gc, height ); sMetricsComposite.setMinHeight( bounds.height ); sMetricsComposite.setMinWidth( bounds.width ); sMetricsComposite.layout( true, true );
public void addTransMetrics() { if ( transGraph.extraViewComposite == null || transGraph.extraViewComposite.isDisposed() ) { transGraph.addExtraView(); } else { transMetricsTab.setText( BaseMessages.getString( PKG, "Spoon.TransGraph.MetricsTab.Name" ) ); sMetricsComposite = new ScrolledComposite( transGraph.extraViewTabFolder, SWT.V_SCROLL | SWT.H_SCROLL ); sMetricsComposite.setLayout( new FillLayout() ); metricsComposite = new Composite( sMetricsComposite, SWT.NONE ); metricsComposite.setBackground( GUIResource.getInstance().getColorBackground() ); metricsComposite.setLayout( new FormLayout() ); sMetricsComposite.setContent( metricsComposite ); sMetricsComposite.setExpandHorizontal( true ); sMetricsComposite.setExpandVertical( true ); sMetricsComposite.setMinWidth( 800 ); sMetricsComposite.setMinHeight( 400 );
wTab.setToolTipText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFiles.Tooltip" ) ); ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL ); scrolledComposite.setLayout( new FillLayout() ); Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE ); props.setLook( wInputComposite ); tabLayout.marginWidth = 15; tabLayout.marginHeight = 15; wInputComposite.setLayout( tabLayout ); wResultFileNameField.setLayoutData( fdResultFileNameField ); wInputComposite.pack(); Rectangle bounds = wInputComposite.getBounds(); scrolledComposite.setContent( wInputComposite ); scrolledComposite.setExpandHorizontal( true ); scrolledComposite.setExpandVertical( true ); scrolledComposite.setMinWidth( bounds.width ); scrolledComposite.setMinHeight( bounds.height );
formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); wStepname.setLayoutData( fdStepname ); ScrolledComposite sc = new ScrolledComposite( shell, SWT.H_SCROLL | SWT.V_SCROLL ); wFileTab.setText( BaseMessages.getString( PKG, "ExcelWriterDialog.FileTab.TabTitle" ) ); Composite wFileComp = new Composite( wTabFolder, SWT.NONE ); props.setLook( wFileComp ); fdSc.right = new FormAttachment( 100, 0 ); fdSc.bottom = new FormAttachment( 100, -50 ); sc.setLayoutData( fdSc ); sc.setContent( wTabFolder ); sc.setMinSize( wTabFolder.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); sc.setExpandHorizontal( true ); sc.setExpandVertical( true ); if ( !display.readAndDispatch() ) { display.sleep();
final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); content.setLayout(new FillLayout()); scrolledComp.setContent(content); scrolledComp.setMinSize(400, 400); scrolledComp.setExpandHorizontal(true); scrolledComp.setExpandVertical(true); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep();
ScrolledComposite sc = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL); Composite parent = new Composite(sc, SWT.NONE); sc.setContent(parent); parent.setLayout(new GridLayout(2, true)); GridData data = new GridData(GridData.FILL_BOTH); copyGroup.setLayoutData(data); copyGroup.setLayout(new GridLayout(3, false)); data = new GridData(GridData.FILL_BOTH); pasteGroup.setLayoutData(data); pasteGroup.setLayout(new GridLayout(3, false)); typesGroup.setLayout(new GridLayout(2, false)); status = new Label(parent, SWT.NONE); status.setLayoutData(data); createAvailableTypes(typesGroup); sc.setMinSize(parent.computeSize(SWT.DEFAULT, SWT.DEFAULT)); sc.setExpandHorizontal(true); sc.setExpandVertical(true); if (!display.readAndDispatch ()) display.sleep ();
shell.setLayout(new FillLayout()); innerComp.setLayout(new GridLayout(4, true)); scrollComp.setMinHeight(innerComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).y); scrollComp.setMinWidth(innerComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).x); scrollComp.setContent(innerComp); scrollComp.setExpandHorizontal(true); scrollComp.setExpandVertical(true); scrollComp.setAlwaysShowScrollBars(true); shell.pack(); shell.open(); shell.setSize(200, 200); while(!shell.isDisposed()) if(!display.readAndDispatch()) display.sleep();
Display display = new Display(); Shell shell = new Shell( display ); shell.setLayout( new FillLayout() ); ScrolledComposite scrolled = new ScrolledComposite( shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL ); scrolled.setExpandVertical( true ); scrolled.setExpandHorizontal( true ); scrolled.setAlwaysShowScrollBars( true ); Composite composite = new Composite( scrolled, SWT.NONE ); composite.setLayout( new FillLayout( SWT.VERTICAL ) ); for( int i = 0; i < 6; i++ ) { Composite item = new Composite( composite, SWT.NONE ); item.setBackground( item.getDisplay().getSystemColor( SWT.COLOR_BLACK + i ) ); scrolled.setContent( composite ); scrolled.setMinSize( composite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); scrolled.addControlListener( new ControlAdapter() { public void controlResized( ControlEvent event ) { Rectangle clientArea = scrolled.getClientArea(); scrolled.setMinSize( composite.computeSize( clientArea.width, SWT.DEFAULT ) ); shell.setSize( 300, 300 ); shell.open(); while( !shell.isDisposed() ) { if( !display.readAndDispatch() ) display.sleep(); display.dispose();
shell.setLayout(new FillLayout()); shell.pack(); shell.setSize(300, shell.getSize().y); shell.open(); while (!shell.isDisposed()) if (!display.readAndDispatch()) display.sleep(); display.dispose(); content.setLayout(new GridLayout(3, true)); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); scrolled.setMinSize(content.computeSize(SWT.DEFAULT, SWT.DEFAULT)); scrolled.setContent(content); scrolled.getHorizontalBar().addListener(SWT.Selection, new Listener() int value = source.getHorizontalBar().getSelection(); target.setOrigin(value, target.getOrigin().y);
/** * Creates the inner page container. * * @param parent * @return Composite */ protected Composite createPageContainer(Composite parent) { Composite outer = new Composite(parent, SWT.NONE); GridData outerData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); outerData.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN; outer.setLayout(new GridLayout()); outer.setLayoutData(outerData); //Create an outer composite for spacing scrolled = new ScrolledComposite(outer, SWT.V_SCROLL | SWT.H_SCROLL); // always show the focus control scrolled.setShowFocusedControl(true); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); GridData scrolledData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); scrolled.setLayoutData(scrolledData); Composite result = new Composite(scrolled, SWT.NONE); GridData resultData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); result.setLayout(getPageLayout()); result.setLayoutData(resultData); scrolled.setContent(result); return result; }
public ClassifierEditor(final SwtFlowgrid flowgrid, Classifier classifier) { this.flowgrid = flowgrid; this.classifier = classifier; flowgrid.shell().setText(classifier.name() + " - FlowGrid"); flowgrid.shell().setLayout(new FillLayout()); GridLayout contentLayout = new GridLayout(4, true); contentLayout.marginHeight = 0; contentLayout.marginWidth = 0; flowgrid.shell().setLayout(contentLayout); propertyScrolledComposite = flowgrid.createVerticalScrolledComposite(flowgrid.shell()); propertyPanel = new Composite(propertyScrolledComposite, SWT.NONE); propertyPanel.setLayout(flowgrid.resourceManager.createGridLayout(1)); propertyScrolledComposite.setContent(propertyPanel); propertyScrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); operationScrolledComposite = flowgrid.createVerticalScrolledComposite(flowgrid.shell()); operationPanel = new Composite(operationScrolledComposite, SWT.NONE); operationPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); GridLayout operationLayout = new GridLayout(2, true); operationLayout.marginHeight = 0; operationLayout.marginWidth = 0; operationPanel.setLayout(operationLayout); operationScrolledComposite.setContent(operationPanel); operationScrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); operationScrolledComposite.setBackground(flowgrid.resourceManager.background); refresh(); // contentPanel.layout(true, true); //flowgrid.shell().layout(true, true); }
public VirtualOperationDialog(final SwtFlowgrid flowgrid, final VirtualOperation operation) { this.flowgrid = flowgrid; this.operation = operation; alert = new AlertDialog(flowgrid.shell()); alert.setTitle("Edit Virtual Method"); new Label(alert.getContentContainer(), SWT.NONE).setText("Operation name"); new Label(alert.getContentContainer(), SWT.NONE).setText(operation.name()); Button addParameterButton = new Button(alert.getContentContainer(), SWT.NONE); addParameterButton.setText("Add Parameter"); addParameterButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { new ParameterDialog(VirtualOperationDialog.this, null).show(); } }); ScrolledComposite scrolledComposite = flowgrid.createVerticalScrolledComposite(alert.getContentContainer()); scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); parameterComposite = new Composite(scrolledComposite, SWT.NONE); scrolledComposite.setContent(parameterComposite); parameterComposite.setLayout(new GridLayout(4, false)); updateParameterList(); alert.setPositiveButton("Ok", null); }
@Override public void createPartControl(Composite parent) { Map<String, Set<ZoneId>> timeZones = TimeZoneComparator.getTimeZones(); CTabFolder tabs = new CTabFolder(parent, SWT.BOTTOM); timeZones.forEach((region, zones) -> { CTabItem item = new CTabItem(tabs, SWT.NONE); item.setText(region); ScrolledComposite scrolled = new ScrolledComposite(tabs, SWT.H_SCROLL | SWT.V_SCROLL); Composite clocks = new Composite(scrolled, SWT.NONE); clocks.setBackground(clocks.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); item.setControl(scrolled); scrolled.setContent(clocks); clocks.setLayout(new RowLayout()); RGB rgb = new RGB(128, 128, 128); zones.forEach(zone -> { Group group = new Group(clocks, SWT.SHADOW_ETCHED_IN); group.setText(zone.getId().split("/")[1]); group.setLayout(new FillLayout()); new ClockWidget(group, SWT.NONE, rgb).setZone(zone); }); Point size = clocks.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); }); tabs.setSelection(0); }
final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); scrolledComposite.setExpandHorizontal(true); scrolledComposite.setExpandVertical(true); scrolledComposite.setBackground(display.getSystemColor(SWT.COLOR_CYAN)); final List list = new List(scrolledComposite, SWT.NONE); list.setEnabled(false); scrolledComposite.setContent(list); scrolledComposite.addListener(SWT.Resize, new Listener() { @Override public void handleEvent(Event event) { final Point size = list.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); scrolledComposite.setMinSize(size); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep();
Display display = new Display(); shell.setLayout(new FillLayout()); Map<String,Control> controlMap = new HashMap<String,Control>(); final ScrolledComposite scrollComposite = new ScrolledComposite(shell, scrollComposite.setContent(parent); scrollComposite.setExpandVertical(true); scrollComposite.setExpandHorizontal(true); scrollComposite.addControlListener(new ControlAdapter() { public void controlResized(ControlEvent e) { Rectangle r = scrollComposite.getClientArea(); scrollComposite.setMinSize(parent.computeSize(r.width, SWT.DEFAULT)); shell.open(); scrollComposite.setOrigin(showCntrl.getLocation()); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep();
public static void setViewRequiresOneDownload(Composite genComposite) { if (genComposite == null || genComposite.isDisposed()) { return; } Utils.disposeComposite(genComposite, false); Label lab = new Label(genComposite, SWT.NULL); GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true); gridData.verticalIndent = 10; lab.setLayoutData(gridData); Messages.setLanguageText(lab, "view.one.download.only"); genComposite.layout(true); Composite parent = genComposite.getParent(); if (parent instanceof ScrolledComposite) { ScrolledComposite scrolled_comp = (ScrolledComposite) parent; Rectangle r = scrolled_comp.getClientArea(); scrolled_comp.setMinSize(genComposite.computeSize(r.width, SWT.DEFAULT )); } }
scrollComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.BORDER); scrollComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scrollComposite.setBackground(toolkit.getColors().getBackground()); main.setLayout(gl); img.setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_DATABASE)); img.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, true)); formText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true)); scrollComposite.setContent(main); scrollComposite.addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { Layout parentLayout = parent.getLayout(); if (parentLayout instanceof GridLayout) { ((GridLayout) parentLayout).marginHeight = 0;
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));