Search in sources :

Example 1 with MergeOrderDialog

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

the class ModifyMergeOrderAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    super.run();
    MergeOrderDialog dialog = new MergeOrderDialog(this.getWorkbenchPart().getSite().getShell(), mergeComponent);
    if (dialog.open() == MergeOrderDialog.OK) {
        for (IConnection connection : mergeComponent.getIncomingConnections()) {
            if (connection.getSource().isStart() && (connection.getSource().getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0 || connection.getSource().getOutgoingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0)) {
                //$NON-NLS-1$
                MessageDialog.openError(//$NON-NLS-1$
                new Shell(), //$NON-NLS-1$
                Messages.getString("ModifyMergeOrderAction.ERROE"), //$NON-NLS-1$
                Messages.getString("ModifyMergeOrderAction.ConnectionModifyError"));
                return;
            }
            if (connection.getSource().getIncomingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0 || connection.getSource().getIncomingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0) {
                //$NON-NLS-1$
                MessageDialog.openError(//$NON-NLS-1$
                new Shell(), //$NON-NLS-1$
                Messages.getString("ModifyMergeOrderAction.ERROE"), //$NON-NLS-1$
                Messages.getString("ModifyMergeOrderAction.ConnectionModifyError"));
                return;
            }
        }
        ChangeMergeOrderCommand cmd = new ChangeMergeOrderCommand(mergeComponent, dialog.getConnectionList());
        execute(cmd);
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) IConnection(org.talend.core.model.process.IConnection) ChangeMergeOrderCommand(org.talend.designer.core.ui.editor.cmd.ChangeMergeOrderCommand) MergeOrderDialog(org.talend.designer.core.ui.dialog.mergeorder.MergeOrderDialog)

Aggregations

Shell (org.eclipse.swt.widgets.Shell)1 IConnection (org.talend.core.model.process.IConnection)1 MergeOrderDialog (org.talend.designer.core.ui.dialog.mergeorder.MergeOrderDialog)1 ChangeMergeOrderCommand (org.talend.designer.core.ui.editor.cmd.ChangeMergeOrderCommand)1