Search in sources :

Example 16 with ApplicationComponent

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

the class NgxBuilder method compRenamed.

@Override
public void compRenamed(final ISharedComponent sharedComponent, final String oldName) throws EngineException {
    UISharedComponent comp = (UISharedComponent) sharedComponent;
    if (comp != null && initDone) {
        synchronized (comp) {
            String newName = comp.getName();
            String newQName = comp.getQName();
            String oldQName = newQName.replace("." + newName, "." + oldName);
            ComponentRefManager.get(Mode.use).copyKey(oldQName, newQName);
            MobileApplication mobileApplication = project.getMobileApplication();
            if (mobileApplication != null) {
                ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
                if (application != null) {
                    writeCompSourceFiles(comp);
                    writeAppSourceFiles(application);
                    deleteUselessCompDir(oldName, oldQName);
                    moveFiles();
                    Engine.logEngine.trace("(MobileBuilder) Handled 'compRenamed'");
                }
            }
        }
    }
}
Also used : MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)

Example 17 with ApplicationComponent

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

the class NgxBuilder method pageDisabled.

@Override
public void pageDisabled(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) {
                    writePageSourceFiles(page);
                    writeAppSourceFiles(application);
                    moveFiles();
                    Engine.logEngine.trace("(MobileBuilder) Handled 'pageDisabled'");
                }
            }
        }
    }
}
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 18 with ApplicationComponent

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

the class DirectoryWatcherService method getCompQName.

private String getCompQName(String compName) {
    MobileApplication mobileApplication = project.getMobileApplication();
    ApplicationComponent app = (ApplicationComponent) mobileApplication.getApplicationComponent();
    for (UISharedComponent uisc : app.getSharedComponentList()) {
        if (compName.equals(uisc.getName().toLowerCase())) {
            return uisc.getQName();
        }
    }
    return null;
}
Also used : MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)

Example 19 with ApplicationComponent

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

the class NgxBuilder method writeAppComponentTempTs.

@Override
public void writeAppComponentTempTs(final IApplicationComponent appComponent) throws EngineException {
    ApplicationComponent app = (ApplicationComponent) appComponent;
    try {
        if (app != null) {
            File appTsFile = new File(appDir, "app.component.ts");
            synchronized (writtenFiles) {
                if (writtenFiles.contains(appTsFile)) {
                    File appTsFileTmp = toTmpFile(appTsFile);
                    if (appTsFileTmp.exists()) {
                        appTsFile = appTsFileTmp;
                    }
                }
            }
            File tempTsFile = new File(appDir, "app.component.temp.ts");
            // Write file (do not need delay)
            FileUtils.copyFile(appTsFile, tempTsFile);
        }
    } catch (Exception e) {
        throw new EngineException("Unable to write ionic app component temp ts file", e);
    }
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) EngineException(com.twinsoft.convertigo.engine.EngineException) File(java.io.File) IOException(java.io.IOException) EngineException(com.twinsoft.convertigo.engine.EngineException)

Example 20 with ApplicationComponent

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

the class NgxBuilder method appRouteChanged.

@Override
public void appRouteChanged(final IApplicationComponent appComponent) throws EngineException {
    ApplicationComponent app = (ApplicationComponent) appComponent;
    if (app != null && initDone) {
        synchronized (app) {
            writeAppComponentTs(app);
            moveFiles();
            File appComponentTsFile = new File(appDir, "app.component.temp.ts");
            if (appComponentTsFile.exists()) {
                writeAppComponentTempTs(app);
            }
            Engine.logEngine.trace("(MobileBuilder) Handled 'appRouteChanged'");
        }
    }
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) File(java.io.File)

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