use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class JavaEditorValueProvider method beforeTempFileOpened.
@Override
public boolean beforeTempFileOpened() {
ProjectConfigurator projConf = new ProjectConfigurator(getProject(), MdwPlugin.getSettings());
projConf.setJava(new NullProgressMonitor());
try {
if (getProject().isRemote() && projConf.isJavaCapable() && !projConf.hasFrameworkJars()) {
FrameworkUpdateDialog updateDlg = new FrameworkUpdateDialog(MdwPlugin.getShell(), MdwPlugin.getSettings(), getProject());
if (updateDlg.open() == Dialog.OK) {
// as
String origVer = getProject().getMdwVersion();
// reported
// by server
// or db
// for
getProject().setMdwVersion(updateDlg.getMdwVersion());
// downloading
projConf.initializeFrameworkJars();
getProject().setMdwVersion(origVer);
}
}
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Framework Jars", getProject());
}
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class ScriptEditorValueProvider method beforeTempFileOpened.
@Override
public boolean beforeTempFileOpened() {
if (isGroovy()) {
ProjectConfigurator projConf = new ProjectConfigurator(getProject(), MdwPlugin.getSettings());
projConf.setGroovy(new NullProgressMonitor());
try {
if (getProject().isRemote() && projConf.isJavaCapable() && !projConf.hasFrameworkJars()) {
FrameworkUpdateDialog updateDlg = new FrameworkUpdateDialog(MdwPlugin.getShell(), MdwPlugin.getSettings(), getProject());
if (updateDlg.open() == Dialog.OK) {
// as
String origVer = getProject().getMdwVersion();
// reported
// by
// server
// or db
// for
getProject().setMdwVersion(updateDlg.getMdwVersion());
// downloading
projConf.initializeFrameworkJars();
getProject().setMdwVersion(origVer);
}
}
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Framework Jars", getProject());
}
}
return true;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator in project mdw-designer by CenturyLinkCloud.
the class WorkflowProject method setJava.
public boolean setJava() {
ProjectConfigurator projConf = new ProjectConfigurator(this, MdwPlugin.getSettings());
if (projConf.isJavaCapable()) {
IProgressMonitor monitor = new NullProgressMonitor();
projConf.setJava(monitor);
try {
if (!projConf.hasFrameworkJars()) {
FrameworkUpdateDialog updateDlg = new FrameworkUpdateDialog(MdwPlugin.getShell(), MdwPlugin.getSettings(), getProject());
if (updateDlg.open() == Dialog.OK) {
String origVer = getProject().getMdwVersion();
// for
getProject().setMdwVersion(updateDlg.getMdwVersion());
// downloading
projConf.initializeFrameworkJars();
projConf.initializeWebAppJars();
getProject().setMdwVersion(origVer);
}
}
} catch (Exception ex) {
PluginMessages.uiError(ex, "Open Java Source", this);
}
return true;
}
return false;
}
use of com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator 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);
}
}
Aggregations