Lines 24-33
Link Here
|
24 |
import java.io.ObjectInput; |
24 |
import java.io.ObjectInput; |
25 |
import java.util.logging.Level; |
25 |
import java.util.logging.Level; |
26 |
import java.util.logging.Logger; |
26 |
import java.util.logging.Logger; |
|
|
27 |
import javax.swing.TransferHandler; |
27 |
import javax.swing.text.EditorKit; |
28 |
import javax.swing.text.EditorKit; |
28 |
import javax.swing.text.StyledDocument; |
29 |
import javax.swing.text.StyledDocument; |
29 |
import javax.swing.text.BadLocationException; |
30 |
import javax.swing.text.BadLocationException; |
30 |
import org.netbeans.api.html.lexer.HTMLTokenId; |
31 |
import org.netbeans.api.html.lexer.HTMLTokenId; |
|
|
32 |
import org.netbeans.api.imagepaste.ImagePasteSupport; |
31 |
import org.netbeans.api.lexer.Token; |
33 |
import org.netbeans.api.lexer.Token; |
32 |
import org.netbeans.api.lexer.TokenHierarchy; |
34 |
import org.netbeans.api.lexer.TokenHierarchy; |
33 |
import org.netbeans.api.lexer.TokenSequence; |
35 |
import org.netbeans.api.lexer.TokenSequence; |
Lines 88-93
Link Here
|
88 |
} |
90 |
} |
89 |
}; |
91 |
}; |
90 |
|
92 |
|
|
|
93 |
private static final String IMG_TEMPLATE = "<img src=\"$FILENAME\" " + |
94 |
"alt=\"$TITLE\">"; |
95 |
|
96 |
protected void initializeCloneableEditor(CloneableEditor editor) { |
97 |
try { |
98 |
super.initializeCloneableEditor(editor); |
99 |
TransferHandler handler = ImagePasteSupport.createTransferHandler( |
100 |
editor.getEditorPane(), IMG_TEMPLATE); |
101 |
editor.getEditorPane().setTransferHandler(handler); |
102 |
} catch (IllegalStateException ise) { |
103 |
//Normal during restart if module has created a dataobject, then |
104 |
//immediately been unloaded and reloaded. The editor toolbar |
105 |
//tries to get info from a node whose dataobject was destroyed |
106 |
//when the module was unloaded. Bug is in the Ant Debugger module, |
107 |
//which is receiving property changes and not checking validity. |
108 |
|
109 |
//No worries about initialization not having completed - this |
110 |
//editor is going to be replaced completely anyway, it's being |
111 |
//initialized for nothing. |
112 |
} |
113 |
} |
91 |
|
114 |
|
92 |
/** Constructor. */ |
115 |
/** Constructor. */ |
93 |
HtmlEditorSupport(HtmlDataObject obj) { |
116 |
HtmlEditorSupport(HtmlDataObject obj) { |