use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart in project cubrid-manager by CUBRID.
the class ShowBrokerClientAction 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();
ClientNode clientNode = db.getClientNodeByBroker(model);
if (this.isChecked()) {
if (null == clientNode) {
clientNode = new ClientNode();
clientNode.setBrokerNode(model);
db.addClientNode(clientNode);
}
clientNode.setVisible(true);
} else {
clientNode.setVisible(false);
}
db.refresh();
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart 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.BrokerMonitorPart 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.BrokerMonitorPart 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.BrokerMonitorPart in project cubrid-manager by CUBRID.
the class ShowHostAction 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();
Iterator<?> iterator = selection.iterator();
boolean isVisible = true;
while (iterator.hasNext()) {
Object objSelected = iterator.next();
if (objSelected instanceof DatabaseMonitorPart) {
DatabaseMonitorPart cmp = (DatabaseMonitorPart) objSelected;
DatabaseNode dn = ((DatabaseNode) cmp.getModel());
if (!dn.getParent().isVisible()) {
isVisible = false;
break;
}
} else if (objSelected instanceof BrokerMonitorPart) {
BrokerMonitorPart cmp = (BrokerMonitorPart) objSelected;
BrokerNode bn = ((BrokerNode) cmp.getModel());
if (!bn.getParent().isVisible()) {
isVisible = false;
break;
}
}
}
setChecked(isVisible);
return true;
}
Aggregations