Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


oracle.ide.controls
Class WaitCursor

java.lang.Object
  extended by oracle.ide.controls.WaitCursor


public class WaitCursor
extends java.lang.Object

This class handles the wait cursor over the application. The show/hide methods increment/decrement a counter 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(). To show a wait cursor:

 import oracle.ide.Ide;

 // ...

 void rebuildTheWorld()
 {
   WaitCursor wc = Ide.getWaitCursor();
   wc.show();

   //...

   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).
WaitCursor(java.awt.Component component)
          Attaches WaitCursor to the RootPaneContainer of the specified Component.

 

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 attaching from specific root panes, clients should construct new 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.
 void dispose()
          Detaches this WaitCursor from any components it is attached to.
protected  void finalize()
           
protected  javax.swing.RootPaneContainer findRootPaneContainer(java.awt.Component component)
           
 void hide()
          Hides the wait cursor if visible.
 void show()
          Shows the wait cursor after DEFAULT_DELAY number of milliseconds has elapsed.
 void show(int delay)
          Schedules the wait cursor to be shown after the specified number of milliseconds has elapsed.
 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

WaitCursor

public WaitCursor()
Deprecated. since 11.1.1 Use WaitCursor(Component).

WaitCursor

public WaitCursor(java.awt.Component component)
Attaches WaitCursor to the RootPaneContainer of the specified Component.

Method Detail

findRootPaneContainer

protected final javax.swing.RootPaneContainer findRootPaneContainer(java.awt.Component component)

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

attach

public 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.
Installs the manager on the specified 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().

Throws:
java.lang.IllegalStateException - if called after dispose().

detach

public void detach(javax.swing.RootPaneContainer rootPaneContainer)
Deprecated. since 11.1.1. Instead of attaching and attaching from specific root panes, clients should construct new 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.
De-installs the manager from the specified RootPaneContainer. This method is used by the IDE. You should only use show() and hide().
Throws:
java.lang.IllegalStateException - if called after dispose().

dispose

public void dispose()
Detaches this WaitCursor from any components it is attached to. This is the prefered way to ensure that any references to components held by a WaitCursor are released (although it may not be necessary, since those components may be unreachable, and therefore garbage collectable anyway).

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.

Throws:
java.lang.UnsupportedOperationException - if you call this method on the WaitCursor instance returned from Ide#getWaitCursor().
Since:
11.1.1

show

public void show()
Shows the wait cursor after DEFAULT_DELAY number of milliseconds has elapsed.
Throws:
java.lang.IllegalStateException - if called after dispose().

show

public final void show(int delay)
Schedules the wait cursor to be shown after the specified number of milliseconds has elapsed. If hide() is called before the delay has elapsed, then the WaitCursor is not shown.
Parameters:
delay - the number of milliseconds to delay before showing the wait cursor.
Throws:
java.lang.IllegalStateException - if called after dispose().

show

public void show(long delay)
Deprecated. since 11.1.1.0.0. Use #show(int).
Schedules the wait cursor to be shown after the specified number of milliseconds has elapsed. If hide() is called before the delay has elapsed, then the WaitCursor is not shown.
Parameters:
delay - the number of milliseconds to delay before showing the wait cursor.
Throws:
java.lang.IllegalStateException - if called after dispose().

hide

public void hide()
Hides the wait cursor if visible.

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 FIFO order. consider the following scenario:

  show(1000) // s1
  show(3000) // s2
  // wait 500 ms
  hide()
  
Calling hide() at 500ms will cancel s1 but not s2 thus resulting in the cursor being shown after 2500ms.
Throws:
java.lang.IllegalStateException - if called after dispose().

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


Copyright © 1997, 2015, Oracle. All rights reserved.