|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.0) E13403-08 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DynamicMenuListener
The DynamicMenuListener allows implementors to add their own menu items to the dynamic menu associated with this listener.
Method Summary | |
---|---|
javax.swing.JComponent[] |
gatherDynamicActions(Context context)
Called just before the dynamic menu is added to the main menu bar. |
Method Detail |
---|
javax.swing.JComponent[] gatherDynamicActions(Context context)
Example:
public JComponent[] gatherDynamicActions(Context context) { if (context.getView() instanceof CodeEditor && context.getDocument() instanceof JavaSourceNode) { return new JComponent[] { Ide.getMenubar().createMenuItem( action1 ), Ide.getMenubar().createMenuItem( action2 ), new JSeparator(), Ide.getMenubar().createMenuItem( action3 ) }; } return new JComponent[0]; }A note about weighting components: Weighting is used to control the order of commands in the dynamic menu. The weight is a float value that can be specific for IdeAction objects like:
action.setMenuWeight(new Float(0.05f);and for JMenu and JSeparator objects like:
((JComponent) menu).putClientProperty(IdeConstants.MENU_WEIGHT, new Float(0.5f));
context
- the current view context.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.0) E13403-08 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |