Search in sources :

Example 51 with FormAttachment

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

the class MemoryRuntimeComposite method createTopGroup.

private Group createTopGroup(Composite parent) {
    Composite topComposite = new Composite(parent, SWT.NULL);
    FormLayout topLayout = new FormLayout();
    FormData topData = new FormData();
    topData.left = new FormAttachment(0, 10);
    topData.right = new FormAttachment(100, 0);
    topData.top = new FormAttachment(0, 0);
    topComposite.setLayout(topLayout);
    topComposite.setLayoutData(topData);
    Group topGroup = new Group(topComposite, SWT.NULL);
    //$NON-NLS-1$
    topGroup.setText("Monitor Control");
    GridLayout groupLayout = new GridLayout(5, false);
    FormData groupData = new FormData();
    groupData.left = new FormAttachment(0, 0);
    groupData.right = new FormAttachment(100, 0);
    groupData.top = new FormAttachment(0, 0);
    groupData.bottom = new FormAttachment(100, 0);
    topGroup.setLayout(groupLayout);
    topGroup.setLayoutData(groupData);
    return topGroup;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) AbstractRuntimeGraphcsComposite(org.talend.designer.runtime.visualization.views.AbstractRuntimeGraphcsComposite) RuntimeGraphcsComposite(org.talend.designer.runtime.visualization.views.RuntimeGraphcsComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 52 with FormAttachment

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

the class AdvanceSettingComposite method createLog4jOptions.

private void createLog4jOptions(Composite parent) {
    customLog4j = new Button(parent, SWT.CHECK);
    //$NON-NLS-1$
    customLog4j.setText(Messages.getString("ProcessComposite.log4jLevel"));
    //$NON-NLS-1$
    customLog4j.setToolTipText(Messages.getString("ProcessComposite.log4jToolTip"));
    FormData layouDatale = new FormData();
    layouDatale.left = new FormAttachment(0, 10);
    layouDatale.right = new FormAttachment(0, 200);
    layouDatale.top = new FormAttachment(watchBtn, 0);
    layouDatale.bottom = new FormAttachment(watchBtn, 50);
    customLog4j.setLayoutData(layouDatale);
    log4jLevel = new Combo(parent, SWT.READ_ONLY);
    //$NON-NLS-1$
    log4jLevel.setText(Messages.getString("ProcessComposite.log4jInfo"));
    log4jLevel.setBackground(parent.getBackground());
    log4jLevel.setItems(Log4jPrefsSettingManager.getLevel());
    log4jLevel.select(2);
    FormData layouDatall = new FormData();
    layouDatall.left = new FormAttachment(0, 200);
    layouDatall.right = new FormAttachment(0, 260);
    layouDatall.top = new FormAttachment(watchBtn, 0);
    layouDatall.bottom = new FormAttachment(watchBtn, 50);
    log4jLevel.setLayoutData(layouDatall);
    log4jLevel.setEnabled(false);
}
Also used : FormData(org.eclipse.swt.layout.FormData) Button(org.eclipse.swt.widgets.Button) Combo(org.eclipse.swt.widgets.Combo) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 53 with FormAttachment

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

the class LoginFirstTimeStartupActionPage method layoutControl.

@Override
protected void layoutControl() {
    super.layoutControl();
    FormData formData = null;
    formData = new FormData();
    formData.left = new FormAttachment(0, 0);
    formData.top = new FormAttachment(0, 0);
    title.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(title, TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
    formData.left = new FormAttachment(title, TAB_HORIZONTAL_PADDING_LEVEL_1, SWT.LEFT);
    createNewProject.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(createNewProject, TAB_HORIZONTAL_PADDING_LEVEL_1, SWT.RIGHT);
    formData.right = new FormAttachment(100, 0);
    formData.top = new FormAttachment(createNewProject, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(createNewProject, 0, SWT.CENTER);
    newProjectName.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(createNewProject, 0, SWT.LEFT);
    formData.top = new FormAttachment(createNewProject, TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
    importDemoProject.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(importDemoProject, 0, SWT.LEFT);
    formData.top = new FormAttachment(importDemoProject, TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
    importExistingProject.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(title, 0, SWT.LEFT);
    formData.width = LoginDialogV2.getNewButtonSize(manageConnections).x;
    formData.bottom = new FormAttachment(navigateArea, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    manageConnections.setLayoutData(formData);
    manageConnections.setBackground(backgroundColor);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 54 with FormAttachment

use of org.eclipse.swt.layout.FormAttachment 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 55 with FormAttachment

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

the class LoginProjectPage method refreshNecessaryVisible.

protected void refreshNecessaryVisible(boolean isRemote) {
    boolean isSVNPluginLoaded = PluginChecker.isSVNProviderPluginLoaded();
    refreshCreateSandboxProjectVisible(isNeedSandboxProject());
    refreshImportLocalProjectVisible(!isRemote);
    refreshImportDemoProjectVisible(!isRemote);
    refreshCreateNewProjectVisible(!isRemote);
    refreshBranchAreaVisible(isSVNPluginLoaded && isRemote);
    Control projectListAreaBottomControl = null;
    if (isSVNPluginLoaded) {
        if (isRemote) {
            if (isNeedSandboxProject()) {
                projectListAreaBottomControl = createSandBoxProject;
            } else {
                projectListAreaBottomControl = navigateArea;
            }
        }
    }
    if (projectListAreaBottomControl == null) {
        projectListAreaBottomControl = createNewProject;
    }
    FormData formData = (FormData) projectListArea.getLayoutData();
    if (projectListAreaBottomControl == navigateArea) {
        formData.bottom = new FormAttachment(100, -1 * TAB_VERTICAL_PADDING_LEVEL_1);
    } else {
        formData.bottom = new FormAttachment(projectListAreaBottomControl, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    }
    projectOperationArea.layout();
    projectOperationArea.update();
}
Also used : FormData(org.eclipse.swt.layout.FormData) Control(org.eclipse.swt.widgets.Control) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

FormAttachment (org.eclipse.swt.layout.FormAttachment)253 FormData (org.eclipse.swt.layout.FormData)245 Composite (org.eclipse.swt.widgets.Composite)97 Point (org.eclipse.swt.graphics.Point)96 Button (org.eclipse.swt.widgets.Button)95 FormLayout (org.eclipse.swt.layout.FormLayout)93 Control (org.eclipse.swt.widgets.Control)64 Label (org.eclipse.swt.widgets.Label)59 CLabel (org.eclipse.swt.custom.CLabel)56 SelectionEvent (org.eclipse.swt.events.SelectionEvent)55 Node (org.talend.designer.core.ui.editor.nodes.Node)49 Text (org.eclipse.swt.widgets.Text)48 GC (org.eclipse.swt.graphics.GC)46 SelectionListener (org.eclipse.swt.events.SelectionListener)37 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)36 GridData (org.eclipse.swt.layout.GridData)36 FieldDecoration (org.eclipse.jface.fieldassist.FieldDecoration)34 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)32 GridLayout (org.eclipse.swt.layout.GridLayout)32 Group (org.eclipse.swt.widgets.Group)29