1 19 20 package org.netbeans.modules.html.palette; 21 import javax.swing.text.BadLocationException ; 22 import javax.swing.text.JTextComponent ; 23 import org.openide.text.ActiveEditorDrop; 24 25 26 27 31 public class HTMLEditorDropDefault implements ActiveEditorDrop { 32 33 String body; 34 35 public HTMLEditorDropDefault(String body) { 36 this.body = body; 37 } 38 39 public boolean handleTransfer(JTextComponent targetComponent) { 40 41 if (targetComponent == null) 42 return false; 43 44 try { 45 HTMLPaletteUtilities.insert(body, (JTextComponent )targetComponent); 46 } 47 catch (BadLocationException ble) { 48 return false; 49 } 50 51 return true; 52 } 53 54 } 55 | Popular Tags |