コード例 #1
0
 /**
  * Template drag n drop
  *
  * @param dropEvent
  */
 public void onTemplateDropped(DropEvent dropEvent) {
   try {
     if (DropEvent.HOVER_START == dropEvent.getEventType()) {
       getDropBoxEffect().setFired(false);
     }
     if (DropEvent.DROPPED == dropEvent.getEventType()) {
       if (dropEvent.getTargetDragValue() == null) {
         return;
       }
       DefaultMutableTreeNode valueNode = (DefaultMutableTreeNode) dropEvent.getTargetDragValue();
       RepositoryDocumentUserObject docUserObject =
           (RepositoryDocumentUserObject) valueNode.getUserObject();
       Document draggedFile = (Document) docUserObject.getResource();
       addTemplate(draggedFile, false);
     }
   } catch (Exception e) {
   }
 }
コード例 #2
0
 /** @param dropEvent */
 public void dropAttachment(DropEvent dropEvent) {
   // if (dropEvent.getEventType() == DropEvent.DROPPED)
   {
     try {
       DefaultMutableTreeNode valueNode = (DefaultMutableTreeNode) dropEvent.getTargetDragValue();
       RepositoryDocumentUserObject docUserObject =
           (RepositoryDocumentUserObject) valueNode.getUserObject();
       Document draggedFile = (Document) docUserObject.getResource();
       addAttachments(
           new Attachment(draggedFile, DocumentMgmtUtility.getDocumentManagementService()));
     } catch (Exception e) {
     }
   }
 }