001: package net.refractions.udig.style.sld.editor;
002:
003: import java.util.Collections;
004: import java.util.HashMap;
005: import java.util.Map;
006:
007: import org.eclipse.core.runtime.preferences.IEclipsePreferences;
008: import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
009: import org.eclipse.core.runtime.preferences.IScope;
010: import org.osgi.service.prefs.BackingStoreException;
011: import org.osgi.service.prefs.Preferences;
012:
013: /**
014: *
015: * TODO Purpose of
016: * <p>
017: *
018: * </p>
019: * @author chorner
020: * @since 1.1.M1
021: * @see org.eclipse.core.internal.preferences.EclipsePreferences
022: */
023: public class SLDPreferences implements IEclipsePreferences, IScope {
024:
025: protected Map children;
026: protected final String name;
027: protected final SLDPreferences parent;
028:
029: public SLDPreferences() {
030: this (null, null);
031: }
032:
033: public SLDPreferences(SLDPreferences parent, String name) {
034: super ();
035: this .parent = parent;
036: this .name = name;
037: }
038:
039: public void addNodeChangeListener(INodeChangeListener listener) {
040: }
041:
042: public void removeNodeChangeListener(INodeChangeListener listener) {
043: }
044:
045: public void addPreferenceChangeListener(
046: IPreferenceChangeListener listener) {
047: }
048:
049: public void removePreferenceChangeListener(
050: IPreferenceChangeListener listener) {
051: }
052:
053: public void removeNode() throws BackingStoreException {
054: }
055:
056: public Preferences node(String path) {
057: return null;
058: }
059:
060: public void accept(IPreferenceNodeVisitor visitor)
061: throws BackingStoreException {
062: }
063:
064: public void put(String key, String value) {
065: }
066:
067: public String get(String key, String def) {
068: return null;
069: }
070:
071: public void remove(String key) {
072: }
073:
074: public void clear() throws BackingStoreException {
075: }
076:
077: public void putInt(String key, int value) {
078: }
079:
080: public int getInt(String key, int def) {
081: return 0;
082: }
083:
084: public void putLong(String key, long value) {
085: }
086:
087: public long getLong(String key, long def) {
088: return 0;
089: }
090:
091: public void putBoolean(String key, boolean value) {
092: }
093:
094: public boolean getBoolean(String key, boolean def) {
095: return false;
096: }
097:
098: public void putFloat(String key, float value) {
099: }
100:
101: public float getFloat(String key, float def) {
102: return 0;
103: }
104:
105: public void putDouble(String key, double value) {
106: }
107:
108: public double getDouble(String key, double def) {
109: return 0;
110: }
111:
112: public void putByteArray(String key, byte[] value) {
113: }
114:
115: public byte[] getByteArray(String key, byte[] def) {
116: return null;
117: }
118:
119: public String[] keys() throws BackingStoreException {
120: return null;
121: }
122:
123: public String[] childrenNames() throws BackingStoreException {
124: return null;
125: }
126:
127: public Preferences parent() {
128: return null;
129: }
130:
131: public boolean nodeExists(String pathName)
132: throws BackingStoreException {
133: return false;
134: }
135:
136: public String name() {
137: return name;
138: }
139:
140: public String absolutePath() {
141: return null;
142: }
143:
144: public void flush() throws BackingStoreException {
145: }
146:
147: public void sync() throws BackingStoreException {
148: }
149:
150: public IEclipsePreferences create(IEclipsePreferences parent,
151: String name) {
152: return null;
153: }
154:
155: protected synchronized IEclipsePreferences addChild(
156: String childName, IEclipsePreferences child) {
157: //Thread safety: synchronize method to protect modification of children field
158: if (children == null)
159: children = Collections.synchronizedMap(new HashMap());
160: children.put(childName, child == null ? (Object) childName
161: : child);
162: return child;
163: }
164:
165: }
|