1 11 12 package org.eclipse.ui.navigator; 13 14 import org.eclipse.jface.util.LocalSelectionTransfer; 15 import org.eclipse.jface.viewers.IStructuredSelection; 16 import org.eclipse.swt.dnd.DragSourceEvent; 17 import org.eclipse.swt.dnd.Transfer; 18 import org.eclipse.swt.dnd.TransferData; 19 import org.eclipse.swt.widgets.Event; 20 import org.eclipse.swt.widgets.Shell; 21 import org.eclipse.ui.PlatformUI; 22 import org.eclipse.ui.internal.navigator.NavigatorContentService; 23 import org.eclipse.ui.part.PluginTransfer; 24 25 51 public abstract class CommonDragAdapterAssistant { 52 53 private INavigatorContentService contentService; 54 55 74 public abstract Transfer[] getSupportedTransferTypes(); 75 76 95 public abstract boolean setDragData(DragSourceEvent anEvent, 96 IStructuredSelection aSelection); 97 98 104 public final void setContentService(INavigatorContentService aContentService) { 105 contentService = aContentService; 106 } 107 108 112 public INavigatorContentService getContentService() { 113 return contentService; 114 } 115 116 121 public final Shell getShell() { 122 if (contentService != null) { 123 ((NavigatorContentService) contentService).getShell(); 124 } 125 return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); 126 } 127 128 } 129 | Popular Tags |