Пример #1
0
 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;
 }
Пример #2
0
 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;
 }