1 19 20 package org.netbeans.api.java.platform; 21 22 import java.beans.PropertyChangeListener ; 23 import java.beans.PropertyChangeSupport ; 24 import java.util.Collection ; 25 import java.util.Collections ; 26 import java.util.List ; 27 import java.util.Map ; 28 import org.netbeans.api.java.classpath.ClassPath; 29 import org.openide.filesystems.FileObject; 30 31 40 public abstract class JavaPlatform { 41 42 46 public static final String PROP_DISPLAY_NAME = "displayName"; 48 51 public static final String PROP_SOURCE_FOLDER = "sourceFolders"; 53 56 public static final String PROP_JAVADOC_FOLDER ="javadocFolders"; 58 61 public static final String PROP_SYSTEM_PROPERTIES = "systemProperties"; 63 private Map sysproperties = Collections.EMPTY_MAP; 64 private PropertyChangeSupport supp; 65 66 67 protected JavaPlatform() { 68 } 69 70 73 public abstract String getDisplayName(); 74 75 79 public final void addPropertyChangeListener(PropertyChangeListener l) { 80 synchronized (this) { 81 if (supp == null) 82 supp = new PropertyChangeSupport (this); 83 } 84 supp.addPropertyChangeListener(l); 85 } 86 87 90 public final void removePropertyChangeListener(PropertyChangeListener l) { 91 if (supp != null) 92 supp.removePropertyChangeListener(l); 93 } 94 95 106 public abstract Map getProperties(); 107 108 111 public final Map getSystemProperties() { 112 return sysproperties; 113 } 114 115 121 public abstract ClassPath getBootstrapLibraries(); 122 123 127 public abstract ClassPath getStandardLibraries(); 128 129 133 public abstract String getVendor (); 134 135 139 public abstract Specification getSpecification (); 140 141 146 public abstract Collection getInstallFolders(); 147 148 153 public abstract FileObject findTool (String toolName); 154 155 156 161 public abstract ClassPath getSourceFolders (); 162 163 168 public abstract List getJavadocFolders (); 169 170 171 176 public static JavaPlatform getDefault() { 177 return JavaPlatformManager.getDefault().getDefaultPlatform(); 178 } 179 180 181 183 188 protected final void firePropertyChange(String propName, Object oldValue, Object newValue) { 189 if (supp != null) 190 supp.firePropertyChange(propName, oldValue, newValue); 191 } 192 193 196 protected final void setSystemProperties(Map sysproperties) { 197 this.sysproperties = Collections.unmodifiableMap(sysproperties); 198 firePropertyChange(PROP_SYSTEM_PROPERTIES, null, null); } 200 201 } 202 | Popular Tags |