/** * added for future use - convert NbMarshalledObject to primitive data types and other supported types (if possible) */ static Object unMarshallObjectRecursively(Object mo) { Object o = mo; while (o instanceof NbMarshalledObject) { try { o = ((NbMarshalledObject) o).get(); } catch (IOException e) { ExternalUtil.exception(e); return mo; } catch (ClassNotFoundException e) { ExternalUtil.exception(e); return mo; } } return (o == null) ? mo : o; }
org.openide.util.io.NbMarshalledObject m = new org.openide.util.io.NbMarshalledObject(this); return (ServiceType) m.get(); } catch (IOException ex) { anEx = ex;
try { NbMarshalledObject mar = (NbMarshalledObject) obj; fs = (FileSystem) mar.get(); } catch (IOException ex) { ExternalUtil.exception(ex);
return (mo == null) ? null : mo.get(); } catch (IOException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N
org.openide.util.io.NbMarshalledObject m = new org.openide.util.io.NbMarshalledObject(this); return (ServiceType) m.get(); } catch (IOException ex) { anEx = ex;
/** Called from {@link #clone} to actually create a new component from this one. * The default implementation only clones the object by calling {@link Object#clone}. * Subclasses may leave this as is, assuming they have no special needs for the cloned * data besides copying it from one object to the other. If they do, the superclass * method should be called, and the returned object modified appropriately. * @return a copy of this object */ protected CloneableTopComponent createClonedObject () { try { // clones the component using serialization NbMarshalledObject o = new NbMarshalledObject (this); CloneableTopComponent top = (CloneableTopComponent)o.get (); return top; } catch (IOException ex) { ex.printStackTrace(); throw new InternalError (); } catch (ClassNotFoundException ex) { ex.printStackTrace(); throw new InternalError (); } }
/** Called from {@link #clone} to actually create a new component from this one. * The default implementation only clones the object by calling {@link Object#clone}. * Subclasses may leave this as is, assuming they have no special needs for the cloned * data besides copying it from one object to the other. If they do, the superclass * method should be called, and the returned object modified appropriately. * @return a copy of this object */ protected CloneableTopComponent createClonedObject () { try { // clones the component using serialization NbMarshalledObject o = new NbMarshalledObject (this); CloneableTopComponent top = (CloneableTopComponent)o.get (); return top; } catch (IOException ex) { ex.printStackTrace(); throw new InternalError (); } catch (ClassNotFoundException ex) { ex.printStackTrace(); throw new InternalError (); } }
/** Read the object. */ private void readObject (ObjectInputStream oos) throws IOException, ClassNotFoundException { final LinkedList<ServiceType> ll = new LinkedList<ServiceType> (); for (;;) { NbMarshalledObject obj = (NbMarshalledObject) oos.readObject(); if (obj == null) { break; } try { ServiceType s = (ServiceType) obj.get(); ll.add(s); } catch (IOException ex) { Logger.getLogger(Services.class.getName()).log(Level.WARNING, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(Services.class.getName()).log(Level.WARNING, null, ex); } } getDefault ().setServiceTypes (ll); }
/** * added for future use - convert NbMarshalledObject to primitive data types and other supported types (if possible) */ static Object unMarshallObjectRecursively(Object mo) { Object o = mo; while(o instanceof NbMarshalledObject) { try { o = ((NbMarshalledObject)o).get (); } catch (IOException e) { ExternalUtil.exception (e); return mo; } catch (ClassNotFoundException e) { ExternalUtil.exception (e); return mo; } } return (o == null)? mo : o; }
/** * added for future use - convert NbMarshalledObject to primitive data types and other supported types (if possible) */ static Object unMarshallObjectRecursively(Object mo) { Object o = mo; while(o instanceof NbMarshalledObject) { try { o = ((NbMarshalledObject)o).get (); } catch (IOException e) { ExternalUtil.exception (e); return mo; } catch (ClassNotFoundException e) { ExternalUtil.exception (e); return mo; } } return (o == null)? mo : o; }
org.openide.util.io.NbMarshalledObject m = new org.openide.util.io.NbMarshalledObject(this); return (ServiceType) m.get(); } catch (IOException ex) { anEx = ex;
org.openide.util.io.NbMarshalledObject m = new org.openide.util.io.NbMarshalledObject(this); return (ServiceType) m.get(); } catch (IOException ex) { anEx = ex;
/** Reads the manager. * Deserialization may throw {@link SafeException} in case * the manager cannot be loaded correctly but the stream is still uncorrupted. */ public void readExternal (ObjectInput oi) throws IOException, ClassNotFoundException { super.readExternal (oi); Object anObj = oi.readObject (); if (anObj instanceof ExplorerManager) { manager = (ExplorerManager)anObj; panels.put (manager, new java.lang.ref.WeakReference (this)); initActionMap (null); initListening(); return; } NbMarshalledObject obj = (NbMarshalledObject) anObj; // --- read all data from main stream, it is OK now --- try { manager = (ExplorerManager) obj.get (); panels.put (manager, new java.lang.ref.WeakReference (this)); initActionMap (null); initListening(); } catch (SafeException se) { throw se; } catch (IOException ioe) { throw new SafeException (ioe); } }
/** Reads the manager. * Deserialization may throw {@link SafeException} in case * the manager cannot be loaded correctly but the stream is still uncorrupted. */ public void readExternal (ObjectInput oi) throws IOException, ClassNotFoundException { super.readExternal (oi); Object anObj = oi.readObject (); if (anObj instanceof ExplorerManager) { manager = (ExplorerManager)anObj; panels.put (manager, new java.lang.ref.WeakReference (this)); initActionMap (null); initListening(); return; } NbMarshalledObject obj = (NbMarshalledObject) anObj; // --- read all data from main stream, it is OK now --- try { manager = (ExplorerManager) obj.get (); panels.put (manager, new java.lang.ref.WeakReference (this)); initActionMap (null); initListening(); } catch (SafeException se) { throw se; } catch (IOException ioe) { throw new SafeException (ioe); } }
c.add (m.get ()); } catch (Exception e) { org.openide.ErrorManager.getDefault().notify(
try { org.openide.util.io.NbMarshalledObject m = new org.openide.util.io.NbMarshalledObject (this); return (ServiceType)m.get (); } catch (IOException ex) { anEx = ex;
c.add (m.get ()); } catch (Exception e) { org.openide.ErrorManager.getDefault().notify(
try { org.openide.util.io.NbMarshalledObject m = new org.openide.util.io.NbMarshalledObject (this); return (ServiceType)m.get (); } catch (IOException ex) { anEx = ex;
return mo == null ? null : mo.get (); } catch (IOException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N
return mo == null ? null : mo.get (); } catch (IOException e) { ExternalUtil.log("Cannot load attribute " + attrName + " from " + fileName); // NOI18N