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

(-)core/ui/src/org/netbeans/core/ui/warmup/ContextMenuWarmUpTask.java (-2 / +2 lines)
Lines 38-45 Link Here
38
    public void run() {
38
    public void run() {
39
        // For first context menu.
39
        // For first context menu.
40
        org.openide.actions.ActionManager.getDefault().getContextActions();
40
        org.openide.actions.ActionManager.getDefault().getContextActions();
41
        new org.openide.awt.JPopupMenuPlus();
41
//        new org.openide.awt.JPopupMenuPlus();
42
        new org.openide.awt.JInlineMenu();
42
//        new org.openide.awt.JInlineMenu();
43
        new javax.swing.JMenuItem();
43
        new javax.swing.JMenuItem();
44
44
45
        // #30676 ToolsAction popup warm up.
45
        // #30676 ToolsAction popup warm up.
(-)editor/nbproject/project.properties (-1 / +1 lines)
Lines 9-15 Link Here
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
10
# Microsystems, Inc. All Rights Reserved.
10
# Microsystems, Inc. All Rights Reserved.
11
11
12
spec.version.base=1.22.0
12
spec.version.base=1.22.1
13
is.autoload=true
13
is.autoload=true
14
14
15
javadoc.arch=${basedir}/arch/arch-editor.xml
15
javadoc.arch=${basedir}/arch/arch-editor.xml
(-)editor/nbproject/project.xml (-2 / +2 lines)
Lines 39-45 Link Here
39
                    <build-prerequisite/>
39
                    <build-prerequisite/>
40
                    <compile-dependency/>
40
                    <compile-dependency/>
41
                    <run-dependency>
41
                    <run-dependency>
42
                        <specification-version>6.2</specification-version>
42
                        <specification-version>6.4</specification-version>
43
                    </run-dependency>
43
                    </run-dependency>
44
                </dependency>
44
                </dependency>
45
                <dependency>
45
                <dependency>
Lines 71-77 Link Here
71
                    <build-prerequisite/>
71
                    <build-prerequisite/>
72
                    <compile-dependency/>
72
                    <compile-dependency/>
73
                    <run-dependency>
73
                    <run-dependency>
74
                        <specification-version>6.2</specification-version>
74
                        <specification-version>6.5</specification-version>
75
                    </run-dependency>
75
                    </run-dependency>
76
                </dependency>
76
                </dependency>
77
                <dependency>
77
                <dependency>
(-)editor/src/org/netbeans/modules/editor/NbCodeFoldingAction.java (-1 / +12 lines)
Lines 18-23 Link Here
18
import javax.swing.Action;
18
import javax.swing.Action;
19
import javax.swing.ActionMap;
19
import javax.swing.ActionMap;
20
import javax.swing.ImageIcon;
20
import javax.swing.ImageIcon;
21
import javax.swing.JComponent;
21
import javax.swing.JEditorPane;
22
import javax.swing.JEditorPane;
22
import javax.swing.JMenu;
23
import javax.swing.JMenu;
23
import javax.swing.JMenuItem;
24
import javax.swing.JMenuItem;
Lines 34-39 Link Here
34
import org.openide.loaders.DataObject;
35
import org.openide.loaders.DataObject;
35
import org.openide.util.HelpCtx;
36
import org.openide.util.HelpCtx;
36
import org.openide.util.NbBundle;
37
import org.openide.util.NbBundle;
38
import org.openide.awt.DynamicMenuContent;
37
import org.openide.util.actions.Presenter;
39
import org.openide.util.actions.Presenter;
38
import org.openide.util.actions.SystemAction;
40
import org.openide.util.actions.SystemAction;
39
41
Lines 102-108 Link Here
102
    }
104
    }
103
    
105
    
104
    
106
    
105
    public class CodeFoldsMenu extends JMenu{
107
    public class CodeFoldsMenu extends JMenu implements DynamicMenuContent {
106
        public CodeFoldsMenu(){
108
        public CodeFoldsMenu(){
107
            super();
109
            super();
108
        }
110
        }
Lines 113-118 Link Here
113
            //setIcon(new ImageIcon(org.openide.util.Utilities.loadImage("org/netbeans/modules/editor/resources/empty.gif"))); //NOI18N
115
            //setIcon(new ImageIcon(org.openide.util.Utilities.loadImage("org/netbeans/modules/editor/resources/empty.gif"))); //NOI18N
114
            //#40585 fix end
116
            //#40585 fix end
115
            org.openide.awt.Mnemonics.setLocalizedText(this, s);
117
            org.openide.awt.Mnemonics.setLocalizedText(this, s);
118
        }
119
120
        public JComponent[] getMenuPresenters() {
121
            return new JComponent[] { this };
122
        }
123
        
124
        public JComponent[] synchMenuPresenters(JComponent[] items) {
125
            getPopupMenu();
126
            return items;
116
        }
127
        }
117
        
128
        
118
        public JPopupMenu getPopupMenu(){
129
        public JPopupMenu getPopupMenu(){
(-)editor/src/org/netbeans/modules/editor/NbEditorKit.java (-30 / +37 lines)
Lines 13-18 Link Here
13
13
14
package org.netbeans.modules.editor;
14
package org.netbeans.modules.editor;
15
15
16
import java.awt.Component;
16
import java.awt.event.ActionEvent;
17
import java.awt.event.ActionEvent;
17
import java.awt.event.ItemEvent;
18
import java.awt.event.ItemEvent;
18
import java.awt.event.ItemListener;
19
import java.awt.event.ItemListener;
Lines 21-26 Link Here
21
import java.util.Iterator;
22
import java.util.Iterator;
22
import java.util.List;
23
import java.util.List;
23
import java.util.Map;
24
import java.util.Map;
25
import javax.swing.JComponent;
24
import javax.swing.JMenu;
26
import javax.swing.JMenu;
25
import javax.swing.JMenuItem;
27
import javax.swing.JMenuItem;
26
import javax.swing.JPopupMenu;
28
import javax.swing.JPopupMenu;
Lines 34-39 Link Here
34
import org.netbeans.editor.ActionFactory;
36
import org.netbeans.editor.ActionFactory;
35
import org.netbeans.editor.EditorUI;
37
import org.netbeans.editor.EditorUI;
36
import org.netbeans.editor.ext.ExtKit;
38
import org.netbeans.editor.ext.ExtKit;
39
import org.openide.awt.DynamicMenuContent;
37
import org.openide.util.actions.SystemAction;
40
import org.openide.util.actions.SystemAction;
38
import org.openide.util.actions.Presenter;
41
import org.openide.util.actions.Presenter;
39
import org.openide.actions.UndoAction;
42
import org.openide.actions.UndoAction;
Lines 308-321 Link Here
308
311
309
            if (action != null) {
312
            if (action != null) {
310
                JMenuItem item = createLocalizedMenuItem(action);
313
                JMenuItem item = createLocalizedMenuItem(action);
311
                item.setEnabled(action.isEnabled());
314
                if (item instanceof DynamicMenuContent) {
312
                Object helpID = action.getValue ("helpID"); // NOI18N
315
                    Component[] cmps = ((DynamicMenuContent)item).getMenuPresenters();
313
                if (helpID != null && (helpID instanceof String)) {
316
                    for (int i = 0; i < cmps.length; i++) {
314
                    item.putClientProperty ("HelpID", helpID); // NOI18N
317
                        popupMenu.add(cmps[i]);
318
                    }
319
                } else {
320
                    item.setEnabled(action.isEnabled());
321
                    Object helpID = action.getValue ("helpID"); // NOI18N
322
                    if (helpID != null && (helpID instanceof String)) {
323
                        item.putClientProperty ("HelpID", helpID); // NOI18N
324
                    }
325
                    assignAccelerator(component.getKeymap(), action, item);
326
                    debugPopupMenuItem(item, action);
327
                    popupMenu.add(item);
315
                }
328
                }
316
                assignAccelerator(component.getKeymap(), action, item);
317
                debugPopupMenuItem(item, action);
318
                popupMenu.add(item);
319
            }
329
            }
320
        }
330
        }
321
        
331
        
Lines 326-346 Link Here
326
            if (tc != null) {
336
            if (tc != null) {
327
                // Add all the actions
337
                // Add all the actions
328
                Action[] actions = tc.getActions();
338
                Action[] actions = tc.getActions();
329
                for (int i = 0; i < actions.length; i++) {
339
                Component[] comps = org.openide.util.Utilities.actionsToPopup(actions, contextLookup).getComponents();
330
                    Action action = actions[i];
340
                for (int i = 0; i < comps.length; i++) {
331
                    action = translateContextLookupAction(contextLookup, action);
341
                    popupMenu.add(comps[i]);
332
                    
333
                    if (action != null){
334
                        JMenuItem item = createLocalizedMenuItem(action);
335
                        assignAccelerator(
336
                            (Keymap)Lookup.getDefault().lookup(Keymap.class),
337
                            action,
338
                            item
339
                        );
340
341
                        debugPopupMenuItem(item, action);
342
                        popupMenu.add(item);
343
                    }
344
                }
342
                }
345
            }
343
            }
346
        }
344
        }
Lines 369-382 Link Here
369
                        action = translateContextLookupAction(contextLookup, action);
367
                        action = translateContextLookupAction(contextLookup, action);
370
                        
368
                        
371
                        JMenuItem item = createLocalizedMenuItem(action);
369
                        JMenuItem item = createLocalizedMenuItem(action);
372
                        if (item != null) { // && !(item instanceof JMenu))
370
                        if (item != null) {
373
                            assignAccelerator(
371
                            if (item instanceof DynamicMenuContent) {
374
                                 (Keymap)Lookup.getDefault().lookup(Keymap.class),
372
                                Component[] cmps = ((DynamicMenuContent)item).getMenuPresenters();
375
                                 action,
373
                                for (int i = 0; i < cmps.length; i++) {
376
                                 item
374
                                    popupMenu.add(cmps[i]);
377
                            );
375
                                }
378
                            debugPopupMenuItem(item, action);
376
                            } else {
379
                            popupMenu.add(item);
377
                                if (!(item instanceof JMenu)) {
378
                                    assignAccelerator(
379
                                         (Keymap)Lookup.getDefault().lookup(Keymap.class),
380
                                         action,
381
                                         item
382
                                    );
383
                                }
384
                                debugPopupMenuItem(item, action);
385
                                popupMenu.add(item);
386
                            }
380
                        }
387
                        }
381
388
382
                        return;
389
                        return;
(-)i18n/src/org/netbeans/modules/i18n/I18nGroupAction.java (+4 lines)
Lines 152-157 Link Here
152
            Actions.setMenuText(this, action.getName(), isMenu);
152
            Actions.setMenuText(this, action.getName(), isMenu);
153
            
153
            
154
            this.isMenu = isMenu;
154
            this.isMenu = isMenu;
155
            if (isMenu) {
156
                // mkleint doens't seem to be dynamic at all, just set it for main menu..
157
                createMenuItems();
158
            }
155
        }
159
        }
156
160
157
        /** Creates <code>LazyPopup</code> menu item. */
161
        /** Creates <code>LazyPopup</code> menu item. */
(-)ide/applemenu/src/org/netbeans/modules/applemenu/layer.xml (-2 / +1 lines)
Lines 15-21 Link Here
15
<filesystem>
15
<filesystem>
16
    <!-- Hide menu items that belong on Apple's app menu -->
16
    <!-- Hide menu items that belong on Apple's app menu -->
17
   <folder name="Menu">
17
   <folder name="Menu">
18
<!--
18
19
        <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.core.Bundle" />
19
        <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.core.Bundle" />
20
        <folder name="File">
20
        <folder name="File">
21
            <file name="org-netbeans-core-actions-SystemExit.instance_hidden"/>
21
            <file name="org-netbeans-core-actions-SystemExit.instance_hidden"/>
Lines 29-35 Link Here
29
            <file name="org-netbeans-core-actions-AboutAction.instance_hidden"/>
29
            <file name="org-netbeans-core-actions-AboutAction.instance_hidden"/>
30
        </folder>
30
        </folder>
31
        
31
        
32
-->        
33
    </folder>
32
    </folder>
34
    
33
    
35
    <folder name="Shortcuts">
34
    <folder name="Shortcuts">
(-)ide/launcher/unix/netbeans (+3 lines)
Lines 65-75 Link Here
65
65
66
nbexec="$progdir"/../platform5/lib/nbexec
66
nbexec="$progdir"/../platform5/lib/nbexec
67
67
68
# in case of macosx, the apple.laf.useScreenMenuBar property should be ideally in the Info.plist file
69
# but it doesn't get propagated into the executed java VM. 
68
case "`uname`" in
70
case "`uname`" in
69
    Darwin*)
71
    Darwin*)
70
        "$nbexec" \
72
        "$nbexec" \
71
            --jdkhome "$netbeans_jdkhome" \
73
            --jdkhome "$netbeans_jdkhome" \
72
            -J-Dcom.apple.mrj.application.apple.menu.about.name=NetBeans \
74
            -J-Dcom.apple.mrj.application.apple.menu.about.name=NetBeans \
75
            -J-Dapple.laf.useScreenMenuBar=true \
73
            -J-Xdock:name=NetBeans \
76
            -J-Xdock:name=NetBeans \
74
            "-J-Xdock:icon=$progdir/../nb4.1/netbeans.icns" \
77
            "-J-Xdock:icon=$progdir/../nb4.1/netbeans.icns" \
75
            --branding nb \
78
            --branding nb \
(-)installer/mac/Info.plist (-2 / +12 lines)
Lines 1-6 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
2
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
3
<plist version="0.9">
3
                       "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4
<plist version="1.0">
4
  <dict>
5
  <dict>
5
6
6
    <key>CFBundleName</key>
7
    <key>CFBundleName</key>
Lines 26-30 Link Here
26
    
27
    
27
    <key>CFBundleIconFile</key>
28
    <key>CFBundleIconFile</key>
28
    <string>@ICONFILENAME@</string>
29
    <string>@ICONFILENAME@</string>
30
31
    <key>Java</key>
32
    <dict>
33
      <key>Properties</key>
34
      <dict>
35
        <key>apple.laf.useScreenMenuBar</key>
36
        <string>true</string>
37
      </dict>
38
    </dict> 
29
  </dict>
39
  </dict>
30
</plist>
40
</plist>
(-)javadoc/manifest.mf (-1 / +1 lines)
Lines 4-10 Link Here
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javadoc/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javadoc/Bundle.properties
5
OpenIDE-Module-Layer: org/netbeans/modules/javadoc/resources/mf-layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/javadoc/resources/mf-layer.xml
6
OpenIDE-Module-Requires: org.openide.modules.InstalledFileLocator
6
OpenIDE-Module-Requires: org.openide.modules.InstalledFileLocator
7
OpenIDE-Module-Specification-Version: 1.15
7
OpenIDE-Module-Specification-Version: 1.16
8
8
9
Name: org/netbeans/modules/javadoc/comments/AutoCommentAction.class
9
Name: org/netbeans/modules/javadoc/comments/AutoCommentAction.class
10
OpenIDE-Module-Class: Action
10
OpenIDE-Module-Class: Action
(-)javadoc/nbproject/project.xml (-2 / +2 lines)
Lines 56-62 Link Here
56
                    <build-prerequisite/>
56
                    <build-prerequisite/>
57
                    <compile-dependency/>
