org.eclipse.ui.navigator.CommonDropAdapterAssistant Java Examples
The following examples show how to use
org.eclipse.ui.navigator.CommonDropAdapterAssistant.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PydevPackageExplorer.java From Pydev with Eclipse Public License 1.0 | 6 votes |
private CommonDropAdapterAssistant[] pySortAssistants(CommonDropAdapterAssistant[] array) { Arrays.sort(array, new Comparator() { @Override public int compare(Object arg0, Object arg1) { CommonDropAdapterAssistant a = (CommonDropAdapterAssistant) arg0; CommonDropAdapterAssistant b = (CommonDropAdapterAssistant) arg1; // This is to ensure that the PyDev drop assistant will always // be chosen over non-PyDev ones, if a conflict ever occurs. String id = "org.python.pydev.navigator.actions"; //$NON-NLS-1$ if (a.getClass().getName().startsWith(id)) { return -1; } if (b.getClass().getName().startsWith(id)) { return 1; } return a.getClass().getName().compareTo(b.getClass().getName()); } }); return array; }
Example #2
Source File: PydevPackageExplorer.java From Pydev with Eclipse Public License 1.0 | 6 votes |
@Override public CommonDropAdapterAssistant[] findCommonDropAdapterAssistants( Object aDropTarget, TransferData aTransferType) { CommonDropAdapterDescriptor[] descriptors = CommonDropDescriptorManager .getInstance().findCommonDropAdapterAssistants(aDropTarget, pyContentService); if (descriptors.length == 0) { return NO_ASSISTANTS; } if (LocalSelectionTransfer.getTransfer().isSupportedType(aTransferType) && LocalSelectionTransfer.getTransfer().getSelection() instanceof IStructuredSelection) { return pyGetAssistantsBySelection(descriptors, (IStructuredSelection) LocalSelectionTransfer .getTransfer().getSelection()); } return pyGetAssistantsByTransferData(descriptors, aTransferType); }
Example #3
Source File: PydevPackageExplorer.java From Pydev with Eclipse Public License 1.0 | 5 votes |
@Override public CommonDropAdapterAssistant[] findCommonDropAdapterAssistants( Object aDropTarget, IStructuredSelection theDragSelection) { CommonDropAdapterDescriptor[] descriptors = CommonDropDescriptorManager .getInstance().findCommonDropAdapterAssistants(aDropTarget, pyContentService); if (descriptors.length == 0) { return NO_ASSISTANTS; } return pyGetAssistantsBySelection(descriptors, theDragSelection); }
Example #4
Source File: PydevPackageExplorer.java From Pydev with Eclipse Public License 1.0 | 5 votes |
private CommonDropAdapterAssistant[] pyGetAssistantsByTransferData( CommonDropAdapterDescriptor[] descriptors, TransferData aTransferType) { Set assistants = new LinkedHashSet(); for (int i = 0; i < descriptors.length; i++) { CommonDropAdapterAssistant asst = pyGetAssistant(descriptors[i]); if (asst.isSupportedType(aTransferType)) { assistants.add(asst); } } return pySortAssistants((CommonDropAdapterAssistant[]) assistants .toArray(new CommonDropAdapterAssistant[assistants.size()])); }
Example #5
Source File: PydevPackageExplorer.java From Pydev with Eclipse Public License 1.0 | 5 votes |
private CommonDropAdapterAssistant[] pyGetAssistantsBySelection( CommonDropAdapterDescriptor[] descriptors, IStructuredSelection aSelection) { Set assistants = new LinkedHashSet(); for (int i = 0; i < descriptors.length; i++) { if (descriptors[i].areDragElementsSupported(aSelection)) { assistants.add(pyGetAssistant(descriptors[i])); } } return pySortAssistants((CommonDropAdapterAssistant[]) assistants .toArray(new CommonDropAdapterAssistant[assistants.size()])); }