Search in sources :

Example 1 with FormData

use of org.eclipse.swt.layout.FormData in project cogtool by cogtool.

the class DictionaryEditorView method layOutWidgets.

protected void layOutWidgets(Composite parent) {
    nameLabel = new Label(parent, SWT.NONE);
    dictTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
    dictTable.setLinesVisible(true);
    dictTable.setHeaderVisible(true);
    dictTable.setEnabled(true);
    dictTable.addListener(SWT.MeasureItem, new Listener() {

        public void handleEvent(Event event) {
            event.height = OSUtils.MACOSX ? 28 : 25;
        }
    });
    TableColumn goalColumn = new TableColumn(dictTable, SWT.NONE);
    goalColumn.setText(GOAL_HEADER);
    goalColumn.setResizable(true);
    goalColumn.setWidth(DictionaryEditorView.COL_WIDTH);
    TableColumn searchColumn = new TableColumn(dictTable, SWT.NONE);
    searchColumn.setText(SEARCH_HEADER);
    searchColumn.setResizable(true);
    searchColumn.setWidth(DictionaryEditorView.COL_WIDTH);
    TableColumn similarityColumn = new TableColumn(dictTable, SWT.RIGHT);
    similarityColumn.setText(SIMIL_HEADER);
    similarityColumn.setResizable(true);
    similarityColumn.setWidth(DictionaryEditorView.COL_WIDTH);
    TableColumn algColumn = new TableColumn(dictTable, SWT.NONE);
    algColumn.setText(ALG_HEADER);
    algColumn.setResizable(false);
    algColumn.setWidth(DictionaryEditorView.COL_WIDTH);
    TableColumn dateColumn = new TableColumn(dictTable, SWT.NONE);
    dateColumn.setText(DATE_HEADER);
    dateColumn.setResizable(true);
    dateColumn.setWidth(DictionaryEditorView.COL_WIDTH);
    urlLabel = new Label(parent, SWT.NONE);
    urlLabel.setText(SITE_LABEL);
    urlText = new View.PerformActionText(parent, SWT.SINGLE | SWT.BORDER) {

        @Override
        protected boolean doChangeAction() {
            return performChangeURL();
        }
    };
    urlText.setEnabled(false);
    spaceLabel = new Label(parent, SWT.NONE);
    spaceLabel.setText(SPACE_LABEL);
    spaceCombo = new View.PerformActionCombo(parent, SWT.DROP_DOWN | SWT.BORDER) {

        @Override
        protected boolean doChangeAction() {
            return performChangeSpace();
        }
    };
    spaceCombo.setItems(LSASimilarity.KNOWN_SPACES);
    spaceCombo.setEnabled(false);
    FormData formData = new FormData();
    formData.left = new FormAttachment(0, 5);
    formData.top = new FormAttachment(0, 5);
    nameLabel.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(0, 20);
    formData.top = new FormAttachment(nameLabel, 5);
    formData.right = new FormAttachment(100, -20);
    formData.height = 350;
    dictTable.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(0, 5);
    formData.top = new FormAttachment(dictTable, 5);
    spaceLabel.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(spaceLabel, 5);
    formData.top = new FormAttachment(dictTable, 5);
    spaceCombo.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(urlLabel, 5);
    formData.top = new FormAttachment(spaceCombo, 5, SWT.BOTTOM);
    formData.right = new FormAttachment(100, -15);
    urlText.setLayoutData(formData);
    formData = new FormData();
    formData.left = new FormAttachment(0, 5);
    formData.top = new FormAttachment(urlText.getOuter(), 0, SWT.CENTER);
    formData.right = new FormAttachment(spaceLabel, 0, SWT.RIGHT);
    urlLabel.setLayoutData(formData);
}
Also used : FormData(org.eclipse.swt.layout.FormData) Table(org.eclipse.swt.widgets.Table) Listener(org.eclipse.swt.widgets.Listener) Label(org.eclipse.swt.widgets.Label) Event(org.eclipse.swt.widgets.Event) TableColumn(org.eclipse.swt.widgets.TableColumn) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 2 with FormData

use of org.eclipse.swt.layout.FormData in project cogtool by cogtool.

the class ThreadProgressBar method addBelowBar.

@Override
protected void addBelowBar() {
    FormData data = new FormData();
    // at the top of the dialog box otherwise
    if (statusLabel != null) {
        data.top = new FormAttachment(statusLabel, 10, SWT.BOTTOM);
        data.bottom = new FormAttachment(statusLabel, 25, SWT.BOTTOM);
    } else {
        data.top = new FormAttachment(0, 10);
        data.bottom = new FormAttachment(0, 25);
    }
    data.left = new FormAttachment(0, 20);
    data.right = new FormAttachment(100, -20);
    bar.setLayoutData(data);
    // box, tying it to the given cancelable "process" object.
    if (cancelListener != null) {
        cancelButton = new Button(shell, SWT.PUSH);
        cancelButton.setText(L10N.get("B.Cancel", "Cancel"));
        cancelButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent evt) {
                // Called from the main UI thread
                cancelListener.cancel();
                cancelButton.setEnabled(false);
            }
        });
        data = new FormData();
        data.left = new FormAttachment(bar, 0, SWT.CENTER);
        data.top = new FormAttachment(bar, 5, SWT.BOTTOM);
        cancelButton.setLayoutData(data);
    }
}
Also used : FormData(org.eclipse.swt.layout.FormData) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 3 with FormData

