use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class NewDirectoryDialog method createDirectoryList.
/**
* create the directory list
*
* @param composite the parent composite
*/
private void createDirectoryList(Composite composite) {
directoryList = new Table(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
directoryList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
directoryList.setLinesVisible(true);
directoryList.setHeaderVisible(true);
directoryList.setEnabled(false);
TableLayout tableLayout = new TableLayout();
tableLayout.addColumnData(new ColumnWeightData(20, true));
directoryList.setLayout(tableLayout);
final TableColumn currentVolumeColumn = new TableColumn(directoryList, SWT.LEFT);
currentVolumeColumn.setText(Messages.tblColDirectoryVolume);
currentVolumeColumn.pack();
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class OptimizeDialog method createDialogArea.
/**
* Create dialog area content
*
* @param parent the parent composite
* @return the control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
final Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.marginWidth = 10;
layout.marginHeight = 10;
composite.setLayout(layout);
final Group dbNameGroup = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 10;
layout.marginHeight = 10;
dbNameGroup.setLayout(layout);
final GridData gdDbNameGroup = new GridData(GridData.FILL_HORIZONTAL);
dbNameGroup.setLayoutData(gdDbNameGroup);
final Label dbNameLabel = new Label(dbNameGroup, SWT.LEFT | SWT.WRAP);
dbNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
dbNameLabel.setText(Messages.lblOptimizeDbName);
databaseName = new Text(dbNameGroup, SWT.BORDER);
databaseName.setEnabled(false);
final GridData gdDatabaseName = new GridData(SWT.FILL, SWT.FILL, true, false);
databaseName.setLayoutData(gdDatabaseName);
final Label optimizeLabel = new Label(dbNameGroup, SWT.WRAP);
optimizeLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
optimizeLabel.setText(Messages.lblOptimizeClassName);
GridData gdClassName = new org.eclipse.swt.layout.GridData(SWT.FILL, SWT.FILL, true, false);
className = new Combo(dbNameGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
className.setLayoutData(gdClassName);
className.setVisibleItemCount(15);
final Group descGroup = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.marginWidth = 10;
layout.marginHeight = 10;
descGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
descGroup.setLayout(layout);
descGroup.setText(Messages.grpOptimizeDesc);
final Label descriptionLabel = new Label(descGroup, SWT.WRAP);
descriptionLabel.setText(Messages.lblOptimizeDesc);
descriptionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
volumeTable = new Table(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.READ_ONLY);
volumeTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
volumeTable.setLinesVisible(false);
volumeTable.setHeaderVisible(false);
TableLayout tableLayout = new TableLayout();
volumeTable.setLayout(tableLayout);
final TableColumn currentVolumeColumn = new TableColumn(volumeTable, SWT.LEFT);
currentVolumeColumn.setText("");
currentVolumeColumn.pack();
setMessage(Messages.msgOptimizeDbInformation);
setTitle(Messages.titleOptimizeDbDialog);
initial();
return parentComp;
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class SettingCubridConfPage method createControl.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FormLayout());
setControl(container);
setDescription(Messages.descSettingCubridPage);
Composite leftComposite = new Composite(container, SWT.NONE);
leftComposite.setLayout(new GridLayout(3, false));
FormData leftData = new FormData();
leftData.top = new FormAttachment(0, 5);
leftData.bottom = new FormAttachment(100, 0);
leftData.left = new FormAttachment(0, 5);
leftData.right = new FormAttachment(50, -5);
leftComposite.setLayoutData(leftData);
Label separator = new Label(container, SWT.SEPARATOR);
FormData separatorData = new FormData();
separatorData.top = new FormAttachment(0, 5);
separatorData.bottom = new FormAttachment(100, -5);
separatorData.left = new FormAttachment(50, -5);
separatorData.right = new FormAttachment(50, 5);
separator.setLayoutData(separatorData);
Composite rightComposite = new Composite(container, SWT.NONE);
rightComposite.setLayout(new GridLayout(3, false));
FormData rightData = new FormData();
rightData.top = new FormAttachment(0, 5);
rightData.bottom = new FormAttachment(100, 0);
rightData.left = new FormAttachment(50, 5);
rightData.right = new FormAttachment(100, -5);
rightComposite.setLayoutData(rightData);
/*Create left widget*/
Label hostALabel = new Label(leftComposite, SWT.None);
hostALabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
hostALabel.setText(Messages.lblMaster);
masterHostLabel = new Label(leftComposite, SWT.None);
masterHostLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
masterViewer = new TableViewer(leftComposite, SWT.BORDER | SWT.FULL_SELECTION);
masterViewer.getTable().setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, -1));
masterViewer.getTable().setLinesVisible(true);
masterViewer.getTable().setHeaderVisible(true);
masterViewer.setContentProvider(new TableContentProvider());
masterViewer.setLabelProvider(new CubridConfTableProvider());
masterViewer.setColumnProperties(PROPS);
CellEditor[] editorsA = new CellEditor[2];
editorsA[0] = null;
editorsA[1] = new TextCellEditor(masterViewer.getTable());
masterViewer.setCellEditors(editorsA);
masterViewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
if (property.equals(PROPS[1])) {
return true;
}
return false;
}
public Object getValue(Object element, String property) {
DataModel model = (DataModel) element;
if (property.equals(PROPS[0])) {
return model.getKey() == null ? "" : model.getKey();
} else if (property.equals(PROPS[1])) {
return model.getValue() == null ? "" : model.getValue();
}
return "";
}
public void modify(Object element, String property, Object value) {
TableItem item = (TableItem) element;
DataModel model = (DataModel) item.getData();
model.setValue(value.toString());
masterViewer.refresh(model);
updateHAModel(masterViewer, model, false);
}
});
TableColumn keyAColumn = new TableColumn(masterViewer.getTable(), SWT.LEFT);
keyAColumn.setText(Messages.lblKey);
keyAColumn.setWidth(160);
TableColumn valueAColumn = new TableColumn(masterViewer.getTable(), SWT.LEFT);
valueAColumn.setText(Messages.lblValue);
valueAColumn.setWidth(200);
Label masterDBLabel = new Label(leftComposite, SWT.None);
masterDBLabel.setText(Messages.lblDatabase);
masterDBLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
masterDBCombo = new Combo(leftComposite, SWT.BORDER | SWT.READ_ONLY);
masterDBCombo.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
masterDBCombo.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
HAModel haModel = getConfigHAWizard().getHaModel();
/*Init table data*/
initTableData(haModel.getMasterServer(), true);
HAServer haServer = haModel.getSlaveServer();
initTableData(haServer, false);
}
});
ToolBar toolBarA = new ToolBar(leftComposite, SWT.None);
toolBarA.setLayoutData(CommonUITool.createGridData(GridData.HORIZONTAL_ALIGN_END, 1, 1, -1, -1));
ToolItem addItemA = new ToolItem(toolBarA, SWT.None);
addItemA.setToolTipText(Messages.itemAddParameter);
addItemA.setImage(CubridManagerUIPlugin.getImage("/icons/replication/add_param.gif"));
addItemA.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
addParameter(masterViewer);
}
});
ToolItem editItemA = new ToolItem(toolBarA, SWT.None);
editItemA.setToolTipText(Messages.itemEditParameter);
editItemA.setImage(CubridManagerUIPlugin.getImage("/icons/replication/edit_param.gif"));
editItemA.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
editParameter(masterViewer);
}
});
ToolItem dropItemA = new ToolItem(toolBarA, SWT.None);
dropItemA.setToolTipText(Messages.itemDeleteParameter);
dropItemA.setImage(CubridManagerUIPlugin.getImage("/icons/replication/delete_param.gif"));
dropItemA.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
dropParameter(masterViewer);
}
});
/*Create right widget*/
Label hostBLabel = new Label(rightComposite, SWT.None);
hostBLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
hostBLabel.setText(Messages.lblSlave);
slaveHostLabel = new Label(rightComposite, SWT.None);
slaveHostLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
slaveViewer = new TableViewer(rightComposite, SWT.BORDER | SWT.FULL_SELECTION);
slaveViewer.getTable().setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, -1));
slaveViewer.getTable().setLinesVisible(true);
slaveViewer.getTable().setHeaderVisible(true);
slaveViewer.setContentProvider(new TableContentProvider());
slaveViewer.setLabelProvider(new CubridConfTableProvider());
slaveViewer.setColumnProperties(PROPS);
CellEditor[] editorsB = new CellEditor[2];
editorsB[0] = null;
editorsB[1] = new TextCellEditor(slaveViewer.getTable());
slaveViewer.setCellEditors(editorsB);
slaveViewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
if (property.equals(PROPS[1])) {
return true;
}
return false;
}
public Object getValue(Object element, String property) {
DataModel model = (DataModel) element;
if (property.equals(PROPS[0])) {
return model.getKey() == null ? "" : model.getKey();
} else if (property.equals(PROPS[1])) {
return model.getValue() == null ? "" : model.getValue();
}
return "";
}
public void modify(Object element, String property, Object value) {
TableItem item = (TableItem) element;
DataModel model = (DataModel) item.getData();
model.setValue(value.toString());
slaveViewer.refresh(model);
updateHAModel(slaveViewer, model, false);
}
});
TableColumn keyBColumn = new TableColumn(slaveViewer.getTable(), SWT.LEFT);
keyBColumn.setText(Messages.lblKey);
keyBColumn.setWidth(160);
TableColumn valueBColumn = new TableColumn(slaveViewer.getTable(), SWT.LEFT);
valueBColumn.setText(Messages.lblValue);
valueBColumn.setWidth(200);
ToolBar toolBarB = new ToolBar(rightComposite, SWT.None);
toolBarB.setLayoutData(CommonUITool.createGridData(GridData.HORIZONTAL_ALIGN_END, 3, 1, -1, -1));
ToolItem addItemB = new ToolItem(toolBarB, SWT.None);
addItemB.setToolTipText(Messages.itemAddParameter);
addItemB.setImage(CubridManagerUIPlugin.getImage("/icons/replication/add_param.gif"));
addItemB.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
addParameter(slaveViewer);
}
});
ToolItem editItemB = new ToolItem(toolBarB, SWT.None);
editItemB.setToolTipText(Messages.itemEditParameter);
editItemB.setImage(CubridManagerUIPlugin.getImage("/icons/replication/edit_param.gif"));
editItemB.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
editParameter(slaveViewer);
}
});
ToolItem dropItemB = new ToolItem(toolBarB, SWT.None);
dropItemB.setToolTipText(Messages.itemDeleteParameter);
dropItemB.setImage(CubridManagerUIPlugin.getImage("/icons/replication/delete_param.gif"));
dropItemB.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
dropParameter(slaveViewer);
}
});
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class CQBUserEditor method createCommonTableViewer.
/**
* Create common tableViewer
*
* @param parent the parent composite
* @param columnNameArr the column name array
* @param gridData the grid data
* @return the table viewer
*/
public TableViewer createCommonTableViewer(Composite parent, final String[] columnNameArr, GridData gridData) {
final TableViewer tableViewer = new TableViewer(parent, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
tableViewer.setContentProvider(new TableContentProvider());
tableViewer.setLabelProvider(new ExTableLabelProvider());
tableViewer.setSorter(new TableViewerSorter());
tableViewer.getTable().setLinesVisible(true);
tableViewer.getTable().setHeaderVisible(true);
tableViewer.getTable().setLayoutData(gridData);
for (int i = 0; i < columnNameArr.length; i++) {
final TableColumn tblColumn = new TableColumn(tableViewer.getTable(), SWT.CHECK);
tblColumn.setData(false);
tblColumn.setText(columnNameArr[i]);
tblColumn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
TableColumn column = (TableColumn) event.widget;
int j = 0;
for (j = 0; j < columnNameArr.length; j++) {
if (column.getText().equals(columnNameArr[j])) {
break;
}
}
TableViewerSorter sorter = ((TableViewerSorter) tableViewer.getSorter());
if (sorter == null) {
return;
}
sorter.doSort(j);
tableViewer.getTable().setSortColumn(column);
tableViewer.getTable().setSortDirection(sorter.isAsc() ? SWT.UP : SWT.DOWN);
tableViewer.refresh();
for (int k = 0; k < tableViewer.getTable().getColumnCount(); k++) {
tableViewer.getTable().getColumn(k).pack();
}
return;
}
});
tblColumn.pack();
}
return tableViewer;
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class SqlLogAnalyzeResultDialog method makeErrColumn.
/**
* make err table column
*
* @return tableColumn
*/
private TableColumn makeErrColumn() {
TableColumn err = new TableColumn(table, SWT.LEFT);
err.addSelectionListener(new DirectionAwareSelectionAdapter("err"));
return err;
}
Aggregations