57
                    <compile-dependency/>
58
                    <run-dependency>
58
                    <run-dependency>
59
                        <specification-version>6.2</specification-version>
59
                        <specification-version>6.4</specification-version>
60
                    </run-dependency>
60
                    </run-dependency>
61
                </dependency>
61
                </dependency>
62
                <dependency>
62
                <dependency>
Lines 88-94 Link Here
88
                    <build-prerequisite/>
88
                    <build-prerequisite/>
89
                    <compile-dependency/>
89
                    <compile-dependency/>
90
                    <run-dependency>
90
                    <run-dependency>
91
                        <specification-version>6.2</specification-version>
91
                        <specification-version>6.5</specification-version>
92
                    </run-dependency>
92
                    </run-dependency>
93
                </dependency>
93
                </dependency>
94
                <dependency>
94
                <dependency>
(-)javadoc/src/org/netbeans/modules/javadoc/search/IndexOverviewAction.java (-9 / +21 lines)
Lines 21-26 Link Here
21
import java.util.*;
21
import java.util.*;
22
import java.lang.ref.Reference;
22
import java.lang.ref.Reference;
23
import java.lang.ref.WeakReference;
23
import java.lang.ref.WeakReference;
24
import javax.swing.JComponent;
24
import javax.swing.JMenu;
25
import javax.swing.JMenu;
25
import javax.swing.JMenuItem;
26
import javax.swing.JMenuItem;
26
import org.openide.ErrorManager;
27
import org.openide.ErrorManager;
Lines 31-36 Link Here
31
import org.openide.filesystems.FileSystem;
32
import org.openide.filesystems.FileSystem;
32
import org.openide.util.HelpCtx;
33
import org.openide.util.HelpCtx;
33
import org.openide.util.NbBundle;
34
import org.openide.util.NbBundle;
35
import org.openide.awt.DynamicMenuContent;
34
import org.openide.util.actions.SystemAction;
36
import org.openide.util.actions.SystemAction;
35
import org.openide.util.actions.Presenter;
37
import org.openide.util.actions.Presenter;
36
38
Lines 73-79 Link Here
73
     * list of filesystems and finding their titles. When the popup for it
75
     * list of filesystems and finding their titles. When the popup for it
74
     * is created, it will create submenuitems for each available index.
76
     * is created, it will create submenuitems for each available index.
75
     */
77
     */
76
    private final class IndexMenu extends JMenu implements HelpCtx.Provider {
78
    private final class IndexMenu extends JMenu implements HelpCtx.Provider, DynamicMenuContent {
77
        
79
        
78
        private int itemHash = 0;
80
        private int itemHash = 0;
79
        
81
        
Lines 86-100 Link Here
86
            return IndexOverviewAction.this.getHelpCtx();
88
            return IndexOverviewAction.this.getHelpCtx();
87
        }
89
        }
88
        
90
        
89
        public void addNotify() {
91
        public JComponent[] getMenuPresenters() {
90
            if (err.isLoggable(ErrorManager.INFORMATIONAL)) {
92
            getPopupMenu2();
91
                err.log("addNotify");
93
            return new JComponent[] {this};
92
            }
94
        }
93
            super.addNotify();
95
        
94
            IndexBuilder.getDefault();
96
        public JComponent[] synchMenuPresenters(JComponent[] items) {
97
            System.out.println("synchronizing doc root.");
98
            getPopupMenu2();
99
            return items;
95
        }
100
        }
96
        
101
        
97
        public JPopupMenu getPopupMenu() {
102
//        public void addNotify() {
103
//            if (err.isLoggable(ErrorManager.INFORMATIONAL)) {
104
//                err.log("addNotify");
105
//            }
106
//            super.addNotify();
107
//            IndexBuilder.getDefault();
108
//        }
109
        
110
        public void getPopupMenu2() {
98
            List[] data = IndexBuilder.getDefault().getIndices();
111
            List[] data = IndexBuilder.getDefault().getIndices();
99
            int newHash = computeDataHash(data);
112
            int newHash = computeDataHash(data);
100
            if (newHash != itemHash) {
113
            if (newHash != itemHash) {
Lines 122-128 Link Here
122
                    add(dummy);
135
                    add(dummy);
123
                }
136
                }
124
            }
137
            }
125
            return super.getPopupMenu();
126
        }
138
        }
127
        
139
        
128
        private int computeDataHash(List[] data) {
140
        private int computeDataHash(List[] data) {
(-)junit/manifest.mf (-1 / +1 lines)
Lines 1-7 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.junit/2
2
OpenIDE-Module: org.netbeans.modules.junit/2
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junit/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junit/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.15
4
OpenIDE-Module-Specification-Version: 2.16
5
OpenIDE-Module-Layer: org/netbeans/modules/junit/resources/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/junit/resources/layer.xml
6
OpenIDE-Module-Java-Dependencies: Java > 1.4
6
OpenIDE-Module-Java-Dependencies: Java > 1.4
7
7
(-)junit/nbproject/project.xml (-2 / +2 lines)
Lines 112-118 Link Here
112
                    <build-prerequisite/>
112
                    <build-prerequisite/>
113
                    <compile-dependency/>
113
                    <compile-dependency/>
114
                    <run-dependency>
114
                    <run-dependency>
115
                        <specification-version>6.2</specification-version>
115
                        <specification-version>6.4</specification-version>
116
                    </run-dependency>
116
                    </run-dependency>
117
                </dependency>
117
                </dependency>
118
                <dependency>
118
                <dependency>
Lines 144-150 Link Here
144
                    <build-prerequisite/>
144
                    <build-prerequisite/>
145
                    <compile-dependency/>
145
                    <compile-dependency/>
146
                    <run-dependency>
146
                    <run-dependency>
147
                        <specification-version>6.2</specification-version>
147
                        <specification-version>6.5</specification-version>
148
                    </run-dependency>
148
                    </run-dependency>
149
                </dependency>
149
                </dependency>
150
                <dependency>
150
                <dependency>
(-)junit/src/org/netbeans/modules/junit/TestsAction.java (-28 / +16 lines)
Lines 86-94 Link Here
86
                SystemAction.get (OpenTestAction.class),
86
                SystemAction.get (OpenTestAction.class),
87
            };
87
            };
88
88
89
    private JMenu menuitem;
89
    public JMenuItem getMenuPresenter () {
90
    public JMenuItem getMenuPresenter () {
90
        JMenu menu = new LazyMenu (getName ());
91
        if (menuitem == null) {
91
        return menu;
92
            // mkleint: just ignore theh lazy conructuction and do everything up front.
93
            // simplifies code and works on macosx
94
            menuitem = new JMenu (getName ());
95
            // Conventional not to set an icon here.
96
            for (int i = 0; i < grouped.length; i++) {
97
                SystemAction action = grouped[i];
98
                if (action == null) {
99
                    menuitem.addSeparator ();
100
                } else if (action instanceof Presenter.Menu) {
101
                    menuitem.add (((Presenter.Menu) action).getMenuPresenter());
102
                }
103
            }
104
        }
105
        return menuitem;
92
    }
106
    }
93
107
94
    public JMenuItem getPopupPresenter () {
108
    public JMenuItem getPopupPresenter () {
Lines 116-147 Link Here
116
            }
130
            }
117
        }
131
        }
118
        return toolbar;
132
        return toolbar;
119
    }
120
121
    /**
122
     * Lazy menu which when added to its parent menu, will begin creating the
123
     * list of submenu items and finding their presenters.
124
     */
125
    private final class LazyMenu extends JMenu {
126
        
127
        public LazyMenu(String name) {
128
            super(name);
129
        }
130
                
131
        public JPopupMenu getPopupMenu() {
132
            if (getItemCount() == 0) {
133
                for (int i = 0; i < grouped.length; i++) {
134
                    SystemAction action = grouped[i];
135
                    if (action == null) {
136
                        addSeparator ();
137
                    } else if (action instanceof Presenter.Menu) {
138
                        add (((Presenter.Menu) action).getMenuPresenter ());
139
                    }
140
                }
141
            }
142
            return super.getPopupMenu();
143
        }
144
        
145
    }
133
    }
146
134
147
}
135
}
(-)openide/actions/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.actions
2
OpenIDE-Module: org.openide.actions
3
OpenIDE-Module-Specification-Version: 6.2
3
OpenIDE-Module-Specification-Version: 6.3
4
OpenIDE-Module-Localizing-Bundle: org/openide/actions/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/actions/Bundle.properties
5
5
(-)openide/actions/nbproject/project.xml (-2 / +2 lines)
Lines 22-28 Link Here
22
                    <build-prerequisite/>
22
                    <build-prerequisite/>
23
                    <compile-dependency/>
23
                    <compile-dependency/>
24
                    <run-dependency>
24
                    <run-dependency>
25
                        <specification-version>6.2</specification-version>
25
                        <specification-version>6.4</specification-version>
26
                    </run-dependency>
26
                    </run-dependency>
27
                </dependency>
27
                </dependency>
28
                <dependency>
28
                <dependency>
Lines 38-44 Link Here
38
                    <build-prerequisite/>
38
                    <build-prerequisite/>
39
                    <compile-dependency/>
39
                    <compile-dependency/>
40
                    <run-dependency>
40
                    <run-dependency>
41
                        <specification-version>6.2</specification-version>
41
                        <specification-version>6.5</specification-version>
42
                    </run-dependency>
42
                    </run-dependency>
43
                </dependency>
43
                </dependency>
44
                <dependency>
44
                <dependency>
(-)openide/actions/src/org/openide/actions/NewAction.java (-1 / +1 lines)
Lines 128-134 Link Here
128
    public javax.swing.JMenuItem getMenuPresenter() {
128
    public javax.swing.JMenuItem getMenuPresenter() {
129
        return new Actions.SubMenu(this, model, false);
129
        return new Actions.SubMenu(this, model, false);
130
    }
130
    }
131
131
    
132
    public javax.swing.JMenuItem getPopupPresenter() {
132
    public javax.swing.JMenuItem getPopupPresenter() {
133
        return new Actions.SubMenu(this, model, true);
133
        return new Actions.SubMenu(this, model, true);
134
    }
134
    }
