mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[service-view] drag bean implements data provider
GitOrigin-RevId: 9f7dbe5a9b6707d227576b8cd28c6ff1c7a3d485
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ab07305151
commit
492ea47776
@@ -6,6 +6,8 @@ import com.intellij.ide.dnd.*;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.ide.util.treeView.PresentableNodeDescriptor;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -128,7 +130,7 @@ class ServiceViewDragHelper {
|
||||
return content;
|
||||
}
|
||||
|
||||
static class ServiceViewDragBean {
|
||||
static class ServiceViewDragBean implements DataProvider {
|
||||
private final ServiceView myServiceView;
|
||||
private final List<ServiceViewItem> myItems;
|
||||
private final ServiceViewContributor myContributor;
|
||||
@@ -160,6 +162,15 @@ class ServiceViewDragHelper {
|
||||
ServiceViewContributor getContributor() {
|
||||
return myContributor;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getData(@NotNull String dataId) {
|
||||
if (PlatformDataKeys.SELECTED_ITEMS.is(dataId)) {
|
||||
return ContainerUtil.map2Array(myItems, ServiceViewItem::getValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static class ServiceViewDnDSource implements DnDSource {
|
||||
|
||||
Reference in New Issue
Block a user