use of org.pentaho.di.trans.step.StepMetaChangeListenerInterface in project pentaho-kettle by pentaho.
the class TransMeta method removeStep.
/**
* Removes a step from the transformation on a certain location (i.e. the specified index). Also marks that the
* transformation's steps have changed.
*
* @param i
* The index
*/
public void removeStep(int i) {
if (i < 0 || i >= steps.size()) {
return;
}
StepMeta removeStep = steps.get(i);
StepMetaInterface iface = removeStep.getStepMetaInterface();
if (iface instanceof StepMetaChangeListenerInterface) {
removeStepChangeListener((StepMetaChangeListenerInterface) iface);
}
steps.remove(i);
if (removeStep.getStepMetaInterface() instanceof MissingTrans) {
removeMissingTrans((MissingTrans) removeStep.getStepMetaInterface());
}
changed_steps = true;
clearCaches();
}
use of org.pentaho.di.trans.step.StepMetaChangeListenerInterface in project pentaho-kettle by pentaho.
the class TransMeta method addOrReplaceStep.
/**
* Add a new step to the transformation if that step didn't exist yet. Otherwise, replace the step. This method also
* marks that the transformation's steps have changed.
*
* @param stepMeta
* The meta-data for the step to be added.
*/
public void addOrReplaceStep(StepMeta stepMeta) {
int index = steps.indexOf(stepMeta);
if (index < 0) {
index = steps.add(stepMeta) ? 0 : index;
} else {
StepMeta previous = getStep(index);
previous.replaceMeta(stepMeta);
}
stepMeta.setParentTransMeta(this);
StepMetaInterface iface = stepMeta.getStepMetaInterface();
if (index != -1 && iface instanceof StepMetaChangeListenerInterface) {
addStepChangeListener(index, (StepMetaChangeListenerInterface) iface);
}
changed_steps = true;
clearCaches();
}
use of org.pentaho.di.trans.step.StepMetaChangeListenerInterface in project pentaho-kettle by pentaho.
the class TransMeta method addStep.
/**
* Add a new step to the transformation. Also marks that the transformation's steps have changed.
*
* @param stepMeta
* The meta-data for the step to be added.
*/
public void addStep(StepMeta stepMeta) {
steps.add(stepMeta);
stepMeta.setParentTransMeta(this);
StepMetaInterface iface = stepMeta.getStepMetaInterface();
if (iface instanceof StepMetaChangeListenerInterface) {
addStepChangeListener((StepMetaChangeListenerInterface) iface);
}
changed_steps = true;
clearCaches();
}
use of org.pentaho.di.trans.step.StepMetaChangeListenerInterface in project pentaho-kettle by pentaho.
the class TransMeta method addStepChangeListener.
public void addStepChangeListener(int p, StepMetaChangeListenerInterface list) {
int indexListener = -1;
int indexListenerRemove = -1;
StepMeta rewriteStep = steps.get(p);
StepMetaInterface iface = rewriteStep.getStepMetaInterface();
if (iface instanceof StepMetaChangeListenerInterface) {
for (StepMetaChangeListenerInterface listener : stepChangeListeners) {
indexListener++;
if (listener.equals(iface)) {
indexListenerRemove = indexListener;
}
}
if (indexListenerRemove >= 0) {
stepChangeListeners.add(indexListenerRemove, list);
} else if (stepChangeListeners.size() == 0 && p == 0) {
stepChangeListeners.add(list);
}
}
}
use of org.pentaho.di.trans.step.StepMetaChangeListenerInterface in project pentaho-kettle by pentaho.
the class TransMeta method setStep.
/**
* Changes the content of a step on a certain position. This is accomplished by setting the step's metadata at the
* specified index to the specified meta-data object. The new step's parent transformation is updated to be this
* transformation.
*
* @param i
* The index into the steps list
* @param stepMeta
* The step meta-data to set
*/
public void setStep(int i, StepMeta stepMeta) {
StepMetaInterface iface = stepMeta.getStepMetaInterface();
if (iface instanceof StepMetaChangeListenerInterface) {
addStepChangeListener(i, (StepMetaChangeListenerInterface) stepMeta.getStepMetaInterface());
}
steps.set(i, stepMeta);
stepMeta.setParentTransMeta(this);
clearCaches();
}
Aggregations