Apple Java Extensions

com.apple.eawt
Class ApplicationEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.apple.eawt.ApplicationEvent
All Implemented Interfaces:
java.io.Serializable

public class ApplicationEvent
extends java.util.EventObject

The class of events sent to ApplicationListener callbacks. Since these events are initiated by Apple events they provide additional functionality over the EventObjects that they inherit their basic characteristics from. For those events where it is appropriate, they store the file name of the item that the event corresponds to. They are also unique in that they can be flagged as, and tested for, having been handled.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 java.lang.String getFilename()
          Provides the filename associated with a particular AppleEvent.
 boolean isHandled()
          Determines whether an ApplicationListener has acted on a particular event.
 void setHandled(boolean state)
          Sets the state of the event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isHandled

public boolean isHandled()
Determines whether an ApplicationListener has acted on a particular event. An event is marked as having been handled with setHandled(true).

Returns:
true if the event has been handled, otherwise false

setHandled

public void setHandled(boolean state)
Sets the state of the event. After this method handles an ApplicationEvent, it may be useful to specify that it has been handled. This is usually used in conjunction with getHandled(). Set to true to designate that this event has been handled. By default it is false.

Parameters:
state - true if the event has been handled, otherwise false.

getFilename

public java.lang.String getFilename()
Provides the filename associated with a particular AppleEvent. When the ApplicationEvent corresponds to an Apple Event that needs to act on a particular file, the ApplicationEvent carries the name of the specific file with it. For example, the Print and Open events refer to specific files. For these cases, this returns the appropriate file name.

Returns:
the full path to the file associated with the event, if applicable, otherwise null

Apple Java Extensions

To file bugs or suggest feature enhancements for the Java implementation in Mac OS X, visit the Apple Developer Connection Bug Reporter website. File bugs under the Java (new bugs) component, version X.

Additional documentation for Java development on Mac OS X is available online at the Java Developer Documentation website.

© Apple Computer, Inc. March 2008