2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.ide
.structureView
.impl
.java
;
18 import com
.intellij
.ide
.structureView
.StructureViewTreeElement
;
19 import com
.intellij
.ide
.util
.treeView
.smartTree
.SortableTreeElement
;
20 import com
.intellij
.navigation
.ItemPresentation
;
21 import com
.intellij
.psi
.PsiField
;
22 import com
.intellij
.psi
.PsiSubstitutor
;
23 import com
.intellij
.psi
.util
.PsiFormatUtil
;
24 import org
.jetbrains
.annotations
.NotNull
;
26 import java
.util
.Collection
;
27 import java
.util
.Collections
;
29 public class PsiFieldTreeElement
extends JavaClassTreeElementBase
<PsiField
> implements SortableTreeElement
{
30 public PsiFieldTreeElement(PsiField field
, boolean isInherited
) {
31 super(isInherited
,field
);
35 public Collection
<StructureViewTreeElement
> getChildrenBase() {
36 return Collections
.emptyList();
39 public ItemPresentation
getPresentation() {
43 public String
getPresentableText() {
44 return PsiFormatUtil
.formatVariable(
46 PsiFormatUtil
.SHOW_NAME
| PsiFormatUtil
.SHOW_TYPE
| PsiFormatUtil
.TYPE_AFTER
| PsiFormatUtil
.SHOW_INITIALIZER
,
51 public PsiField
getField() {
55 public String
getAlphaSortKey() {
56 final PsiField field
= getElement();
58 String name
= field
.getName();