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'");
}
}
}
}
}
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'");
}
}
}
}
}
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;
}
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);
}
}
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'");
}
}
}
Aggregations