Lines 58-63
Link Here
|
58 |
import org.netbeans.core.api.multiview.MultiViewHandler; |
58 |
import org.netbeans.core.api.multiview.MultiViewHandler; |
59 |
import org.netbeans.core.api.multiview.MultiViewPerspective; |
59 |
import org.netbeans.core.api.multiview.MultiViewPerspective; |
60 |
import org.netbeans.core.api.multiview.MultiViews; |
60 |
import org.netbeans.core.api.multiview.MultiViews; |
|
|
61 |
import org.openide.awt.Actions; |
61 |
import org.openide.awt.DynamicMenuContent; |
62 |
import org.openide.awt.DynamicMenuContent; |
62 |
import org.openide.awt.Mnemonics; |
63 |
import org.openide.awt.Mnemonics; |
63 |
import org.openide.text.CloneableEditorSupport; |
64 |
import org.openide.text.CloneableEditorSupport; |
Lines 72-93
Link Here
|
72 |
* @author mkleint |
73 |
* @author mkleint |
73 |
*/ |
74 |
*/ |
74 |
public class EditorsAction extends AbstractAction |
75 |
public class EditorsAction extends AbstractAction |
75 |
implements Presenter.Menu { |
76 |
implements Presenter.Menu, Presenter.Popup { |
76 |
|
77 |
|
77 |
public EditorsAction() { |
78 |
public EditorsAction() { |
78 |
super(NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction")); |
79 |
super(NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction")); |
79 |
} |
80 |
} |
80 |
|
81 |
|
|
|
82 |
@Override |
81 |
public void actionPerformed(ActionEvent ev) { |
83 |
public void actionPerformed(ActionEvent ev) { |
82 |
assert false;// no operation |
84 |
assert false;// no operation |
83 |
} |
85 |
} |
84 |
|
86 |
|
|
|
87 |
@Override |
85 |
public JMenuItem getMenuPresenter() { |
88 |
public JMenuItem getMenuPresenter() { |
86 |
JMenu menu = new UpdatingMenu(); |
89 |
JMenu menu = new UpdatingMenu(); |
87 |
String label = NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction"); |
90 |
String label = NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction"); |
88 |
Mnemonics.setLocalizedText(menu, label); |
91 |
Mnemonics.setLocalizedText(menu, label); |
89 |
return menu; |
92 |
return menu; |
90 |
} |
93 |
} |
|
|
94 |
@Override |
95 |
public JMenuItem getPopupPresenter() { |
96 |
JMenu menu = new UpdatingMenu(); |
97 |
String label = NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction"); |
98 |
Actions.setMenuText(menu, label, false); |
99 |
return menu; |
100 |
} |
91 |
|
101 |
|
92 |
private static final class UpdatingMenu extends JMenu implements DynamicMenuContent { |
102 |
private static final class UpdatingMenu extends JMenu implements DynamicMenuContent { |
93 |
|
103 |
|