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;
}
Aggregations