Search in sources :

Example 11 with IPageComponent

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

the class NgxBuilder method pageModuleTsChanged.

@Override
public synchronized void pageModuleTsChanged(final IPageComponent pageComponent) throws EngineException {
    PageComponent page = (PageComponent) pageComponent;
    if (page != null && page.isEnabled() && initDone) {
        writePageModuleTs(page);
        moveFiles();
        Engine.logEngine.trace("(MobileBuilder) Handled 'pageModuleTsChanged'");
    }
}
Also used : IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.ngx.components.PageComponent)

Example 12 with IPageComponent

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

the class Ionic3Builder method pageRenamed.

@Override
public void pageRenamed(final IPageComponent pageComponent, final String oldName) 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);
                    deleteUselessDir(oldName);
                    moveFiles();
                    Engine.logEngine.trace("(MobileBuilder) Handled 'pageRenamed'");
                }
            }
        }
    }
}
Also used : MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) ApplicationComponent(com.twinsoft.convertigo.beans.mobile.components.ApplicationComponent) IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.mobile.components.PageComponent)

Example 13 with IPageComponent

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

the class Ionic3Builder method getTempTsRelativePath.

@Override
public String getTempTsRelativePath(final IPageComponent pageComponent) throws EngineException {
    PageComponent page = (PageComponent) pageComponent;
    try {
        if (page != null) {
            String pageName = page.getName();
            File pageDir = new File(ionicWorkDir, "src/pages/" + pageName);
            File tempTsFile = new File(pageDir, pageName.toLowerCase() + ".temp.ts");
            String filePath = tempTsFile.getPath().replace(projectDir.getPath(), File.separator);
            return filePath;
        }
    } catch (Exception e) {
        throw new EngineException("Unable to write page temp ts file", e);
    }
    return null;
}
Also used : EngineException(com.twinsoft.convertigo.engine.EngineException) File(java.io.File) IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.mobile.components.PageComponent) IOException(java.io.IOException) EngineException(com.twinsoft.convertigo.engine.EngineException)

Example 14 with IPageComponent

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

the class Ionic3Builder 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) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) ApplicationComponent(com.twinsoft.convertigo.beans.mobile.components.ApplicationComponent) IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.mobile.components.PageComponent)

Example 15 with IPageComponent

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

the class Ionic3Builder 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);
                    deleteUselessDir(page.getName());
                    moveFiles();
                    Engine.logEngine.trace("(MobileBuilder) Handled 'pageRemoved'");
                }
            }
        }
    }
}
Also used : MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) ApplicationComponent(com.twinsoft.convertigo.beans.mobile.components.ApplicationComponent) IPageComponent(com.twinsoft.convertigo.beans.core.IPageComponent) PageComponent(com.twinsoft.convertigo.beans.mobile.components.PageComponent)

Aggregations

IPageComponent (com.twinsoft.convertigo.beans.core.IPageComponent)22 PageComponent (com.twinsoft.convertigo.beans.mobile.components.PageComponent)11 PageComponent (com.twinsoft.convertigo.beans.ngx.components.PageComponent)11 IApplicationComponent (com.twinsoft.convertigo.beans.core.IApplicationComponent)6 MobileApplication (com.twinsoft.convertigo.beans.core.MobileApplication)6 File (java.io.File)6 EngineException (com.twinsoft.convertigo.engine.EngineException)4 IOException (java.io.IOException)4 ApplicationComponent (com.twinsoft.convertigo.beans.mobile.components.ApplicationComponent)3 ApplicationComponent (com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent)3 Matcher (java.util.regex.Matcher)2 Pattern (java.util.regex.Pattern)2