Package de.loskutov.anyedit.actions
Class ChangeCase
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.core.commands.AbstractHandler
-
- de.loskutov.anyedit.actions.AbstractAction
-
- de.loskutov.anyedit.actions.AbstractTextAction
-
- de.loskutov.anyedit.actions.AbstractReplaceAction
-
- de.loskutov.anyedit.actions.ChangeCase
-
- All Implemented Interfaces:
org.eclipse.core.commands.IHandler,org.eclipse.core.commands.IHandler2,org.eclipse.ui.IActionDelegate,org.eclipse.ui.IEditorActionDelegate,org.eclipse.ui.IViewActionDelegate,org.eclipse.ui.IWorkbenchWindowActionDelegate
public class ChangeCase extends AbstractReplaceAction
Initiated by Ray Vanderborght.
-
-
Field Summary
Fields Modifier and Type Field Description private static intKEY_CAMELprivate static intKEY_CAMEL_TO_PASCALprivate static intKEY_CAPITALIZEprivate static intKEY_INVERT_CASEprivate static intKEY_TO_LOWERprivate static intKEY_TO_UPPERprivate static java.util.regex.PatternPASCAL-
Fields inherited from class de.loskutov.anyedit.actions.AbstractReplaceAction
shouldStopReplace
-
Fields inherited from class de.loskutov.anyedit.actions.AbstractTextAction
ACTION_ID_CAMEL, ACTION_ID_CAMEL_TO_PASCAL, ACTION_ID_CAPITALIZE, ACTION_ID_CONVERT_SPACES, ACTION_ID_CONVERT_TABS, ACTION_ID_ENCODE, ACTION_ID_TO_LOWER, ACTION_ID_TO_UPPER, ACTION_ID_UNESCAPE, ACTION_ID_UNICODIFY, textUtil
-
Fields inherited from class de.loskutov.anyedit.actions.AbstractAction
editor
-
-
Constructor Summary
Constructors Constructor Description ChangeCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetActionKey(java.lang.String actionID)Mapping between String actions and "smarter" custom int's for inernal (in performReplace() method) use only!protected java.lang.StringperformReplace(java.lang.String line, int actionKey)Does custom replace operation.-
Methods inherited from class de.loskutov.anyedit.actions.AbstractReplaceAction
doTextOperation, estimateActionRange
-
Methods inherited from class de.loskutov.anyedit.actions.AbstractTextAction
init, isSaveDirtyBufferEnabled, isUsedOnSave, run, setUsedOnSave
-
Methods inherited from class de.loskutov.anyedit.actions.AbstractAction
createActiveEditorDelegate, dispose, execute, getCombinedPreferences, getEditor, getFile, getViewPart, getWindow, init, init, selectionChanged, setActiveEditor, setEditor, setFile
-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
-
-
-
-
Field Detail
-
KEY_TO_LOWER
private static final int KEY_TO_LOWER
- See Also:
- Constant Field Values
-
KEY_TO_UPPER
private static final int KEY_TO_UPPER
- See Also:
- Constant Field Values
-
KEY_INVERT_CASE
private static final int KEY_INVERT_CASE
- See Also:
- Constant Field Values
-
KEY_CAPITALIZE
private static final int KEY_CAPITALIZE
- See Also:
- Constant Field Values
-
KEY_CAMEL
private static final int KEY_CAMEL
- See Also:
- Constant Field Values
-
KEY_CAMEL_TO_PASCAL
private static final int KEY_CAMEL_TO_PASCAL
- See Also:
- Constant Field Values
-
PASCAL
private static final java.util.regex.Pattern PASCAL
-
-
Method Detail
-
performReplace
protected java.lang.String performReplace(java.lang.String line, int actionKey)Description copied from class:AbstractReplaceActionDoes custom replace operation.- Specified by:
performReplacein classAbstractReplaceAction- Parameters:
line- text to "replace"actionKey- any one action key as delivered by getActionKey(String) method- Returns:
- "replace" result or old unchanged string, if replace was not performed
-
getActionKey
protected int getActionKey(java.lang.String actionID)
Description copied from class:AbstractReplaceActionMapping between String actions and "smarter" custom int's for inernal (in performReplace() method) use only!- Specified by:
getActionKeyin classAbstractReplaceAction- Parameters:
actionID- action id starts with one of AbstractTextAction.ACTION_ID_ constants (it starts with the constant cause we have multiple actions there which are used once for key bindings and once for editor actions).- Returns:
- any one int value for given action
-
-