public String open() { Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); setShellImage( shell, input ); formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( BaseMessages.getString( PKG, "ScriptValuesDialogMod.Shell.Title" ) ); wStepname.setLayoutData( fdStepname ); wSash = new SashForm( shell, SWT.VERTICAL ); wTop = new Composite( wSash, SWT.NONE ); props.setLook( wTop ); wBottom = new Composite( wSash, SWT.NONE ); fdSash.right = new FormAttachment( 100, 0 ); fdSash.bottom = new FormAttachment( 100, -50 ); wSash.setLayoutData( fdSash ); wSash.setWeights( new int[] { 75, 25 } );
shell.setLayout( new FormLayout() ); Composite top = new Composite( shell, SWT.NONE ); FormLayout topLayout = new FormLayout(); topLayout.marginHeight = margin; topLayout.marginWidth = margin; top.setLayout( topLayout ); fdTop.right = new FormAttachment( 100, 0 ); fdTop.bottom = new FormAttachment( 100, -50 ); top.setLayoutData( fdTop ); props.setLook( top ); SashForm sashform = new SashForm( top, SWT.HORIZONTAL ); sashform.setLayout( new FormLayout() ); FormData fdSashform = new FormData(); fdSashform.left = new FormAttachment( 0, 0 ); fdSashform.right = new FormAttachment( 100, 0 ); fdSashform.bottom = new FormAttachment( 100, 0 ); sashform.setLayoutData( fdSashform ); wListDest.setLayoutData( fdListDest ); sashform.setWeights( new int[] { 40, 16, 40 } );
/** * maximizeBrowser * * @param browser * the browser object to maximize. We try to take up as much of the Spoon window as possible. */ private static void maximizeExpandedContent( Browser browser ) { SashForm sash = (SashForm) spoonInstance().getDesignParent(); int[] weights = sash.getWeights(); int[] savedSashWeights = new int[weights.length]; System.arraycopy( weights, 0, savedSashWeights, 0, weights.length ); spoonInstance().getTabSet().getSelected().setSashWeights( savedSashWeights ); weights[0] = 0; weights[1] = 1000; sash.setWeights( weights ); FormData formData = new FormData(); formData.top = new FormAttachment( 0, 0 ); formData.left = new FormAttachment( 0, 0 ); formData.bottom = new FormAttachment( 100, 0 ); formData.right = new FormAttachment( 100, 0 ); browser.setLayoutData( formData ); browser.getParent().layout( true ); browser.getParent().redraw(); } }
public void open() { shell = new Shell( display ); shell.setLayout( new FillLayout() ); shell.setText( APP_NAME ); try { readFiles( ROOT ); } catch ( Exception e ) { new ErrorDialog( shell, "Error reading translations", "There was an unexpected error reading the translations", e ); } // Put something on the screen sashform = new SashForm( shell, SWT.HORIZONTAL ); sashform.setLayout( new FillLayout() ); addList(); addGrid(); addListeners(); sashform.setWeights( new int[] { 30, 70 } ); sashform.setVisible( true ); refresh(); BaseStepDialog.setSize( shell ); shell.open(); }
public void open() { shell = new Shell( display ); shell.setLayout( new FillLayout() ); shell.setText( APP_NAME ); shell.setImage( GUIResource.getInstance().getImageLogoSmall() ); try { readFiles(); } catch ( Exception e ) { new ErrorDialog( shell, "Error reading translations", "There was an unexpected error reading the translations", e ); } // Put something on the screen sashform = new SashForm( shell, SWT.HORIZONTAL ); sashform.setLayout( new FormLayout() ); addLists(); addGrid(); addListeners(); sashform.setWeights( new int[] { 40, 60 } ); sashform.setVisible( true ); shell.pack(); refresh(); shell.setSize( 1024, 768 ); shell.open(); }
private void disposeExtraView() { extraViewComposite.dispose(); sashForm.layout(); sashForm.setWeights( new int[] { 100, } ); XulToolbarbutton button = (XulToolbarbutton) toolbar.getElementById( "job-show-results" ); button.setTooltiptext( BaseMessages.getString( PKG, "Spoon.Tooltip.ShowExecutionResults" ) ); ToolItem swtToolItem = (ToolItem) button.getManagedObject(); swtToolItem.setImage( GUIResource.getInstance().getImageShowResults() ); }
shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); formLayout.marginWidth = 5; formLayout.marginHeight = 5; shell.setLayout( formLayout ); sashForm = new SashForm( shell, SWT.HORIZONTAL ); sashForm.setLayout( new FillLayout() ); fdSashForm.top = new FormAttachment( 0, 10 ); fdSashForm.bottom = new FormAttachment( buttonsComposite, -10 ); sashForm.setLayoutData( fdSashForm ); buttonsComposite.setLayoutData( fdBC ); rightSash = new SashForm( sashForm, SWT.VERTICAL ); message.setLayoutData( fdMessage ); rightSash.setWeights( new int[] { 10, 80, } ); sashForm.setWeights( new int[] { 15, 85, } ); red = new Color( shell.getDisplay(), 255, 0, 0 ); green = new Color( shell.getDisplay(), 0, 220, 0 ); blue = new Color( shell.getDisplay(), 0, 0, 255 );
public CTabItem init(){ server = service.listById(id); Image pubImage = new Image(tabFolder.getShell().getDisplay(), getClass().getResourceAsStream("/publish.png")); composite_3 = new Composite(tabFolder, SWT.NONE); tbtmNewItem.setControl(composite_3); composite_3.setLayout(new GridLayout(1, false)); tbtmNewItem.setText(server.getName() +" "+RedisClient.i18nFile.getText(I18nFile.PUBLISH)); tbtmNewItem.setImage(pubImage); SashForm sashForm_2 = new SashForm(composite_3, SWT.NONE); sashForm_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); Composite composite_4 = new Composite(sashForm_2, SWT.NONE); composite_4.setLayout(new GridLayout(1, false)); tblclmnNewColumn_2.setWidth(100); tblclmnNewColumn_2.setText(RedisClient.i18nFile.getText(I18nFile.MESSAGE)); sashForm_2.setWeights(new int[] {1, 2});
public JobGraph( Composite par, final Spoon spoon, final JobMeta jobMeta ) { super( par, SWT.NONE ); shell = par.getShell(); this.log = spoon.getLog(); this.spoon = spoon; mainComposite = new Composite( this, SWT.NONE ); mainComposite.setLayout( new FillLayout() ); sashForm = new SashForm( mainComposite, SWT.VERTICAL ); sashForm.setWeights( new int[] { 100, } );
layout.marginWidth = 0; layout.marginHeight = 0; shell.setLayout( layout ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); deck = (SwtDeck) mainSpoonContainer.getDocumentRoot().getElementById( "canvas-deck" ); final Composite tempSashComposite = new Composite( shell, SWT.None ); sashComposite = tempSashComposite; windowProperty.setShell( shell ); } else { shell.pack(); shell.setMaximized( true ); // Default = maximized! data.verticalAlignment = SWT.FILL; data.horizontalAlignment = SWT.FILL; sashComposite.setLayoutData( data ); sashComposite.setLayout( layout ); sashform = new SashForm( sashComposite, SWT.HORIZONTAL ); fdSash.bottom = new FormAttachment( 100, 0 ); fdSash.right = new FormAttachment( 100, 0 ); sashform.setLayoutData( fdSash );
public void createControl( Composite parent ) { shell = parent.getShell(); Composite composite = new Composite( parent, SWT.NONE ); props.setLook( composite ); compLayout.marginHeight = Const.FORM_MARGIN; compLayout.marginWidth = Const.FORM_MARGIN; composite.setLayout( compLayout ); SashForm sashform = new SashForm( top, SWT.HORIZONTAL ); sashform.setLayout( new FormLayout() ); FormData fdSashform = new FormData(); fdSashform.left = new FormAttachment( 0, 0 ); fdSashform.right = new FormAttachment( 100, 0 ); fdSashform.bottom = new FormAttachment( 100, 0 ); sashform.setLayoutData( fdSashform ); wListDest.setLayoutData( fdListDest ); sashform.setWeights( new int[] { 45, 10, 45 } );
private void initSash() { Composite composite_1 = new Composite(shell, SWT.NONE); GridLayout gl_composite_1 = new GridLayout(1, false); gl_composite_1.verticalSpacing = 0; text.setEditable(false); final SashForm sashForm = new SashForm(composite_1, SWT.NONE); sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); composite_2.setLayout(new GridLayout(1, false)); final SashForm sashForm_1 = new SashForm(composite_2, SWT.VERTICAL); sashForm_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); sashForm_1.setLocation(0, 0); SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT)); sashForm_1.setWeights(new int[] { 1, 1 }); sashForm.setWeights(new int[] { 1, 4 }); shell.setImage(iconImage);
Composite logTableComposite = new Composite( tabFolder, SWT.NONE ); logTableComposite.setLayout( new FormLayout() ); spoon.props.setLook( logTableComposite ); SashForm sash = new SashForm( logTableComposite, SWT.VERTICAL ); sash.setLayout( new FillLayout() ); FormData fdSash = new FormData(); fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner fdSash.right = new FormAttachment( 100, 0 ); fdSash.bottom = new FormAttachment( 100, 0 ); sash.setLayoutData( fdSash ); logDisplayText.setLayoutData( fdText ); sash.setWeights( new int[] { 70, 30, } ); } else { logDisplayText = null; sash.setWeights( new int[] { 100, } );
extraViewComposite = new Composite( sashForm, SWT.NONE ); FormLayout extraCompositeFormLayout = new FormLayout(); extraCompositeFormLayout.marginWidth = 2; extraCompositeFormLayout.marginHeight = 2; extraViewComposite.setLayout( extraCompositeFormLayout ); extraViewTabFolder.setLayoutData( fdTabFolder ); sashForm.setWeights( new int[] { 60, 40, } );
private void addTabs() { tabComp.dispose(); tabComp = new Composite( sashform, SWT.BORDER ); props.setLook( tabComp ); tabComp.setLayout( new FillLayout() ); sashform.setWeights( weights ); sashform.setVisible( true ); Control[] comps = sashform.getChildren(); for ( Control comp : comps ) {
public SpoonSlave( Composite parent, int style, final Spoon spoon, SlaveServer slaveServer ) { super( parent, style ); this.shell = parent.getShell(); this.display = shell.getDisplay(); this.spoon = spoon; this.slaveServer = slaveServer; spoon.props.setLook( this ); SashForm sash = new SashForm( this, SWT.VERTICAL ); sash.setLayout( new FillLayout() ); fdSash.right = new FormAttachment( 100, 0 ); fdSash.bottom = new FormAttachment( wRefresh, -5 ); sash.setLayoutData( fdSash );
public MainWindow(Composite c) { super(c, SWT.NONE); initLayoutFillMax(); SashForm main = new SashForm(this, SWT.VERTICAL); main.setLayout(new GridLayout(1, true)); main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); createTop(main); createBottom(main); // top a little bigger than the bottom.. int weights[] = {60, 40}; main.setWeights(weights); FileDropTarget.attach(main); }
private void updateSashPanelMargins(SashForm sash) { Control [] children = sash.getChildren(); int orientation = sash.getOrientation(); // update task explorer panel GridLayout layout = (GridLayout)((Composite)children[0]).getLayout(); if (orientation==SWT.HORIZONTAL) { layout.marginBottom = 0; layout.marginRight = 1; } else { layout.marginBottom = 1; layout.marginRight = 0; } // update task editor panel layout = (GridLayout)((Composite)children[1]).getLayout(); if (orientation==SWT.HORIZONTAL) { layout.marginTop = 0; layout.marginLeft = 1; } else { layout.marginTop = 1; layout.marginLeft = 0; } ((Composite)children[0]).layout(); ((Composite)children[1]).layout(); }
protected void createMainArea(Composite parent) { fSashForm= new SashForm(parent, SWT.HORIZONTAL); fSashForm.setFont(parent.getFont()); fSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); createPreferenceTree(fSashForm); fTree.unifySectionTitlesHeights(null); fTree.restoreExpansionState(); createPreviewPane(fSashForm); try { fSashForm.setWeights(new int[] { fDialogSettings.getInt(fKeySashFormLeftWidth), fDialogSettings.getInt(fKeySashFormRightWidth) }); } catch (NumberFormatException e) { Control[] children= fSashForm.getChildren(); int treeWidth= children[0].computeSize(SWT.DEFAULT, SWT.DEFAULT).x; int previewWidth= children[1].computeSize(SWT.DEFAULT, SWT.DEFAULT).x; fSashForm.setWeights(new int[] { treeWidth, previewWidth }); } }
private void writeConfiguration(){ IDialogSettings s = getDialogSettings(); Point location = getShell().getLocation(); s.put("x", location.x); //$NON-NLS-1$ s.put("y", location.y); //$NON-NLS-1$ Point size = getShell().getSize(); s.put("width", size.x); //$NON-NLS-1$ s.put("height", size.y); //$NON-NLS-1$ sashWeights = getSashForm().getWeights(); s.put("sashWidth1", sashWeights[0]); //$NON-NLS-1$ s.put("sashWidth2", sashWeights[1]); //$NON-NLS-1$ } }