Search in sources :

Example 21 with TransAction

use of org.pentaho.di.core.undo.TransAction in project pentaho-kettle by pentaho.

the class Spoon method redoAction.

public void redoAction(UndoInterface undoInterface) {
    if (undoInterface == null) {
        return;
    }
    TransAction ta = undoInterface.nextUndo();
    if (ta == null) {
        return;
    }
    // something changed: change the menu
    setUndoMenu(undoInterface);
    if (undoInterface instanceof TransMeta) {
        delegates.trans.redoTransformationAction((TransMeta) undoInterface, ta);
        if (ta.getType() == TransAction.TYPE_ACTION_DELETE_HOP) {
            // something changed: change the menu
            setUndoMenu(undoInterface);
            ta = undoInterface.viewNextUndo();
            if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_STEP) {
                ta = undoInterface.nextUndo();
                delegates.trans.redoTransformationAction((TransMeta) undoInterface, ta);
            }
        }
    }
    if (undoInterface instanceof JobMeta) {
        delegates.jobs.redoJobAction((JobMeta) undoInterface, ta);
        if (ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_HOP) {
            // something changed: change the menu
            setUndoMenu(undoInterface);
            ta = undoInterface.viewNextUndo();
            if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_ENTRY) {
                ta = undoInterface.nextUndo();
                delegates.jobs.redoJobAction((JobMeta) undoInterface, ta);
            }
        }
    }
    // Put what we redo in focus
    if (undoInterface instanceof TransMeta) {
        TransGraph transGraph = delegates.trans.findTransGraphOfTransformation((TransMeta) undoInterface);
        transGraph.forceFocus();
    }
    if (undoInterface instanceof JobMeta) {
        JobGraph jobGraph = delegates.jobs.findJobGraphOfJob((JobMeta) undoInterface);
        jobGraph.forceFocus();
    }
}
Also used : TransAction(org.pentaho.di.core.undo.TransAction) JobMeta(org.pentaho.di.job.JobMeta) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransMeta(org.pentaho.di.trans.TransMeta) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Example 22 with TransAction

use of org.pentaho.di.core.undo.TransAction in project pentaho-kettle by pentaho.

the class Spoon method undoAction.

public void undoAction(UndoInterface undoInterface) {
    if (undoInterface == null) {
        return;
    }
    TransAction ta = undoInterface.previousUndo();
    if (ta == null) {
        return;
    }
    // something changed: change the menu
    setUndoMenu(undoInterface);
    if (undoInterface instanceof TransMeta) {
        delegates.trans.undoTransformationAction((TransMeta) undoInterface, ta);
        if (ta.getType() == TransAction.TYPE_ACTION_DELETE_STEP) {
            // something changed: change the menu
            setUndoMenu(undoInterface);
            handleSelectedStepOnUndo((TransMeta) undoInterface);
            ta = undoInterface.viewPreviousUndo();
            if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_HOP) {
                ta = undoInterface.previousUndo();
                delegates.trans.undoTransformationAction((TransMeta) undoInterface, ta);
            }
        }
    }
    if (undoInterface instanceof JobMeta) {
        delegates.jobs.undoJobAction((JobMeta) undoInterface, ta);
        if (ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_ENTRY) {
            // something changed: change the menu
            setUndoMenu(undoInterface);
            ta = undoInterface.viewPreviousUndo();
            if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_HOP) {
                ta = undoInterface.previousUndo();
                delegates.jobs.undoJobAction((JobMeta) undoInterface, ta);
            }
        }
    }
    // Put what we undo in focus
    if (undoInterface instanceof TransMeta) {
        TransGraph transGraph = delegates.trans.findTransGraphOfTransformation((TransMeta) undoInterface);
        transGraph.forceFocus();
    }
    if (undoInterface instanceof JobMeta) {
        JobGraph jobGraph = delegates.jobs.findJobGraphOfJob((JobMeta) undoInterface);
        jobGraph.forceFocus();
    }
}
Also used : TransAction(org.pentaho.di.core.undo.TransAction) JobMeta(org.pentaho.di.job.JobMeta) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransMeta(org.pentaho.di.trans.TransMeta) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Aggregations

TransAction (org.pentaho.di.core.undo.TransAction)22 Point (org.eclipse.swt.graphics.Point)10 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)7 TableItem (org.eclipse.swt.widgets.TableItem)6 Point (org.pentaho.di.core.gui.Point)4 JobMeta (org.pentaho.di.job.JobMeta)2 TransMeta (org.pentaho.di.trans.TransMeta)2 JobGraph (org.pentaho.di.ui.spoon.job.JobGraph)2 TransGraph (org.pentaho.di.ui.spoon.trans.TransGraph)2 Clipboard (org.eclipse.swt.dnd.Clipboard)1 TextTransfer (org.eclipse.swt.dnd.TextTransfer)1 Test (org.junit.Test)1 Matchers.anyObject (org.mockito.Matchers.anyObject)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 XulMenuitem (org.pentaho.ui.xul.components.XulMenuitem)1