站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

CloseOperationState (MultiView Windows) - NetBeans API Javadoc (Current Development Version)

org.netbeans.core.multiview/1 1.9

org.netbeans.core.spi.multiview
Class CloseOperationState

java.lang.Object
  extended by org.netbeans.core.spi.multiview.CloseOperationState

public final class CloseOperationState
extends Object

instances of this class describe the MultiViewElement's state when the component is about to be closed. (See MultiViewElement.canCloseElement()) New instances are created by MultiViewFactory.createUnsafeCloseState(java.lang.String, javax.swing.Action, javax.swing.Action) factory method.


Field Summary
static CloseOperationState STATE_OK
          Singleton instance of a close operation state, to be used whenever MultiViewElement is in consistent state and can be safely closed.
 
Method Summary
 boolean canClose()
          The return value denotes wheather the MultiViewElement can be closed or not.
 String getCloseWarningID()
          A preferably unique id of the reason why the element cannot be closed.
 Action getDiscardAction()
          Action is used when user wants to complete the closing of the component and discard any changes.
 Action getProceedAction()
          Action is used when user wants to complete the closing of the component without loosing changed data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_OK

public static final CloseOperationState STATE_OK
Singleton instance of a close operation state, to be used whenever MultiViewElement is in consistent state and can be safely closed.

Method Detail

canClose

public boolean canClose()
The return value denotes wheather the MultiViewElement can be closed or not.

Returns:
can close element or not

getCloseWarningID

public String getCloseWarningID()
A preferably unique id of the reason why the element cannot be closed. CloseOperationHandler implementation can use it when deciding about UI shown or action taken.


getProceedAction

public Action getProceedAction()
Action is used when user wants to complete the closing of the component without loosing changed data. Used by CloseOperationHandler.

Returns:
action which will be triggered when user confirms changes

getDiscardAction

public Action getDiscardAction()
Action is used when user wants to complete the closing of the component and discard any changes. Used by CloseOperationHandler.

Returns:
action which will be triggered when user discards changes

org.netbeans.core.multiview/1 1.9

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.