Skip to content

Commit 24009fe

Browse files
committed
Keyboard shortcut does not format non java files #90
1 parent 1cf1a50 commit 24009fe

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ This plugin helps you to apply to a common code style in a team of Eclipse JDT a
3333
<img src="https://raw.githubusercontent.com/markiewb/eclipsecodeformatter_for_netbeans/master/doc/project.png">
3434

3535

36+
<h2>Updates in 1.12.1:</h2>
37+
<ul>
38+
<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/90">Bugfix 88</a>]: Fixed: Keyboard shortcut does not format non java files</li>
39+
</ul>
40+
3641
<h2>Updates in 1.12.0:</h2>
3742
<ul>
3843
<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/86">Feature 86</a>]: Allow action to be invoked via macro</li>

manifest.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Manifest-Version: 1.0
22
OpenIDE-Module: de.markiewb.netbeans.plugins.eclipse.formatter
33
OpenIDE-Module-Layer: de/markiewb/netbeans/plugins/eclipse/formatter/layer.xml
44
OpenIDE-Module-Localizing-Bundle: de/markiewb/netbeans/plugins/eclipse/formatter/Bundle.properties
5-
OpenIDE-Module-Specification-Version: 1.12.0.0
5+
OpenIDE-Module-Specification-Version: 1.12.1.0

