1 19 20 package org.netbeans.api.project.ui; 21 22 import java.beans.PropertyChangeListener ; 23 import org.netbeans.api.project.Project; 24 import org.netbeans.modules.project.uiapi.OpenProjectsTrampoline; 25 import org.netbeans.modules.project.uiapi.Utilities; 26 27 45 public final class OpenProjects { 46 47 51 public static final String PROPERTY_OPEN_PROJECTS = "openProjects"; 53 58 public static final String PROPERTY_MAIN_PROJECT = "MainProject"; 60 private static OpenProjects INSTANCE = new OpenProjects(); 61 62 private OpenProjectsTrampoline trampoline; 63 64 private OpenProjects() { 65 this.trampoline = Utilities.getOpenProjectsTrampoline(); 66 } 67 68 72 public static OpenProjects getDefault() { 73 return INSTANCE; 74 } 75 76 80 public Project[] getOpenProjects() { 81 return trampoline.getOpenProjectsAPI(); 82 } 83 84 104 public void open (Project[] projects, boolean openSubprojects) { 105 trampoline.openAPI (projects,openSubprojects); 106 } 107 108 114 public void close (Project[] projects) { 115 trampoline.closeAPI (projects); 116 } 117 118 135 public Project getMainProject() { 136 return trampoline.getMainProject(); 137 } 138 139 153 public void setMainProject(Project project) throws IllegalArgumentException { 154 trampoline.setMainProject(project); 155 } 156 157 164 public void addPropertyChangeListener( PropertyChangeListener listener ) { 165 trampoline.addPropertyChangeListenerAPI( listener ); 166 } 167 168 172 public void removePropertyChangeListener( PropertyChangeListener listener ) { 173 trampoline.removePropertyChangeListenerAPI( listener ); 174 } 175 176 } 177 | Popular Tags |