Package de.loskutov.anyedit.actions
Class ToggleWhitespace
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.core.commands.AbstractHandler
-
- de.loskutov.anyedit.actions.AbstractAction
-
- de.loskutov.anyedit.actions.ToggleWhitespace
-
- 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 ToggleWhitespace extends AbstractAction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ToggleWhitespace.SuperListener
-
Field Summary
Fields Modifier and Type Field Description private ToggleWhitespace.SuperListener
mainListener
private org.eclipse.jface.action.IAction
proxyAction
private static java.lang.String
SHOW_WS_COMMAND
private static java.lang.String
SPACES
private static java.lang.String
TABS
private static java.lang.String
TRAILING
-
Fields inherited from class de.loskutov.anyedit.actions.AbstractAction
editor
-
-
Constructor Summary
Constructors Constructor Description ToggleWhitespace()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addAnnotations(AbstractEditor aEditor, org.eclipse.jface.text.source.IAnnotationModelExtension extension)
private static void
addAnnotations(org.eclipse.jface.text.source.IAnnotationModel annotationModel, java.lang.String line, org.eclipse.jface.text.IRegion region, char c, org.eclipse.jface.text.source.Annotation annotation, org.eclipse.core.runtime.IProgressMonitor monitor)
private static void
addTrailingAnnotation(org.eclipse.jface.text.source.IAnnotationModel annotationModel, java.lang.String line, org.eclipse.jface.text.IRegion region)
private void
applyEditorAnnotations(boolean on)
private void
disableButton()
void
dispose()
private void
enableButton()
private static org.eclipse.jface.preference.IPreferenceStore
getPrefs()
void
init(org.eclipse.ui.IWorkbenchWindow window1)
(package private) ToggleWhitespace.SuperListener
installGlobalListener(org.eclipse.ui.IWorkbenchWindow window1)
protected static boolean
isChecked()
protected static boolean
isTrailingOnly()
protected static boolean
isTrailingShownDifferently()
private static void
removeAnnotations(org.eclipse.jface.text.source.IAnnotationModelExtension extension)
void
run(org.eclipse.jface.action.IAction action)
void
selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
protected static void
setChecked(boolean checked)
(package private) void
uninstallGlobalListener()
private void
updateCheckState()
-
Methods inherited from class de.loskutov.anyedit.actions.AbstractAction
createActiveEditorDelegate, execute, getCombinedPreferences, getEditor, getFile, getViewPart, getWindow, init, setActiveEditor, setEditor, setFile
-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
-
-
-
-
Field Detail
-
SHOW_WS_COMMAND
private static final java.lang.String SHOW_WS_COMMAND
- See Also:
- Constant Field Values
-
SPACES
private static final java.lang.String SPACES
- See Also:
- Constant Field Values
-
TABS
private static final java.lang.String TABS
- See Also:
- Constant Field Values
-
TRAILING
private static final java.lang.String TRAILING
- See Also:
- Constant Field Values
-
proxyAction
private org.eclipse.jface.action.IAction proxyAction
-
mainListener
private ToggleWhitespace.SuperListener mainListener
-
-
Method Detail
-
init
public void init(org.eclipse.ui.IWorkbenchWindow window1)
- Specified by:
init
in interfaceorg.eclipse.ui.IWorkbenchWindowActionDelegate
- Overrides:
init
in classAbstractAction
-
run
public void run(org.eclipse.jface.action.IAction action)
- Specified by:
run
in interfaceorg.eclipse.ui.IActionDelegate
- Overrides:
run
in classAbstractAction
-
installGlobalListener
ToggleWhitespace.SuperListener installGlobalListener(org.eclipse.ui.IWorkbenchWindow window1)
-
uninstallGlobalListener
void uninstallGlobalListener()
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.core.commands.IHandler
- Specified by:
dispose
in interfaceorg.eclipse.ui.IWorkbenchWindowActionDelegate
- Overrides:
dispose
in classAbstractAction
-
applyEditorAnnotations
private void applyEditorAnnotations(boolean on)
-
addAnnotations
private static void addAnnotations(AbstractEditor aEditor, org.eclipse.jface.text.source.IAnnotationModelExtension extension)
-
addAnnotations
private static void addAnnotations(org.eclipse.jface.text.source.IAnnotationModel annotationModel, java.lang.String line, org.eclipse.jface.text.IRegion region, char c, org.eclipse.jface.text.source.Annotation annotation, org.eclipse.core.runtime.IProgressMonitor monitor)
-
addTrailingAnnotation
private static void addTrailingAnnotation(org.eclipse.jface.text.source.IAnnotationModel annotationModel, java.lang.String line, org.eclipse.jface.text.IRegion region)
-
removeAnnotations
private static void removeAnnotations(org.eclipse.jface.text.source.IAnnotationModelExtension extension)
-
enableButton
private void enableButton()
-
disableButton
private void disableButton()
-
selectionChanged
public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
- Specified by:
selectionChanged
in interfaceorg.eclipse.ui.IActionDelegate
- Overrides:
selectionChanged
in classAbstractAction
-
updateCheckState
private void updateCheckState()
-
isChecked
protected static boolean isChecked()
-
getPrefs
private static org.eclipse.jface.preference.IPreferenceStore getPrefs()
-
setChecked
protected static void setChecked(boolean checked)
-
isTrailingOnly
protected static boolean isTrailingOnly()
-
isTrailingShownDifferently
protected static boolean isTrailingShownDifferently()
-
-