Search in sources :

Example 36 with MobileApplication

use of com.twinsoft.convertigo.beans.core.MobileApplication in project convertigo by convertigo.

the class LaunchMobileApplicationProjectAction method run.

@Override
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) {
            TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
            Object databaseObject = treeObject.getObject();
            if ((databaseObject != null) && (databaseObject instanceof MobileApplication)) {
                MobileApplication mobileApplication = (MobileApplication) databaseObject;
                // Test plateform
                Program.launch(EnginePropertiesManager.getProperty(PropertyName.APPLICATION_SERVER_CONVERTIGO_URL) + "/project.html#" + mobileApplication.getProject() + "?launch=webapp");
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to launch the mobile device selected project!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display)

Aggregations

MobileApplication (com.twinsoft.convertigo.beans.core.MobileApplication)36 IApplicationComponent (com.twinsoft.convertigo.beans.core.IApplicationComponent)16 ApplicationComponent (com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent)12 IPageComponent (com.twinsoft.convertigo.beans.core.IPageComponent)8 MobilePlatform (com.twinsoft.convertigo.beans.core.MobilePlatform)8 IOException (java.io.IOException)8 UISharedComponent (com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)7 Element (org.w3c.dom.Element)7 Project (com.twinsoft.convertigo.beans.core.Project)6 ApplicationComponent (com.twinsoft.convertigo.beans.mobile.components.ApplicationComponent)6 ServiceException (com.twinsoft.convertigo.engine.admin.services.ServiceException)6 File (java.io.File)6 EngineException (com.twinsoft.convertigo.engine.EngineException)5 IOs (com.twinsoft.convertigo.beans.mobileplatforms.IOs)4 AuthenticationException (com.twinsoft.convertigo.engine.AuthenticationException)4 PageComponent (com.twinsoft.convertigo.beans.mobile.components.PageComponent)3 Android (com.twinsoft.convertigo.beans.mobileplatforms.Android)3 PageComponent (com.twinsoft.convertigo.beans.ngx.components.PageComponent)3 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)3 Cursor (org.eclipse.swt.graphics.Cursor)3