use of com.twinsoft.convertigo.eclipse.wizards.new_ngx.ComponentObjectWizard in project convertigo by convertigo.
the class NgxComponentCreateAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
int folderType = -1;
TreeObject parentTreeObject = null;
DatabaseObject databaseObject = null;
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
parentTreeObject = explorerView.getFirstSelectedTreeObject();
if (parentTreeObject instanceof ObjectsFolderTreeObject) {
ObjectsFolderTreeObject folderTreeObject = (ObjectsFolderTreeObject) parentTreeObject;
folderType = folderTreeObject.folderType;
parentTreeObject = folderTreeObject.getParent();
databaseObject = (DatabaseObject) parentTreeObject.getObject();
} else {
databaseObject = (DatabaseObject) parentTreeObject.getObject();
}
ComponentObjectWizard newObjectWizard = new ComponentObjectWizard(databaseObject, databaseObjectClassName, folderType);
WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
wzdlg.setPageSize(850, 650);
wzdlg.open();
int result = wzdlg.getReturnCode();
if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
postCreate(parentTreeObject, newObjectWizard.newBean);
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new database object '" + databaseObjectClassName + "'!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations