Search in sources :

Example 21 with FormLayout

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

the class TOSLoginComposite method createTosRepositoryArea.

private void createTosRepositoryArea(Composite parent) {
    repositoryComposite = toolkit.createComposite(parent);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 40;
    repositoryComposite.setLayoutData(gd);
    repositoryComposite.setLayout(new FormLayout());
    repositoryComposite.setBackgroundMode(SWT.INHERIT_DEFAULT);
    String productName = brandingService.getProductName();
    Label welcomeLabel = toolkit.createLabel(repositoryComposite, //$NON-NLS-1$
    Messages.getString("TOSLoginComposite.welcomeTitle", productName));
    welcomeLabel.setBackground(repositoryComposite.getBackground());
    welcomeLabel.setFont(font);
    FormData welcomeLabelFormData = new FormData();
    welcomeLabelFormData.top = new FormAttachment(0, 7);
    welcomeLabelFormData.left = new FormAttachment(0, 10);
    if (Platform.getOS().equals(Platform.OS_WIN32)) {
        welcomeLabelFormData.right = new FormAttachment(0, 380);
        welcomeLabelFormData.right = new FormAttachment(0, 420);
    } else if (Platform.getOS().equals(Platform.OS_LINUX)) {
        welcomeLabelFormData.right = new FormAttachment(0, 420);
    } else {
        welcomeLabelFormData.right = new FormAttachment(0, 420);
    }
    welcomeLabelFormData.bottom = new FormAttachment(100, 0);
    welcomeLabel.setLayoutData(welcomeLabelFormData);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 22 with FormLayout

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

the class WidgetFactory method createFlatFormComposite.

/**
     * Creates a flat form composite as a part of the form.
     * 
     * @param parent the composite parent.
     * @return the composite.
     */
public Composite createFlatFormComposite(Composite parent) {
    Composite composite = createComposite(parent);
    FormLayout layout = new FormLayout();
    layout.marginWidth = ITabbedPropertyConstants.HSPACE + 2;
    layout.marginHeight = ITabbedPropertyConstants.VSPACE;
    layout.spacing = ITabbedPropertyConstants.VMARGIN + 1;
    composite.setLayout(layout);
    return composite;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite)

Example 23 with FormLayout

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

the class HeaderComposite method createComponents.

private void createComponents() {
    GridData headerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
    this.setLayoutData(headerCompositeGridData);
    FormLayout formLayout = new FormLayout();
    this.setLayout(formLayout);
    this.statusLabel = new Label(this, SWT.NONE);
    this.iconLabel = new Label(this, SWT.NONE);
    FormData iconFormData = new FormData();
    Point minSize = statusLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    iconFormData.width = Math.max(15, minSize.x);
    iconFormData.left = new FormAttachment(0, 5);
    iconLabel.setLayoutData(iconFormData);
    iconLabel.setImage(null);
    FormData labelFormData = new FormData();
    Point iconminSize = statusLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    labelFormData.width = Math.max(1000, iconminSize.x);
    labelFormData.left = new FormAttachment(iconLabel, 5);
    statusLabel.setLayoutData(labelFormData);
    //$NON-NLS-1$
    statusLabel.setText("");
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Point(org.eclipse.swt.graphics.Point) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 24 with FormLayout

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

the class InsertionIndicator method updatePosition.

/**
     * Update position of the indicator at top of <code>itemIndexTarget</code> position of the
     * <code>draggableTable</code>.
     * 
     * @param currentTable
     * @param itemIndexTarget
     */
public void updatePosition(Table currentTable, int itemIndexTarget) {
    //        System.out.println(itemIndexTarget);
    this.draggableTable = currentTable;
    removeTablePaintListener();
    if (tablePaintListener == null) {
        tablePaintListener = new Listener() {

            public void handleEvent(Event event) {
                drawIndicatorLineInTable(event);
            }
        };
    }
    FormLayout formLayout = tablesZoneViewParent.getLayout();
    UIManager uiManager = mapperManager.getUiManager();
    TablesZoneView tablesZoneViewOutputs = uiManager.getTablesZoneViewOutputs();
    Display display = tablesZoneViewOutputs.getDisplay();
    Point tablePositionRefZone = display.map(currentTable, tablesZoneViewParent, new Point(0, 0));
    FormData formDataLeftArrow = (FormData) leftArrowDraggingIndicator.getLayoutData();
    FormData formDataRightArrow = (FormData) rightArrowDraggingIndicator.getLayoutData();
    ScrollBar verticalBar = currentTable.getVerticalBar();
    // System.out.println("verticalBar.getSelection()="+verticalBar.getSelection() + "
    // currentTable.getItemHeight()="+currentTable.getItemHeight());
    DataMapTableView dataMapTableView = mapperManager.retrieveDataMapTableView(currentTable);
    int indicYPositionRefZone = 0;
    if (WindowSystem.isGTK()) {
        int offsetVerticalBar = -verticalBar.getSelection();
        if (itemIndexTarget == 0) {
            indicYPositionRefTable = 0 + offsetVerticalBar;
        } else {
            indicYPositionRefTable = itemIndexTarget * (currentTable.getItemHeight() + 2) + offsetVerticalBar;
        }
        // System.out.println("indicYPositionRefTable="+indicYPositionRefTable);
        indicYPositionRefZone = indicYPositionRefTable + tablePositionRefZone.y + formLayout.marginTop - HEIGHT_INDICATOR / 2;
        indicYPositionRefZone -= currentTable.getItemHeight() + 1;
    // System.out.println("indicYPositionRefZone="+indicYPositionRefZone);
    } else {
        int offsetVerticalBar = -verticalBar.getSelection() * currentTable.getItemHeight();
        if (itemIndexTarget == 0) {
            indicYPositionRefTable = 0 + offsetVerticalBar;
        } else {
            indicYPositionRefTable = itemIndexTarget * currentTable.getItemHeight() - 1 + offsetVerticalBar;
        }
        Point point = currentTable.getDisplay().map(currentTable, tablesZoneViewParent, new Point(0, indicYPositionRefTable));
        indicYPositionRefZone = point.y + 5;
    }
    Rectangle boundsTableView = dataMapTableView.getBounds();
    int testValue = boundsTableView.y + boundsTableView.height - formLayout.marginTop - HEIGHT_INDICATOR / 2 - 5;
    if (indicYPositionRefZone > testValue) {
        indicYPositionRefZone = testValue;
    }
    currentTable.addListener(SWT.Paint, tablePaintListener);
    if (lastIndicYPositionRefZone != indicYPositionRefZone) {
        formDataLeftArrow.top.offset = indicYPositionRefZone;
        formDataRightArrow.top.offset = indicYPositionRefZone;
        formDataRightArrow.left.offset = currentTable.getSize().x + 2;
        currentTable.redraw();
        tablesZoneViewParent.layout();
    }
    lastIndicYPositionRefZone = indicYPositionRefZone;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Listener(org.eclipse.swt.widgets.Listener) Rectangle(org.eclipse.swt.graphics.Rectangle) Event(org.eclipse.swt.widgets.Event) UIManager(org.talend.designer.mapper.managers.UIManager) DataMapTableView(org.talend.designer.mapper.ui.visualmap.table.DataMapTableView) Point(org.eclipse.swt.graphics.Point) TablesZoneView(org.talend.designer.mapper.ui.visualmap.zone.scrollable.TablesZoneView) ScrollBar(org.eclipse.swt.widgets.ScrollBar) Point(org.eclipse.swt.graphics.Point) Display(org.eclipse.swt.widgets.Display)

Example 25 with FormLayout

use of org.eclipse.swt.layout.FormLayout 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)

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