use of com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesDialog in project convertigo by convertigo.
the class CouchAddVariables method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
TreeObject parentTreeObject = null;
AbstractCouchDbTransaction databaseObject = null;
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
parentTreeObject = explorerView.getFirstSelectedTreeObject();
if (parentTreeObject.getObject() instanceof AbstractCouchDbTransaction) {
databaseObject = (AbstractCouchDbTransaction) parentTreeObject.getObject();
PropertyDescriptor[] props = CachedIntrospector.getBeanInfo(databaseObject).getPropertyDescriptors();
props = cleanProps(databaseObject, props);
if (props.length > 0) {
CouchVariablesDialog couchVariablesDialog = new CouchVariablesDialog(shell, databaseObject, props);
couchVariablesDialog.open();
explorerView.reloadTreeObject(parentTreeObject);
} else {
MessageBox messageBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.OK);
messageBox.setMessage("No parameters are available for this transaction.");
messageBox.setText("No availables parameters");
messageBox.open();
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new database object '" + databaseObjectClassName + "'!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations