From 4d9229982dbb12ea67635bdffe5751ac3cf1038a Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 6 Feb 2015 12:41:56 +0300 Subject: [PATCH] simplification of DataProviders: single-element NAVIGATABLE_ARRAY is automatically provided by NavigatableArrayRule if NAVIGATABLE is available --- .../com/intellij/execution/testframework/TestsUIUtil.java | 4 ---- .../src/com/intellij/util/xml/tree/DomModelTreeView.java | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java b/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java index cbb0373f34c1..59e30a064581 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java @@ -57,10 +57,6 @@ public class TestsUIUtil { if (testProxy == null) return null; if (AbstractTestProxy.DATA_KEY.is(dataId)) return testProxy; if (CommonDataKeys.NAVIGATABLE.is(dataId)) return getOpenFileDescriptor(testProxy, model); - if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) { - final Navigatable openFileDescriptor = getOpenFileDescriptor(testProxy, model); - return openFileDescriptor != null ? new Navigatable[]{openFileDescriptor} : null; - } if (CommonDataKeys.PSI_ELEMENT.is(dataId)) { final Location location = testProxy.getLocation(project, properties.getScope()); if (location != null) { diff --git a/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java index 15c3de313d43..546cea563d1f 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/tree/DomModelTreeView.java @@ -190,17 +190,17 @@ public class DomModelTreeView extends Wrapper implements DataProvider, Disposabl @Override @Nullable public Object getData(String dataId) { - if (DomModelTreeView.DATA_KEY.is(dataId)) { + if (DATA_KEY.is(dataId)) { return this; } final SimpleNode simpleNode = getTree().getSelectedNode(); if (simpleNode instanceof AbstractDomElementNode) { final DomElement domElement = ((AbstractDomElementNode)simpleNode).getDomElement(); if (domElement != null && domElement.isValid()) { - if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) { + if (CommonDataKeys.NAVIGATABLE.is(dataId)) { final XmlElement tag = domElement.getXmlElement(); if (tag instanceof Navigatable) { - return new Navigatable[] { (Navigatable)tag }; + return tag; } } }