Search in sources :

Example 1 with ProjectDeployDialog

use of com.twinsoft.convertigo.eclipse.dialogs.ProjectDeployDialog in project convertigo by convertigo.

the class ProjectDeployAction method run.

public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
    Shell shell = getParentShell();
    shell.setCursor(waitCursor);
    try {
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            ProjectTreeObject projectTreeObject = (ProjectTreeObject) explorerView.getFirstSelectedTreeObject();
            Project project = projectTreeObject.getObject();
            if (projectTreeObject.hasChanged() && !projectTreeObject.save(true)) {
                return;
            }
            ArchiveExportOptionDialog dlg = new ArchiveExportOptionDialog(shell, project, true);
            if (dlg.open() != Window.OK) {
                return;
            }
            if (!dlg.getVersion().equals(project.getVersion())) {
                project.setVersion(dlg.getVersion());
                project.hasChanged = true;
                projectTreeObject.save(false);
            }
            explorerView.refreshTreeObject(projectTreeObject);
            ProjectDeployDialog projectDeployDialog = new ProjectDeployDialog(shell, project, dlg.getArchiveExportOptions());
            projectDeployDialog.open();
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to deploy the project!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Project(com.twinsoft.convertigo.beans.core.Project) Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) ArchiveExportOptionDialog(com.twinsoft.convertigo.eclipse.dialogs.ArchiveExportOptionDialog) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) Cursor(org.eclipse.swt.graphics.Cursor) ProjectDeployDialog(com.twinsoft.convertigo.eclipse.dialogs.ProjectDeployDialog) Display(org.eclipse.swt.widgets.Display)

Aggregations

Project (com.twinsoft.convertigo.beans.core.Project)1 ArchiveExportOptionDialog (com.twinsoft.convertigo.eclipse.dialogs.ArchiveExportOptionDialog)1 ProjectDeployDialog (com.twinsoft.convertigo.eclipse.dialogs.ProjectDeployDialog)1 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)1 ProjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject)1 Cursor (org.eclipse.swt.graphics.Cursor)1 Display (org.eclipse.swt.widgets.Display)1 Shell (org.eclipse.swt.widgets.Shell)1