public static LibraryChooser.Panel createPanel(LibraryManager manager, LibraryChooser.Filter filter) { LibraryChooserGUI l = new LibraryChooserGUI(manager, filter, null); l.configureForEmbedded(); return l; }
/** * Create a picker as an embeddable panel. * Might be used in a wizard, for example. * @param manager library manager to use or null for global libraries * @param filter optional libraries filter; null for no filtering * @return a panel controller */ public static Panel createPanel(LibraryManager manager, Filter filter) { return LibraryChooserGUI.createPanel(manager, filter); }
public void propertyChange(PropertyChangeEvent evt) { add.setEnabled(!getSelectedLibraries().isEmpty()); } });
public static Set<Library> showChooser(LibraryManager manager, LibraryChooser.Filter filter, LibraryChooser.LibraryImportHandler handler, boolean addOperation) { LibraryChooserGUI l = new LibraryChooserGUI(manager, filter, handler); return l.showDialog(addOperation); }
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
private void importButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importButtonActionPerformed Set<Library> libs = showChooser(LibraryManager.getDefault(), new IgnoreAlreadyImportedLibrariesFilter(), null, false); if (libs != null) { Set<Library> importedLibs = new HashSet<Library>(); try { for (Library lib : libs) { importedLibs.add(importHandler.importLibrary(lib)); } } catch (IOException ex) { Exceptions.printStackTrace(ex); } setRootNode(); selectLibrary(importedLibs); } }//GEN-LAST:event_importButtonActionPerformed
this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) manageLibrariesButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LibraryChooserGUI.class, "ACSD_ManageLibraries")); // NOI18N getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(LibraryChooserGUI.class, "LibraryChooserGUI.AccessibleContext.accessibleName")); // NOI18N getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LibraryChooserGUI.class, "LibraryChooserGUI.accessibleDescription")); // NOI18N
@Override public void addNotify() { super.addNotify(); setRootNode(); }
/** * Create a chooser showing libraries from given library manager and let the * user to pick some. * @param manager manager; can be null in which case global libraries are listed * @param filter optional libraries filter; null for no filtering * @param handler handler to perform library importing; can be null in which case * import will not be allowed in UI * @return a nonempty set of libraries that were selected, or null if the dialog was cancelled */ public static Set<Library> showDialog(LibraryManager manager, Filter filter, LibraryImportHandler handler) { return LibraryChooserGUI.showChooser(manager, filter, handler, true); }
private LibraryChooserGUI(LibraryManager manager, LibraryChooser.Filter filter, LibraryChooser.LibraryImportHandler importHandler) { if (manager == null) { manager = LibraryManager.getDefault(); } this.manager = manager; this.filter = filter; this.importHandler = importHandler; explorer = new ExplorerManager(); initComponents(); tree.setDefaultActionAllowed(true); }
private void manageLibrariesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageLibrariesButtonActionPerformed if (LibrariesCustomizer.showCustomizer(null, manager)) { setRootNode(); } }//GEN-LAST:event_manageLibrariesButtonActionPerformed
dialogDescriptor.setClosingOptions(new Object[] {add, NotifyDescriptor.CANCEL_OPTION}); if (DialogDisplayer.getDefault().notify(dialogDescriptor) == add) { Set<Library> selection = getSelectedLibraries(); assert !selection.isEmpty(); return selection;