/** * Shows libraries customizer for global libraries. * @param activeLibrary if not null the activeLibrary is selected in the opened customizer * @return true if user pressed OK and libraries were sucessfully modified */ public static boolean showCustomizer (Library activeLibrary) { return showCustomizer(activeLibrary, LibraryManager.getDefault()); }
private void createButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createButtonActionPerformed Library l = LibrariesCustomizer.showCreateNewLibraryCustomizer(manager); if (l != null) { setRootNode(); selectLibrary(Collections.singleton(l)); } }//GEN-LAST:event_createButtonActionPerformed
p.setDialogDescriptor(dd); Dialog dlg = DialogDisplayer.getDefault().createDialog (dd); setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription()); dlg.setVisible(true); if (dd.getValue() == DialogDescriptor.OK_OPTION) { customizer.getModel().addLibrary(impl); customizer.forceTreeRecreation(); if (customizeLibrary(customizer, impl)) { return manager.getLibrary(impl.getName());
@Messages("LibrariesCustomizer.customizeLibrary.title=Customize Library") private static boolean customizeLibrary(org.netbeans.modules.project.libraries.ui.LibrariesCustomizer customizer, LibraryImplementation activeLibrary) { customizer.hideLibrariesList(); customizer.setBorder(new EmptyBorder(12, 8, 0, 10)); customizer.setSelectedLibrary (activeLibrary); DialogDescriptor descriptor = new DialogDescriptor(customizer, LibrariesCustomizer_customizeLibrary_title()); Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor); setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription()); try { dlg.setVisible(true); if (descriptor.getValue() == DialogDescriptor.OK_OPTION) { customizer.apply(); return true; } else { return false; } } finally { dlg.dispose(); } }
/** * Show library customizer for the given library. * @param library library * @return true if library was modified or not * @since org.netbeans.modules.project.libraries/1 1.16 */ public static boolean showSingleLibraryCustomizer(Library library) { org.netbeans.modules.project.libraries.ui.LibrariesCustomizer customizer = new org.netbeans.modules.project.libraries.ui.LibrariesCustomizer ( LibrariesSupport.getLibraryStorageArea(library.getManager())); return customizeLibrary(customizer, LibrariesSupport.getLibraryImplementation(library)); }
/** * Shows libraries customizer for given library manager. * @param activeLibrary if not null the activeLibrary is selected in the opened customizer * @return true if user pressed OK and libraries were sucessfully modified */ @Messages("TXT_LibrariesManager=Ant Library Manager") public static boolean showCustomizer (Library activeLibrary, LibraryManager libraryManager) { org.netbeans.modules.project.libraries.ui.LibrariesCustomizer customizer = new org.netbeans.modules.project.libraries.ui.LibrariesCustomizer ( LibrariesSupport.getLibraryStorageArea(libraryManager)); customizer.setBorder(new EmptyBorder(12, 12, 0, 12)); if (activeLibrary != null) { customizer.setSelectedLibrary (LibrariesSupport.getLibraryImplementation(activeLibrary)); } DialogDescriptor descriptor = new DialogDescriptor(customizer, TXT_LibrariesManager()); Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor); setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription()); try { dlg.setVisible(true); if (descriptor.getValue() == DialogDescriptor.OK_OPTION) { return customizer.apply(); } else { return false; } } finally { dlg.dispose(); } }
private ProjectProblemsProvider.Status resolveByLibraryManager() { final LibraryManager lm = getProjectLibraryManager(); if (lm == null) { //Closed and freed project return ProjectProblemsProvider.Status.UNRESOLVED; } LibrariesCustomizer.showCustomizer(null,lm); return ProjectProblemsProvider.Status.RESOLVED; }
private void manageLibrariesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageLibrariesButtonActionPerformed if (LibrariesCustomizer.showCustomizer(null, manager)) { setRootNode(); } }//GEN-LAST:event_manageLibrariesButtonActionPerformed