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 184891
Collapse All | Expand All

(-)a/core.windows/src/org/netbeans/core/windows/actions/ActionUtils.java (-1 / +3 lines)
Lines 57-62 Link Here
57
import org.openide.DialogDisplayer;
57
import org.openide.DialogDisplayer;
58
import org.openide.NotifyDescriptor;
58
import org.openide.NotifyDescriptor;
59
import org.openide.actions.SaveAction;
59
import org.openide.actions.SaveAction;
60
import org.openide.awt.Actions;
60
import org.openide.cookies.SaveCookie;
61
import org.openide.cookies.SaveCookie;
61
import org.openide.util.*;
62
import org.openide.util.*;
62
import org.openide.util.actions.Presenter;
63
import org.openide.util.actions.Presenter;
Lines 182-188 Link Here
182
        
183
        
183
        private JCheckBoxMenuItem getMenuItem() {
184
        private JCheckBoxMenuItem getMenuItem() {
184
            if (menuItem == null) {
185
            if (menuItem == null) {
185
                menuItem = new JCheckBoxMenuItem((String)getValue(Action.NAME), state);
186
                menuItem = new JCheckBoxMenuItem("", state);
187
                Actions.setMenuText(menuItem, (String)getValue(Action.NAME), false);
186
                //#45940 - hardwiring the shortcut UI since the actual shortcut processignb is also
188
                //#45940 - hardwiring the shortcut UI since the actual shortcut processignb is also
187
                // hardwired in AbstractTabViewDisplayerUI class.
189
                // hardwired in AbstractTabViewDisplayerUI class.
188
                // later this should be probably made customizable?
190
                // later this should be probably made customizable?
(-)a/core.windows/src/org/netbeans/core/windows/actions/Bundle.properties (-10 / +6 lines)
Lines 55-77 Link Here
55
CTL_UndockWindowAction_Dock=Doc&k Window
55
CTL_UndockWindowAction_Dock=Doc&k Window
56
56
57
# ActionUtils.CloseAllDocumentsAction
57
# ActionUtils.CloseAllDocumentsAction
58
LBL_CloseAllDocumentsAction=Close All Documents
58
LBL_CloseAllDocumentsAction=Close &All Documents
59
# ActionUtils.AutoHideWindowAction
59
# ActionUtils.AutoHideWindowAction
60
LBL_AutoHideWindowAction=Minimize Window
60
LBL_AutoHideWindowAction=M&inimize Window
61
# ActionUtils.CloseWindowAction
62
LBL_CloseWindowAction=Close Window
63
# ActionUtils.CloseAllButThisAction
64
LBL_CloseAllButThisAction=Close Other Documents
65
# ActionUtils.SaveDocumentAction
61
# ActionUtils.SaveDocumentAction
66
LBL_SaveDocumentAction=Save Document
62
LBL_SaveDocumentAction=&Save Document
67
# ActionUtils.CloneDocumentAction
63
# ActionUtils.CloneDocumentAction
68
LBL_CloneDocumentAction=Clone Document
64
LBL_CloneDocumentAction=C&lone Document
69
# CloseAllButThisAction
65
# CloseAllButThisAction
70
CTL_CloseAllButThisAction=Close Other Docu&ments
66
CTL_CloseAllButThisAction=Close Other Docu&ments
71
67
72
# MaximizeWindowAction
68
# MaximizeWindowAction
73
CTL_MaximizeWindowAction=Maximi&ze Window
69
CTL_MaximizeWindowAction=Maximi&ze Window
74
CTL_UnmaximizeWindowAction=Restore Window
70
CTL_UnmaximizeWindowAction=&Restore Window
75
71
76
# DocumentsAction
72
# DocumentsAction
77
CTL_DocumentsAction=&Documents...
73
CTL_DocumentsAction=&Documents...
Lines 90-96 Link Here
90
CTL_ResetWindows=Reset &Windows
86
CTL_ResetWindows=Reset &Windows
91
CTL_ReloadWindows=Reload Windows
87
CTL_ReloadWindows=Reload Windows
92
88
93
LBL_ToggleWindowTransparencyAction=Transparent Window
89
LBL_ToggleWindowTransparencyAction=&Transparent Window
94
LBL_WindowTransparencyHint=Press and hold [Ctrl+NumPad 0] key to make minimized window transparent.
90
LBL_WindowTransparencyHint=Press and hold [Ctrl+NumPad 0] key to make minimized window transparent.
95
91
96
# Properties
92
# Properties
(-)a/core.windows/src/org/netbeans/core/windows/actions/CloseAllButThisAction.java (-2 / +2 lines)
Lines 89-96 Link Here
89
        this.isContext = isContext;
89
        this.isContext = isContext;
90
        //Include the name in the label for the popup menu - it may be clicked over
90
        //Include the name in the label for the popup menu - it may be clicked over
91
        //a component that is not selected
91
        //a component that is not selected
92
        putValue(Action.NAME, NbBundle.getMessage(ActionUtils.class,
92
        putValue(Action.NAME, NbBundle.getMessage(CloseAllButThisAction.class,
93
        "LBL_CloseAllButThisAction")); //NOI18N
93
            "CTL_CloseAllButThisAction")); //NOI18N
94
        
94
        
95
    }
95
    }
96
96
(-)a/core.windows/src/org/netbeans/core/windows/actions/CloseWindowAction.java (-2 / +1 lines)
Lines 86-93 Link Here
86
        tc = topcomp;
86
        tc = topcomp;
87
        //Include the name in the label for the popup menu - it may be clicked over
87
        //Include the name in the label for the popup menu - it may be clicked over
88
        //a component that is not selected
88
        //a component that is not selected
89
        putValue(Action.NAME, NbBundle.getMessage(ActionUtils.class,
89
        putValue(Action.NAME, NbBundle.getMessage(CloseWindowAction.class, "CTL_CloseWindowAction")); //NOI18N
90
        "LBL_CloseWindowAction")); //NOI18N
91
        if( WindowManagerImpl.getInstance().isEditorTopComponent(tc) ) {
90
        if( WindowManagerImpl.getInstance().isEditorTopComponent(tc) ) {
92
            setEnabled(Switches.isEditorTopComponentClosingEnabled() && Switches.isClosingEnabled(tc));
91
            setEnabled(Switches.isEditorTopComponentClosingEnabled() && Switches.isClosingEnabled(tc));
93
        } else {
92
        } else {
(-)a/core.windows/src/org/netbeans/core/windows/actions/MaximizeWindowAction.java (-2 / +2 lines)
Lines 171-177 Link Here
171
        ModeImpl activeMode = (ModeImpl)wm.findMode(active);
171
        ModeImpl activeMode = (ModeImpl)wm.findMode(active);
172
        if (activeMode == null || !Switches.isTopComponentMaximizationEnabled() || !Switches.isMaximizationEnabled(active)) {
172
        if (activeMode == null || !Switches.isTopComponentMaximizationEnabled() || !Switches.isMaximizationEnabled(active)) {
173
            String label = NbBundle.getMessage(MaximizeWindowAction.class, "CTL_MaximizeWindowAction"); //NOI18N
173
            String label = NbBundle.getMessage(MaximizeWindowAction.class, "CTL_MaximizeWindowAction"); //NOI18N
174
            putValue(Action.NAME, (isPopup ? Actions.cutAmpersand(label) : label));
174
            putValue(Action.NAME, label);
175
            setEnabled(false);
175
            setEnabled(false);
176
            return;
176
            return;
177
        }
177
        }
Lines 192-198 Link Here
192
        } else {
192
        } else {
193
            label = NbBundle.getMessage(MaximizeWindowAction.class, "CTL_UnmaximizeWindowAction");
193
            label = NbBundle.getMessage(MaximizeWindowAction.class, "CTL_UnmaximizeWindowAction");
194
        }
194
        }
195
        putValue(Action.NAME, (isPopup ? Actions.cutAmpersand(label) : label));
195
        putValue(Action.NAME, label);
196
        
196
        
197
        setEnabled(activeMode != null /*&& activeMode.getKind() != Constants.MODE_KIND_SLIDING*/);
197
        setEnabled(activeMode != null /*&& activeMode.getKind() != Constants.MODE_KIND_SLIDING*/);
198
    }
198
    }
