Package de.loskutov.anyedit.actions.sort
Class AbstractSortAction
- 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.sort.AbstractSortAction
-
- 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
- Direct Known Subclasses:
SortAlphabeticallyCaseInsensitiveAscending
,SortAlphabeticallyCaseInsensitiveDescending
,SortAlphabeticallyCaseSensitiveAscending
,SortAlphabeticallyCaseSensitiveDescending
,SortLineLengthAscending
,SortLineLengthDescending
,SortNumericallyAscending
,SortNumericallyDescending
public abstract class AbstractSortAction 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 AbstractSortAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
addLines(TextReplaceResultSet results, java.util.List<LineReplaceResult> lineList)
protected void
doTextOperation(org.eclipse.jface.text.IDocument document, java.lang.String action, TextReplaceResultSet results)
Should be invoked always after estimateActionRange() to ensure that operaton is possibleprotected TextReplaceResultSet
estimateActionRange(org.eclipse.jface.text.IDocument document)
protected abstract java.util.Comparator<LineReplaceResult>
getComparator()
private java.util.List<LineReplaceResult>
getLines(TextReplaceResultSet result, org.eclipse.jface.text.IDocument document)
private org.eclipse.jface.text.ITextSelection
getSelection()
private void
sortLines(java.util.List<LineReplaceResult> lines)
-
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
-
getComparator
protected abstract java.util.Comparator<LineReplaceResult> getComparator()
-
estimateActionRange
protected TextReplaceResultSet estimateActionRange(org.eclipse.jface.text.IDocument document)
- Specified by:
estimateActionRange
in classAbstractTextAction
-
doTextOperation
protected void doTextOperation(org.eclipse.jface.text.IDocument document, java.lang.String action, TextReplaceResultSet results) throws org.eclipse.jface.text.BadLocationException
Description copied from class:AbstractTextAction
Should be invoked always after estimateActionRange() to ensure that operaton is possible- Specified by:
doTextOperation
in classAbstractTextAction
- Parameters:
document
- cannot be nullaction
- desired text action idresults
- cannot be null- Throws:
org.eclipse.jface.text.BadLocationException
-
getLines
private java.util.List<LineReplaceResult> getLines(TextReplaceResultSet result, org.eclipse.jface.text.IDocument document) throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
-
sortLines
private void sortLines(java.util.List<LineReplaceResult> lines)
-
addLines
private void addLines(TextReplaceResultSet results, java.util.List<LineReplaceResult> lineList)
-
getSelection
private org.eclipse.jface.text.ITextSelection getSelection()
-
-