Search in sources :

Example 46 with TableLayout

use of org.eclipse.jface.viewers.TableLayout in project linuxtools by eclipse.

the class DockerRegistryAccountPreferencePage method createContents.

/**
 * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
 */
@Override
protected Control createContents(Composite parent) {
    Composite page = createComposite(parent, 1, 2, false, null, -1, -1, GridData.FILL);
    GridData gd = (GridData) page.getLayoutData();
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    // SystemWidgetHelpers.createLabel(page,
    // SystemResources.RESID_PREF_SIGNON_DESCRIPTION, 2);
    // Password table
    pwdTable = new Table(page, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
    pwdTable.setLinesVisible(true);
    pwdTable.setHeaderVisible(true);
    pwdTable.addListener(SWT.Selection, this);
    TableLayout tableLayout = new TableLayout();
    tableLayout.addColumnData(new ColumnWeightData(100, true));
    tableLayout.addColumnData(new ColumnWeightData(100, true));
    tableLayout.addColumnData(new ColumnWeightData(100, true));
    pwdTable.setLayout(tableLayout);
    gd = new GridData(GridData.FILL_BOTH);
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    pwdTable.setLayoutData(gd);
    // Server Address column
    TableColumn hostnameColumn = new TableColumn(pwdTable, SWT.NONE);
    hostnameColumn.setText("Server Address");
    // Username column
    TableColumn sysTypeColumn = new TableColumn(pwdTable, SWT.NONE);
    sysTypeColumn.setText("Username");
    // Email column
    TableColumn useridColumn = new TableColumn(pwdTable, SWT.NONE);
    useridColumn.setText("Email");
    pwdTableViewer = new TableViewer(pwdTable);
    pwdTableViewer.setContentProvider(provider);
    pwdTableViewer.setLabelProvider(provider);
    pwdTableViewer.setInput(passwords);
    // Create the Button bar for add, change and remove
    Composite buttonBar = createComposite(page, 1, 1, false, null, -1, -1, GridData.FILL);
    gd = (GridData) buttonBar.getLayoutData();
    gd.grabExcessHorizontalSpace = false;
    gd.grabExcessVerticalSpace = true;
    addButton = createPushButton(buttonBar, this, "Add", "Add a new Docker registry account.");
    changeButton = createPushButton(buttonBar, this, "Edit", "Edit an existing Docker registry account.");
    removeButton = createPushButton(buttonBar, this, "Remove", "Remove an existing Docker registry account.");
    changeButton.setEnabled(false);
    removeButton.setEnabled(false);
    return parent;
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

TableLayout (org.eclipse.jface.viewers.TableLayout)46 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)23 GridData (org.eclipse.swt.layout.GridData)23 TableColumn (org.eclipse.swt.widgets.TableColumn)20 Table (org.eclipse.swt.widgets.Table)18 TableViewer (org.eclipse.jface.viewers.TableViewer)16 Composite (org.eclipse.swt.widgets.Composite)16 GridLayout (org.eclipse.swt.layout.GridLayout)15 Label (org.eclipse.swt.widgets.Label)10 ColumnPixelData (org.eclipse.jface.viewers.ColumnPixelData)8 TableItem (org.eclipse.swt.widgets.TableItem)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)4 BrokerEnvStatusColumn (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)4 Point (org.eclipse.swt.graphics.Point)4 Event (org.eclipse.swt.widgets.Event)4 Listener (org.eclipse.swt.widgets.Listener)4 Menu (org.eclipse.swt.widgets.Menu)4 CommonUITool.trimPaintColor (com.cubrid.common.ui.spi.util.CommonUITool.trimPaintColor)3 ApplyServerInfo (com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo)3