use of com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerTblColumnSetHelp in project cubrid-manager by CUBRID.
the class BrokerEnvStatusView method createTable.
/**
* This method initializes table
*
*/
private void createTable() {
tableViewer = new TableViewer(composite, SWT.FULL_SELECTION);
tableViewer.getTable().setHeaderVisible(true);
tableViewer.getTable().setLinesVisible(true);
BrokerTblColumnSetHelp bcsh = BrokerTblColumnSetHelp.getInstance();
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerEnvStatusColumn, BrokerEnvStatusColumn.values());
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().addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent event) {
int index = -1;
if ((index = tableViewer.getTable().getSelectionIndex()) >= 0) {
TableItem tableItem = tableViewer.getTable().getItem(index);
String brokename = tableItem.getText(0).trim();
ICubridNode input = null;
for (ICubridNode node : cubridNode.getChildren()) {
if (node.getLabel().equalsIgnoreCase(brokename)) {
input = node;
break;
}
}
LayoutManager.getInstance().setCurrentSelectedNode(input);
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (null == window) {
return;
}
IWorkbenchPage activePage = window.getActivePage();
IViewPart viewPart = window.getActivePage().findView(BrokerStatusView.ID);
if (null != viewPart) {
activePage.hideView(viewPart);
}
try {
activePage.showView(BrokerStatusView.ID);
} catch (PartInitException e1) {
LOGGER.error(e1.getMessage(), e1);
}
}
}
});
makeTableColumn();
tableViewer.setContentProvider(new BrokersStatusContentProvider());
ServerInfo serverInfo = cubridNode.getServer().getServerInfo();
BrokersStatusLabelProvider brokersStatusLabelProvider = new BrokersStatusLabelProvider();
brokersStatusLabelProvider.setServerInfo(serverInfo);
tableViewer.setLabelProvider(brokersStatusLabelProvider);
}
use of com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerTblColumnSetHelp in project cubrid-manager by CUBRID.
the class BrokerStatusView method createPartControl.
/**
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*
* @param parent the parent composite
*/
public void createPartControl(Composite parent) {
final ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
composite = new Composite(scrolledComp, SWT.NONE);
composite.setLayout(new GridLayout());
BrokerTblColumnSetHelp bcsh = BrokerTblColumnSetHelp.getInstance();
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusBasicColumn, BrokerStatusBasicColumn.values());
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusAsColumn, BrokerStatusAsColumn.values());
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusJqColumn, BrokerStatusJqColumn.values());
if (isSupportNewBrokerParamPropery) {
createBasicTable(composite);
}
createAsTable(composite);
createJobTable(composite);
makeActions();
composite.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent event) {
updateTableLayout();
}
});
scrolledComp.setContent(composite);
scrolledComp.setExpandHorizontal(true);
scrolledComp.setExpandVertical(true);
scrolledComp.setMinHeight(300);
scrolledComp.setMinWidth(800);
new StatusUpdate().start();
}
use of com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerTblColumnSetHelp in project cubrid-manager by CUBRID.
the class BrokerDashboardViewPart method createPartControl.
/**
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*
* @param parent the parent composite
*/
public void createPartControl(Composite parent) {
final ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
composite = new Composite(scrolledComp, SWT.NONE);
composite.setLayout(new GridLayout());
BrokerTblColumnSetHelp bcsh = BrokerTblColumnSetHelp.getInstance();
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusBasicColumn, BrokerStatusBasicColumn.values());
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusAsColumn, BrokerStatusAsColumn.values());
bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusJqColumn, BrokerStatusJqColumn.values());
brokerTablePart.setServerInfo(serverInfo);
brokerTablePart.setAppendDiag(true);
basicTableViewer = brokerTablePart.createBasicTable(composite);
asTableViewer = brokerTablePart.createAsTable(composite);
jqTableViewer = brokerTablePart.createJobTable(composite);
makeActions();
composite.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent event) {
updateTableLayout();
}
});
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);
scrolledComp.setContent(composite);
scrolledComp.setExpandHorizontal(true);
scrolledComp.setExpandVertical(true);
scrolledComp.setMinHeight(300);
scrolledComp.setMinWidth(800);
}
Aggregations