Package de.loskutov.anyedit.actions
Class Spaces
- 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.Spaces
-
- 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 Spaces extends AbstractTextAction
-
-
Field Summary
-
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 Spaces()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doTextOperation(org.eclipse.jface.text.IDocument doc, java.lang.String actionID, TextReplaceResultSet resultSet)
Should be invoked always after estimateActionRange() to ensure that operaton is possibleprotected TextReplaceResultSet
estimateActionRange(org.eclipse.jface.text.IDocument doc)
protected java.lang.String
getLineDelimiter()
private static java.lang.String
getLineDelimiter(org.osgi.service.prefs.Preferences node)
private static org.osgi.service.prefs.Preferences
getPlatformPreferences(org.eclipse.core.resources.IProject project)
int
getTabWidth(org.eclipse.core.resources.IFile file, CombinedPreferences prefs)
private boolean
isAddLineEnabled(CombinedPreferences prefs)
boolean
isDefaultTabToSpaces()
protected boolean
isFixLineDelimitersEnabled(CombinedPreferences prefs)
protected boolean
isRemoveTrailingSpaceEnabled(CombinedPreferences prefs)
protected boolean
isReplaceAllSpacesEnabled(CombinedPreferences prefs)
protected boolean
isReplaceAllTabsEnabled(CombinedPreferences prefs)
private boolean
isSaveAndAddLineEnabled(CombinedPreferences prefs)
boolean
isSaveAndConvertEnabled()
private boolean
isSaveAndFixLineDelimitersEnabled(CombinedPreferences prefs)
boolean
isSaveAndTrimEnabled()
-
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
-
-
-
-
Method Detail
-
estimateActionRange
protected TextReplaceResultSet estimateActionRange(org.eclipse.jface.text.IDocument doc)
- Specified by:
estimateActionRange
in classAbstractTextAction
-
doTextOperation
protected void doTextOperation(org.eclipse.jface.text.IDocument doc, java.lang.String actionID, TextReplaceResultSet resultSet) throws org.eclipse.jface.text.BadLocationException
Should be invoked always after estimateActionRange() to ensure that operaton is possible- Specified by:
doTextOperation
in classAbstractTextAction
- Parameters:
doc
- cannot be nullactionID
-resultSet
- cannot be null- Throws:
org.eclipse.jface.text.BadLocationException
-
getLineDelimiter
protected java.lang.String getLineDelimiter()
-
getPlatformPreferences
private static org.osgi.service.prefs.Preferences getPlatformPreferences(org.eclipse.core.resources.IProject project)
-
getLineDelimiter
private static java.lang.String getLineDelimiter(org.osgi.service.prefs.Preferences node)
-
isSaveAndTrimEnabled
public boolean isSaveAndTrimEnabled()
-
isSaveAndAddLineEnabled
private boolean isSaveAndAddLineEnabled(CombinedPreferences prefs)
-
isSaveAndFixLineDelimitersEnabled
private boolean isSaveAndFixLineDelimitersEnabled(CombinedPreferences prefs)
-
isSaveAndConvertEnabled
public boolean isSaveAndConvertEnabled()
-
isAddLineEnabled
private boolean isAddLineEnabled(CombinedPreferences prefs)
-
isRemoveTrailingSpaceEnabled
protected boolean isRemoveTrailingSpaceEnabled(CombinedPreferences prefs)
-
isFixLineDelimitersEnabled
protected boolean isFixLineDelimitersEnabled(CombinedPreferences prefs)
-
isReplaceAllTabsEnabled
protected boolean isReplaceAllTabsEnabled(CombinedPreferences prefs)
-
isReplaceAllSpacesEnabled
protected boolean isReplaceAllSpacesEnabled(CombinedPreferences prefs)
-
isDefaultTabToSpaces
public boolean isDefaultTabToSpaces()
-
getTabWidth
public int getTabWidth(org.eclipse.core.resources.IFile file, CombinedPreferences prefs)
-
-