Skip to content

Commit b014ff8

Browse files
committed
Merge branch 'feature/issue-65'
2 parents 119d673 + f018cfc commit b014ff8

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ 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>Supports profiles (since 1.6)</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 format of selected text (since 1.7)</li>\n<li>Preserve breakpoints (experimental) (since 1.8)</li>\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/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?\
8+
</font>\n</h3>\n<h2>Features:</h2>\n<ul>\n<li>Global configuration and project specific configuration</li>\n<li>Supports profiles (since 1.6)</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 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</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...)\
9+
</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?\
910
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. \
1011
Eclipse users may miss the application of save-actions like "adding @Override annotations" or "member sort order". \
1112
Such AST-based transformations are not provided by this plugin. \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE codetemplates PUBLIC "-//NetBeans//DTD Editor Code Templates settings 1.0//EN" "http://www.netbeans.org/dtds/EditorCodeTemplates-1_0.dtd">
3+
<codetemplates>
4+
<codetemplate abbreviation="formatonoff" xml:space="preserve">
5+
<code><![CDATA[// @formatter:off
6+
${selection}
7+
// @formatter:on]]></code>
8+
<description><![CDATA[@formatter:off (for Eclipse Java Code Formatter)]]></description>
9+
</codetemplate>
10+
<codetemplate abbreviation="formatteron" xml:space="preserve" contexts="BLOCK,CASE,LABELED_STATEMENT,DO_WHILE_LOOP,ENHANCED_FOR_LOOP,FOR_LOOP,IF,WHILE_LOOP,LAMBDA_EXPRESSION">
11+
<code><![CDATA[// @formatter:on]]></code>
12+
<description><![CDATA[@formatter:on (for Eclipse Java Code Formatter)]]></description>
13+
</codetemplate>
14+
<codetemplate abbreviation="formatteroff" xml:space="preserve" contexts="BLOCK,CASE,LABELED_STATEMENT,DO_WHILE_LOOP,ENHANCED_FOR_LOOP,FOR_LOOP,IF,WHILE_LOOP,LAMBDA_EXPRESSION">
15+
<code><![CDATA[// @formatter:off]]></code>
16+
<description><![CDATA[@formatter:off (for Eclipse Java Code Formatter)]]></description>
17+
</codetemplate>
18+
</codetemplates>

src/de/markiewb/netbeans/plugins/eclipse/formatter/layer.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,15 @@
7272
</folder>
7373
</folder>
7474
</folder>
75+
76+
<folder name="Editors">
77+
<folder name="text">
78+
<folder name="x-java">
79+
<folder name="CodeTemplates">
80+
<file name="eclipse-formatter-templates.xml" url="eclipse-formatter-templates.xml"/>
81+
</folder>
82+
</folder>
83+
</folder>
84+
</folder>
85+
7586
</filesystem>

0 commit comments

Comments
 (0)