org.netbeans.api.project.libraries

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.libraries 
org.netbeans.api.project.libraries
Libraries API

Representation of a library, and the ability to find the installed libraries.

Contents

Libraries API

Overview

The libraries API provides a client API of the Libraries framework. The Library itself is a typed set of volumes. The volume is a ordered list of resources. The type of library implies the volumes contained in it. For example the Java SE library contains three volumes (sources, classpath and javadoc). The resource is a valid URL of the physical resource.

How to obtain a list of installed libraries or given library

To obtain a list of installed libraries you want to call {@link org.netbeans.api.project.libraries.LibraryManager#getLibraries} as in the following example for listing the names of installed libraries.

Library[] libraries = LibraryManager.getDefault().getLibraries ();
for (int i = 0; i< libraries.length; i++) {
    System.out.println(libraries[i].getName()+" : "+libraries[i].getType());
}
To obtain a library with a given name you want to call {@link org.netbeans.api.project.libraries.LibraryManager#getLibrary} method as in the following example.
Library library = LibraryManager.getDefault().getLibrary ("Ant");
if (library != null) {
    System.out.println(library.getName()+" : "+libraries[i].getType());
}

Managing libraries

Libraries module provides graphical manager of libraries. The manager allows you to create a new library of a given type, to delete existing library or to change content of volumes. It is not possible to create or delete a volume in the library since the volumes are implied by the library type.

To open the graphical libraries manager you need to call {@link org.netbeans.api.project.libraries.LibrariesCustomizer#showCustomizer} method.

Library definition format

A module is able to register the predefined library. For example the junit module installs the junit library. The library definition is placed in the org-netbeans-api-project-libraries/Libraries folder on the system filesystem.

The library format is given by the following DTD.

<?xml version="1.0" encoding="UTF-8"?>

<!--
  Root element of library definition descriptor.
-->
<!ELEMENT library (name, type, description?, localizing-bundle?, volume*) >

<!-- The version attribute specifies the version of the library -->

<!ATTLIST library version CDATA #FIXED "1.0" >

<!--- Library unique identifier - a string.

 In the case when the localizing-bundle element presents the name value is used 
 as a key into bundle to locate the display name. Otherwise the name value is 
 used as a display name-->
<!ELEMENT name (#PCDATA) >

<!--Short description of given library - a string.
 In the case when the localizing-bundle element presents the description value
 is used as a key into bundle to locate the localized description. Otherwise
 the description value is used.-->
<!ELEMENT description (#PCDATA) >

<!-- The resource name of base bundle without an extension - a string.
 The bundle used to lookup the localized strings.
 The bundle is looked up by NbBundle.getBundle (String) method.
 Example of localizing bundle: org.netbeans.modules.junit.resources.Bundle -->
<!ELEMENT localizing-bundle (#PCDATA)>

<!--- Volume is typed list of resources -->
<!ELEMENT volume (type, resource*) >

<!--- Volume type of a library volume - a string 
 For example the Java SE library supports the following types of volume:

 classpath, javadoc and src -->
<!ELEMENT type (#PCDATA) >

<!--- Volume resource coded as an URL
 In the case of URL with nbinst protocol the URL is resolved from the NetBeans installation
 dircetory.
 If the URL points to an archive file, the URL must have the jar protocol.
 Example:
 jar:file:///usr/lib/java/xerces.jar!/ is resolved to /usr/lib/java/xerces.jar/
 jar:nbinst://org.netbeans.modules.junit/modules/ext/junit.jar!/ is resolved to ${netbeans.home}/modules/ext/junit.jar

 -->
<!ELEMENT resource (#PCDATA) >

Java Source File NameTypeComment
LibrariesCustomizer.javaClass
Library.javaClass Library models typed bundle of typed volumes.

Library volumes are typed and query-able by their type.

LibraryChooser.javaClass Visual picker for libraries.
LibraryChooserGUI.javaClass
LibraryManager.javaClass LibraryManager provides registry of the installed libraries.
LibraryManagerTest.javaClass
LibraryTest.javaClass
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.