[hg] main-silver: #205007: In NB module project at the end of wi...

  • From: Martin Kozeny < >
  • To:
  • Subject: [hg] main-silver: #205007: In NB module project at the end of wi...
  • Date: Mon, 07 Jan 2013 08:21:56 -0800

changeset 6ba76fd111ef in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/6ba76fd111ef
description:
        #205007: In NB module project at the end of wizard for adding e.g. 
library descriptor when button Finish is invoked, localizing property bundle 
is created if not exists and information about library are written there. 
Displayed name of the module is fetched from manifest file (property 
OpenIDE-Module-Name).

diffstat:

 
apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java
 |  24 ++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diffs (73 lines):

diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java
@@ -61,6 +61,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.jar.Attributes;
 import java.util.jar.Manifest;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -171,6 +172,8 @@
     public static final String SOURCES_TYPE_JAVAHELP = "javahelp"; // NOI18N
     static final String[] COMMON_TEST_TYPES = {"unit", "qa-functional"}; // 
NOI18N
     
+    public static final String OPENIDE_MODULE_NAME = "OpenIDE-Module-Name"; 
// NOI18N
+    
     private final AntProjectHelper helper;
     private final Evaluator eval;
     private final Lookup lookup;
@@ -497,6 +500,17 @@
         }
     }
     
+    private String getModuleName() {
+        Manifest m = getManifest();
+        if (m != null) {
+            String moduleName = 
m.getMainAttributes().getValue(OPENIDE_MODULE_NAME);
+            if (moduleName != null) {
+                return moduleName;
+            }
+        }
+        return null;
+    }
+    
     public @CheckForNull String getSpecVersion() {
         //TODO shall we check for illegal cases like "none-defined" or 
"both-defined" here?
         Manifest m = getManifest();
@@ -807,17 +821,24 @@
         private final PropertyChangeSupport changeSupport = new 
PropertyChangeSupport(this);
 
         private final String name;
+        private final String openideModuleName;
         private String displayName;
         
         Info() {
             String cnb = getCodeNameBase();
             name = cnb != null ? cnb : /* #70490 
*/getProjectDirectory().toString();
+            String omn = getModuleName();
+            openideModuleName = omn;
         }
         
         @Override public String getName() {
             return name;
         }
         
+        private String getOpenideModuleName() {
+            return openideModuleName;
+        }
+        
         @Override public String getDisplayName() {
             if (displayName == null) {
                 LocalizedBundleInfo bundleInfo = getBundleInfo();
@@ -825,6 +846,9 @@
                     displayName = bundleInfo.getDisplayName();
                 }
             }
+            if (displayName == null) {
+                displayName = getOpenideModuleName();
+            }
             if (/* #70490 */displayName == null) {
                 displayName = getName();
             }

[hg] main-silver: #205007: In NB module project at the end of wi...

Martin Kozeny 01/07/2013

<Possible follow-up(s)>

[hg] main-silver: #205007: In NB module project at the end of wi...

Martin Kozeny 01/07/2013

Project Features

About this Project

APIsupport was started in November 2009, is owned by Antonin Nebuzelsky, and has 43 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close