Search in sources :

Example 11 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project generator by mybatis.

the class AbstractGeneratorComposite method createFileNameBrowseButtons.

private void createFileNameBrowseButtons(Composite parent) {
    new Label(parent, SWT.NONE);
    Composite buttonComposite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    buttonComposite.setLayout(layout);
    GridData gd = new GridData(SWT.END, SWT.CENTER, false, false);
    buttonComposite.setLayoutData(gd);
    buttonComposite.setFont(parent.getFont());
    btnBrowseWorkplace = new Button(buttonComposite, SWT.NONE);
    btnBrowseWorkplace.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            IResource chosenFile = chooseFileFromWorkspace();
            if (chosenFile != null) {
                IPath path = chosenFile.getFullPath();
                //$NON-NLS-1$ //$NON-NLS-2$
                txtFileName.setText("${workspace_loc:" + path.toString() + "}");
                javaProjectName = GeneratorLaunchShortcut.getJavaProjectNameFromResource(chosenFile);
            }
        }
    });
    btnBrowseWorkplace.setText(Messages.FILE_PICKER_BROWSE_WORKSPACE);
    btnBrowseFileSystem = new Button(buttonComposite, SWT.NONE);
    btnBrowseFileSystem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            chooseFileFromFileSystem();
        }
    });
    btnBrowseFileSystem.setText(Messages.FILE_PICKER_BROWSE_FILE_SYSTEM);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) IPath(org.eclipse.core.runtime.IPath) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IResource(org.eclipse.core.resources.IResource)

Example 12 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project generator by mybatis.

the class AbstractGeneratorComposite method createFileNameGroup.

protected Composite createFileNameGroup(Composite parent, String groupText) {
    Group group = new Group(parent, SWT.NONE);
    group.setText(groupText);
    GridLayout groupLayout = new GridLayout(2, false);
    group.setLayout(groupLayout);
    group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    group.setFont(parent.getFont());
    createFileNameTextbox(group);
    createFileNameBrowseButtons(group);
    return group;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData)

Example 13 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project generator by mybatis.

the class SqlScriptComposite method createConnectionGroup.

private void createConnectionGroup(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText(Messages.SQL_SCRIPT_TAB_JDBC_CONNECTION_GROUP_TITLE);
    GridLayout groupLayout = new GridLayout(2, false);
    group.setLayout(groupLayout);
    group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    group.setFont(parent.getFont());
    Label lblJdbcDriverClass = new Label(group, SWT.NONE);
    lblJdbcDriverClass.setText(Messages.SQL_SCRIPT_TAB_JDBC_DRIVER_LABEL);
    new Label(group, SWT.NONE);
    txtJdbcDriver = new Text(group, SWT.BORDER);
    txtJdbcDriver.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtJdbcDriver = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtJdbcDriver.horizontalIndent = 30;
    txtJdbcDriver.setLayoutData(gd_txtJdbcDriver);
    new Label(group, SWT.NONE);
    Label lblJdbcUrl = new Label(group, SWT.NONE);
    lblJdbcUrl.setText(Messages.SQL_SCRIPT_TAB_JDBC_URL_LABEL);
    new Label(group, SWT.NONE);
    txtJdbcURL = new Text(group, SWT.BORDER);
    txtJdbcURL.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtJdbcURL = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtJdbcURL.horizontalIndent = 30;
    txtJdbcURL.setLayoutData(gd_txtJdbcURL);
    new Label(group, SWT.NONE);
    Label lblUserId = new Label(group, SWT.NONE);
    lblUserId.setText(Messages.SQL_SCRIPT_TAB_USERID_LABEL);
    new Label(group, SWT.NONE);
    txtUserID = new Text(group, SWT.BORDER);
    txtUserID.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtUserID = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtUserID.horizontalIndent = 30;
    txtUserID.setLayoutData(gd_txtUserID);
    new Label(group, SWT.NONE);
    Label lblPassword = new Label(group, SWT.NONE);
    lblPassword.setText(Messages.SQL_SCRIPT_TAB_PASSWORD_LABEL);
    new Label(group, SWT.NONE);
    txtPassword = new Text(group, SWT.PASSWORD | SWT.BORDER);
    txtPassword.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    GridData gd_txtPassword = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtPassword.horizontalIndent = 30;
    txtPassword.setLayoutData(gd_txtPassword);
    new Label(group, SWT.NONE);
    btnSecureStorage = new Button(group, SWT.CHECK);
    btnSecureStorage.setText(Messages.SQL_SCRIPT_TAB_SECURE_STORAGE);
    btnSecureStorage.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            sqlScriptTab.updateLaunchConfigurationDialog();
        }
    });
    new Label(group, SWT.NONE);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Text(org.eclipse.swt.widgets.Text)

Example 14 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project mechanoid by robotoworks.

the class NewMechanoidElementPage method createControl.

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    // top level group
    Composite topLevel = new Composite(parent, SWT.NONE);
    topLevel.setLayout(new GridLayout());
    topLevel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
    topLevel.setFont(parent.getFont());
    //PlatformUI.getWorkbench().getHelpSystem().setHelp(topLevel,
    //        IIDEHelpContextIds.NEW_FILE_WIZARD_PAGE);
    createFields(topLevel, parent.getFont());
    setControl(topLevel);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Example 15 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project mechanoid by robotoworks.

the class TextField method addDummyFillerLabel.

protected void addDummyFillerLabel(Composite parent, boolean fillRemainingColumns) {
    //
    if (parent.getLayout() instanceof GridLayout && fillRemainingColumns) {
        GridLayout grid = (GridLayout) parent.getLayout();
        int remainingColumns = grid.numColumns - 2;
        Label dummy = new Label(parent, SWT.NONE);
        GridData dummyData = new GridData(SWT.FILL, SWT.CENTER, false, false);
        dummyData.horizontalSpan = remainingColumns > 1 ? remainingColumns : 1;
        dummy.setLayoutData(dummyData);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Aggregations

GridLayout (org.eclipse.swt.layout.GridLayout)1439 GridData (org.eclipse.swt.layout.GridData)1286 Composite (org.eclipse.swt.widgets.Composite)1098 Label (org.eclipse.swt.widgets.Label)617 SelectionEvent (org.eclipse.swt.events.SelectionEvent)498 Button (org.eclipse.swt.widgets.Button)481 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)429 Text (org.eclipse.swt.widgets.Text)385 Group (org.eclipse.swt.widgets.Group)374 ModifyListener (org.eclipse.swt.events.ModifyListener)164 ModifyEvent (org.eclipse.swt.events.ModifyEvent)161 Combo (org.eclipse.swt.widgets.Combo)150 TableViewer (org.eclipse.jface.viewers.TableViewer)103 Table (org.eclipse.swt.widgets.Table)102 SelectionListener (org.eclipse.swt.events.SelectionListener)94 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)76 FillLayout (org.eclipse.swt.layout.FillLayout)72 Point (org.eclipse.swt.graphics.Point)70 ArrayList (java.util.ArrayList)64 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)61