| 
 | Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.4.0) E17493-05 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.ide.controls.WaitCursor
public class WaitCursor
This class handles the wait cursor over the application and dialogs. The show/hide methods increment/decrement a counter for each window and the wait cursor is removed only when the counter==0.
All you have to do to show and hide the wait cursor is to call show(), do your long operation then call hide(). If you are showing the wait cursor from a dialog, do this:
 import oracle.ide.controls.WaitCursor;
 // ...
 public void doSomeLongOperation()
 {
   WaitCursor wc = new WaitCursor(window1);
   wc.show();
   //...
   wc.hide();
 }
 
 If you are showing the wait cursor from the IDE, do this:
 
 import oracle.ide.Ide;
 // ...
 public void rebuildTheWorld()
 {
   WaitCursor wc = new WaitCursor(Ide.getMainWindow());
   wc.show();
   //...
   wc.hide();
 }
 
 Typical usage is to spawn a thread. The process goes like this: create a wait cursor, show it, create a thread,
 do some stuff then hide the wait cursor:
 
 import oracle.ide.controls.WaitCursor;
 // ...
 public void doSomeLongOperation()
 {
   WaitCursor wc = new WaitCursor(window1);
   wc.show();
   Thread thread = new Thread("")
   {
     public void run()
     {
       try
       {
         //...
       }
       finally
       {
         wc.hide();
       }
     }
   }
 }
 
 Although this class is not marked final, extension writers should not
 subclass it..
| Constructor Summary | |
|---|---|
| WaitCursor()Deprecated. since 11.1.1 Use WaitCursor(Component). This constructor will be removed. | |
| WaitCursor(java.awt.Component component)Attaches WaitCursor to the RootPaneContainerof the
  specifiedComponent. | |
| Method Summary | |
|---|---|
|  void | attach(javax.swing.RootPaneContainer rootPaneContainer)Deprecated. since 11.1.1. Instead of calling this method, clients should construct a new instance of WaitCursor, passing in the root pane container component in the constructor. In particular, clients should never call the attach method on the WaitCursor instance returned by Ide#getWaitCursor(), since doing so will almost certainly leak
    memory. | 
|  void | detach(javax.swing.RootPaneContainer rootPaneContainer)Deprecated. since 11.1.1. Instead of attaching and detatching from specific root panes, clients should construct new WaitCursorinstances
    for new root panes using theWaitCursor(Component)API. If you
    want to force a wait cursor to detach from all of its attached root
    panes, you should calldispose(). Note that the WaitCursor
    returned fromIde#getWaitCursor()does not support the dispose()
    method, and will throw an exception if you attempt to use it. | 
|  void | dispose()Deprecated. since 11.1.2.0.0. Currently no replacement. | 
| protected  void | finalize()Deprecated. since 11.1.2.0.0. Currently no replacement. This function will be removed. | 
| protected  javax.swing.RootPaneContainer | findRootPaneContainer(java.awt.Component component)Deprecated. since 11.1.2.0.0. Currently no replacement. This function will become private. | 
|  void | hide()Deprecated. since 11.1.2.0.0. Currently no replacement. | 
|  void | show()Deprecated. | 
|  void | show(int delay)Deprecated. since 11.1.2.0.0. Currently no replacement. | 
|  void | show(long delay)Deprecated. since 11.1.1.0.0. Use #show(int). | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
@Deprecated public WaitCursor()
WaitCursor(Component). This constructor will be removed.
public WaitCursor(java.awt.Component component)
RootPaneContainer of the
  specified Component.
| Method Detail | 
|---|
@Deprecated protected final javax.swing.RootPaneContainer findRootPaneContainer(java.awt.Component component)
@Deprecated protected void finalize()
finalize in class java.lang.Object@Deprecated public void attach(javax.swing.RootPaneContainer rootPaneContainer)
Ide#getWaitCursor(), since doing so will almost certainly leak
    memory.
RootPaneContainer.
 This method is used by the IDE. You should only use show() and hide().
 Note that, if called on the WaitCursor instance returned by
 Ide#getWaitCursor(), this method will dump a diagnostic trace
 to stderr. You can fix this by using a new WaitCursor instance instead
 of the one returned by Ide.getWaitCursor().
java.lang.IllegalStateException - if called after dispose().@Deprecated public void detach(javax.swing.RootPaneContainer rootPaneContainer)
WaitCursor instances
    for new root panes using the WaitCursor(Component) API. If you
    want to force a wait cursor to detach from all of its attached root
    panes, you should call dispose(). Note that the WaitCursor
    returned from Ide#getWaitCursor() does not support the dispose()
    method, and will throw an exception if you attempt to use it.
RootPaneContainer.
 This method is used by the IDE. You should only use show() and hide().
java.lang.IllegalStateException - if called after dispose().@Deprecated public void dispose()
 Calling this method on the WaitCursor returned from Ide#getWaitCursor()
 is not supported, and will throw an UnsupportedOperationException.
 
 Once this WaitCursor instance has been disposed, it can no longer be used.
 Calling show()or hide()on it will result in an
 IllegalStateException.
java.lang.UnsupportedOperationException - if you call this method on the
 WaitCursor instance returned from Ide#getWaitCursor().@Deprecated public void show()
DEFAULT_DELAY number of
 milliseconds has elapsed.
java.lang.IllegalStateException - if called after dispose().public final void show(int delay)
hide() is
 called before the delay has elapsed, then the
 WaitCursor is not shown.
delay - the number of milliseconds to delay before showing
 the wait cursor.
java.lang.IllegalStateException - if called after dispose().@Deprecated public void show(long delay)
hide() is
 called before the delay has elapsed, then the
 WaitCursor is not shown.
delay - the number of milliseconds to delay before showing
 the wait cursor.
java.lang.IllegalStateException - if called after dispose().public void hide()
Note that hide() must be called as many times as show() to clear all pending cursor display calls. Calls to hide() will always cancel calls to show() in FILO order. consider the following scenario:
show(1000) // s1 show(3000) // s2 // wait 500 ms hide()Calling hide() at 500ms will cancel s2 but not s1 thus resulting in the cursor being shown after 500ms.
java.lang.IllegalStateException - if called after dispose().| 
 | Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.4.0) E17493-05 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||