Browser Drag and Drop
- From: milkygto@xxxxxxxxx
- Date: 27 Apr 2005 15:23:37 -0700
I need help using swt.browser
I am unable to trigger the drag and drop listener from the Browser
object. I need to drop the text and do some calculation from the
browser (locating the nodes) and drop it into the table. That's mean I
will need to implement my own TransferType. However, I can't even let
the browser detect the drag event. The only thing I can use at the
moment is to use onmouseup and onmousedown to cheat it as a drag event,
but when it drops, it can only drop the text that I drag from. Because
I am not able to set the DragTarget. It is from the native. I need it
drop more than just text, but also the node location and such.
final Browser browser = new Browser(group, SWT.BORDER | SWT.MULTI);
setDrag(browser);
browser.setUrl("http://www.yahoo.com");
public static void setDrag(final Browser browser) {
Transfer[] types = new Transfer[] { TextTransfer.getInstance()
};
int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
final DragSource source = new DragSource(browser, operations);
source.setTransfer(types);
source.addDragListener(new DragSourceListener() {
public void dragStart(DragSourceEvent event) {
System.out.println("dragStart");
event.doit = true;
}
public void dragSetData(DragSourceEvent event) {
System.out.println("dragSetData");
event.data = "mydata";
}
public void dragFinished(DragSourceEvent event) {
if (event.detail == DND.DROP_MOVE)
System.out.println("dragFinished");
}
});
}
.
- Prev by Date: Problem with Font.createGlyphVector(frc, String)
- Next by Date: Horizontal wrap with JScrollPane
- Previous by thread: Problem with Font.createGlyphVector(frc, String)
- Next by thread: Horizontal wrap with JScrollPane
- Index(es):
Relevant Pages
|
|