(-)a/openide.awt/apichanges.xml (+16 lines)
Lines 50-55 Link Here
50
<apidef name="awt">AWT API</apidef>
50
<apidef name="awt">AWT API</apidef>
51
</apidefs>
51
</apidefs>
52
<changes>
52
<changes>
53
    <change id="mnemonics.in.popup">
54
        <api name="awt"/>
55
        <summary>Turn on Mnemonics in Popup Menus</summary>
56
        <version major="7" minor="37"/>
57
        <date day="14" month="6" year="2011"/>
58
        <author login="jtulach"/>
59
        <compatibility addition="yes" binary="compatible" deletion="no" semantic="compatible"/>
60
        <description>
61
            <p>
62
                New branding key for applications built on top of NetBeans
63
                Platform to <a href="@TOP@architecture-summary.html#property-USE_MNEMONICS">
64
                turn mnemonics in popup menus on</a>. 
65
            </p>
66
        </description>
67
        <issue number="184891"/>
68
    </change>
53
    <change id="ActionRegistration.menuOrPopupText">
69
    <change id="ActionRegistration.menuOrPopupText">
54
        <api name="awt"/>
70
        <api name="awt"/>
55
        <summary>New attributes (popupText, menuText) in @ActionRegistration annotation</summary>
71
        <summary>New attributes (popupText, menuText) in @ActionRegistration annotation</summary>
