use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard 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.model.Dashboard 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.model.Dashboard 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.model.Dashboard 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.model.Dashboard in project cubrid-manager by CUBRID.
the class AddDashboardDialog method buttonPressed.
/**
* When press button,call it
*
* @param buttonId the button id
*/
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
if (dashboard == null) {
dashboard = new Dashboard();
}
String dashboardNode = dashboardNameText.getText();
dashboard.setName(dashboardNode);
for (int i = 0; i < hostNodeList.size(); i++) {
HostNode node = hostNodeList.get(i);
node.setDbNodeList(node.getCopyedDbNodeList());
node.setBrokerNodeList(node.getCopyedBrokerNodeList());
}
dashboard.setChildNodeList(hostNodeList);
HAUtil.calcLocation(dashboard.getHostNodeList());
}
super.buttonPressed(buttonId);
}
Aggregations