use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard in project cubrid-manager by CUBRID.
the class AddDatabaseMonitorAction method run.
/**
* open add database 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;
}
HostMonitorPart hostMonPart = (HostMonitorPart) objArr[0];
HostNode hostNode = (HostNode) hostMonPart.getModel();
Dashboard dashboard = (Dashboard) hostMonPart.getParent().getModel();
if (hostNode != null && dashboard != null) {
AddHostAndDbWizard wizard = new AddHostAndDbWizard(hostNode, dashboard.getHostNodeList(), 1);
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());
}
}
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard in project cubrid-manager by CUBRID.
the class DeleteHostMonitorAction method run.
/**
* Delete host and it's databases from dashboard.
*/
public void run() {
if (getSelectedObj() == null || getSelectedObj().length == 0) {
return;
}
HostMonitorPart part = (HostMonitorPart) getSelectedObj()[0];
DashboardPart dashboardPart = (DashboardPart) part.getParent();
Dashboard dashboard = (Dashboard) dashboardPart.getModel();
HostNode hn = (HostNode) part.getModel();
boolean isDelete = CommonUITool.openConfirmBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.bind(Messages.msgConfirmDeleteHost, hn.getName()));
if (!isDelete) {
return;
}
dashboard.removeNode(hn);
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard in project cubrid-manager by CUBRID.
the class MonitorDashboardEditor method initializeGraphicalViewer.
/**
* initialize viewer
*
* @see org.eclipse.gef.ui.parts.GraphicalEditor.initializeGraphicalViewer
*/
protected void initializeGraphicalViewer() {
IEditorInput input = this.getEditorInput();
if (input instanceof ICubridNode) {
ICubridNode node = (ICubridNode) input;
Dashboard dashboard = (Dashboard) node.getAdapter(Dashboard.class);
getGraphicalViewer().setContents(dashboard);
dashboard.refresh();
}
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard in project cubrid-manager by CUBRID.
the class BrokerDBListMonitorPart method refreshVisuals.
/**
* Refreshes this EditPart's <i>visuals</i>. This method is called by
* {@link #refresh()}, and may also be called in response to notifications
* from the model.
*/
protected void refreshVisuals() {
BrokerDBListFigure figure = (BrokerDBListFigure) this.getFigure();
BrokerDBListNode dn = (BrokerDBListNode) this.getModel();
figure.setName(dn.getName());
//Remove defined dabatases.
List<String> dbList = new ArrayList<String>();
dbList.addAll(dn.getDbList());
Dashboard dashboard = (Dashboard) getParent().getModel();
for (DatabaseNode dbNode : dashboard.getAllDatabaseNode()) {
String dbName = dbNode.getDbName() + "@" + dbNode.getParent().getIp();
if (dn.getDbList().contains(dbName)) {
dbList.remove(dbName);
}
}
figure.setDBList(dbList);
BrokerNode broker = dn.getBrokerNode();
figure.setHostConnected(broker.getParent().isConnected());
super.refreshVisuals();
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard in project cubrid-manager by CUBRID.
the class DashboardPart method refreshVisuals.
/**
* refresh Visuals
*/
protected void refreshVisuals() {
Dashboard model = (Dashboard) getModel();
model.getConnectionManager().refreshConnections();
super.refreshVisuals();
}
Aggregations