Java Doc for OpenProjects.java in  » IDE-Netbeans » project.ant » org » netbeans » api » project » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » project.ant » org.netbeans.api.project.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.api.project.ui.OpenProjects

OpenProjects
final public class OpenProjects (Code)
List of projects open in the GUI.

Warning: this API is intended only for a limited set of use cases where obtaining a list of all open projects is really the direct goal. For example, you may wish to display a chooser letting the user select a file from among the top-level source folders of any open project. For many cases, however, this API is not the correct approach, so use it as a last resort. Consider GlobalPathRegistry, org.netbeans.spi.project.ui.ProjectOpenedHook , and org.netbeans.spi.project.ui.support.ProjectSensitiveActions (or org.netbeans.spi.project.ui.support.MainProjectSensitiveActions ) first. Only certain operations should actually be aware of which projects are "open"; by default, all project functionality should be available whether it is open or not.


author:
   Jesse Glick, Petr Hrebejk


Field Summary
final public static  StringPROPERTY_MAIN_PROJECT
     Property representing main project.
final public static  StringPROPERTY_OPEN_PROJECTS
     Property representing open projects.


Method Summary
public  voidaddPropertyChangeListener(PropertyChangeListener listener)
     Adds a listener to changes in the set of open projects.
public  voidclose(Project[] projects)
     Closes given projects. Acquires org.netbeans.api.project.ProjectManager.mutex in the write mode.
Parameters:
  projects - to be closed.
public static  OpenProjectsgetDefault()
     Get the default singleton instance of this class.
public  ProjectgetMainProject()
     Retrieves the current main project set in the IDE.

Warning: the set of usecases that require invoking this method is limited.

public  Project[]getOpenProjects()
     Gets a list of currently open projects.
public  voidopen(Project[] projects, boolean openSubprojects)
     Opens given projects. Acquires org.netbeans.api.project.ProjectManager.mutex in the write mode.
Parameters:
  projects - to be opened.
public  Future<Project[]>openProjects()
     Method to track progress of projects opening and closing.
public  voidremovePropertyChangeListener(PropertyChangeListener listener)
     Removes a listener.
public  voidsetMainProject(Project project)
     Sets the main project.

Warning: the set of usecases that require invoking this method is very limited and should be generally avoided if possible.


Field Detail
PROPERTY_MAIN_PROJECT
final public static String PROPERTY_MAIN_PROJECT(Code)
Property representing main project.
See Also:   OpenProjects.getMainProject
since:
   org.netbeans.modules.projectuiapi/1 1.20



PROPERTY_OPEN_PROJECTS
final public static String PROPERTY_OPEN_PROJECTS(Code)
Property representing open projects.
See Also:   OpenProjects.getOpenProjects





Method Detail
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)(Code)
Adds a listener to changes in the set of open projects. As this class is a singleton and is not subject to garbage collection, it is recommended to add only weak listeners, or remove regular listeners reliably.
Parameters:
  listener - a listener to add
See Also:   OpenProjects.PROPERTY_OPEN_PROJECTS



close
public void close(Project[] projects)(Code)
Closes given projects. Acquires org.netbeans.api.project.ProjectManager.mutex in the write mode.
Parameters:
  projects - to be closed. The non opened project contained in the projects array are ignored.
since:
   org.netbeans.modules.projectuiapi/0 1.2



getDefault
public static OpenProjects getDefault()(Code)
Get the default singleton instance of this class. the default instance



getMainProject
public Project getMainProject()(Code)
Retrieves the current main project set in the IDE.

Warning: the set of usecases that require invoking this method is limited. org.netbeans.spi.project.ui.support.MainProjectSensitiveActions should be used in favour of this method if possible. In particular, this method should not be used to let the user choose if an action should be run on the main vs. the currently selected project.

As a rule of thumb, any code outside of the project system infrastructure which behaves differently depending on the choice of main project should be reviewed critically. All functionality of a project ought to be available regardless of the "main project" flag, which is intended only as a convenient shortcut to permit certain actions (such as Run) to be invoked from a global context on a preselected project.

the current main project or null if none
since:
   1.11



getOpenProjects
public Project[] getOpenProjects()(Code)
Gets a list of currently open projects.

Since 1.26, the standard implementation handling the list of opened projects, delays their actual loading. First of all the startup of all modules is finished and only then the projects are loaded and opened on background. As soon as and no sooner before all opened projects are opened, the return value of this method changes and appropriate property change event with PROPERTY_OPEN_PROJECTS is delivered. list of projects currently opened in the IDE's GUI; order not specified




open
public void open(Project[] projects, boolean openSubprojects)(Code)
Opens given projects. Acquires org.netbeans.api.project.ProjectManager.mutex in the write mode.
Parameters:
  projects - to be opened. In the case when some of the projects are already openedthese projects are not opened again. If the projects contain duplicates, the duplicatedprojects are opened just once.
Parameters:
  openSubprojects - if true also subprojects are opened.
since:
   org.netbeans.modules.projectuiapi/0 1.2
since:
  


since:
   This method is designed for use by logical view's Libraries Node to open one or more of dependent
since:
   projects. This method can be used also by other project GUI components which need to open certain
since:
   project(s), eg. code generation wizards.

since:
   The method should not be used for opening newly created project, insted theorg.openide.WizardDescriptor.InstantiatingIterator.instantiate
since:
   used for creation of new project
since:
   should return the project directory.

since:
   The method should not be also used to provide a GUI to open subprojects.
since:
   The org.netbeans.spi.project.ui.support.CommonProjectActions.openSubprojectsAction
since:
   should be used
since:
   instead.
since:
  




openProjects
public Future<Project[]> openProjects()(Code)
Method to track progress of projects opening and closing. As the opening of a project may take long time, and as there can be multiple projects open at once, it may be necessary to be notified that the process of open project list modification started or that it has finished. This method provides a future that can do that. To find out that the list of open projects is currently modified use:
 assert openProjects().isDone() == false;
 
To wait for the opening/closing to be finished and then obtain the result use:
 Project[] current = openProjects().get();
 
This result is different that a plain call to OpenProjects.getOpenProjects as that methods returns the current state, whatever it is. While the call through the future awaits for current modifications to finish. As such wait can take a long time one can also wait for just a limited amount of time. However this waiting methods should very likely only be used from dedicated threads, where the wait does not block other essencial operations (read: do not use such methods from AWT or other known threads!). future to track computation of open projects
since:
   1.27



removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)(Code)
Removes a listener.
Parameters:
  listener - a listener to remove



setMainProject
public void setMainProject(Project project) throws IllegalArgumentException(Code)
Sets the main project.

Warning: the set of usecases that require invoking this method is very limited and should be generally avoided if possible. In particular, this method should not be used to mark a project just created by the New Project wizard as the main project.


Parameters:
  project - project to set as main project (must be open), ornull to set no project as main.
throws:
  IllegalArgumentException - if the project is not opened.
since:
   1.11



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.