public void drop( DropTargetEvent event ) { if ( event.data instanceof String ) insertText( (String) event.data ); } } );
public void drop( DropTargetEvent event ) { if ( event.data instanceof String ) insertText( (String) event.data ); } }; dropTarget.addDropListener( dropTargetAdapter ); }
	public void addDropSupportToViewer( )	{		Assert.isNotNull( expressionViewer );		final StyledText text = expressionViewer.getTextWidget( );		dropTarget = new DropTarget( text, DND.DROP_COPY | DND.DROP_DEFAULT );		dropTarget.setTransfer( new Transfer[]{			TextTransfer.getInstance( )		} );		dropTarget.addDropListener( new DropTargetAdapter( ) {			public void dragEnter( DropTargetEvent event )			{				text.setFocus( );				if ( event.detail == DND.DROP_DEFAULT )					event.detail = DND.DROP_COPY;				if ( event.detail != DND.DROP_COPY )					event.detail = DND.DROP_NONE;			}			public void dragOver( DropTargetEvent event )			{				event.feedback = DND.FEEDBACK_SCROLL						| DND.FEEDBACK_INSERT_BEFORE;			}			public void dragOperationChanged( DropTargetEvent event )			{				dragEnter( event );			}			public void drop( DropTargetEvent event )			{				if ( event.data instanceof String )					insertText( (String) event.data );			}		} );	}