Search in sources :

Example 1 with ConnectorEditorWrap

use of com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap in project convertigo by convertigo.

the class TestCaseExecuteSelectedAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
        if ((treeObject != null) && (treeObject.instanceOf(TestCase.class))) {
            TestCase testCase = (TestCase) treeObject.getObject();
            ProjectView projectTreeObject = treeObject.getProjectViewObject();
            RequestableObject requestable = (RequestableObject) testCase.getParent();
            if (requestable instanceof Transaction) {
                TransactionView transactionTreeObject = (TransactionView) treeObject.getParent();
                transactionTreeObject.getConnectorTreeObject().openConnectorEditor();
                Transaction transaction = (Transaction) testCase.getParent();
                Connector connector = (Connector) transaction.getParent();
                ConnectorEditorWrap connectorEditor = projectTreeObject.getConnectorEditor(connector);
                if (connectorEditor != null) {
                    // getActivePage().activate(connectorEditor);
                    connectorEditor.getDocument(transaction.getName(), testCase.getName(), false);
                }
            } else if (requestable instanceof Sequence) {
                SequenceView sequenceTreeObject = (SequenceView) treeObject.getParent();
                new SequenceExecuteSelectedAction(studio).openEditors(sequenceTreeObject);
                Sequence sequence = (Sequence) testCase.getParent();
                SequenceEditorWrap sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
                if (sequenceEditor != null) {
                    // getActivePage().activate(sequenceEditor);
                    sequenceEditor.getDocument(sequence.getName(), testCase.getName(), false);
                }
            }
        }
    } catch (Exception e) {
        throw e;
    }
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) ConnectorEditorWrap(com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap) RequestableObject(com.twinsoft.convertigo.beans.core.RequestableObject) Sequence(com.twinsoft.convertigo.beans.core.Sequence) Transaction(com.twinsoft.convertigo.beans.core.Transaction) TestCase(com.twinsoft.convertigo.beans.core.TestCase) SequenceView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.SequenceView) TransactionView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.TransactionView) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) ProjectView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView) SequenceEditorWrap(com.twinsoft.convertigo.engine.studio.editors.sequences.SequenceEditorWrap)

Example 2 with ConnectorEditorWrap

use of com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap in project convertigo by convertigo.

the class TransactionExecuteSelectedAction method run2.

@Override
public void run2() throws Exception {
    try {
        WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
        if ((treeObject != null) && (treeObject.instanceOf(Transaction.class))) {
            TransactionView transactionTreeObject = (TransactionView) treeObject;
            Transaction transaction = transactionTreeObject.getObject();
            transactionTreeObject.getConnectorTreeObject().openConnectorEditor();
            Connector connector = (Connector) transaction.getParent();
            ProjectView projectTreeObject = transactionTreeObject.getProjectView();
            ConnectorEditorWrap connectorEditor = projectTreeObject.getConnectorEditor(connector);
            if (connectorEditor != null) {
                // getActivePage().activate(connectorEditor);
                connectorEditor.getDocument(transaction.getName(), isStubRequested());
            }
        }
    } catch (Throwable e) {
        // ConvertigoPlugin.logException(e, "Unable to execute the selected transaction!");
        throw e;
    }
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) ConnectorEditorWrap(com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap) Transaction(com.twinsoft.convertigo.beans.core.Transaction) TransactionView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.TransactionView) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) ProjectView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView)

Example 3 with ConnectorEditorWrap

use of com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap in project convertigo by convertigo.

the class ProjectView method getConnectorEditor.

public ConnectorEditorWrap getConnectorEditor(Connector connector) {
    ConnectorEditorWrap connectorEditor = connectorToConnectorEditor.get(connector);
    // Create instance if it doesn't exist yet
    if (connectorEditor == null) {
        connectorEditor = new ConnectorEditorWrap(connector);
        connectorToConnectorEditor.put(connector, connectorEditor);
    }
    return connectorEditor;
}
Also used : ConnectorEditorWrap(com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap)

Example 4 with ConnectorEditorWrap

use of com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap in project convertigo by convertigo.

the class TransactionExecuteDefaultAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
        if (treeObject != null) {
            ProjectView projectTreeObject = treeObject.getProjectViewObject();
            Connector connector = null;
            if (treeObject.instanceOf(Connector.class)) {
                ConnectorView connectorTreeObject = (ConnectorView) treeObject;
                connectorTreeObject.openConnectorEditor();
                connector = connectorTreeObject.getObject();
            } else {
                connector = ((Project) projectTreeObject.getObject()).getDefaultConnector();
                ConnectorView connectorTreeObject = (ConnectorView) Studio.getViewFromDbo(connector, studio);
                if (connectorTreeObject != null) {
                    connectorTreeObject.openConnectorEditor();
                }
            }
            Transaction transaction = connector.getDefaultTransaction();
            ConnectorEditorWrap connectorEditor = projectTreeObject.getConnectorEditor(connector);
            if (connectorEditor != null) {
                // getActivePage().activate(connectorEditor);
                connectorEditor.getDocument(transaction.getName(), false);
            }
        }
    } catch (Exception e) {
        throw e;
    }
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) ConnectorEditorWrap(com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap) Transaction(com.twinsoft.convertigo.beans.core.Transaction) ConnectorView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) ProjectView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView)

Aggregations

ConnectorEditorWrap (com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap)4 Connector (com.twinsoft.convertigo.beans.core.Connector)3 Transaction (com.twinsoft.convertigo.beans.core.Transaction)3 ProjectView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView)3 WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)3 TransactionView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.TransactionView)2 RequestableObject (com.twinsoft.convertigo.beans.core.RequestableObject)1 Sequence (com.twinsoft.convertigo.beans.core.Sequence)1 TestCase (com.twinsoft.convertigo.beans.core.TestCase)1 SequenceEditorWrap (com.twinsoft.convertigo.engine.studio.editors.sequences.SequenceEditorWrap)1 ConnectorView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView)1 SequenceView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.SequenceView)1