[hg] main-silver: #243152: Print only a warning for actions that...

  • From:
  • To:
  • Subject: [hg] main-silver: #243152: Print only a warning for actions that...
  • Date: Fri, 04 Apr 2014 23:58:06 +0000

changeset 306d10ce78b9 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/306d10ce78b9
description:
        #243152: Print only a warning for actions that produce null menu item.

diffstat:

 editor/src/org/netbeans/modules/editor/NbEditorKit.java |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (21 lines):

diff --git a/editor/src/org/netbeans/modules/editor/NbEditorKit.java 
b/editor/src/org/netbeans/modules/editor/NbEditorKit.java
--- a/editor/src/org/netbeans/modules/editor/NbEditorKit.java
+++ b/editor/src/org/netbeans/modules/editor/NbEditorKit.java
@@ -778,6 +778,9 @@
                     if 
(Boolean.TRUE.equals(action.getValue(DynamicMenuContent.HIDE_WHEN_DISABLED)) 
&& !action.isEnabled()) {
                         return;
                     }
+                    if (item == null) {
+                        LOG.log(Level.WARNING, "Null menu item produced by 
action {0}.", action);
+                    } else {
                     item.setEnabled(action.isEnabled());
                     Object helpID = action.getValue ("helpID"); // NOI18N
                     if (helpID != null && (helpID instanceof String)) {
@@ -789,6 +792,7 @@
                 }
             }
         }
+        }
         
         private void addTopComponentActions(JTextComponent component, 
JPopupMenu popupMenu) {
             Lookup contextLookup = getContextLookup(component);

[hg] main-silver: #243152: Print only a warning for actions that...

mentlicher 04/04/2014

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 188 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150226.965aeb8). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close