Community
Participate
Working Groups
Created attachment 255769 [details] modified RAP mail demo (holding a Browser in the Message View) It is not possible to drag elements from a TreeViewer into a Browser widget (IFrame). This would be useful for applications which have embedded JavaScript applications running. In RCP this behavior works. Related Forum post: https://www.eclipse.org/forums/index.php?t=rview&goto=1703589 I created an RCP and RAP example, based on the mail demo (drag from tree to text field in the message view): NavigationView: public void createPartControl(Composite parent) { viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); viewer.setContentProvider(new ViewContentProvider()); viewer.setLabelProvider(new ViewLabelProvider()); viewer.setInput(createDummyModel()); // new dnd example code int operations = DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_COPY; Transfer[] transfers = new Transfer[] { HTMLTransfer.getInstance(), RTFTransfer.getInstance(), TextTransfer.getInstance() }; viewer.addDragSupport(operations, transfers, new DragSourceAdapter() { @Override public void dragSetData(DragSourceEvent event) { Object element = ((IStructuredSelection) viewer.getSelection()).getFirstElement(); if (element != null) { event.data = element.toString(); } } }); } View: public void createPartControl(Composite parent) { Browser browser = new Browser(parent, SWT.NONE); browser.setText("<html><body><input type=\"text\" name=\"test\"></body></html>"); }
Created attachment 255770 [details] modified RCP mail demo (holding a Browser in the Message View)