14 Commits

Author SHA1 Message Date
Piotr Wolny
6edac575c4 Update README.md 2014-11-18 20:22:35 +01:00
Piotr Wolny
c87e904e11 Name fixes. 2014-11-17 22:49:34 +01:00
Piotr Wolny
b9c4e9725a LICENSE moved to separate file. 2014-11-17 22:31:07 +01:00
Piotr Wolny
4e82e32ab6 Package name fixed. 2014-11-16 01:39:23 +01:00
Piotr Wolny
1f00095290 Update README.md 2014-11-14 20:38:58 +01:00
Piotr Wolny
a43a19f743 Create README.md 2014-11-14 20:35:00 +01:00
Piotr Wolny
c48b7c8c05 Reorganizing repository to add feature and update site. 2014-11-14 20:08:39 +01:00
Piotr Wolny
3d7aa9ee7c New version. 2014-05-20 11:20:34 +02:00
Piotr Wolny
a19a30490d Do not touch escape sequences other than unicode escepe sequeneces ('\uXXXX'). 2014-05-20 11:19:44 +02:00
Piotr Wolny
73bad66829 New version. 2014-05-20 10:58:35 +02:00
Piotr Wolny
2137715576 Do not escape question mark ('?'). 2014-05-20 10:57:56 +02:00
Piotr Wolny
a2bc4e5749 New version. 2014-04-24 11:05:20 +02:00
Piotr Wolny
0ee301e5a7 Encode using capital letters. 2014-04-24 11:05:20 +02:00
Piotr Wolny
d2348f8761 Ignore binaries. 2014-04-24 11:05:20 +02:00
28 changed files with 257 additions and 296 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.metadata/
bin/
RemoteSystemsTempFiles/

22
LICENSE Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2010-2014 Piotr Wolny
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

19
README.md Normal file
View File

@@ -0,0 +1,19 @@
Simple Properties Editor
========================
Eclipse plug-in for editing Java properties files, automatically converts non-ASCII characters to unicode escape sequences.
Installation
------------
<a href="http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=25025" title="Drag and drop into a running Eclipse workspace to install Simple Properties Editor">
<img src="http://marketplace.eclipse.org/sites/all/modules/custom/marketplace/images/installbutton.png"/>
</a>
Drag and drop above button into a running Eclipse workspace or click "Help -> Install new software" and paste update site URL:<br>
http://gildur.github.io/SimplePropertiesEditor/updates/
License
-------
<a href="https://raw.githubusercontent.com/gildur/SimplePropertiesEditor/master/LICENSE">MIT</a>

17
feature/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

1
feature/build.properties Normal file
View File

@@ -0,0 +1 @@
bin.includes = feature.xml

50
feature/feature.xml Normal file
View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="pl.gildur.simplepropertieseditor.feature"
label="Simple Properties Editor"
version="1.0.5"
provider-name="Piotr Wolny">
<description url="https://github.com/gildur/SimplePropertiesEditor">
Eclipse plug-in for editing Java properties files, automatically converts non-ASCII characters to unicode escape sequences.
</description>
<copyright>
Copyright (c) 2010-2014 Piotr Wolny
</copyright>
<license url="">
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the &quot;Software&quot;), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
</license>
<url>
<update label="Simple Properties Editor" url="http://gildur.github.io/SimplePropertiesEditor/updates"/>
</url>
<plugin
id="pl.gildur.simplepropertieseditor"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SimplePropertiesEditor
Bundle-SymbolicName: SimplePropertiesEditor; singleton:=true
Bundle-Version: 1.0.1
Bundle-Activator: org.gildur.simplepropertieseditor.Activator
Bundle-Name: Simple Properties Editor
Bundle-SymbolicName: pl.gildur.simplepropertieseditor;singleton:=true
Bundle-Version: 1.0.5
Bundle-Activator: pl.gildur.simplepropertieseditor.Activator
Bundle-Vendor: Piotr Wolny
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface.text,

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
name="SimplePropertiesEditor"
extensions="properties"
icon="icons/icon.gif"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
class="org.gildur.simplepropertieseditor.editor.SimplePropertiesEditor"
id="org.gildur.simplepropertieseditor.editor.SimplePropertiesEditor">
</editor>
</extension>
</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
name="Simple Properties Editor"
extensions="properties"
icon="icons/icon.gif"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
class="pl.gildur.simplepropertieseditor.editor.SimplePropertiesEditor"
id="pl.gildur.simplepropertieseditor.editor.SimplePropertiesEditor">
</editor>
</extension>
</plugin>

View File

@@ -1,26 +1,4 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor;
package pl.gildur.simplepropertieseditor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;

View File

@@ -0,0 +1,28 @@
package pl.gildur.simplepropertieseditor.editor;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
public class ColorManager {
protected Map<RGB, Color> colorTable = new HashMap<RGB, Color>(10);
public void dispose() {
for (Color c : colorTable.values()) {
c.dispose();
}
}
public Color getColor(RGB rgb) {
Color color = colorTable.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
colorTable.put(rgb, color);
}
return color;
}
}

View File

@@ -0,0 +1,12 @@
package pl.gildur.simplepropertieseditor.editor;
import org.eclipse.swt.graphics.RGB;
public interface PropertiesColorConstants {
RGB DEFAULT = new RGB(0, 0, 0);
RGB COMMENT = new RGB(0, 255, 0);
RGB ENTRY = new RGB(0, 0, 255);
}

View File

@@ -1,26 +1,4 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
package pl.gildur.simplepropertieseditor.editor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextAttribute;

View File

