Search in sources :

Example 1 with FrameworkUpdateDialog

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

the class JavaSource method beforeFileOpened.

@Override
public void beforeFileOpened() {
    ProjectConfigurator projConf = new ProjectConfigurator(getProject(), MdwPlugin.getSettings());
    IProgressMonitor monitor = new NullProgressMonitor();
    projConf.setJava(monitor);
    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();
                projConf.initializeWebAppJars();
                getProject().setMdwVersion(origVer);
            }
        } else if (!getProject().isCustomTaskManager() && !projConf.hasWebAppJars()) {
            projConf.initializeWebAppJars();
        }
    } catch (CoreException ex) {
        PluginMessages.uiError(ex, "Framework Jars", getProject());
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ProjectConfigurator(com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator) CoreException(org.eclipse.core.runtime.CoreException) FrameworkUpdateDialog(com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog)

Example 2 with FrameworkUpdateDialog

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

the class Script method beforeFileOpened.

@Override
public void beforeFileOpened() {
    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());
        }
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProjectConfigurator(com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator) CoreException(org.eclipse.core.runtime.CoreException) FrameworkUpdateDialog(com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog)

Example 3 with FrameworkUpdateDialog

use of com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog 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;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProjectConfigurator(com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator) CoreException(org.eclipse.core.runtime.CoreException) FrameworkUpdateDialog(com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog)

Example 4 with FrameworkUpdateDialog

use of com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog 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;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProjectConfigurator(com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator) CoreException(org.eclipse.core.runtime.CoreException) FrameworkUpdateDialog(com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog)

Example 5 with FrameworkUpdateDialog

use of com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog 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;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ProjectConfigurator(com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator) FrameworkUpdateDialog(com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog) CoreException(org.eclipse.core.runtime.CoreException) JSONException(org.json.JSONException) GeneralSecurityException(java.security.GeneralSecurityException) IOException(java.io.IOException) MdwSecurityException(com.centurylink.mdw.auth.MdwSecurityException) MalformedURLException(java.net.MalformedURLException)

Aggregations

FrameworkUpdateDialog (com.centurylink.mdw.plugin.designer.dialogs.FrameworkUpdateDialog)5 ProjectConfigurator (com.centurylink.mdw.plugin.project.assembly.ProjectConfigurator)5 CoreException (org.eclipse.core.runtime.CoreException)5 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)5 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 MdwSecurityException (com.centurylink.mdw.auth.MdwSecurityException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 JSONException (org.json.JSONException)1