private void initLibraries() { // create library LibraryImplementation lib = new J2eeLibraryTypeProvider().createLibrary(); lib.setName(NbBundle.getMessage(JBJ2eePlatformFactory.class, "TITLE_JBOSS_LIBRARY")); lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH, properties.getClasses()); lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC, properties.getJavadocs()); lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_SRC, properties.getSources()); libraries = new LibraryImplementation[] {lib}; }
@Override public List<URL> getContent(String volumeType) throws IllegalArgumentException { return getLibraryImplementation().getContent(volumeType); }
@Override public String getName () { return this.lib.getName (); }
public void propertyChange(PropertyChangeEvent evt) { if (J2eePlatformImpl.PROP_LIBRARIES.equals(evt.getPropertyName())) { LibraryImplementation[] libs = getLibraries(); for (int i = 0; i < libs.length; i++) { libs[i].removePropertyChangeListener(librariesChangeListener); libs[i].addPropertyChangeListener(librariesChangeListener); } classpathCache = null; String newClassPath = getClasspathAsString(); if (currentClasspath == null || !currentClasspath.equals(newClassPath)) { currentClasspath = newClassPath; impl.firePropertyChange(PROP_CLASSPATH, null, null); } } else if (J2eePlatformImpl.PROP_SERVER_LIBRARIES.equals(evt.getPropertyName())) { impl.firePropertyChange(PROP_CLASSPATH, null, null); } } });
List<URL> runtime) throws IOException { LibraryImplementation impl = LibrariesSupport.createLibraryImplementation(ThemeLibraryTypeProvider.LIBRARY_TYPE, ThemeLibraryTypeProvider.VOLUME_TYPES); impl.setName (name); impl.setDescription (description); impl.setLocalizingBundle (localizingBundle); if (classPaths != null) { ArrayList a = new ArrayList(classPaths.size()); a.add(toResourceURL((URL)i.next())); impl.setContent("classpath", a); // NOI18N a.add(toResourceURL((URL)i.next())); impl.setContent("src", a); // NOI18N a.add(toResourceURL((URL)i.next())); impl.setContent("javadoc", a); // NOI18N a.add(toResourceURL((URL)i.next())); impl.setContent("runtime", a); // NOI18N
private static boolean addLibraryIntoBuild(LibraryImplementation impl, EditableProperties props) { boolean modified = false; for (int i=0; i<VOLUME_TYPES.length; i++) { String propName = LIB_PREFIX + impl.getName() + '.' + VOLUME_TYPES[i]; //NOI18N List roots = impl.getContent (VOLUME_TYPES[i]); if (roots == null) {
private void loadLibraries(LibraryImplementation lib) { lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH, tp.getClasses()); lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC, tp.getJavadocs()); lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_SRC, tp.getSources()); } }
ALPUtils.remove(area2Storage.get(area), (LibraryImplementation2)impl); } else { throw new IOException("Cannot find storage for library: " + impl.getName()); // NOI18N ArealLibraryProvider alp = area2Storage.get(area); assert alp != null : "Unknown area: " + area + " known areas: " + area2Storage.keySet(); final LibraryImplementation2 createdLib = ALPUtils.createLibrary(alp, impl.getType(), impl.getName(), area, ((DummyArealLibrary) impl).contents); LibrariesSupport.setDisplayName(createdLib, LibrariesSupport.getDisplayName(impl)); } else if (writableProvider != null) { orig.setContent(entry.getKey(), entry.getValue()); throw new IOException("Cannot find storage for library: " + orig.getName()); // NOI18N
String type = libs[j].getType (); List classes = libs[j].getContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH); //NOI18N for (Iterator it = classes.iterator(); it.hasNext();) { URL entry = (URL) it.next();
@Override public void setName(String name) { getLibraryImplementation().setName(name); }
public void setSelectedLibrary (LibraryImplementation library) { if (library == null) { return; } ExplorerManager currentManager = this.getExplorerManager(); Node root = currentManager.getRootContext(); String[] path = {library.getType(), library.getName()}; try { Node node = NodeOp.findPath(root, path); if (node != null) { currentManager.setSelectedNodes(new Node[] {node}); } } catch (NodeNotFoundException e) { //Ignore it } catch (PropertyVetoException e) { //Ignore it } }
public Result (URL queryFor, LibraryImplementation aLib) { this.entry = queryFor; this.lib = aLib; this.lib.addPropertyChangeListener ((PropertyChangeListener)WeakListeners.create(PropertyChangeListener.class,this,this.lib)); }
@Override public String getType() { return getLibraryImplementation().getType(); }
@Override public void removePropertyChangeListener(PropertyChangeListener l) { getLibraryImplementation().removePropertyChangeListener(l); }
LibraryImplementation impl = LibrariesSupport.getLibraryTypeProvider("j2se").createLibrary(); impl.setName (name); impl.setDescription (description); impl.setLocalizingBundle (localizingBundle); if (classPaths != null) { ArrayList a = new ArrayList(classPaths.size()); a.add(toResourceURL((URL)i.next())); impl.setContent("classpath", a); // NOI18N a.add(toResourceURL((URL)i.next())); impl.setContent("src", a); // NOI18N a.add(toResourceURL((URL)i.next())); impl.setContent("javadoc", a); // NOI18N
private static boolean addLibraryIntoBuild(LibraryImplementation impl, EditableProperties props) { boolean modified = false; for (int i = 0; i < VOLUME_TYPES.length; i++) { String propName = LIB_PREFIX + impl.getName() + '.' + VOLUME_TYPES[i]; //NOI18N List roots = impl.getContent(VOLUME_TYPES[i]); if (roots == null) {
@Override public void setContent(String volumeType, List<URL> path) throws IllegalArgumentException { getLibraryImplementation().setContent(volumeType, path); } }
@Override public synchronized LibraryImplementation[] getLibraries() { if (libraries == null) { J2eeLibraryTypeProvider libProvider = new J2eeLibraryTypeProvider(); LibraryImplementation lib = libProvider.createLibrary(); lib.setName(NbBundle.getMessage(TomcatPlatformImpl.class, "LBL_lib_name", displayName)); loadLibraries(lib); libraries = new LibraryImplementation[1]; libraries[0] = lib; } return libraries; }