Search in sources :

Example 1 with ErrorMessageDialog

use of org.talend.designer.core.ui.dialog.mergeorder.ErrorMessageDialog 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 ErrorMessageDialog

use of org.talend.designer.core.ui.dialog.mergeorder.ErrorMessageDialog in project tdi-studio-se by Talend.

the class NodeErrorEditPart method performRequest.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#performRequest(org.eclipse.gef.Request)
     */
@Override
public void performRequest(final Request request) {
    if (request.getType().equals("open")) {
        //$NON-NLS-1$
        Node node = ((NodeContainer) ((NodeContainerPart) getParent()).getModel()).getNode();
        if (node.isErrorFlag()) {
            Shell shell = getViewer().getControl().getShell();
            ErrorMessageDialog dialog = new ErrorMessageDialog(new Shell(shell), node);
            dialog.open();
        }
    }
}
Also used : ErrorMessageDialog(org.talend.designer.core.ui.dialog.mergeorder.ErrorMessageDialog) Shell(org.eclipse.swt.widgets.Shell) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)

Aggregations

Shell (org.eclipse.swt.widgets.Shell)2 ErrorMessageDialog (org.talend.designer.core.ui.dialog.mergeorder.ErrorMessageDialog)2 NodeContainer (org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)2 Point (org.eclipse.draw2d.geometry.Point)1 SelectionRequest (org.eclipse.gef.requests.SelectionRequest)1 Node (org.talend.designer.core.ui.editor.nodes.Node)1