use of com.twinsoft.convertigo.beans.core.StepEvent in project convertigo by convertigo.
the class ChangeToIfFileExistThenElseStepAction method run.
/* (non-Javadoc)
* @see com.twinsoft.convertigo.eclipse.popup.actions.MyAbstractAction#run()
*/
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof IfFileExistStep)) {
IfFileExistStep ifFileExistStep = (IfFileExistStep) databaseObject;
List<Step> list = ifFileExistStep.getSteps();
TreePath[] selectedPaths = new TreePath[list.size()];
for (int i = 0; i < list.size(); i++) {
StepTreeObject stepTreeObject = (StepTreeObject) explorerView.findTreeObjectByUserObject(list.get(i));
selectedPaths[i] = new TreePath(stepTreeObject);
}
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New IfFileExistThenElseStep step
IfFileExistThenElseStep ifFileExistThenElseStep = new IfFileExistThenElseStep(ifFileExistStep.getCondition());
ifFileExistThenElseStep.bNew = true;
ifFileExistThenElseStep.hasChanged = true;
// Add new IfFileExistThenElseStep step to parent
DatabaseObject parentDbo = ifFileExistStep.getParent();
parentDbo.add(ifFileExistThenElseStep);
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(ifFileExistThenElseStep, ifFileExistStep.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(ifFileExistThenElseStep, ifFileExistStep.priority);
// Add Then/Else steps
ThenStep thenStep = new ThenStep();
thenStep.bNew = true;
ifFileExistThenElseStep.addStep(thenStep);
ElseStep elseStep = new ElseStep();
elseStep.bNew = true;
ifFileExistThenElseStep.addStep(elseStep);
// Add new IfFileExistThenElseStep step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, ifFileExistThenElseStep);
treeParent.addChild(stepTreeObject);
StepTreeObject thenTreeObject = new StepTreeObject(explorerView.viewer, thenStep);
stepTreeObject.addChild(thenTreeObject);
StepTreeObject elseTreeObject = new StepTreeObject(explorerView.viewer, elseStep);
stepTreeObject.addChild(elseTreeObject);
// Cut/Paste steps under Then step
if (selectedPaths.length > 0) {
new ClipboardAction(ConvertigoPlugin.clipboardManagerDND).cut(explorerView, selectedPaths, ProjectExplorerView.TREE_OBJECT_TYPE_DBO_STEP);
for (int i = 0; i < ConvertigoPlugin.clipboardManagerDND.objects.length; i++) {
ConvertigoPlugin.clipboardManagerDND.cutAndPaste(ConvertigoPlugin.clipboardManagerDND.objects[i], thenTreeObject);
}
ConvertigoPlugin.clipboardManagerDND.reset();
}
// Delete If step
long oldPriority = ifFileExistStep.priority;
ifFileExistStep.delete();
// Simulate move of If to IfThenElse
ifFileExistThenElseStep.getSequence().fireStepMoved(new StepEvent(ifFileExistThenElseStep, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(ifFileExistThenElseStep));
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to change step to IfFileExistThenElse step!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.beans.core.StepEvent in project convertigo by convertigo.
the class ChangeToIfStepAction method run.
/* (non-Javadoc)
* @see com.twinsoft.convertigo.eclipse.popup.actions.MyAbstractAction#run()
*/
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof IfThenElseStep)) {
IfThenElseStep ifThenElseStep = (IfThenElseStep) databaseObject;
if (ifThenElseStep.hasThenElseSteps()) {
ThenStep thenStep = ifThenElseStep.getThenStep();
List<Step> list = thenStep.getSteps();
TreePath[] selectedPaths = new TreePath[list.size()];
for (int i = 0; i < list.size(); i++) {
StepTreeObject stepTreeObject = (StepTreeObject) explorerView.findTreeObjectByUserObject(list.get(i));
selectedPaths[i] = new TreePath(stepTreeObject);
}
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New jIf step
IfStep ifStep = new IfStep(ifThenElseStep.getCondition());
ifStep.bNew = true;
ifStep.hasChanged = true;
// Add new jIf step to parent
DatabaseObject parentDbo = ifThenElseStep.getParent();
parentDbo.add(ifStep);
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(ifStep, ifThenElseStep.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(ifStep, ifThenElseStep.priority);
// Add new jIf step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, ifStep);
treeParent.addChild(stepTreeObject);
// Cut/Paste steps under jIf step
if (selectedPaths.length > 0) {
new ClipboardAction(ConvertigoPlugin.clipboardManagerDND).cut(explorerView, selectedPaths, ProjectExplorerView.TREE_OBJECT_TYPE_DBO_STEP);
for (int i = 0; i < ConvertigoPlugin.clipboardManagerDND.objects.length; i++) {
ConvertigoPlugin.clipboardManagerDND.cutAndPaste(ConvertigoPlugin.clipboardManagerDND.objects[i], stepTreeObject);
}
ConvertigoPlugin.clipboardManagerDND.reset();
}
// Delete IfThenElse step
long oldPriority = ifThenElseStep.priority;
ifThenElseStep.delete();
// Simulate move of IfThenElse to If
ifStep.getSequence().fireStepMoved(new StepEvent(ifStep, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(ifStep));
}
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to change step to jIf step!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.beans.core.StepEvent in project convertigo by convertigo.
the class ChangeToIfThenElseStepAction method run.
/* (non-Javadoc)
* @see com.twinsoft.convertigo.eclipse.popup.actions.MyAbstractAction#run()
*/
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof IfStep)) {
IfStep ifStep = (IfStep) databaseObject;
List<Step> list = ifStep.getSteps();
TreePath[] selectedPaths = new TreePath[list.size()];
for (int i = 0; i < list.size(); i++) {
StepTreeObject stepTreeObject = (StepTreeObject) explorerView.findTreeObjectByUserObject(list.get(i));
selectedPaths[i] = new TreePath(stepTreeObject);
}
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New IfThenElseStep step
IfThenElseStep ifThenElseStep = new IfThenElseStep(ifStep.getCondition());
ifThenElseStep.bNew = true;
ifThenElseStep.hasChanged = true;
// Add new IfThenElseStep step to parent
DatabaseObject parentDbo = ifStep.getParent();
parentDbo.add(ifThenElseStep);
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(ifThenElseStep, ifStep.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(ifThenElseStep, ifStep.priority);
// Add Then/Else steps
ThenStep thenStep = new ThenStep();
thenStep.bNew = true;
ifThenElseStep.addStep(thenStep);
ElseStep elseStep = new ElseStep();
elseStep.bNew = true;
ifThenElseStep.addStep(elseStep);
// Add new IfThenElseStep step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, ifThenElseStep);
treeParent.addChild(stepTreeObject);
StepTreeObject thenTreeObject = new StepTreeObject(explorerView.viewer, thenStep);
stepTreeObject.addChild(thenTreeObject);
StepTreeObject elseTreeObject = new StepTreeObject(explorerView.viewer, elseStep);
stepTreeObject.addChild(elseTreeObject);
// Cut/Paste steps under Then step
if (selectedPaths.length > 0) {
new ClipboardAction(ConvertigoPlugin.clipboardManagerDND).cut(explorerView, selectedPaths, ProjectExplorerView.TREE_OBJECT_TYPE_DBO_STEP);
for (int i = 0; i < ConvertigoPlugin.clipboardManagerDND.objects.length; i++) {
ConvertigoPlugin.clipboardManagerDND.cutAndPaste(ConvertigoPlugin.clipboardManagerDND.objects[i], thenTreeObject);
}
ConvertigoPlugin.clipboardManagerDND.reset();
}
// Delete If step
long oldPriority = ifStep.priority;
ifStep.delete();
// Simulate move of If to IfThenElse
ifThenElseStep.getSequence().fireStepMoved(new StepEvent(ifThenElseStep, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(ifThenElseStep));
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to change step to jIfThenElse step!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.beans.core.StepEvent in project convertigo by convertigo.
the class ChangeToIsInThenElseStepAction method run.
/* (non-Javadoc)
* @see com.twinsoft.convertigo.eclipse.popup.actions.MyAbstractAction#run()
*/
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
// For IsInStep
if ((databaseObject != null) && (databaseObject instanceof IsInStep)) {
IsInStep isIn = (IsInStep) databaseObject;
List<Step> list = isIn.getSteps();
TreePath[] selectedPaths = new TreePath[list.size()];
for (int i = 0; i < list.size(); i++) {
StepTreeObject stepTreeObject = (StepTreeObject) explorerView.findTreeObjectByUserObject(list.get(i));
selectedPaths[i] = new TreePath(stepTreeObject);
}
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New IfThenElseStep step
IsInThenElseStep ifThenElseStep = new IsInThenElseStep();
// Set properties
ifThenElseStep.setSourceDefinition(isIn.getSourceDefinition());
ifThenElseStep.setTestDefinition(isIn.getTestDefinition());
ifThenElseStep.setComment(isIn.getComment());
ifThenElseStep.setCondition(isIn.getCondition());
ifThenElseStep.setEnabled(isIn.isEnabled());
ifThenElseStep.setOutput(isIn.isOutput());
ifThenElseStep.setName(isIn.getName());
ifThenElseStep.bNew = true;
ifThenElseStep.hasChanged = true;
// Add new IfThenElseStep step to parent
DatabaseObject parentDbo = isIn.getParent();
parentDbo.add(ifThenElseStep);
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(ifThenElseStep, isIn.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(ifThenElseStep, isIn.priority);
// Add Then/Else steps
ThenStep thenStep = new ThenStep();
thenStep.bNew = true;
ifThenElseStep.addStep(thenStep);
ElseStep elseStep = new ElseStep();
elseStep.bNew = true;
ifThenElseStep.addStep(elseStep);
// Add new IfThenElseStep step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, ifThenElseStep);
treeParent.addChild(stepTreeObject);
StepTreeObject thenTreeObject = new StepTreeObject(explorerView.viewer, thenStep);
stepTreeObject.addChild(thenTreeObject);
StepTreeObject elseTreeObject = new StepTreeObject(explorerView.viewer, elseStep);
stepTreeObject.addChild(elseTreeObject);
// Cut/Paste steps under Then step
if (selectedPaths.length > 0) {
new ClipboardAction(ConvertigoPlugin.clipboardManagerDND).cut(explorerView, selectedPaths, ProjectExplorerView.TREE_OBJECT_TYPE_DBO_STEP);
for (int i = 0; i < ConvertigoPlugin.clipboardManagerDND.objects.length; i++) {
ConvertigoPlugin.clipboardManagerDND.cutAndPaste(ConvertigoPlugin.clipboardManagerDND.objects[i], thenTreeObject);
}
ConvertigoPlugin.clipboardManagerDND.reset();
}
// Delete If step
long oldPriority = isIn.priority;
// Save oldName
String oldName = isIn.getName();
// Now delete
isIn.delete();
// Set name after deletion
ifThenElseStep.setName(oldName);
// Simulate move of If to IfThenElse
ifThenElseStep.getSequence().fireStepMoved(new StepEvent(ifThenElseStep, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(ifThenElseStep));
}
}
// For IfExistThenElse step
if ((databaseObject != null) && (databaseObject instanceof IfExistThenElseStep)) {
IfExistThenElseStep ifExistThenElse = (IfExistThenElseStep) databaseObject;
if (ifExistThenElse.hasThenElseSteps()) {
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New IsInThenElse step
IsInThenElseStep isInThenElse = new IsInThenElseStep();
// Set properties
isInThenElse.setSourceDefinition(ifExistThenElse.getSourceDefinition());
isInThenElse.setComment(ifExistThenElse.getComment());
isInThenElse.setCondition(ifExistThenElse.getCondition());
isInThenElse.setEnabled(ifExistThenElse.isEnabled());
isInThenElse.setOutput(ifExistThenElse.isOutput());
isInThenElse.setName(ifExistThenElse.getName());
isInThenElse.bNew = true;
isInThenElse.hasChanged = true;
// Add new IsInThenElse step to parent
DatabaseObject parentDbo = ifExistThenElse.getParent();
parentDbo.add(isInThenElse);
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(isInThenElse, ifExistThenElse.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(isInThenElse, ifExistThenElse.priority);
// Add Then/Else steps
ThenStep thenStep = ifExistThenElse.getThenStep();
ElseStep elseStep = ifExistThenElse.getElseStep();
thenStep.bNew = true;
elseStep.bNew = true;
isInThenElse.addStep(thenStep);
isInThenElse.addStep(elseStep);
// Add new IsInThenElse step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, isInThenElse);
treeParent.addChild(new StepTreeObject(explorerView.viewer, isInThenElse));
stepTreeObject.addChild(new StepTreeObject(explorerView.viewer, thenStep));
stepTreeObject.addChild(new StepTreeObject(explorerView.viewer, elseStep));
// Delete ifExistThenElse step
long oldPriority = ifExistThenElse.priority;
// Save oldName
String oldName = ifExistThenElse.getName();
// Now delete
ifExistThenElse.delete();
// Set name after deletion
isInThenElse.setName(oldName);
// Simulate move of ifExistThenElse to IsInThenElse step
isInThenElse.getSequence().fireStepMoved(new StepEvent(isInThenElse, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(isInThenElse));
}
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to change step to IsInThenElse step!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.beans.core.StepEvent in project convertigo by convertigo.
the class ChangeToElementStepAction method run.
/* (non-Javadoc)
* @see com.twinsoft.convertigo.eclipse.popup.actions.MyAbstractAction#run()
*/
@Override
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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
// Attribute
if ((databaseObject != null) && (databaseObject instanceof AttributeStep)) {
AttributeStep attributeStep = (AttributeStep) databaseObject;
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New Element step
ElementStep jelementStep = new ElementStep();
if (DatabaseObjectsManager.acceptDatabaseObjects(attributeStep.getParent(), jelementStep)) {
// Set properties
jelementStep.setOutput(attributeStep.isOutput());
jelementStep.setEnabled(attributeStep.isEnabled());
jelementStep.setComment(attributeStep.getComment());
jelementStep.setExpression(attributeStep.getExpression());
jelementStep.setNodeText(attributeStep.getNodeText());
jelementStep.setNodeName(attributeStep.getNodeName());
jelementStep.bNew = true;
jelementStep.hasChanged = true;
// Add new Element step to parent
DatabaseObject parentDbo = attributeStep.getParent();
parentDbo.add(jelementStep);
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(jelementStep, attributeStep.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(jelementStep, attributeStep.priority);
// Add new Element step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, attributeStep);
treeParent.addChild(stepTreeObject);
// Delete Attribute step
long oldPriority = attributeStep.priority;
attributeStep.delete();
jelementStep.getSequence().fireStepMoved(new StepEvent(jelementStep, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(jelementStep));
} else {
throw new EngineException("You cannot paste to a " + attributeStep.getParent().getClass().getSimpleName() + " a database object of type " + jelementStep.getClass().getSimpleName());
}
}
}
// XML Element
if ((databaseObject != null) && (databaseObject instanceof XMLElementStep)) {
XMLElementStep elementStep = (XMLElementStep) databaseObject;
TreeParent treeParent = treeObject.getParent();
DatabaseObjectTreeObject parentTreeObject = null;
if (treeParent instanceof DatabaseObjectTreeObject)
parentTreeObject = (DatabaseObjectTreeObject) treeParent;
else
parentTreeObject = (DatabaseObjectTreeObject) treeParent.getParent();
if (parentTreeObject != null) {
// New Element step
ElementStep jelementStep = new ElementStep();
if (DatabaseObjectsManager.acceptDatabaseObjects(elementStep.getParent(), jelementStep)) {
// Set properties
jelementStep.setOutput(elementStep.isOutput());
jelementStep.setEnabled(elementStep.isEnabled());
jelementStep.setComment(elementStep.getComment());
// jelementStep.setSourceDefinition(elementStep.getSourceDefinition());
jelementStep.setNodeText(elementStep.getNodeText());
jelementStep.setNodeName(elementStep.getNodeName());
jelementStep.bNew = true;
jelementStep.hasChanged = true;
// Add new XMLElement step to parent
DatabaseObject parentDbo = elementStep.getParent();
parentDbo.add(jelementStep);
for (Step step : elementStep.getAllSteps()) {
try {
jelementStep.addStep(step);
} catch (Throwable t) {
}
}
// Set correct order
if (parentDbo instanceof StepWithExpressions)
((StepWithExpressions) parentDbo).insertAtOrder(jelementStep, elementStep.priority);
else if (parentDbo instanceof Sequence)
((Sequence) parentDbo).insertAtOrder(jelementStep, elementStep.priority);
// Add new Element step in Tree
StepTreeObject stepTreeObject = new StepTreeObject(explorerView.viewer, elementStep);
treeParent.addChild(stepTreeObject);
// Delete XMLAttribute step
long oldPriority = elementStep.priority;
elementStep.delete();
jelementStep.getSequence().fireStepMoved(new StepEvent(jelementStep, String.valueOf(oldPriority)));
parentTreeObject.hasBeenModified(true);
explorerView.reloadTreeObject(parentTreeObject);
explorerView.setSelectedTreeObject(explorerView.findTreeObjectByUserObject(jelementStep));
} else {
throw new EngineException("You cannot paste to a " + elementStep.getParent().getClass().getSimpleName() + " a database object of type " + jelementStep.getClass().getSimpleName());
}
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to change step to Element step!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations