mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
simplification of DataProviders: single-element NAVIGATABLE_ARRAY is automatically provided by NavigatableArrayRule if NAVIGATABLE is available
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user