Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 157520 Details for
Bug 279748
[Progress] Job with property KEEP_PROPERTY doesn't keep if status not Status.OK_STATUS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix proposal v02
KeepJob.txt (text/plain), 5.26 KB, created by
Krzysztof Daniel
on 2010-01-28 09:28:32 EST
(
hide
)
Description:
Fix proposal v02
Filename:
MIME Type:
Creator:
Krzysztof Daniel
Created:
2010-01-28 09:28:32 EST
Size:
5.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/progress/FinishedJobs.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/FinishedJobs.java,v >retrieving revision 1.36 >diff -u -r1.36 FinishedJobs.java >--- Eclipse UI/org/eclipse/ui/internal/progress/FinishedJobs.java 24 Mar 2008 19:21:58 -0000 1.36 >+++ Eclipse UI/org/eclipse/ui/internal/progress/FinishedJobs.java 28 Jan 2010 14:24:49 -0000 >@@ -109,22 +109,31 @@ > 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; >- } >+ if (hasKeepFlag(job)) >+ return true; >+ >+ IStatus status = job.getResult(); >+ if (status != null && status.getSeverity() == IStatus.ERROR) { >+ return true; > } >+ } >+ return false; >+ } > >- prop = job.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY); >- if (prop instanceof Boolean) { >- if (((Boolean) prop).booleanValue()) { >- return true; >- } >+ /** >+ * Returns true if job has one of keep flags set. >+ */ >+ static boolean hasKeepFlag(Job job) { >+ Object prop = job.getProperty(ProgressManagerUtil.KEEP_PROPERTY); >+ if (prop instanceof Boolean) { >+ if (((Boolean) prop).booleanValue()) { >+ return true; > } >+ } > >- IStatus status = job.getResult(); >- if (status != null && status.getSeverity() == IStatus.ERROR) { >+ prop = job.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY); >+ if (prop instanceof Boolean) { >+ if (((Boolean) prop).booleanValue()) { > return true; > } > } >@@ -288,6 +297,22 @@ > JobInfo info1 = (JobInfo) infos[i]; > Job job = info1.getJob(); > if (job != null) { >+ >+ // do not remove error jobs that have keep flag set >+ if (hasKeepFlag(job)){ >+ // but mark the job as reported to prevent displaying >+ // the same job error many times >+ info1.setReported(true); >+ // notify listeners to force refresh >+ Object l[] = getListeners(); >+ for (int j = 0; j < l.length; j++) { >+ KeptJobsListener jv = (KeptJobsListener) l[j]; >+ jv.removed(null); >+ } >+ //proceed with next entry >+ continue; >+ } >+ > IStatus status = job.getResult(); > if (status != null && status.getSeverity() == IStatus.ERROR) { > JobTreeElement topElement = (JobTreeElement) info1 >Index: Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java,v >retrieving revision 1.48 >diff -u -r1.48 JobInfo.java >--- Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java 20 Jan 2010 07:33:01 -0000 1.48 >+++ Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java 28 Jan 2010 14:24:49 -0000 >@@ -30,6 +30,13 @@ > private IStatus blockedStatus; > > private volatile boolean canceled = false; >+ >+ /** >+ * This flag controls when the job result was passed to status handling in >+ * order to display it. >+ */ >+ private volatile boolean reported = false; >+ > private List children = Collections.synchronizedList(new ArrayList()); > > private Job job; >@@ -382,6 +389,14 @@ > return getJob().getState() != Job.NONE; > } > >+ boolean isReported() { >+ return reported; >+ } >+ >+ void setReported(boolean errorReported) { >+ this.reported = errorReported; >+ } >+ > /** > * Return whether or not the receiver is blocked. > * >Index: Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java,v >retrieving revision 1.56 >diff -u -r1.56 ProgressAnimationItem.java >--- Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java 7 Oct 2009 17:01:38 -0000 1.56 >+++ Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java 28 Jan 2010 14:24:49 -0000 >@@ -103,6 +103,10 @@ > for (int i = jobTreeElements.length - 1; i >= 0; i--) { > if (jobTreeElements[i] instanceof JobInfo) { > JobInfo ji = (JobInfo) jobTreeElements[i]; >+ if (ji.isReported()) { >+ // the error was already reported, so do nothing. >+ continue; >+ } > Job job = ji.getJob(); > if (job != null) { > >@@ -117,7 +121,11 @@ > StatusManager.getManager().handle(statusAdapter, > StatusManager.SHOW); > >- removeTopElement(ji); >+ if (FinishedJobs.keep(ji)) { >+ ji.setReported(true); >+ } else { >+ removeTopElement(ji); >+ } > } > > execute(ji, job); >@@ -209,7 +217,7 @@ > if (jobTreeElements[i] instanceof JobInfo) { > JobInfo ji = (JobInfo) jobTreeElements[i]; > Job job = ji.getJob(); >- if (job != null) { >+ if ((job != null) && (!ji.isReported())) { > IStatus status = job.getResult(); > if (status != null && status.getSeverity() == IStatus.ERROR) { > // green arrow with error overlay
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 279748
:
146161
|
146169
|
157520
|
173002