Revision 2ef84e57 src/gr/ebs/gss/client/CellTreeViewModel.java

b/src/gr/ebs/gss/client/CellTreeViewModel.java
95 95
	    SafeHtml outerHelper(String cssClassName);
96 96
	  }
97 97

  
98
	static void configureDragOperation(final DraggableOptions options) {
98
	void configureDragOperation(final DraggableOptions options) {
99 99

  
100 100
	    // set a custom element as drag helper. The content of the helper will be
101 101
	    // set when the drag will start
......
110 110
	    options.setCursorAt(new CursorAt(10, 10, null, null));
111 111
	    // append the helper to the body element
112 112
	    options.setAppendTo("body");
113
	    options.setCancel("select");
113 114
	    // set the revert option
114 115
	    options.setRevert(RevertOption.ON_INVALID_DROP);
116
	    
115 117
	    options.setOnBeforeDragStart(new DragFunction() {
116 118
			
117 119
			@Override
118 120
			public void f(DragContext context) {
119 121
				 RestResource value = context.getDraggableData();
122
			     if(!CellTreeViewModel.this.selectionModel.isSelected(value)){
123
			       	throw new StopDragException();
124
			      }
120 125
			     if(value instanceof TrashResource || value instanceof SharedResource || value instanceof OthersResource || value instanceof OtherUserResource){
121 126
			       	throw new StopDragException();
122 127
			      }
......
205 210
		public void onBrowserEvent(Cell.Context context, com.google.gwt.dom.client.Element parent, RestResource value, com.google.gwt.dom.client.NativeEvent event, com.google.gwt.cell.client.ValueUpdater<RestResource> valueUpdater) {
206 211
			if(event.getType().equals("contextmenu")){
207 212
				selectionModel.setSelected(value, true);
213
				GSS.get().setCurrentSelection(value);
208 214
				GSS.get().getTreeView().showPopup(event.getClientX(), event.getClientY());
209 215
			}
210 216
		};

Also available in: Unified diff