use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject in project convertigo by convertigo.
the class DatabaseObjectCreateAction 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;
DatabaseObject databaseObject = null;
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
parentTreeObject = explorerView.getFirstSelectedTreeObject();
if (parentTreeObject instanceof ObjectsFolderTreeObject) {
parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
databaseObject = (DatabaseObject) parentTreeObject.getObject();
} else {
databaseObject = (DatabaseObject) parentTreeObject.getObject();
}
NewObjectWizard newObjectWizard = new NewObjectWizard(databaseObject, databaseObjectClassName);
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();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject in project convertigo by convertigo.
the class CreateNgxUIComponentAction method selectionChanged.
public void selectionChanged(IAction action, ISelection selection) {
try {
boolean enable = true;
super.selectionChanged(action, selection);
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
if (treeObject instanceof ObjectsFolderTreeObject) {
ObjectsFolderTreeObject oft = (ObjectsFolderTreeObject) treeObject;
if (oft.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_PAGES) {
enable = false;
} else {
TreeParent treeParent = oft.getParent();
enable = treeParent != null && treeParent instanceof NgxComponentTreeObject;
}
} else if (treeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
enable = actionModel.isEnabled;
}
action.setEnabled(enable);
} catch (Exception e) {
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject in project convertigo by convertigo.
the class CreateTestCaseAction method selectionChanged.
public void selectionChanged(IAction action, ISelection selection) {
try {
boolean enable = true;
super.selectionChanged(action, selection);
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
if (treeObject instanceof ObjectsFolderTreeObject) {
enable = ((ObjectsFolderTreeObject) treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_TESTCASES;
} else {
DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
enable = actionModel.isEnabled;
}
action.setEnabled(enable);
} catch (Exception e) {
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject in project convertigo by convertigo.
the class CreatePoolAction method selectionChanged.
public void selectionChanged(IAction action, ISelection selection) {
try {
boolean enable = true;
super.selectionChanged(action, selection);
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
if (treeObject instanceof ObjectsFolderTreeObject)
enable = ((ObjectsFolderTreeObject) treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_POOLS;
else if (treeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
enable = actionModel.isEnabled;
}
action.setEnabled(enable);
} catch (Exception e) {
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject in project convertigo by convertigo.
the class CreateMobileRouteEventComponentAction method selectionChanged.
public void selectionChanged(IAction action, ISelection selection) {
try {
boolean enable = true;
super.selectionChanged(action, selection);
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
if (treeObject instanceof ObjectsFolderTreeObject) {
ObjectsFolderTreeObject ofto = (ObjectsFolderTreeObject) treeObject;
enable = ofto.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_EVENTS;
treeObject = ofto.getParent();
}
if (enable && treeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
enable = actionModel.isEnabled;
}
action.setEnabled(enable);
} catch (Exception e) {
}
}
Aggregations