Search in sources :

Example 1 with SelectionRequest

use of org.eclipse.gef.requests.SelectionRequest in project tdi-studio-se by Talend.

the class SubjobContainerPart method performRequest.

@Override
public void performRequest(Request req) {
    if (req instanceof SelectionRequest) {
        Point location = ((SelectionRequest) req).getLocation();
        List<NodeContainer> list = this.getModelChildren();
        for (NodeContainer nodeCon : list) {
            if (nodeCon.getErrorMarkRectangle() != null && nodeCon.getErrorMarkRectangle().contains(location)) {
                Node node = nodeCon.getNode();
                if (node.isErrorFlag()) {
                    // getViewer().getControl().getShell();
                    Shell shell = Display.getCurrent().getActiveShell();
                    ErrorMessageDialog dialog = new ErrorMessageDialog(new Shell(shell), node);
                    dialog.open();
                    break;
                }
            } else if (nodeCon.getErrorRectangle() != null && nodeCon.getErrorRectangle().contains(location)) {
                Node node = nodeCon.getNode();
                showModules(node);
            }
        }
    }
    super.performRequest(req);
}
Also used : ErrorMessageDialog(org.talend.designer.core.ui.dialog.mergeorder.ErrorMessageDialog) Shell(org.eclipse.swt.widgets.Shell) SelectionRequest(org.eclipse.gef.requests.SelectionRequest) Node(org.talend.designer.core.ui.editor.nodes.Node) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer) Point(org.eclipse.draw2d.geometry.Point)

Example 2 with SelectionRequest

use of org.eclipse.gef.requests.SelectionRequest in project cubrid-manager by CUBRID.

the class MonitorDetailAction method run.

/**
	 * Open monitor detail windows.
	 */
public void run() {
    Object[] objArr = this.getSelectedObj();
    if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
        setEnabled(false);
        return;
    }
    HANodePart part = null;
    if (objArr[0] instanceof HostMonitorPart) {
        part = (HostMonitorPart) objArr[0];
    } else if (objArr[0] instanceof DatabaseMonitorPart) {
        part = (DatabaseMonitorPart) objArr[0];
    } else if (objArr[0] instanceof BrokerMonitorPart) {
        part = (BrokerMonitorPart) objArr[0];
    }
    if (part != null) {
        SelectionRequest sr = new SelectionRequest();
        sr.setType(RequestConstants.REQ_OPEN);
        part.performRequest(sr);
    }
}
Also used : BrokerMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart) SelectionRequest(org.eclipse.gef.requests.SelectionRequest) HostMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart) DatabaseMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DatabaseMonitorPart) HANodePart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart)

Aggregations

SelectionRequest (org.eclipse.gef.requests.SelectionRequest)2 BrokerMonitorPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart)1 DatabaseMonitorPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DatabaseMonitorPart)1 HANodePart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart)1 HostMonitorPart (com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart)1 Point (org.eclipse.draw2d.geometry.Point)1 Shell (org.eclipse.swt.widgets.Shell)1 ErrorMessageDialog (org.talend.designer.core.ui.dialog.mergeorder.ErrorMessageDialog)1 NodeContainer (org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)1 Node (org.talend.designer.core.ui.editor.nodes.Node)1