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 124330 Details for
Bug 155479
[Jobs] Job Progress Dialog should allow disabling of cancel button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Partial fix
uncancelable-jobs.txt (text/plain), 5.91 KB, created by
Eugene Ostroukhov
on 2009-01-30 16:18:58 EST
(
hide
)
Description:
Partial fix
Filename:
MIME Type:
Creator:
Eugene Ostroukhov
Created:
2009-01-30 16:18:58 EST
Size:
5.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java,v >retrieving revision 1.52 >diff -u -r1.52 ProgressInfoItem.java >--- Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java 1 Oct 2008 15:36:11 -0000 1.52 >+++ Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java 30 Jan 2009 21:08:36 -0000 >@@ -219,18 +219,19 @@ > // overwrite > // any > // busy >- > // cursor we might have >- actionButton = new ToolItem(actionBar, SWT.NONE); >- actionButton >- .setToolTipText(ProgressMessages.NewProgressView_CancelJobToolTip); >- actionButton.addSelectionListener(new SelectionAdapter() { >- public void widgetSelected(SelectionEvent e) { >- actionButton.setEnabled(false); >- cancelOrRemove(); >- } >+ if (info.isCancellable()) { >+ actionButton = new ToolItem(actionBar, SWT.NONE); >+ actionButton >+ .setToolTipText(ProgressMessages.NewProgressView_CancelJobToolTip); >+ actionButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ actionButton.setEnabled(false); >+ cancelOrRemove(); >+ } > >- }); >+ }); >+ } > actionBar.addListener(SWT.Traverse, new Listener() { > /* > * (non-Javadoc) >@@ -651,6 +652,9 @@ > * > */ > private void updateToolBarValues() { >+ if (actionButton == null) { >+ return; >+ } > if (isCompleted()) { > actionButton.setImage(JFaceResources > .getImage(CLEAR_FINISHED_JOB_KEY)); >Index: Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java,v >retrieving revision 1.47 >diff -u -r1.47 ProgressMonitorFocusJobDialog.java >--- Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java 24 Mar 2008 19:21:58 -0000 1.47 >+++ Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java 30 Jan 2009 21:08:37 -0000 >@@ -413,6 +413,7 @@ > > setOpenOnRun(false); > aboutToRun(); >+ getButton(IDialogConstants.CANCEL_ID).setEnabled(jobToWatch.isCancelable()); > // start with a quick busy indicator. Lock the UI as we > // want to preserve modality > BusyIndicator.showWhile(PlatformUI.getWorkbench().getDisplay(), >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.46 >diff -u -r1.46 JobInfo.java >--- Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java 3 Dec 2007 20:22:56 -0000 1.46 >+++ Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java 30 Jan 2009 21:08:35 -0000 >@@ -407,7 +407,7 @@ > * @see org.eclipse.ui.internal.progress.JobTreeElement#isCancellable() > */ > public boolean isCancellable() { >- return super.isCancellable(); >+ return job.isCancelable(); > } > > /* >#P org.eclipse.core.jobs >Index: src/org/eclipse/core/runtime/jobs/Job.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/Job.java,v >retrieving revision 1.12 >diff -u -r1.12 Job.java >--- src/org/eclipse/core/runtime/jobs/Job.java 17 Oct 2007 13:49:09 -0000 1.12 >+++ src/org/eclipse/core/runtime/jobs/Job.java 30 Jan 2009 21:08:39 -0000 >@@ -328,6 +328,18 @@ > } > > /** >+ * Returns whether this job can be canceled by user. If this value is not explicitly >+ * set, jobs are treated as cancelable. The default value is <code>true</code>. >+ * >+ * @return <code>true</code> if the user can cancel the job and <code>false</code> >+ * otherwise >+ * @see #setCancelable(boolean) >+ */ >+ public final boolean isCancelable() { >+ return super.isCancelable(); >+ } >+ >+ /** > * Returns whether this job is a system job. System jobs are typically not > * revealed to users in any UI presentation of jobs. Other than their UI presentation, > * system jobs act exactly like other jobs. If this value is not explicitly set, jobs >@@ -460,6 +472,17 @@ > public final void schedule(long delay) { > super.schedule(delay); > } >+ >+ /** >+ * Sets is the job is cancelable. If the job is currently running, waiting, >+ * or sleeping, the new job name may not take effect until the next time the >+ * job is scheduled. >+ * >+ * @param cancelable true if the user may cancel the job >+ */ >+ public final void setCancelable(boolean cancelable) { >+ super.setCancelable(cancelable); >+ } > > /** > * Changes the name of this job. If the job is currently running, waiting, >Index: src/org/eclipse/core/internal/jobs/InternalJob.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/InternalJob.java,v >retrieving revision 1.10 >diff -u -r1.10 InternalJob.java >--- src/org/eclipse/core/internal/jobs/InternalJob.java 3 Oct 2008 22:08:46 -0000 1.10 >+++ src/org/eclipse/core/internal/jobs/InternalJob.java 30 Jan 2009 21:08:38 -0000 >@@ -83,6 +83,7 @@ > */ > private InternalJob previous; > private int priority = Job.LONG; >+ private boolean cancelable = true; > /** > * Arbitrary properties (key,value) pairs, attached > * to a job instance by a third party. >@@ -187,6 +188,10 @@ > protected String getName() { > return name; > } >+ >+ protected boolean isCancelable() { >+ return cancelable; >+ } > > /* (non-Javadoc) > * @see Job#getPriority() >@@ -413,6 +418,10 @@ > Assert.isNotNull(name); > this.name = name; > } >+ >+ protected void setCancelable(boolean cancelable) { >+ this.cancelable = cancelable; >+ } > > /** > * Sets the next entry in this linked list of jobs.
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 155479
: 124330 |
124332
|
132831