use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class NgxComponentCreateAction method postCreate.
public void postCreate(TreeObject parentTreeObject, DatabaseObject createdDatabaseObject) throws Exception {
ProjectExplorerView explorerView = getProjectExplorerView();
explorerView.reloadTreeObject(parentTreeObject);
explorerView.objectSelected(new CompositeEvent(createdDatabaseObject));
/* No more needed since #20 correction : see DatabaseObjectTreeObject:setParent(TreeParent parent)
TreeObject selectedTreeObject = explorerView.getFirstSelectedTreeObject();
if ((selectedTreeObject != null) && (selectedTreeObject.getObject().equals(createdDatabaseObject)))
explorerView.fireTreeObjectAdded(new TreeObjectEvent(selectedTreeObject));*/
}
use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class NgxSharedComponentExtractAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DatabaseObjectTreeObject firstSelectedDoTo = GenericUtils.cast(explorerView.getFirstSelectedTreeObject());
DatabaseObjectTreeObject parentTreeObject = firstSelectedDoTo.getParentDatabaseObjectTreeObject();
TreeObject appTo = getAppTreeObject(firstSelectedDoTo);
if (appTo == null) {
throw new Exception("Unable to retrieve target application");
}
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
List<DatabaseObject> objectList = GenericUtils.cast(Arrays.asList(explorerView.getSelectedDatabaseObjects()));
SharedComponentWizard newObjectWizard = new SharedComponentWizard(objectList);
WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
wzdlg.setPageSize(850, 650);
wzdlg.open();
int result = wzdlg.getReturnCode();
if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
for (TreeObject to : treeObjects) {
if (((DatabaseObject) to.getObject()).getParent() == null) {
parentTreeObject.removeChild(firstSelectedDoTo);
}
}
explorerView.reloadTreeObject(appTo);
explorerView.objectSelected(new CompositeEvent(newObjectWizard.newBean));
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new shared component!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class MobileSharedComponentExtractAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DatabaseObjectTreeObject firstSelectedDoTo = GenericUtils.cast(explorerView.getFirstSelectedTreeObject());
DatabaseObjectTreeObject parentTreeObject = firstSelectedDoTo.getParentDatabaseObjectTreeObject();
TreeObject appTo = getAppTreeObject(firstSelectedDoTo);
if (appTo == null) {
throw new Exception("Unable to retrieve target application");
}
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
List<DatabaseObject> objectList = GenericUtils.cast(Arrays.asList(explorerView.getSelectedDatabaseObjects()));
SharedComponentWizard newObjectWizard = new SharedComponentWizard(objectList);
WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
wzdlg.setPageSize(850, 650);
wzdlg.open();
int result = wzdlg.getReturnCode();
if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
for (TreeObject to : treeObjects) {
if (((DatabaseObject) to.getObject()).getParent() == null) {
parentTreeObject.removeChild(firstSelectedDoTo);
}
}
explorerView.reloadTreeObject(appTo);
explorerView.objectSelected(new CompositeEvent(newObjectWizard.newBean));
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new shared component!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations