update copyrights
[fedora-idea.git] / platform / lang-api / src / com / intellij / ide / hierarchy / HierarchyProvider.java
blob4d9c2cfc31c372041e0435b6074e2a0a0823f73c
1 /*
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.
17 package com.intellij.ide.hierarchy;
19 import com.intellij.lang.LanguageExtensionPoint;
20 import com.intellij.openapi.actionSystem.DataContext;
21 import com.intellij.openapi.extensions.ExtensionPointName;
22 import com.intellij.psi.PsiElement;
23 import org.jetbrains.annotations.Nullable;
25 /**
26 * Implement this interface to provide hierarchy browsing actions (Type Hierarchy, Method Hierarchy,
27 * Call Hierarchy) for a custom language.
29 * @author yole
31 public interface HierarchyProvider {
32 ExtensionPointName<LanguageExtensionPoint> TYPE_EP_NAME = ExtensionPointName.create("com.intellij.typeHierarchyProvider");
33 ExtensionPointName<LanguageExtensionPoint> METHOD_EP_NAME = ExtensionPointName.create("com.intellij.methodHierarchyProvider");
35 /**
36 * Returns the element for which the hierarchy should be displayed.
38 * @param dataContext the data context for the action invocation.
39 * @return the target element, or null if the action is not applicable in this context.
41 @Nullable
42 PsiElement getTarget(DataContext dataContext);
44 /**
45 * Creates a browser for viewing the hierarchy of the specified element.
47 * @param target the element to view the hierarchy for.
48 * @return the browser instance.
50 HierarchyBrowser createHierarchyBrowser(final PsiElement target);
52 /**
53 * Notifies that the toolwindow has been shown and the specified browser is currently being displayed.
55 * @param hierarchyBrowser the browser instance created by {@link #createHierarchyBrowser(com.intellij.psi.PsiElement)}.
57 void browserActivated(final HierarchyBrowser hierarchyBrowser);