Search in sources :

Example 31 with ApplicationComponent

use of com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent in project convertigo by convertigo.

the class NgxBuilder method appContributorsChanged.

@Override
public void appContributorsChanged(final IApplicationComponent appComponent) throws EngineException {
    ApplicationComponent app = (ApplicationComponent) appComponent;
    if (app != null && initDone) {
        synchronized (app) {
            writeAppSourceFiles(app);
            moveFiles();
            Engine.logEngine.trace("(MobileBuilder) Handled 'appContributorsChanged'");
        }
    }
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent)

Example 32 with ApplicationComponent

use of com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent in project convertigo by convertigo.

the class NgxBuilder method pageRemoved.

@Override
public void pageRemoved(final IPageComponent pageComponent) throws EngineException {
    PageComponent page = (PageComponent) pageComponent;
    if (page != null && page.isEnabled() && initDone) {
        synchronized (page) {
            MobileApplication mobileApplication = project.getMobileApplication();
            if (mobileApplication != null) {
                ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
                if (application != null) {
                    writeAppSourceFiles(application);
                    deleteUselessPageDir(page.getName());
                    moveFiles();
                    Engine.logEngine.trace("(MobileBuilder) Handled 'pageRemoved'");
                }
            }
        }
    }
}
Also used : MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.ngx.components.PageComponent)

Example 33 with ApplicationComponent

use of com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent in project convertigo by convertigo.

the class NgxBuilder method getFunctionTempTsRelativePath.

@Override
public String getFunctionTempTsRelativePath(final IUIComponent uiComponent) throws EngineException {
    UIComponent uic = (UIComponent) uiComponent;
    IScriptComponent main = uic.getMainScriptComponent();
    if (main != null) {
        File tempTsDir = null;
        String tempTsFileName = null;
        if (main instanceof ApplicationComponent) {
            UIActionStack stack = uic.getSharedAction();
            tempTsDir = stack == null ? appDir : servicesDir;
            tempTsFileName = stack == null ? "app.component.function.temp.ts" : "actionbeans.service.function.temp.ts";
        }
        if (main instanceof PageComponent) {
            PageComponent page = (PageComponent) main;
            String pageName = page.getName();
            tempTsDir = pageDir(page);
            tempTsFileName = pageName.toLowerCase() + ".function.temp.ts";
        }
        if (main instanceof UISharedComponent) {
            UISharedComponent comp = (UISharedComponent) main;
            String compName = comp.getName();
            tempTsDir = compDir(comp);
            tempTsFileName = compName.toLowerCase() + ".function.temp.ts";
        }
        if (tempTsDir != null && tempTsFileName != null) {
            if (uiComponent instanceof UICustomAction) {
                tempTsFileName = "CTS" + ((UICustomAction) uiComponent).priority + ".temp.ts";
            }
            File tempTsFile = new File(tempTsDir, tempTsFileName);
            return tempTsFile.getPath().replace(projectDir.getPath(), File.separator);
        }
    }
    return null;
}
Also used : UIActionStack(com.twinsoft.convertigo.beans.ngx.components.UIActionStack) IScriptComponent(com.twinsoft.convertigo.beans.ngx.components.IScriptComponent) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) IUIComponent(com.twinsoft.convertigo.beans.core.IUIComponent) UIComponent(com.twinsoft.convertigo.beans.ngx.components.UIComponent) UICustomAction(com.twinsoft.convertigo.beans.ngx.components.UICustomAction) File(java.io.File) UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent) IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.ngx.components.PageComponent)

Example 34 with ApplicationComponent

use of com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent in project convertigo by convertigo.

the class NgxBuilder method appStyleChanged.

@Override
public void appStyleChanged(final IApplicationComponent appComponent) throws EngineException {
    ApplicationComponent app = (ApplicationComponent) appComponent;
    if (app != null && initDone) {
        synchronized (app) {
            writeAppStyle(app);
            moveFiles();
            Engine.logEngine.trace("(MobileBuilder) Handled 'appStyleChanged'");
        }
    }
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent)

Example 35 with ApplicationComponent

use of com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent in project convertigo by convertigo.

the class NgxBuilder method getTempTsRelativePath.

@Override
public String getTempTsRelativePath(IApplicationComponent appComponent) throws EngineException {
    ApplicationComponent app = (ApplicationComponent) appComponent;
    try {
        if (app != null) {
            File appComponentTsFile = new File(appDir, "app.component.temp.ts");
            String filePath = appComponentTsFile.getPath().replace(projectDir.getPath(), File.separator);
            return filePath;
        }
    } catch (Exception e) {
    }
    return null;
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) File(java.io.File) IOException(java.io.IOException) EngineException(com.twinsoft.convertigo.engine.EngineException)

Aggregations

ApplicationComponent (com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent)49 IApplicationComponent (com.twinsoft.convertigo.beans.core.IApplicationComponent)25 UISharedComponent (com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)18 PageComponent (com.twinsoft.convertigo.beans.ngx.components.PageComponent)16 EngineException (com.twinsoft.convertigo.engine.EngineException)13 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)12 MobileApplication (com.twinsoft.convertigo.beans.core.MobileApplication)12 File (java.io.File)12 UIComponent (com.twinsoft.convertigo.beans.ngx.components.UIComponent)10 UIActionStack (com.twinsoft.convertigo.beans.ngx.components.UIActionStack)8 JSONException (org.codehaus.jettison.json.JSONException)8 JSONObject (org.codehaus.jettison.json.JSONObject)8 UIUseShared (com.twinsoft.convertigo.beans.ngx.components.UIUseShared)7 PartInitException (org.eclipse.ui.PartInitException)7 UICustomAction (com.twinsoft.convertigo.beans.ngx.components.UICustomAction)6 UIDynamicAction (com.twinsoft.convertigo.beans.ngx.components.UIDynamicAction)6 InvocationTargetException (java.lang.reflect.InvocationTargetException)6 IPageComponent (com.twinsoft.convertigo.beans.core.IPageComponent)5 Project (com.twinsoft.convertigo.beans.core.Project)5 IScriptComponent (com.twinsoft.convertigo.beans.ngx.components.IScriptComponent)5