mirror of
https://github.com/gildur/SimplePropertiesEditor.git
synced 2026-04-03 00:29:47 +09:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6edac575c4 | ||
|
|
c87e904e11 | ||
|
|
b9c4e9725a | ||
|
|
4e82e32ab6 | ||
|
|
1f00095290 | ||
|
|
a43a19f743 | ||
|
|
c48b7c8c05 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
/bin
|
||||
.metadata/
|
||||
bin/
|
||||
RemoteSystemsTempFiles/
|
||||
|
||||
22
LICENSE
Normal file
22
LICENSE
Normal 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
19
README.md
Normal 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
17
feature/.project
Normal 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
1
feature/build.properties
Normal file
@@ -0,0 +1 @@
|
||||
bin.includes = feature.xml
|
||||
50
feature/feature.xml
Normal file
50
feature/feature.xml
Normal 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 "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.
|
||||
</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>
|
||||
@@ -1,9 +1,9 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: SimplePropertiesEditor
|
||||
Bundle-SymbolicName: SimplePropertiesEditor; singleton:=true
|
||||
Bundle-Version: 1.0.4
|
||||
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,
|
||||
|
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
@@ -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>
|
||||
@@ -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;
|
||||
28
plugin/src/pl/gildur/simplepropertieseditor/editor/ColorManager.java
Executable file
28
plugin/src/pl/gildur/simplepropertieseditor/editor/ColorManager.java
Executable 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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
4
site/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
artifacts.jar
|
||||
content.jar
|
||||
features/
|
||||
plugins/
|
||||
17
site/.project
Normal file
17
site/.project
Normal 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
7
site/site.xml
Normal 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>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user