(-)openide/actions/src/org/openide/actions/PasteAction.java (-6 / +2 lines)
Lines 61-67 Link Here
61
* <code>getValue ("delegates")</code> than those actions are offered as
61
* <code>getValue ("delegates")</code> than those actions are offered as
62
* subelements by the paste action presenter.
62
* subelements by the paste action presenter.
63
*/
63
*/
64
public final class PasteAction extends CallbackSystemAction {
64
public final class PasteAction extends CallbackSystemAction  {
65
    /** Imlementation of ActSubMenuInt */
65
    /** Imlementation of ActSubMenuInt */
66
    private static ActSubMenuModel globalModel;
66
    private static ActSubMenuModel globalModel;
67
67
Lines 98-108 Link Here
98
    public javax.swing.JMenuItem getMenuPresenter() {
98
    public javax.swing.JMenuItem getMenuPresenter() {
99
        return new Actions.SubMenu(this, model(), false);
99
        return new Actions.SubMenu(this, model(), false);
100
    }
100
    }
101
101
    
102
    public javax.swing.JMenuItem getPopupPresenter() {
103
        return new Actions.SubMenu(this, model(), true);
104
    }
105
106
    public Action createContextAwareInstance(Lookup actionContext) {
102
    public Action createContextAwareInstance(Lookup actionContext) {
107
        return new DelegateAction(this, actionContext);
103
        return new DelegateAction(this, actionContext);
108
    }
104
    }
(-)openide/actions/src/org/openide/actions/ToolsAction.java (-64 / +75 lines)
Lines 14-20 Link Here
14
14
15
import org.openide.actions.ActionManager;
15
import org.openide.actions.ActionManager;
16
import org.openide.awt.Actions;
16
import org.openide.awt.Actions;
17
import org.openide.awt.JInlineMenu;
18
import org.openide.util.ContextAwareAction;
17
import org.openide.util.ContextAwareAction;
19
import org.openide.util.HelpCtx;
18
import org.openide.util.HelpCtx;
20
import org.openide.util.Lookup;
19
import org.openide.util.Lookup;
Lines 27-32 Link Here
27
26
28
import javax.swing.*;
27
import javax.swing.*;
29
import javax.swing.event.*;
28
import javax.swing.event.*;
29
import org.openide.awt.DynamicMenuContent;
30
30
31
31
32
/** A "meta-action" that displays (in a submenu) a list of enabled actions provided by modules.
32
/** A "meta-action" that displays (in a submenu) a list of enabled actions provided by modules.
Lines 194-200 Link Here
194
194
195
    /** Inline menu that watches model changes only when really needed.
195
    /** Inline menu that watches model changes only when really needed.
196
     */
196
     */
197
    private static final class Inline extends JInlineMenu implements PropertyChangeListener, Runnable {
197
    private static final class Inline extends JMenuItem implements DynamicMenuContent {
198
        static final long serialVersionUID = 2269006599727576059L;
198
        static final long serialVersionUID = 2269006599727576059L;
199
199
200
        /** timestamp of the beginning of the last regeneration */
200
        /** timestamp of the beginning of the last regeneration */
Lines 205-268 Link Here
205
205
206
        Inline(Action toolsAction) {
206
        Inline(Action toolsAction) {
207
            this.toolsAction = toolsAction;
207
            this.toolsAction = toolsAction;
208
            putClientProperty("hack.preShowUpdater", this);
208
//            putClientProperty("hack.preShowUpdater", this);
209
        }
209
        }
210
210
211
        /** By calling this method, our parent notifies us we've to be keep
211
//        /** By calling this method, our parent notifies us we've to be keep
212
         * updated, so we start listening on SystemAction changes, and
212
//         * updated, so we start listening on SystemAction changes, and
213
         * schedule updating Runnable imediately.
213
//         * schedule updating Runnable imediately.
214
         */
214
//         */
215
        public void addNotify() {
215
//        public void addNotify() {
216
            // We were not notified by our parent, too bad
216
////            // We were not notified by our parent, too bad
217
            if (timestamp != gl().getTimestamp()) {
217
////            if (timestamp != gl().getTimestamp()) {
218
                SwingUtilities.invokeLater(this);
218
////                SwingUtilities.invokeLater(this);
219
            }
219
////            }
220
220
////
221
            gl().addPropertyChangeListener(this);
221
////            gl().addPropertyChangeListener(this);
222
            super.addNotify();
222
//            super.addNotify();
223
        }
223
//        }
224
224
//
225
        /** By calling this method, our parent notifies us we don't have
225
//        /** By calling this method, our parent notifies us we don't have
226
         * to be up-to-date more, so we switch to lazy mode and discard any
226
//         * to be up-to-date more, so we switch to lazy mode and discard any
227
         * pending updates.
227
//         * pending updates.
228
         */
228
//         */
229
        public void removeNotify() {
229
//        public void removeNotify() {
230
            gl().removePropertyChangeListener(this);
230
////            gl().removePropertyChangeListener(this);
231
            super.removeNotify();
231
//            super.removeNotify();
232
        }
232
//        }
233
233
234
        /** Change of model.
234
//        /** Change of model.
235
        */
235
//        */
236
        public void propertyChange(PropertyChangeEvent ev) {
236
//        public void propertyChange(PropertyChangeEvent ev) {
237
            String prop = ev.getPropertyName();
237
//            String prop = ev.getPropertyName();
238
238
//
239
            if ((prop == null) || prop.equals(G.PROP_STATE)) {
239
//            if ((prop == null) || prop.equals(G.PROP_STATE)) {
240
                SwingUtilities.invokeLater(this);
240
//                SwingUtilities.invokeLater(this);
241
            }
241
//            }
242
        }
242
//        }
243
243
        
244
        /** Runs the update */
244
        public JComponent[] synchMenuPresenters(JComponent[] items) {
245
        public void run() {
246
            if (timestamp == gl().getTimestamp()) {
245
            if (timestamp == gl().getTimestamp()) {
247
                return;
246
                return items;
248
            }
247
            }
249
250
            // generate directly list of menu items
248
            // generate directly list of menu items
251
            List l = generate(toolsAction, true);
249
            List l = generate(toolsAction, true);
252
            setMenuItems((JMenuItem[]) l.toArray(new JMenuItem[l.size()]));
253
            timestamp = gl().getTimestamp();
250
            timestamp = gl().getTimestamp();
251
            return (JMenuItem[]) l.toArray(new JMenuItem[l.size()]);
254
        }
252
        }
253
        
254
        
255
        public JComponent[] getMenuPresenters() {
256
            return synchMenuPresenters(new JComponent[0]);
257
        }        
255
    }
258
    }
256
259
257
    //--------------------------------------------------
260
    //--------------------------------------------------
258
261
259
    /** Inline menu that is either empty or contains one submenu.*/
262
    /** Inline menu that is either empty or contains one submenu.*/
260
    private static final class Popup extends JInlineMenu implements Runnable {
263
    private static final class Popup extends JMenuItem implements DynamicMenuContent {
261
        static final long serialVersionUID = 2269006599727576059L;
264
        static final long serialVersionUID = 2269006599727576059L;
262
265
263
        /** sub menu */
266
        /** sub menu */
264
        private JMenu menu = new MyMenu();
267
        private JMenu menu = new MyMenu();
265
        private boolean inited = false;
266
268
267
        /** Associated tools action. */
269
        /** Associated tools action. */
268
        private Action toolsAction;
270
        private Action toolsAction;
Lines 272-298 Link Here
272
            this.toolsAction = toolsAction;
274
            this.toolsAction = toolsAction;
273
            HelpCtx.setHelpIDString(menu, ToolsAction.class.getName());
275
            HelpCtx.setHelpIDString(menu, ToolsAction.class.getName());
274
276
275
            // This can be probably swapped as the popup is short time entity and our hack
277
//            // This can be probably swapped as the popup is short time entity and our hack
276
            // will be called just once and very early after the constructor.
278
//            // will be called just once and very early after the constructor.
277
            //            run();
279
//            //            run();
278
            putClientProperty("hack.preShowUpdater", this);
280
//            putClientProperty("hack.preShowUpdater", this);
279
        }
281
        }
280
282
281
        public void addNotify() {
283
//        public void addNotify() {
282
            if (!inited) { // should not happen
284
//            if (!inited) { // should not happen
283
                SwingUtilities.invokeLater(this); // too late to do it here
285
//                SwingUtilities.invokeLater(this); // too late to do it here
284
            }
286
//            }
285
287
//
286
            super.addNotify();
288
//            super.addNotify();
287
        }
289
//        }
288
290
        
289
        /** Runs the update */
291
        public JComponent[] synchMenuPresenters(JComponent[] items) {
290
        public void run() {
292
            return gl().isPopupEnabled(toolsAction) ? new JMenuItem[] { menu } : new JMenuItem[0];
291
            if (!inited) {
293
        }
292
                setMenuItems(gl().isPopupEnabled(toolsAction) ? new JMenuItem[] { menu } : new JMenuItem[0]);
294
        
293
                inited = true;
295
        
294
            }
296
        public JComponent[] getMenuPresenters() {
295
        }
297
            return synchMenuPresenters(new JComponent[0]);
298
        }                
299
300
//        /** Runs the update */
301
//        public void run() {
302
//            if (!inited) {
303
//                setMenuItems(gl().isPopupEnabled(toolsAction) ? new JMenuItem[] { menu } : new JMenuItem[0]);
304
//                inited = true;
305
//            }
306
//        }
296
307
297
        /** A special menu that will properly update its submenu before posting */
308
        /** A special menu that will properly update its submenu before posting */
298
        private class MyMenu extends org.openide.awt.JMenuPlus implements PopupMenuListener {
309
        private class MyMenu extends org.openide.awt.JMenuPlus implements PopupMenuListener {
(-)openide/awt/apichanges.xml (-3 / +28 lines)
Lines 17-22 Link Here
17
<apidef name="awt">AWT API</apidef>
17
<apidef name="awt">AWT API</apidef>
18
</apidefs>
18
</apidefs>
19
<changes>
19
<changes>
20
    <change id="DynamicMenuContent-added">
21
      <api name="awt"/>
22
      <summary>DynamicMenuContent interface added</summary>
23
      <version major="6" minor="5"/>
24
      <date day="12" month="6" year="2005"/>
25
      <author login="mkleint"/>
26
      <compatibility addition="yes" modification="yes" binary="compatible" source="compatible" semantic="incompatible" deprecation="yes" deletion="no"/>
27
      <description>
28
        In order to support MacOSX top menus and to fix problems with deprecated <code>JInlineMenu</code>, this new
29
        interface was added that allows to handle dynamic content in <a href="@org-openide-util@/org/openide/util/actions/Presenter.Menu.html">Presenter.Menu</a>
30
 and <a href="@org-openide-util@/org/openide/util/actions/Presenter.Popup.html">Presenter.Popup</a>.
31
        If the instance returned by Presenter.Menu/Popup is an instance of <a href="@TOP@/org/openide/awt/DynamicMenuContent.html">DynamicMenuContent</a>, it's methods are
32
        consulted when creating/updating the menu.
33
        <code>JInlineMenu</code> rewritten to use this new approach in a backward compatible way, however changed during visibility of the menu are not supported.
34
        <code>JMenuPlus</code> and <code>JPopupMenuPlus</code> are deprecated and behave exactly like their standard Swing counterparts.
35
        <code>Actions.Submenu</code> and <code>Actions.MenuItem</code> now implement <code>DynamicMenuContent</code> interface.
36
      </description>
37
      <class package="org.openide.awt" name="DynamicMenuContent"/>
38
      <class package="org.openide.awt" name="JInlineMenu"/>
39
      <class package="org.openide.awt" name="JMenuPlus"/>
40
      <class package="org.openide.awt" name="JPopupMenuPlus"/>
41
      <class package="org.openide.awt" name="Actions"/>
42
      <issue number="35827"/>
43
    </change>    
44
    
20
    <change id="statuslineelementprovider-added">
45
    <change id="statuslineelementprovider-added">
21
        <api name="awt"/>
46
        <api name="awt"/>
22
        <summary>Make IDE's status bar pluggable.</summary>
47
        <summary>Make IDE's status bar pluggable.</summary>
Lines 48-54 Link Here
48
    </change>
73
    </change>
49
    
74
    
50
    <change>
75
    <change>
51
      <api name="util"/>
76
      <api name="awt"/>
52
      <summary>HTML browser factory deprecated, use lookup instead</summary>
77
      <summary>HTML browser factory deprecated, use lookup instead</summary>
53
      <date day="8" month="3" year="2001"/>
78
      <date day="8" month="3" year="2001"/>
54
      <compatibility modification="yes" deprecation="yes" binary="compatible" source="compatible" semantic="compatible" addition="no" deletion="no"/>
79
      <compatibility modification="yes" deprecation="yes" binary="compatible" source="compatible" semantic="compatible" addition="no" deletion="no"/>
Lines 61-67 Link Here
61
      <class package="org.openide.awt" name="HtmlBrowser"/>
86
      <class package="org.openide.awt" name="HtmlBrowser"/>
62
    </change>
87
    </change>
63
   <change>
88
   <change>
64
      <api name="util"/>
89
      <api name="awt"/>
65
      <summary>Display names for toolbars</summary>
90
      <summary>Display names for toolbars</summary>
66
      <date day="8" month="12" year="2000"/>
91
      <date day="8" month="12" year="2000"/>
67
      <compatibility addition="yes" binary="compatible" source="compatible" semantic="compatible" deprecation="no" deletion="no" modification="no"/>
92
      <compatibility addition="yes" binary="compatible" source="compatible" semantic="compatible" deprecation="no" deletion="no" modification="no"/>
Lines 85-91 Link Here
85
      <class package="org.openide.awt" name="Toolbar"/>
110
      <class package="org.openide.awt" name="Toolbar"/>
86
    </change>
111
    </change>
87
    <change>
112
    <change>
88
      <api name="util"/>
113
      <api name="awt"/>
89
      <summary>Cleaned up accidentally public members of <code>Toolbar</code>
114
      <summary>Cleaned up accidentally public members of <code>Toolbar</code>
90
      </summary>
115
      </summary>
91
      <date day="19" month="4" year="2000"/>
116
      <date day="19" month="4" year="2000"/>
(-)openide/awt/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.awt
2
OpenIDE-Module: org.openide.awt
3
OpenIDE-Module-Specification-Version: 6.4
3
OpenIDE-Module-Specification-Version: 6.5
4
OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties
5
5
(-)openide/awt/nbproject/project.properties (+1 lines)
Lines 15-18 Link Here
15
#javadoc.arch=${basedir}/../arch/arch-openide-awt.xml
15
#javadoc.arch=${basedir}/../arch/arch-openide-awt.xml
16
#javadoc.docfiles=${basedir}/api/doc
16
#javadoc.docfiles=${basedir}/api/doc
17
#javadoc.apichanges=${basedir}/api/apichanges.xml
17
#javadoc.apichanges=${basedir}/api/apichanges.xml
18
javadoc.apichanges=${basedir}/apichanges.xml
18
19
(-)openide/awt/nbproject/project.xml (-1 / +1 lines)
Lines 22-28 Link Here
22
                    <build-prerequisite/>
22
                    <build-prerequisite/>
23
                    <compile-dependency/>
23
                    <compile-dependency/>
24
                    <run-dependency>
24
                    <run-dependency>
25
                        <specification-version>6.2</specification-version>
25
                        <specification-version>6.4</specification-version>
26
                    </run-dependency>
26
                    </run-dependency>
27
                </dependency>
27
                </dependency>
28
            </module-dependencies>
28
            </module-dependencies>
(-)openide/awt/src/org/netbeans/modules/openide/awt/DefaultAWTBridge.java (-1 / +9 lines)
Lines 17-22 Link Here
17
import javax.swing.Action;
17
import javax.swing.Action;
18
import javax.swing.JMenuItem;
18
import javax.swing.JMenuItem;
19
import org.openide.awt.Actions;
19
import org.openide.awt.Actions;
20
import org.openide.awt.DynamicMenuContent;
20
import org.openide.util.actions.BooleanStateAction;
21
import org.openide.util.actions.BooleanStateAction;
21
import org.openide.util.actions.SystemAction;
22
import org.openide.util.actions.SystemAction;
22
23
Lines 64-69 Link Here
64
    
65
    
65
    public javax.swing.JPopupMenu createEmptyPopup() {
66
    public javax.swing.JPopupMenu createEmptyPopup() {
66
        return new org.openide.awt.JPopupMenuPlus ();
67
        return new org.openide.awt.JPopupMenuPlus ();
67
    }    
68
    }  
69
    
70
    public Component[] convertComponents(Component comp) {
71
         if (comp instanceof DynamicMenuContent) {
72
            return ((DynamicMenuContent)comp).getMenuPresenters();
73
         }
74
         return new Component[] {comp};
75
    }
68
    
76
    
69
}
77
}
(-)openide/awt/src/org/openide/awt/Actions.java (-300 / +140 lines)
Lines 12-19 Link Here
12
 */
12
 */
13
package org.openide.awt;
13
package org.openide.awt;
14
14
15
import java.util.List;
15
import org.openide.ErrorManager;
16
import org.openide.ErrorManager;
16
import org.openide.awt.Mnemonics;
17
import org.openide.util.HelpCtx;
17
import org.openide.util.HelpCtx;
18
import org.openide.util.Lookup;
18
import org.openide.util.Lookup;
19
import org.openide.util.Utilities;
19
import org.openide.util.Utilities;
Lines 26-33 Link Here
26
import java.beans.*;
26
import java.beans.*;
27
27
28
import java.lang.ref.WeakReference;
28
import java.lang.ref.WeakReference;
29
29
import java.util.ArrayList;
30
import java.util.HashMap;
31
import java.util.Hashtable;
30
import java.util.Hashtable;
32
import java.util.Iterator;
31
import java.util.Iterator;
33
import java.util.Map;
32
import java.util.Map;
Lines 126-135 Link Here
126
    public static void connect(JMenuItem item, Action action, boolean popup) {
125
    public static void connect(JMenuItem item, Action action, boolean popup) {
127
        Bridge b = new MenuBridge(item, action, popup);
126
        Bridge b = new MenuBridge(item, action, popup);
128
127
129
        // Would make more sense to defer this until addNotify, but for some reason (why?)
128
        if (item instanceof Actions.MenuItem) {
130
        // if you do that, various menus start out compacted and poorly painted.
129
            ((Actions.MenuItem)item).setBridge(b);
130
        }
131
        b.updateState(null);
131
        b.updateState(null);
132
133
        if (!popup) {
132
        if (!popup) {
134
            // #39508 fix.
133
            // #39508 fix.
135
            setMenuActionConnection(item, action);
134
            setMenuActionConnection(item, action);
Lines 349-360 Link Here
349
    * @param action the action to update
348
    * @param action the action to update
350
    */
349
    */
351
    static void updateKey(JMenuItem item, Action action) {
350
    static void updateKey(JMenuItem item, Action action) {
352
        if (item instanceof SubMenu || !(item instanceof JMenu)) {
351
        if (!(item instanceof JMenu)) {
353
            if (item instanceof SubMenu && !((SubMenu) item).useAccel()) {
352
            item.setAccelerator((KeyStroke) action.getValue(Action.ACCELERATOR_KEY));
354
                item.setAccelerator(null);
355
            } else {
356
                item.setAccelerator((KeyStroke) action.getValue(Action.ACCELERATOR_KEY));
357
            }
358
        }
353
        }
359
    }
354
    }
360
355
Lines 937-970 Link Here
937
        }
932
        }
938
    }
933
    }
939
934
940
    /** Sub menu bridge.
935
936
    /** The class that listens to the menu item selections and forwards it to the
937
     * action class via the performAction() method.
938
     */
939
    private static class ISubActionListener implements java.awt.event.ActionListener {
940
        int index;
941
        SubMenuModel support;
942
        
943
        public ISubActionListener(int index, SubMenuModel support) {
944
            this.index = index;
945
            this.support = support;
946
        }
947
        
948
        /** called when a user clicks on this menu item */
949
        public void actionPerformed(ActionEvent e) {
950
            support.performActionAt(index);
951
        }
952
    }
953
954
    /** Sub menu bridge 2.
941
    */
955
    */
942
    private static final class SubMenuBridge extends MenuBridge implements ChangeListener {
956
    private static final class SubMenuBridge extends MenuBridge implements ChangeListener, DynamicMenuContent {
943
        /** model to obtain subitems from */
957
        /** model to obtain subitems from */
944
        private SubMenuModel model;
958
        private SubMenuModel model;
945
959
        private List currentOnes;
946
        /** submenu */
960
        private JMenuItem single;
947
        private SubMenu menu;
961
        private JMenu multi;
948
949
        /** Constructor.
962
        /** Constructor.
950
        */
963
        */
951
        public SubMenuBridge(SubMenu item, Action action, SubMenuModel model, boolean popup) {
964
        public SubMenuBridge(JMenuItem one, JMenu more, Action action, SubMenuModel model, boolean popup) {
952
            super(item, action, popup);
965
            super(one, action, popup);
953
            prepareMargins(item, action);
966
            single = one;
954
967
            multi = more;
955
            menu = item;
968
            setMenuText(multi, (String)action.getValue(Action.NAME), popup);
969
            prepareMargins(one, action);
970
            prepareMargins(more, action);
971
            currentOnes = new ArrayList();
956
            this.model = model;
972
            this.model = model;
957
        }
973
            single.addActionListener(new ISubActionListener(0, model));
958
974
//            model.addChangeListener(this);
959
        public void addNotify() {
975
//            checkVisibility();
960
            super.addNotify();
961
            model.addChangeListener(this);
962
            generateSubMenu();
963
        }
964
965
        public void removeNotify() {
966
            model.removeChangeListener(this);
967
            super.removeNotify();
968
        }
976
        }
969
977
970
        /** Called when model changes. Regenerates the model.
978
        /** Called when model changes. Regenerates the model.
Lines 974-1070 Link Here
974
            if (!EventQueue.isDispatchThread()) {
982
            if (!EventQueue.isDispatchThread()) {
975
                new IllegalStateException("This must happen in the event thread!").printStackTrace();
983
                new IllegalStateException("This must happen in the event thread!").printStackTrace();
976
            }
984
            }
977
978
            // change in keys or in submenu model
985
            // change in keys or in submenu model
979
            generateSubMenu();
986
//            checkVisibility();
980
        }
987
        }
988
        
989
        public void updateState(String changedProperty) {
990
            super.updateState(changedProperty);
991
//            checkVisibility();
992
        }        
981
993
982
        /** Regenerates the menu
994
        
983
        */
995
        
984
        private void generateSubMenu() {
996
        public JComponent[] getMenuPresenters() {
985
            boolean shouldUpdate = false;
997
            return synchMenuPresenters(null);
986
998
        }
987
            try {
999
        
988
                menu.removeAll();
1000
        public JComponent[] synchMenuPresenters(JComponent[] items) {
989
1001
            currentOnes.clear();
990
                int cnt = model.getCount();
1002
            int cnt = model.getCount();
991
1003
            
992
                if (cnt != menu.previousCount) {
1004
            if (cnt == 0) {
993
                    // update UI
1005
                updateState(null);
994
                    shouldUpdate = true;
1006
                currentOnes.add(single);
995
                }
1007
                // menu disabled
996
1008
                single.setEnabled(false);
997
                // in all cases remeber the previous
1009
            } else if (cnt == 1) {
998
                menu.previousCount = cnt;
1010
                updateState(null);
999
1011
                currentOnes.add(single);
1000
                // remove if there is an previous listener
1012
                single.setEnabled(true);
1001
                if (menu.oneItemListener != null) {
1013
                // generate without submenu
1002
                    menu.removeActionListener(menu.oneItemListener);
1014
                HelpCtx help = model.getHelpCtx(0);
1003
                }
1015
                associateHelp(single, (help == null) ? findHelp(action) : help);
1004
1016
            } else {
1005
                if (cnt == 0) {
1017
                currentOnes.add(multi);
1006
                    // menu disabled
1018
                multi.removeAll();
1007
                    menu.setEnabled(false);
1019
                //TODO
1008
1020
                Mnemonics.setLocalizedText(multi, (String)action.getValue(Action.NAME));
1009
                    if (menu.oneItemListener != null) {
1021
            
1010
                        menu.removeActionListener(menu.oneItemListener);
1022
                boolean addSeparator = false;
1011
                        menu.oneItemListener = null;
1023
                int count = model.getCount();
1012
                    }
1024
            
1013
1025
                for (int i = 0; i < count; i++) {
1014
                    return;
1026
                    String label = model.getLabel(i);
1015
                } else {
1027
                
1016
                    menu.setEnabled(true);
1028
                    //          MenuShortcut shortcut = support.getMenuShortcut(i);
1017
1029
                    if (label == null) {
1018
                    // go on
1030
                        addSeparator = multi.getItemCount() > 0;
1019
                }
1031
                    } else {
1020
1032
                        if (addSeparator) {
1021
                if (cnt == 1) {
1033
                            multi.addSeparator();
1022
                    // generate without submenu
1034
                            addSeparator = false;
1023
                    menu.addActionListener(menu.oneItemListener = new ISubActionListener(0, model));
1035
                        }
1024
1036
                    
1025
                    HelpCtx help = model.getHelpCtx(0);
1037
                        //       if (shortcut == null)
1026
                    associateHelp(menu, (help == null) ? findHelp(action) : help);
1038
                        // (Dafe) changed to support mnemonics in item labels
1027
                } else {
1039
                        JMenuItem item = new JMenuItem();
1028
                    boolean addSeparator = false;
1040
                        Mnemonics.setLocalizedText(item, label);
1029
                    int count = model.getCount();
1041
                    
1030
1042
                        // attach the shortcut to the first item
1031
                    for (int i = 0; i < count; i++) {
1043
                        if (i == 0) {
1032
                        String label = model.getLabel(i);
1044
                            updateKey(item, action);
1033
1034
                        //          MenuShortcut shortcut = support.getMenuShortcut(i);
1035
                        if (label == null) {
1036
                            addSeparator = menu.getItemCount() > 0;
1037
                        } else {
1038
                            if (addSeparator) {
1039
                                menu.addSeparator();
1040
                                addSeparator = false;
1041
                            }
1042
1043
                            //       if (shortcut == null)
1044
                            // (Dafe) changed to support mnemonics in item labels
1045
                            JMenuItem item = new JMenuItem();
1046
                            Mnemonics.setLocalizedText(item, label);
1047
1048
                            // attach the shortcut to the first item
1049
                            if (i == 0) {
1050
                                updateKey(item, action);
1051
                            }
1052
1053
                            item.addActionListener(new ISubActionListener(i, model));
1054
1055
                            HelpCtx help = model.getHelpCtx(i);
1056
                            associateHelp(item, (help == null) ? findHelp(action) : help);
1057
                            menu.add(item);
1058
                        }
1045
                        }
1046
                    
1047
                        item.addActionListener(new ISubActionListener(i, model));
1048
                    
1049
                        HelpCtx help = model.getHelpCtx(i);
1050
                        associateHelp(item, (help == null) ? findHelp(action) : help);
1051
                        multi.add(item);
1059
                    }
1052
                    }
1060
1053
                
1061
                    associateHelp(menu, findHelp(action));
1054
                    associateHelp(multi, findHelp(action));
1062
                }
1063
            } finally {
1064
                if (shouldUpdate) {
1065
                    menu.updateUI();
1066
                }
1055
                }
1056
                multi.setEnabled(true);
1067
            }
1057
            }
1058
            return (JMenuItem[])currentOnes.toArray(new JMenuItem[currentOnes.size()]);
1059
            
1068
        }
1060
        }
1069
1061
1070
        private void associateHelp(JComponent comp, HelpCtx help) {
1062
        private void associateHelp(JComponent comp, HelpCtx help) {
Lines 1074-1099 Link Here
1074
                HelpCtx.setHelpIDString(comp, null);
1066
                HelpCtx.setHelpIDString(comp, null);
1075
            }
1067
            }
1076
        }
1068
        }
1077
1078
        /** The class that listens to the menu item selections and forwards it to the
1079
        * action class via the performAction() method.
1080
        */
1081
        private static class ISubActionListener implements java.awt.event.ActionListener {
1082
            int index;
1083
            SubMenuModel support;
1084
1085
            public ISubActionListener(int index, SubMenuModel support) {
1086
                this.index = index;
1087
                this.support = support;
1088
            }
1089
1090
            /** called when a user clicks on this menu item */
1091
            public void actionPerformed(ActionEvent e) {
1092
                support.performActionAt(index);
1093
            }
1094
        }
1095
    }
1069
    }
