Stan's Weblog
Thursday May 15, 2008
Drag and Drop Text into Palette Window to Create Custom Code CLips
The Common Palette associated with HTML editor has been improved a bit - now it's possible to drag any text and drop it in the palette window to create a new custom code snippet:
Other editors will follow soon. Adding such support to your own palette is quite easy. Just override org.netbeans.spi.palette.DragAndDropHandler
and let it handle everything:
class MyDragAndDropHandler extends DragAndDropHandler {
MyDragAndDropHandler() {
super( true );
}
public void customize(ExTransferable t, Lookup item) {
}
}
...
PaletteFactory.createPalette("_path_to_my_palette_root_",
new MyPaletteActions(),
null,
new MyDragAndDropHandler());
Posted at 06:40PM May 15, 2008 by Stanislav Aubrecht in NetBeans | Comments[1]
r
Posted by 190.128.128.46 on May 26, 2008 at 06:09 PM CEST #