Eclipse triple shortcut operator?

In Eclipse (3.4+ up), I looked for a shortcut that converts the condition block if {} else {} into a three-dimensional operator (or ?:) .

How can i do this?

+6
java eclipse keyboard-shortcuts
source share
3 answers

Sorry if this is no longer relevant.

I wrote an eclipse plugin that does just that:

http://marketplace.eclipse.org/content/spartan-refactoring

Feel free to report this if you have any problems installing or using this plug-in.

Edit : A rewritten version of other developers is available at https://marketplace.eclipse.org/content/spartan-refactoring-0

+4
source share

There is no such shortcut. Refactoring operators in expressions is not a trivial process, and you cannot always start with it. The process will be too complicated for automation.

However, Ctrl + Shift + L will display ALL Eclipse shortcuts.

Related Questions

  • Hidden Eclipse Features
  • What is your favorite hotkey in Eclipse
+4
source share

Well, you can add a template for Eclipse as follows:

 ${condition:field(boolean)}? ${positive:field(void)}: ${negative:field(void)}; 

Call it something like tern , and you can automatically create a three-dimensional operator for you.

(Not sure if this is what you want)

+2
source share

All Articles