src/de/markiewb/netbeans/plugins/eclipse/formatter/Bundle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ OpenIDE-Module-Long-Description=\
55
You only have to provide an Eclipse formatter configuration file.\n\
66
<h3>\n<font color="#FF0000">Known issue: When the Eclipse formatter is used the line-breakpoints at the formatted lines are lost. \
77
Class/Method/Field breakpoints will be preserved.\
8-
</font>\n</h3>\n<h2>Features:</h2>\n<ul>\n<li>Global configuration and project specific configuration</li>\n<li>On save action (Disabled by default)</li>\n<li>Shows the used formatter as notification (Enabled by default)</li>\n<li>Supports profiles (since 1.6)</li>\n<li>Supports format of selected text (since 1.7)</li>\n<li>Preserve breakpoints (experimental) (since 1.8)</li>\n<li>Code templates for @formatter:on/off (since 1.9)</li>\n<li>Supports <a href="https://code.google.com/a/eclipselabs.org/p/workspacemechanic/">Workspace Mechanic</a> configuration file (since 1.10)</li>\n<li>Support configuration from .settings/org.eclipse.jdt.core.prefs (absolute and relative paths) (since 1.10)</li>\n<li>On save action: Introduced option for formatting only the changed lines (since 1.10)</li>\n<li>Support configuration of linefeed (since 1.10)</li>\n<li>Support configuration of source level (since 1.10)</li>\n<li>Support for macro invocation (since 1.12)</li>\n</ul>\n\n<img src="https://raw.githubusercontent.com/markiewb/eclipsecodeformatter_for_netbeans/master/doc/global.png">\n<br>\n<img src="https://raw.githubusercontent.com/markiewb/eclipsecodeformatter_for_netbeans/master/doc/project.png">\n\n\n<h2>Updates in 1.12.0:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/86">Feature 86</a>]: Allow action to be invoked via macro</li>\n</ul>\n\n<h2>Updates in 1.11.0:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/78">Feature 78</a>]: Support formatting using Eclipse 4.5.2 Mars.2</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/74">Bugfix 74</a>]: Fixed: Minor UI issues in options dialog</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/80">Bugfix 80</a>]: Fixed: Prevent "URI is not hierarchical" exception</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/77">Bugfix 77</a>]: Fixed: Exception, when using third-party Java code formatter in configuation file</li>\n</ul>\n\n<h2>Updates in 1.10.2:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/61">Feature 61</a>]: Support <a href="https://code.google.com/a/eclipselabs.org/p/workspacemechanic/">Workspace Mechanic</a> configuration file (*.epf)</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/67">Feature 67</a>]: Support configuration via <projectdir>/.settings/org.eclipse.jdt.core.prefs or absolute path to org.eclipse.jdt.core.prefs</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/68">Feature 68</a>]: Reduce download size by 77% by repacking jars with pack200</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/70">Feature 70</a>]: On save action: Introduced option for formatting only the changed lines</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/71">Feature 71</a>]: Support configuration of linefeed</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/23">Feature 23</a>]: Support configuration of source level</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/37">Feature 37</a>]: Fallback to NB formatter, if file isn't a java file</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/73">Bugfix 73</a>]: Selection in undocked windows is not respected, when called via keyboard</li>\n\n\n\n</ul>\n\n<h2>Updates in 1.9:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/63">Task 63</a>]: Update to Eclipse formatter jars from Eclipse 4.5.1 (Mars.1)</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/65">Feature 65</a>]: Code templates for @formatter:on/off (<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/wiki/Support-of-@formatter:off">More details...)\
8+
</font>\n</h3>\n<h2>Features:</h2>\n<ul>\n<li>Global configuration and project specific configuration</li>\n<li>On save action (Disabled by default)</li>\n<li>Shows the used formatter as notification (Enabled by default)</li>\n<li>Supports profiles (since 1.6)</li>\n<li>Supports format of selected text (since 1.7)</li>\n<li>Preserve breakpoints (experimental) (since 1.8)</li>\n<li>Code templates for @formatter:on/off (since 1.9)</li>\n<li>Supports <a href="https://code.google.com/a/eclipselabs.org/p/workspacemechanic/">Workspace Mechanic</a> configuration file (since 1.10)</li>\n<li>Support configuration from .settings/org.eclipse.jdt.core.prefs (absolute and relative paths) (since 1.10)</li>\n<li>On save action: Introduced option for formatting only the changed lines (since 1.10)</li>\n<li>Support configuration of linefeed (since 1.10)</li>\n<li>Support configuration of source level (since 1.10)</li>\n<li>Support for macro invocation (since 1.12)</li>\n</ul>\n\n<img src="https://raw.githubusercontent.com/markiewb/eclipsecodeformatter_for_netbeans/master/doc/global.png">\n<br>\n<img src="https://raw.githubusercontent.com/markiewb/eclipsecodeformatter_for_netbeans/master/doc/project.png">\n\n\n<h2>Updates in 1.12.1:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/90">Bugfix 88</a>]: Fixed: Keyboard shortcut does not format non java files</li>\n</ul>\n\n<h2>Updates in 1.12.0:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/86">Feature 86</a>]: Allow action to be invoked via macro</li>\n</ul>\n\n<h2>Updates in 1.11.0:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/78">Feature 78</a>]: Support formatting using Eclipse 4.5.2 Mars.2</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/74">Bugfix 74</a>]: Fixed: Minor UI issues in options dialog</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/80">Bugfix 80</a>]: Fixed: Prevent "URI is not hierarchical" exception</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/77">Bugfix 77</a>]: Fixed: Exception, when using third-party Java code formatter in configuation file</li>\n</ul>\n\n<h2>Updates in 1.10.2:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/61">Feature 61</a>]: Support <a href="https://code.google.com/a/eclipselabs.org/p/workspacemechanic/">Workspace Mechanic</a> configuration file (*.epf)</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/67">Feature 67</a>]: Support configuration via <projectdir>/.settings/org.eclipse.jdt.core.prefs or absolute path to org.eclipse.jdt.core.prefs</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/68">Feature 68</a>]: Reduce download size by 77% by repacking jars with pack200</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/70">Feature 70</a>]: On save action: Introduced option for formatting only the changed lines</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/71">Feature 71</a>]: Support configuration of linefeed</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/23">Feature 23</a>]: Support configuration of source level</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/37">Feature 37</a>]: Fallback to NB formatter, if file isn't a java file</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/73">Bugfix 73</a>]: Selection in undocked windows is not respected, when called via keyboard</li>\n\n\n\n</ul>\n\n<h2>Updates in 1.9:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/63">Task 63</a>]: Update to Eclipse formatter jars from Eclipse 4.5.1 (Mars.1)</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/65">Feature 65</a>]: Code templates for @formatter:on/off (<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/wiki/Support-of-@formatter:off">More details...)\
99
</a></li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/66">Task 66</a>]: Update requirements to NetBeans 8.0+</li>\n\n</ul>\n<h2>Updates in 1.8.0.6:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/57">Bugfix 57</a>]: Fixed: java.lang.IllegalArgumentException: bad position and run parts in EDT</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/4">Bugfix 4</a>]: Fixed: option panel isn't found by searching for "eclipse"</li>\n</ul>\n<h2>Updates in 1.8.0.5:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/56">Bugfix 56</a>]: Fixed: Format on Save - Changed files remain modified after saving them in Java Editor </li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/55">Bugfix 55</a>]: Fixed: "URI is not hierarchical" error message on calling format - add logging for this error</li>\n</ul>\n<h2>Updates in 1.8.0.4:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/47">Feature 47</a>]: Preserve Class/Method/Field breakpoints (experimental, can be disabled in options)</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/47">Bugfix 53</a>]: Fixed: Do not remove linebreakpoint, if line is not included in selection</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/52">Bugfix 52</a>]: Fixed: Cannot assign shortcut for "Format with Eclipse Formatter" action</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/46">Task 46</a>]: Update to use eclipse formatter libs from eclipse 4.4 </li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/48">Task 48</a>]: Support only NetBeans 7.4 and above</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/49">Task 49</a>]: Add donation button</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/50">Task 50</a>]: Add link to github/homepage</li>\n\n</ul>\n<h2>Updates in 1.7.1:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/41">Bugfix 41</a>]: Fixed: NPE when configuration file not found </li>\n</ul>\n<h2>Updates in 1.7:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/pull/38">Feature 38</a>]: Format selected part of document (PR by <a href="https://github.com/saadmufti">saadmufti</a>)</li>\n</ul>\n<h2>Updates in 1.6.1:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/34">Bugfix 34</a>]: Fixed: NPE while saving options when no profile is set</li>\n</ul>\n<h2>Updates in 1.6:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/30">Task 30</a>]: Update to Eclipse formatter jars from Eclipse Kepler 4.3</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/31">Feature 31</a>]: First profile in file is always used - support selection of profile</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/21">Feature 21</a>]: Project specific options: Show link to global options</li>\n</ul>\n\n<h2>Updates in 1.5:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/18">Bugfix 18</a>]: Fixed: Formatting with eclipse formatter introduces empty document in undo manager</li>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/27">Task 27</a>]: Provide a signed package for the PPUC</li>\n</ul>\n\n<h2>Updates in 1.4.1:</h2>\n<ul>\n<li>[<a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues/25">Bugfix 25</a>]: Fixed: Configured formatter.xml isn't used</li>\n</ul>\n<h2>Updates in 1.4:</h2>\n<ul>\n<li>major refactorings and fixes - see <a href="https://github.com/markiewb/eclipsecodeformatter_for_netbeans/issues?\
1010
milestone=1&page=1&state=closed">milestone 1.4@github</a></li>\n</ul>\n<h2>Note:</h2>\nPlease note that this plugin only provides support for formatting. \
1111
Eclipse users may miss the application of save-actions like "adding @Override annotations" or "member sort order". \

src/de/markiewb/netbeans/plugins/eclipse/formatter/actions/FormatAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
@NbBundle.Messages({ "CTL_EclipseFormatter=Format with Eclipse formatter 4.5",
3434
"eclipse45-format=Format with Eclipse formatter 4.5" })
35-
@EditorActionRegistration(name = FormatAction.MACRONAME, mimeType = "text/x-java", menuPath = "Source", menuPosition = 0, menuText = "#CTL_EclipseFormatter")
35+
@EditorActionRegistration(name = FormatAction.MACRONAME, menuPath = "Source", menuPosition = 0, menuText = "#CTL_EclipseFormatter")
3636
public class FormatAction extends org.netbeans.editor.BaseAction {
3737
public static final String ID = "org.netbeans.eclipse.formatter.ReformatWithEclipseBeforeSaveTask45";
3838
public static final String MACRONAME = "eclipse45-format";

0 commit comments

Comments
 (0)