Search in sources :

Example 1 with StepSourceEventWrap

use of com.twinsoft.convertigo.engine.studio.views.projectexplorer.StepSourceEventWrap in project convertigo by convertigo.

the class ShowStepInPickerAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
        if (treeObject != null) {
            if (treeObject.instanceOf(DatabaseObject.class)) {
                DatabaseObject selectedDbo = ((DatabaseObjectView) treeObject).getObject();
                if (selectedDbo != null) {
                    StepSourceEventWrap event = null;
                    if (showSource) {
                        if (selectedDbo instanceof Step) {
                            Step step = (Step) selectedDbo;
                            Set<StepSource> sources = step.getSources();
                            if (!sources.isEmpty()) {
                                event = new StepSourceEventWrap(sources.iterator().next());
                            } else {
                                throw new Exception("No Source defined");
                            }
                        }
                    } else {
                        event = new StepSourceEventWrap(selectedDbo);
                    }
                    if (event != null) {
                        SourcePickerViewWrap spv = studio.getSourcePickerView();
                        spv.sourceSelected(event);
                    }
                }
            }
        }
    } catch (Exception e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to show object in Picker!");
    }
}
Also used : StepSource(com.twinsoft.convertigo.beans.core.StepSource) SourcePickerViewWrap(com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) DatabaseObjectView(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.DatabaseObjectView) StepSourceEventWrap(com.twinsoft.convertigo.engine.studio.views.projectexplorer.StepSourceEventWrap) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) Step(com.twinsoft.convertigo.beans.core.Step)

Aggregations

DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)1 Step (com.twinsoft.convertigo.beans.core.Step)1 StepSource (com.twinsoft.convertigo.beans.core.StepSource)1 StepSourceEventWrap (com.twinsoft.convertigo.engine.studio.views.projectexplorer.StepSourceEventWrap)1 DatabaseObjectView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.DatabaseObjectView)1 WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)1 SourcePickerViewWrap (com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap)1