return selection.length == 1;
}
+ protected String getText() {
+ return "Open With";
+ }
+
@Override
protected IContributionItem[] getContributionItems(ReadGraph graph, Object[] selection) throws DatabaseException {
final Object r = extractResource(graph, selection[0]);
+ if (r == null)
+ return NONE;
final EditorAdapter[] editorAdapters = EditorRegistry.getInstance().getAdaptersFor(graph, r);
if (editorAdapters.length == 0)
return NONE;
@Override
public void fill(Menu menu, int index) {
MenuItem openWith = new MenuItem(menu, SWT.CASCADE, index);
- openWith.setText("Open With");
+ openWith.setText(getText());
openWith.setEnabled(editorAdapters.length > 0);
Menu subMenu = new Menu(menu);
openWith.setMenu(subMenu);