Search in sources :

Example 6 with Dashboard

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();
}
Also used : BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) BrokerMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart) DashboardPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart) ClientNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.ClientNode) Dashboard(com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 7 with Dashboard

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;
}
Also used : BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) BrokerMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart) DashboardPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart) ClientNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.ClientNode) Dashboard(com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 8 with Dashboard

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();
}
Also used : BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) BrokerMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart) DashboardPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart) BrokerDBListNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerDBListNode) Dashboard(com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 9 with Dashboard

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;
}
Also used : BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) BrokerMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart) DashboardPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart) BrokerDBListNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerDBListNode) Dashboard(com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 10 with Dashboard

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);
}
Also used : HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode) Dashboard(com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard)

Aggregations

Dashboard (com.cubrid.cubridmanager.ui.mondashboard.editor.model.Dashboard)16 HostNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)8 BrokerNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode)7 DashboardPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart)6 BrokerDBListNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerDBListNode)5 ClientNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.ClientNode)4 BrokerMonitorPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 CMWizardDialog (com.cubrid.common.ui.spi.dialog.CMWizardDialog)3 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)3 AddHostAndDbWizard (com.cubrid.cubridmanager.ui.mondashboard.dialog.wizard.AddHostAndDbWizard)3 DatabaseNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.DatabaseNode)3 HostMonitorPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart)3 DefaultCubridNode (com.cubrid.common.ui.spi.model.DefaultCubridNode)2 IXMLMemento (com.cubrid.cubridmanager.core.common.xml.IXMLMemento)2 AddDashboardDialog (com.cubrid.cubridmanager.ui.mondashboard.dialog.AddDashboardDialog)2 Point (org.eclipse.draw2d.geometry.Point)2 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)1