Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 83611 Details for
Bug 210729
[64] drag&drop into tabfolder not possible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
snippet that demonstrates the bug
Snippet78b.java (text/plain), 2.50 KB, created by
mail
on 2007-11-23 04:42:56 EST
(
hide
)
Description:
snippet that demonstrates the bug
Filename:
MIME Type:
Creator:
mail
Created:
2007-11-23 04:42:56 EST
Size:
2.50 KB
patch
obsolete
>// dnd into a tab folder >// - drop text into label within folder does not work on linux >// >// works with: org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar >// not with: org.eclipse.swt.gtk.linux.x86_64_3.3.0.v3346.jar >// >// see also more complicated scenarios with possibly similar problems: >// - https://bugs.eclipse.org/bugs/show_bug.cgi?id=167677 >// - https://bugs.eclipse.org/bugs/show_bug.cgi?id=141893 > > >package org.eclipse.swt.snippets; > >/* > * Drag and Drop example snippet: drag text between two labels > * > * For a list of all SWT example snippets see > * http://www.eclipse.org/swt/snippets/ > */ >import org.eclipse.swt.*; >import org.eclipse.swt.dnd.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class Snippet78b { > >public static void main (String [] args) { > > Display display = new Display (); > final Shell shell = new Shell (display); > shell.setLayout(new FillLayout()); > final Label label1 = new Label (shell, SWT.BORDER); > label1.setText ("TEXT"); > final Label label2 = new Label (shell, SWT.BORDER); > // > TabFolder f = new TabFolder(shell, SWT.NONE); > TabItem t1 = new TabItem(f, SWT.NONE); > t1.setText("Tab 1"); > TabItem t2 = new TabItem(f, SWT.NONE); > t2.setText("Tab 2"); > Label l1 = new Label (f, SWT.BORDER); > Label l2 = new Label (f, SWT.BORDER); > t1.setControl(l1); > t2.setControl(l2); > // > setDragDrop (label1); > setDragDrop (label2); > setDragDrop (l1); > setDragDrop (l2); > // > shell.setSize (400, 200); > shell.open (); > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > display.dispose (); >} > > >public static void setDragDrop (final Label label) { > > Transfer[] types = new Transfer[] {TextTransfer.getInstance()}; > int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK; > > final DragSource source = new DragSource (label, operations); > source.setTransfer(types); > source.addDragListener (new DragSourceListener () { > public void dragStart(DragSourceEvent event) { > event.doit = (label.getText ().length () != 0); > } > public void dragSetData (DragSourceEvent event) { > event.data = label.getText (); > } > public void dragFinished(DragSourceEvent event) { > if (event.detail == DND.DROP_MOVE) > label.setText (""); > } > }); > > DropTarget target = new DropTarget(label, operations); > target.setTransfer(types); > target.addDropListener (new DropTargetAdapter() { > public void drop(DropTargetEvent event) { > if (event.data == null) { > event.detail = DND.DROP_NONE; > return; > } > label.setText ((String) event.data); > } > }); >} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 210729
: 83611