items.add(new Action(caption, icon));\r
}\r
\r
- public Action[] getActions() {\r
+ public Action[] getActions(Object target, Object sender) {\r
Action[] actions = new Action[items.size()];\r
for (int i = 0; i < items.size(); i++) {\r
actions[i] = items.get(i);\r
}\r
\r
public Action[] getActions(Object target, Object sender) {\r
- return value.getActions();\r
+ return value.getActions(target, sender);\r
}\r
});\r
}\r
ICON_64_EMAIL_REPLY_PNG_UNCACHEABLE));\r
options.put("Empty", new ContextMenu() {\r
@Override\r
- public Action[] getActions() {\r
+ public Action[] getActions(Object target, Object sender) {\r
return null;\r
}\r
});\r
+ options.put("Edit/New", new ContextMenu() {\r
+ @Override\r
+ public Action[] getActions(Object itemId, Object component) {\r
+ if (itemId == null) {\r
+ return new Action[] { new Action("New..."),\r
+ new Action("Common action") };\r
+ } else {\r
+ return new Action[] { new Action("Edit " + itemId),\r
+ new Action("Common action") };\r
+ }\r
+ }\r
+ });\r
\r
createSelectAction("Context menu", category, options, "None",\r
contextMenuCommand, true);\r