@SuppressWarnings("unchecked") static GuiComponent<?> createDesktopComponent(final GenericFrame parentFrame,final WorkspaceComponent component){
  Class<? extends WorkspaceComponent> componentClass=component.getClass();
  Class<? extends GuiComponent<?>> guiClass=wrappers.get(componentClass);
  if (guiClass == null) {
    throw new IllegalArgumentException("no desktop component registered for " + component.getClass());
  }
  try {
    GenericFrame genericFrame=parentFrame != null ? parentFrame : new DesktopInternalFrame(component);
    Constructor<? extends GuiComponent<?>> constructor=guiClass.getConstructor(GenericFrame.class,componentClass);
    return constructor.newInstance(genericFrame,component);
  }
 catch (  RuntimeException e) {
    throw e;
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

@ SuppressWarnings ( "unchecked" ) static GuiComponent < ? > createDesktopComponent ( final GenericFrame parentFrame , final WorkspaceComponent component ) { Class < ? extends WorkspaceComponent > componentClass = component . getClass ( ) ; Class < ? extends GuiComponent < ? > > guiClass = wrappers . get ( componentClass ) ; if ( guiClass == null ) { throw new IllegalArgumentException ( "no desktop component registered for " + component . getClass ( ) ) ; } try { GenericFrame genericFrame = parentFrame != null ? parentFrame : new DesktopInternalFrame ( component ) ; Constructor < ? extends GuiComponent < ? > > constructor = guiClass . getConstructor ( GenericFrame . class , componentClass ) ; return constructor . newInstance ( genericFrame , component ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
creates an instance of the proper wrapper class around the provided instance .
