org.eclipse.swt.layout.FormLayout Java Examples
The following examples show how to use
org.eclipse.swt.layout.FormLayout.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HopGui.java From hop with Apache License 2.0 | 6 votes |
protected void addPerspectivesToolbar() { // We can't mix horizontal and vertical toolbars so we need to add a composite. // shell.setLayout( new FormLayout() ); mainHopGuiComposite = new Composite( shell, SWT.NO_BACKGROUND ); mainHopGuiComposite.setLayout( new FormLayout() ); FormData formData = new FormData(); formData.left = new FormAttachment( 0, 0 ); formData.right = new FormAttachment( 100, 0 ); formData.top = new FormAttachment( mainToolbar, 0 ); formData.bottom = new FormAttachment( 100, 0 ); mainHopGuiComposite.setLayoutData( formData ); perspectivesToolbar = new ToolBar( mainHopGuiComposite, SWT.WRAP | SWT.RIGHT | SWT.VERTICAL ); props.setLook( perspectivesToolbar, PropsUi.WIDGET_STYLE_TOOLBAR ); FormData fdToolBar = new FormData(); fdToolBar.left = new FormAttachment( 0, 0 ); fdToolBar.top = new FormAttachment( 0, 0 ); fdToolBar.bottom = new FormAttachment( 100, 0 ); perspectivesToolbar.setLayoutData( fdToolBar ); perspectivesToolbarWidgets = new GuiToolbarWidgets(); perspectivesToolbarWidgets.registerGuiPluginObject( this ); perspectivesToolbarWidgets.createToolbarWidgets( perspectivesToolbar, GUI_PLUGIN_PERSPECTIVES_PARENT_ID ); perspectivesToolbar.pack(); }
Example #2
Source File: CheckstylePreferencePage.java From eclipse-cs with GNU Lesser General Public License v2.1 | 6 votes |
/** * Creates the content regarding the management of check configurations. * * @param parent * the parent composite * @return the configuration area */ private Composite createCheckConfigContents(Composite parent) { // // Create the composite for configuring check configurations. // Group configComposite = new Group(parent, SWT.NULL); configComposite.setText(Messages.CheckstylePreferencePage_titleCheckConfigs); configComposite.setLayout(new FormLayout()); mWorkingSetEditor = new CheckConfigurationWorkingSetEditor(mWorkingSet, true); final Control editorControl = mWorkingSetEditor.createContents(configComposite); FormData fd = new FormData(); fd.left = new FormAttachment(0, 3); fd.top = new FormAttachment(0, 3); fd.right = new FormAttachment(100, -3); fd.bottom = new FormAttachment(100, -3); editorControl.setLayoutData(fd); return configComposite; }
Example #3
Source File: BaseDialog.java From hop with Apache License 2.0 | 6 votes |
/** * Returns a {@link org.eclipse.swt.events.SelectionAdapter} that is used to "submit" the dialog. */ private Display prepareLayout() { // Prep the parent shell and the dialog shell final Shell parent = getParent(); final Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.SHEET ); shell.setImage( GuiResource.getInstance().getImageHopUi() ); props.setLook( shell ); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { @Override public void shellClosed( ShellEvent e ) { dispose(); } } ); final FormLayout formLayout = new FormLayout(); formLayout.marginWidth = MARGIN_SIZE; formLayout.marginHeight = MARGIN_SIZE; shell.setLayout( formLayout ); shell.setText( this.title ); return display; }
Example #4
Source File: ConfigurationDialog.java From hop with Apache License 2.0 | 6 votes |
protected void optionsSectionLayout( Class<?> PKG, String prefix ) { gDetails = new Group( shell, SWT.SHADOW_ETCHED_IN ); gDetails.setText( BaseMessages.getString( PKG, prefix + ".DetailsGroup.Label" ) ); props.setLook( gDetails ); // The layout gDetails.setLayout( new FormLayout() ); fdDetails = new FormData(); fdDetails.top = new FormAttachment( wRunConfigurationControl, 15 ); fdDetails.right = new FormAttachment( 100, -15 ); fdDetails.left = new FormAttachment( 0, 15 ); gDetails.setBackground( shell.getBackground() ); // the default looks ugly gDetails.setLayoutData( fdDetails ); optionsSectionControls(); }
Example #5
Source File: LabelCombo.java From hop with Apache License 2.0 | 5 votes |
public LabelCombo( Composite composite, int flags, String labelText, String toolTipText ) { super( composite, SWT.NONE ); props.setLook( this ); int middle = props.getMiddlePct(); int margin = props.getMargin(); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = 0; formLayout.marginHeight = 0; formLayout.marginTop = 0; formLayout.marginBottom = 0; this.setLayout( formLayout ); int textFlags = SWT.SINGLE | SWT.LEFT | SWT.BORDER; if ( flags != SWT.NONE ) { textFlags = flags; } wCombo = new CCombo( this, textFlags ); FormData fdText = new FormData(); fdText.left = new FormAttachment( middle, margin ); fdText.right = new FormAttachment( 100, 0 ); wCombo.setLayoutData( fdText ); wCombo.setToolTipText( toolTipText ); wLabel = new Label( this, SWT.RIGHT ); props.setLook( wLabel ); wLabel.setText( labelText ); FormData fdLabel = new FormData(); fdLabel.left = new FormAttachment( 0, 0 ); fdLabel.right = new FormAttachment( middle, 0 ); fdLabel.top = new FormAttachment( wCombo, 0, SWT.CENTER ); wLabel.setLayoutData( fdLabel ); wLabel.setToolTipText( toolTipText ); }
Example #6
Source File: ConfigurationDialog.java From hop with Apache License 2.0 | 5 votes |
protected void mainLayout( String shellTitle, Image img ) { display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX ); props.setLook( shell ); shell.setImage( img ); shell.setLayout( new FormLayout() ); shell.setText( shellTitle ); }
Example #7
Source File: CommonTransformDialog.java From hop with Apache License 2.0 | 5 votes |
private Display prepareLayout() { // Prep the parent shell and the dialog shell final Shell parent = getParent(); final Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); setShellImage( shell, meta ); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { @Override public void shellClosed( ShellEvent e ) { cancel(); } } ); changed = meta.hasChanged(); final FormLayout formLayout = new FormLayout(); formLayout.marginWidth = BaseDialog.MARGIN_SIZE; formLayout.marginHeight = BaseDialog.MARGIN_SIZE; shell.setLayout( formLayout ); shell.setText( getTitle() ); return display; }
Example #8
Source File: BrowserEnvironmentWarningDialog.java From hop with Apache License 2.0 | 5 votes |
/** * showWarningDialog * <p> * Shows a SWT dialog warning the user that something is wrong with the browser environment. * * @param title the title on the top of the window. * @param message the message at the center of the screen. * @param helpLink a string that contains a hyperlink to a help web page. * @param maxTextWidth the width for the text inside the dialog. */ private void showWarningDialog( String title, String message, String helpLink, EnvironmentCase environment, int maxTextWidth ) { if ( this.getParent().isDisposed() ) { return; } this.props = PropsUi.getInstance(); Display display = this.getParent().getDisplay(); shell = new Shell( this.getParent(), SWT.TITLE | SWT.APPLICATION_MODAL ); props.setLook( shell ); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = margin; formLayout.marginHeight = margin; shell.setLayout( formLayout ); // setting layout shell.setText( title ); //setting title of the window setWarningIcon( display ); //adding icon setWarningText( message, maxTextWidth ); //adding text setHelpLink( display, helpLink, maxTextWidth, environment ); //adding link setCloseButton(); //adding button shell.setSize( shell.computeSize( SWT.DEFAULT, SWT.DEFAULT, true ) ); Rectangle screenSize = display.getPrimaryMonitor().getBounds(); shell.setLocation( ( screenSize.width - shell.getBounds().width ) / 2, ( screenSize.height - shell.getBounds().height ) / 2 ); closeButton.setFocus(); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } }
Example #9
Source File: RadioTab.java From hop with Apache License 2.0 | 5 votes |
public RadioTab( Composite composite, int i, String title, PropsUi props ) { super( composite, i ); this.props = props; props.setLook( this ); noMarginLayout = new FormLayout(); this.setLayout( noMarginLayout ); fdMaximize = new FormData(); fdMaximize.left = new FormAttachment( 0 ); fdMaximize.top = new FormAttachment( 0 ); fdMaximize.right = new FormAttachment( 100 ); fdMaximize.bottom = new FormAttachment( 100 ); this.setLayoutData( fdMaximize ); FormLayout marginLayout = new FormLayout(); marginLayout.marginWidth = 15; marginLayout.marginHeight = 15; radioGroup = new Group( this, i ); radioGroup.setLayout( marginLayout ); radioGroup.setText( title ); FormData fdRadioGroup = new FormData(); fdRadioGroup.top = new FormAttachment( 0 ); fdRadioGroup.left = new FormAttachment( 0 ); fdRadioGroup.right = new FormAttachment( 100 ); radioGroup.setLayoutData( fdRadioGroup ); props.setLook( radioGroup ); contentArea = new Composite( this, i ); contentArea.setLayout( noMarginLayout ); FormData fdContentArea = new FormData(); fdContentArea.left = new FormAttachment( 0 ); fdContentArea.top = new FormAttachment( radioGroup, 15 ); fdContentArea.bottom = new FormAttachment( 100 ); fdContentArea.right = new FormAttachment( 100 ); contentArea.setLayoutData( fdContentArea ); props.setLook( contentArea ); }
Example #10
Source File: AuthComposite.java From hop with Apache License 2.0 | 5 votes |
private void layoutComposite() { FormLayout flAuthComp = new FormLayout(); this.setLayout( flAuthComp ); //authentication group wAuthGroup = new Group( this, SWT.SHADOW_ETCHED_IN ); props.setLook( wAuthGroup ); wAuthGroup.setText( authGroupLabel ); FormLayout flAuthGroup = new FormLayout(); flAuthGroup.marginHeight = 15; flAuthGroup.marginWidth = 15; wAuthGroup.setLayout( flAuthGroup ); wAuthGroup.setLayoutData( new FormDataBuilder().fullSize().result() ); //username wlUsername = new Label( wAuthGroup, SWT.LEFT ); props.setLook( wlUsername ); wlUsername.setText( usernameLabel ); wlUsername.setLayoutData( new FormDataBuilder().left().top().result() ); wUsername = new TextVar( pipelineMeta, wAuthGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wUsername ); wUsername.addModifyListener( lsMod ); wUsername.setLayoutData( new FormDataBuilder().top( wlUsername ).left().width( 800 ).result() ); //password wlPassword = new Label( wAuthGroup, SWT.LEFT ); props.setLook( wlPassword ); wlPassword.setText( passwordLabel ); wlPassword.setLayoutData( new FormDataBuilder().left().top( wUsername, ConstUi.MEDUIM_MARGIN ).result() ); wPassword = new PasswordTextVar( pipelineMeta, wAuthGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wPassword ); wPassword.addModifyListener( lsMod ); wPassword.setLayoutData( new FormDataBuilder().left().top( wlPassword ).width( 800 ).result() ); }
Example #11
Source File: LabelText.java From hop with Apache License 2.0 | 5 votes |
public LabelText( Composite composite, int textStyle, String labelText, String toolTipText, int middle, int margin ) { super( composite, SWT.NONE ); props.setLook( this ); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = 0; formLayout.marginHeight = 0; this.setLayout( formLayout ); wText = new Text( this, textStyle ); FormData fdText = new FormData(); fdText.left = new FormAttachment( middle, margin ); fdText.right = new FormAttachment( 100, 0 ); wText.setLayoutData( fdText ); wText.setToolTipText( toolTipText ); wLabel = new Label( this, SWT.RIGHT ); props.setLook( wLabel ); wLabel.setText( labelText ); FormData fdLabel = new FormData(); fdLabel.left = new FormAttachment( 0, 0 ); fdLabel.right = new FormAttachment( middle, 0 ); fdLabel.top = new FormAttachment( wText, 0, SWT.CENTER ); wLabel.setLayoutData( fdLabel ); wLabel.setToolTipText( toolTipText ); }
Example #12
Source File: HopGui.java From hop with Apache License 2.0 | 5 votes |
/** * Add a main composite where the various perspectives can parent on to show stuff... * Its area is to just below the main toolbar and to the right of the perspectives toolbar */ private void addMainPerspectivesComposite() { mainPerspectivesComposite = new Composite( mainHopGuiComposite, SWT.NO_BACKGROUND ); mainPerspectivesComposite.setLayout( new FormLayout() ); FormData fdMain = new FormData(); fdMain.top = new FormAttachment( 0, 0 ); fdMain.left = new FormAttachment( perspectivesToolbar, 0 ); fdMain.bottom = new FormAttachment( 100, 0 ); fdMain.right = new FormAttachment( 100, 0 ); mainPerspectivesComposite.setLayoutData( fdMain ); }
Example #13
Source File: LabelComboVar.java From hop with Apache License 2.0 | 5 votes |
public LabelComboVar( IVariables variables, Composite composite, int flags, String labelText, String toolTipText ) { super( composite, SWT.NONE ); props.setLook( this ); int middle = props.getMiddlePct(); int margin = props.getMargin(); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = 0; formLayout.marginHeight = 0; formLayout.marginTop = 0; formLayout.marginBottom = 0; this.setLayout( formLayout ); int textFlags = SWT.SINGLE | SWT.LEFT | SWT.BORDER; if ( flags != SWT.NONE ) { textFlags = flags; } wCombo = new ComboVar( variables, this, textFlags, toolTipText ); FormData fdText = new FormData(); fdText.left = new FormAttachment( middle, margin ); fdText.right = new FormAttachment( 100, 0 ); wCombo.setLayoutData( fdText ); wCombo.getCComboWidget().setToolTipText( toolTipText ); wLabel = new Label( this, SWT.RIGHT ); props.setLook( wLabel ); wLabel.setText( labelText ); FormData fdLabel = new FormData(); fdLabel.left = new FormAttachment( 0, 0 ); fdLabel.right = new FormAttachment( middle, 0 ); fdLabel.top = new FormAttachment( wCombo, 0, SWT.CENTER ); wLabel.setLayoutData( fdLabel ); wLabel.setToolTipText( toolTipText ); }
Example #14
Source File: TextFileImportWizardPage1.java From hop with Apache License 2.0 | 5 votes |
public void createControl( Composite parent ) { // create the composite to hold the widgets Composite composite = new Composite( parent, SWT.NONE ); props.setLook( composite ); FormLayout compLayout = new FormLayout(); compLayout.marginHeight = Const.FORM_MARGIN; compLayout.marginWidth = Const.FORM_MARGIN; composite.setLayout( compLayout ); MouseAdapter lsMouse = new MouseAdapter() { public void mouseDown( MouseEvent e ) { int s = getSize(); setPageComplete( s > 0 ); } }; wTable = new TableDraw( composite, props, this, fields ); wTable.setRows( rows ); props.setLook( wTable ); wTable.setFields( fields ); fdTable = new FormData(); fdTable.left = new FormAttachment( 0, 0 ); fdTable.right = new FormAttachment( 100, 0 ); fdTable.top = new FormAttachment( 0, 0 ); fdTable.bottom = new FormAttachment( 100, 0 ); wTable.setLayoutData( fdTable ); wTable.addMouseListener( lsMouse ); // set the composite as the control for this page setControl( composite ); }
Example #15
Source File: TextFileImportWizardPage1.java From hop with Apache License 2.0 | 5 votes |
public void createControl( Composite parent ) { // create the composite to hold the widgets Composite composite = new Composite( parent, SWT.NONE ); props.setLook( composite ); FormLayout compLayout = new FormLayout(); compLayout.marginHeight = Const.FORM_MARGIN; compLayout.marginWidth = Const.FORM_MARGIN; composite.setLayout( compLayout ); MouseAdapter lsMouse = new MouseAdapter() { public void mouseDown( MouseEvent e ) { int s = getSize(); setPageComplete( s > 0 ); } }; wTable = new TableDraw( composite, props, this, fields ); wTable.setRows( rows ); props.setLook( wTable ); wTable.setFields( fields ); fdTable = new FormData(); fdTable.left = new FormAttachment( 0, 0 ); fdTable.right = new FormAttachment( 100, 0 ); fdTable.top = new FormAttachment( 0, 0 ); fdTable.bottom = new FormAttachment( 100, 0 ); wTable.setLayoutData( fdTable ); wTable.addMouseListener( lsMouse ); // set the composite as the control for this page setControl( composite ); }
Example #16
Source File: TextFileImportWizardPage1.java From hop with Apache License 2.0 | 5 votes |
public void createControl( Composite parent ) { // create the composite to hold the widgets Composite composite = new Composite( parent, SWT.NONE ); props.setLook( composite ); FormLayout compLayout = new FormLayout(); compLayout.marginHeight = Const.FORM_MARGIN; compLayout.marginWidth = Const.FORM_MARGIN; composite.setLayout( compLayout ); MouseAdapter lsMouse = new MouseAdapter() { public void mouseDown( MouseEvent e ) { int s = getSize(); setPageComplete( s > 0 ); } }; wTable = new TableDraw( composite, props, this, fields ); wTable.setRows( rows ); props.setLook( wTable ); wTable.setFields( fields ); fdTable = new FormData(); fdTable.left = new FormAttachment( 0, 0 ); fdTable.right = new FormAttachment( 100, 0 ); fdTable.top = new FormAttachment( 0, 0 ); fdTable.bottom = new FormAttachment( 100, 0 ); wTable.setLayoutData( fdTable ); wTable.addMouseListener( lsMouse ); // set the composite as the control for this page setControl( composite ); }
Example #17
Source File: BeamJobConfigDialog.java From kettle-beam with Apache License 2.0 | 5 votes |
private void addParametersTab() { wParametersTab = new CTabItem( wTabFolder, SWT.NONE ); wParametersTab.setText( "Parameters" ); wParametersComp = new Composite( wTabFolder, SWT.NO_BACKGROUND ); props.setLook( wParametersComp ); wParametersComp.setLayout( new FormLayout() ); ColumnInfo[] columnInfos = new ColumnInfo[] { new ColumnInfo( "Name", ColumnInfo.COLUMN_TYPE_TEXT, false, false ), new ColumnInfo( "Value", ColumnInfo.COLUMN_TYPE_TEXT, false, false ), }; wParameters = new TableView( space, wParametersComp, SWT.BORDER, columnInfos, config.getParameters().size(), null, props ); props.setLook( wParameters ); FormData fdParameters = new FormData(); fdParameters.left = new FormAttachment( 0, 0 ); fdParameters.right = new FormAttachment( 100, 0 ); fdParameters.top = new FormAttachment( 0, 0 ); fdParameters.bottom = new FormAttachment( 100, 0 ); wParameters.setLayoutData( fdParameters ); FormData fdParametersComp = new FormData(); fdParametersComp.left = new FormAttachment( 0, 0 ); fdParametersComp.right = new FormAttachment( 100, 0 ); fdParametersComp.top = new FormAttachment( 0, 0 ); fdParametersComp.bottom = new FormAttachment( 100, 0 ); wParametersComp.setLayoutData( fdParametersComp ); wParametersTab.setControl( wParametersComp ); }
Example #18
Source File: SnippetCompositeTableDataBinding.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void doLayout() { setLayout(new FormLayout()); Label lblName = new Label(this, SWT.CENTER); lblName.setText("Name"); int index = 0; FormData data = new FormData(); data.left = new FormAttachment(cols[index], 100, 5); data.right = new FormAttachment(cols[index + 1], 100, 0); data.top = new FormAttachment(0, 100, 5); lblName.setLayoutData(data); index++; Label lblFirstname = new Label(this, SWT.CENTER); lblFirstname.setText("Firstname"); data = new FormData(); data.left = new FormAttachment(cols[index], 100, 5); data.right = new FormAttachment(cols[index + 1], 100, 0); data.top = new FormAttachment(0, 100, 5); lblFirstname.setLayoutData(data); index++; Label lblAction = new Label(this, SWT.CENTER); lblAction.setText("Action"); data = new FormData(); data.left = new FormAttachment(cols[index], 100, 5); data.right = new FormAttachment(cols[index + 1], 100, 0); data.top = new FormAttachment(0, 100, 5); lblAction.setLayoutData(data); }
Example #19
Source File: SnippetCompositeTableDataBinding.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void doLayout() { lastname = new Text(this, SWT.BORDER); firstname = new Text(this, SWT.BORDER); action = new Button(this, SWT.NONE); action.setText("Delete"); setLayout(new FormLayout()); // column index int index = 0; FormData data = new FormData(); data.top = new FormAttachment(0, 100, 5); data.left = new FormAttachment(cols[index], 100, 5); data.right = new FormAttachment(cols[index + 1], 100, 0); lastname.setLayoutData(data); index++; data = new FormData(); data.top = new FormAttachment(0, 100, 5); data.left = new FormAttachment(cols[index], 100, 5); data.right = new FormAttachment(cols[index + 1], 100, 0); firstname.setLayoutData(data); index++; data = new FormData(); data.top = new FormAttachment(0, 100, 5); data.left = new FormAttachment(cols[index], 100, 5); data.right = new FormAttachment(cols[index + 1], 100, 0); action.setLayoutData(data); index++; }
Example #20
Source File: SnippetCompositeTableDataBinding.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void doLayout() { setLayout(new FormLayout()); table = new CompositeTable(this, SWT.NULL); table.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); new Header(table, SWT.NULL); new Row(table, SWT.NULL); addNew = new Button(this, SWT.NONE); addNew.setText("Add new Hero"); addNew.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PersonTitleAreaDialog d = new PersonTitleAreaDialog(getShell()); d.open(); final int result = d.getReturnCode(); if (result == Window.OK) { Hero p = d.getHero(); getModel().addHero(p); } } }); FormData data = new FormData(); data.left = new FormAttachment(0, 100, 5); data.right = new FormAttachment(100, 100, -5); data.top = new FormAttachment(0, 100, 5); data.bottom = new FormAttachment(addNew, -5, SWT.TOP); table.setLayoutData(data); table.setRunTime(true); data = new FormData(); data.right = new FormAttachment(100, 100, -5); data.bottom = new FormAttachment(100, 100, -5); addNew.setLayoutData(data); }
Example #21
Source File: Translator.java From hop with Apache License 2.0 | 5 votes |
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[] { 30, 70 } ); sashform.setVisible( true ); shell.pack(); refresh(); wPackages.optWidth( true ); wPackages.getTable().getColumn( 1 ).setWidth( 1 ); BaseTransformDialog.setSize( shell); shell.open(); }
Example #22
Source File: SnippetCompositeTableDataBinding.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Main entry point. * * @param args */ public static void main(String[] args) { final Display display = new Display(); Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() { public void run() { Shell shell = new Shell(display); shell.setText("Jules Verne's Heroes"); shell.setBounds(0, 0, 400, 200); shell.setLayout(new FormLayout()); // creation of the composite containing the table MainCompo compo = new MainCompo(shell, SWT.NONE); // position it on the shell FormData data = new FormData(); data.left = new FormAttachment(0, 100, 5); data.right = new FormAttachment(100, 100, -5); data.top = new FormAttachment(0, 100, 5); data.bottom = new FormAttachment(100, 100, -5); compo.setLayoutData(data); // add some data to the model populateModel(compo.getModel()); // binding the UI with the model compo.binding(); // start the UI shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } }); display.dispose(); }
Example #23
Source File: CheckstylePropertyPage.java From eclipse-cs with GNU Lesser General Public License v2.1 | 5 votes |
/** * Creates the file sets area. * * @param fileSetsContainer * the container to add the file sets area to */ private Control createFileSetsArea(Composite fileSetsContainer) throws CheckstylePluginException { Control[] controls = fileSetsContainer.getChildren(); for (int i = 0; i < controls.length; i++) { controls[i].dispose(); } if (mProjectConfig.isUseSimpleConfig()) { mFileSetsEditor = new SimpleFileSetsEditor(this); } else { mFileSetsEditor = new ComplexFileSetsEditor(this); } mFileSetsEditor.setFileSets(mProjectConfig.getFileSets()); final Control editor = mFileSetsEditor.createContents(mFileSetsContainer); fileSetsContainer.setLayout(new FormLayout()); FormData fd = new FormData(); fd.left = new FormAttachment(0); fd.top = new FormAttachment(0); fd.right = new FormAttachment(100); fd.bottom = new FormAttachment(100); editor.setLayoutData(fd); return fileSetsContainer; }
Example #24
Source File: CheckstylePreferencePage.java From eclipse-cs with GNU Lesser General Public License v2.1 | 5 votes |
/** * {@inheritDoc} */ @Override public Control createContents(Composite ancestor) { noDefaultAndApplyButton(); // // Build the top level composite with one colume. // Composite parentComposite = new Composite(ancestor, SWT.NULL); FormLayout layout = new FormLayout(); parentComposite.setLayout(layout); // // Create the general section of the screen. // final Composite generalComposite = createGeneralContents(parentComposite); FormData fd = new FormData(); fd.left = new FormAttachment(0); fd.top = new FormAttachment(0); fd.right = new FormAttachment(100); generalComposite.setLayoutData(fd); // // Create the check configuration section of the screen. // final Composite configComposite = createCheckConfigContents(parentComposite); fd = new FormData(); fd.left = new FormAttachment(0); fd.top = new FormAttachment(generalComposite, 3, SWT.BOTTOM); fd.right = new FormAttachment(100); fd.bottom = new FormAttachment(100); configComposite.setLayoutData(fd); return parentComposite; }
Example #25
Source File: TextFileInputDialog.java From hop with Apache License 2.0 | 4 votes |
private void addFiltersTabs() { // Filters tab... // wFilterTab = new CTabItem( wTabFolder, SWT.NONE ); wFilterTab.setText( BaseMessages.getString( PKG, "TextFileInputDialog.FilterTab.TabTitle" ) ); FormLayout FilterLayout = new FormLayout(); FilterLayout.marginWidth = Const.FORM_MARGIN; FilterLayout.marginHeight = Const.FORM_MARGIN; wFilterComp = new Composite( wTabFolder, SWT.NONE ); wFilterComp.setLayout( FilterLayout ); props.setLook( wFilterComp ); final int FilterRows = input.getFilter().length; ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterStringColumn.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositionColumn.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.StopOnFilterColumn.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO ), new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositiveColumn.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO ) }; colinf[ 2 ].setToolTip( BaseMessages.getString( PKG, "TextFileInputDialog.StopOnFilterColumn.Tooltip" ) ); colinf[ 3 ].setToolTip( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositiveColumn.Tooltip" ) ); wFilter = new TableView( pipelineMeta, wFilterComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FilterRows, lsMod, props ); fdFilter = new FormData(); fdFilter.left = new FormAttachment( 0, 0 ); fdFilter.top = new FormAttachment( 0, 0 ); fdFilter.right = new FormAttachment( 100, 0 ); fdFilter.bottom = new FormAttachment( 100, 0 ); wFilter.setLayoutData( fdFilter ); fdFilterComp = new FormData(); fdFilterComp.left = new FormAttachment( 0, 0 ); fdFilterComp.top = new FormAttachment( 0, 0 ); fdFilterComp.right = new FormAttachment( 100, 0 ); fdFilterComp.bottom = new FormAttachment( 100, 0 ); wFilterComp.setLayoutData( fdFilterComp ); wFilterComp.layout(); wFilterTab.setControl( wFilterComp ); }
Example #26
Source File: AbortDialog.java From hop with Apache License 2.0 | 4 votes |
private void buildOptions( Control widgetAbove ) { wOptionsGroup = new Group( shell, SWT.SHADOW_ETCHED_IN ); props.setLook( wOptionsGroup ); wOptionsGroup.setText( BaseMessages.getString( PKG, "AbortDialog.Options.Group.Label" ) ); FormLayout flOptionsGroup = new FormLayout(); flOptionsGroup.marginHeight = 15; flOptionsGroup.marginWidth = 15; wOptionsGroup.setLayout( flOptionsGroup ); FormData fdOptionsGroup = new FormData(); fdOptionsGroup.left = new FormAttachment( 0, 0 ); fdOptionsGroup.top = new FormAttachment( widgetAbove, 15 ); fdOptionsGroup.right = new FormAttachment( 100, 0 ); wOptionsGroup.setLayoutData( fdOptionsGroup ); wAbortButton = new Button( wOptionsGroup, SWT.RADIO ); wAbortButton.addSelectionListener( lsSelMod ); wAbortButton.setText( BaseMessages.getString( PKG, "AbortDialog.Options.Abort.Label" ) ); FormData fdAbort = new FormData(); fdAbort.left = new FormAttachment( 0, 0 ); fdAbort.top = new FormAttachment( 0, 0 ); wAbortButton.setLayoutData( fdAbort ); props.setLook( wAbortButton ); wAbortWithErrorButton = new Button( wOptionsGroup, SWT.RADIO ); wAbortWithErrorButton.addSelectionListener( lsSelMod ); wAbortWithErrorButton.setText( BaseMessages.getString( PKG, "AbortDialog.Options.AbortWithError.Label" ) ); FormData fdAbortWithError = new FormData(); fdAbortWithError.left = new FormAttachment( 0, 0 ); fdAbortWithError.top = new FormAttachment( wAbortButton, 10 ); wAbortWithErrorButton.setLayoutData( fdAbortWithError ); props.setLook( wAbortWithErrorButton ); wSafeStopButton = new Button( wOptionsGroup, SWT.RADIO ); wSafeStopButton.addSelectionListener( lsSelMod ); wSafeStopButton.setText( BaseMessages.getString( PKG, "AbortDialog.Options.SafeStop.Label" ) ); FormData fdSafeStop = new FormData(); fdSafeStop.left = new FormAttachment( 0, 0 ); fdSafeStop.top = new FormAttachment( wAbortWithErrorButton, 10 ); wSafeStopButton.setLayoutData( fdSafeStop ); props.setLook( wSafeStopButton ); wlRowThreshold = new Label( wOptionsGroup, SWT.RIGHT ); wlRowThreshold.setText( BaseMessages.getString( PKG, "AbortDialog.Options.RowThreshold.Label" ) ); props.setLook( wlRowThreshold ); fdlRowThreshold = new FormData(); fdlRowThreshold.left = new FormAttachment( 0, 0 ); fdlRowThreshold.top = new FormAttachment( wSafeStopButton, 10 ); wlRowThreshold.setLayoutData( fdlRowThreshold ); wRowThreshold = new TextVar( pipelineMeta, wOptionsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wRowThreshold.setText( "" ); props.setLook( wRowThreshold ); wRowThreshold.addModifyListener( lsMod ); wRowThreshold.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Options.RowThreshold.Tooltip" ) ); fdRowThreshold = new FormData(); fdRowThreshold.left = new FormAttachment( 0, 0 ); fdRowThreshold.top = new FormAttachment( wlRowThreshold, 5 ); fdRowThreshold.width = 174; wRowThreshold.setLayoutData( fdRowThreshold ); }
Example #27
Source File: WorkflowExecutorDialog.java From hop with Apache License 2.0 | 4 votes |
private void addRowGroupTab() { final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE ); wTab.setText( BaseMessages.getString( PKG, "JobExecutorDialog.RowGroup.Title" ) ); wTab.setToolTipText( BaseMessages.getString( PKG, "JobExecutorDialog.RowGroup.Tooltip" ) ); Composite wInputComposite = new Composite( wTabFolder, SWT.NONE ); props.setLook( wInputComposite ); FormLayout tabLayout = new FormLayout(); tabLayout.marginWidth = 15; tabLayout.marginHeight = 15; wInputComposite.setLayout( tabLayout ); // Group size // wlGroupSize = new Label( wInputComposite, SWT.RIGHT ); props.setLook( wlGroupSize ); wlGroupSize.setText( BaseMessages.getString( PKG, "JobExecutorDialog.GroupSize.Label" ) ); FormData fdlGroupSize = new FormData(); fdlGroupSize.top = new FormAttachment( 0, 0 ); fdlGroupSize.left = new FormAttachment( 0, 0 ); wlGroupSize.setLayoutData( fdlGroupSize ); wGroupSize = new TextVar( pipelineMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wGroupSize ); wGroupSize.addModifyListener( lsMod ); FormData fdGroupSize = new FormData(); fdGroupSize.width = 250; fdGroupSize.top = new FormAttachment( wlGroupSize, 5 ); fdGroupSize.left = new FormAttachment( 0, 0 ); wGroupSize.setLayoutData( fdGroupSize ); // Group field // wlGroupField = new Label( wInputComposite, SWT.RIGHT ); props.setLook( wlGroupField ); wlGroupField.setText( BaseMessages.getString( PKG, "JobExecutorDialog.GroupField.Label" ) ); FormData fdlGroupField = new FormData(); fdlGroupField.top = new FormAttachment( wGroupSize, 10 ); fdlGroupField.left = new FormAttachment( 0, 0 ); wlGroupField.setLayoutData( fdlGroupField ); wGroupField = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wGroupField ); wGroupField.addModifyListener( lsMod ); FormData fdGroupField = new FormData(); fdGroupField.width = 250; fdGroupField.top = new FormAttachment( wlGroupField, 5 ); fdGroupField.left = new FormAttachment( 0, 0 ); wGroupField.setLayoutData( fdGroupField ); // Group time // wlGroupTime = new Label( wInputComposite, SWT.RIGHT ); props.setLook( wlGroupTime ); wlGroupTime.setText( BaseMessages.getString( PKG, "JobExecutorDialog.GroupTime.Label" ) ); FormData fdlGroupTime = new FormData(); fdlGroupTime.top = new FormAttachment( wGroupField, 10 ); fdlGroupTime.left = new FormAttachment( 0, 0 ); // First one in the left wlGroupTime.setLayoutData( fdlGroupTime ); wGroupTime = new TextVar( pipelineMeta, wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wGroupTime ); wGroupTime.addModifyListener( lsMod ); FormData fdGroupTime = new FormData(); fdGroupTime.width = 250; fdGroupTime.top = new FormAttachment( wlGroupTime, 5 ); fdGroupTime.left = new FormAttachment( 0, 0 ); wGroupTime.setLayoutData( fdGroupTime ); wTab.setControl( wInputComposite ); wTabFolder.setSelection( wTab ); }
Example #28
Source File: BeamPerspective.java From kettle-beam with Apache License 2.0 | 4 votes |
private void addAdminTab() throws Exception { final XulTabAndPanel tabAndPanel = createTab(); tabAndPanel.tab.setLabel( "Admin" ); PropsUI props = PropsUI.getInstance(); final Composite comp = (Composite) tabAndPanel.panel.getManagedObject(); props.setLook( comp ); comp.setLayout( new FillLayout() ); ScrolledComposite scrolledComposite = new ScrolledComposite( comp, SWT.V_SCROLL | SWT.H_SCROLL ); props.setLook( scrolledComposite ); scrolledComposite.setLayout( new FillLayout() ); final Composite parentComposite = new Composite( scrolledComposite, SWT.NONE ); props.setLook( parentComposite ); FormLayout formLayout = new FormLayout(); formLayout.marginLeft = 10; formLayout.marginRight = 10; formLayout.marginTop = 10; formLayout.marginBottom = 10; formLayout.spacing = Const.MARGIN; parentComposite.setLayout( formLayout ); parentComposite.layout( true ); parentComposite.pack(); // What's the size: Rectangle bounds = parentComposite.getBounds(); scrolledComposite.setContent( parentComposite ); scrolledComposite.setExpandHorizontal( true ); scrolledComposite.setExpandVertical( true ); scrolledComposite.setMinWidth( bounds.width ); scrolledComposite.setMinHeight( bounds.height ); comp.layout(); }
Example #29
Source File: JsonInputDialog.java From hop with Apache License 2.0 | 4 votes |
private void addFieldsTab() { // Fields tab... // CTabItem wFieldsTab = new CTabItem( wTabFolder, SWT.NONE ); wFieldsTab.setText( BaseMessages.getString( PKG, "JsonInputDialog.Fields.Tab" ) ); FormLayout fieldsLayout = new FormLayout(); fieldsLayout.marginWidth = Const.FORM_MARGIN; fieldsLayout.marginHeight = Const.FORM_MARGIN; Composite wFieldsComp = new Composite( wTabFolder, SWT.NONE ); wFieldsComp.setLayout( fieldsLayout ); props.setLook( wFieldsComp ); wGet = new Button( wFieldsComp, SWT.PUSH ); wGet.setText( BaseMessages.getString( PKG, "JsonInputDialog.Button.SelectFields" ) ); fdGet = new FormData(); fdGet.left = new FormAttachment( 50, 0 ); fdGet.bottom = new FormAttachment( 100, 0 ); wGet.setLayoutData( fdGet ); setButtonPositions( new Button[] { wGet }, margin, null ); final int FieldsRows = input.getInputFields().length; ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Name.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Path.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Type.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames(), true ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Format.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getConversionFormats() ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Length.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Precision.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Currency.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Decimal.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Group.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.TrimType.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaBase.trimTypeDesc, true ), new ColumnInfo( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Repeat.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { BaseMessages.getString( PKG, "System.Combo.Yes" ), BaseMessages.getString( PKG, "System.Combo.No" ) }, true ), }; colinf[ 0 ].setUsingVariables( true ); colinf[ 0 ].setToolTip( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Name.Column.Tooltip" ) ); colinf[ 1 ].setUsingVariables( true ); colinf[ 1 ].setToolTip( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Path.Column.Tooltip" ) ); wFields = new TableView( pipelineMeta, wFieldsComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FieldsRows, lsMod, props ); FormData fdFields = new FormData(); fdFields.left = new FormAttachment( 0, 0 ); fdFields.top = new FormAttachment( 0, 0 ); fdFields.right = new FormAttachment( 100, 0 ); fdFields.bottom = new FormAttachment( wGet, -margin ); wFields.setLayoutData( fdFields ); FormData fdFieldsComp = new FormData(); fdFieldsComp.left = new FormAttachment( 0, 0 ); fdFieldsComp.top = new FormAttachment( 0, 0 ); fdFieldsComp.right = new FormAttachment( 100, 0 ); fdFieldsComp.bottom = new FormAttachment( 100, 0 ); wFieldsComp.setLayoutData( fdFieldsComp ); wFieldsComp.layout(); wFieldsTab.setControl( wFieldsComp ); }
Example #30
Source File: AbortDialog.java From hop with Apache License 2.0 | 4 votes |
private void buildLogging( Composite widgetAbove ) { wLoggingGroup = new Group( shell, SWT.SHADOW_ETCHED_IN ); props.setLook( wLoggingGroup ); wLoggingGroup.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.Group" ) ); FormLayout flLoggingGroup = new FormLayout(); flLoggingGroup.marginHeight = 15; flLoggingGroup.marginWidth = 15; wLoggingGroup.setLayout( flLoggingGroup ); FormData fdLoggingGroup = new FormData(); fdLoggingGroup.left = new FormAttachment( 0, 0 ); fdLoggingGroup.top = new FormAttachment( widgetAbove, 15 ); fdLoggingGroup.right = new FormAttachment( 100, 0 ); fdLoggingGroup.bottom = new FormAttachment( hSpacer, -15 ); wLoggingGroup.setLayoutData( fdLoggingGroup ); wlMessage = new Label( wLoggingGroup, SWT.RIGHT ); wlMessage.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.AbortMessage.Label" ) ); props.setLook( wlMessage ); fdlMessage = new FormData(); fdlMessage.left = new FormAttachment( 0, 0 ); fdlMessage.top = new FormAttachment( 0, 0 ); wlMessage.setLayoutData( fdlMessage ); wMessage = new TextVar( pipelineMeta, wLoggingGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wMessage.setText( "" ); props.setLook( wMessage ); wMessage.addModifyListener( lsMod ); wMessage.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Logging.AbortMessage.Tooltip" ) ); fdMessage = new FormData(); fdMessage.left = new FormAttachment( 0, 0 ); fdMessage.top = new FormAttachment( wlMessage, 5 ); fdMessage.right = new FormAttachment( 100, 0 ); wMessage.setLayoutData( fdMessage ); wAlwaysLogRows = new Button( wLoggingGroup, SWT.CHECK ); wAlwaysLogRows.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.AlwaysLogRows.Label" ) ); props.setLook( wAlwaysLogRows ); wAlwaysLogRows.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Logging.AlwaysLogRows.Tooltip" ) ); fdAlwaysLogRows = new FormData(); fdAlwaysLogRows.left = new FormAttachment( 0, 0 ); fdAlwaysLogRows.top = new FormAttachment( wMessage, 10 ); wAlwaysLogRows.setLayoutData( fdAlwaysLogRows ); wAlwaysLogRows.addSelectionListener( lsSelMod ); }