Search in sources :

Example 6 with Table

use of org.eclipse.swt.widgets.Table in project cogtool by cogtool.

the class DictionaryEditorUI method selectAll.

public void selectAll() {
    Table dictTable = view.getDictTable();
    int size = dictTable.getItemCount();
    // Don't select the pending entry row
    dictTable.setSelection(0, size - 2);
}
Also used : Table(org.eclipse.swt.widgets.Table) Point(org.eclipse.swt.graphics.Point)

Example 7 with Table

use of org.eclipse.swt.widgets.Table in project cogtool by cogtool.

the class DictionaryEditorUI method setViewEnabledState.

protected void setViewEnabledState(Boolean context) {
    try {
        Table dictTable = view.getDictTable();
        int selectionCount = dictTable.getSelectionCount();
        boolean pendingSelected = dictTable.isSelected(dictTable.getItemCount() - 1);
        boolean enabled = !pendingSelected && (selectionCount >= 1);
        setEnabled(CogToolLID.Delete, context, enabled);
        enabled = selectionCount == 1;
        setEnabled(DictionaryEditorLID.SetSimilarity, context, enabled);
        setEnabled(DictionaryEditorLID.SetGoalString, context, enabled);
        setEnabled(DictionaryEditorLID.SetSearchString, context, enabled);
    } catch (SWTException e) {
    // ignore
    }
}
Also used : Table(org.eclipse.swt.widgets.Table) SWTException(org.eclipse.swt.SWTException) Point(org.eclipse.swt.graphics.Point)

Example 8 with Table

use of org.eclipse.swt.widgets.Table in project otertool by wuntee.

the class LoadApkFromDeviceDialog method createContents.

/**
	 * Create contents of the dialog.
	 */
private void createContents() {
    shlSelectApk = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
    shlSelectApk.setSize(592, 486);
    shlSelectApk.setText("Select APK");
    shlSelectApk.setLayout(new GridLayout(1, false));
    table = new Table(shlSelectApk, SWT.BORDER | SWT.FULL_SELECTION);
    table.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDoubleClick(MouseEvent arg0) {
            result = (PackageBean) table.getSelection()[0].getData(PACKAGE_BEAN);
            shlSelectApk.close();
        }
    });
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    table.setBounds(0, 0, 3, 19);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    final TableColumn tblclmnApk = new TableColumn(table, SWT.NONE);
    tblclmnApk.setWidth(240);
    tblclmnApk.setText("APK");
    final TableColumn tblclmnPackage = new TableColumn(table, SWT.NONE);
    tblclmnPackage.setWidth(338);
    tblclmnPackage.setText("Package");
    final String[] keys = { PACKAGE_BEAN };
    GuiWorkshop.addColumnSorter(table, tblclmnApk, 0, keys);
    GuiWorkshop.addColumnSorter(table, tblclmnPackage, 1, keys);
    Composite composite = new Composite(shlSelectApk, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    composite.setBounds(0, 0, 64, 64);
    GridLayout gl_composite = new GridLayout(2, false);
    gl_composite.verticalSpacing = 0;
    gl_composite.marginWidth = 0;
    gl_composite.marginHeight = 0;
    gl_composite.horizontalSpacing = 0;
    composite.setLayout(gl_composite);
    Button btnLoad = new Button(composite, SWT.NONE);
    btnLoad.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            if (table.getSelection().length == 0) {
                GuiWorkshop.messageError(shlSelectApk, "Please Select an APK to load.");
            } else {
                result = (PackageBean) table.getSelection()[0].getData(PACKAGE_BEAN);
                shlSelectApk.close();
            }
        }
    });
    btnLoad.setText("Load");
    Button btnCancel = new Button(composite, SWT.NONE);
    btnCancel.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            result = null;
            shlSelectApk.close();
        }
    });
    btnCancel.setText("Cancel");
}
Also used : Table(org.eclipse.swt.widgets.Table) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) MouseAdapter(org.eclipse.swt.events.MouseAdapter) TableColumn(org.eclipse.swt.widgets.TableColumn) Shell(org.eclipse.swt.widgets.Shell) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) PackageBean(com.wuntee.oter.packagemanager.PackageBean) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 9 with Table

use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.

the class MultiSchemasShadowProcessPreview method newTablePreview.

@Override
public void newTablePreview() {
    table = new Table(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    table.setLayoutData(new GridData(GridData.FILL_BOTH));
}
Also used : Table(org.eclipse.swt.widgets.Table) GridData(org.eclipse.swt.layout.GridData)

Example 10 with Table

use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.

the class HL7OutputUI method addSchemaViewer.

private void addSchemaViewer(final Composite mainComposite, final int width, final int height) {
    // Group Schema Viewer
    final Group group = Form.createGroup(mainComposite, 1, "Linker Source", height);
    // add by wzhang. add a combo for tFileOutputMSXML.
    createCombo(group);
    schemaViewer = new TableViewer(group);
    // schemaViewer.set
    // schemaViewer.getTable().setBackground(schemaViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_WHITE));
    HL7OutputTableViewerProvider provider = new HL7OutputTableViewerProvider();
    schemaViewer.setContentProvider(provider);
    schemaViewer.setLabelProvider(provider);
    GridData data2 = new GridData(GridData.FILL_BOTH);
    Table table = schemaViewer.getTable();
    // see bug 7087
    if (canModify || isRespo) {
        table.setEnabled(false);
    }
    // table.setLinesVisible(true);
    table.setHeaderVisible(true);
    TableColumn column1 = new TableColumn(table, SWT.LEFT);
    column1.setText("Schema List");
    column1.setWidth(100);
    table.setLayoutData(data2);
}
Also used : Group(org.eclipse.swt.widgets.Group) Table(org.eclipse.swt.widgets.Table) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) HL7OutputTableViewerProvider(org.talend.designer.hl7.ui.edit.HL7OutputTableViewerProvider) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer) TableColumn(org.eclipse.swt.widgets.TableColumn)

Aggregations

Table (org.eclipse.swt.widgets.Table)770 GridData (org.eclipse.swt.layout.GridData)368 Composite (org.eclipse.swt.widgets.Composite)325 TableColumn (org.eclipse.swt.widgets.TableColumn)324 TableViewer (org.eclipse.jface.viewers.TableViewer)303 GridLayout (org.eclipse.swt.layout.GridLayout)255 TableItem (org.eclipse.swt.widgets.TableItem)210 SelectionEvent (org.eclipse.swt.events.SelectionEvent)204 Label (org.eclipse.swt.widgets.Label)179 Button (org.eclipse.swt.widgets.Button)161 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)145 Point (org.eclipse.swt.graphics.Point)138 Text (org.eclipse.swt.widgets.Text)102 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)96 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)95 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)89 FillLayout (org.eclipse.swt.layout.FillLayout)87 Shell (org.eclipse.swt.widgets.Shell)82 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)81 Event (org.eclipse.swt.widgets.Event)80