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 classToggleWhitespace.SuperListener
-
Field Summary
Fields Modifier and Type Field Description private ToggleWhitespace.SuperListenermainListenerprivate org.eclipse.jface.action.IActionproxyActionprivate static java.lang.StringSHOW_WS_COMMANDprivate static java.lang.StringSPACESprivate static java.lang.StringTABSprivate static java.lang.StringTRAILING-
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 voidaddAnnotations(AbstractEditor aEditor, org.eclipse.jface.text.source.IAnnotationModelExtension extension)private static voidaddAnnotations(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 voidaddTrailingAnnotation(org.eclipse.jface.text.source.IAnnotationModel annotationModel, java.lang.String line, org.eclipse.jface.text.IRegion region)private voidapplyEditorAnnotations(boolean on)private voiddisableButton()voiddispose()private voidenableButton()private static org.eclipse.jface.preference.IPreferenceStoregetPrefs()voidinit(org.eclipse.ui.IWorkbenchWindow window1)(package private) ToggleWhitespace.SuperListenerinstallGlobalListener(org.eclipse.ui.IWorkbenchWindow window1)protected static booleanisChecked()protected static booleanisTrailingOnly()protected static booleanisTrailingShownDifferently()private static voidremoveAnnotations(org.eclipse.jface.text.source.IAnnotationModelExtension extension)voidrun(org.eclipse.jface.action.IAction action)voidselectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)protected static voidsetChecked(boolean checked)(package private) voiduninstallGlobalListener()private voidupdateCheckState()-
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:
initin interfaceorg.eclipse.ui.IWorkbenchWindowActionDelegate- Overrides:
initin classAbstractAction
-
run
public void run(org.eclipse.jface.action.IAction action)
- Specified by:
runin interfaceorg.eclipse.ui.IActionDelegate- Overrides:
runin classAbstractAction
-
installGlobalListener
ToggleWhitespace.SuperListener installGlobalListener(org.eclipse.ui.IWorkbenchWindow window1)
-
uninstallGlobalListener
void uninstallGlobalListener()
-
dispose
public void dispose()
- Specified by:
disposein interfaceorg.eclipse.core.commands.IHandler- Specified by:
disposein interfaceorg.eclipse.ui.IWorkbenchWindowActionDelegate- Overrides:
disposein 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:
selectionChangedin interfaceorg.eclipse.ui.IActionDelegate- Overrides:
selectionChangedin 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()
-
-