if (created != null) { DataLoaderPool.getDefault().fireOperationEvent( new OperationEvent.Copy (created, DataFolder.this), OperationEvent.TEMPL );
DataObject originalDataObject = copy.getOriginalDataObject(); if(originalDataObject != null) { FileObject originalPrimaryFile = originalDataObject.getPrimaryFile(); od = copy.getObject(); FileObject file = copy.getObject().getPrimaryFile(); Project owner = FileOwnerQuery.getOwner(file);
/** Create a new object from template. * Asks {@link #handleCreateFromTemplate}. * * @param f folder to create object in * @param name name of object that should be created, or <CODE>null</CODE> if the * name should be same as that of the template (or otherwise mechanically generated) * @return the new data object * @exception IOException if an error occured */ public final DataObject createFromTemplate ( final DataFolder f, final String name ) throws IOException { final DataObject[] result = new DataObject[1]; invokeAtomicAction (f.getPrimaryFile (), new FileSystem.AtomicAction () { public void run () throws IOException { result[0] = handleCreateFromTemplate (f, name); } }); fireOperationEvent ( new OperationEvent.Copy (result[0], this), OperationEvent.TEMPL ); return result[0]; }
/** Creates shadow for this object in specified folder. * <p>An event is fired and atomicity is implemented. * * @param f the folder to create shortcut in * @return the shadow */ public final DataShadow createShadow (final DataFolder f) throws IOException { final DataShadow[] result = new DataShadow[1]; invokeAtomicAction (f.getPrimaryFile (), new FileSystem.AtomicAction () { public void run () throws IOException { result[0] = handleCreateShadow (f); } }); fireOperationEvent ( new OperationEvent.Copy (result[0], this), OperationEvent.SHADOW ); return result[0]; }
/** Copy this object to a folder. The copy of the object is required to * be deletable and movable. * <p>An event is fired, and atomicity is implemented. * @param f the folder to copy the object to * @exception IOException if something went wrong * @return the new object */ public final DataObject copy (final DataFolder f) throws IOException { final DataObject[] result = new DataObject[1]; invokeAtomicAction (f.getPrimaryFile (), new FileSystem.AtomicAction () { public void run () throws IOException { result[0] = handleCopy (f); } }); fireOperationEvent ( new OperationEvent.Copy (result[0], this), OperationEvent.COPY ); return result[0]; }
public void operationCreateFromTemplate(OperationEvent.Copy ev) { FileObject fileObject = getOurFileObject(ev.getObject().getPrimaryFile()); if (fileObject == null) { return; } // XXX NB issue #81746. processFileDataCreated(fileObject); } } // End of ModelSetOperationListener.