(-)a/openide.awt/arch.xml (+10 lines)
Lines 468-473 Link Here
468
   <li>
468
   <li>
469
    <api name="popupText" category="stable" type="export" group="property" url="@TOP@/org/openide/awt/Actions.html#connect(javax.swing.JMenuItem,%20javax.swing.Action,%20boolean)"/>
469
    <api name="popupText" category="stable" type="export" group="property" url="@TOP@/org/openide/awt/Actions.html#connect(javax.swing.JMenuItem,%20javax.swing.Action,%20boolean)"/>
470
   </li>
470
   </li>
471
   <li> 
472
    <api name="USE_MNEMONICS" category="stable" type="export" group="property">
473
        There is a way to enable mnemonics in popup menu items created via
474
        <a href="@TOP@/org/openide/awt/Actions.html">Actions</a> factory methods
475
        in your own application build on top of NetBeans Platform.
476
        Just provide branding for <code>org/openide/awt/Bundle.properties</code>
477
        file and modify <code>USE_MNEMONICS=always</code>. Other possible values
478
        of this key include <code>default</code>, <code>never</code> or <code>always</code>.
479
     </api>
480
    </li>
471
  </ul>
481
  </ul>
472
 </answer>
482
 </answer>
473
483
(-)a/openide.awt/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.openide.awt
2
OpenIDE-Module: org.openide.awt
3
OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties
4
AutoUpdate-Essential-Module: true
4
AutoUpdate-Essential-Module: true
5
OpenIDE-Module-Specification-Version: 7.35
5
OpenIDE-Module-Specification-Version: 7.37
6
6
(-)a/openide.awt/src/org/openide/awt/Actions.java (+8 lines)
Lines 273-278 Link Here
273
    */
273
    */
274
    @Deprecated
274
    @Deprecated
275
    public static void setMenuText(AbstractButton item, String text, boolean useMnemonic) {
275
    public static void setMenuText(AbstractButton item, String text, boolean useMnemonic) {
276
        String msg = NbBundle.getMessage(Actions.class, "USE_MNEMONICS"); // NOI18N
277
        if ("always".equals(msg)) { // NOI18N
278
            useMnemonic = true;
279
        } else if ("never".equals(msg)) { // NOI18N
280
            useMnemonic = false;
281
        } else {
282
            assert "default".equals(msg); // NOI18N 
283
        }
276
        if (useMnemonic) {
284
        if (useMnemonic) {
277
            Mnemonics.setLocalizedText(item, text);
285
            Mnemonics.setLocalizedText(item, text);
278
        } else {
286
        } else {
(-)a/openide.awt/src/org/openide/awt/Bundle.properties (+4 lines)
Lines 120-122 Link Here
120
Print=&Print...
120
Print=&Print...
121
View=View
121
View=View
122
Close=Close
122
Close=Close
123
124
125
# either: default, never or always
126
USE_MNEMONICS=default

Return to bug 184891