pedjjj
pedjjj

Reputation: 1038

NetBeans: Java: Shortcut for creating all cases in a switch

Is there any shortcut to immediately create (for one enum) all cases in a switch case statement?

Upvotes: 3

Views: 5514

Answers (1)

ollo
ollo

Reputation: 25350

To keep the answer short: there's none (yet).

Feel free to file a feature bug at netbeans.


However, there are some helpers:

  • Case template: Within the switch, type cs + <TAB> to generate a case template, including break and a ready-to-type case-value.
  • Switch/Case template: Type sw + <TAB> to generate a switch/case template. It doesn't generate cases for all enum values, but in addition to the case template it reduces the effort a lot!

You can find all temples at: Tools -> Options -> Editor -> Code Templates.

Maybe you can write even a template to generate a switch/case for all enum values.


Update

Feature announced for Netbeans 8.1.

Upvotes: 5

Related Questions