use of com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog in project mdw-designer by CenturyLinkCloud.
the class ProjectUpdateAction method run.
/**
* @see IActionDelegate#run(IAction)
*/
public void run(final IAction action) {
IProject project = null;
WorkflowProject workflowProject = null;
try {
if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).getFirstElement() instanceof IProject) {
project = (IProject) ((IStructuredSelection) selection).getFirstElement();
workflowProject = WorkflowProjectManager.getInstance().getWorkflowProject(project);
}
if (workflowProject == null) {
MessageDialog.openError(shell, "MDW Update", "Selection must be a Workflow project.");
return;
}
final ProjectUpdater updater = new ProjectUpdater(workflowProject, MdwPlugin.getSettings());
if (action.getId().equals("mdw.workflow.updateFrameworkJars")) {
updater.updateFrameworkJars(null);
ExtensionModulesUpdater modulesUpdater = new ExtensionModulesUpdater(workflowProject);
modulesUpdater.doUpdate(shell);
} else if (action.getId().equals("mdw.workflow.associateFrameworkSourceCode")) {
ProgressMonitorDialog pmDialog = new MdwProgressMonitorDialog(shell);
final WorkflowProject wfProject = workflowProject;
pmDialog.run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Setting Java source attachment locations", 100);
monitor.worked(20);
ProjectConfigurator configurator = new ProjectConfigurator(wfProject, MdwPlugin.getSettings());
try {
configurator.createFrameworkSourceCodeAssociations(shell, monitor);
} catch (CoreException ex) {
PluginMessages.log(ex);
}
}
});
}
} catch (Exception ex) {
PluginMessages.log(ex);
}
}
use of com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method inflateCliCloudProject.
public void inflateCliCloudProject() {
try {
IRunnableWithProgress loader = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
monitor.beginTask("Inflating Workflow Project", 250);
monitor.worked(5);
// Download the templates
Init init = new Init(new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile() + "/" + workflowProject.getName()));
if (workflowProject.getMdwVersion().indexOf("SNAPSHOT") > -1)
init.setSnapshots(true);
init.setMdwVersion(workflowProject.getMdwVersion());
init.setDiscoveryUrl(MdwPlugin.getSettings().getMdwReleasesUrl());
monitor.subTask("Downloading Templates");
monitor.worked(10);
init.run(new SwtProgressMonitor(monitor));
createGitRepository(monitor);
IProject sourceProject = workflowProject.getSourceProject();
PluginUtil.createFoldersAsNeeded(sourceProject, sourceProject.getFolder("/build/classes"), monitor);
PluginUtil.createFoldersAsNeeded(sourceProject, sourceProject.getFolder("/src/main/java"), monitor);
ProjectUpdater updater = new ProjectUpdater(getProject(), MdwPlugin.getSettings());
updater.updateFrameworkJars(new SubProgressMonitor(monitor, 150));
workflowProject.refreshProject();
} catch (Exception ex) {
throw new InvocationTargetException(ex);
}
}
};
ProgressMonitorDialog progMonDlg = new MdwProgressMonitorDialog(MdwPlugin.getShell());
progMonDlg.run(true, false, loader);
} catch (Exception ex) {
PluginMessages.uiError(ex, "Create Cloud Project", workflowProject);
}
}
Aggregations