本文整理汇总了Java中org.eclipse.ui.navigator.CommonDropAdapterAssistant类的典型用法代码示例。如果您正苦于以下问题:Java CommonDropAdapterAssistant类的具体用法?Java CommonDropAdapterAssistant怎么用?Java CommonDropAdapterAssistant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommonDropAdapterAssistant类属于org.eclipse.ui.navigator包,在下文中一共展示了CommonDropAdapterAssistant类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pySortAssistants
import org.eclipse.ui.navigator.CommonDropAdapterAssistant; //导入依赖的package包/类
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;
}
示例2: findCommonDropAdapterAssistants
import org.eclipse.ui.navigator.CommonDropAdapterAssistant; //导入依赖的package包/类
@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);
}
示例3: pyGetAssistantsByTransferData
import org.eclipse.ui.navigator.CommonDropAdapterAssistant; //导入依赖的package包/类
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()]));
}
示例4: pyGetAssistantsBySelection
import org.eclipse.ui.navigator.CommonDropAdapterAssistant; //导入依赖的package包/类
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()]));
}