use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart in project cubrid-manager by CUBRID.
the class ShowBrokerClientAction method isSupported.
/**
* Always support
*
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
* @param obj Object
* @return boolean support:true;not support:false;
*/
public boolean isSupported(Object obj) {
IStructuredSelection selection = (IStructuredSelection) getSelection();
if (!(selection.getFirstElement() instanceof BrokerMonitorPart)) {
return false;
}
BrokerMonitorPart cmp = (BrokerMonitorPart) selection.getFirstElement();
DashboardPart dp = (DashboardPart) cmp.getParent();
Dashboard db = (Dashboard) dp.getModel();
BrokerNode model = (BrokerNode) cmp.getModel();
ClientNode clientNode = db.getClientNodeByBroker(model);
setChecked(null != clientNode && clientNode.isVisible());
return true;
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart in project cubrid-manager by CUBRID.
the class ShowBrokerDabaseAction method run.
/**
* Create a new figure in dashboard.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IStructuredSelection selection = (IStructuredSelection) getSelection();
BrokerMonitorPart cmp = (BrokerMonitorPart) selection.getFirstElement();
DashboardPart dp = (DashboardPart) cmp.getParent();
Dashboard db = (Dashboard) dp.getModel();
BrokerNode model = (BrokerNode) cmp.getModel();
BrokerDBListNode brokerDBListNode = db.getBrokerDBListNodeByBroker(model);
if (isChecked()) {
if (null == brokerDBListNode) {
brokerDBListNode = new BrokerDBListNode();
brokerDBListNode.setBrokerNode(model);
db.addBrokerDBListNode(brokerDBListNode);
}
brokerDBListNode.setVisible(true);
} else {
brokerDBListNode.setVisible(false);
}
db.refresh();
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart in project cubrid-manager by CUBRID.
the class ShowBrokerDabaseAction method isSupported.
/**
* Always support
*
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
* @param obj Object
* @return boolean support:true;not support:false;
*/
public boolean isSupported(Object obj) {
IStructuredSelection selection = (IStructuredSelection) getSelection();
if (!(selection.getFirstElement() instanceof BrokerMonitorPart)) {
return false;
}
BrokerMonitorPart cmp = (BrokerMonitorPart) selection.getFirstElement();
DashboardPart dp = (DashboardPart) cmp.getParent();
Dashboard db = (Dashboard) dp.getModel();
BrokerNode model = (BrokerNode) cmp.getModel();
BrokerDBListNode brokerDBListNode = db.getBrokerDBListNodeByBroker(model);
setChecked(null != brokerDBListNode && brokerDBListNode.isVisible());
return true;
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart in project cubrid-manager by CUBRID.
the class AddHostMonitorAction method run.
/**
* Open add host monitor dialog.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Object[] objArr = this.getSelectedObj();
if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
setEnabled(false);
return;
}
DashboardPart dp = (DashboardPart) objArr[0];
Dashboard dashboard = (Dashboard) dp.getModel();
if (dashboard != null) {
AddHostAndDbWizard wizard = new AddHostAndDbWizard(null, dashboard.getHostNodeList(), 0);
CMWizardDialog dialog = new CMWizardDialog(getShell(), wizard);
dialog.setPageSize(660, 380);
int returnCode = dialog.open();
if (returnCode == IDialogConstants.OK_ID) {
List<HostNode> addedHostNodeList = wizard.getAddedHostNodeList();
HAUtil.mergeHostNode(dashboard, addedHostNodeList);
HAUtil.calcLocation(dashboard.getHostNodeList());
}
}
}
Aggregations