GitOrigin-RevId: 3dec1b2a5d050ba5284f49a3a6ee31e887de154f
This commit is contained in:
Vladimir Krivosheev
2022-08-24 17:51:59 +02:00
committed by intellij-monorepo-bot
parent 24c0477d33
commit ae1f8d58f9
14 changed files with 82 additions and 187 deletions

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.structureView.impl.java;
import com.intellij.ide.structureView.StructureViewModel;
@@ -25,13 +11,13 @@ import com.intellij.ui.PlaceHolder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class JavaFileTreeModel extends TextEditorBasedStructureViewModel implements StructureViewModel.ElementInfoProvider, PlaceHolder {
private static final Collection<NodeProvider> NODE_PROVIDERS = Arrays.asList(new JavaInheritedMembersNodeProvider(),
new JavaAnonymousClassesNodeProvider(),
new JavaLambdaNodeProvider());
private static final Collection<NodeProvider<?>> NODE_PROVIDERS = List.of(new JavaInheritedMembersNodeProvider(),
new JavaAnonymousClassesNodeProvider(),
new JavaLambdaNodeProvider());
private String myPlace;
public JavaFileTreeModel(@NotNull PsiClassOwner file, @Nullable Editor editor) {
@@ -43,9 +29,8 @@ public class JavaFileTreeModel extends TextEditorBasedStructureViewModel impleme
return new Filter[]{new FieldsFilter(), new PublicElementsFilter()};
}
@NotNull
@Override
public Collection<NodeProvider> getNodeProviders() {
public @NotNull Collection<NodeProvider<?>> getNodeProviders() {
return NODE_PROVIDERS;
}
@@ -55,8 +40,7 @@ public class JavaFileTreeModel extends TextEditorBasedStructureViewModel impleme
}
@Override
@NotNull
public StructureViewTreeElement getRoot() {
public @NotNull StructureViewTreeElement getRoot() {
return new JavaFileTreeElement(getPsiFile());
}