use of com.centurylink.mdw.cli.Convert in project mdw-designer by CenturyLinkCloud.
the class ConvertPropertiesToYaml method run.
@SuppressWarnings("restriction")
public void run(IAction action) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if (structuredSelection.getFirstElement() instanceof IFile) {
final IFile inputFile = (IFile) structuredSelection.getFirstElement();
final WorkflowProject project = WorkflowProjectManager.getInstance().getWorkflowProject(inputFile.getProject().getName());
BusyIndicator.showWhile(MdwPlugin.getActiveWorkbenchWindow().getShell().getDisplay(), new Runnable() {
public void run() {
try {
Convert convert = new Convert(inputFile.getRawLocation().makeAbsolute().toFile());
convert.setConfigLoc(inputFile.getParent().getRawLocation().makeAbsolute().toFile().getAbsolutePath());
convert.run();
inputFile.getParent().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
} catch (Exception ex) {
PluginMessages.uiError(shell, ex, "Convert Application Properties", project);
}
}
});
}
}
}
Aggregations