Java Doc for ProjectManager.java in  » IDE-Netbeans » project.ant » org » netbeans » api » project » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.api.project.ProjectManager

ProjectManager
final public class ProjectManager (Code)
Manages loaded projects.
author:
   Jesse Glick




Method Summary
public  voidclearNonProjectCache()
     Clear the cached list of folders thought not to be projects. This may be useful after creating project metadata in a folder, etc. Cached project objects, i.e.
public  ProjectfindProject(FileObject projectDirectory)
     Find an open project corresponding to a given project directory. Will be created in memory if necessary.

Acquires read access.

It is not guaranteed that the returned instance will be identical to that which is created by the appropriate ProjectFactory .

public static  ProjectManagergetDefault()
     Returns the singleton project manager instance.
public  Set<Project>getModifiedProjects()
     Get a list of all projects which are modified and need to be saved.
public  booleanisModified(Project p)
     Check whether a given project is current modified.
public  booleanisProject(FileObject projectDirectory)
     Check whether a given directory is likely to contain a project without actually loading it. Should be faster and use less memory than ProjectManager.findProject when called on a large number of directories.

The result is not guaranteed to be accurate; there may be false positives (directories for which isProject is true but ProjectManager.findProject will return false), for example if there is trouble loading the project. False negatives are possible only if there are bugs in the project factory.

Acquires read access.

You do not need to call this method if you just plan to call ProjectManager.findProject afterwards.

public  booleanisValid(Project p)
     Checks whether a project is still valid.
public static  Mutexmutex()
     Get a read/write lock to be used for all project metadata accesses. All methods relating to recognizing and loading projects, saving them, getting or setting their metadata, etc.
 voidreset()
     Clear internal state.
public  voidsaveAllProjects()
     Save all modified projects.
public  voidsaveProject(Project p)
     Save one project (if it was in fact modified).

Acquires write access.

Although the project infrastructure permits a modified project to be saved at any time, current UI principles dictate that the "save project" concept should be internal only - i.e.




Method Detail
clearNonProjectCache
public void clearNonProjectCache()(Code)
Clear the cached list of folders thought not to be projects. This may be useful after creating project metadata in a folder, etc. Cached project objects, i.e. folders that are known to be projects, are not affected.



findProject
public Project findProject(FileObject projectDirectory) throws IOException, IllegalArgumentException(Code)
Find an open project corresponding to a given project directory. Will be created in memory if necessary.

Acquires read access.

It is not guaranteed that the returned instance will be identical to that which is created by the appropriate ProjectFactory . In particular, the project manager is free to return only wrapper Project instances which delegate to the factory's implementation. If you know your factory created a particular project, you cannot safely cast the return value of this method to your project type implementation class; you should instead place an implementation of some suitable private interface into your project's lookup, which would be safely proxied.


Parameters:
  projectDirectory - the project top directory the project (object identity may or may not vary between calls)or null if the directory is not recognized as a project by anyregistered ProjectFactory(might be null even if ProjectManager.isProject returns true)
throws:
  IOException - if the project was recognized but could not be loaded
throws:
  IllegalArgumentException - if the supplied file object is null or not a folder



getDefault
public static ProjectManager getDefault()(Code)
Returns the singleton project manager instance. the default instance



getModifiedProjects
public Set<Project> getModifiedProjects()(Code)
Get a list of all projects which are modified and need to be saved.

Acquires read access. an immutable set of projects




isModified
public boolean isModified(Project p) throws IllegalArgumentException(Code)
Check whether a given project is current modified.

Acquires read access.
Parameters:
  p - a project loaded by this manager true if it is modified, false if has been saved since the last modification
throws:
  IllegalArgumentException - if the project was not created through this manager




isProject
public boolean isProject(FileObject projectDirectory) throws IllegalArgumentException(Code)
Check whether a given directory is likely to contain a project without actually loading it. Should be faster and use less memory than ProjectManager.findProject when called on a large number of directories.

The result is not guaranteed to be accurate; there may be false positives (directories for which isProject is true but ProjectManager.findProject will return false), for example if there is trouble loading the project. False negatives are possible only if there are bugs in the project factory.

Acquires read access.

You do not need to call this method if you just plan to call ProjectManager.findProject afterwards. It is intended for only those clients which would discard the result of ProjectManager.findProject other than to check for null, and which can also tolerate false positives.


Parameters:
  projectDirectory - a directory which may be some project's top directory true if the directory is likely to contain a project according tosome registered ProjectFactory
throws:
  IllegalArgumentException - if the supplied file object is null or not a folder



isValid
public boolean isValid(Project p)(Code)
Checks whether a project is still valid.

Acquires read access.


since:
   1.6
Parameters:
  p - a project loaded by this manager true if the project is still valid, false if it has been deleted



mutex
public static Mutex mutex()(Code)
Get a read/write lock to be used for all project metadata accesses. All methods relating to recognizing and loading projects, saving them, getting or setting their metadata, etc. should be controlled by this mutex and be marked as read operations or write operations. Unless otherwise stated, project-related methods automatically acquire the mutex for you, so you do not necessarily need to pay attention to it; but you may directly acquire the mutex in order to ensure that a block of reads does not have any interspersed writes, or in order to ensure that a write is not clobbering an unrelated write, etc. a general read/write lock for project metadata operations of all sorts



reset
void reset()(Code)
Clear internal state. Useful from unit tests.



saveAllProjects
public void saveAllProjects() throws IOException(Code)
Save all modified projects.

Acquires write access.
throws:
  IOException - if any of them cannot be saved




saveProject
public void saveProject(Project p) throws IOException, IllegalArgumentException(Code)
Save one project (if it was in fact modified).

Acquires write access.

Although the project infrastructure permits a modified project to be saved at any time, current UI principles dictate that the "save project" concept should be internal only - i.e. a project customizer should automatically save the project when it is closed e.g. with an "OK" button. Currently there is no UI display of modified projects; this module does not ensure that modified projects are saved at system exit time the way modified files are, though the Project UI implementation module currently does this check.


Parameters:
  p - the project to save
throws:
  IOException - if it cannot be saved
throws:
  IllegalArgumentException - if the project was not created through this manager



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.