2 * Copyright 2000-2005 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
.navigationToolbar
;
18 import com
.intellij
.ide
.SelectInManager
;
19 import com
.intellij
.ide
.StandardTargetWeights
;
20 import com
.intellij
.ide
.impl
.SelectInTargetPsiWrapper
;
21 import com
.intellij
.ide
.ui
.UISettings
;
22 import com
.intellij
.openapi
.project
.DumbAware
;
23 import com
.intellij
.openapi
.project
.Project
;
24 import com
.intellij
.openapi
.vfs
.VirtualFile
;
25 import com
.intellij
.openapi
.wm
.ex
.WindowManagerEx
;
26 import com
.intellij
.openapi
.wm
.impl
.IdeFrameImpl
;
27 import com
.intellij
.openapi
.wm
.impl
.IdeRootPane
;
28 import com
.intellij
.psi
.PsiElement
;
29 import com
.intellij
.psi
.PsiFileSystemItem
;
30 import org
.jetbrains
.annotations
.NonNls
;
36 public class SelectInNavBarTarget
extends SelectInTargetPsiWrapper
implements DumbAware
{
37 public SelectInNavBarTarget(final Project project
) {
41 public String
toString() {
42 return SelectInManager
.NAV_BAR
;
46 public String
getToolWindowId() {
50 public String
getMinorViewId() {
54 public float getWeight() {
55 return StandardTargetWeights
.NAV_BAR
;
58 protected boolean canSelect(PsiFileSystemItem file
) {
59 return UISettings
.getInstance().SHOW_NAVIGATION_BAR
;
62 protected void select(final Object selector
, VirtualFile virtualFile
, final boolean requestFocus
) {
63 final IdeFrameImpl frame
= WindowManagerEx
.getInstanceEx().getFrame(myProject
);
64 ((NavBarPanel
)((IdeRootPane
)frame
.getRootPane()).findByName(NavBarRootPaneExtension
.NAV_BAR
).getComponent()).select();
67 protected boolean canWorkWithCustomObjects() {
71 protected void select(PsiElement element
, boolean requestFocus
) {
72 final IdeFrameImpl frame
= WindowManagerEx
.getInstanceEx().getFrame(myProject
);
73 ((NavBarPanel
)((IdeRootPane
)frame
.getRootPane()).findByName(NavBarRootPaneExtension
.NAV_BAR
).getComponent()).select();