1 19 20 package org.netbeans.modules.web.core.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 JSPEditorDropDefault implements ActiveEditorDrop { 32 33 String body; 34 35 public JSPEditorDropDefault(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 JSPPaletteUtilities.insert(body, (JTextComponent )targetComponent); 46 } 47 catch (BadLocationException ble) { 48 return false; 49 } 50 51 return true; 52 } 53 54 } 55 | Popular Tags |