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 class
DefaultUserActionManagerCtrl.Category
static class
DefaultUserActionManagerCtrl.ClipboardImpl
Clipboard data object for copy/paste, internal use onlystatic class
DefaultUserActionManagerCtrl.UserActionContextImpl
internal use only
-
Field Summary
Fields Modifier and Type Field Description protected static char
SPLIT_CHAR
-
Constructor Summary
Constructors Constructor Description DefaultUserActionManagerCtrl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(Spreadsheet sparedsheet)
Will be called when a handler assign to spreadsheet.protected void
clearClipboard()
protected void
clearUndoable()
protected boolean
dispatchAuxAction(UserActionContext ctx)
protected boolean
dispatchKeyAction(UserActionContext ctx)
void
doAfterLoadBook(Book book)
Will be called when a book set to sparedshetprotected boolean
doRedo()
protected boolean
doUndo()
protected String
getAction(org.zkoss.zk.ui.event.KeyEvent event)
protected UserActionContext.Clipboard
getClipboard()
String
getCtrlKeys()
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 disabledvoid
onEvent(org.zkoss.zk.ui.event.Event event)
void
registerHandler(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.void
setHandler(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 void
updateClipboardEffect(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:UserActionManagerCtrl
Will be called when a handler assign to spreadsheet.- Specified by:
bind
in interfaceUserActionManagerCtrl
-
dispatchAuxAction
protected boolean dispatchAuxAction(UserActionContext ctx)
-
getCtrlKeys
public String getCtrlKeys()
Description copied from interface:UserActionManagerCtrl
Returns the interested ctrlKeys of the spreadsheet- Specified by:
getCtrlKeys
in 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:UserActionManagerCtrl
Returns the supported user action that should be disabled- Specified by:
getSupportedUserAction
in interfaceUserActionManagerCtrl
- Parameters:
sheet
- the sheet for cheeking- Returns:
- a disabled user action array
-
getInterestedEvents
public Set<String> getInterestedEvents()
Description copied from interface:UserActionManagerCtrl
Returns the interested events of the spreadsheet.- Specified by:
getInterestedEvents
in 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:
onEvent
in 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:UserActionManagerCtrl
Will be called when a book set to sparedshet- Specified by:
doAfterLoadBook
in 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:UserActionManager
Register a handler to the handler list of category/action, append to the last handler of same category/action.- Specified by:
registerHandler
in 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:UserActionManager
set a handler to the handler list of category/action, it will remove all other handlers in same category/action- Specified by:
setHandler
in 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()
-
-