Search in sources :

Example 16 with UISharedComponent

use of com.twinsoft.convertigo.beans.ngx.components.UISharedComponent 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 17 with UISharedComponent

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

the class NgxBuilder method updateConsumers.

private void updateConsumers(Project to) {
    MobileApplication mobileApplication = project.getMobileApplication();
    ApplicationComponent app = (ApplicationComponent) mobileApplication.getApplicationComponent();
    for (UISharedComponent uisc : app.getSharedComponentList()) {
        updateConsumers(uisc, to);
    }
}
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 18 with UISharedComponent

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

the class NgxBuilder method compTsChanged.

@Override
public void compTsChanged(ISharedComponent sharedComponent, boolean forceTemp) throws EngineException {
    UISharedComponent comp = (UISharedComponent) sharedComponent;
    if (comp != null && initDone) {
        synchronized (comp) {
            writeCompTs(comp);
            moveFiles();
            /*File compDir = compDir(comp);
				File tempTsFile = new File(compDir, comp.getName().toLowerCase() + ".temp.ts");
				if (forceTemp && tempTsFile.exists()) {
					writeCompTempTs(comp);
				}*/
            Engine.logEngine.trace("(MobileBuilder) Handled 'compTsChanged'");
        }
    }
}
Also used : UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)

Example 19 with UISharedComponent

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

the class NgxBuilder method compAdded.

@Override
public void compAdded(final ISharedComponent sharedComponent) throws EngineException {
    UISharedComponent comp = (UISharedComponent) sharedComponent;
    if (comp != null && comp.bNew && initDone) {
        synchronized (comp) {
            addComp(comp);
            moveFiles();
            Engine.logEngine.trace("(MobileBuilder) Handled 'compAdded'");
        }
    }
}
Also used : UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)

Example 20 with UISharedComponent

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

the class NgxPickerContentProvider method addSharedComponents.

private void addSharedComponents(TVObject tvi, Object object) {
    if (object != null) {
        List<? extends UIComponent> list = null;
        if (object instanceof ApplicationComponent) {
            list = ((ApplicationComponent) object).getSharedComponentList();
        } else if (object instanceof UISharedComponent) {
            list = new ArrayList<>(Arrays.asList((UISharedComponent) object));
        }
        if (list != null) {
            for (UIComponent uic : list) {
                if (uic instanceof UISharedComponent) {
                    // do not add to prevent selection on itself or children
                    if (uic.equals(selected)) {
                        return;
                    }
                    // do not add if not parent of selected (popped picker only)
                    boolean showInPicker = true;
                    if (selected != null && selected instanceof UIComponent) {
                        String selectedQName = ((UIComponent) selected).getQName();
                        String uicQName = uic.getQName() + ".";
                        if (!selectedQName.startsWith(uicQName)) {
                            showInPicker = false;
                        }
                    }
                    if (showInPicker) {
                        SourceData sd = null;
                        try {
                            sd = Filter.Shared.toSourceData(new JSONObject().put("priority", uic.priority).put("regular", ((UISharedComponent) uic).isRegular()));
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                        tvi.add(new TVObject(uic.toString(), uic, sd));
                    }
                }
            }
        }
    }
}
Also used : JSONObject(org.codehaus.jettison.json.JSONObject) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) ArrayList(java.util.ArrayList) UIComponent(com.twinsoft.convertigo.beans.ngx.components.UIComponent) JSONException(org.codehaus.jettison.json.JSONException) UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent) SourceData(com.twinsoft.convertigo.beans.ngx.components.MobileSmartSource.SourceData)

Aggregations

UISharedComponent (com.twinsoft.convertigo.beans.ngx.components.UISharedComponent)34 ApplicationComponent (com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent)16 EngineException (com.twinsoft.convertigo.engine.EngineException)15 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)13 UIActionStack (com.twinsoft.convertigo.beans.ngx.components.UIActionStack)13 PageComponent (com.twinsoft.convertigo.beans.ngx.components.PageComponent)11 UIComponent (com.twinsoft.convertigo.beans.ngx.components.UIComponent)11 UIUseShared (com.twinsoft.convertigo.beans.ngx.components.UIUseShared)8 MobileApplication (com.twinsoft.convertigo.beans.core.MobileApplication)7 File (java.io.File)7 IApplicationComponent (com.twinsoft.convertigo.beans.core.IApplicationComponent)6 IOException (java.io.IOException)6 CoreException (org.eclipse.core.runtime.CoreException)6 IPageComponent (com.twinsoft.convertigo.beans.core.IPageComponent)5 UIDynamicAction (com.twinsoft.convertigo.beans.ngx.components.UIDynamicAction)5 UIDynamicInvoke (com.twinsoft.convertigo.beans.ngx.components.UIDynamicInvoke)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 IScriptComponent (com.twinsoft.convertigo.beans.ngx.components.IScriptComponent)4 MobileSmartSourceType (com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType)4 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)4