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;
}
}
}
});
}
Aggregations