public ResourceEditor edit(ResourceType type, long id) throws Exception { if (!resourceEditActions.containsKey(type)) { showUnhandledErrorDialog( "No editor", "There is no editor for resources of type: " + type.getDisplayString()); // actually should never happen return null; } ResourceEditor editor = resourceEditActions.get(type).run(ResourceInputMapper.map(id)); return editor; }
public ResourceEditor editNew(ResourceType type, Long id) throws Exception { if (!resourceEditActions.containsKey(type)) { showUnhandledErrorDialog( "No editor", "There is no editor for resources of type: " + type.getDisplayString()); // actually should never happen return null; } ResourceEditor editor = resourceEditActions.get(type).run(null); if (id != null) openEditors2.put(editor, id); return editor; }