1096
1097
    //
1070
    //
1098
    //
1071
    //
1099
    // The presenter classes
1072
    // The presenter classes
Lines 1104-1112 Link Here
1104
     * Extension of Swing menu item with connection to
1077
     * Extension of Swing menu item with connection to
1105
     * system actions.
1078
     * system actions.
1106
     */
1079
     */
1107
    public static class MenuItem extends javax.swing.JMenuItem {
1080
    public static class MenuItem extends javax.swing.JMenuItem implements DynamicMenuContent {
1108
        static final long serialVersionUID = -21757335363267194L;
1081
        static final long serialVersionUID = -21757335363267194L;
1109
1082
        private Actions.Bridge bridge;
1110
        /** Constructs a new menu item with the specified label
1083
        /** Constructs a new menu item with the specified label
1111
        * and no keyboard shortcut and connects it to the given SystemAction.
1084
        * and no keyboard shortcut and connects it to the given SystemAction.
1112
        * @param aAction the action to which this menu item should be connected
1085
        * @param aAction the action to which this menu item should be connected
Lines 1124-1129 Link Here
1124
        public MenuItem(Action aAction, boolean useMnemonic) {
1097
        public MenuItem(Action aAction, boolean useMnemonic) {
1125
            Actions.connect(this, aAction, !useMnemonic);
1098
            Actions.connect(this, aAction, !useMnemonic);
1126
        }
1099
        }
1100
        
1101
        void setBridge(Actions.Bridge br) {
1102
            bridge = br;
1103
        }
1104
1105
        public JComponent[] synchMenuPresenters(JComponent[] items) {
1106
            return getMenuPresenters();
1107
        }
1108
1109
        public JComponent[] getMenuPresenters() {
1110
            if (bridge != null) {
1111
                bridge.updateState(null);
1112
            }
1113
            return new JComponent[] {this};
1114
        }
1115
        
1127
    }
1116
    }
1128
1117
1129
    /** CheckboxMenuItem extends the java.awt.CheckboxMenuItem and adds
1118
    /** CheckboxMenuItem extends the java.awt.CheckboxMenuItem and adds
Lines 1207-1231 Link Here
1207
            return this.getPreferredSize();
1196
            return this.getPreferredSize();
1208
        }
1197
        }
1209
    }
1198
    }
1199
    
1210
1200
1211
    /** SubMenu provides easy way of displaying submenu items based on
1201
    /** SubMenu provides easy way of displaying submenu items based on
1212
    * SubMenuModel.
1202
    * SubMenuModel.
1213
    */
1203
    */
1214
    public static class SubMenu extends org.openide.awt.JMenuPlus {
1204
    public static class SubMenu extends JMenu implements DynamicMenuContent {
1215
        static final long serialVersionUID = -4446966671302959091L;
1205
        static final long serialVersionUID = -4446966671302959091L;
1216
1206
1217
        /** number of previous sub items */
1218
        int previousCount = -1;
1219
1220
        /** listener to remove from this menu or <CODE>null</CODE> */
1221
        ActionListener oneItemListener;
1222
1223
        /** The keystroke which acts as the menu's accelerator.
1224
         * This menu can have an accelerator! */
1225
        private KeyStroke accelerator;
1226
1227
        /** The model of the submenu used in menuitem generation */
1228
        private SubMenuModel subModel;
1229
        private SubMenuBridge bridge;
1207
        private SubMenuBridge bridge;
1230
1208
1231
        /** Constructs a new ActMenuItem with the specified label
1209
        /** Constructs a new ActMenuItem with the specified label
Lines 1257-1416 Link Here
1257
        * @param popup whether this is a popup menu
1235
        * @param popup whether this is a popup menu
1258
        */
1236
        */
1259
        public SubMenu(Action aAction, SubMenuModel model, boolean popup) {
1237
        public SubMenu(Action aAction, SubMenuModel model, boolean popup) {
1260
            subModel = model;
1238
            bridge = new SubMenuBridge(new JMenuItem(), this, aAction, model, popup);
1261
            bridge = new SubMenuBridge(this, aAction, model, popup);
1262
1239
1263
            // set at least the name to have reasonable bounds
1240
            // set at least the name to have reasonable bounds
1264
            bridge.updateState(Action.NAME);
1241
            bridge.updateState(Action.NAME);
1265
        }
1242
        }
1266
1243
        
1267
        // Fixes #26619
1244
        public JComponent[] getMenuPresenters() {
1268
1245
            return bridge.getMenuPresenters();
1269
        /** Overriden to finish initialization of the bridge on demand
1246
        }
1270
         */
1247
        
1271
        public void addNotify() {
1248
        public JComponent[] synchMenuPresenters(JComponent[] items) {
1272
            super.addNotify();
1249
            return bridge.synchMenuPresenters(items);
1273
            bridge.updateState(null);
1274
1275
            // Empty SubMenu -> disable
1276
            if (subModel.getCount() == 0) {
1277
                setEnabled(false);
1278
            }
1279
        }
1280
1281
        // XXX Overriding processKeyBinding is not a nice solution, used as
1282
        // a last resort here to fix the bug.
1283
        // #9331. Missed accelerator for Paste action.
1284
1285
        /** Overrides superclass method.
1286
         * If it has accelerator delegates processing of it to the first item. */
1287
        protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
1288
            // If it is as accelerator process the doClick binding to the
1289
            // first sub-item.
1290
            if (ks.equals(accelerator)) {
1291
                // Use first item if there is one.
1292
                Component[] cs = getMenuComponents();
1293
1294
                if ((cs.length > 0) && cs[0] instanceof JComponent) {
1295
                    JComponent comp = (JComponent) cs[0];
1296
1297
                    ActionMap am = comp.getActionMap();
1298
1299
                    if ((am != null) && comp.isEnabled()) {
1300
                        Action action = am.get("doClick"); // NOI18N
1301
1302
                        if (action != null) {
1303
                            return SwingUtilities.notifyAction(action, ks, e, comp, e.getModifiers());
1304
                        }
1305
                    }
1306
1307
                    return false;
1308
                }
1309
            }
1310
1311
            return super.processKeyBinding(ks, e, condition, pressed);
1312
        }
1313
1314
        // XXX #11048. Ugly patch.
1315
        // This works for the cases when this menu is in 'menu'
1316
        // (not popup), the popup is handled by NbPopupMenuUI hack. This same
1317
        // method for popup wouldn't work since NbPopupMenuUI automatically
1318
        // passes focus to sub-menu.
1319
1320
        /** Overrides superclass method. Adds a hack for KB menu invokation
1321
         * when this <code>JMenu</code> needs to act like <code>JMenuItem</code>. */
1322
        public void processKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager m) {
1323
            if (
1324
                (getMenuComponentCount() <= 1) &&
1325
                    java.util.Arrays.equals(path, MenuSelectionManager.defaultManager().getSelectedPath()) &&
1326
                    ((e.getKeyCode() == KeyEvent.VK_ENTER) || (e.getKeyCode() == KeyEvent.VK_SPACE))
1327
            ) {
1328
                ActionListener ac = oneItemListener;
1329
1330
                if (ac != null) {
1331
                    m.setSelectedPath(new MenuElement[0]);
1332
                    ac.actionPerformed(new ActionEvent(e.getSource(), 0, null));
1333
1334
                    return;
1335
                }
1336
            }
1337
1338
            super.processKeyEvent(e, path, m);
1339
        }
1340
1341
        /** Request for either MenuUI or MenuItemUI if the only one subitem should not
1342
        * use submenu.
1343
        */
1344
        public String getUIClassID() {
1345
            if (previousCount == 0) {
1346
                return "MenuItemUI"; // NOI18N
1347
            }
1348
1349
            return (previousCount == 1) ? "MenuItemUI" : "MenuUI"; // NOI18N
1350
        }
1351
1352
        boolean useAccel() {
1353
            return subModel.getCount() <= 1;
1354
        }
1355
1356
        /** Overrides superclass method to be able to have an accelerator. */
1357
        public void setAccelerator(KeyStroke keyStroke) {
1358
            KeyStroke oldAccelerator = accelerator;
1359
            this.accelerator = keyStroke;
1360
1361
            // Note: "accelerator" for the bean prop, not Action.ACCELERATOR_KEY == "AcceleratorKey"
1362
            firePropertyChange("accelerator", oldAccelerator, accelerator); // NOI18N
1363
        }
1364
1365
        /** Overrides superclass method to be able to have an accelerator. */
1366
        public KeyStroke getAccelerator() {
1367
            return this.accelerator;
1368
        }
1369
1370
        public void menuSelectionChanged(boolean isIncluded) {
1371
            if (previousCount <= 1) {
1372
                setArmed(isIncluded); // JMenuItem behaviour
1373
            } else {
1374
                if (isArmed() && !isIncluded) {
1375
                    setArmed(false);
1376
                }
1377
1378
                super.menuSelectionChanged(isIncluded);
1379
            }
1380
        }
1381
1382
        /** Menu cannot be selected when it represents MenuItem.
1383
        */
1384
        public void setSelected(boolean s) {
1385
            // disabled menu cannot be selected
1386
            if (isEnabled() || !s) {
1387
                super.setSelected(s);
1388
            }
1389
        }
1390
1391
        /** Seting menu to disabled also sets the item as not selected
1392
        */
1393
        public void setEnabled(boolean e) {
1394
            super.setEnabled(e);
1395
1396
            if (!e) {
1397
                super.setSelected(false);
1398
            }
1399
        }
1400
1401
        public void doClick(int pressTime) {
1402
            if (!isEnabled()) {
1403
                // do nothing if not enabled
1404
                return;
1405
            }
1406
1407
            if (oneItemListener != null) {
1408
                oneItemListener.actionPerformed(null);
1409
            } else {
1410
                super.doClick(pressTime);
1411
            }
1412
        }
1250
        }
1251
        
1413
    }
1252
    }
1253
1414
1254
1415
    private static class DisabledButtonFilter extends RGBImageFilter {
1255
    private static class DisabledButtonFilter extends RGBImageFilter {
1416
        DisabledButtonFilter() {
1256
        DisabledButtonFilter() {
(-)openide/awt/src/org/openide/awt/JInlineMenu.java (-229 / +238 lines)
Lines 23-53 Link Here
23
23
24
import javax.swing.*;
24
import javax.swing.*;
25
import javax.swing.event.*;
25
import javax.swing.event.*;
26
import org.openide.awt.DynamicMenuContent;
27
import org.openide.util.actions.Presenter;
26
28
27
29
28
/**
30
/**
29
 * Menu element that can contain other menu items. These items are then
31
 * Menu element that can contain other menu items. These items are then
30
 * displayed "inline". The JInlineMenu can be used to componse more menu items
32
 * displayed "inline". The JInlineMenu can be used to compose more menu items
31
 * into one that can be added/removed at once.
33
 * into one that can be added/removed at once.
32
 *
34
 *
33
 * @deprecated JInlineMenu is resizing itself after being displayed, this
35
 * @deprecated since 6.5 JInlineMenu is a simple implementation of DynamicMenuContent, it
34
 * behavior causes a lot of troubles for Swing/AWT on various platforms.  Very
36
 * doesn't update when visible and doesn't handle the separators itself anymore.
35
 * hard to be fixed.  Module developers should stop using this class.
36
 *
37
 *
37
 * @author Jan Jancura
38
 * @author Jan Jancura
38
 */
39
 */
39
public class JInlineMenu extends JMenuItem {
40
public class JInlineMenu extends JMenuItem implements DynamicMenuContent {
40
    /** generated Serialized Version UID */
41
    /** generated Serialized Version UID */
41
    static final long serialVersionUID = -2310488127953523571L;
42
    static final long serialVersionUID = -2310488127953523571L;
42
    private static final Icon BLANK_ICON = new ImageIcon(
43
    private static final Icon BLANK_ICON = new ImageIcon(
43
            Utilities.loadImage("org/openide/resources/actions/empty.gif")
44
            Utilities.loadImage("org/openide/resources/actions/empty.gif")
44
        ); // NOI18N            
45
        ); // NOI18N            
45
46
46
    /** north separator */
47
//    /** north separator */
47
    private JSeparator north = new JSeparator();
48
//    private JSeparator north = new JSeparator();
48
49
//
49
    /** south separator */
50
//    /** south separator */
50
    private JSeparator south = new JSeparator();
51
//    private JSeparator south = new JSeparator();
51
52
52
    /** Stores inner MenuItems added to outer menu. */
53
    /** Stores inner MenuItems added to outer menu. */
53
    private JComponent[] items = new JComponent[0];
54
    private JComponent[] items = new JComponent[0];
Lines 96-131 Link Here
96
97
97
        alignItems();
98
        alignItems();
98
99
99
        // tell the parent it is not up-to-date as well
100
//        // tell the parent it is not up-to-date as well
100
        Container parent = getParent();
101
//        Container parent = getParent();
101
102
//
102
        while (parent instanceof JInlineMenu) {
103
//        while (parent instanceof JInlineMenu) {
103
            ((JInlineMenu) parent).upToDate = false;
104
//            ((JInlineMenu) parent).upToDate = false;
104
            parent = parent.getParent();
105
//            parent = parent.getParent();
105
        }
106
//        }
106
107
//
107
        if (isShowing()) { // Ugly thing have happened - we're already visible
108
//        if (isShowing()) { // Ugly thing have happened - we're already visible
108
            SwingUtilities.invokeLater(new Updater());
109
//            SwingUtilities.invokeLater(new Updater());
109
        }
110
//        }
110
    }
111
    }
111
112
112
    /* This method is overriden so that this class now allow following
113
//    /* This method is overriden so that this class now allow following
113
     * pattern to be used:
114
//     * pattern to be used:
114
     *
115
//     *
115
     * (1) nm = new JInlineMenu();
116
//     * (1) nm = new JInlineMenu();
116
     * (2) nm.setMenuItems( ... some items ... );
117
//     * (2) nm.setMenuItems( ... some items ... );
117
     * (3) myJPopupMenu.add(nm);
118
//     * (3) myJPopupMenu.add(nm);
118
     *
119
//     *
119
     * While the old source required (1) (3) and (2)
120
//     * While the old source required (1) (3) and (2)
120
     */
121
//     */
121
    public void addNotify() { // addNotify it quite late to do anything, but we'll try
122
//    public void addNotify() { // addNotify it quite late to do anything, but we'll try
122
        super.addNotify();
123
//        super.addNotify();
123
124
//// we for sure don't want to update menu when it's visible, it's evil.
124
        if (!upToDate) {
125
////        if (!upToDate) {
125
            //System.err.println("InvokeLater-ing from addNotify()");
126
////            //System.err.println("InvokeLater-ing from addNotify()");
126
            SwingUtilities.invokeLater(new Updater());
127
////            SwingUtilities.invokeLater(new Updater());
127
        }
128
////        }
128
    }
129
//    }
129
130
130
    /** Overriden to return first non null icon of current items or null if
131
    /** Overriden to return first non null icon of current items or null if
131
     * all items has null icons.
132
     * all items has null icons.
Lines 165-263 Link Here
165
        }
166
        }
166
    }
167
    }
167
168
168
    static void prepareItemsInContainer(Container c) {
169
//    static void prepareItemsInContainer(Container c) {
169
        Component[] comps = c.getComponents();
170
//        Component[] comps = c.getComponents();
170
171
//
171
        for (int i = 0; i < comps.length; i++) {
172
//        for (int i = 0; i < comps.length; i++) {
172
            if (comps[i] instanceof JInlineMenu) {
173
//            if (comps[i] instanceof JInlineMenu) {
173
                ((JInlineMenu) comps[i]).doUpdate();
174
//                ((JInlineMenu) comps[i]).doUpdate();
174
            }
175
//            }
175
        }
176
//        }
176
    }
177
//    }
177
178
178
    private void doUpdate() {
179
//    private void doUpdate() {
179
        // Let the subclasses add their own update logic, done this
180
//        // Let the subclasses add their own update logic, done this
180
        // way because we want to go w/o API change for 3.4 on this topic
181
//        // way because we want to go w/o API change for 3.4 on this topic
181
        // when we're going to _solve_ this for 4.0
182
//        // when we're going to _solve_ this for 4.0
182
        Object prop = getClientProperty("hack.preShowUpdater");
183
//        Object prop = getClientProperty("hack.preShowUpdater");
183
184
//
184
        if (prop instanceof Runnable) {
185
//        if (prop instanceof Runnable) {
185
            ((Runnable) prop).run();
186
//            ((Runnable) prop).run();
186
        }
187
//        }
187
188
//
188
        updateContents();
189
//        updateContents();
189
    }
190
//    }
190
191
//
191
    /** This method is called only when in AWT, never in addNotify
192
//    /** This method is called only when in AWT, never in addNotify
192
     * so it is safe to operate with the parent menu content */
193
//     * so it is safe to operate with the parent menu content */
193
    private void updateContents() {
194
//    private void updateContents() {
194
        Container parent = getParent();
195
//        Container parent = getParent();
195
196
//
196
        if (!upToDate && (parent != null)) {
197
//        if (!upToDate && (parent != null)) {
197
            if (!(parent instanceof JInlineMenu)) {
198
//            if (!(parent instanceof JInlineMenu)) {
198
                // we're the highest JInlineMenu, do the update ourself
199
//                // we're the highest JInlineMenu, do the update ourself
199
                //call around all our subitems to prepare them
200
//                //call around all our subitems to prepare them
200
                for (int i = 0; i < items.length; i++) {
201
//                for (int i = 0; i < items.length; i++) {
201
                    Object prop = items[i].getClientProperty("hack.preShowUpdater");
202
//                    Object prop = items[i].getClientProperty("hack.preShowUpdater");
202
203
//
203
                    if (prop instanceof Runnable) {
204
//                    if (prop instanceof Runnable) {
204
                        ((Runnable) prop).run();
205
//                        ((Runnable) prop).run();
205
                    }
206
//                    }
206
                }
207
//                }
207
208
//
208
                removeItems();
209
//                removeItems();
209
                addItems();
210
//                addItems();
210
            }
211
//            }
211
212
//
212
            upToDate = true; // we've been processed
213
//            upToDate = true; // we've been processed
213
        }
214
//        }
214
    }
215
//    }
215
216
216
    /** Remove all current items.
217
//    /** Remove all current items.
217
    */
218
//    */
218
    private void removeItems() {
219
//    private void removeItems() {
219
        JComponent m = (JComponent) getParent();
220
//        JComponent m = (JComponent) getParent();
220
221
//
221
        if (m == null) {
222
//        if (m == null) {
222
            return; // Can't happen
223
//            return; // Can't happen
223
        }
224
//        }
224
225
//
225
        if (m instanceof JInlineMenu) {
226
//        if (m instanceof JInlineMenu) {
226
            // Delegate removing to parent JInlineMenu.
227
//            // Delegate removing to parent JInlineMenu.
227
            ((JInlineMenu) m).removeItems();
228
//            ((JInlineMenu) m).removeItems();
228
229
//
229
            return;
230
//            return;
230
        }
231
//        }
231
232
//
232
        // Remove all the items we've previously added.
233
//        // Remove all the items we've previously added.
233
        if (addedItems != null) {
234
//        if (addedItems != null) {
234
            java.util.Iterator it = addedItems.iterator();
235
//            java.util.Iterator it = addedItems.iterator();
235
236
//
236
            while (it.hasNext())
237
//            while (it.hasNext())
237
                m.remove((Component) it.next());
238
//                m.remove((Component) it.next());
238
        }
239
//        }
239
240
//
240
        // Remove also our separators
241
//        // Remove also our separators
241
        m.remove(north);
242
//        m.remove(north);
242
        m.remove(south);
243
//        m.remove(south);
243
244
//
244
        addedItems = null;
245
//        addedItems = null;
245
    }
246
//    }
246
247
247
    /** Gets all inline items including inline items from
248
//    /** Gets all inline items including inline items from
248
     * sub-<code>JInlineMenu</code>'s. Used only by parent
249
//     * sub-<code>JInlineMenu</code>'s. Used only by parent
249
     * <code>JInlineMenu</code>. */
250
//     * <code>JInlineMenu</code>. */
250
    private void getAllInlineItems(List its) {
251
//    private void getAllInlineItems(List its) {
251
        for (int i = 0; i < items.length; i++) {
252
//        for (int i = 0; i < items.length; i++) {
252
            Object item = items[i];
253
//            Object item = items[i];
253
254
//
254
            if (item instanceof JInlineMenu) {
255
//            if (item instanceof JInlineMenu) {
255
                ((JInlineMenu) item).getAllInlineItems(its);
256
//                ((JInlineMenu) item).getAllInlineItems(its);
256
            } else {
257
//            } else {
257
                its.add(item);
258
//                its.add(item);
258
            }
259
//            }
259
        }
260
//        }
260
    }
261
//    }
261
262
262
    /** Finds the index of a component in array of components.
263
    /** Finds the index of a component in array of components.
263
     * @return index or -1
264
     * @return index or -1
Lines 274-373 Link Here
274
        return -1;
275
        return -1;
275
    }
276
    }
276
277
277
    void addItems() {
278
//    void addItems() {
278
        JComponent m = (JComponent) getParent();
279
//        JComponent m = (JComponent) getParent();
279
280
//
280
        if (m == null) {
281
//        if (m == null) {
281
            return; // Can't happen
282
//            return; // Can't happen
282
        }
283
//        }
283
284
//
284
        boolean usedToBeContained = false;
285
//        boolean usedToBeContained = false;
285
286
//
286
        if (m instanceof JPopupMenu) {
287
//        if (m instanceof JPopupMenu) {
287
            usedToBeContained = JPopupMenuUtils.isPopupContained((JPopupMenu) m);
288
//            usedToBeContained = JPopupMenuUtils.isPopupContained((JPopupMenu) m);
288
        }
289
//        }
289
290
//
290
        // Get all items, including those ones from sub-JInlineMenu's.
291
//        // Get all items, including those ones from sub-JInlineMenu's.
291
        List its = new java.util.ArrayList(items.length);
292
//        List its = new java.util.ArrayList(items.length);
292
        getAllInlineItems(its);
293
//        getAllInlineItems(its);
293
294
//
294
        JComponent[] items = (JComponent[]) its.toArray(new JComponent[its.size()]);
295
//        JComponent[] items = (JComponent[]) its.toArray(new JComponent[its.size()]);
295
        addedItems = its;
296
//        addedItems = its;
296
297
//
297
        // Find me please!
298
//        // Find me please!
298
        Component[] array = m.getComponents();
299
//        Component[] array = m.getComponents();
299
300
//
300
        int menuPos = findIndex(this, array);
301
//        int menuPos = findIndex(this, array);
301
302
//
302
        if (menuPos == -1) {
303
//        if (menuPos == -1) {
303
            return; // not found? strange!
304
//            return; // not found? strange!
304
        }
305
//        }
305
306
//
306
        if (
307
//        if (
307
            (menuPos > 0) && (items.length > 0) && (array.length > 0) && /* should be always true */
308
//            (menuPos > 0) && (items.length > 0) && (array.length > 0) && /* should be always true */
308
                !(array[menuPos - 1] instanceof JSeparator) && !(array[menuPos - 1] instanceof JInlineMenu)
309
//                !(array[menuPos - 1] instanceof JSeparator) && !(array[menuPos - 1] instanceof JInlineMenu)
309
        ) { // not first and not after separator or another inline menu ==>> add separator before
310
//        ) { // not first and not after separator or another inline menu ==>> add separator before
310
            m.add(north, menuPos++);
311
//            m.add(north, menuPos++);
311
            array = m.getComponents();
312
//            array = m.getComponents();
312
        }
313
//        }
313
314
//
314
        if (menuPos < (array.length - 1)) {
315
//        if (menuPos < (array.length - 1)) {
315
            // not last
316
//            // not last
316
            if (
317
//            if (
317
                (items.length > 0) && !(array[menuPos + 1] instanceof JPopupMenu.Separator) &&
318
//                (items.length > 0) && !(array[menuPos + 1] instanceof JPopupMenu.Separator) &&
318
                    !(array[menuPos + 1] instanceof JSeparator)
319
//                    !(array[menuPos + 1] instanceof JSeparator)
319
            ) {
320
//            ) {
320
                // adding non-zero items and not before separator
321
//                // adding non-zero items and not before separator
321
                m.add(south, menuPos + 1);
322
//                m.add(south, menuPos + 1);
322
            } else if (
323
//            } else if (
323
                (items.length == 0) &&
324
//                (items.length == 0) &&
324
                    (array[menuPos + 1] instanceof JPopupMenu.Separator || array[menuPos + 1] instanceof JSeparator)
325
//                    (array[menuPos + 1] instanceof JPopupMenu.Separator || array[menuPos + 1] instanceof JSeparator)
325
            ) {
326
//            ) {
326
                // adding zero items and there is an extra separator after the JInlineMenu item ==>> remove it
327
//                // adding zero items and there is an extra separator after the JInlineMenu item ==>> remove it
327
                m.remove(menuPos + 1);
328
//                m.remove(menuPos + 1);
328
                array = m.getComponents();
329
//                array = m.getComponents();
329
            }
330
//            }
330
        }
331
//        }
331
332
//
332
        // Add components to outer menu.
333
//        // Add components to outer menu.
333
        if (menuPos > array.length) {
334
//        if (menuPos > array.length) {
334
            int menuLength = items.length;
335
//            int menuLength = items.length;
335
336
//
336
            for (int i = 0; i < menuLength; i++) {
337
//            for (int i = 0; i < menuLength; i++) {
337
                m.add(items[i]);
338
//                m.add(items[i]);
338
            }
339
//            }
339
        } else {
340
//        } else {
340
            int menuLength = items.length;
341
//            int menuLength = items.length;
341
342
//
342
            for (int i = 0; i < menuLength; i++) {
343
//            for (int i = 0; i < menuLength; i++) {
343
                m.add(items[i], ++menuPos);
344
//                m.add(items[i], ++menuPos);
344
345
//
345
                // advance menuPos for JInlineMenu
346
//                // advance menuPos for JInlineMenu
346
                // otherwise the next item will be
347
//                // otherwise the next item will be
347
                // actually placed before expanded
348
//                // actually placed before expanded
348
                // items of this JInlineMenu
349
//                // items of this JInlineMenu
349
                if (items[i] instanceof JInlineMenu) {
350
//                if (items[i] instanceof JInlineMenu) {
350
                    JInlineMenu him = (JInlineMenu) items[i];
351
//                    JInlineMenu him = (JInlineMenu) items[i];
351
                    menuPos += him.items.length;
352
//                    menuPos += him.items.length;
352
                }
353
//                }
353
            }
354
//            }
354
        }
355
//        }
355
356
//
356
        if (m instanceof JPopupMenu && m.isShowing()) {
357
//        if (m instanceof JPopupMenu && m.isShowing()) {
357
            // This can happen when somebody call setMenuItems on visible
358
//            // This can happen when somebody call setMenuItems on visible
358
            JPopupMenuUtils.dynamicChange((JPopupMenu) m, usedToBeContained);
359
//            JPopupMenuUtils.dynamicChange((JPopupMenu) m, usedToBeContained);
359
        } else {
360
//        } else {
360
            // ensure correct preferred size computation
361
//            // ensure correct preferred size computation
361
            m.invalidate();
362
//            m.invalidate();
362
        }
363
//        }
363
    }
364
//    }
364
365
365
    private class Updater implements Runnable {
366
    public JComponent[] synchMenuPresenters(JComponent[] items) {
366
        Updater() {
367
        return this.items;
367
        }
368
    }
368
369
369
        public void run() {
370
    public JComponent[] getMenuPresenters() {
370
            updateContents();
371
        return items;
371
        }
372
    }
372
    }
373
374
//    private class Updater implements Runnable {
375
//        Updater() {
376
//        }
377
//
378
//        public void run() {
379
//            updateContents();
380
//        }
381
//    }
373
}
382
}
(-)openide/awt/src/org/openide/awt/JMenuPlus.java (-103 / +103 lines)
Lines 21-30 Link Here
21
 * It assures, that the popup menu gets placed inside visible screen area.
21
 * It assures, that the popup menu gets placed inside visible screen area.
22
 * It also improves placement of popups in the case the subclass lazily changes
22
 * It also improves placement of popups in the case the subclass lazily changes
23
 * the content from getPopupMenu().
23
 * the content from getPopupMenu().
24
 * @deprecated doesn't do anything special anymore - since 6.5
24
 */
25
 */
25
public class JMenuPlus extends JMenu {
26
public class JMenuPlus extends JMenu {
26
    static final long serialVersionUID = -7700146216422707913L;
27
    static final long serialVersionUID = -7700146216422707913L;
27
    private static final boolean NO_POPUP_PLACEMENT_HACK = Boolean.getBoolean("netbeans.popup.no_hack"); // NOI18N
28
//    private static final boolean NO_POPUP_PLACEMENT_HACK = Boolean.getBoolean("netbeans.popup.no_hack"); // NOI18N
28
29
29
    public JMenuPlus() {
30
    public JMenuPlus() {
30
        this(""); // NOI18N
31
        this(""); // NOI18N
Lines 38-143 Link Here
38
        getAccessibleContext().setAccessibleDescription(label);
39
        getAccessibleContext().setAccessibleDescription(label);
39
    }
40
    }
40
41
41
    /** Overriden to provide better strategy for placing the JMenu on the screen.
42
//    /** Overriden to provide better strategy for placing the JMenu on the screen.
42
    * @param b a boolean value -- true to make the menu visible, false to hide it
43
//    * @param b a boolean value -- true to make the menu visible, false to hide it
43
    */
44
//    */
44
    public void setPopupMenuVisible(boolean b) {
45
//    public void setPopupMenuVisible(boolean b) {
45
        boolean isVisible = isPopupMenuVisible();
46
//        boolean isVisible = isPopupMenuVisible();
46
47
//
47
        if (b != isVisible) {
48
//        if (b != isVisible) {
48
            if ((b == true) && isShowing()) {
49
//            if ((b == true) && isShowing()) {
49
                // The order of calls is a provision for subclassers that 
50
////                // The order of calls is a provision for subclassers that 
50
                // change the content of the menu during getPopupMenu()
51
////                // change the content of the menu during getPopupMenu()
51
                // We compute the origin later with properly filled popup
52
////                // We compute the origin later with properly filled popup
52
                JPopupMenu popup = getPopupMenu();
53
//                JPopupMenu popup = getPopupMenu();
53
54
////
54
                // HACK[pnejedly]: Notify all the items in the menu we're going to show
55
////                // HACK[pnejedly]: Notify all the items in the menu we're going to show
55
                JInlineMenu.prepareItemsInContainer(popup);
56
////                JInlineMenu.prepareItemsInContainer(popup);
56
57
////
57
                // End of HACK
58
////                // End of HACK
58
                // HACK[mkleint]: Notify all the items in the menu we're going to show
59
////                // HACK[mkleint]: Notify all the items in the menu we're going to show
59
                // #40824 - when the text changes, it's too late to update in popup.show() (which triggers the updateState() in the MenuBridge.
60
////                // #40824 - when the text changes, it's too late to update in popup.show() (which triggers the updateState() in the MenuBridge.
60
                Actions.prepareMenuBridgeItemsInContainer(popup);
61
////                Actions.prepareMenuBridgeItemsInContainer(popup);
61
62
//
62
                // End of HACK
63
//                // End of HACK
63
                if (NO_POPUP_PLACEMENT_HACK) {
64
////                if (NO_POPUP_PLACEMENT_HACK) {
64
                    Point p = super.getPopupMenuOrigin();
65
//                    Point p = super.getPopupMenuOrigin();
65
                    getPopupMenu().show(this, p.x, p.y);
66
//                    popup.show(this, p.x, p.y);
66
                } else {
67
////                } else {
67
                    Point p = getPopupMenuOrigin();
68
////                    Point p = getPopupMenuOrigin(popup);
68
                    popup.show(this, p.x, p.y);
69
////                    popup.show(this, p.x, p.y);
69
                }
70
////                }
70
            } else {
71
//            } else {
71
                getPopupMenu().setVisible(false);
72
//                getPopupMenu().setVisible(false);
72
            }
73
//            }
73
        }
74
//        }
74
    }
75
//    }
75
76
76
    /** Overriden to provide better strategy for placing the JMenu on the screen.
77
//    /** Overriden to provide better strategy for placing the JMenu on the screen.
77
    *
78
//    *
78
    * @return a Point in the coordinate space of the menu instance
79
//    * @return a Point in the coordinate space of the menu instance
79
    * which should be used as the origin of the JMenu's popup menu.
80
//    * which should be used as the origin of the JMenu's popup menu.
80
    */
81
//    */
81
    protected Point getPopupMenuOrigin() {
82
//    protected Point getPopupMenuOrigin(JPopupMenu pm) {
82
        int x = 0;
83
//        int x = 0;
83
        int y = 0;
84
//        int y = 0;
84
        JPopupMenu pm = getPopupMenu();
85
//        Rectangle screenRect = JPopupMenuUtils.getScreenRect();
85
        Rectangle screenRect = JPopupMenuUtils.getScreenRect();
86
//        Dimension s = getSize();
86
        Dimension s = getSize();
87
//        Dimension pmSize = pm.getSize();
87
        Dimension pmSize = pm.getSize();
88
//        int screenRight = screenRect.x + screenRect.width;
88
        int screenRight = screenRect.x + screenRect.width;
89
//        int screenBottom = screenRect.y + screenRect.height;
89
        int screenBottom = screenRect.y + screenRect.height;
90
//
90
91
//        // For the first time the menu is popped up,
91
        // For the first time the menu is popped up,
92
//        // the size has not yet been initiated
92
        // the size has not yet been initiated
93
//        if (pmSize.width == 0) {
93
        if (pmSize.width == 0) {
94
//            pmSize = pm.getPreferredSize();
94
            pmSize = pm.getPreferredSize();
95
//        }
95
        }
96
//
96
97
//        Point position = getLocationOnScreen();
97
        Point position = getLocationOnScreen();
98
//
98
99
//        Container parent = getParent();
99
        Container parent = getParent();
100
//
100
101
//        if (parent instanceof JPopupMenu) {
101
        if (parent instanceof JPopupMenu) {
102
//            // We are a submenu (pull-right)
102
            // We are a submenu (pull-right)
103
//            // First determine x:
103
            // First determine x:
104
//            if ((position.x + s.width + pmSize.width) < screenRight) {
104
            if ((position.x + s.width + pmSize.width) < screenRight) {
105
//                x = s.width; // Prefer placement to the right
105
                x = s.width; // Prefer placement to the right
106
//            } else {
106
            } else {
107
//                x = 0 - pmSize.width; // Otherwise place to the left
107
                x = 0 - pmSize.width; // Otherwise place to the left
108
//            }
108
            }
109
//
109
110
//            // Then the y:
110
            // Then the y:
111
//            if ((position.y + pmSize.height) < screenBottom) {
111
            if ((position.y + pmSize.height) < screenBottom) {
112
//                y = 0; // Prefer dropping down
112
                y = 0; // Prefer dropping down
113
//            } else {
113
            } else {
114
//                y = s.height - pmSize.height; // Otherwise drop 'up'
114
                y = s.height - pmSize.height; // Otherwise drop 'up'
115
//            }
115
            }
116
//        } else {
116
        } else {
117
//            // We are a toplevel menu (pull-down)
117
            // We are a toplevel menu (pull-down)
118
//            // First determine the x:
118
            // First determine the x:
119
//            if ((position.x + pmSize.width) < screenRight) {
119
            if ((position.x + pmSize.width) < screenRight) {
120
//                x = 0; // Prefer extending to right
120
                x = 0; // Prefer extending to right
121
//            } else {
121
            } else {
122
//                x = s.width - pmSize.width; // Otherwise extend to left
122
                x = s.width - pmSize.width; // Otherwise extend to left
123
//            }
123
            }
124
//
124
125
//            // Then the y:
125
            // Then the y:
126
//            if ((position.y + s.height + pmSize.height) < screenBottom) {
126
            if ((position.y + s.height + pmSize.height) < screenBottom) {
127
//                y = s.height; // Prefer dropping down
127
                y = s.height; // Prefer dropping down
128
//            } else {
128
            } else {
129
//                y = 0 - pmSize.height; // Otherwise drop 'up'
129
                y = 0 - pmSize.height; // Otherwise drop 'up'
130
//            }
130
            }
131
//        }
131
        }
132
//
132
133
//        if (y < -position.y) {
133
        if (y < -position.y) {
134
//            y = -position.y;
134
            y = -position.y;
135
//        }
135
        }
136
//
136
137
//        if (x < -position.x) {
137
        if (x < -position.x) {
138
//            x = -position.x;
138
            x = -position.x;
139
//        }
139
        }
140
//
140
141
//        return new Point(x, y);
141
        return new Point(x, y);
142
//    }
142
    }
143
}
143
}
(-)openide/awt/src/org/openide/awt/JPopupMenuPlus.java (-28 / +28 lines)
Lines 21-58 Link Here
21
21
22
/** A subclass of JPopupMenu which ensures that the popup menus do
22
/** A subclass of JPopupMenu which ensures that the popup menus do
23
 * not stretch off the edges of the screen.
23
 * not stretch off the edges of the screen.
24
 *
24
 * @deprecated - doesn't do anything special anymore. (since 6.5)
25
 */
25
 */
26
public class JPopupMenuPlus extends JPopupMenu {
26
public class JPopupMenuPlus extends JPopupMenu {
27
    private static final boolean NO_POPUP_PLACEMENT_HACK = Boolean.getBoolean("netbeans.popup.no_hack"); // NOI18N
27
//    private static final boolean NO_POPUP_PLACEMENT_HACK = Boolean.getBoolean("netbeans.popup.no_hack"); // NOI18N
28
28
29
    public JPopupMenuPlus() {
29
    public JPopupMenuPlus() {
30
    }
30
    }
31
31
32
    /*
32
//    /*
33
     * Override the show() method to ensure that the popup will be
33
//     * Override the show() method to ensure that the popup will be
34
     * on the screen.
34
//     * on the screen.
35
     */
35
//     */
36
    public void show(Component invoker, int x, int y) {
36
//    public void show(Component invoker, int x, int y) {
37
        if (isVisible()) {
37
//        if (isVisible()) {
38
            return;
38
//            return;
39
        }
39
//        }
40
40
//
41
        // HACK[pnejedly]: Notify all the items in the menu we're going to show
41
////        // HACK[pnejedly]: Notify all the items in the menu we're going to show
42
        JInlineMenu.prepareItemsInContainer(this);
42
////        JInlineMenu.prepareItemsInContainer(this);
43
43
//
44
        // End of HACK
44
//        // End of HACK
45
        if (NO_POPUP_PLACEMENT_HACK) {
45
//        if (NO_POPUP_PLACEMENT_HACK) {
46
            super.show(invoker, x, y);
46
//            super.show(invoker, x, y);
47
47
//
48
            return;
48
//            return;
49
        }
49
//        }
50
50
//
51
        Point p = new Point(x, y);
51
//        Point p = new Point(x, y);
52
        SwingUtilities.convertPointToScreen(p, invoker);
52
//        SwingUtilities.convertPointToScreen(p, invoker);
53
53
//
54
        Point newPt = JPopupMenuUtils.getPopupMenuOrigin(this, p);
54
//        Point newPt = JPopupMenuUtils.getPopupMenuOrigin(this, p);
55
        SwingUtilities.convertPointFromScreen(newPt, invoker);
55
//        SwingUtilities.convertPointFromScreen(newPt, invoker);
56
        super.show(invoker, newPt.x, newPt.y);
56
//        super.show(invoker, newPt.x, newPt.y);
57
    }
57
//    }
58
}
58
}
(-)openide/awt/src/org/openide/awt/JPopupMenuUtils.java (-7 / +7 lines)
Lines 42-48 Link Here
42
    private static boolean problem = false;
42
    private static boolean problem = false;
43
    private static RequestProcessor reqProc;
43
    private static RequestProcessor reqProc;
44
    private static RequestProcessor.Task task;
44
    private static RequestProcessor.Task task;
45
    private static final boolean NO_POPUP_PLACEMENT_HACK = Boolean.getBoolean("netbeans.popup.no_hack"); // NOI18N
45
//    private static final boolean NO_POPUP_PLACEMENT_HACK = Boolean.getBoolean("netbeans.popup.no_hack"); // NOI18N
46
46
47
    /*
47
    /*
48
     * Called when a visible menu has dynamically changed.  Ensure that
48
     * Called when a visible menu has dynamically changed.  Ensure that
Lines 74-82 Link Here
74
        }
74
        }
75
75
76
        if (!newPt.equals(p)) {
76
        if (!newPt.equals(p)) {
77
            if (!NO_POPUP_PLACEMENT_HACK) {
77
//            if (!NO_POPUP_PLACEMENT_HACK) {
78
                popup.setLocation(newPt.x, newPt.y);
78
//                popup.setLocation(newPt.x, newPt.y);
79
            }
79
//            }
80
        }
80
        }
81
81
82
        if (usedToBeContained != willBeContained) {
82
        if (usedToBeContained != willBeContained) {
Lines 126-134 Link Here
126
                                        refreshPopup(popup);
126
                                        refreshPopup(popup);
127
127
128
                                        if (!newPt.equals(p)) {
128
                                        if (!newPt.equals(p)) {
129
                                            if (!NO_POPUP_PLACEMENT_HACK) {
129
//                                            if (!NO_POPUP_PLACEMENT_HACK) {
130
                                                popup.setLocation(newPt.x, newPt.y);
130
//                                                popup.setLocation(newPt.x, newPt.y);
131
                                            }
131
//                                            }
132
                                        }
132
                                        }
133
133
134
                                        popup.setVisible(true);
134
                                        popup.setVisible(true);
(-)openide/loaders/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.loaders
2
OpenIDE-Module: org.openide.loaders
3
OpenIDE-Module-Specification-Version: 5.4
3
OpenIDE-Module-Specification-Version: 5.5
4
OpenIDE-Module-Localizing-Bundle: org/openide/loaders/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/loaders/Bundle.properties
5
5
(-)openide/loaders/nbproject/project.xml (-3 / +3 lines)
Lines 22-28 Link Here
22
                    <build-prerequisite/>
22
                    <build-prerequisite/>
23
                    <compile-dependency/>
23
                    <compile-dependency/>
24
                    <run-dependency>
24
                    <run-dependency>
25
                        <specification-version>6.2</specification-version>
25
                        <specification-version>6.4</specification-version>
26
                    </run-dependency>
26
                    </run-dependency>
27
                </dependency>
27
                </dependency>
28
                <dependency>
28
                <dependency>
Lines 62-68 Link Here
62
                    <build-prerequisite/>
62
                    <build-prerequisite/>
63
                    <compile-dependency/>
63
                    <compile-dependency/>
64
                    <run-dependency>
64
                    <run-dependency>
65
                        <specification-version>6.2</specification-version>
65
                        <specification-version>6.5</specification-version>
66
                    </run-dependency>
66
                    </run-dependency>
67
                </dependency>
67
                </dependency>
68
                <dependency>
68
                <dependency>
Lines 78-84 Link Here
78
                    <build-prerequisite/>
78
                    <build-prerequisite/>
79
                    <compile-dependency/>
79
                    <compile-dependency/>
80
                    <run-dependency>
80
                    <run-dependency>
81
                        <specification-version>6.2</specification-version>
81
                        <specification-version>6.3</specification-version>
82
                    </run-dependency>
82
                    </run-dependency>
83
                </dependency>
83
                </dependency>
84
                <dependency>
84
                <dependency>
(-)openide/loaders/src/org/openide/awt/MenuBar.java (-71 / +64 lines)
Lines 15-25 Link Here
15
15
16
import java.awt.Component;
16
import java.awt.Component;
17
import java.awt.EventQueue;
17
import java.awt.EventQueue;
18
import java.awt.Point;
19
import java.awt.event.*;
18
import java.awt.event.KeyEvent;
20
import java.awt.event.KeyEvent;
19
import java.io.*;
21
import java.io.*;
20
import java.util.*;
22
import java.util.*;
21
import javax.swing.*;
23
import javax.swing.*;
22
import javax.swing.KeyStroke;
24
import javax.swing.KeyStroke;
25
import javax.swing.MenuElement;
26
import javax.swing.event.ChangeEvent;
27
import javax.swing.event.ChangeListener;
23
28
24
import org.openide.ErrorManager;
29
import org.openide.ErrorManager;
25
import org.openide.loaders.*;
30
import org.openide.loaders.*;
Lines 368-387 Link Here
368
    }
373
    }
369
374
370
    /** Menu based on the folder content whith lazy items creation. */
375
    /** Menu based on the folder content whith lazy items creation. */
371
    private static class LazyMenu extends JMenuPlus implements NodeListener, Runnable {
376
    private static class LazyMenu extends JMenu implements NodeListener, Runnable, ChangeListener {
372
	DataFolder master;
377
	DataFolder master;
373
	boolean icon;
378
	boolean icon;
374
	MenuFolder slave;
379
	MenuFolder slave;
380
        DynaMenuModel dynaModel;
375
	
381
	
376
	/** Constructor. */
382
	/** Constructor. */
377
        public LazyMenu(final DataFolder df, boolean icon) {
383
        public LazyMenu(final DataFolder df, boolean icon) {
378
	    master = df;
384
	    master = df;
379
	    this.icon = icon;
385
	    this.icon = icon;
386
            dynaModel = new DynaMenuModel();
380
387
381
	    // Listen for changes in Node's DisplayName/Icon
388
	    // Listen for changes in Node's DisplayName/Icon
382
            Node n = master.getNodeDelegate ();
389
            Node n = master.getNodeDelegate ();
383
            n.addNodeListener (org.openide.nodes.NodeOp.weakNodeListener (this, n));
390
            n.addNodeListener (org.openide.nodes.NodeOp.weakNodeListener (this, n));
384
	    updateProps();
391
	    updateProps();
392
            getModel().addChangeListener(this);
385
393
386
        }
394
        }
387
        
395
        
Lines 461-474 Link Here
461
        public void childrenRemoved (NodeMemberEvent ev) {}
469
        public void childrenRemoved (NodeMemberEvent ev) {}
462
        public void childrenReordered(NodeReorderEvent ev) {}
470
        public void childrenReordered(NodeReorderEvent ev) {}
463
        public void nodeDestroyed (NodeEvent ev) {}
471
        public void nodeDestroyed (NodeEvent ev) {}
464
465
            
472
            
466
        /** Overrides superclass method to lazy create popup. */
473
        private boolean selected = false;
467
        public JPopupMenu getPopupMenu() {
474
        public void stateChanged(ChangeEvent event) {
468
            doInitialize();
475
            if (selected) {
469
            return super.getPopupMenu();
476
                selected = false;
477
            } else {
478
                selected = true;
479
                doInitialize();
480
                dynaModel.checkSubmenu(this);
481
//                // The order of calls is a provision for subclassers that 
482
//                // change the content of the menu during getPopupMenu()
483
//                // We compute the origin later with properly filled popup
484
//                JPopupMenu popup = getPopupMenu();
485
//
486
//                // HACK[pnejedly]: Notify all the items in the menu we're going to show
487
//                JInlineMenu.prepareItemsInContainer(popup);
488
//
489
//                // End of HACK
490
//                // HACK[mkleint]: Notify all the items in the menu we're going to show
491
//                // #40824 - when the text changes, it's too late to update in popup.show() (which triggers the updateState() in the MenuBridge.
492
//                Actions.prepareMenuBridgeItemsInContainer(popup);
493
//                
494
////                slave = null;
495
            }
470
        }
496
        }
471
        
497
        
498
499
    /** Overriden to provide better strategy for placing the JMenu on the screen.
500
    * @param b a boolean value -- true to make the menu visible, false to hide it
501
    */
502
    public void setPopupMenuVisible(boolean b) {
503
        boolean isVisible = isPopupMenuVisible();
504
505
        if (b != isVisible) {
506
            if ((b == true) && isShowing()) {
507
                doInitialize();                
508
                dynaModel.checkSubmenu(this);
509
//                // The order of calls is a provision for subclassers that 
510
//                // change the content of the menu during getPopupMenu()
511
//                // We compute the origin later with properly filled popup
512
//                JPopupMenu popup = getPopupMenu();
513
//
514
//                // HACK[pnejedly]: Notify all the items in the menu we're going to show
515
//                JInlineMenu.prepareItemsInContainer(popup);
516
//
517
//                // End of HACK
518
//                // HACK[mkleint]: Notify all the items in the menu we're going to show
519
//                // #40824 - when the text changes, it's too late to update in popup.show() (which triggers the updateState() in the MenuBridge.
520
//                Actions.prepareMenuBridgeItemsInContainer(popup);
521
522
            }
523
        }
524
        super.setPopupMenuVisible(b);
525
    }        
526
        
472
	private void doInitialize() {
527
	private void doInitialize() {
473
	    if(slave == null) {
528
	    if(slave == null) {
474
		slave = new MenuFolder(); // will do the tracking
529
		slave = new MenuFolder(); // will do the tracking
Lines 554-560 Link Here
554
    	     */
609
    	     */
555
    	    protected Object createInstance(InstanceCookie[] cookies)
610
    	    protected Object createInstance(InstanceCookie[] cookies)
556
    			    throws IOException, ClassNotFoundException {
611
    			    throws IOException, ClassNotFoundException {
557
		JMenu m = LazyMenu.this;
612
		LazyMenu m = LazyMenu.this;
558
613
559
        	//synchronized (this) { // see #15917 - attachment from 2001/09/27
614
        	//synchronized (this) { // see #15917 - attachment from 2001/09/27
560
        	LinkedList cInstances = new LinkedList();
615
        	LinkedList cInstances = new LinkedList();
Lines 574-642 Link Here
574
		    m.add(item);
629
		    m.add(item);
575
		}
630
		}
576
631
577
	    
632
                m.dynaModel.loadSubmenu(cInstances, m);
578
        	// clear first - refresh the menu's content
579
        	boolean addSeparator = false;
580
                // is menu with some ityem with icon or not
581
                boolean isWithIcons = false;
582
                Icon curIcon = null;
583
        	Iterator it = cInstances.iterator();
584
                List menuItems = new ArrayList(cInstances.size());
585
        	while (it.hasNext()) {
586
            	    Object obj = it.next();
587
            	    if (obj instanceof Presenter.Menu) {
588
                	obj = ((Presenter.Menu)obj).getMenuPresenter();
589
            	    }
590
		
591
		    if (obj instanceof JMenuItem) {
592
                	if(addSeparator) {
593
                	    menuItems.add(null);
594
                    	    addSeparator = false;
595
                	}
596
                        // check icon
597
                        if (!isWithIcons) {
598
                            curIcon = ((JMenuItem)obj).getIcon();
599
                            if (curIcon != null) {
600
                                isWithIcons = true;
601
                            }
602
                        }
603
            		menuItems.add((JMenuItem)obj);
604
            	    } else if (obj instanceof JSeparator) {
605
                	addSeparator = menuItems.size() > 0;
606
            	    } else if (obj instanceof Action) {
607
                	if(addSeparator) {
608
                	    menuItems.add(null);
609
                    	    addSeparator = false;
610
                	}
611
                	Action a = (Action)obj;
612
                	JMenuItem item = new JMenuItem();
613
                	Actions.connect (item, a, false);
614
                        // check icon
615
                        if (!isWithIcons) {
616
                            curIcon = item.getIcon();
617
                            if (curIcon != null) {
618
                                isWithIcons = true;
619
                            }
620
                        }
621
                	menuItems.add (item);
622
            	    }
623
        	}
624
625
                if (isWithIcons) {
626
                    menuItems = alignVertically(menuItems);
627
                }
628
                
629
                // fill menu with built items
630
                JMenuItem curItem = null;
631
                for (Iterator iter = menuItems.iterator(); iter.hasNext(); ) {
632
                    curItem = (JMenuItem)iter.next();
633
                    if (curItem != null) {
634
                        m.add(curItem);
635
                    } else {
636
                        // null means separator
637
                        m.addSeparator();
638
                    }
639
                }
640
                
633
                
641
        	return m;
634
        	return m;
642
    	    }
635
    	    }
Lines 664-667 Link Here
664
	}
657
	}
665
    }
658
    }
666
    
659
    
667
}
660
}
(-)openide/util/apichanges.xml (+22 lines)
Lines 24-29 Link Here
24
<changes>
24
<changes>
25
    <change>