use of org.eclipse.swt.layout.FormData in project cogtool by cogtool.

the class ThreadProgressBar method addAboveBar.

@Override
protected void addAboveBar() {
    shell.setLayout(new FormLayout());
    // Add status display area if requested
    if (initialStatus != null) {
        statusLabel = new Label(shell, SWT.NONE);
        statusLabel.setText(initialStatus);
        FormData data = new FormData();
        data.left = new FormAttachment(0, 20);
        data.top = new FormAttachment(0, 10);
        data.right = new FormAttachment(100, -20);
        statusLabel.setLayoutData(data);
    }
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Label(org.eclipse.swt.widgets.Label) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 4 with FormData

use of org.eclipse.swt.layout.FormData in project cogtool by cogtool.

the class ActionChangePropertySet method layOutTouchComposite.

@Override
public void layOutTouchComposite() {
    touchActionCombo.addSelectionListener(handleChangeChecks);
    // Center button action label to its associated combo vertically
    // Attach button action label to 5 pixels from the properties left
    FormData data = new FormData();
    data.top = new FormAttachment(touchActionCombo, 0, SWT.CENTER);
    data.left = new FormAttachment(0, 5);
    touchActionLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(0, 5);
    data.left = new FormAttachment(touchActionLabel, 5, SWT.RIGHT);
    data.right = new FormAttachment(100, -5);
    touchActionCombo.setLayoutData(data);
    transitionSourceLabelTouch.setVisible(false);
    transitionSourceNameTouch.setVisible(false);
    transitionDestinationLabelTouch.setVisible(false);
    transitionDestinationNameTouch.setVisible(false);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 5 with FormData

use of org.eclipse.swt.layout.FormData in project cogtool by cogtool.

the class ActionChangePropertySet method layOutMouseComposite.

@Override
public void layOutMouseComposite() {
    mouseButtonCombo.addSelectionListener(handleChangeChecks);
    mouseActionCombo.addSelectionListener(handleChangeChecks);
    if (buttonModifierSet != null) {
        buttonModifierSet.addSelectionListener(handleChangeChecks);
    }
    // Center mouse button label to its associated combo vertically
    // Attach mouse button label to 5 from the properties left
    FormData data = new FormData();
    data.top = new FormAttachment(mouseButtonCombo, 0, SWT.CENTER);
    data.left = new FormAttachment(0, 5);
    mouseButtonLabel.setLayoutData(data);
    // Attach mouse button combo to 5 pixels from the label's right
    // Attach mouse button combo to 5 from the properties top
    // Attach right of combo to end of the properties space
    data = new FormData();
    data.top = new FormAttachment(0, 5);
    data.left = new FormAttachment(mouseButtonLabel, 5, SWT.RIGHT);
    data.right = new FormAttachment(100, -5);
    mouseButtonCombo.setLayoutData(data);
    // Center button action label to its associated combo vertically
    // Attach button action label to 5 pixels from the properties left
    data = new FormData();
    data.top = new FormAttachment(mouseActionCombo, 0, SWT.CENTER);
    data.left = new FormAttachment(0, 5);
    mouseActionLabel.setLayoutData(data);
    data = new FormData();
    data.left = new FormAttachment(mouseButtonCombo, 0, SWT.LEFT);
    data.top = new FormAttachment(mouseButtonCombo, 5, SWT.BOTTOM);
    data.right = new FormAttachment(100, -5);
    mouseActionCombo.setLayoutData(data);
    transitionSourceLabelMouse.setVisible(false);
    transitionSourceNameMouse.setVisible(false);
    transitionDestinationLabelMouse.setVisible(false);
    transitionDestinationNameMouse.setVisible(false);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

FormData (org.eclipse.swt.layout.FormData)1050 FormAttachment (org.eclipse.swt.layout.FormAttachment)999 FormLayout (org.eclipse.swt.layout.FormLayout)667 Label (org.eclipse.swt.widgets.Label)554 Button (org.eclipse.swt.widgets.Button)550 SelectionEvent (org.eclipse.swt.events.SelectionEvent)476 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)433 Composite (org.eclipse.swt.widgets.Composite)423 Text (org.eclipse.swt.widgets.Text)420 ModifyListener (org.eclipse.swt.events.ModifyListener)360 Shell (org.eclipse.swt.widgets.Shell)358 ModifyEvent (org.eclipse.swt.events.ModifyEvent)356 Listener (org.eclipse.swt.widgets.Listener)356 Event (org.eclipse.swt.widgets.Event)355 Display (org.eclipse.swt.widgets.Display)342 ShellEvent (org.eclipse.swt.events.ShellEvent)331 ShellAdapter (org.eclipse.swt.events.ShellAdapter)324 TextVar (org.pentaho.di.ui.core.widget.TextVar)234 ColumnInfo (org.pentaho.di.ui.core.widget.ColumnInfo)224 TableView (org.pentaho.di.ui.core.widget.TableView)219