Search in sources :

Example 1 with MdwListInputDialog

use of com.centurylink.mdw.plugin.designer.dialogs.MdwListInputDialog in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method tagVersion.

public void tagVersion(WorkflowElement[] elements) {
    final List<WorkflowPackage> packages = new ArrayList<WorkflowPackage>();
    for (WorkflowElement element : elements) {
        if (element instanceof WorkflowPackage)
            packages.add((WorkflowPackage) element);
        else
            throw new UnsupportedOperationException("Invalid type for tagVersion: " + element.getClass().getName());
    }
    MdwListInputDialog dlg = new MdwListInputDialog(getShell(), "Tag Workflow Package(s)", "Enter tag to apply to package versions", packages);
    if (dlg.open() == Dialog.CANCEL)
        return;
    final String tag = dlg.getInput();
    if (tag == null)
        return;
    BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {

        public void run() {
            for (final WorkflowPackage pkg : packages) {
                try {
                    DesignerProxy dp = pkg.getProject().getDesignerProxy();
                    dp.tagPackage(pkg, tag);
                } catch (Exception ex) {
                    PluginMessages.uiError(ex, "Tag Package", pkg.getProject());
                    break;
                }
            }
        }
    });
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) MdwListInputDialog(com.centurylink.mdw.plugin.designer.dialogs.MdwListInputDialog) DesignerProxy(com.centurylink.mdw.plugin.designer.DesignerProxy) ArrayList(java.util.ArrayList) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement) CoreException(org.eclipse.core.runtime.CoreException) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ConnectException(java.net.ConnectException) IOException(java.io.IOException)

Aggregations

DesignerProxy (com.centurylink.mdw.plugin.designer.DesignerProxy)1 MdwListInputDialog (com.centurylink.mdw.plugin.designer.dialogs.MdwListInputDialog)1 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)1 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ConnectException (java.net.ConnectException)1 ArrayList (java.util.ArrayList)1 CoreException (org.eclipse.core.runtime.CoreException)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 PartInitException (org.eclipse.ui.PartInitException)1