public ResourceEditor createResourceEditor(IResource resource) {
   ResourceEditor editor = new ResourceEditor();
   editor.setResizable(false);
   if (resource != null) {
     openEditors.put(resource.getId(), editor);
     openEditors2.put(editor, resource.getId());
   }
   editor.addWindowListener(openEditorsListener);
   return editor;
 }
 public static <M extends IMedia> M map(long id, Class<M> clazz) throws MapperException {
   IResource resource = ResourceInputMapper.map(id);
   if (!clazz.isAssignableFrom(resource.getClass()))
     throw new MapperException(
         "expected: "
             + clazz.getCanonicalName()
             + " but found: "
             + resource.getClass().getCanonicalName());
   return clazz.cast(resource);
 }
 public ResourceEditor getOpenEditor(IResource resource) {
   if (resource != null && openEditors.containsKey(resource.getId()))
     return openEditors.get(resource.getId());
   return null;
 }