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 8512 Details for
Bug 53748
[RCP][Workbench] StatusLineManager API is not flexible enough for RCP applications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fixes subclassing issues
subclass_fix_patch.txt (text/plain), 6.17 KB, created by
Matthew Hatem
on 2004-03-11 12:49:18 EST
(
hide
)
Description:
Fixes subclassing issues
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2004-03-11 12:49:18 EST
Size:
6.17 KB
patch
obsolete
>Index: StatusLineManager.java >=================================================================== >retrieving revision 1.6 >diff -u -r1.6 StatusLineManager.java >--- StatusLineManager.java 9 Oct 2003 17:08:16 -0000 1.6 >+++ StatusLineManager.java 11 Mar 2004 17:31:49 -0000 >@@ -28,10 +28,25 @@ > public class StatusLineManager extends ContributionManager implements IStatusLineWithProgressManager { > > /** >+ * Global group marker used to control positioning of contributions >+ */ >+ public static final String BEGIN_GROUP = "BEGIN_GROUP"; >+ >+ /** >+ * Global group marker used to control positioning of contributions >+ */ >+ public static final String MIDDLE_GROUP = "MIDDLE_GROUP"; >+ >+ /** >+ * Global group marker used to control positioning of contributions >+ */ >+ public static final String END_GROUP = "END_GROUP"; >+ >+ /** > * The status line control; <code>null</code> before > * creation and after disposal. > */ >- private StatusLine statusLine = null; >+ private Composite statusLine = null; > > private String lastMessage; > private Image lastImage; >@@ -50,9 +65,12 @@ > * @param parent the parent control > * @return the status line control > */ >-public StatusLine createControl(Composite parent) { >+public Control createControl(Composite parent) { > if (!statusLineExist() && parent != null) { > statusLine= new StatusLine(parent); >+ add(new GroupMarker(BEGIN_GROUP)); >+ add(new GroupMarker (MIDDLE_GROUP)); >+ add(new GroupMarker(END_GROUP)); > update(false); > } > return statusLine; >@@ -74,14 +92,22 @@ > } > } > /** >- * Internal -- returns the StatusLine control. >- * <p> >- * This method is not intended to be used outside of the JFace framework. >- * </p> >+ * Returns the Control used by this StatusLineManager. >+ * >+ * @return the control used by this manager > */ > public Control getControl() { > return statusLine; > } >+/** >+ * Returns the progress monitor delegate. Override this method >+ * to provide your own object used to handle progress. >+ * >+ * @return the IProgressMonitor delegate >+ */ >+protected IProgressMonitor getProgressMonitorDelegate() { >+ return (IProgressMonitor)getControl(); >+} > /* > * (non-Javadoc) > * Method declared on IStatusLineManager >@@ -89,18 +115,21 @@ > public IProgressMonitor getProgressMonitor() { > > return new IProgressMonitor(){ >+ >+ IProgressMonitor progressDelegate = getProgressMonitorDelegate(); >+ > /* (non-Javadoc) > * @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String, int) > */ > public void beginTask(String name, int totalWork) { >- statusLine.beginTask(name,totalWork); >+ progressDelegate.beginTask(name,totalWork); > > } > /* (non-Javadoc) > * @see org.eclipse.core.runtime.IProgressMonitor#done() > */ > public void done() { >- statusLine.done(); >+ progressDelegate.done(); > clearProgress(); > } > >@@ -108,7 +137,7 @@ > * @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double) > */ > public void internalWorked(double work) { >- statusLine.internalWorked(work); >+ progressDelegate.internalWorked(work); > > } > >@@ -116,7 +145,7 @@ > * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled() > */ > public boolean isCanceled() { >- return statusLine.isCanceled(); >+ return progressDelegate.isCanceled(); > } > > /* (non-Javadoc) >@@ -126,7 +155,7 @@ > //Don't bother updating for disposed status > if(statusLine.isDisposed()) > return; >- statusLine.setCanceled(value); >+ progressDelegate.setCanceled(value); > > } > >@@ -134,7 +163,7 @@ > * @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String) > */ > public void setTaskName(String name) { >- statusLine.setTaskName(name); >+ progressDelegate.setTaskName(name); > > } > >@@ -142,7 +171,7 @@ > * @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String) > */ > public void subTask(String name) { >- statusLine.subTask(name); >+ progressDelegate.subTask(name); > > } > >@@ -150,7 +179,7 @@ > * @see org.eclipse.core.runtime.IProgressMonitor#worked(int) > */ > public void worked(int work) { >- statusLine.worked(work); >+ progressDelegate.worked(work); > } > }; > } >@@ -158,35 +187,35 @@ > * Method declared on IStatueLineManager > */ > public boolean isCancelEnabled() { >- return statusLineExist() && statusLine.isCancelEnabled(); >+ return statusLineExist() && ((StatusLine)statusLine).isCancelEnabled(); > } > /* (non-Javadoc) > * Method declared on IStatueLineManager > */ > public void setCancelEnabled(boolean enabled) { > if (statusLineExist()) >- statusLine.setCancelEnabled(enabled); >+ ((StatusLine)statusLine).setCancelEnabled(enabled); > } > /* (non-Javadoc) > * Method declared on IStatusLineManager. > */ > public void setErrorMessage(String message) { > if (statusLineExist()) >- statusLine.setErrorMessage(message); >+ ((StatusLine)statusLine).setErrorMessage(message); > } > /* (non-Javadoc) > * Method declared on IStatusLineManager. > */ > public void setErrorMessage(Image image, String message) { > if (statusLineExist()) >- statusLine.setErrorMessage(image, message); >+ ((StatusLine)statusLine).setErrorMessage(image, message); > } > /* (non-Javadoc) > * Method declared on IStatusLineManager. > */ > public void setMessage(String message) { > if (statusLineExist()) >- statusLine.setMessage(message); >+ ((StatusLine)statusLine).setMessage(message); > lastMessage = message; > } > /* (non-Javadoc) >@@ -194,7 +223,7 @@ > */ > public void setMessage(Image image, String message) { > if (statusLineExist()) >- statusLine.setMessage(image, message); >+ ((StatusLine)statusLine).setMessage(image, message); > lastMessage = message; > lastImage = image; > } >@@ -337,7 +366,7 @@ > * @see org.eclipse.jface.action.IStatusLineWithProgressManager#clearProgress() > */ > public void clearProgress() { >- statusLine.setMessage(lastImage,lastMessage); >+ ((StatusLine)statusLine).setMessage(lastImage,lastMessage); > > } > >@@ -346,7 +375,7 @@ > */ > public void setProgressMessage(String message) { > if (statusLineExist()) >- statusLine.setMessage(message); >+ ((StatusLine)statusLine).setMessage(message); > } > > }
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 53748
: 8512