25
    <change>
26
      <api name="util"/>
26
      <api name="util"/>
27
      <summary>DynamicMenuContent interface added</summary>
28
      <version major="6" minor="4"/>
29
      <date day="12" month="6" year="2005"/>
30
      <author login="mkleint"/>
31
      <compatibility addition="no" modification="yes" binary="compatible" source="compatible" semantic="compatible" deprecation="no" deletion="no"/>
32
      <description>
33
        In order to support MacOSX top menus and to fix problems with deprecated JInlineMenu, this new
34
        interface was added that allows to handle dynamic content in 
35
<a href="@TOP@/org/openide/util/actions/Presenter.Menu.html">Presenter.Menu</a>
36
 and <a href="@TOP@/org/openide/util/actions/Presenter.Popup.html">Presenter.Popup</a>.
37
        If the instance returned by Presenter.Menu/Popup is an instance of 
38
<a href="@org-openide-awt@/org/openide/awt/DynamicMenuContent.html">DynamicMenuContent</a>, it's methods are
39
        consulted when creating/updating the menu.
40
      </description>
41
      <class package="org.openide.util.actions" name="Presenter"/>
42
      <issue number="35827"/>
43
    </change>
44
    
45
46
    
47
    <change>
48
      <api name="util"/>
27
      <summary>Support for interruption of RequestProcessor tasks</summary>
