IntelliJ Community . ToggleKeywordPlugin

 
ToggleKeywordPlugin 

HOME INDEX SEARCH CHANGES GO  

ToggleKeywordPlugin

This plugin was tested with IntelliJ IDEA Build 695 but might work with other builds.

What is it?

This plugin toggles the Java keywords public/protected/private and true/false. Actually, true and false aren't keywords but reserved words. However, I didn't want to call the plugin ToggleKeywordOrReservedWord or something like that wink

This is my first plugin and I hope others will find it useful. Comments, bug reports and feature requests are always welcome!

How to install it

Copy the jar file into the "plugins" directory of IntelliJ IDEA. Note that there is no keymap associated with this plugin. Go to Options | Keymap and find the "Toggle Keyword" entry under the "Editor Actions" section. Assign a keyboard shortcut of your choice (I use Ctrl+T).

How to use it

Place the caret on one of the keywords/reserved words mentioned above and press the keyboard shortcut. Enjoy!

To do

  • Allow toggling of all occurrences in the current selection at the same time
  • Allow caret to be anywhere in the current line
  • Resolve conflicts between public/protected/private and true/false by only toggling true/false when the cursor is in the word or it is the only togglable thing on the line

Acknowledgements

Thanks to ChrisBartley for creating the ToggleCharacterCase plugin. It served as a template for this plugin.

Version History

1.0 (01 Oct 2002)
  • Initial version
1.1 (20 Feb 2003)
  • Fixed bug: true/false doesn't toggle if enclosed by non-whitespace delimiters such as "{}[]()". Thanks to PaulBruynel for reporting this bug.
  • Enhancement: if possible without disrupting back-and-forth toggling, the caret is left at its original offset. Thanks to BjoernKuebler for suggesting this enhancement.
1.2 (24 Feb 2003)
  • Fixed bug: true/false doesn't toggle if delimiter is "," (e.g. as part of a parameter list). Thanks to PaulBruynel for reporting this bug.
  • Added rudimentary unit tests.
1.3 (02 Feb 2005) - Built by Nathan Brown
  • Recompiled for Irida Build 3193.
  • Updated to avoid use of deprecated getChars() method of Document.

Notes for 3.0 release (builds 676+)

You have to change group-id "EditorActions" to "EditorPopupMenu" at plugin.xml -- RomanPorotnikov - 22 Nov 2002

It works fine for me using "EditorActions" with build 695. -- ThomasVollmer - 24 Feb 2003

IntelliJPluginWebForm
IntelliJPluginName: ToggleKeywordPlugin
IntelliJPluginVersion: 1.3
IntelliJPluginVendor: Thomas Vollmer
IntelliJPluginBinary: http://www.intellij.org/twiki/pub/Main/ToggleKeywordPlugin/ToggleKeywordPlugin-1.3.jar
IntelliJPluginSource: http://www.intellij.org/twiki/pub/Main/ToggleKeywordPlugin/ToggleKeywordPlugin-1.3-src.jar
IntelliJPluginClassification:
TopicClassification: IntelliJPluginPackage
TopicShortDescription: Toggles public/protected/private and true/false.
TestedOnOS: OsWin2K, OsWinXP
ShouldRunOnOS: AnyOS

Attachment: sort Action: Size: Date: Who: Comment:
ToggleKeywordPlugin-1.0.jar action 3840 02 Oct 2002 - 05:15 ThomasVollmer jar
ToggleKeywordPlugin-1.0-src.zip action 1851 02 Oct 2002 - 05:15 ThomasVollmer src
ToggleKeywordPlugin-1.1.jar action 4879 20 Feb 2003 - 18:02 ThomasVollmer jar
ToggleKeywordPlugin-1.1-src.jar action 2523 20 Feb 2003 - 18:02 ThomasVollmer src
ToggleKeywordPlugin-1.2.jar action 5441 24 Feb 2003 - 18:50 ThomasVollmer jar
ToggleKeywordPlugin-1.2-src.jar action 2812 24 Feb 2003 - 18:51 ThomasVollmer src
ToggleKeywordPlugin-1.3.jar action 5386 02 Feb 2005 - 15:22 NathanBrown plugin jar
ToggleKeywordPlugin-1.3-src.jar action 2797 02 Feb 2005 - 15:22 NathanBrown src

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.