Package org.cytoscape.application.events
Class CyShutdownRequestedEvent
java.lang.Object
org.cytoscape.event.AbstractCyEvent<Object>
org.cytoscape.application.events.CyShutdownRequestedEvent
An event fired immediately before Cytoscape will be shutdown to determine if the shutdown action should be aborted.
If the shutdown request is not aborted then a CyShutdownEvent will be fired immediately after this event.
Apps should not listen for
CyShutdownRequestedEvent
. It is used internally by Cytoscape to prompt the user
if they want to cancel exiting Cytoscape. Apps should only use CyShutdownListener
to be notified
of shutdown.Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
Module: application-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>application-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (DO NOT USE): This class may change or be removed in future minor version upgrades of Cytoscape. It is not safe for Apps to reference this class.
-
Constructor Summary
ConstructorDescriptionCyShutdownRequestedEvent
(Object source) Constructor.CyShutdownRequestedEvent
(Object source, boolean force) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
abortShutdown
(String why) A callback to the firing class that allows a listener to abort the shutdown.Returns the reason that the application should not be shut down.boolean
Returns true if no reason is provided to abort the shutdown and false if anyone processing this event wants to prevent shutdown.boolean
Returns true if we want to force the shutdown without any user promptMethods inherited from class org.cytoscape.event.AbstractCyEvent
getListenerClass, getSource
-
Constructor Details
-
CyShutdownRequestedEvent
Constructor.- Parameters:
source
- The object firing this event.force
- If true, force the shutdown (no user prompt)
-
CyShutdownRequestedEvent
Constructor.- Parameters:
source
- The object firing this event.
-
-
Method Details
-
abortShutdown
A callback to the firing class that allows a listener to abort the shutdown. This can cause conflicts if abused.- Parameters:
why
- A user comprehensible message describing why the shutdown was aborted.
-
abortShutdownReason
Returns the reason that the application should not be shut down.- Returns:
- The reason that the application should not be shut down.
-
actuallyShutdown
public boolean actuallyShutdown()Returns true if no reason is provided to abort the shutdown and false if anyone processing this event wants to prevent shutdown.- Returns:
- true if no reason is provided to abort the shutdown and false if anyone processing this event wants to prevent shutdown.
-
forceShutdown
public boolean forceShutdown()Returns true if we want to force the shutdown without any user prompt
-