49
      <summary>Support for interruption of RequestProcessor tasks</summary>
28
      <version major="6" minor="3"/>
50
      <version major="6" minor="3"/>
29
      <date day="10" month="6" year="2005"/>
51
      <date day="10" month="6" year="2005"/>
(-)openide/util/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.util
2
OpenIDE-Module: org.openide.util
3
OpenIDE-Module-Specification-Version: 6.3
3
OpenIDE-Module-Specification-Version: 6.4
4
OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties
5
5
(-)openide/util/src/org/netbeans/modules/openide/util/AWTBridge.java (+5 lines)
Lines 58-63 Link Here
58
    public abstract Component createToolbarPresenter (Action action);
58
    public abstract Component createToolbarPresenter (Action action);
59
    
59
    
60
    
60
    
61
    public abstract Component[] convertComponents(Component comp);
62
    
61
    //
63
    //
62
    // Default implementation of the the presenter
64
    // Default implementation of the the presenter
63
    // 
65
    // 
Lines 80-84 Link Here
80
            return new javax.swing.JPopupMenu ();
82
            return new javax.swing.JPopupMenu ();
81
        }
83
        }
82
        
84
        
85
        public Component[] convertComponents(Component comp) {
86
            return new Component[] {comp};
87
        }
83
    }
