Search in sources :

Example 6 with ProjectView

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView 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

ProjectView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView)6 WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)5 Connector (com.twinsoft.convertigo.beans.core.Connector)4 Sequence (com.twinsoft.convertigo.beans.core.Sequence)4 SequenceView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.SequenceView)4 Transaction (com.twinsoft.convertigo.beans.core.Transaction)3 EngineException (com.twinsoft.convertigo.engine.EngineException)3 ConnectorEditorWrap (com.twinsoft.convertigo.engine.studio.editors.connectors.ConnectorEditorWrap)3 Project (com.twinsoft.convertigo.beans.core.Project)2 Step (com.twinsoft.convertigo.beans.core.Step)2 SequenceEditorWrap (com.twinsoft.convertigo.engine.studio.editors.sequences.SequenceEditorWrap)2 ConnectorView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView)2 TransactionView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.TransactionView)2 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)1 RequestableObject (com.twinsoft.convertigo.beans.core.RequestableObject)1 StepWithExpressions (com.twinsoft.convertigo.beans.core.StepWithExpressions)1 TestCase (com.twinsoft.convertigo.beans.core.TestCase)1 ElseStep (com.twinsoft.convertigo.beans.steps.ElseStep)1 SequenceStep (com.twinsoft.convertigo.beans.steps.SequenceStep)1 ThenStep (com.twinsoft.convertigo.beans.steps.ThenStep)1