本文整理汇总了Java中org.pentaho.di.job.entry.JobEntryCopy.setName方法的典型用法代码示例。如果您正苦于以下问题:Java JobEntryCopy.setName方法的具体用法?Java JobEntryCopy.setName怎么用?Java JobEntryCopy.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.job.entry.JobEntryCopy
的用法示例。
在下文中一共展示了JobEntryCopy.setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renameJobEntryIfNameCollides
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* See if the name of the supplied job entry copy doesn't collide with any
* other job entry copy in the job.
*
* @param je
* The job entry copy to verify the name for.
*/
public void renameJobEntryIfNameCollides(JobEntryCopy je) {
// First see if the name changed.
// If so, we need to verify that the name is not already used in the
// job.
//
String newname = je.getName();
// See if this name exists in the other job entries
//
boolean found;
int nr = 1;
do {
found = false;
for (JobEntryCopy copy : jobcopies) {
if (copy != je && copy.getName().equalsIgnoreCase(newname) && copy.getNr() == 0)
found = true;
}
if (found) {
nr++;
newname = je.getName() + " (" + nr + ")";
}
} while (found);
// Rename if required.
//
je.setName(newname);
}
示例2: renameJobEntry
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* Method gets called, when the user wants to change a job entries name and he indeed entered
* a different name then the old one. Make sure that no other job entry matches this name
* and rename in case of uniqueness.
*
* @param jobEntry
* @param newName
*/
public void renameJobEntry(JobEntryCopy jobEntry, String newName) {
JobEntryCopy[] jobs = jobMeta.getAllJobGraphEntries(newName);
if (jobs != null && jobs.length > 0) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
mb.setMessage(Messages.getString("Spoon.Dialog.JobEntryNameExists.Message", newName));
mb.setText(Messages.getString("Spoon.Dialog.JobEntryNameExists.Title"));
mb.open();
} else {
jobEntry.setName(newName);
jobEntry.setChanged();
spoon.refreshTree(); // to reflect the new name
spoon.refreshGraph();
}
}
示例3: renameJobEntry
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* Method gets called, when the user wants to change a job entries name and he indeed entered
* a different name then the old one. Make sure that no other job entry matches this name
* and rename in case of uniqueness.
*
* @param jobEntry
* @param newName
*/
public void renameJobEntry(JobEntryCopy jobEntry, String newName) {
JobEntryCopy[] jobs = jobMeta.getAllJobGraphEntries(newName);
if (jobs != null && jobs.length > 0) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.JobEntryNameExists.Message", newName));
mb.setText(BaseMessages.getString(PKG, "Spoon.Dialog.JobEntryNameExists.Title"));
mb.open();
} else {
jobEntry.setName(newName);
jobEntry.setChanged();
spoon.refreshTree(); // to reflect the new name
spoon.refreshGraph();
}
}