1 11 12 package org.eclipse.jdt.internal.ui.preferences; 13 14 import org.eclipse.core.runtime.ListenerList; 15 16 import org.eclipse.jface.preference.IPreferenceStore; 17 import org.eclipse.jface.util.IPropertyChangeListener; 18 import org.eclipse.jface.util.PropertyChangeEvent; 19 20 30 public class MockupPreferenceStore implements IPreferenceStore { 31 32 33 private ListenerList fListeners= new ListenerList(ListenerList.IDENTITY); 34 35 38 public void addPropertyChangeListener(IPropertyChangeListener listener) { 39 fListeners.add(listener); 40 } 41 42 45 public void removePropertyChangeListener(IPropertyChangeListener listener) { 46 fListeners.remove(listener); 47 } 48 49 52 public boolean contains(String name) { 53 throw new UnsupportedOperationException (); 54 } 55 56 59 public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { 60 firePropertyChangeEvent(this, name, oldValue, newValue); 61 } 62 63 71 public void firePropertyChangeEvent(Object source, String name, Object oldValue, Object newValue) { 72 PropertyChangeEvent event= new PropertyChangeEvent(source, name, oldValue, newValue); 73 Object [] listeners= fListeners.getListeners(); 74 for (int i= 0; i < listeners.length; i++) 75 ((IPropertyChangeListener) listeners[i]).propertyChange(event); 76 } 77 78 81 public boolean getBoolean(String name) { 82 throw new UnsupportedOperationException (); 83 } 84 85 88 public boolean getDefaultBoolean(String name) { 89 throw new UnsupportedOperationException (); 90 } 91 92 95 public double getDefaultDouble(String name) { 96 throw new UnsupportedOperationException (); 97 } 98 99 102 public float getDefaultFloat(String name) { 103 throw new UnsupportedOperationException (); 104 } 105 106 109 public int getDefaultInt(String name) { 110 throw new UnsupportedOperationException (); 111 } 112 113 116 public long getDefaultLong(String name) { 117 throw new UnsupportedOperationException (); 118 } 119 120 123 public String getDefaultString(String name) { 124 throw new UnsupportedOperationException (); 125 } 126 127 130 public double getDouble(String name) { 131 throw new UnsupportedOperationException (); 132 } 133 134 137 public float getFloat(String name) { 138 throw new UnsupportedOperationException (); 139 } 140 141 144 public int getInt(String name) { 145 throw new UnsupportedOperationException (); 146 } 147 148 151 public long getLong(String name) { 152 throw new UnsupportedOperationException (); 153 } 154 155 158 public String getString(String name) { 159 throw new UnsupportedOperationException (); 160 } 161 162 165 public boolean isDefault(String name) { 166 throw new UnsupportedOperationException (); 167 } 168 169 172 public boolean needsSaving() { 173 throw new UnsupportedOperationException (); 174 } 175 176 179 public void putValue(String name, String value) { 180 throw new UnsupportedOperationException (); 181 } 182 183 186 public void setDefault(String name, double value) { 187 throw new UnsupportedOperationException (); 188 } 189 190 193 public void setDefault(String name, float value) { 194 throw new UnsupportedOperationException (); 195 } 196 197 200 public void setDefault(String name, int value) { 201 throw new UnsupportedOperationException (); 202 } 203 204 207 public void setDefault(String name, long value) { 208 throw new UnsupportedOperationException (); 209 } 210 211 214 public void setDefault(String name, String defaultObject) { 215 throw new UnsupportedOperationException (); 216 } 217 218 221 public void setDefault(String name, boolean value) { 222 throw new UnsupportedOperationException (); 223 } 224 225 228 public void setToDefault(String name) { 229 throw new UnsupportedOperationException (); 230 } 231 232 235 public void setValue(String name, double value) { 236 throw new UnsupportedOperationException (); 237 } 238 239 242 public void setValue(String name, float value) { 243 throw new UnsupportedOperationException (); 244 } 245 246 249 public void setValue(String name, int value) { 250 throw new UnsupportedOperationException (); 251 } 252 253 256 public void setValue(String name, long value) { 257 throw new UnsupportedOperationException (); 258 } 259 260 263 public void setValue(String name, String value) { 264 throw new UnsupportedOperationException (); 265 } 266 267 270 public void setValue(String name, boolean value) { 271 throw new UnsupportedOperationException (); 272 } 273 274 } 275 | Popular Tags |