use of com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor in project convertigo by convertigo.
the class SequenceExecuteSelectedFromStubAction method run.
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();
if ((treeObject != null) && (treeObject instanceof SequenceTreeObject)) {
SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) treeObject;
openEditors(explorerView, sequenceTreeObject);
Sequence sequence = sequenceTreeObject.getObject();
ProjectTreeObject projectTreeObject = sequenceTreeObject.getProjectTreeObject();
SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
if (sequenceEditor != null) {
getActivePage().activate(sequenceEditor);
sequenceEditor.getDocument(sequence.getName(), true);
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to execute the selected sequence!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor in project convertigo by convertigo.
the class CreateStubFromXMLAction method getXML.
public Document getXML(TreeObject treeObject) throws Exception {
Document dom = XMLUtils.createDom("java");
ProjectTreeObject projectTreeObject = treeObject.getProjectTreeObject();
Object requestable = treeObject.getObject();
if (requestable instanceof Transaction) {
Transaction transaction = (Transaction) requestable;
ConnectorEditor connectorEditor = projectTreeObject.getConnectorEditor((Connector) transaction.getParent());
dom = connectorEditor.getLastGeneratedDocument();
} else if (requestable instanceof Sequence) {
SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor((Sequence) requestable);
dom = sequenceEditor.getLastGeneratedDocument();
}
if (dom == null) {
throw new NoSuchElementException();
}
return dom;
}
use of com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor in project convertigo by convertigo.
the class TestCaseExecuteSelectedAction method run.
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();
if ((treeObject != null) && (treeObject instanceof TestCaseTreeObject)) {
TestCase testCase = (TestCase) treeObject.getObject();
ProjectTreeObject projectTreeObject = treeObject.getProjectTreeObject();
RequestableObject requestable = (RequestableObject) testCase.getParent();
if (requestable instanceof Transaction) {
TransactionTreeObject transactionTreeObject = (TransactionTreeObject) treeObject.getParent().getParent();
transactionTreeObject.getConnectorTreeObject().openConnectorEditor();
Transaction transaction = (Transaction) testCase.getParent();
Connector connector = (Connector) transaction.getParent();
ConnectorEditor connectorEditor = projectTreeObject.getConnectorEditor(connector);
if (connectorEditor != null) {
getActivePage().activate(connectorEditor);
connectorEditor.getDocument(transaction.getName(), testCase.getName(), false);
}
}
if (requestable instanceof Sequence) {
SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) treeObject.getParent().getParent();
new SequenceExecuteSelectedAction().openEditors(explorerView, sequenceTreeObject);
Sequence sequence = (Sequence) testCase.getParent();
SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
if (sequenceEditor != null) {
getActivePage().activate(sequenceEditor);
sequenceEditor.getDocument(sequence.getName(), testCase.getName(), false);
}
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to execute the selected test case!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor in project convertigo by convertigo.
the class SequenceExecuteSelectedAction method 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();
if ((treeObject != null) && (treeObject instanceof SequenceTreeObject)) {
SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) treeObject;
openEditors(explorerView, sequenceTreeObject);
Sequence sequence = sequenceTreeObject.getObject();
ProjectTreeObject projectTreeObject = sequenceTreeObject.getProjectTreeObject();
SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
if (sequenceEditor != null) {
getActivePage().activate(sequenceEditor);
boolean fromStub = action.getId().contains("FromStub");
sequenceEditor.getSequenceEditorPart().getDocument(sequence.getName(), null, fromStub);
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to execute the selected sequence!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor in project convertigo by convertigo.
the class ProjectTreeObject method getSequenceEditor.
public SequenceEditor getSequenceEditor(Sequence sequence) {
SequenceEditor sequenceEditor = null;
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if (activePage != null) {
if (sequence != null) {
IEditorReference[] editorRefs = activePage.getEditorReferences();
for (int i = 0; i < editorRefs.length; i++) {
IEditorReference editorRef = (IEditorReference) editorRefs[i];
try {
IEditorInput editorInput = editorRef.getEditorInput();
if ((editorInput != null) && (editorInput instanceof SequenceEditorInput)) {
if (((SequenceEditorInput) editorInput).is(sequence)) {
sequenceEditor = (SequenceEditor) editorRef.getEditor(true);
break;
}
}
} catch (PartInitException e) {
ConvertigoPlugin.logException(e, "Error while retrieving the sequence editor '" + editorRef.getName() + "'");
}
}
}
}
return sequenceEditor;
}
Aggregations