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
.psi
.impl
.beanProperties
;
18 import com
.intellij
.ide
.IdeBundle
;
19 import com
.intellij
.openapi
.util
.TextRange
;
20 import com
.intellij
.psi
.PsiElement
;
21 import com
.intellij
.psi
.PsiManager
;
22 import com
.intellij
.psi
.PsiMethod
;
23 import com
.intellij
.psi
.PsiType
;
24 import com
.intellij
.psi
.util
.PropertyUtil
;
25 import com
.intellij
.psi
.impl
.FakePsiElement
;
26 import com
.intellij
.psi
.meta
.PsiMetaData
;
27 import com
.intellij
.psi
.meta
.PsiMetaOwner
;
28 import com
.intellij
.psi
.meta
.PsiPresentableMetaData
;
29 import com
.intellij
.util
.ArrayUtil
;
30 import org
.jetbrains
.annotations
.NonNls
;
31 import org
.jetbrains
.annotations
.NotNull
;
32 import org
.jetbrains
.annotations
.Nullable
;
39 public class BeanPropertyElement
extends FakePsiElement
implements PsiMetaOwner
, PsiPresentableMetaData
{
40 private final PsiMethod myMethod
;
41 private final String myName
;
43 public BeanPropertyElement(final PsiMethod method
, final String name
) {
49 public PsiType
getPropertyType() {
50 return PropertyUtil
.getPropertyType(myMethod
);
54 public PsiMethod
getMethod() {
58 public PsiElement
getNavigationElement() {
62 public PsiManager
getManager() {
63 return myMethod
.getManager();
66 public PsiElement
getDeclaration() {
71 public String
getName(PsiElement context
) {
76 public String
getName() {
80 public void init(PsiElement element
) {
84 public Object
[] getDependences() {
85 return ArrayUtil
.EMPTY_OBJECT_ARRAY
;
89 public Icon
getIcon(boolean flags
) {
90 return BeanProperty
.ICON
;
93 public PsiElement
getParent() {
98 public PsiMetaData
getMetaData() {
102 public String
getTypeName() {
103 return IdeBundle
.message("bean.property");
107 public Icon
getIcon() {
111 public TextRange
getTextRange() {
112 return TextRange
.from(0, 0);