update copyright
[fedora-idea.git] / java / java-impl / src / com / intellij / ide / structureView / impl / java / InheritedMembersFilter.java
blob566f15d23d68cf78eb114891502e627f9ae06e17
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.
16 package com.intellij.ide.structureView.impl.java;
18 import com.intellij.ide.IdeBundle;
19 import com.intellij.ide.util.FileStructureFilter;
20 import com.intellij.ide.util.treeView.smartTree.ActionPresentation;
21 import com.intellij.ide.util.treeView.smartTree.ActionPresentationData;
22 import com.intellij.ide.util.treeView.smartTree.TreeElement;
23 import com.intellij.openapi.util.IconLoader;
24 import com.intellij.openapi.actionSystem.Shortcut;
25 import com.intellij.openapi.keymap.KeymapManager;
26 import org.jetbrains.annotations.NonNls;
27 import org.jetbrains.annotations.NotNull;
29 public class InheritedMembersFilter implements FileStructureFilter {
30 @NonNls public static final String ID = "SHOW_INHERITED";
32 public boolean isVisible(TreeElement treeNode) {
33 if (treeNode instanceof JavaClassTreeElementBase) {
34 return !((JavaClassTreeElementBase)treeNode).isInherited();
36 else {
37 return true;
41 @NotNull
42 public ActionPresentation getPresentation() {
43 return new ActionPresentationData(IdeBundle.message("action.structureview.show.inherited"), null, IconLoader.getIcon("/hierarchy/supertypes.png"));
46 @NotNull
47 public String getName() {
48 return ID;
51 public boolean isReverted() {
52 return true;
55 public String getCheckBoxText() {
56 return IdeBundle.message("file.structure.toggle.show.inherited");
59 public Shortcut[] getShortcut() {
60 return KeymapManager.getInstance().getActiveKeymap().getShortcuts("FileStructurePopup");