KotlinStructureViewModel: J2K
This commit is contained in:
+21
-25
@@ -14,38 +14,34 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.structureView;
|
package org.jetbrains.kotlin.idea.structureView
|
||||||
|
|
||||||
import com.intellij.ide.structureView.StructureViewModelBase;
|
import com.intellij.ide.structureView.StructureViewModelBase
|
||||||
import com.intellij.ide.util.treeView.smartTree.NodeProvider;
|
import com.intellij.ide.util.treeView.smartTree.NodeProvider
|
||||||
import com.intellij.ide.util.treeView.smartTree.Sorter;
|
import com.intellij.ide.util.treeView.smartTree.Sorter
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||||
import org.jetbrains.kotlin.psi.KtDeclaration;
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
import org.jetbrains.kotlin.psi.KtFile;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
public class KotlinStructureViewModel extends StructureViewModelBase {
|
class KotlinStructureViewModel(jetFile: KtFile) : StructureViewModelBase(jetFile, KotlinStructureViewElement(jetFile, false)) {
|
||||||
private static final Collection<NodeProvider> NODE_PROVIDERS = Arrays.<NodeProvider>asList(
|
|
||||||
new KotlinInheritedMembersNodeProvider());
|
|
||||||
|
|
||||||
private static final Sorter[] sorters = new Sorter[] {Sorter.ALPHA_SORTER};
|
init {
|
||||||
|
withSuitableClasses(KtDeclaration::class.java)
|
||||||
public KotlinStructureViewModel(@NotNull KtFile jetFile) {
|
|
||||||
super(jetFile, new KotlinStructureViewElement(jetFile, false));
|
|
||||||
withSuitableClasses(KtDeclaration.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
override fun getNodeProviders(): Collection<NodeProvider<*>> {
|
||||||
@Override
|
return NODE_PROVIDERS
|
||||||
public Collection<NodeProvider> getNodeProviders() {
|
|
||||||
return NODE_PROVIDERS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
override fun getSorters(): Array<Sorter> {
|
||||||
@Override
|
return Companion.sorters
|
||||||
public Sorter[] getSorters() {
|
}
|
||||||
return sorters;
|
|
||||||
|
companion object {
|
||||||
|
private val NODE_PROVIDERS = Arrays.asList<NodeProvider<*>>(
|
||||||
|
KotlinInheritedMembersNodeProvider())
|
||||||
|
|
||||||
|
private val sorters = arrayOf(Sorter.ALPHA_SORTER)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user