Class AceCommandDescription
java.lang.Object
cn.mapway.document.ui.client.component.ace.AceCommandDescription
Rules describing how editor runs this command (from keyboard,
from command line or by
AceEditor.execCommand(String) API calls).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAce command execution action.static classKey binding description.static enumAction defines a way of running commands based on editor text selection.static enumAce command scrolling options. -
Constructor Summary
ConstructorsConstructorDescriptionDefine Ace command with command line name and execution action -
Method Summary
Modifier and TypeMethodDescriptionstatic AceCommandDescriptionfromJavaScript(com.google.gwt.core.client.JavaScriptObject obj) Create Ace command from javascript object.Give Ace command group name of this command.Give key bindings.getExec()Give execution action of this command.Give multi-select action for this command.getName()Give command line name.Give scroll settings for this command.booleanIn case this parameter is true keyboard event will be passed to original listener.booleanDescribe does this command change editor document or not.com.google.gwt.core.client.JavaScriptObjecttoJavaScript(AceEditor editor) Create javascript object from Ace command description.toString()withAceCommandGroup(String aceCommandGroup) Chainable setter method for aceCommandGroup property.Chainable setter method for bindKey property.withBindKey(String bindKeyForAllPlatforms) Chainable setter method for bindKey property for all platforms.withBindKey(String bindKeyForAllPlatformsExceptMac, String bindKeyForMac) Chainable setter method for bindKey property for Mac and other platforms separately.withMultiSelectAction(AceCommandDescription.MultiSelectAction multiSelectAction) Chainable setter method for multiSelectAction property.withPassEvent(boolean passEvent) Chainable setter method for passEvent property.withReadOnly(boolean readOnly) Chainable setter method for readOnly property.withScrollIntoView(AceCommandDescription.ScrollIntoView scrollIntoView) Chainable setter method for scrollIntoView property.
-
Constructor Details
-
AceCommandDescription
Define Ace command with command line name and execution action- Parameters:
name- command line nameexec- execution action
-
-
Method Details
-
getName
Give command line name.- Returns:
- command line name
-
getExec
Give execution action of this command.- Returns:
- execution action
-
getBindKey
Give key bindings.- Returns:
- key bindings
-
isReadOnly
public boolean isReadOnly()Describe does this command change editor document or not.- Returns:
- whether or not editor document could be changed
-
isPassEvent
public boolean isPassEvent()In case this parameter is true keyboard event will be passed to original listener.- Returns:
- true in case event shouldn't be stopped after command execution
-
getScrollIntoView
Give scroll settings for this command. In case it's null command is executed without scroll adjustment. Otherwise seeAceCommandDescription.ScrollIntoViewfor details.- Returns:
- scroll settings
-
getMultiSelectAction
Give multi-select action for this command. In case it's null command is executed once without virtual changes in selection ranges. Otherwise seeAceCommandDescription.MultiSelectActionfor details.- Returns:
- multi-select action
-
getAceCommandGroup
Give Ace command group name of this command.- Returns:
- Ace command group name
-
withBindKey
Chainable setter method for bindKey property.- Parameters:
bindKey- key binding (e.g. "shift-esc|ctrl-`" or "Command+Alt+C")- Returns:
- reference to this command description
-
withBindKey
Chainable setter method for bindKey property for all platforms.- Parameters:
bindKeyForAllPlatforms- key binding (e.g. "shift-esc|ctrl-`" or "Command+Alt+C")- Returns:
- reference to this command description
-
withBindKey
public AceCommandDescription withBindKey(String bindKeyForAllPlatformsExceptMac, String bindKeyForMac) Chainable setter method for bindKey property for Mac and other platforms separately.- Parameters:
bindKeyForAllPlatformsExceptMac- key binding for everything except Mac (e.g. "shift-esc|ctrl-`")bindKeyForMac- key binding for Mac (e.g. "shift-esc|ctrl-`" or "Command+Alt+C")- Returns:
- reference to this command description
-
withReadOnly
Chainable setter method for readOnly property.- Parameters:
readOnly- describes does this command change editor document or not- Returns:
- reference to this command description
-
withPassEvent
Chainable setter method for passEvent property.- Parameters:
passEvent- in case it's true keyboard event will not be stopped and will be passed to original listener after command execution- Returns:
- reference to this command description
-
withScrollIntoView
public AceCommandDescription withScrollIntoView(AceCommandDescription.ScrollIntoView scrollIntoView) Chainable setter method for scrollIntoView property.- Parameters:
scrollIntoView- scroll settings for this command (in case it's null command is executed without scroll adjustment; otherwise seeAceCommandDescription.ScrollIntoViewfor details)- Returns:
- reference to this command description
-
withMultiSelectAction
public AceCommandDescription withMultiSelectAction(AceCommandDescription.MultiSelectAction multiSelectAction) Chainable setter method for multiSelectAction property.- Parameters:
multiSelectAction- multi-select action for this command (in case it's null command is executed once without virtual changes in selection ranges; otherwise seeAceCommandDescription.MultiSelectActionfor details)- Returns:
- reference to this command description
-
withAceCommandGroup
Chainable setter method for aceCommandGroup property.- Parameters:
aceCommandGroup- Ace command group name of this command- Returns:
- reference to this command description
-
toString
-
fromJavaScript
Create Ace command from javascript object.- Parameters:
obj- javascript object describing Ace command- Returns:
- Ace command description object
-
toJavaScript
Create javascript object from Ace command description.- Parameters:
editor- Ace editor java wrapper- Returns:
- Ace command javascript object
-