88
    }
84
}
89
}
(-)openide/util/src/org/openide/util/Utilities.java (-11 / +17 lines)
Lines 12-30 Link Here
12
 */
12
 */
13
package org.openide.util;
13
package org.openide.util;
14
14
15
import javax.swing.JSeparator;
16
import org.netbeans.modules.openide.util.AWTBridge;
15
import org.openide.ErrorManager;
17
import org.openide.ErrorManager;
16
import org.openide.util.ContextAwareAction;
17
import org.openide.util.actions.Presenter;
18
import org.openide.util.actions.Presenter;
18
19
19
import java.awt.*;
20
import java.awt.*;
20
import java.awt.event.ActionEvent;
21
import java.awt.event.ActionEvent;
21
import java.awt.event.ActionListener;
22
import java.awt.event.ActionListener;
22
import java.awt.event.FocusListener;
23
import java.awt.event.KeyEvent;
23
import java.awt.event.KeyEvent;
24
24
25
import java.beans.PropertyChangeListener;
26
import java.beans.VetoableChangeListener;
27
28
import java.io.BufferedReader;
25
import java.io.BufferedReader;
29
import java.io.File;
26
import java.io.File;
30
import java.io.IOException;
27
import java.io.IOException;
Lines 43-54 Link Here
43
import java.util.List;
40
import java.util.List;
44
41
45
import javax.swing.Action;
42
import javax.swing.Action;
43
import javax.swing.JComponent;
46
import javax.swing.JMenuItem;
44
import javax.swing.JMenuItem;
47
import javax.swing.JPopupMenu;
45
import javax.swing.JPopupMenu;
48
import javax.swing.KeyStroke;
46
import javax.swing.KeyStroke;
49
import javax.swing.Timer;
47
import javax.swing.Timer;
50
import javax.swing.event.ChangeListener;
48
51
import javax.swing.event.DocumentListener;
52
49
53
50
54
/** Otherwise uncategorized useful static methods.
51
/** Otherwise uncategorized useful static methods.
Lines 2592-2605 Link Here
2592
                            ); // NOI18N
2589
                            ); // NOI18N
2593
                        ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, npe);
2590
                        ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, npe);
2594
                    }
2591
                    }
2595
2596
                    menu.add(item);
2597
                } else {
2592
                } else {
2598
                    // We need to correctly handle mnemonics with '&' etc.
2593
                    // We need to correctly handle mnemonics with '&' etc.
2599
                    JMenuItem mi = org.netbeans.modules.openide.util.AWTBridge.getDefault().createPopupPresenter(
2594
                     item = org.netbeans.modules.openide.util.AWTBridge.getDefault().createPopupPresenter(
2600
                            action
2595
                            action
2601
                        );
2596
                        );
2602
                    menu.add(mi);
2597
                }
2598
                Component[] comps = AWTBridge.getDefault().convertComponents(item);
2599
                for (int v = 0; v < comps.length;v++) {
2600
                    if ((comps[v] == null || comps[v] instanceof JSeparator) && menu.getComponentCount() > 0 && menu.getComponent(menu.getComponentCount() - 1) instanceof JSeparator) {
2601
//                                System.out.println("ignorring separator");
2602
                    } else {
2603
//                                System.out.println("is not=" + comps[v].getClass());
2604
                        menu.add(comps[v]);
2605
                    }
2606
                }
2607
                if (comps.length == 0 || (comps.length > 0 && comps[comps.length - 1] instanceof JSeparator)) {
2608
                    haveHadNonSep = false;
2603
                }
2609
                }
2604
            } else {
2610
            } else {
2605
                // Add next time it is needed.
2611
                // Add next time it is needed.
(-)openide/util/src/org/openide/util/actions/Presenter.java (-2 / +4 lines)
Lines 38-45 Link Here
38
    */
