Search in sources :

Example 26 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class LoginProjectPage method layoutControl.

@Override
protected void layoutControl() {
    /**
         * 2. Layout all the control
         */
    super.layoutControl();
    FormData formData = null;
    /**
         * 2.1 Layout Bottom Navigation Area
         */
    layoutNavigatorArea();
    /**
         * 2.2 Layout Connection Area
         */
    formData = new FormData();
    formData.top = new FormAttachment(0, 0);
    formData.left = new FormAttachment(0, 0);
    title.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(title, TAB_VERTICAL_PADDING_LEVEL_2, SWT.BOTTOM);
    formData.left = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);
    connectionManageArea.setLayoutData(formData);
    GridLayout gridLayout = new GridLayout(2, true);
    gridLayout.horizontalSpacing = TAB_HORIZONTAL_PADDING_LEVEL_2;
    gridLayout.verticalSpacing = 0;
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;
    connectionManageArea.setLayout(gridLayout);
    // formData = new FormData();
    // formData.top = new FormAttachment(title, TAB_VERTICAL_PADDING_LEVEL_2, SWT.BOTTOM);
    // formData.right = new FormAttachment(100, 0);
    // formData.left = new FormAttachment(100, -1 * LoginDialogV2.getNewButtonSize(manageButton).x);
    // manageButton.setLayoutData(formData);
    GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
    manageButton.setLayoutData(gridData);
    // formData = new FormData();
    // formData.top = new FormAttachment(manageButton, 0, SWT.CENTER);
    // formData.bottom = new FormAttachment(manageButton, 0, SWT.CENTER);
    // formData.left = new FormAttachment(title, 0, SWT.LEFT);
    // formData.right = new FormAttachment(manageButton, -1 * TAB_HORIZONTAL_PADDING_LEVEL_2, SWT.LEFT);
    // connectionsViewer.getControl().setLayoutData(formData);
    gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
    connectionsViewer.getControl().setLayoutData(gridData);
    connectionsViewer.setContentProvider(ArrayContentProvider.getInstance());
    connectionsViewer.setLabelProvider(new ConnectionLabelProvider());
    /**
         * 2.3 Layout Project Operation Area
         */
    int operationButtonPadding = 6;
    formData = new FormData();
    // formData.top = new FormAttachment(manageButton, 0, SWT.BOTTOM);
    formData.top = new FormAttachment(connectionManageArea, 0, SWT.BOTTOM);
    formData.bottom = new FormAttachment(navigateArea, 0, SWT.TOP);
    // formData.left = new FormAttachment(connectionsViewer.getControl(), 0, SWT.LEFT);
    formData.left = new FormAttachment(connectionManageArea, 0, SWT.LEFT);
    formData.right = new FormAttachment(100, 0);
    projectOperationArea.setLayout(new FormLayout());
    projectOperationArea.setLayoutData(formData);
    formData = new FormData();
    formData.bottom = new FormAttachment(100, -1 * TAB_VERTICAL_PADDING_LEVEL_1);
    formData.left = new FormAttachment(0, 0);
    createSandBoxProject.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(createSandBoxProject, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(createSandBoxProject, 0, SWT.CENTER);
    formData.right = new FormAttachment(100, -1 * TAB_HORIZONTAL_PADDING_LEVEL_1);
    formData.width = LoginDialogV2.getNewButtonSize(executeCreateSandBoxProject, operationButtonPadding).x;
    executeCreateSandBoxProject.setLayoutData(formData);
    formData = new FormData();
    formData.bottom = new FormAttachment(createSandBoxProject, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    formData.left = new FormAttachment(0, 0);
    importLocalProject.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(importLocalProject, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(importLocalProject, 0, SWT.CENTER);
    formData.right = new FormAttachment(100, -1 * TAB_HORIZONTAL_PADDING_LEVEL_1);
    formData.width = LoginDialogV2.getNewButtonSize(executeImportLocalProject, operationButtonPadding).x;
    executeImportLocalProject.setLayoutData(formData);
    formData = new FormData();
    formData.bottom = new FormAttachment(importLocalProject, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    formData.left = new FormAttachment(0, 0);
    importDemoProject.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(importDemoProject, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(importDemoProject, 0, SWT.CENTER);
    formData.right = new FormAttachment(100, -1 * TAB_HORIZONTAL_PADDING_LEVEL_1);
    formData.width = LoginDialogV2.getNewButtonSize(executeImportDemoProject, operationButtonPadding).x;
    executeImportDemoProject.setLayoutData(formData);
    formData = new FormData();
    formData.bottom = new FormAttachment(importDemoProject, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    formData.left = new FormAttachment(0, 0);
    createNewProject.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(createNewProject, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(createNewProject, 0, SWT.CENTER);
    formData.right = new FormAttachment(100, -1 * TAB_HORIZONTAL_PADDING_LEVEL_1);
    formData.width = LoginDialogV2.getNewButtonSize(executeCreateNewProject, operationButtonPadding).x;
    executeCreateNewProject.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(createNewProject, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(createNewProject, 0, SWT.CENTER);
    formData.right = new FormAttachment(executeCreateNewProject, -1 * TAB_HORIZONTAL_PADDING_LEVEL_2, SWT.LEFT);
    formData.left = new FormAttachment(createNewProject, TAB_HORIZONTAL_PADDING_LEVEL_2, SWT.RIGHT);
    newProjectName.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(0, TAB_VERTICAL_PADDING_LEVEL_1);
    formData.left = new FormAttachment(0, 0);
    selectExistingProject.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(0, TAB_HORIZONTAL_PADDING_LEVEL_1);
    formData.right = new FormAttachment(100, 0);
    formData.top = new FormAttachment(selectExistingProject, TAB_VERTICAL_PADDING_LEVEL_2, SWT.BOTTOM);
    formData.bottom = new FormAttachment(createNewProject, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    projectListArea.setLayoutData(formData);
    layoutProjectListArea();
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormLayout(org.eclipse.swt.layout.FormLayout) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) FormAttachment(org.eclipse.swt.layout.FormAttachment) Point(org.eclipse.swt.graphics.Point)

Example 27 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class LoginProjectPage method layoutProjectListArea.

protected void layoutProjectListArea() {
    projectListArea.setLayout(new FormLayout());
    FormData formData = null;
    /**
         * BranchArea layout
         */
    formData = new FormData();
    formData.left = new FormAttachment(0, TAB_HORIZONTAL_PADDING_LEVEL_3);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(100, 0);
    branchArea.setLayoutData(formData);
    branchArea.setLayout(new FormLayout());
    int svnBranchLabelWidth = branchLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
    int refreshButtonWidth = refreshProjectButton.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
    formData = new FormData();
    formData.bottom = new FormAttachment(100, 0);
    formData.right = new FormAttachment(100, -1 * refreshButtonWidth - TAB_HORIZONTAL_PADDING_LEVEL_2);
    formData.left = new FormAttachment(0, svnBranchLabelWidth + TAB_HORIZONTAL_PADDING_LEVEL_2);
    Control svnBranchComboControl = branchesViewer.getControl();
    svnBranchComboControl.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
    formData.left = new FormAttachment(0, 0);
    branchLabel.setLayoutData(formData);
    formData = new FormData();
    formData.right = new FormAttachment(100, 0);
    if (EnvironmentUtils.isWindowsSystem()) {
        formData.top = new FormAttachment(svnBranchComboControl, -1, SWT.TOP);
        formData.bottom = new FormAttachment(svnBranchComboControl, 1, SWT.BOTTOM);
    } else {
        formData.top = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
        formData.bottom = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
    }
    refreshProjectButton.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(0, 0);
    formData.left = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(branchArea, -1 * TAB_VERTICAL_PADDING_LEVEL_2, SWT.TOP);
    projectViewer.getControl().setLayoutData(formData);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Control(org.eclipse.swt.widgets.Control) FormAttachment(org.eclipse.swt.layout.FormAttachment) Point(org.eclipse.swt.graphics.Point)

Example 28 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class DynamicTabbedPropertySection method createControls.

/*
     * (non-Java)
     * 
     * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#
     * createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
     */
@Override
public void createControls(final Composite parent, final TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    composite = parent;
    FormLayout layout = new FormLayout();
    layout.marginWidth = ITabbedPropertyConstants.HSPACE + 2;
    layout.marginHeight = ITabbedPropertyConstants.VSPACE;
    layout.spacing = ITabbedPropertyConstants.VMARGIN + 1;
    composite.setLayout(layout);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout)

Example 29 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class FooterComposite method createComponents.

/**
     * DOC amaumont Comment method "createComponents".
     */
private void createComponents() {
    FormLayout formLayout = new FormLayout();
    formLayout.spacing = 15;
    this.setLayout(formLayout);
    Button applyButton = new Button(this, SWT.NONE);
    applyButton.setEnabled(!mapperUi.getMapperComponent().isReadOnly());
    //$NON-NLS-1$
    applyButton.setText("Apply");
    FormData applyFormData = new FormData();
    applyFormData.width = 100;
    applyButton.setLayoutData(applyFormData);
    applyButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            mapperUi.closeMapperDialog(SWT.APPLICATION_MODAL);
        }
    });
    statusBar = new StatusBar(this, SWT.NONE);
    final ProblemsAnalyser problemsAnalyser = mapperUi.getMapperManager().getProblemsAnalyser();
    if (!problemsAnalyser.getProblems().isEmpty()) {
        statusBar.setValues(STATUS.ERROR, problemsAnalyser.getErrorMessage());
    }
    Button okButton = new Button(this, SWT.NONE);
    okButton.setEnabled(!mapperUi.getMapperComponent().isReadOnly());
    //$NON-NLS-1$
    okButton.setText("OK");
    FormData okFormData = new FormData();
    okFormData.width = 100;
    okButton.setLayoutData(okFormData);
    okButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            mapperUi.closeMapperDialog(SWT.OK);
        }
    });
    Button cancelButton = new Button(this, SWT.NONE);
    //$NON-NLS-1$
    cancelButton.setText("Cancel");
    cancelButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            mapperUi.closeMapperDialog(SWT.CANCEL);
        }
    });
    FormData cancelFormData = new FormData();
    cancelFormData.width = 100;
    cancelButton.setLayoutData(cancelFormData);
    cancelFormData.right = new FormAttachment(100, -5);
    okFormData.right = new FormAttachment(cancelButton, -5);
    applyFormData.right = new FormAttachment(okButton, -5);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ProblemsAnalyser(org.talend.designer.xmlmap.util.problem.ProblemsAnalyser) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 30 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class InputTablesZoneView method initLayout.

@Override
public Layout initLayout() {
    formLayout = new FormLayout();
    formLayout.marginLeft = 30;
    formLayout.marginRight = 40;
    formLayout.marginTop = MARGIN_TOP_ZONE_WITHOUT_ACTION_BAR;
    formLayout.marginBottom = 10;
    formLayout.marginWidth = 0;
    formLayout.marginHeight = 0;
    formLayout.spacing = 10;
    setLayout(formLayout);
    return formLayout;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout)

Aggregations

FormLayout (org.eclipse.swt.layout.FormLayout)726 FormData (org.eclipse.swt.layout.FormData)651 FormAttachment (org.eclipse.swt.layout.FormAttachment)649 Label (org.eclipse.swt.widgets.Label)503 Button (org.eclipse.swt.widgets.Button)484 SelectionEvent (org.eclipse.swt.events.SelectionEvent)444 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)407 Text (org.eclipse.swt.widgets.Text)390 Composite (org.eclipse.swt.widgets.Composite)384 Shell (org.eclipse.swt.widgets.Shell)365 ModifyListener (org.eclipse.swt.events.ModifyListener)355 Listener (org.eclipse.swt.widgets.Listener)354 Event (org.eclipse.swt.widgets.Event)352 ModifyEvent (org.eclipse.swt.events.ModifyEvent)350 Display (org.eclipse.swt.widgets.Display)343 ShellEvent (org.eclipse.swt.events.ShellEvent)335 ShellAdapter (org.eclipse.swt.events.ShellAdapter)330 TextVar (org.pentaho.di.ui.core.widget.TextVar)220 ColumnInfo (org.pentaho.di.ui.core.widget.ColumnInfo)200 TableView (org.pentaho.di.ui.core.widget.TableView)198