Issue Details (XML | Word | Printable)

Key: FLAMINGO-83
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: kirillcool
Reporter: hoesterholt
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
flamingo

Add popup menu to JRibbon component

Created: 20/Sep/10 03:15 PM   Updated: 20/Sep/10 03:15 PM
Component/s: ribbon
Affects Version/s: 5.0
Fix Version/s: milestone 1

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 83
Tags:
Participants: hoesterholt and kirillcool


 Description  « Hide

I can add a popupMenu to a JRibbon using the following code:

JRibbon _toolbar=_ribbonFrame.getRibbon();
final JPopupMenu minimize=new JPopupMenu();
JMenuItem itm=new JMenuItem(_.t("Toggle Ribbon"));
itm.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { _toolbar.setMinimized(!_toolbar.isMinimized()); }
});
minimize.add(itm);

{
for(int n=_toolbar.getComponentCount(),i=0;i<n;i++) {
Component c=_toolbar.getComponent;
if (c instanceof JScrollablePanel) { ((JComponent) c).setComponentPopupMenu(minimize); }
}
}

However, it would be nice if the same were possible to add the popup menu, using
this line of code:

_toolbar.setComponentPopupMenu(minimize)



There are no comments yet on this issue.