1 11 package org.eclipse.ui.internal.preferences; 12 13 import java.util.Set ; 14 15 import org.eclipse.jface.util.IPropertyChangeListener; 16 import org.eclipse.jface.util.PropertyChangeEvent; 17 import org.eclipse.ui.themes.IThemeManager; 18 19 22 public class ThemeManagerAdapter extends PropertyMapAdapter { 23 24 private IThemeManager manager; 25 26 private IPropertyChangeListener listener = new IPropertyChangeListener() { 27 public void propertyChange(PropertyChangeEvent event) { 28 firePropertyChange(event.getProperty()); 29 } 30 }; 31 32 public ThemeManagerAdapter(IThemeManager manager) { 33 this.manager = manager; 34 } 35 36 39 protected void attachListener() { 40 manager.addPropertyChangeListener(listener); 41 } 42 43 46 protected void detachListener() { 47 manager.removePropertyChangeListener(listener); 48 } 49 50 53 public Set keySet() { 54 Set result = ThemeAdapter.getKeySet(manager.getCurrentTheme()); 55 56 return result; 57 } 58 59 62 public Object getValue(String propertyId, Class propertyType) { 63 return ThemeAdapter.getValue(manager.getCurrentTheme(), propertyId, propertyType); 64 } 65 66 69 public boolean propertyExists(String propertyId) { 70 return keySet().contains(propertyId); 71 } 72 73 76 public void setValue(String propertyId, Object newValue) { 77 throw new UnsupportedOperationException (); 78 } 79 80 } 81 | Popular Tags |