当前位置: 首页>>代码示例>>Java>>正文


Java JobEntryCopy.setName方法代码示例

本文整理汇总了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);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:35,代码来源:JobMeta.java

示例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();
  }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:JobGraph.java

示例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();
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:JobGraph.java


注:本文中的org.pentaho.di.job.entry.JobEntryCopy.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。