本文整理汇总了Java中org.pentaho.di.trans.TransHopMeta类的典型用法代码示例。如果您正苦于以下问题:Java TransHopMeta类的具体用法?Java TransHopMeta怎么用?Java TransHopMeta使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransHopMeta类属于org.pentaho.di.trans包,在下文中一共展示了TransHopMeta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setNew
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void setNew(Object prev[], int position[])
{
if (prev.length==0) return;
current=prev;
current_index=position;
previous = null;
if ( prev[0] instanceof StepMeta) type=TYPE_ACTION_NEW_STEP;
if ( prev[0] instanceof DatabaseMeta) type=TYPE_ACTION_NEW_CONNECTION;
if ( prev[0] instanceof TransHopMeta) type=TYPE_ACTION_NEW_HOP;
if ( prev[0] instanceof NotePadMeta) type=TYPE_ACTION_NEW_NOTE;
if ( prev[0] instanceof JobEntryCopy) type=TYPE_ACTION_NEW_JOB_ENTRY;
if ( prev[0] instanceof JobHopMeta) type=TYPE_ACTION_NEW_JOB_HOP;
if ( prev[0] instanceof String[]) type=TYPE_ACTION_NEW_TABLEITEM;
}
示例2: delStep
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void delStep(TransMeta transMeta, StepMeta stepMeta)
{
spoon.getLog().logDebug(toString(), Messages.getString("Spoon.Log.DeleteStep") + stepMeta.getName());// "Delete
// step:
// "
for (int i = transMeta.nrTransHops() - 1; i >= 0; i--)
{
TransHopMeta hi = transMeta.getTransHop(i);
if (hi.getFromStep().equals(stepMeta) || hi.getToStep().equals(stepMeta))
{
spoon.addUndoDelete(transMeta, new TransHopMeta[] { hi }, new int[] { transMeta
.indexOfTransHop(hi) }, true);
transMeta.removeTransHop(i);
spoon.refreshTree();
}
}
int pos = transMeta.indexOfStep(stepMeta);
transMeta.removeStep(pos);
spoon.addUndoDelete(transMeta, new StepMeta[] { stepMeta }, new int[] { pos });
spoon.refreshTree();
spoon.refreshGraph();
}
示例3: editHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void editHop(TransMeta transMeta, TransHopMeta transHopMeta) {
// Backup situation BEFORE edit:
String name = transHopMeta.toString();
TransHopMeta before = (TransHopMeta) transHopMeta.clone();
TransHopDialog hd = new TransHopDialog(shell, SWT.NONE, transHopMeta, transMeta);
if (hd.open() != null) {
// Backup situation for redo/undo:
TransHopMeta after = (TransHopMeta) transHopMeta.clone();
addUndoChange(transMeta, new TransHopMeta[] { before }, new TransHopMeta[] { after }, new int[] { transMeta.indexOfTransHop(transHopMeta) });
String newname = transHopMeta.toString();
if (!name.equalsIgnoreCase(newname)) {
refreshTree();
refreshGraph(); // color, nr of copies...
}
}
setShellText();
}
示例4: newHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void newHop(TransMeta transMeta, TransHopMeta transHopMeta) {
if (checkIfHopAlreadyExists(transMeta, transHopMeta)) {
transMeta.addTransHop(transHopMeta);
int idx = transMeta.indexOfTransHop(transHopMeta);
if (!performNewTransHopChecks(transMeta, transHopMeta)) {
// Some error occurred: loops, existing hop, etc.
// Remove it again...
//
transMeta.removeTransHop(idx);
} else {
addUndoNew(transMeta, new TransHopMeta[] { transHopMeta }, new int[] { transMeta.indexOfTransHop(transHopMeta) });
}
// Just to make sure
transHopMeta.getFromStep().drawStep();
transHopMeta.getToStep().drawStep();
refreshTree();
refreshGraph();
}
}
示例5: findHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
/**
* See if location (x,y) is on a line between two steps: the hop!
* @param x
* @param y
* @param exclude the step to exclude from the hops (from or to location). Specify null if no step is to be excluded.
* @return the transformation hop on the specified location, otherwise: null
*/
private TransHopMeta findHop(int x, int y, StepMeta exclude) {
int i;
TransHopMeta online = null;
for (i = 0; i < transMeta.nrTransHops(); i++) {
TransHopMeta hi = transMeta.getTransHop(i);
StepMeta fs = hi.getFromStep();
StepMeta ts = hi.getToStep();
if (fs == null || ts == null)
return null;
// If either the "from" or "to" step is excluded, skip this hop.
//
if (exclude != null && (exclude.equals(fs) || exclude.equals(ts)))
continue;
int line[] = getLine(fs, ts);
if (pointOnLine(x, y, line))
online = hi;
}
return online;
}
示例6: flipHopDirection
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void flipHopDirection() {
selrect = null;
TransHopMeta hi = getCurrentHop();
hi.flip();
if (transMeta.hasLoop(hi.getFromStep())) {
spoon.refreshGraph();
MessageBox mb = new MessageBox(shell, SWT.YES | SWT.ICON_WARNING);
mb.setMessage(Messages.getString("TransGraph.Dialog.LoopsAreNotAllowed.Message")); //$NON-NLS-1$
mb.setText(Messages.getString("TransGraph.Dialog.LoopsAreNotAllowed.Title")); //$NON-NLS-1$
mb.open();
hi.flip();
spoon.refreshGraph();
} else {
hi.setChanged();
spoon.refreshGraph();
spoon.refreshTree();
spoon.setShellText();
}
}
示例7: enableHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void enableHop() {
selrect = null;
TransHopMeta hi = getCurrentHop();
TransHopMeta before = (TransHopMeta) hi.clone();
hi.setEnabled(!hi.isEnabled());
if (transMeta.hasLoop(hi.getToStep())) {
hi.setEnabled(!hi.isEnabled());
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_WARNING);
mb.setMessage(Messages.getString("TransGraph.Dialog.LoopAfterHopEnabled.Message")); //$NON-NLS-1$
mb.setText(Messages.getString("TransGraph.Dialog.LoopAfterHopEnabled.Title")); //$NON-NLS-1$
mb.open();
} else {
TransHopMeta after = (TransHopMeta) hi.clone();
spoon.addUndoChange(transMeta, new TransHopMeta[] { before }, new TransHopMeta[] { after }, new int[] { transMeta
.indexOfTransHop(hi) });
spoon.refreshGraph();
spoon.refreshTree();
}
}
示例8: verifyRule
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
@Override
public List<ImportValidationFeedback> verifyRule(Object subject) {
List<ImportValidationFeedback> feedback = new ArrayList<ImportValidationFeedback>();
if (!isEnabled()) return feedback;
if (!(subject instanceof TransMeta)) return feedback;
TransMeta transMeta = (TransMeta)subject;
for (int i=0;i<transMeta.nrTransHops();i++) {
TransHopMeta hop = transMeta.getTransHop(i);
if (!hop.isEnabled()) {
feedback.add( new ImportValidationFeedback(this, ImportValidationResultType.ERROR, "There is a disabled hop in the transformation.") );
}
}
if (feedback.isEmpty()) {
feedback.add( new ImportValidationFeedback(this, ImportValidationResultType.APPROVAL, "All hops are enabled in this transformation.") );
}
return feedback;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:TransformationHasNoDisabledHopsImportRule.java
示例9: saveTransHopMeta
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void saveTransHopMeta(TransHopMeta transHopMeta, ObjectId id_transformation) throws KettleException
{
try
{
// See if a transformation hop with the same fromstep and tostep is
// already available...
ObjectId id_step_from = transHopMeta.getFromStep() == null ? null : transHopMeta.getFromStep().getObjectId();
ObjectId id_step_to = transHopMeta.getToStep() == null ? null : transHopMeta.getToStep().getObjectId();
// Insert new transMeta hop in repository
transHopMeta.setObjectId(insertTransHop(id_transformation, id_step_from, id_step_to, transHopMeta.isEnabled()));
} catch (KettleDatabaseException dbe)
{
throw new KettleException(
BaseMessages.getString(PKG, "TransHopMeta.Exception.UnableToSaveTransformationHopInfo") + id_transformation, dbe); //$NON-NLS-1$
}
}
示例10: editHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void editHop(TransMeta transMeta, TransHopMeta transHopMeta) {
// Backup situation BEFORE edit:
String name = transHopMeta.toString();
TransHopMeta before = (TransHopMeta) transHopMeta.clone();
TransHopDialog hd = new TransHopDialog(shell, SWT.NONE, transHopMeta, transMeta);
if (hd.open() != null) {
// Backup situation for redo/undo:
TransHopMeta after = (TransHopMeta) transHopMeta.clone();
addUndoChange(transMeta, new TransHopMeta[] { before }, new TransHopMeta[] { after }, new int[] { transMeta
.indexOfTransHop(transHopMeta) });
String newname = transHopMeta.toString();
if (!name.equalsIgnoreCase(newname)) {
refreshTree();
refreshGraph(); // color, nr of copies...
}
}
setShellText();
}
示例11: newHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void newHop(TransMeta transMeta, TransHopMeta transHopMeta) {
if (checkIfHopAlreadyExists(transMeta, transHopMeta)) {
transMeta.addTransHop(transHopMeta);
int idx = transMeta.indexOfTransHop(transHopMeta);
if (!performNewTransHopChecks(transMeta, transHopMeta)) {
// Some error occurred: loops, existing hop, etc.
// Remove it again...
//
transMeta.removeTransHop(idx);
} else {
addUndoNew(transMeta, new TransHopMeta[] { transHopMeta },
new int[] { transMeta.indexOfTransHop(transHopMeta) });
}
// Just to make sure
transHopMeta.getFromStep().drawStep();
transHopMeta.getToStep().drawStep();
refreshTree();
refreshGraph();
}
}
示例12: flipHopDirection
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void flipHopDirection() {
selectionRegion = null;
TransHopMeta hi = getCurrentHop();
hi.flip();
if (transMeta.hasLoop(hi.getFromStep())) {
spoon.refreshGraph();
MessageBox mb = new MessageBox(shell, SWT.YES | SWT.ICON_WARNING);
mb.setMessage(BaseMessages.getString(PKG, "TransGraph.Dialog.LoopsAreNotAllowed.Message")); //$NON-NLS-1$
mb.setText(BaseMessages.getString(PKG, "TransGraph.Dialog.LoopsAreNotAllowed.Title")); //$NON-NLS-1$
mb.open();
hi.flip();
spoon.refreshGraph();
} else {
hi.setChanged();
spoon.refreshGraph();
spoon.refreshTree();
spoon.setShellText();
}
}
示例13: enableHop
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
public void enableHop() {
selectionRegion = null;
TransHopMeta hi = getCurrentHop();
TransHopMeta before = (TransHopMeta) hi.clone();
hi.setEnabled(!hi.isEnabled());
if (transMeta.hasLoop(hi.getToStep())) {
hi.setEnabled(!hi.isEnabled());
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_WARNING);
mb.setMessage(BaseMessages.getString(PKG, "TransGraph.Dialog.LoopAfterHopEnabled.Message")); //$NON-NLS-1$
mb.setText(BaseMessages.getString(PKG, "TransGraph.Dialog.LoopAfterHopEnabled.Title")); //$NON-NLS-1$
mb.open();
} else {
TransHopMeta after = (TransHopMeta) hi.clone();
spoon.addUndoChange(transMeta, new TransHopMeta[] { before }, new TransHopMeta[] { after }, new int[] { transMeta
.indexOfTransHop(hi) });
spoon.refreshGraph();
spoon.refreshTree();
}
}
示例14: enableHopsBetweenSelectedSteps
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
/**
* This method enables or disables all the hops between the selected steps.
*
**/
public void enableHopsBetweenSelectedSteps(boolean enabled) {
List<StepMeta> list = transMeta.getSelectedSteps();
for (int i=0;i<transMeta.nrTransHops();i++) {
TransHopMeta hop = transMeta.getTransHop(i);
if (list.contains(hop.getFromStep()) && list.contains(hop.getToStep())) {
TransHopMeta before = (TransHopMeta) hop.clone();
hop.setEnabled(enabled);
TransHopMeta after = (TransHopMeta) hop.clone();
spoon.addUndoChange(transMeta, new TransHopMeta[] { before }, new TransHopMeta[] { after }, new int[] { transMeta.indexOfTransHop(hop) });
}
}
spoon.refreshGraph();
}
示例15: detach
import org.pentaho.di.trans.TransHopMeta; //导入依赖的package包/类
private void detach( StepMeta stepMeta ) {
for ( int i = transMeta.nrTransHops() - 1; i >= 0; i-- ) {
TransHopMeta hop = transMeta.getTransHop( i );
if ( stepMeta.equals( hop.getFromStep() ) || stepMeta.equals( hop.getToStep() ) ) {
// Step is connected with a hop, remove this hop.
//
spoon.addUndoNew( transMeta, new TransHopMeta[] { hop }, new int[] { i } );
transMeta.removeTransHop( i );
}
}
/*
* TransHopMeta hfrom = transMeta.findTransHopTo(stepMeta); TransHopMeta hto = transMeta.findTransHopFrom(stepMeta);
*
* if (hfrom != null && hto != null) { if (transMeta.findTransHop(hfrom.getFromStep(), hto.getToStep()) == null) {
* TransHopMeta hnew = new TransHopMeta(hfrom.getFromStep(), hto.getToStep()); transMeta.addTransHop(hnew);
* spoon.addUndoNew(transMeta, new TransHopMeta[] { hnew }, new int[] { transMeta.indexOfTransHop(hnew) });
* spoon.refreshTree(); } } if (hfrom != null) { int fromidx = transMeta.indexOfTransHop(hfrom); if (fromidx >= 0) {
* transMeta.removeTransHop(fromidx); spoon.refreshTree(); } } if (hto != null) { int toidx =
* transMeta.indexOfTransHop(hto); if (toidx >= 0) { transMeta.removeTransHop(toidx); spoon.refreshTree(); } }
*/
spoon.refreshTree();
redraw();
}