38
    */
39
    public interface Menu extends Presenter {
39
    public interface Menu extends Presenter {
40
        /** Get a menu item that can present this action in a {@link javax.swing.JMenu}.
40
        /** Get a menu item that can present this action in a {@link javax.swing.JMenu}.
41
        * @return the representation for this action
41
         * If your menu content is dynamic in nature, consider using {@link org.openide.awt.DynamicMenuContent}
42
        */
42
         * @return the representation for this action
43
         */
43
        public JMenuItem getMenuPresenter();
44
        public JMenuItem getMenuPresenter();
44
    }
45
    }
45
46
Lines 47-52 Link Here
47
    */
48
    */
48
    public interface Popup extends Presenter {
49
    public interface Popup extends Presenter {
49
        /** Get a menu item that can present this action in a {@link javax.swing.JPopupMenu}.
50
        /** Get a menu item that can present this action in a {@link javax.swing.JPopupMenu}.
51
         * If your menu content is dynamic in nature, consider using {@link org.openide.awt.DynamicMenuContent}
50
        * @return the representation for this action
52
        * @return the representation for this action
51
        */
53
        */
52
        public JMenuItem getPopupPresenter();
54
        public JMenuItem getPopupPresenter();
(-)openide/util/test/unit/src/org/openide/util/UtilitiesActionsTest.java (-2 / +5 lines)
Lines 12-25 Link Here
12
 */
12
 */
13
13
14
package org.openide.util;
14
package org.openide.util;
15
15
import java.awt.Component;
16
import java.lang.ref.*;
16
import javax.swing.AbstractAction;
17
import javax.swing.Action;
17
import javax.swing.Action;
18
import javax.swing.JComponent;
18
import javax.swing.JMenuItem;
19
import javax.swing.JMenuItem;
20
import javax.swing.JPopupMenu;
19
21
20
import junit.framework.*;
22
import junit.framework.*;
21
23
22
import org.netbeans.junit.*;
24
import org.netbeans.junit.*;
25
import org.openide.util.actions.Presenter;
23
    
26
    
24
/** Tests of actions related methods in Utilities class.
27
/** Tests of actions related methods in Utilities class.
25
 */
28
 */
(-)openide/www/proposals/actions/index.html (+3 lines)
Lines 88-93 Link Here
88
           activated nodes) </i> <a href="impl.html#nodeActions"><b>[Implemented]</b></a>
88
           activated nodes) </i> <a href="impl.html#nodeActions"><b>[Implemented]</b></a>
89
    <LI>Actions that require more than one menu item should be able to achieve this in cleaner way than by usage of (now deprecated)
89
    <LI>Actions that require more than one menu item should be able to achieve this in cleaner way than by usage of (now deprecated)
90
            <code>org.openide.awt.JInlineMenu</CODE> component
90
            <code>org.openide.awt.JInlineMenu</CODE> component
91
        <br>
92
       <b>SOLVED:</b> Use <code>org.openide.util.actions.DynamicMenuContent</code> instead of the <code>org.openide.awt.JInlineMenu</CODE>   
93
        </br>
91
    <LI class="leftsolid">All actions should update its state before a menu is shown to prevent resizing and dynamic updates of menu when visible
94
    <LI class="leftsolid">All actions should update its state before a menu is shown to prevent resizing and dynamic updates of menu when visible
92
            (see <a href="design.html#context">Context</a>) <a href="impl.html#context"><b>[Implemented]</b></a>
95
            (see <a href="design.html#context">Context</a>) <a href="impl.html#context"><b>[Implemented]</b></a>
93
    <LI>It is not easy to change menu provided by another module
96
    <LI>It is not easy to change menu provided by another module
(-)projects/projectui/nbproject/project.properties (-1 / +1 lines)
Lines 9-15 Link Here
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
10
# Microsystems, Inc. All Rights Reserved.
10
# Microsystems, Inc. All Rights Reserved.
11
11
12
spec.version.base=1.5.0
12
spec.version.base=1.5.1
13
13
14
javadoc.arch=${basedir}/arch.xml
14
javadoc.arch=${basedir}/arch.xml
15
15
(-)projects/projectui/nbproject/project.xml (-2 / +2 lines)
Lines 84-90 Link Here
84
                    <build-prerequisite/>
84
                    <build-prerequisite/>
85
                    <compile-dependency/>
85
                    <compile-dependency/>
86
                    <run-dependency>
86
                    <run-dependency>
87
                        <specification-version>6.2</specification-version>
87
                        <specification-version>6.4</specification-version>
88
                    </run-dependency>
88
                    </run-dependency>
89
                </dependency>
89
                </dependency>
90
                <dependency>
90
                <dependency>
Lines 116-122 Link Here
116
                    <build-prerequisite/>
116
                    <build-prerequisite/>
117
                    <compile-dependency/>
117
                    <compile-dependency/>
118
                    <run-dependency>
118
                    <run-dependency>
119
                        <specification-version>6.2</specification-version>
119
                        <specification-version>6.5</specification-version>
120
                    </run-dependency>
120
                    </run-dependency>
121
                </dependency>
121
                </dependency>
122
                <dependency>
122
                <dependency>
(-)projects/projectui/src/org/netbeans/modules/project/ui/actions/RecentProjects.java (-1 / +21 lines)
Lines 22-28 Link Here
22
import java.util.Iterator;
22
import java.util.Iterator;
23
import java.util.List;
23
import java.util.List;
24
import javax.swing.AbstractAction;
24
import javax.swing.AbstractAction;
25
import javax.swing.Action;
25
import javax.swing.ImageIcon;
26
import javax.swing.ImageIcon;
27
import javax.swing.JComponent;
26
import javax.swing.JMenu;
28
import javax.swing.JMenu;
27
import javax.swing.JMenuItem;
29
import javax.swing.JMenuItem;
28
import javax.swing.event.PopupMenuEvent;
30
import javax.swing.event.PopupMenuEvent;
Lines 37-42 Link Here
37
import org.openide.nodes.Node;
39
import org.openide.nodes.Node;
38
import org.openide.util.NbBundle;
40
import org.openide.util.NbBundle;
39
import org.openide.util.Utilities;
41
import org.openide.util.Utilities;
42
import org.openide.awt.DynamicMenuContent;
40
import org.openide.util.actions.Presenter;
43
import org.openide.util.actions.Presenter;
41
import org.openide.filesystems.FileChangeAdapter;
44
import org.openide.filesystems.FileChangeAdapter;
42
import org.openide.filesystems.FileEvent;
45
import org.openide.filesystems.FileEvent;
Lines 84-90 Link Here
84
    }
87
    }
85
    
88
    
86
    private JMenu createSubMenu() {
89
    private JMenu createSubMenu() {
87
        JMenu menu = new JMenu(this);
90
        JMenu menu = new UpdatingMenu(this);
88
        menu.setMnemonic(NbBundle.getMessage(RecentProjects.class, "MNE_RecentProjectsAction_Name").charAt(0));
91
        menu.setMnemonic(NbBundle.getMessage(RecentProjects.class, "MNE_RecentProjectsAction_Name").charAt(0));
89
        return menu;
92
        return menu;
90
    }
93
    }
Lines 208-213 Link Here
208
    private class ProjectDirListener extends FileChangeAdapter {
211
    private class ProjectDirListener extends FileChangeAdapter {
209
        public void fileDeleted(FileEvent fe) {
212
        public void fileDeleted(FileEvent fe) {
210
            recreate = true;
213
            recreate = true;
214
        }
215
    }
216
    
217
    private class UpdatingMenu extends JMenu implements DynamicMenuContent {
218
        
219
        public UpdatingMenu(Action action) {
220
            super(action);
221
        }
222
        
223
        public JComponent[] synchMenuPresenters(JComponent[] items) {
224
            fillSubMenu(this);
225
            recreate = false;
226
            return getMenuPresenters();
227
        }
228
        
229
        public JComponent[] getMenuPresenters() {
230
            return new JComponent[] { this };
211
        }
231
        }
212
    }
232
    }
213
    
233
    
(-)xtest/instance/master-config.xml (+1 lines)
Lines 23-28 Link Here
23
        <module name="core" testtypes="unit" attributes="stable"/>
23
        <module name="core" testtypes="unit" attributes="stable"/>
24
        <module name="core/startup" testtypes="unit" attributes="stable"/>
24
        <module name="core/startup" testtypes="unit" attributes="stable"/>
25
        <module name="openide" testtypes="unit" attributes="stable"/>
25
        <module name="openide" testtypes="unit" attributes="stable"/>
26
        <module name="openide/awt" testtypes="unit" attributes="stable"/>
26
        <module name="openide/fs" testtypes="unit" attributes="stable"/>
27
        <module name="openide/fs" testtypes="unit" attributes="stable"/>
27
        <module name="openide/masterfs" testtypes="unit" attributes="stable"/>
28
        <module name="openide/masterfs" testtypes="unit" attributes="stable"/>
28
        <module name="openide/util" testtypes="unit" attributes="stable"/>
29
        <module name="openide/util" testtypes="unit" attributes="stable"/>

Return to bug 35827