@@ -1,26 +1,4 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
package pl.gildur.simplepropertieseditor.editor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -46,13 +24,10 @@ public class PropertiesDocumentProvider extends FileDocumentProvider {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < content.length(); i++) {
char c = content.charAt(i);
if (c == '\\') {
c = content.charAt(i + 1);
if (c == 'u') {
int code = Integer.parseInt(content.substring(i + 2, i + 6), 16);
buffer.append((char) code);
i += 5;
}
if (c == '\\' && i < content.length() - 1 && content.charAt(i + 1) == 'u') {
int code = Integer.parseInt(content.substring(i + 2, i + 6), 16);
buffer.append((char) code);
i += 5;
} else {
buffer.append(c);
}

View File

@@ -1,26 +1,4 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
package pl.gildur.simplepropertieseditor.editor;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
@@ -112,8 +90,8 @@ public class PropertiesDocumentWrapper implements IDocument {
ByteBuffer encodedUnknown = asciiCharset.encode("?");
for (int i = 0; i < content.length(); i++) {
char c = content.charAt(i);
if (asciiCharset.encode(String.valueOf(c)).equals(encodedUnknown)) {
buffer.append(String.format("\\u%04x", (int) c));
if (c != '?' && asciiCharset.encode(String.valueOf(c)).equals(encodedUnknown)) {
buffer.append(String.format("\\u%04X", (int) c));
} else {
buffer.append(c);
}

View File

@@ -0,0 +1,25 @@
package pl.gildur.simplepropertieseditor.editor;
import org.eclipse.jface.text.rules.*;
public class PropertiesPartitionScanner extends RuleBasedPartitionScanner {
public final static String PROPERTIES_COMMENT = "__properties_comment";
public final static String PROPERTIES_ENTRY = "__properties_entry";
public PropertiesPartitionScanner() {
IToken comment = new Token(PROPERTIES_COMMENT);
IToken entry = new Token(PROPERTIES_ENTRY);
IPredicateRule[] rules = new IPredicateRule[2];
SingleLineRule commentRule = new SingleLineRule("#", null, comment, (char) 0, true);
commentRule.setColumnConstraint(0);
rules[0] = commentRule;
rules[1] = new SingleLineRule("=", null, entry, (char) 0, true);
setPredicateRules(rules);
}
}

View File

@@ -0,0 +1,21 @@
package pl.gildur.simplepropertieseditor.editor;
import org.eclipse.ui.editors.text.TextEditor;
public class SimplePropertiesEditor extends TextEditor {
private ColorManager colorManager;
public SimplePropertiesEditor() {
super();
colorManager = new ColorManager();
setSourceViewerConfiguration(new PropertiesConfiguration(colorManager));
setDocumentProvider(new PropertiesDocumentProvider());
}
@Override
public void dispose() {
colorManager.dispose();
super.dispose();
}
}

4
site/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
artifacts.jar
content.jar
features/
plugins/

17
site/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>site</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.UpdateSiteBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.UpdateSiteNature</nature>
</natures>
</projectDescription>

7
site/site.xml Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<description name="Simple Properties Editor" url="http://gildur.github.io/SimplePropertiesEditor/updates">
Eclipse plug-in for editing Java properties files, automatically converts non-ASCII characters to unicode escape sequences.
</description>
<feature url="features/pl.gildur.simplepropertieseditor.feature_1.0.5.jar" id="pl.gildur.simplepropertieseditor.feature" version="1.0.5"/>
</site>

View File

@@ -1,50 +0,0 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
public class ColorManager {
protected Map<RGB, Color> colorTable = new HashMap<RGB, Color>(10);
public void dispose() {
for (Color c : colorTable.values()) {
c.dispose();
}
}
public Color getColor(RGB rgb) {
Color color = colorTable.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
colorTable.put(rgb, color);
}
return color;
}
}

View File

@@ -1,34 +0,0 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
import org.eclipse.swt.graphics.RGB;
public interface PropertiesColorConstants {
RGB DEFAULT = new RGB(0, 0, 0);
RGB COMMENT = new RGB(0, 255, 0);
RGB ENTRY = new RGB(0, 0, 255);
}

View File

@@ -1,47 +0,0 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
import org.eclipse.jface.text.rules.*;
public class PropertiesPartitionScanner extends RuleBasedPartitionScanner {
public final static String PROPERTIES_COMMENT = "__properties_comment";
public final static String PROPERTIES_ENTRY = "__properties_entry";
public PropertiesPartitionScanner() {
IToken comment = new Token(PROPERTIES_COMMENT);
IToken entry = new Token(PROPERTIES_ENTRY);
IPredicateRule[] rules = new IPredicateRule[2];
SingleLineRule commentRule = new SingleLineRule("#", null, comment, (char) 0, true);
commentRule.setColumnConstraint(0);
rules[0] = commentRule;
rules[1] = new SingleLineRule("=", null, entry, (char) 0, true);
setPredicateRules(rules);
}
}

View File

@@ -1,43 +0,0 @@
// Copyright (c) 2010 Piotr Wolny
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
package org.gildur.simplepropertieseditor.editor;
import org.eclipse.ui.editors.text.TextEditor;
public class SimplePropertiesEditor extends TextEditor {
private ColorManager colorManager;
public SimplePropertiesEditor() {
super();
colorManager = new ColorManager();
setSourceViewerConfiguration(new PropertiesConfiguration(colorManager));
setDocumentProvider(new PropertiesDocumentProvider());
}
@Override
public void dispose() {
colorManager.dispose();
super.dispose();
}
}