本文整理汇总了Java中org.eclipse.core.runtime.jobs.Job.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Job.getProperty方法的具体用法?Java Job.getProperty怎么用?Java Job.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.jobs.Job
的用法示例。
在下文中一共展示了Job.getProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keep
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
* Returns true if JobInfo indicates that it must be kept.
*/
static boolean keep(JobInfo info) {
Job job = info.getJob();
if (job != null) {
Object prop = job.getProperty(ProgressManagerUtil.KEEP_PROPERTY);
if (prop instanceof Boolean) {
if (((Boolean) prop).booleanValue()) {
return true;
}
}
prop = job.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY);
if (prop instanceof Boolean) {
if (((Boolean) prop).booleanValue()) {
return true;
}
}
IStatus status = job.getResult();
if (status != null && status.getSeverity() == IStatus.ERROR) {
return true;
}
}
return false;
}
示例2: execute
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
* @param ji
* @param job
* @return <code>true</code> if Action or Command is executed
*/
private boolean execute(JobInfo ji, Job job) {
Object prop = job.getProperty(IProgressConstants.ACTION_PROPERTY);
if (prop instanceof IAction && ((IAction) prop).isEnabled()) {
IAction action = (IAction) prop;
action.run();
removeTopElement(ji);
return true;
}
prop = job.getProperty(IProgressConstants.COMMAND_PROPERTY);
if (prop instanceof ParameterizedCommand) {
ParameterizedCommand command = (ParameterizedCommand) prop;
getEHandlerService().executeHandler(command);
removeTopElement(ji);
return true;
}
return false;
}
示例3: getAction
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
private IAction getAction(Job job) {
Object property = job.getProperty(IProgressConstants.ACTION_PROPERTY);
if (property instanceof IAction) {
return (IAction) property;
}
return null;
}
示例4: disposeAction
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
static void disposeAction(JobTreeElement jte) {
if (jte.isJobInfo()) {
JobInfo ji = (JobInfo) jte;
Job job = ji.getJob();
if (job != null) {
Object prop = job
.getProperty(IProgressConstants.ACTION_PROPERTY);
if (prop instanceof IDisposableAction) {
((IDisposableAction) prop).dispose();
}
}
}
}
示例5: findJobsToRemove
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
private JobTreeElement[] findJobsToRemove(JobTreeElement info) {
if (info.isJobInfo()) {
Job myJob = ((JobInfo) info).getJob();
if (myJob != null) {
Object prop = myJob
.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY);
if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) {
ArrayList<JobTreeElement> found = null;
JobTreeElement[] all;
synchronized (keptjobinfos) {
all = keptjobinfos
.toArray(new JobTreeElement[keptjobinfos.size()]);
}
for (int i = 0; i < all.length; i++) {
JobTreeElement jte = all[i];
if (jte != info && jte.isJobInfo()) {
Job job = ((JobInfo) jte).getJob();
if (job != null && job != myJob
&& job.belongsTo(myJob)) {
if (found == null) {
found = new ArrayList<>();
}
found.add(jte);
}
}
}
if (found != null) {
return found
.toArray(new JobTreeElement[found.size()]);
}
}
}
}
return null;
}
示例6: isInfrastructureJob
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
* Return whether or not this job is an infrastructure job.
*
* @param job
* @return boolean <code>true</code> if it is never displayed.
*/
private boolean isInfrastructureJob(Job job) {
if (Policy.DEBUG_SHOW_ALL_JOBS)
return false;
return job.getProperty(ProgressManagerUtil.INFRASTRUCTURE_PROPERTY) != null;
}