├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── org.eclipselabs.dte-feature
├── .project
├── build.properties
├── feature.xml
└── pom.xml
├── org.eclipselabs.dte-repository
├── .project
├── category.xml
└── pom.xml
├── org.eclipselabs.dte.tests
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.jdt.core.prefs
│ ├── org.eclipse.jdt.ui.prefs
│ └── org.eclipse.pde.core.prefs
├── META-INF
│ └── MANIFEST.MF
├── build.properties
├── pom.xml
├── resources
│ ├── empty
│ ├── sample.7z
│ ├── sample.csv
│ ├── sample.png
│ ├── sample.xls
│ └── sample.xml
└── src
│ └── org
│ └── eclipselabs
│ └── dte
│ └── tests
│ ├── KnownFileTypesExtensionsTest.java
│ └── TextFileDetectorTest.java
├── org.eclipselabs.dte
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.jdt.core.prefs
│ ├── org.eclipse.jdt.ui.prefs
│ └── org.eclipse.pde.core.prefs
├── META-INF
│ └── MANIFEST.MF
├── build.properties
├── plugin.xml
├── pom.xml
└── src
│ └── org
│ └── eclipselabs
│ └── dte
│ ├── Activator.java
│ ├── EditorAssociationOverride.java
│ ├── KnownBinaryFileExtensions.java
│ ├── KnownTextBasedFileExtensions.java
│ ├── TextFileDetector.java
│ └── preferences
│ ├── PreferenceConstants.java
│ ├── PreferenceInitializer.java
│ └── PreferencePage.java
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | target/
3 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | jdk: oraclejdk7
4 |
5 | env: DISPLAY=:99.0
6 |
7 | install: true
8 |
9 | before_script:
10 | - sh -e /etc/init.d/xvfb start
11 | - sleep 10 # give xvfb some time to start
12 |
13 | script:
14 | - export
15 | - mvn clean verify
16 |
17 | after_success:
18 | # Upload the repository to the snapshot update site on Bintray
19 | # 1. Delete the snapshot version
20 | - curl -X DELETE -ukaloyan-raev:$BINTRAY_KEY https://api.bintray.com/packages/kaloyan-raev/default-text-editor/update-site/versions/snapshot
21 | # 2. Upload the repository.zip to a new version with name "snapshot", unzip it and publish it
22 | - curl -T org.eclipselabs.dte-repository/target/repository.zip -ukaloyan-raev:$BINTRAY_KEY "https://api.bintray.com/content/kaloyan-raev/default-text-editor/update-site/snapshot/snapshot/repository.zip?publish=1&explode=1"
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Eclipse Public License - v 1.0
2 |
3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
4 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
5 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6 |
7 | 1. DEFINITIONS
8 |
9 | "Contribution" means:
10 |
11 | a) in the case of the initial Contributor, the initial code and documentation
12 | distributed under this Agreement, and
13 | b) in the case of each subsequent Contributor:
14 | i) changes to the Program, and
15 | ii) additions to the Program;
16 |
17 | where such changes and/or additions to the Program originate from and are
18 | distributed by that particular Contributor. A Contribution 'originates'
19 | from a Contributor if it was added to the Program by such Contributor
20 | itself or anyone acting on such Contributor's behalf. Contributions do not
21 | include additions to the Program which: (i) are separate modules of
22 | software distributed in conjunction with the Program under their own
23 | license agreement, and (ii) are not derivative works of the Program.
24 |
25 | "Contributor" means any person or entity that distributes the Program.
26 |
27 | "Licensed Patents" mean patent claims licensable by a Contributor which are
28 | necessarily infringed by the use or sale of its Contribution alone or when
29 | combined with the Program.
30 |
31 | "Program" means the Contributions distributed in accordance with this
32 | Agreement.
33 |
34 | "Recipient" means anyone who receives the Program under this Agreement,
35 | including all Contributors.
36 |
37 | 2. GRANT OF RIGHTS
38 | a) Subject to the terms of this Agreement, each Contributor hereby grants
39 | Recipient a non-exclusive, worldwide, royalty-free copyright license to
40 | reproduce, prepare derivative works of, publicly display, publicly
41 | perform, distribute and sublicense the Contribution of such Contributor,
42 | if any, and such derivative works, in source code and object code form.
43 | b) Subject to the terms of this Agreement, each Contributor hereby grants
44 | Recipient a non-exclusive, worldwide, royalty-free patent license under
45 | Licensed Patents to make, use, sell, offer to sell, import and otherwise
46 | transfer the Contribution of such Contributor, if any, in source code and
47 | object code form. This patent license shall apply to the combination of
48 | the Contribution and the Program if, at the time the Contribution is
49 | added by the Contributor, such addition of the Contribution causes such
50 | combination to be covered by the Licensed Patents. The patent license
51 | shall not apply to any other combinations which include the Contribution.
52 | No hardware per se is licensed hereunder.
53 | c) Recipient understands that although each Contributor grants the licenses
54 | to its Contributions set forth herein, no assurances are provided by any
55 | Contributor that the Program does not infringe the patent or other
56 | intellectual property rights of any other entity. Each Contributor
57 | disclaims any liability to Recipient for claims brought by any other
58 | entity based on infringement of intellectual property rights or
59 | otherwise. As a condition to exercising the rights and licenses granted
60 | hereunder, each Recipient hereby assumes sole responsibility to secure
61 | any other intellectual property rights needed, if any. For example, if a
62 | third party patent license is required to allow Recipient to distribute
63 | the Program, it is Recipient's responsibility to acquire that license
64 | before distributing the Program.
65 | d) Each Contributor represents that to its knowledge it has sufficient
66 | copyright rights in its Contribution, if any, to grant the copyright
67 | license set forth in this Agreement.
68 |
69 | 3. REQUIREMENTS
70 |
71 | A Contributor may choose to distribute the Program in object code form under
72 | its own license agreement, provided that:
73 |
74 | a) it complies with the terms and conditions of this Agreement; and
75 | b) its license agreement:
76 | i) effectively disclaims on behalf of all Contributors all warranties
77 | and conditions, express and implied, including warranties or
78 | conditions of title and non-infringement, and implied warranties or
79 | conditions of merchantability and fitness for a particular purpose;
80 | ii) effectively excludes on behalf of all Contributors all liability for
81 | damages, including direct, indirect, special, incidental and
82 | consequential damages, such as lost profits;
83 | iii) states that any provisions which differ from this Agreement are
84 | offered by that Contributor alone and not by any other party; and
85 | iv) states that source code for the Program is available from such
86 | Contributor, and informs licensees how to obtain it in a reasonable
87 | manner on or through a medium customarily used for software exchange.
88 |
89 | When the Program is made available in source code form:
90 |
91 | a) it must be made available under this Agreement; and
92 | b) a copy of this Agreement must be included with each copy of the Program.
93 | Contributors may not remove or alter any copyright notices contained
94 | within the Program.
95 |
96 | Each Contributor must identify itself as the originator of its Contribution,
97 | if
98 | any, in a manner that reasonably allows subsequent Recipients to identify the
99 | originator of the Contribution.
100 |
101 | 4. COMMERCIAL DISTRIBUTION
102 |
103 | Commercial distributors of software may accept certain responsibilities with
104 | respect to end users, business partners and the like. While this license is
105 | intended to facilitate the commercial use of the Program, the Contributor who
106 | includes the Program in a commercial product offering should do so in a manner
107 | which does not create potential liability for other Contributors. Therefore,
108 | if a Contributor includes the Program in a commercial product offering, such
109 | Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
110 | every other Contributor ("Indemnified Contributor") against any losses,
111 | damages and costs (collectively "Losses") arising from claims, lawsuits and
112 | other legal actions brought by a third party against the Indemnified
113 | Contributor to the extent caused by the acts or omissions of such Commercial
114 | Contributor in connection with its distribution of the Program in a commercial
115 | product offering. The obligations in this section do not apply to any claims
116 | or Losses relating to any actual or alleged intellectual property
117 | infringement. In order to qualify, an Indemnified Contributor must:
118 | a) promptly notify the Commercial Contributor in writing of such claim, and
119 | b) allow the Commercial Contributor to control, and cooperate with the
120 | Commercial Contributor in, the defense and any related settlement
121 | negotiations. The Indemnified Contributor may participate in any such claim at
122 | its own expense.
123 |
124 | For example, a Contributor might include the Program in a commercial product
125 | offering, Product X. That Contributor is then a Commercial Contributor. If
126 | that Commercial Contributor then makes performance claims, or offers
127 | warranties related to Product X, those performance claims and warranties are
128 | such Commercial Contributor's responsibility alone. Under this section, the
129 | Commercial Contributor would have to defend claims against the other
130 | Contributors related to those performance claims and warranties, and if a
131 | court requires any other Contributor to pay any damages as a result, the
132 | Commercial Contributor must pay those damages.
133 |
134 | 5. NO WARRANTY
135 |
136 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
137 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
138 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
140 | Recipient is solely responsible for determining the appropriateness of using
141 | and distributing the Program and assumes all risks associated with its
142 | exercise of rights under this Agreement , including but not limited to the
143 | risks and costs of program errors, compliance with applicable laws, damage to
144 | or loss of data, programs or equipment, and unavailability or interruption of
145 | operations.
146 |
147 | 6. DISCLAIMER OF LIABILITY
148 |
149 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
150 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
151 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
152 | LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
153 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
154 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
155 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
156 | OF SUCH DAMAGES.
157 |
158 | 7. GENERAL
159 |
160 | If any provision of this Agreement is invalid or unenforceable under
161 | applicable law, it shall not affect the validity or enforceability of the
162 | remainder of the terms of this Agreement, and without further action by the
163 | parties hereto, such provision shall be reformed to the minimum extent
164 | necessary to make such provision valid and enforceable.
165 |
166 | If Recipient institutes patent litigation against any entity (including a
167 | cross-claim or counterclaim in a lawsuit) alleging that the Program itself
168 | (excluding combinations of the Program with other software or hardware)
169 | infringes such Recipient's patent(s), then such Recipient's rights granted
170 | under Section 2(b) shall terminate as of the date such litigation is filed.
171 |
172 | All Recipient's rights under this Agreement shall terminate if it fails to
173 | comply with any of the material terms or conditions of this Agreement and does
174 | not cure such failure in a reasonable period of time after becoming aware of
175 | such noncompliance. If all Recipient's rights under this Agreement terminate,
176 | Recipient agrees to cease use and distribution of the Program as soon as
177 | reasonably practicable. However, Recipient's obligations under this Agreement
178 | and any licenses granted by Recipient relating to the Program shall continue
179 | and survive.
180 |
181 | Everyone is permitted to copy and distribute copies of this Agreement, but in
182 | order to avoid inconsistency the Agreement is copyrighted and may only be
183 | modified in the following manner. The Agreement Steward reserves the right to
184 | publish new versions (including revisions) of this Agreement from time to
185 | time. No one other than the Agreement Steward has the right to modify this
186 | Agreement. The Eclipse Foundation is the initial Agreement Steward. The
187 | Eclipse Foundation may assign the responsibility to serve as the Agreement
188 | Steward to a suitable separate entity. Each new version of the Agreement will
189 | be given a distinguishing version number. The Program (including
190 | Contributions) may always be distributed subject to the version of the
191 | Agreement under which it was received. In addition, after a new version of the
192 | Agreement is published, Contributor may elect to distribute the Program
193 | (including its Contributions) under the new version. Except as expressly
194 | stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
195 | licenses to the intellectual property of any Contributor under this Agreement,
196 | whether expressly, by implication, estoppel or otherwise. All rights in the
197 | Program not expressly granted under this Agreement are reserved.
198 |
199 | This Agreement is governed by the laws of the State of New York and the
200 | intellectual property laws of the United States of America. No party to this
201 | Agreement will bring a legal action under this Agreement more than one year
202 | after the cause of action arose. Each party waives its rights to a jury trial in
203 | any resulting litigation.
204 |
205 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Default Text Editor plug-in for Eclipse
2 | =======================================
3 |
4 | [](https://travis-ci.org/eclipselabs/default-text-editor)
5 |
6 | _**NOTE.** The functionality of the Default Text Editor plugin has been implemented in the Eclipse Platform with the Neon release. Check the [release notes](https://www.eclipse.org/eclipse/news/4.6/platform.php#text-editor-selection-strategy) for details._
7 |
8 | Makes the internal text editor in Eclipse to be the default editor for unknown files.
9 |
10 | If there is no editor associated with the file being opened then Eclipse consults the operating system if there is an external editor available for this file. If positive then the file is opened in the system editor outside of Eclipse. This may not be the desired behavior for some users who want to keep opening all text files in Eclipse even if it is done just in the plain text editor.
11 |
12 | This plugin overrides the default open file behavior of Eclipse and will avoid opening text files in external editors.
13 |
14 | Requirements
15 | ------------
16 |
17 | * Eclipse Juno (4.2, 3.8) or newer
18 |
19 | Installation
20 | ------------
21 |
22 | #### Eclipse Marketplace
23 |
24 | Drag this button to your Eclipse workbench to install:
25 |
26 | [](http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=2299057)
27 |
28 | #### Update site
29 |
30 | Or install this plugin by using ```Help > Install New Software...``` and add the update site:
31 |
https://dl.bintray.com/kaloyan-raev/default-text-editor/
32 |
33 | License
34 | -------
35 |
36 | This is open source software under the Eclipse Public License. See the [LICENSE](LICENSE) file for details.
37 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-feature/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.eclipselabs.dte-feature
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.pde.FeatureBuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.pde.FeatureNature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-feature/build.properties:
--------------------------------------------------------------------------------
1 | bin.includes = feature.xml
2 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-feature/feature.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | Makes the internal text editor of Eclipse to be the default editor for unknown files.
10 |
11 |
12 |
13 | Copyright (c) 2015 Kaloyan Raev.
14 | All rights reserved. This program and the accompanying materials
15 | are made available under the terms of the Eclipse Public License v1.0
16 | which accompanies this distribution, and is available at
17 | http://www.eclipse.org/legal/epl-v10.html
18 |
19 |
20 |
21 | Eclipse Public License, Version 1.0 (EPL-1.0)
22 |
23 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
24 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
25 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
26 |
27 | 1. DEFINITIONS
28 |
29 | "Contribution" means:
30 |
31 | a) in the case of the initial Contributor, the initial code and
32 | documentation distributed under this Agreement, and
33 |
34 | b) in the case of each subsequent Contributor:
35 | i) changes to the Program, and
36 | ii) additions to the Program;
37 |
38 | where such changes and/or additions to the Program originate from and are
39 | distributed by that particular Contributor. A Contribution 'originates'
40 | from a Contributor if it was added to the Program by such Contributor itself
41 | or anyone acting on such Contributor's behalf. Contributions do not include
42 | additions to the Program which: (i) are separate modules of software
43 | distributed in conjunction with the Program under their own license agreement,
44 | and (ii) are not derivative works of the Program.
45 |
46 | "Contributor" means any person or entity that distributes the Program.
47 |
48 | "Licensed Patents " mean patent claims licensable by a Contributor which are
49 | necessarily infringed by the use or sale of its Contribution alone or
50 | when combined with the Program.
51 |
52 | "Program" means the Contributions distributed in accordance with
53 | this Agreement.
54 |
55 | "Recipient" means anyone who receives the Program under this Agreement,
56 | including all Contributors.
57 |
58 | 2. GRANT OF RIGHTS
59 |
60 | a) Subject to the terms of this Agreement, each Contributor hereby grants
61 | Recipient a non-exclusive, worldwide, royalty-free copyright license to
62 | reproduce, prepare derivative works of, publicly display, publicly
63 | perform, distribute and sublicense the Contribution of such
64 | Contributor, if any, and such derivative works,
65 | in source code and object code form.
66 |
67 | b) Subject to the terms of this Agreement, each Contributor hereby grants
68 | Recipient a non-exclusive, worldwide, royalty-free patent license under
69 | Licensed Patents to make, use, sell, offer to sell, import and
70 | otherwise transfer the Contribution of such Contributor, if any,
71 | in source code and object code form. This patent license shall apply
72 | to the combination of the Contribution and the Program if, at the time
73 | the Contribution is added by the Contributor, such addition of the
74 | Contribution causes such combination to be covered by the
75 | Licensed Patents. The patent license shall not apply to any other
76 | combinations which include the Contribution.
77 | No hardware per se is licensed hereunder.
78 |
79 | c) Recipient understands that although each Contributor grants the
80 | licenses to its Contributions set forth herein, no assurances are
81 | provided by any Contributor that the Program does not infringe the
82 | patent or other intellectual property rights of any other entity.
83 | Each Contributor disclaims any liability to Recipient for claims
84 | brought by any other entity based on infringement of intellectual
85 | property rights or otherwise. As a condition to exercising the
86 | rights and licenses granted hereunder, each Recipient hereby assumes
87 | sole responsibility to secure any other intellectual property rights
88 | needed, if any. For example, if a third party patent license is
89 | required to allow Recipient to distribute the Program, it is
90 | Recipient's responsibility to acquire that license
91 | before distributing the Program.
92 |
93 | d) Each Contributor represents that to its knowledge it has sufficient
94 | copyright rights in its Contribution, if any, to grant the copyright
95 | license set forth in this Agreement.
96 |
97 | 3. REQUIREMENTS
98 |
99 | A Contributor may choose to distribute the Program in object code form under
100 | its own license agreement, provided that:
101 |
102 | a) it complies with the terms and conditions of this Agreement; and
103 |
104 | b) its license agreement:
105 |
106 | i) effectively disclaims on behalf of all Contributors all warranties
107 | and conditions, express and implied, including warranties or
108 | conditions of title and non-infringement, and implied warranties or
109 | conditions of merchantability and fitness for a particular purpose;
110 |
111 | ii) effectively excludes on behalf of all Contributors all liability
112 | for damages, including direct, indirect, special, incidental and
113 | consequential damages, such as lost profits;
114 |
115 | iii) states that any provisions which differ from this Agreement are
116 | offered by that Contributor alone and not by any other party; and
117 |
118 | iv) states that source code for the Program is available from such
119 | Contributor, and informs licensees how to obtain it in a reasonable
120 | manner on or through a medium customarily used for software exchange.
121 |
122 | When the Program is made available in source code form:
123 |
124 | a) it must be made available under this Agreement; and
125 | b) a copy of this Agreement must be included with each copy of the Program.
126 |
127 | Contributors may not remove or alter any copyright notices contained
128 | within the Program.
129 |
130 | Each Contributor must identify itself as the originator of its Contribution,
131 | if any, in a manner that reasonably allows subsequent Recipients to
132 | identify the originator of the Contribution.
133 |
134 | 4. COMMERCIAL DISTRIBUTION
135 |
136 | Commercial distributors of software may accept certain responsibilities with
137 | respect to end users, business partners and the like. While this license is
138 | intended to facilitate the commercial use of the Program, the Contributor who
139 | includes the Program in a commercial product offering should do so in a manner
140 | which does not create potential liability for other Contributors. Therefore,
141 | if a Contributor includes the Program in a commercial product offering,
142 | such Contributor ("Commercial Contributor") hereby agrees to defend and
143 | indemnify every other Contributor ("Indemnified Contributor") against any
144 | losses, damages and costs (collectively "Losses") arising from claims,
145 | lawsuits and other legal actions brought by a third party against the
146 | Indemnified Contributor to the extent caused by the acts or omissions of
147 | such Commercial Contributor in connection with its distribution of the Program
148 | in a commercial product offering. The obligations in this section do not apply
149 | to any claims or Losses relating to any actual or alleged intellectual
150 | property infringement. In order to qualify, an Indemnified Contributor must:
151 | a) promptly notify the Commercial Contributor in writing of such claim,
152 | and b) allow the Commercial Contributor to control, and cooperate with the
153 | Commercial Contributor in, the defense and any related settlement
154 | negotiations. The Indemnified Contributor may participate in any such
155 | claim at its own expense.
156 |
157 | For example, a Contributor might include the Program in a commercial product
158 | offering, Product X. That Contributor is then a Commercial Contributor.
159 | If that Commercial Contributor then makes performance claims, or offers
160 | warranties related to Product X, those performance claims and warranties
161 | are such Commercial Contributor's responsibility alone. Under this section,
162 | the Commercial Contributor would have to defend claims against the other
163 | Contributors related to those performance claims and warranties, and if a
164 | court requires any other Contributor to pay any damages as a result,
165 | the Commercial Contributor must pay those damages.
166 |
167 | 5. NO WARRANTY
168 |
169 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
170 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
171 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
172 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
173 | Each Recipient is solely responsible for determining the appropriateness of
174 | using and distributing the Program and assumes all risks associated with its
175 | exercise of rights under this Agreement , including but not limited to the
176 | risks and costs of program errors, compliance with applicable laws, damage to
177 | or loss of data, programs or equipment, and unavailability
178 | or interruption of operations.
179 |
180 | 6. DISCLAIMER OF LIABILITY
181 |
182 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
183 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
184 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
185 | LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
186 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
187 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
188 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
189 | POSSIBILITY OF SUCH DAMAGES.
190 |
191 | 7. GENERAL
192 |
193 | If any provision of this Agreement is invalid or unenforceable under
194 | applicable law, it shall not affect the validity or enforceability of the
195 | remainder of the terms of this Agreement, and without further action by
196 | the parties hereto, such provision shall be reformed to the minimum extent
197 | necessary to make such provision valid and enforceable.
198 |
199 | If Recipient institutes patent litigation against any entity (including a
200 | cross-claim or counterclaim in a lawsuit) alleging that the Program itself
201 | (excluding combinations of the Program with other software or hardware)
202 | infringes such Recipient's patent(s), then such Recipient's rights granted
203 | under Section 2(b) shall terminate as of the date such litigation is filed.
204 |
205 | All Recipient's rights under this Agreement shall terminate if it fails to
206 | comply with any of the material terms or conditions of this Agreement and
207 | does not cure such failure in a reasonable period of time after becoming
208 | aware of such noncompliance. If all Recipient's rights under this
209 | Agreement terminate, Recipient agrees to cease use and distribution of the
210 | Program as soon as reasonably practicable. However, Recipient's obligations
211 | under this Agreement and any licenses granted by Recipient relating to the
212 | Program shall continue and survive.
213 |
214 | Everyone is permitted to copy and distribute copies of this Agreement,
215 | but in order to avoid inconsistency the Agreement is copyrighted and may
216 | only be modified in the following manner. The Agreement Steward reserves
217 | the right to publish new versions (including revisions) of this Agreement
218 | from time to time. No one other than the Agreement Steward has the right to
219 | modify this Agreement. The Eclipse Foundation is the initial
220 | Agreement Steward. The Eclipse Foundation may assign the responsibility to
221 | serve as the Agreement Steward to a suitable separate entity. Each new version
222 | of the Agreement will be given a distinguishing version number. The Program
223 | (including Contributions) may always be distributed subject to the version
224 | of the Agreement under which it was received. In addition, after a new version
225 | of the Agreement is published, Contributor may elect to distribute the Program
226 | (including its Contributions) under the new version. Except as expressly
227 | stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
228 | licenses to the intellectual property of any Contributor under this Agreement,
229 | whether expressly, by implication, estoppel or otherwise. All rights in the
230 | Program not expressly granted under this Agreement are reserved.
231 |
232 | This Agreement is governed by the laws of the State of New York and the
233 | intellectual property laws of the United States of America. No party to
234 | this Agreement will bring a legal action under this Agreement more than one
235 | year after the cause of action arose. Each party waives its rights to a
236 | jury trial in any resulting litigation.
237 |
238 |
239 |
244 |
245 |
246 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-feature/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | 4.0.0
5 |
6 | org.eclipselabs.dte
7 | parent
8 | 1.2.0-SNAPSHOT
9 |
10 | org.eclipselabs.dte.feature
11 | eclipse-feature
12 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-repository/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.eclipselabs.dte-repository
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-repository/category.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Makes the internal text editor of Eclipse to be the default editor for unknown files.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte-repository/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | 4.0.0
5 |
6 | org.eclipselabs.dte
7 | parent
8 | 1.2.0-SNAPSHOT
9 |
10 | repository
11 | eclipse-repository
12 |
13 |
14 | repository
15 |
16 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.eclipselabs.dte.tests
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.pde.ManifestBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.pde.SchemaBuilder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.pde.PluginNature
26 | org.eclipse.jdt.core.javanature
27 |
28 |
29 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.7
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.source=1.7
13 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/.settings/org.eclipse.jdt.ui.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
3 | sp_cleanup.add_default_serial_version_id=false
4 | sp_cleanup.add_generated_serial_version_id=false
5 | sp_cleanup.add_missing_annotations=true
6 | sp_cleanup.add_missing_deprecated_annotations=true
7 | sp_cleanup.add_missing_methods=false
8 | sp_cleanup.add_missing_nls_tags=false
9 | sp_cleanup.add_missing_override_annotations=true
10 | sp_cleanup.add_missing_override_annotations_interface_methods=true
11 | sp_cleanup.add_serial_version_id=false
12 | sp_cleanup.always_use_blocks=false
13 | sp_cleanup.always_use_parentheses_in_expressions=false
14 | sp_cleanup.always_use_this_for_non_static_field_access=false
15 | sp_cleanup.always_use_this_for_non_static_method_access=false
16 | sp_cleanup.convert_functional_interfaces=false
17 | sp_cleanup.convert_to_enhanced_for_loop=true
18 | sp_cleanup.correct_indentation=false
19 | sp_cleanup.format_source_code=true
20 | sp_cleanup.format_source_code_changes_only=true
21 | sp_cleanup.insert_inferred_type_arguments=false
22 | sp_cleanup.make_local_variable_final=false
23 | sp_cleanup.make_parameters_final=false
24 | sp_cleanup.make_private_fields_final=false
25 | sp_cleanup.make_type_abstract_if_missing_method=false
26 | sp_cleanup.make_variable_declarations_final=false
27 | sp_cleanup.never_use_blocks=false
28 | sp_cleanup.never_use_parentheses_in_expressions=false
29 | sp_cleanup.on_save_use_additional_actions=true
30 | sp_cleanup.organize_imports=true
31 | sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
32 | sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
33 | sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
34 | sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
35 | sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
36 | sp_cleanup.remove_private_constructors=false
37 | sp_cleanup.remove_redundant_type_arguments=false
38 | sp_cleanup.remove_trailing_whitespaces=true
39 | sp_cleanup.remove_trailing_whitespaces_all=false
40 | sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
41 | sp_cleanup.remove_unnecessary_casts=true
42 | sp_cleanup.remove_unnecessary_nls_tags=false
43 | sp_cleanup.remove_unused_imports=true
44 | sp_cleanup.remove_unused_local_variables=false
45 | sp_cleanup.remove_unused_private_fields=false
46 | sp_cleanup.remove_unused_private_members=false
47 | sp_cleanup.remove_unused_private_methods=false
48 | sp_cleanup.remove_unused_private_types=false
49 | sp_cleanup.sort_members=false
50 | sp_cleanup.sort_members_all=false
51 | sp_cleanup.use_anonymous_class_creation=false
52 | sp_cleanup.use_blocks=true
53 | sp_cleanup.use_blocks_only_for_return_and_throw=false
54 | sp_cleanup.use_lambda=false
55 | sp_cleanup.use_parentheses_in_expressions=false
56 | sp_cleanup.use_this_for_non_static_field_access=false
57 | sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
58 | sp_cleanup.use_this_for_non_static_method_access=false
59 | sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
60 | sp_cleanup.use_type_arguments=false
61 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/.settings/org.eclipse.pde.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | pluginProject.extensions=false
3 | resolve.requirebundle=false
4 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: Default Text Editor Tests
4 | Bundle-SymbolicName: org.eclipselabs.dte.tests
5 | Bundle-Version: 1.2.0.qualifier
6 | Bundle-Vendor: Kaloyan Raev
7 | Fragment-Host: org.eclipselabs.dte
8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7
9 | Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
10 | org.easymock;bundle-version="2.4.0"
11 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/
2 | output.. = bin/
3 | bin.includes = META-INF/,\
4 | .
5 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | org.eclipselabs.dte
6 | parent
7 | 1.2.0-SNAPSHOT
8 |
9 | org.eclipselabs.dte.tests
10 | eclipse-test-plugin
11 |
12 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/resources/empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipselabs/default-text-editor/3bf328a5b2143fb0ab9e7af43a2fac5ea19f6ff5/org.eclipselabs.dte.tests/resources/empty
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/resources/sample.7z:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipselabs/default-text-editor/3bf328a5b2143fb0ab9e7af43a2fac5ea19f6ff5/org.eclipselabs.dte.tests/resources/sample.7z
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/resources/sample.csv:
--------------------------------------------------------------------------------
1 | FirstName,LastName,Title,ReportsTo.Email,Birthdate,Description
2 | Tom,Jones,Senior Director,buyer@salesforcesample.com,1940-06-07Z,"Self-described as ""the top"" branding guru on the West Coast"
3 | Ian,Dury,Chief Imagineer,cto@salesforcesample.com,,"World-renowned expert in fuzzy logic design.
4 | Influential in technology purchases."
5 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/resources/sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipselabs/default-text-editor/3bf328a5b2143fb0ab9e7af43a2fac5ea19f6ff5/org.eclipselabs.dte.tests/resources/sample.png
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/resources/sample.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipselabs/default-text-editor/3bf328a5b2143fb0ab9e7af43a2fac5ea19f6ff5/org.eclipselabs.dte.tests/resources/sample.xls
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/resources/sample.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Xytrex Co.
5 | Industrial Cleaning Supply Company
6 | ABC15797531
7 |
8 |
9 | Watson and Powell, Inc.
10 | Law firm. New York Headquarters
11 | ABC24689753
12 |
13 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/src/org/eclipselabs/dte/tests/KnownFileTypesExtensionsTest.java:
--------------------------------------------------------------------------------
1 | package org.eclipselabs.dte.tests;
2 |
3 | import static org.junit.Assert.assertEquals;
4 | import static org.junit.Assert.assertTrue;
5 |
6 | import java.util.Arrays;
7 | import java.util.HashSet;
8 | import java.util.Set;
9 |
10 | import org.eclipselabs.dte.KnownBinaryFileExtensions;
11 | import org.eclipselabs.dte.KnownTextBasedFileExtensions;
12 | import org.junit.Test;
13 |
14 | public class KnownFileTypesExtensionsTest {
15 |
16 | @Test
17 | public void testNoDuplications() {
18 | Set intersection = new HashSet(
19 | KnownTextBasedFileExtensions.set());
20 | intersection.retainAll(KnownBinaryFileExtensions.set());
21 |
22 | String message = "Duplicated file extensions: "
23 | + Arrays.toString(intersection.toArray());
24 |
25 | assertTrue(message, intersection.isEmpty());
26 | }
27 |
28 | @Test
29 | public void testRemoveLeadingUnderscoreFromName() {
30 | assertEquals("7Z", KnownBinaryFileExtensions._7Z.toString());
31 | }
32 |
33 | @Test
34 | public void testUniqueInstanceForKnownBinaryFileExtensions() {
35 | Set s1 = KnownBinaryFileExtensions.set();
36 | Set s2 = KnownBinaryFileExtensions.set();
37 | assertEquals(System.identityHashCode(s1), System.identityHashCode(s2));
38 | }
39 |
40 | @Test
41 | public void testUniqueInstanceForKnownTextBasedFileExtensions() {
42 | Set s1 = KnownTextBasedFileExtensions.set();
43 | Set s2 = KnownTextBasedFileExtensions.set();
44 | assertEquals(System.identityHashCode(s1), System.identityHashCode(s2));
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte.tests/src/org/eclipselabs/dte/tests/TextFileDetectorTest.java:
--------------------------------------------------------------------------------
1 | package org.eclipselabs.dte.tests;
2 |
3 | import static org.easymock.EasyMock.createMock;
4 | import static org.easymock.EasyMock.createNiceMock;
5 | import static org.easymock.EasyMock.expect;
6 | import static org.easymock.EasyMock.replay;
7 | import static org.junit.Assert.assertEquals;
8 |
9 | import java.io.BufferedInputStream;
10 | import java.io.File;
11 | import java.io.FileInputStream;
12 | import java.io.IOException;
13 | import java.io.InputStream;
14 |
15 | import org.eclipse.ui.IURIEditorInput;
16 | import org.eclipselabs.dte.TextFileDetector;
17 | import org.junit.Test;
18 |
19 | public class TextFileDetectorTest {
20 |
21 | @Test
22 | public void testNullSafety() throws IOException {
23 | assertEquals(false, TextFileDetector.isTextFile((IURIEditorInput) null));
24 | assertEquals(false, TextFileDetector.isTextFile((String) null));
25 | assertEquals(false, TextFileDetector.isTextFile((InputStream) null));
26 | }
27 |
28 | @Test
29 | public void testEditorInputNullName() {
30 | IURIEditorInput mockedInput = createMock(IURIEditorInput.class);
31 | expect(mockedInput.getName()).andReturn(null);
32 | replay(mockedInput);
33 |
34 | assertEquals(false, TextFileDetector.isTextFile(mockedInput));
35 | }
36 |
37 | @Test
38 | public void testEditorInputNullURI() {
39 | IURIEditorInput mockedInput = createMock(IURIEditorInput.class);
40 | expect(mockedInput.getName()).andReturn("");
41 | expect(mockedInput.getURI()).andReturn(null);
42 | replay(mockedInput);
43 |
44 | assertEquals(false, TextFileDetector.isTextFile(mockedInput));
45 | }
46 |
47 | @Test
48 | public void testNonExistingFile() throws IOException {
49 | assertEquals(false, TextFileDetector.isTextFile("nonexisting"));
50 | }
51 |
52 | @Test
53 | public void testDetectTextFileByEditorInput() {
54 | _testDetectTextFileByEditorInput("resources/empty", true);
55 | _testDetectTextFileByEditorInput("resources/sample.7z", false);
56 | _testDetectTextFileByEditorInput("resources/sample.csv", true);
57 | _testDetectTextFileByEditorInput("resources/sample.png", false);
58 | _testDetectTextFileByEditorInput("resources/sample.xls", false);
59 | _testDetectTextFileByEditorInput("resources/sample.xml", true);
60 | }
61 |
62 | private void _testDetectTextFileByEditorInput(String fileName,
63 | boolean expected) {
64 | IURIEditorInput mockedInput = createNiceMock(IURIEditorInput.class);
65 | expect(mockedInput.getName()).andReturn(fileName);
66 | expect(mockedInput.getURI()).andReturn(new File(fileName).toURI());
67 | replay(mockedInput);
68 |
69 | assertEquals(expected, TextFileDetector.isTextFile(mockedInput));
70 | }
71 |
72 | @Test
73 | public void testDetectTextFileByFileName() {
74 | _testDetectTextFileByFileName("resources/empty", true);
75 | _testDetectTextFileByFileName("resources/sample.7z", false);
76 | _testDetectTextFileByFileName("resources/sample.csv", true);
77 | _testDetectTextFileByFileName("resources/sample.png", false);
78 | _testDetectTextFileByFileName("resources/sample.xls", false);
79 | _testDetectTextFileByFileName("resources/sample.xml", true);
80 | }
81 |
82 | private void _testDetectTextFileByFileName(String fileName, boolean expected) {
83 | boolean result = TextFileDetector.isTextFile(fileName);
84 | assertEquals(fileName, expected, result);
85 | }
86 |
87 | @Test
88 | public void testDetectTextFileByInputStream() throws IOException {
89 | _testDetectTextFileByInputStream("resources/empty", true);
90 | _testDetectTextFileByInputStream("resources/sample.7z", false);
91 | _testDetectTextFileByInputStream("resources/sample.csv", true);
92 | _testDetectTextFileByInputStream("resources/sample.png", false);
93 | _testDetectTextFileByInputStream("resources/sample.xls", false);
94 | _testDetectTextFileByInputStream("resources/sample.xml", true);
95 | }
96 |
97 | private void _testDetectTextFileByInputStream(String fileName,
98 | boolean expected) throws IOException {
99 | boolean result = false;
100 | BufferedInputStream is = null;
101 | try {
102 | is = new BufferedInputStream(new FileInputStream(fileName));
103 | result = TextFileDetector.isTextFile(fileName);
104 | } finally {
105 | // Make sure the input streams are closed
106 | is.close();
107 | }
108 |
109 | assertEquals(fileName, expected, result);
110 | }
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.eclipselabs.dte
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.pde.ManifestBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.pde.SchemaBuilder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.pde.PluginNature
26 | org.eclipse.jdt.core.javanature
27 |
28 |
29 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.6
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.source=1.6
13 | org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
14 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
15 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
16 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
17 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
18 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
19 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
20 | org.eclipse.jdt.core.formatter.alignment_for_assignment=0
21 | org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
22 | org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
23 | org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
24 | org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
25 | org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
26 | org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
27 | org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
28 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
29 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
30 | org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
31 | org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
32 | org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
33 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
34 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
35 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
36 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
37 | org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
38 | org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
39 | org.eclipse.jdt.core.formatter.blank_lines_after_package=1
40 | org.eclipse.jdt.core.formatter.blank_lines_before_field=0
41 | org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
42 | org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
43 | org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
44 | org.eclipse.jdt.core.formatter.blank_lines_before_method=1
45 | org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
46 | org.eclipse.jdt.core.formatter.blank_lines_before_package=0
47 | org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
48 | org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
49 | org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
50 | org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
51 | org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
52 | org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
53 | org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
54 | org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
55 | org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
56 | org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
57 | org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
58 | org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
59 | org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
60 | org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
61 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
62 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
63 | org.eclipse.jdt.core.formatter.comment.format_block_comments=true
64 | org.eclipse.jdt.core.formatter.comment.format_header=false
65 | org.eclipse.jdt.core.formatter.comment.format_html=true
66 | org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
67 | org.eclipse.jdt.core.formatter.comment.format_line_comments=true
68 | org.eclipse.jdt.core.formatter.comment.format_source_code=true
69 | org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
70 | org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
71 | org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
72 | org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
73 | org.eclipse.jdt.core.formatter.comment.line_length=80
74 | org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
75 | org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
76 | org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
77 | org.eclipse.jdt.core.formatter.compact_else_if=true
78 | org.eclipse.jdt.core.formatter.continuation_indentation=2
79 | org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
80 | org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
81 | org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
82 | org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
83 | org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
84 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
85 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
86 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
87 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
88 | org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
89 | org.eclipse.jdt.core.formatter.indent_empty_lines=false
90 | org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
91 | org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
92 | org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
93 | org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
94 | org.eclipse.jdt.core.formatter.indentation.size=4
95 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
96 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
97 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
98 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
99 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
100 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
101 | org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
102 | org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
103 | org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
104 | org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
105 | org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
106 | org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
107 | org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
108 | org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
109 | org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
110 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
111 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
112 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
113 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
114 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
115 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
116 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
117 | org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
118 | org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
119 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
120 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
121 | org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
122 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
123 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
124 | org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
125 | org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
126 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
127 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
128 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
129 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
130 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
131 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
132 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
133 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
134 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
135 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
136 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
137 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
138 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
139 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
140 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
141 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
142 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
143 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
144 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
145 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
146 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
147 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
148 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
149 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
150 | org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
151 | org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
152 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
153 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
154 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
155 | org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
156 | org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
157 | org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
158 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
159 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
160 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
161 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
162 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
163 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
164 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
165 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
166 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
167 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
168 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
169 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
170 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
171 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
172 | org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
173 | org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
174 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
175 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
176 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
177 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
178 | org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
179 | org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
180 | org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
181 | org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
182 | org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
183 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
184 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
185 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
186 | org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
187 | org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
188 | org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
189 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
190 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
191 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
192 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
193 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
194 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
195 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
196 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
197 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
198 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
199 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
200 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
201 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
202 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
203 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
204 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
205 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
206 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
207 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
208 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
209 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
210 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
211 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
212 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
213 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
214 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
215 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
216 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
217 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
218 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
219 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
220 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
221 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
222 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
223 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
224 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
225 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
226 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
227 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
228 | org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
229 | org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
230 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
231 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
232 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
233 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
234 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
235 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
236 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
237 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
238 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
239 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
240 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
241 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
242 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
243 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
244 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
245 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
246 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
247 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
248 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
249 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
250 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
251 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
252 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
253 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
254 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
255 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
256 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
257 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
258 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
259 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
260 | org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
261 | org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
262 | org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
263 | org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
264 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
265 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
266 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
267 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
268 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
269 | org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
270 | org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
271 | org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
272 | org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
273 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
274 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
275 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
276 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
277 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
278 | org.eclipse.jdt.core.formatter.join_lines_in_comments=true
279 | org.eclipse.jdt.core.formatter.join_wrapped_lines=true
280 | org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
281 | org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
282 | org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
283 | org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
284 | org.eclipse.jdt.core.formatter.lineSplit=80
285 | org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
286 | org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
287 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
288 | org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
289 | org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
290 | org.eclipse.jdt.core.formatter.tabulation.char=space
291 | org.eclipse.jdt.core.formatter.tabulation.size=4
292 | org.eclipse.jdt.core.formatter.use_on_off_tags=false
293 | org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
294 | org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
295 | org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
296 | org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
297 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/.settings/org.eclipse.jdt.ui.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
3 | formatter_profile=_Spaces
4 | formatter_settings_version=12
5 | sp_cleanup.add_default_serial_version_id=false
6 | sp_cleanup.add_generated_serial_version_id=false
7 | sp_cleanup.add_missing_annotations=true
8 | sp_cleanup.add_missing_deprecated_annotations=true
9 | sp_cleanup.add_missing_methods=false
10 | sp_cleanup.add_missing_nls_tags=false
11 | sp_cleanup.add_missing_override_annotations=true
12 | sp_cleanup.add_missing_override_annotations_interface_methods=true
13 | sp_cleanup.add_serial_version_id=false
14 | sp_cleanup.always_use_blocks=false
15 | sp_cleanup.always_use_parentheses_in_expressions=false
16 | sp_cleanup.always_use_this_for_non_static_field_access=false
17 | sp_cleanup.always_use_this_for_non_static_method_access=false
18 | sp_cleanup.convert_functional_interfaces=false
19 | sp_cleanup.convert_to_enhanced_for_loop=true
20 | sp_cleanup.correct_indentation=false
21 | sp_cleanup.format_source_code=true
22 | sp_cleanup.format_source_code_changes_only=true
23 | sp_cleanup.insert_inferred_type_arguments=false
24 | sp_cleanup.make_local_variable_final=false
25 | sp_cleanup.make_parameters_final=false
26 | sp_cleanup.make_private_fields_final=false
27 | sp_cleanup.make_type_abstract_if_missing_method=false
28 | sp_cleanup.make_variable_declarations_final=false
29 | sp_cleanup.never_use_blocks=false
30 | sp_cleanup.never_use_parentheses_in_expressions=false
31 | sp_cleanup.on_save_use_additional_actions=true
32 | sp_cleanup.organize_imports=true
33 | sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
34 | sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
35 | sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
36 | sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
37 | sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
38 | sp_cleanup.remove_private_constructors=false
39 | sp_cleanup.remove_redundant_type_arguments=false
40 | sp_cleanup.remove_trailing_whitespaces=true
41 | sp_cleanup.remove_trailing_whitespaces_all=false
42 | sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
43 | sp_cleanup.remove_unnecessary_casts=true
44 | sp_cleanup.remove_unnecessary_nls_tags=false
45 | sp_cleanup.remove_unused_imports=true
46 | sp_cleanup.remove_unused_local_variables=false
47 | sp_cleanup.remove_unused_private_fields=false
48 | sp_cleanup.remove_unused_private_members=false
49 | sp_cleanup.remove_unused_private_methods=false
50 | sp_cleanup.remove_unused_private_types=false
51 | sp_cleanup.sort_members=false
52 | sp_cleanup.sort_members_all=false
53 | sp_cleanup.use_anonymous_class_creation=false
54 | sp_cleanup.use_blocks=true
55 | sp_cleanup.use_blocks_only_for_return_and_throw=false
56 | sp_cleanup.use_lambda=false
57 | sp_cleanup.use_parentheses_in_expressions=false
58 | sp_cleanup.use_this_for_non_static_field_access=false
59 | sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
60 | sp_cleanup.use_this_for_non_static_method_access=false
61 | sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
62 | sp_cleanup.use_type_arguments=false
63 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/.settings/org.eclipse.pde.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | pluginProject.extensions=true
3 | resolve.requirebundle=false
4 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: Default Text Editor
4 | Bundle-SymbolicName: org.eclipselabs.dte;singleton:=true
5 | Bundle-Version: 1.2.0.qualifier
6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6
7 | Require-Bundle: org.eclipse.core.runtime,
8 | org.eclipse.ui,
9 | org.eclipse.ui.ide;bundle-version="3.8.0",
10 | org.eclipse.ui.editors;bundle-version="3.0.0",
11 | com.ibm.icu;bundle-version="3.4.0",
12 | org.apache.commons.io;bundle-version="1.1.0"
13 | Bundle-Vendor: Kaloyan Raev
14 | Bundle-Activator: org.eclipselabs.dte.Activator
15 | Bundle-ActivationPolicy: lazy
16 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/
2 | output.. = bin/
3 | bin.includes = META-INF/,\
4 | .,\
5 | plugin.xml
6 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
9 |
10 |
11 |
13 |
18 |
19 |
20 |
22 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | 4.0.0
5 |
6 | org.eclipselabs.dte
7 | parent
8 | 1.2.0-SNAPSHOT
9 |
10 | org.eclipselabs.dte
11 | eclipse-plugin
12 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/Activator.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte;
12 |
13 | import org.eclipse.ui.plugin.AbstractUIPlugin;
14 | import org.osgi.framework.BundleContext;
15 |
16 | public class Activator extends AbstractUIPlugin {
17 |
18 | // The shared instance.
19 | private static Activator plugin;
20 |
21 | /**
22 | * The constructor.
23 | */
24 | public Activator() {
25 | plugin = this;
26 | }
27 |
28 | /**
29 | * This method is called upon plug-in activation
30 | */
31 | @Override
32 | public void start(BundleContext context) throws Exception {
33 | super.start(context);
34 | }
35 |
36 | /**
37 | * This method is called when the plug-in is stopped
38 | */
39 | @Override
40 | public void stop(BundleContext context) throws Exception {
41 | super.stop(context);
42 | plugin = null;
43 | }
44 |
45 | /**
46 | * Returns the shared instance.
47 | */
48 | public static Activator getDefault() {
49 | return plugin;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/EditorAssociationOverride.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte;
12 |
13 | import static org.eclipse.ui.editors.text.EditorsUI.DEFAULT_TEXT_EDITOR_ID;
14 |
15 | import org.eclipse.core.runtime.content.IContentType;
16 | import org.eclipse.ui.IEditorDescriptor;
17 | import org.eclipse.ui.IEditorInput;
18 | import org.eclipse.ui.IURIEditorInput;
19 | import org.eclipse.ui.PlatformUI;
20 | import org.eclipse.ui.ide.IEditorAssociationOverride;
21 | import org.eclipselabs.dte.preferences.PreferenceConstants;
22 |
23 | /**
24 | * Overrides the default editor of text files, which have no editor association,
25 | * with the default text editor. This way it is avoided to open text files with
26 | * the system editor outside of the IDE.
27 | */
28 | public class EditorAssociationOverride implements IEditorAssociationOverride {
29 |
30 | @Override
31 | public IEditorDescriptor[] overrideEditors(IEditorInput editorInput,
32 | IContentType contentType, IEditorDescriptor[] editorDescriptors) {
33 | return editorDescriptors;
34 | }
35 |
36 | @Override
37 | public IEditorDescriptor[] overrideEditors(String fileName,
38 | IContentType contentType, IEditorDescriptor[] editorDescriptors) {
39 | return editorDescriptors;
40 | }
41 |
42 | @Override
43 | public IEditorDescriptor overrideDefaultEditor(IEditorInput editorInput,
44 | IContentType contentType, IEditorDescriptor editorDescriptor) {
45 | // Override with default text editor only if no association is found yet
46 | if (editorDescriptor == null && editorInput != null
47 | && editorInput instanceof IURIEditorInput
48 | && isOverrideEnabled()
49 | && TextFileDetector.isTextFile((IURIEditorInput) editorInput)) {
50 | return getTextEditorDescriptor();
51 | }
52 | return editorDescriptor;
53 | }
54 |
55 | @Override
56 | public IEditorDescriptor overrideDefaultEditor(String fileName,
57 | IContentType contentType, IEditorDescriptor editorDescriptor) {
58 | // Override with default text editor only if no association is found yet
59 | if (editorDescriptor == null && fileName != null && isOverrideEnabled()
60 | && TextFileDetector.isTextFile(fileName)) {
61 | return getTextEditorDescriptor();
62 | }
63 | return editorDescriptor;
64 | }
65 |
66 | private IEditorDescriptor getTextEditorDescriptor() {
67 | return PlatformUI.getWorkbench().getEditorRegistry()
68 | .findEditor(DEFAULT_TEXT_EDITOR_ID);
69 | }
70 |
71 | private boolean isOverrideEnabled() {
72 | return Activator.getDefault().getPreferenceStore()
73 | .getBoolean(PreferenceConstants.ENABLED);
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/KnownBinaryFileExtensions.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte;
12 |
13 | import java.util.Collections;
14 | import java.util.HashSet;
15 | import java.util.Set;
16 |
17 | /**
18 | * Enumeration of all known file extensions of binary files.
19 | */
20 | public enum KnownBinaryFileExtensions {
21 |
22 | /** Rhino 3D Model */
23 | _3DM,
24 | /** 3D Studio Scene */
25 | _3DS,
26 | /** 3GPP2 Multimedia File */
27 | _3G2,
28 | /** 3GPP Multimedia File */
29 | _3GP,
30 | /** 7-Zip Compressed File */
31 | _7Z,
32 | /** Access 2007 Database File */
33 | ACCDB,
34 | /** WinAce Compressed File */
35 | ACE,
36 | /** Adobe Illustrator File */
37 | AI,
38 | /** Audio Interchange File Format */
39 | AIF,
40 | /** Audio Interchange File Format */
41 | AIFF,
42 | /** Adaptive Multi-Rate Codec File */
43 | AMR,
44 | /** Android Package File */
45 | APK,
46 | /** Mac OS X Application */
47 | APP,
48 | /** Advanced Systems Format File */
49 | ASF,
50 | /** Audio Video Interleave File */
51 | AVI,
52 | /** Binary Disc Image */
53 | BIN,
54 | /** Bitmap Image File */
55 | BMP,
56 | /** Windows Cabinet File */
57 | CAB,
58 | /** Comic Book RAR Archive */
59 | CBR,
60 | /** CD Audio Track Shortcut */
61 | CDA,
62 | /** CorelDRAW Image File */
63 | CDR,
64 | /** Compiled HTML Help File */
65 | CHM,
66 | /** Java Class File */
67 | CLASS,
68 | /** DOS Command File */
69 | COM,
70 | /** Windows Control Panel Item */
71 | CPL,
72 | /** Chrome Extension */
73 | CRX,
74 | /** Cue Sheet File */
75 | CUE,
76 | /** Windows Cursor */
77 | CUR,
78 | /** Database File */
79 | DB,
80 | /** Database File */
81 | DBF,
82 | /** DirectDraw Surface */
83 | DDS,
84 | /** Debian Software Package */
85 | DEB,
86 | /** DivX-Encoded Movie File */
87 | DIVX,
88 | /** Dynamic Link Library */
89 | DLL,
90 | /** Mac OS X Disk Image */
91 | DMG,
92 | /** Windows Memory Dump */
93 | DMP,
94 | /** Microsoft Word Document */
95 | DOC,
96 | /** Microsoft Word Open XML Document */
97 | DOCX,
98 | /** Device Driver */
99 | DRV,
100 | /** Digital Speech Standard File */
101 | DSS,
102 | /** Sony Digital Voice File */
103 | DVF,
104 | /** AutoCAD Drawing Database File */
105 | DWG,
106 | /** Encapsulated PostScript File */
107 | EPS,
108 | /** Windows Executable File */
109 | EXE,
110 | /** Adobe Flash Animation */
111 | FLA,
112 | /** Flash Video File */
113 | FLV,
114 | /** Windows Font File */
115 | FNT,
116 | /** Generic Font File */
117 | FON,
118 | /** Windows Gadget */
119 | GADGET,
120 | /** Saved Game File */
121 | GAM,
122 | /** Graphical Interchange Format File */
123 | GIF,
124 | /** Gnu Zipped Archive */
125 | GZ,
126 | /** BinHex 4.0 Encoded File */
127 | HQX,
128 | /** Mac OS X Icon Resource File */
129 | ICNS,
130 | /** Interchange File Format */
131 | IFF,
132 | /** DVD-Video Disc Information File */
133 | IFO,
134 | /** Adobe InDesign Document */
135 | INDD,
136 | /** Disc Image File */
137 | ISO,
138 | /** Java Archive File */
139 | JAR,
140 | /** JPEG Image */
141 | JPEG,
142 | /** JPEG Image */
143 | JPG,
144 | /** Keynote Presentation */
145 | KEY,
146 | /** Mac OS X Keychain File */
147 | KEYCHAIN,
148 | /** Google Earth Placemark File */
149 | KMZ,
150 | /** Windows File Shortcut */
151 | LNK,
152 | /** MPEG-4 Audio File */
153 | M4A,
154 | /** MPEG-4 Audio Book File */
155 | M4B,
156 | /** iTunes Music Store Audio File */
157 | M4P,
158 | /** iTunes Video File */
159 | M4V,
160 | /** 3ds Max Scene File */
161 | MAX,
162 | /** Microsoft Access Database */
163 | MDB,
164 | /** Media Disc Image File */
165 | MDF,
166 | /** MIDI File */
167 | MID,
168 | /** Apple QuickTime Movie */
169 | MOV,
170 | /** MPEG Layer II Compressed Audio File */
171 | MP2,
172 | /** MP3 Audio File */
173 | MP3,
174 | /** MPEG-4 Video File */
175 | MP4,
176 | /** MPEG-2 Audio File */
177 | MPA,
178 | /** MPEG Movie */
179 | MPEG,
180 | /** MPEG Video File */
181 | MPG,
182 | /** Outlook Mail Message */
183 | MSG,
184 | /** Windows Installer Package */
185 | MSI,
186 | /** Nintendo (NES) ROM File */
187 | NES,
188 | /** Wavefront 3D Object File */
189 | OBJ,
190 | /** OpenDocument Text Document */
191 | ODT,
192 | /** Ogg Vorbis Audio File */
193 | OGG,
194 | /** OpenType Font */
195 | OTF,
196 | /** Pages Document */
197 | PAGES,
198 | /** Picture File */
199 | PCT,
200 | /** Program Database */
201 | PDB,
202 | /** Portable Document Format File */
203 | PDF,
204 | /** Mac OS X Installer Package */
205 | PKG,
206 | /** Portable Network Graphic */
207 | PNG,
208 | /** PowerPoint Slide Show */
209 | PPS,
210 | /** PowerPoint Presentation */
211 | PPT,
212 | /** PowerPoint Open XML Presentation */
213 | PPTX,
214 | /** Outlook Profile File */
215 | PRF,
216 | /** PostScript File */
217 | PS,
218 | /** Adobe Photoshop Document */
219 | PSD,
220 | /** PaintShop Pro Image */
221 | PSPIMAGE,
222 | /** Outlook Personal Information Store File */
223 | PST,
224 | /** Microsoft Publisher Document */
225 | PUB,
226 | /** QuickBooks Backup File */
227 | QBB,
228 | /** QuickBooks Data File */
229 | QBW,
230 | /** QuarkXPress Document */
231 | QXD,
232 | /** Real Audio File */
233 | RA,
234 | /** Real Audio Metadata File */
235 | RAM,
236 | /** WinRAR Compressed Archive */
237 | RAR,
238 | /** Real Media File */
239 | RM,
240 | /** RealMedia Variable Bit Rate File */
241 | RMVB,
242 | /** N64 Game ROM File */
243 | ROM,
244 | /** Red Hat Package Manager File */
245 | RPM,
246 | /** Rich Text Format File */
247 | RTF,
248 | /** Saved Game */
249 | SAV,
250 | /** Self-Extracting Archive */
251 | SEA,
252 | /** StuffIt Archive */
253 | SIT,
254 | /** StuffIt X Archive */
255 | SITX,
256 | /** Shockwave Flash Movie */
257 | SWF,
258 | /** Windows System File */
259 | SYS,
260 | /** Consolidated Unix File Archive */
261 | TAR,
262 | /** Targa Graphic */
263 | TGA,
264 | /** Gzipped Tar File */
265 | TGZ,
266 | /** Thumbnail Image File */
267 | THM,
268 | /** Tagged Image File */
269 | TIF,
270 | /** Tagged Image File Format */
271 | TIFF,
272 | /** Toast Disc Image */
273 | TOAST,
274 | /** BitTorrent File */
275 | TORRENT,
276 | /** TrueType Font */
277 | TTF,
278 | /** Virtual CD */
279 | VCD,
280 | /** DVD Video Object File */
281 | VOB,
282 | /** WAVE Audio File */
283 | WAV,
284 | /** Windows Media Audio File */
285 | WMA,
286 | /** Windows Media Video File */
287 | WMV,
288 | /** WordPerfect Document */
289 | WPD,
290 | /** Microsoft Works Word Processor Document */
291 | WPS,
292 | /** Works Spreadsheet */
293 | XLR,
294 | /** Excel Spreadsheet */
295 | XLS,
296 | /** Microsoft Excel Open XML Spreadsheet */
297 | XLSX,
298 | /** YUV Encoded Image File */
299 | YUV,
300 | /** Zipped File */
301 | ZIP,
302 | /** Extended Zip File */
303 | ZIPX;
304 |
305 | private static Set cached = null;
306 |
307 | /**
308 | * Returns the enumeration as a set.
309 | *
310 | * @return an unmodifiable set.
311 | */
312 | public static Set set() {
313 | if (cached == null) {
314 | Set set = new HashSet();
315 |
316 | for (KnownBinaryFileExtensions v : values()) {
317 | set.add(v.toString());
318 | }
319 |
320 | cached = Collections.unmodifiableSet(set);
321 | }
322 |
323 | return cached;
324 | }
325 |
326 | @Override
327 | public String toString() {
328 | String name = name();
329 | return name.startsWith("_") ? name.substring(1) : name;
330 | }
331 |
332 | }
333 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/KnownTextBasedFileExtensions.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte;
12 |
13 | import java.util.Collections;
14 | import java.util.HashSet;
15 | import java.util.Set;
16 |
17 | /**
18 | * Enumeration of all known file extensions of text-based files.
19 | */
20 | public enum KnownTextBasedFileExtensions {
21 |
22 | /** Active Server Page */
23 | ASP,
24 | /** Active Server Page Extended File */
25 | ASPX,
26 | /** Microsoft ASF Redirector File */
27 | ASX,
28 | /** DOS Batch File */
29 | BAT,
30 | /** C/C++ Source Code File */
31 | C,
32 | /** Internet Security Certificate */
33 | CER,
34 | /** Configuration File */
35 | CFG,
36 | /** ColdFusion Markup File */
37 | CFM,
38 | /** Common Gateway Interface Script */
39 | CGI,
40 | /** C++ Source Code File */
41 | CPP,
42 | /** Visual C# Source Code File */
43 | CS,
44 | /** Cascading Style Sheet */
45 | CSS,
46 | /** Certificate Signing Request File */
47 | CSR,
48 | /** Comma Separated Values File */
49 | CSV,
50 | /** Document Type Definition File */
51 | DTD,
52 | /** Drawing Exchange Format File */
53 | DXF,
54 | /** E-Mail Message */
55 | EML,
56 | /** GEDCOM Genealogy Data File */
57 | GED,
58 | /** GPS Exchange File */
59 | GPX,
60 | /** C/C++/Objective-C Header File */
61 | H,
62 | /** C++ Header File */
63 | HPP,
64 | /** Hypertext Markup Language File */
65 | HTM,
66 | /** Hypertext Markup Language File */
67 | HTML,
68 | /** Calendar File */
69 | ICS,
70 | /** Windows Initialization File */
71 | INI,
72 | /** Java Source Code File */
73 | JAVA,
74 | /** JavaScript File */
75 | JS,
76 | /** Java Server Page */
77 | JSP,
78 | /** Keyhole Markup Language File */
79 | KML,
80 | /** Log File */
81 | LOG,
82 | /** Lua Source File */
83 | LUA,
84 | /** Objective-C Implementation File */
85 | M,
86 | /** Markdown Documentation File */
87 | MARKDOWN,
88 | /** Markdown Documentation File */
89 | MD,
90 | /** Markdown Documentation File */
91 | MDOWN,
92 | /** Media Playlist File */
93 | M3U,
94 | /** PHP Source Code File */
95 | PHP,
96 | /** Perl Script */
97 | PL,
98 | /** Python Script */
99 | PY,
100 | /** Rich Site Summary */
101 | RSS,
102 | /** Standard Data File */
103 | SDF,
104 | /** Bash Shell Script */
105 | SH,
106 | /** Visual Studio Solution File */
107 | SLN,
108 | /** Structured Query Language Data File */
109 | SQL,
110 | /** SubRip Subtitle File */
111 | SRT,
112 | /** Subtitle File */
113 | SUB,
114 | /** Scalable Vector Graphics File */
115 | SVG,
116 | /** Swift Source Code File */
117 | SWIFT,
118 | /** LaTeX Source Document */
119 | TEX,
120 | /** Plain Text File */
121 | TXT,
122 | /** Visual Basic Project File */
123 | VBP,
124 | /** Visual Studio Visual Basic Project */
125 | VBPROJ,
126 | /** vCard File */
127 | VCF,
128 | /** Visual C++ Project */
129 | VCXPROJ,
130 | /** Windows Script File */
131 | WSF,
132 | /** Xcode Project */
133 | XCODEPROJ,
134 | /** Extensible Hypertext Markup Language File */
135 | XHTML,
136 | /** XML File */
137 | XML,
138 | /** YAML Document */
139 | YML;
140 |
141 | private static Set cached = null;
142 |
143 | /**
144 | * Returns the enumeration as a set.
145 | *
146 | * @return an unmodifiable set.
147 | */
148 | public static Set set() {
149 | if (cached == null) {
150 | Set set = new HashSet();
151 |
152 | for (KnownTextBasedFileExtensions v : values()) {
153 | set.add(v.toString());
154 | }
155 |
156 | cached = Collections.unmodifiableSet(set);
157 | }
158 |
159 | return cached;
160 | }
161 |
162 | @Override
163 | public String toString() {
164 | String name = name();
165 | return name.startsWith("_") ? name.substring(1) : name;
166 | }
167 |
168 | }
169 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/TextFileDetector.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte;
12 |
13 | import java.io.BufferedInputStream;
14 | import java.io.FileInputStream;
15 | import java.io.IOException;
16 | import java.io.InputStream;
17 | import java.net.URI;
18 |
19 | import org.apache.commons.io.FilenameUtils;
20 | import org.eclipse.ui.IURIEditorInput;
21 |
22 | import com.ibm.icu.text.CharsetDetector;
23 | import com.ibm.icu.text.CharsetMatch;
24 |
25 | /**
26 | * Utility class for detecting if file is text or binary.
27 | */
28 | public class TextFileDetector {
29 |
30 | /**
31 | * Checks if a file is text or binary.
32 | *
33 | *
34 | * This method will first check if the file extension is known to be for a
35 | * binary or a text-based file. If the file extension is unknown then it
36 | * will try to analyze the file content.
37 | *
38 | *
39 | * @param input
40 | * an editor input of the file
41 | * @return true
if the file is more likely to be text file than
42 | * binary file, false
otherwise.
43 | */
44 | public static boolean isTextFile(IURIEditorInput input) {
45 | if (input == null)
46 | return false;
47 |
48 | String fileName = input.getName();
49 | if (fileName == null)
50 | return false;
51 |
52 | String extension = FilenameUtils.getExtension(fileName).toUpperCase();
53 |
54 | if (KnownTextBasedFileExtensions.set().contains(extension))
55 | return true;
56 |
57 | if (KnownBinaryFileExtensions.set().contains(extension))
58 | return false;
59 |
60 | URI uri = input.getURI();
61 | if (uri != null) {
62 | InputStream is = null;
63 | try {
64 | is = uri.toURL().openStream();
65 | return TextFileDetector.isTextFile(is);
66 | } catch (IOException e) {
67 | // Problem reading the editor input - avoid overriding
68 | } finally {
69 | // Make sure the input stream is closed
70 | close(is);
71 | }
72 | }
73 |
74 | return false;
75 | }
76 |
77 | /**
78 | * Checks if a file is text or binary.
79 | *
80 | *
81 | * This method will first check if the file extension is known to be for a
82 | * binary or a text-based file. If the file extension is unknown then it
83 | * will try to analyze the file content.
84 | *
85 | *
86 | * @param fileName
87 | * a file name
88 | * @return true
if the file is more likely to be text file than
89 | * binary file, false
otherwise.
90 | */
91 | public static boolean isTextFile(String fileName) {
92 | if (fileName == null)
93 | return false;
94 |
95 | String extension = FilenameUtils.getExtension(fileName).toUpperCase();
96 |
97 | if (KnownTextBasedFileExtensions.set().contains(extension))
98 | return true;
99 |
100 | if (KnownBinaryFileExtensions.set().contains(extension))
101 | return false;
102 |
103 | BufferedInputStream is = null;
104 | try {
105 | is = new BufferedInputStream(new FileInputStream(fileName));
106 | return isTextFile(is);
107 | } catch (IOException e) {
108 | // Problem reading the editor input - avoid overriding
109 | } finally {
110 | // Make sure the input streams are closed
111 | close(is);
112 | }
113 |
114 | return false;
115 | }
116 |
117 | /**
118 | * Checks if a file is text or binary.
119 | *
120 | *
121 | * The provided input stream will not be closed and the position in the
122 | * stream will be unchanged after leaving this method.
123 | *
124 | *
125 | * @param is
126 | * input stream of the file
127 | * @return true
if the file is more likely to be text file than
128 | * binary file, false
otherwise.
129 | * @throws IOException
130 | * in case of error while reading from the stream
131 | */
132 | public static boolean isTextFile(InputStream is) throws IOException {
133 | if (is == null)
134 | return false;
135 |
136 | CharsetDetector detector = new CharsetDetector();
137 | detector.setText(is);
138 | CharsetMatch match = detector.detect();
139 |
140 | // The file is text if a charset with confidence of at least 10 (out
141 | // of 100) is detected. Empty files have confidence 10 for UTF-8.
142 | return match != null && match.getConfidence() >= 10;
143 | }
144 |
145 | /**
146 | * Closes the input stream.
147 | *
148 | * @param is
149 | * an input stream.
150 | */
151 | private static void close(InputStream is) {
152 | if (is != null) {
153 | try {
154 | is.close();
155 | } catch (IOException e) {
156 | // Error closing the file input stream - ignore it
157 | }
158 | }
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/preferences/PreferenceConstants.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte.preferences;
12 |
13 | /**
14 | * Constant definitions for plug-in preferences
15 | */
16 | public class PreferenceConstants {
17 |
18 | /**
19 | * Preference constant for overriding the editor association.
20 | */
21 | public static final String ENABLED = "enabled";
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/preferences/PreferenceInitializer.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte.preferences;
12 |
13 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
14 | import org.eclipse.jface.preference.IPreferenceStore;
15 | import org.eclipselabs.dte.Activator;
16 |
17 | /**
18 | * Class used to initialize default preference values.
19 | */
20 | public class PreferenceInitializer extends AbstractPreferenceInitializer {
21 |
22 | /*
23 | * (non-Javadoc)
24 | *
25 | * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
26 | * initializeDefaultPreferences()
27 | */
28 | @Override
29 | public void initializeDefaultPreferences() {
30 | IPreferenceStore store = Activator.getDefault().getPreferenceStore();
31 | store.setDefault(PreferenceConstants.ENABLED, true);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/org.eclipselabs.dte/src/org/eclipselabs/dte/preferences/PreferencePage.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Kaloyan Raev.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Kaloyan Raev - initial API and implementation
10 | *******************************************************************************/
11 | package org.eclipselabs.dte.preferences;
12 |
13 | import org.eclipse.jface.preference.BooleanFieldEditor;
14 | import org.eclipse.jface.preference.FieldEditorPreferencePage;
15 | import org.eclipse.ui.IWorkbench;
16 | import org.eclipse.ui.IWorkbenchPreferencePage;
17 | import org.eclipselabs.dte.Activator;
18 |
19 | /**
20 | * This class represents a preference page that is contributed to the
21 | * Preferences dialog. By subclassing FieldEditorPreferencePage, we
22 | * can use the field support built into JFace that allows us to create a page
23 | * that is small and knows how to save, restore and apply itself.
24 | *
25 | * This page is used to modify preferences only. They are stored in the
26 | * preference store that belongs to the main plug-in class. That way,
27 | * preferences can be accessed directly via the preference store.
28 | */
29 |
30 | public class PreferencePage extends FieldEditorPreferencePage
31 | implements IWorkbenchPreferencePage {
32 |
33 | public PreferencePage() {
34 | super(GRID);
35 | setPreferenceStore(Activator.getDefault().getPreferenceStore());
36 | setDescription(
37 | "Files without associated editor may be opened in an external system editor. Selecting the below checkbox overrides this behavior and all text files of unknown type will be opened in the internal text editor.");
38 | }
39 |
40 | /**
41 | * Creates the field editors. Field editors are abstractions of the common
42 | * GUI blocks needed to manipulate various types of preferences. Each field
43 | * editor knows how to save and restore itself.
44 | */
45 | @Override
46 | public void createFieldEditors() {
47 | addField(new BooleanFieldEditor(PreferenceConstants.ENABLED,
48 | "&Use the internal text editor for unknown file types",
49 | getFieldEditorParent()));
50 | }
51 |
52 | /*
53 | * (non-Javadoc)
54 | *
55 | * @see
56 | * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
57 | */
58 | @Override
59 | public void init(IWorkbench workbench) {
60 | }
61 |
62 | }
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 | 4.0.0
6 | org.eclipselabs.dte
7 | parent
8 | 1.2.0-SNAPSHOT
9 | pom
10 |
11 |
12 | 0.22.0
13 |
14 |
15 |
16 |
17 | luna
18 | p2
19 | http://download.eclipse.org/releases/luna/
20 |
21 |
22 |
23 |
24 |
25 |
26 | org.eclipse.tycho
27 | tycho-maven-plugin
28 | ${tycho-version}
29 | true
30 |
31 |
32 |
33 |
34 |
35 | org.eclipselabs.dte
36 | org.eclipselabs.dte.tests
37 | org.eclipselabs.dte-feature
38 | org.eclipselabs.dte-repository
39 |
40 |
41 |
--------------------------------------------------------------------------------