use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject in project convertigo by convertigo.
the class DatabaseObjectDeleteAction method run2.
@Override
protected void run2() throws Exception {
String qname = null;
try {
treeNodesToUpdate = new ArrayList<WrapDatabaseObject>();
WrapDatabaseObject treeObject = null;
WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
dboDoDelete = new HashMap<>(treeObjects.length);
if (treeObjects != null) {
MultipleDeletionDialog dialog = new MultipleDeletionDialog(studio, "Object Deletion", treeObjects.length > 1);
for (int i = 0; i < treeObjects.length; ++i) {
treeObject = (WrapDatabaseObject) treeObjects[i];
String message = treeObject.instanceOf(Project.class) ? java.text.MessageFormat.format("Do you really want to delete the project \"{0}\" and all its sub-objects?", new Object[] { treeObject.getName() }) : java.text.MessageFormat.format("Do you really want to delete the object \"{0}\" and all its sub-objects?", new Object[] { treeObject.getName() });
qname = ((DatabaseObject) treeObject.getObject()).getQName();
if (!dialog.shouldBeDeleted(message)) {
dboDoDelete.put(qname, false);
continue;
}
dboDoDelete.put(qname, true);
if (treeObject.instanceOf(Project.class)) {
((ProjectView) treeObject).closeAllEditors();
} else if (treeObject.instanceOf(Sequence.class)) {
((ProjectView) ((SequenceView) treeObject).getParent()).closeSequenceEditors((Sequence) treeObject.getObject());
} else if (treeObject.instanceOf(Connector.class)) {
((ProjectView) ((ConnectorView) treeObject).getParent()).closeConnectorEditors((Connector) treeObject.getObject());
} else if (treeObject.instanceOf(Step.class)) {
// // We close the editor linked with the SimpleStep (=SequenceJsStep)
// if (treeObject.getObject() instanceof SimpleStep) {
// boolean find = false;
// SimpleStep simpleStep = (SimpleStep) treeObject.getObject();
// IWorkbenchPage page = this.getActivePage();
// IEditorReference[] editors = page.getEditorReferences();
// int _i = 0;
// while (find != true && _i < editors.length) {
// IEditorReference editor = editors[_i];
// IEditorPart editorPart = page.findEditor(editor.getEditorInput());
// if (editorPart != null && editorPart instanceof JscriptStepEditor) {
// JscriptStepEditor jscriptEditor = (JscriptStepEditor) editorPart;
// if (jscriptEditor.getSimpleStepLinked().equals(simpleStep)) {
// find = true;
// page.activate(editorPart);
// page.closeEditor(editorPart, false);
// }
// }
// ++_i;
// }
}
delete(treeObject);
if (treeObject.instanceOf(Project.class)) {
// explorerView.removeProjectTreeObject(treeObject);
} else {
// // prevents treeObject and its childs to receive further TreeObjectEvents
// if (treeObject instanceof TreeObjectListener)
// explorerView.removeTreeObjectListener(treeObject);
// treeObject.removeAllChildren();
}
//
// explorerView.fireTreeObjectRemoved(new TreeObjectEvent(treeObject));
}
}
// Updating the tree and the properties panel
Enumeration<WrapDatabaseObject> enumeration = Collections.enumeration(treeNodesToUpdate);
WrapDatabaseObject parentTreeObject;
while (enumeration.hasMoreElements()) {
parentTreeObject = enumeration.nextElement();
if (parentTreeObject != null) {
// explorerView.reloadTreeObject(parentTreeObject);
// explorerView.setSelectedTreeObject(parentTreeObject);
}
}
//
// Refresh tree to show potential 'broken' steps
// explorerView.refreshTree();
} catch (Exception e) {
throw e;
}
}
use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject in project convertigo by convertigo.
the class DisableMobileRouteEventComponentAction 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(RouteEventComponent.class)) {
// StepView stepTreeObject = (StepView) treeObject;
RouteEventComponent component = (RouteEventComponent) 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.engine.studio.views.projectexplorer.model.WrapObject in project convertigo by convertigo.
the class DisableStatementAction 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(Statement.class)) {
// StepView stepTreeObject = (StepView) treeObject;
Statement statement = (Statement) treeObject.getObject();
statement.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.engine.studio.views.projectexplorer.model.WrapObject in project convertigo by convertigo.
the class EnableExtractionRuleAction 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(ExtractionRule.class)) {
// StepView stepTreeObject = (StepView) treeObject;
ExtractionRule extractionRule = (ExtractionRule) treeObject.getObject();
extractionRule.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();
}
use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject in project convertigo by convertigo.
the class EnableMobileRouteComponentAction 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(RouteComponent.class)) {
// StepView stepTreeObject = (StepView) treeObject;
RouteComponent component = (RouteComponent) 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