This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 200157
Collapse All | Expand All

(-)project.libraries/manifest.mf (-1 / +1 lines)
Lines 2-8 Link Here
2
OpenIDE-Module: org.netbeans.modules.project.libraries/1
2
OpenIDE-Module: org.netbeans.modules.project.libraries/1
3
OpenIDE-Module-Install: org/netbeans/modules/project/libraries/LibrariesModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/project/libraries/LibrariesModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/project/libraries/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/project/libraries/resources/mf-layer.xml
5
OpenIDE-Module-Specification-Version: 1.31
5
OpenIDE-Module-Specification-Version: 1.32
6
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/libraries/resources/Bundle.properties
6
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/libraries/resources/Bundle.properties
7
AutoUpdate-Show-In-Client: false
7
AutoUpdate-Show-In-Client: false
8
8
(-)project.libraries/src/org/netbeans/api/project/libraries/LibrariesCustomizer.java (-1 / +13 lines)
Lines 108-113 Link Here
108
     * @since org.netbeans.modules.project.libraries/1 1.16
108
     * @since org.netbeans.modules.project.libraries/1 1.16
109
     */
109
     */
110
    public static Library showCreateNewLibraryCustomizer(LibraryManager manager) {                                             
110
    public static Library showCreateNewLibraryCustomizer(LibraryManager manager) {                                             
111
        return showCreateNewLibraryCustomizer(manager, null); //NOI18N
112
    }
113
    
114
    /**
115
     * Show customizer for creating new library with pre-filled library name 
116
     * in the given library manager. 
117
     * @param manager manager
118
     * @param libraryName pre-filled library name
119
     * @return created persisted library or null if user cancelled operation
120
     * @since org.netbeans.modules.project.libraries/1 1.32
121
     */
122
    public static Library showCreateNewLibraryCustomizer(LibraryManager manager, String libraryName) {                                             
111
        if (manager == null) {
123
        if (manager == null) {
112
            manager = LibraryManager.getDefault();
124
            manager = LibraryManager.getDefault();
113
        }
125
        }
Lines 117-123 Link Here
117
        }
129
        }
118
        org.netbeans.modules.project.libraries.ui.LibrariesCustomizer  customizer =
130
        org.netbeans.modules.project.libraries.ui.LibrariesCustomizer  customizer =
119
                new org.netbeans.modules.project.libraries.ui.LibrariesCustomizer (area);
131
                new org.netbeans.modules.project.libraries.ui.LibrariesCustomizer (area);
120
        NewLibraryPanel p = new NewLibraryPanel(customizer.getModel(), null, area);
132
        NewLibraryPanel p = new NewLibraryPanel(customizer.getModel(), null, area, libraryName);
121
        DialogDescriptor dd = new DialogDescriptor (p, 
133
        DialogDescriptor dd = new DialogDescriptor (p, 
122
                NbBundle.getMessage(LibrariesCustomizer.class,"LibrariesCustomizer.createLibrary.title"),
134
                NbBundle.getMessage(LibrariesCustomizer.class,"LibrariesCustomizer.createLibrary.title"),
123
                true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
135
                true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
(-)project.libraries/src/org/netbeans/modules/project/libraries/ui/LibrariesCustomizer.java (-1 / +1 lines)
Lines 522-528 Link Here
522
            if (area == null) {
522
            if (area == null) {
523
                area = LibrariesModel.GLOBAL_AREA;
523
                area = LibrariesModel.GLOBAL_AREA;
524
            }
524
            }
525
            NewLibraryPanel p = new NewLibraryPanel(model, preselectedLibraryType, area);
525
            NewLibraryPanel p = new NewLibraryPanel(model, preselectedLibraryType, area, null);
526
            DialogDescriptor dd = new DialogDescriptor (p, NbBundle.getMessage(LibrariesCustomizer.class,"CTL_CreateLibrary"),
526
            DialogDescriptor dd = new DialogDescriptor (p, NbBundle.getMessage(LibrariesCustomizer.class,"CTL_CreateLibrary"),
527
                    true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
527
                    true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
528
            p.setDialogDescriptor(dd);
528
            p.setDialogDescriptor(dd);
(-)project.libraries/src/org/netbeans/modules/project/libraries/ui/NewLibraryPanel.java (-5 / +8 lines)
Lines 61-68 Link Here
61
61
62
    private DialogDescriptor dd;
62
    private DialogDescriptor dd;
63
    
63
    
64
64
    public NewLibraryPanel (LibrariesModel model, String preselectedLibraryType, LibraryStorageArea area, String libraryName) {
65
    public NewLibraryPanel (LibrariesModel model, String preselectedLibraryType, LibraryStorageArea area) {
66
        this.model = model;
65
        this.model = model;
67
        this.area = area;
66
        this.area = area;
68
        initComponents();
67
        initComponents();
Lines 81-87 Link Here
81
            }
80
            }
82
81
83
        });
82
        });
84
        initModel(preselectedLibraryType);
83
        initModel(preselectedLibraryType, libraryName);
85
        Color c = javax.swing.UIManager.getColor("nb.errorForeground"); //NOI18N
84
        Color c = javax.swing.UIManager.getColor("nb.errorForeground"); //NOI18N
86
        if (c == null) {
85
        if (c == null) {
87
            c = new Color(89,79,191);  // RGB suggested by Bruce in #28466
86
            c = new Color(89,79,191);  // RGB suggested by Bruce in #28466
Lines 109-117 Link Here
109
    }
108
    }
110
109
111
110
112
    private void initModel(String preselectedLibraryType) {
111
    private void initModel(String preselectedLibraryType, String libraryName) {
113
        this.typeMap = new HashMap<Integer,String>();
112
        this.typeMap = new HashMap<Integer,String>();
114
        this.name.setText (NbBundle.getMessage (NewLibraryPanel.class,"TXT_NewLibrary"));
113
        if (libraryName != null) {
114
            this.name.setText(libraryName);
115
        } else {
116
            this.name.setText(NbBundle.getMessage (NewLibraryPanel.class,"TXT_NewLibrary"));
117
        }
115
        LibraryTypeRegistry regs = LibraryTypeRegistry.getDefault();
118
        LibraryTypeRegistry regs = LibraryTypeRegistry.getDefault();
116
        LibraryTypeProvider[] providers = regs.getLibraryTypeProviders();
119
        LibraryTypeProvider[] providers = regs.getLibraryTypeProviders();
117
        int index = 0;
120
        int index = 0;

Return to bug 200157