use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView in project convertigo by convertigo.
the class SequenceExecuteSelectedAction method openEditors.
private void openEditors(/*ProjectExplorerView explorerView, */
List<Step> steps, Set<SequenceStep> alreadyOpened) {
for (Step step : steps) {
if (step.isEnabled()) {
if (step instanceof SequenceStep) {
SequenceStep sequenceStep = (SequenceStep) step;
String projectName = sequenceStep.getProjectName();
// load project if necessary
if (!step.getSequence().getProject().getName().equals(projectName)) {
// loadProject(explorerView, projectName);
}
if (alreadyOpened.contains(sequenceStep)) {
// avoid sequence recursion
return;
}
alreadyOpened.add(sequenceStep);
try {
// ProjectTreeObject projectTreeObject = (ProjectTreeObject)explorerView.getProjectRootObject(projectName);
Project p = step.getProject();
Sequence subSequence = p.getSequenceByName(sequenceStep.getSequenceName());
SequenceView subSequenceTreeObject = (SequenceView) Studio.getViewFromDbo(subSequence, studio);
// recurse on sequence
openEditors(/*explorerView, */
subSequenceTreeObject, alreadyOpened);
} catch (EngineException e) {
}
} else if (step instanceof TransactionStep) {
TransactionStep transactionStep = (TransactionStep) step;
String projectName = transactionStep.getProjectName();
if (!step.getSequence().getProject().getName().equals(projectName)) {
// loadProject(explorerView, projectName); // load project if necessary
}
try {
// ProjectTreeObject projectTreeObject = (ProjectTreeObject)explorerView.getProjectRootObject(projectName);
Project project = Engine.theApp.databaseObjectsManager.getProjectByName(projectName);
ProjectView projectTreeObject = new ProjectView(project, studio);
Connector connector = projectTreeObject.getObject().getConnectorByName(transactionStep.getConnectorName());
ConnectorView connectorTreeObject = new ConnectorView(connector, studio);
// open connector editor
connectorTreeObject.openConnectorEditor();
} catch (EngineException e) {
}
} else if (step instanceof StepWithExpressions) {
openEditors(/*explorerView, */
((StepWithExpressions) step).getSteps(), alreadyOpened);
}
}
}
}
use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView in project convertigo by convertigo.
the class LaunchConnectorEditorAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
((ConnectorView) treeObject).launchEditor();
} catch (Exception e) {
throw e;
}
}
use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ConnectorView 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;
}
}
Aggregations