protected void copySelectedBean(){
  if (Debug.debugging("beanbox"))   Debug.output("Enter> copySelectedBean");
  if (selectedBean == null || selectedBeanLocation == null) {
    clearSelection();
    if (Debug.debugging("beanbox"))     Debug.output("selectedBean=" + selectedBean);
    if (Debug.debugging("beanbox"))     Debug.output("selectedBeanLocation=" + selectedBeanLocation);
    return;
  }
  try {
    serBean=new ByteArrayOutputStream();
    ObjectOutputStream oos=new ObjectOutputStream(serBean);
    oos.writeObject(selectedBean);
  }
 catch (  Exception e) {
    e.printStackTrace();
    clearSelection();
    if (Debug.debugging("beanbox"))     Debug.output("Exit> copySelectedBean");
    return;
  }
  cutBean=null;
  if (Debug.debugging("beanbox"))   Debug.output("Exit> copySelectedBean");
}

protected void copySelectedBean ( ) { if ( Debug . debugging ( "beanbox" ) ) Debug . output ( "Enter> copySelectedBean" ) ; if ( selectedBean == null || selectedBeanLocation == null ) { clearSelection ( ) ; if ( Debug . debugging ( "beanbox" ) ) Debug . output ( "selectedBean=" + selectedBean ) ; if ( Debug . debugging ( "beanbox" ) ) Debug . output ( "selectedBeanLocation=" + selectedBeanLocation ) ; return ; } try { serBean = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( serBean ) ; oos . writeObject ( selectedBean ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; clearSelection ( ) ; if ( Debug . debugging ( "beanbox" ) ) Debug . output ( "Exit> copySelectedBean" ) ; return ; } cutBean = null ; if ( Debug . debugging ( "beanbox" ) ) Debug . output ( "Exit> copySelectedBean" ) ; }
this method is called when the user chooses to copy a bean by some means such by by pressing ctrl - c . this method tries to serialize the selected bean . if no bean is selected or the bean is not serializable , this method is a no - op .
