use of com.twinsoft.convertigo.beans.mobile.components.UIComponent in project convertigo by convertigo.
the class SharedComponentWizard method doFinish.
private void doFinish(IProgressMonitor monitor) throws CoreException {
UISharedComponent uisc = null;
UIUseShared uius = null;
try {
if (page1 != null) {
shared_comp_name = page1.getSharedComponentName();
keep_original = page1.keepComponent();
}
if (page2 != null) {
dlg_map = page2.getVariableMap();
}
// Create shared component
uisc = createSharedComponent();
monitor.setTaskName("SharedComponent created");
monitor.worked(1);
// Create UseShared
uius = createUseShared(uisc.getQName());
monitor.setTaskName("UseShared component created");
monitor.worked(1);
// Disable or Remove selected databaseObject(s)
for (DatabaseObject dbo : objectList) {
UIComponent uic = (UIComponent) dbo;
if (keep_original) {
uic.setEnabled(false);
uic.hasChanged = true;
} else {
MobileComponent mc = (MobileComponent) uic.getParent();
if (mc instanceof ApplicationComponent) {
ApplicationComponent parent = (ApplicationComponent) mc;
parent.remove(uic);
parent.hasChanged = true;
} else if (mc instanceof PageComponent) {
PageComponent parent = (PageComponent) mc;
parent.remove(uic);
parent.hasChanged = true;
} else if (mc instanceof UIComponent) {
UIComponent parent = (UIComponent) mc;
parent.remove(uic);
parent.hasChanged = true;
}
}
}
// Set newBean to new shared component
newBean = uisc;
} catch (Exception e) {
try {
if (uisc != null) {
uisc.getParent().remove(uisc);
}
if (uius != null) {
uius.getParent().remove(uius);
}
} catch (Exception ex) {
}
String message = "Unable to create a new object from class '" + this.className + "'.";
ConvertigoPlugin.logException(e, message);
newBean = null;
}
}
use of com.twinsoft.convertigo.beans.mobile.components.UIComponent 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;
}
use of com.twinsoft.convertigo.beans.mobile.components.UIComponent 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(createControlVariable(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;
}
use of com.twinsoft.convertigo.beans.mobile.components.UIComponent in project convertigo by convertigo.
the class DisableMobileUIComponentAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
for (int i = treeObjects.length - 1; i >= 0; --i) {
WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
if (treeObject.instanceOf(UIComponent.class)) {
// StepView stepTreeObject = (StepView) treeObject;
UIComponent component = (UIComponent) treeObject.getObject();
component.setEnabled(false);
// stepTreeObject.setEnabled(true);
// stepTreeObject.hasBeenModified(true);
// TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
// explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
// explorerView.refreshSelectedTreeObjects();
} catch (Throwable e) {
throw e;
// ConvertigoPlugin.logException(e, "Unable to enable step!");
}
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
use of com.twinsoft.convertigo.beans.mobile.components.UIComponent in project convertigo by convertigo.
the class EnableMobileUIComponentAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
for (int i = treeObjects.length - 1; i >= 0; --i) {
WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
if (treeObject.instanceOf(UIComponent.class)) {
// StepView stepTreeObject = (StepView) treeObject;
UIComponent component = (UIComponent) treeObject.getObject();
component.setEnabled(true);
// stepTreeObject.setEnabled(true);
// stepTreeObject.hasBeenModified(true);
// TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
// explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
// explorerView.refreshSelectedTreeObjects();
} catch (Throwable e) {
throw e;
// ConvertigoPlugin.logException(e, "Unable to enable step!");
}
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Aggregations