use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerStatusView method createAsTable.
/**
* Create app server table
*
* @param comp the parent composite
*
*/
private void createAsTable(Composite comp) {
Composite asComposite = new Composite(comp, SWT.NONE);
GridData gdAs = new GridData(SWT.FILL, SWT.FILL, true, true);
asComposite.setLayoutData(gdAs);
asComposite.setLayout(new GridLayout());
asTableViewer = new TableViewer(asComposite, SWT.FULL_SELECTION | SWT.NO_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Table asTable = asTableViewer.getTable();
asTable.setHeaderVisible(true);
asTable.setLinesVisible(true);
asTable.setLayoutData(gdAs);
TableLayout asLayout = new TableLayout();
setAsLayout(asLayout);
asTable.setLayout(asLayout);
TableColumn tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsId);
tblColumn.setToolTipText(Messages.tblAsId);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsProcess);
tblColumn.setToolTipText(Messages.tblAsProcess);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsQps);
tblColumn.setToolTipText(Messages.tblAsQps);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsLqs);
tblColumn.setToolTipText(Messages.tblAsLqs);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsPort);
tblColumn.setToolTipText(Messages.tblAsPort);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsSize);
tblColumn.setToolTipText(Messages.tblAsSize);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsStatus);
tblColumn.setToolTipText(Messages.tblAsStatus);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsDb);
tblColumn.setToolTipText(Messages.tblAsDb);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsHost);
tblColumn.setToolTipText(Messages.tblAsHost);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsLastAccess);
tblColumn.setToolTipText(Messages.tblAsLastAccess);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsLct);
tblColumn.setToolTipText(Messages.tblAsLct);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsClientIp);
tblColumn.setToolTipText(Messages.tblAsClientIp);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsCur);
tblColumn.setToolTipText(Messages.tblAsCur);
asTableViewer.setContentProvider(new ApplyServerContentProvider());
asTableViewer.setLabelProvider(new ApplyServerLabelProvider());
asTableViewer.setInput(asinfoLst);
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
menuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
IStructuredSelection selection = (IStructuredSelection) asTableViewer.getSelection();
ApplyServerInfo as = (ApplyServerInfo) (selection.toArray()[0]);
RestartAction restartAcion = new RestartAction(as.getAs_id());
manager.add(restartAcion);
}
});
Menu contextMenu = menuManager.createContextMenu(asTableViewer.getControl());
asTableViewer.getControl().setMenu(contextMenu);
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerEnvStatusView method makeActions.
/**
* This method is to create actions at tool bar
*
*/
private void makeActions() {
Action columnAction = new Action() {
public void run() {
BrokerEnvStatusSettingDlg settingDlg = new BrokerEnvStatusSettingDlg(null);
if (settingDlg.open() == Dialog.OK) {
TableLayout tlayout = new TableLayout();
for (BrokerEnvStatusColumn column : BrokerEnvStatusColumn.values()) {
if (column.getValue() == -1) {
tlayout.addColumnData(new ColumnWeightData(0, 0, false));
} else {
tlayout.addColumnData(new ColumnWeightData(10, 40, true));
}
}
tableViewer.getTable().setLayout(tlayout);
tableViewer.getTable().layout();
}
}
};
columnAction.setText(Messages.envColumnSettingTxt);
columnAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
IActionBars bars = getViewSite().getActionBars();
IToolBarManager manager = bars.getToolBarManager();
manager.add(columnAction);
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerSatusTablePart method createBasicTable.
/**
* Create basic info table
*
* @param comp the parent composite
* @return TableViewer
*
*/
public TableViewer createBasicTable(Composite comp) {
final Composite basicComposite = new Composite(comp, SWT.NONE);
GridData gdBasic = new GridData(SWT.FILL, SWT.NONE, false, false);
basicComposite.setLayoutData(gdBasic);
basicComposite.setLayout(new GridLayout());
TableViewer basicTableViewer = new TableViewer(basicComposite, SWT.NO_SCROLL | SWT.BORDER);
Table basicTable = basicTableViewer.getTable();
basicTable.setHeaderVisible(true);
basicTable.setLinesVisible(true);
GridData tblBasic = new GridData(SWT.FILL, SWT.TOP, true, false);
tblBasic.heightHint = CommonUITool.getHeightHintOfTable(basicTable);
basicTable.setLayoutData(tblBasic);
TableLayout basicLayout = new TableLayout();
setBasicLayout(basicLayout);
basicTable.setLayout(basicLayout);
basicTable.setBackground(basicComposite.getBackground());
TableColumn tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscPid);
tblColumn.setToolTipText(Messages.tblBscPid);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscPort);
tblColumn.setToolTipText(Messages.tblBscPort);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscJobQueue);
tblColumn.setToolTipText(Messages.tblBscJobQueue);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscAutoAddAs);
tblColumn.setToolTipText(Messages.tblBscAutoAddAs);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscSqlLogMode);
tblColumn.setToolTipText(Messages.tblBscSqlLogMode);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscLongTranTime);
tblColumn.setToolTipText(Messages.tblBscLongTranTime);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscLongQueryTime);
tblColumn.setToolTipText(Messages.tblBscLongQueryTime);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscSessionTimeout);
tblColumn.setToolTipText(Messages.tblBscSessionTimeout);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscKeepConn);
tblColumn.setToolTipText(Messages.tblBscKeepConn);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscAccessMode);
tblColumn.setToolTipText(Messages.tblBscAccessMode);
if (isAppendDiag) {
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscActiveSession);
tblColumn.setToolTipText(Messages.tblBscActiveSession);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscSession);
tblColumn.setToolTipText(Messages.tblBscSession);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscTps);
tblColumn.setToolTipText(Messages.tblBscTps);
}
basicTableViewer.setContentProvider(new BrokerBasicInfoContentProvider());
BrokerBasicInfoLabelProvider basicInfoLabelProvider = new BrokerBasicInfoLabelProvider();
basicTableViewer.setLabelProvider(basicInfoLabelProvider);
List<String> basicInfoLst = new ArrayList<String>();
basicTableViewer.setInput(basicInfoLst);
return basicTableViewer;
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerSatusTablePart method createJobTable.
/**
* Create job table composite
*
* @param comp the composite
* @return TableViewer
*
*/
public TableViewer createJobTable(Composite comp) {
Composite jobComposite = new Composite(comp, SWT.NONE);
GridData gdJob = new GridData(SWT.FILL, SWT.FILL, true, true);
jobComposite.setLayoutData(gdJob);
jobComposite.setLayout(new GridLayout());
final Label label = new Label(jobComposite, SWT.CENTER);
label.setText(Messages.jobTblTitle);
TableViewer jqTableViewer = new TableViewer(jobComposite, SWT.FULL_SELECTION | SWT.NO_SCROLL | SWT.V_SCROLL | SWT.BORDER);
jqTableViewer.getTable().setHeaderVisible(true);
jqTableViewer.getTable().setLinesVisible(true);
TableLayout jqLayout = new TableLayout();
setJqLayout(jqLayout);
jqTableViewer.getTable().setLayout(jqLayout);
jqTableViewer.getTable().setLayoutData(gdJob);
TableColumn tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblJobId);
tblColumn.setToolTipText(Messages.tblJobId);
tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblJobPriority);
tblColumn.setToolTipText(Messages.tblJobPriority);
tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblJobAddress);
tblColumn.setToolTipText(Messages.tblJobAddress);
tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblJobTime);
tblColumn.setToolTipText(Messages.tblJobTime);
tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblJobRequest);
tblColumn.setToolTipText(Messages.tblJobRequest);
jqTableViewer.setContentProvider(new JobContentProvider());
jqTableViewer.setLabelProvider(new JobLabelProvider());
jqTableViewer.setInput(jobinfoLst);
return jqTableViewer;
}
use of org.eclipse.jface.viewers.TableLayout in project cubrid-manager by CUBRID.
the class BrokerSatusTablePart method createAsTable.
/**
* Create app server table
*
* @param comp the parent composite
* @return TableViewer
*
*/
public TableViewer createAsTable(Composite comp) {
Composite asComposite = new Composite(comp, SWT.NONE);
GridData gdAs = new GridData(SWT.FILL, SWT.FILL, true, true);
asComposite.setLayoutData(gdAs);
asComposite.setLayout(new GridLayout());
TableViewer asTableViewer = new TableViewer(asComposite, SWT.FULL_SELECTION | SWT.NO_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Table asTable = asTableViewer.getTable();
asTable.setHeaderVisible(true);
asTable.setLinesVisible(true);
asTable.setLayoutData(gdAs);
TableLayout asLayout = new TableLayout();
setAsLayout(asLayout);
asTable.setLayout(asLayout);
TableColumn tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsId);
tblColumn.setToolTipText(Messages.tblAsId);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsProcess);
tblColumn.setToolTipText(Messages.tblAsProcess);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsQps);
tblColumn.setToolTipText(Messages.tblAsQps);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsLqs);
tblColumn.setToolTipText(Messages.tblAsLqs);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsPort);
tblColumn.setToolTipText(Messages.tblAsPort);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsSize);
tblColumn.setToolTipText(Messages.tblAsSize);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsStatus);
tblColumn.setToolTipText(Messages.tblAsStatus);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsDb);
tblColumn.setToolTipText(Messages.tblAsDb);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsHost);
tblColumn.setToolTipText(Messages.tblAsHost);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsLastAccess);
tblColumn.setToolTipText(Messages.tblAsLastAccess);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsLct);
tblColumn.setToolTipText(Messages.tblAsLct);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsClientIp);
tblColumn.setToolTipText(Messages.tblAsClientIp);
tblColumn = new TableColumn(asTable, SWT.CENTER);
tblColumn.setText(Messages.tblAsCur);
tblColumn.setToolTipText(Messages.tblAsCur);
asTableViewer.setContentProvider(new ApplyServerContentProvider());
asTableViewer.setLabelProvider(new ApplyServerLabelProvider());
asTableViewer.setInput(asinfoLst);
return asTableViewer;
}
Aggregations