Search in sources :

Example 6 with WrapObject

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

the class EnableMobileRouteEventComponentAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(RouteEventComponent.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                RouteEventComponent component = (RouteEventComponent) treeObject.getObject();
                component.setEnabled(true);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) RouteEventComponent(com.twinsoft.convertigo.beans.mobile.components.RouteEventComponent)

Example 7 with WrapObject

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

the class CheStudio method runAction.

public void runAction(AbstractRunnableAction action) throws Exception {
    try {
        // Get all qnames to generate the response later
        List<String> qnames = new ArrayList<>(getSelectedObjects().size());
        for (WrapObject wrapObject : getSelectedObjects()) {
            WrapDatabaseObject wrapDbo = (WrapDatabaseObject) wrapObject;
            qnames.add(((DatabaseObject) wrapDbo.getObject()).getQName());
        }
        action.run();
        synchronized (this) {
            isActionDone = action.isDone();
            // Generate responses
            for (String qname : qnames) {
                Element xmlResponse = action.toXml(document, qname);
                createResponse(xmlResponse);
            }
            // End of the action: notify
            notify();
        }
    } catch (Exception e) {
        isActionDone = true;
        throw e;
    }
}
Also used : Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Example 8 with WrapObject

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

the class DatabaseObjectDeleteAction method delete.

private void delete(WrapDatabaseObject treeObject) throws ConvertigoException, IOException {
    WrapDatabaseObject parentTreeObject = null;
    WrapObject treeParent = treeObject.getParent();
    DatabaseObject databaseObject = (DatabaseObject) treeObject.getObject();
    DatabaseObject parent = databaseObject.getParent();
    while ((treeParent != null) && (!(treeParent instanceof WrapDatabaseObject))) {
        treeParent = treeParent.getParent();
    }
    if (treeParent != null) {
        parentTreeObject = (WrapDatabaseObject) treeParent;
    }
    delete(databaseObject);
    // Do not save after a deletion anymore
    if (parent != null) {
        parentTreeObject.hasBeenModified(true);
    }
    if ((parentTreeObject != null) && !treeNodesToUpdate.contains(parentTreeObject)) {
        treeNodesToUpdate.add(parentTreeObject);
    }
}
Also used : WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Example 9 with WrapObject

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

the class DisableExtractionRuleAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(ExtractionRule.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                ExtractionRule extractionRule = (ExtractionRule) treeObject.getObject();
                extractionRule.setEnabled(false);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) ExtractionRule(com.twinsoft.convertigo.beans.core.ExtractionRule) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Example 10 with WrapObject

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

the class DisableListenerAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(Listener.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                Listener listener = (Listener) treeObject.getObject();
                listener.setEnabled(false);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : Listener(com.twinsoft.convertigo.beans.core.Listener) WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Aggregations

WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)19 WrapObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject)19 Step (com.twinsoft.convertigo.beans.core.Step)3 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)2 ExtractionRule (com.twinsoft.convertigo.beans.core.ExtractionRule)2 Listener (com.twinsoft.convertigo.beans.core.Listener)2 Statement (com.twinsoft.convertigo.beans.core.Statement)2 RouteActionComponent (com.twinsoft.convertigo.beans.mobile.components.RouteActionComponent)2 RouteComponent (com.twinsoft.convertigo.beans.mobile.components.RouteComponent)2 RouteEventComponent (com.twinsoft.convertigo.beans.mobile.components.RouteEventComponent)2 UIComponent (com.twinsoft.convertigo.beans.mobile.components.UIComponent)2 Project (com.twinsoft.convertigo.beans.core.Project)1 Sequence (com.twinsoft.convertigo.beans.core.Sequence)1 ElseStep (com.twinsoft.convertigo.beans.steps.ElseStep)1 ThenStep (com.twinsoft.convertigo.beans.steps.ThenStep)1 ConvertigoException (com.twinsoft.convertigo.engine.ConvertigoException)1 EngineException (com.twinsoft.convertigo.engine.EngineException)1 MultipleDeletionDialog (com.twinsoft.convertigo.engine.studio.dialogs.MultipleDeletionDialog)1 ProjectView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.ProjectView)1 SequenceView (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.SequenceView)1