Package io.keikai.ui.impl
Class DefaultUserActionManagerCtrl
- java.lang.Object
-
- io.keikai.ui.impl.DefaultUserActionManagerCtrl
-
- All Implemented Interfaces:
UserActionManagerCtrl,UserActionManager,Serializable,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>,org.zkoss.zk.ui.event.SerializableEventListener<org.zkoss.zk.ui.event.Event>
- Direct Known Subclasses:
UserActionManagerCtrlImpl
public class DefaultUserActionManagerCtrl extends Object implements UserActionManagerCtrl, UserActionManager
The user action handler which provide default spreadsheet operation handling.- Since:
- 3.0.0
- Author:
- dennis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultUserActionManagerCtrl.Categorystatic classDefaultUserActionManagerCtrl.ClipboardImplClipboard data object for copy/paste, internal use onlystatic classDefaultUserActionManagerCtrl.UserActionContextImplinternal use only
-
Field Summary
Fields Modifier and Type Field Description protected static charSPLIT_CHAR
-
Constructor Summary
Constructors Constructor Description DefaultUserActionManagerCtrl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(Spreadsheet sparedsheet)Will be called when a handler assign to spreadsheet.protected voidclearClipboard()protected voidclearUndoable()protected booleandispatchAuxAction(UserActionContext ctx)protected booleandispatchKeyAction(UserActionContext ctx)voiddoAfterLoadBook(Book book)Will be called when a book set to sparedshetprotected booleandoRedo()protected booleandoUndo()protected StringgetAction(org.zkoss.zk.ui.event.KeyEvent event)protected UserActionContext.ClipboardgetClipboard()StringgetCtrlKeys()Returns the interested ctrlKeys of the spreadsheetprotected List<UserActionHandler>getHandlerList(String category, String action)Set<String>getInterestedEvents()Returns the interested events of the spreadsheet.Set<String>getSupportedUserAction(Sheet sheet)Returns the supported user action that should be disabledvoidonEvent(org.zkoss.zk.ui.event.Event event)voidregisterHandler(String category, String action, UserActionHandler handler)Register a handler to the handler list of category/action, append to the last handler of same category/action.voidsetHandler(String category, String action, UserActionHandler handler)set a handler to the handler list of category/action, it will remove all other handlers in same category/actionprotected voidupdateClipboardEffect(Sheet sheet)
-
-
-
Field Detail
-
SPLIT_CHAR
protected static final char SPLIT_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
bind
public void bind(Spreadsheet sparedsheet)
Description copied from interface:UserActionManagerCtrlWill be called when a handler assign to spreadsheet.- Specified by:
bindin interfaceUserActionManagerCtrl
-
dispatchAuxAction
protected boolean dispatchAuxAction(UserActionContext ctx)
-
getCtrlKeys
public String getCtrlKeys()
Description copied from interface:UserActionManagerCtrlReturns the interested ctrlKeys of the spreadsheet- Specified by:
getCtrlKeysin interfaceUserActionManagerCtrl- Returns:
- ctrlKeys that you want to set to spreadsheet, or null to set nothing to spreadsheet.
- See Also:
Spreadsheet.setCtrlKeys(String)
-
getAction
protected String getAction(org.zkoss.zk.ui.event.KeyEvent event)
-
dispatchKeyAction
protected boolean dispatchKeyAction(UserActionContext ctx)
-
getSupportedUserAction
public Set<String> getSupportedUserAction(Sheet sheet)
Description copied from interface:UserActionManagerCtrlReturns the supported user action that should be disabled- Specified by:
getSupportedUserActionin interfaceUserActionManagerCtrl- Parameters:
sheet- the sheet for cheeking- Returns:
- a disabled user action array
-
getInterestedEvents
public Set<String> getInterestedEvents()
Description copied from interface:UserActionManagerCtrlReturns the interested events of the spreadsheet.- Specified by:
getInterestedEventsin interfaceUserActionManagerCtrl- Returns:
- event name list if you have any interested event of spreadsheet.
- See Also:
Events
-
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event event) throws Exception- Specified by:
onEventin interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>- Throws:
Exception
-
updateClipboardEffect
protected void updateClipboardEffect(Sheet sheet)
-
doAfterLoadBook
public void doAfterLoadBook(Book book)
Description copied from interface:UserActionManagerCtrlWill be called when a book set to sparedshet- Specified by:
doAfterLoadBookin interfaceUserActionManagerCtrl- Parameters:
book- the book to load or null if close a book
-
getClipboard
protected UserActionContext.Clipboard getClipboard()
-
clearClipboard
protected void clearClipboard()
-
registerHandler
public void registerHandler(String category, String action, UserActionHandler handler)
Description copied from interface:UserActionManagerRegister a handler to the handler list of category/action, append to the last handler of same category/action.- Specified by:
registerHandlerin interfaceUserActionManager- Parameters:
category- the category of the handleraction- the action of the handlerhandler- the handler
-
setHandler
public void setHandler(String category, String action, UserActionHandler handler)
Description copied from interface:UserActionManagerset a handler to the handler list of category/action, it will remove all other handlers in same category/action- Specified by:
setHandlerin interfaceUserActionManager- Parameters:
category- the category of the handleraction- the action of the handlerhandler- the handler
-
getHandlerList
protected List<UserActionHandler> getHandlerList(String category, String action)
-
doUndo
protected boolean doUndo()
-
doRedo
protected boolean doRedo()
-
clearUndoable
protected void clearUndoable()
-
-