Search in sources :

Example 36 with ApplicationComponent

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

the class NgxBuilder method appRootChanged.

@Override
public void appRootChanged(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 'appRootChanged'");
        }
    }
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) IApplicationComponent(com.twinsoft.convertigo.beans.core.IApplicationComponent) File(java.io.File)

Example 37 with ApplicationComponent

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

the class NgxBuilder method compRemoved.

@Override
public void compRemoved(final ISharedComponent sharedComponent) throws EngineException {
    UISharedComponent comp = (UISharedComponent) sharedComponent;
    if (comp != null && initDone) {
        synchronized (comp) {
            MobileApplication mobileApplication = project.getMobileApplication();
            if (mobileApplication != null) {
                ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
                if (application != null) {
                    writeAppSourceFiles(application);
                    deleteUselessCompDir(comp.getName(), comp.getQName());
                    moveFiles();
                    Engine.logEngine.trace("(MobileBuilder) Handled 'compRemoved'");
                    ComponentRefManager.get(Mode.use).removeKey(comp.getQName());
                }
            }
        }
    }
}
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 38 with ApplicationComponent

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

the class NgxBuilder method appCompTsChanged.

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

Example 39 with ApplicationComponent

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

the class SharedComponentWizard method sharedComponentAlreadyExists.

protected boolean sharedComponentAlreadyExists(String sharedComponentName) {
    UIComponent uic = (UIComponent) getFirstInList();
    MobileApplication ma = uic.getProject().getMobileApplication();
    ApplicationComponent app = (ApplicationComponent) ma.getApplicationComponent();
    for (UISharedComponent uisc : app.getSharedComponentList()) {
        if (uisc.getName().equals(sharedComponentName)) {
            return true;
        }
    }
    return false;
}
Also used : MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) UIComponent(com.twinsoft.convertigo.beans.ngx.components.UIComponent) UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)

Example 40 with ApplicationComponent

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

the class SharedComponentWizard method createUseShared.

private UIUseShared createUseShared(String qname) throws Exception {
    UIUseShared uius = new UIUseShared();
    uius.setSharedComponentQName(qname);
    uius.hasChanged = true;
    uius.bNew = true;
    for (String name : dlg_map.keySet()) {
        String value = ovarMap.get(name).keySet().iterator().next();
        uius.add(createUseVariable(dlg_map.get(name), value));
    }
    UIComponent uic = (UIComponent) getLastInList();
    MobileComponent mc = (MobileComponent) uic.getParent();
    if (mc instanceof ApplicationComponent) {
        ApplicationComponent parent = (ApplicationComponent) mc;
        parent.add((DatabaseObject) uius, uic.priority);
    } else if (mc instanceof PageComponent) {
        PageComponent parent = (PageComponent) mc;
        parent.add((DatabaseObject) uius, uic.priority);
    } else if (mc instanceof UIComponent) {
        UIComponent parent = (UIComponent) mc;
        parent.add((DatabaseObject) uius, uic.priority);
    }
    return uius;
}
Also used : ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) UIUseShared(com.twinsoft.convertigo.beans.ngx.components.UIUseShared) UIComponent(com.twinsoft.convertigo.beans.ngx.components.UIComponent) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) PageComponent(com.twinsoft.convertigo.beans.ngx.components.PageComponent) MobileComponent(com.twinsoft.convertigo.beans.ngx.components.MobileComponent)

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