Lines 1-28
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2003 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2003 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Common Public License v1.0 |
4 |
* are made available under the terms of the Common Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/cpl-v10.html |
6 |
* http://www.eclipse.org/legal/cpl-v10.html |
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* Jesper Kamstrup Linnet (eclipse@kamstrup-linnet.dk) - initial API and implementation |
9 |
* Jesper Kamstrup Linnet (eclipse@kamstrup-linnet.dk) - initial API and implementation |
10 |
* (report 36180: Callers/Callees view) |
10 |
* (report 36180: Callers/Callees view) |
11 |
******************************************************************************/ |
11 |
******************************************************************************/ |
12 |
package org.eclipse.jdt.internal.ui.callhierarchy; |
12 |
package org.eclipse.jdt.internal.ui.callhierarchy; |
13 |
|
13 |
|
14 |
import java.util.ArrayList; |
14 |
import java.util.ArrayList; |
15 |
import java.util.List; |
15 |
import java.util.List; |
16 |
|
16 |
|
17 |
import org.eclipse.swt.SWT; |
17 |
import org.eclipse.jdt.core.IJavaElement; |
18 |
import org.eclipse.swt.custom.SashForm; |
18 |
import org.eclipse.jdt.core.IMember; |
19 |
import org.eclipse.swt.events.KeyAdapter; |
19 |
import org.eclipse.jdt.core.IMethod; |
20 |
import org.eclipse.swt.events.KeyEvent; |
20 |
import org.eclipse.jdt.core.JavaModelException; |
21 |
import org.eclipse.swt.events.KeyListener; |
21 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
22 |
import org.eclipse.swt.widgets.Composite; |
22 |
import org.eclipse.jdt.internal.corext.callhierarchy.CallHierarchy; |
23 |
import org.eclipse.swt.widgets.Label; |
23 |
import org.eclipse.jdt.internal.corext.callhierarchy.CallLocation; |
24 |
import org.eclipse.swt.widgets.Menu; |
24 |
import org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper; |
25 |
|
25 |
import org.eclipse.jdt.internal.ui.JavaPlugin; |
|
|
26 |
import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup; |
27 |
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; |
28 |
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater; |
29 |
import org.eclipse.jdt.ui.IContextMenuConstants; |
30 |
import org.eclipse.jdt.ui.JavaElementLabelProvider; |
31 |
import org.eclipse.jdt.ui.actions.OpenViewActionGroup; |
32 |
import org.eclipse.jdt.ui.actions.RefactorActionGroup; |
26 |
import org.eclipse.jface.action.IMenuListener; |
33 |
import org.eclipse.jface.action.IMenuListener; |
27 |
import org.eclipse.jface.action.IMenuManager; |
34 |
import org.eclipse.jface.action.IMenuManager; |
28 |
import org.eclipse.jface.action.IStatusLineManager; |
35 |
import org.eclipse.jface.action.IStatusLineManager; |
Lines 41-47
Link Here
|
41 |
import org.eclipse.jface.viewers.OpenEvent; |
48 |
import org.eclipse.jface.viewers.OpenEvent; |
42 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
49 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
43 |
import org.eclipse.jface.viewers.Viewer; |
50 |
import org.eclipse.jface.viewers.Viewer; |
44 |
|
51 |
import org.eclipse.swt.SWT; |
|
|
52 |
import org.eclipse.swt.custom.SashForm; |
53 |
import org.eclipse.swt.events.KeyAdapter; |
54 |
import org.eclipse.swt.events.KeyEvent; |
55 |
import org.eclipse.swt.events.KeyListener; |
56 |
import org.eclipse.swt.widgets.Composite; |
57 |
import org.eclipse.swt.widgets.Label; |
58 |
import org.eclipse.swt.widgets.Menu; |
45 |
import org.eclipse.ui.IActionBars; |
59 |
import org.eclipse.ui.IActionBars; |
46 |
import org.eclipse.ui.IEditorPart; |
60 |
import org.eclipse.ui.IEditorPart; |
47 |
import org.eclipse.ui.IMemento; |
61 |
import org.eclipse.ui.IMemento; |
Lines 55-77
Link Here
|
55 |
import org.eclipse.ui.part.ViewPart; |
69 |
import org.eclipse.ui.part.ViewPart; |
56 |
import org.eclipse.ui.texteditor.ITextEditor; |
70 |
import org.eclipse.ui.texteditor.ITextEditor; |
57 |
|
71 |
|
58 |
import org.eclipse.jdt.core.IJavaElement; |
|
|
59 |
import org.eclipse.jdt.core.IMember; |
60 |
import org.eclipse.jdt.core.IMethod; |
61 |
import org.eclipse.jdt.core.JavaModelException; |
62 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
63 |
|
64 |
import org.eclipse.jdt.ui.IContextMenuConstants; |
65 |
import org.eclipse.jdt.ui.JavaElementLabelProvider; |
66 |
import org.eclipse.jdt.ui.actions.CustomFiltersActionGroup; |
67 |
import org.eclipse.jdt.ui.actions.OpenViewActionGroup; |
68 |
import org.eclipse.jdt.ui.actions.RefactorActionGroup; |
69 |
|
70 |
import org.eclipse.jdt.internal.ui.JavaPlugin; |
71 |
import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup; |
72 |
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; |
73 |
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater; |
74 |
|
75 |
/** |
72 |
/** |
76 |
* This is the main view for the callers plugin. It builds a tree of callers/callees |
73 |
* This is the main view for the callers plugin. It builds a tree of callers/callees |
77 |
* and allows the user to double click an entry to go to the selected method. |
74 |
* and allows the user to double click an entry to go to the selected method. |
Lines 109-129
Link Here
|
109 |
private int fCurrentOrientation; |
106 |
private int fCurrentOrientation; |
110 |
private int fCurrentCallMode; |
107 |
private int fCurrentCallMode; |
111 |
private int fCurrentJavaLabelFormat; |
108 |
private int fCurrentJavaLabelFormat; |
112 |
private CalleeMethodWrapper fCalleeRoot; |
109 |
private MethodWrapper fCalleeRoot; |
113 |
private CallerMethodWrapper fCallerRoot; |
110 |
private MethodWrapper fCallerRoot; |
114 |
private IMemento fMemento; |
111 |
private IMemento fMemento; |
115 |
private IMethod fShownMethod; |
112 |
private IMethod fShownMethod; |
116 |
private SelectionProviderMediator fSelectionProviderMediator; |
113 |
private SelectionProviderMediator fSelectionProviderMediator; |
117 |
private List fMethodHistory; |
114 |
private List fMethodHistory; |
118 |
private ListViewer fLocationViewer; |
115 |
private ListViewer fLocationViewer; |
119 |
private Menu fListContextMenu; |
116 |
private Menu fLocationContextMenu; |
120 |
private Menu fTreeContextMenu; |
117 |
private Menu fTreeContextMenu; |
121 |
private SashForm fHierarchyLocationSplitter; |
118 |
private SashForm fHierarchyLocationSplitter; |
122 |
private SearchScopeActionGroup fSearchScopeActions; |
119 |
private SearchScopeActionGroup fSearchScopeActions; |
123 |
private ToggleOrientationAction[] fToggleOrientationActions; |
120 |
private ToggleOrientationAction[] fToggleOrientationActions; |
124 |
private ToggleCallModeAction[] fToggleCallModeActions; |
121 |
private ToggleCallModeAction[] fToggleCallModeActions; |
125 |
private ToggleJavaLabelFormatAction[] fToggleJavaLabelFormatActions; |
122 |
private ToggleJavaLabelFormatAction[] fToggleJavaLabelFormatActions; |
126 |
private CustomFiltersActionGroup fCustomFiltersActionGroup; |
123 |
private CallHierarchyFiltersActionGroup fFiltersActionGroup; |
127 |
private HistoryDropDownAction fHistoryDropDownAction; |
124 |
private HistoryDropDownAction fHistoryDropDownAction; |
128 |
private RefreshAction fRefreshAction; |
125 |
private RefreshAction fRefreshAction; |
129 |
private OpenDeclarationAction fOpenDeclarationAction; |
126 |
private OpenDeclarationAction fOpenDeclarationAction; |
Lines 175-181
Link Here
|
175 |
*/ |
172 |
*/ |
176 |
public void setMethod(IMethod method) { |
173 |
public void setMethod(IMethod method) { |
177 |
if (method == null) { |
174 |
if (method == null) { |
178 |
fPagebook.showPage(fNoHierarchyShownLabel); |
175 |
showPage(PAGE_EMPTY); |
179 |
|
176 |
|
180 |
return; |
177 |
return; |
181 |
} |
178 |
} |
Lines 285-294
Link Here
|
285 |
|
282 |
|
286 |
showPage(PAGE_EMPTY); |
283 |
showPage(PAGE_EMPTY); |
287 |
|
284 |
|
288 |
fSelectionProviderMediator= new SelectionProviderMediator(new Viewer[] { fCallHierarchyViewer, fLocationViewer }); |
285 |
fSelectionProviderMediator = new SelectionProviderMediator(new Viewer[] { |
|
|
286 |
fCallHierarchyViewer, fLocationViewer |
287 |
}); |
289 |
|
288 |
|
290 |
IStatusLineManager slManager= getViewSite().getActionBars().getStatusLineManager(); |
289 |
IStatusLineManager slManager = getViewSite().getActionBars().getStatusLineManager(); |
291 |
fSelectionProviderMediator.addSelectionChangedListener(new StatusBarUpdater(slManager)); |
290 |
fSelectionProviderMediator.addSelectionChangedListener(new StatusBarUpdater( |
|
|
291 |
slManager)); |
292 |
getSite().setSelectionProvider(fSelectionProviderMediator); |
292 |
getSite().setSelectionProvider(fSelectionProviderMediator); |
293 |
|
293 |
|
294 |
makeActions(); |
294 |
makeActions(); |
Lines 321-326
Link Here
|
321 |
* @param b |
321 |
* @param b |
322 |
*/ |
322 |
*/ |
323 |
private void enableActions(boolean enabled) { |
323 |
private void enableActions(boolean enabled) { |
|
|
324 |
fLocationContextMenu.setEnabled(enabled); |
325 |
|
324 |
// TODO: Is it possible to disable the actions on the toolbar and on the view menu? |
326 |
// TODO: Is it possible to disable the actions on the toolbar and on the view menu? |
325 |
} |
327 |
} |
326 |
|
328 |
|
Lines 442-448
Link Here
|
442 |
*/ |
444 |
*/ |
443 |
public void dispose() { |
445 |
public void dispose() { |
444 |
disposeMenu(fTreeContextMenu); |
446 |
disposeMenu(fTreeContextMenu); |
445 |
disposeMenu(fListContextMenu); |
447 |
disposeMenu(fLocationContextMenu); |
446 |
|
448 |
|
447 |
super.dispose(); |
449 |
super.dispose(); |
448 |
} |
450 |
} |
Lines 483-495
Link Here
|
483 |
Object structuredSelection = ((IStructuredSelection) selection).getFirstElement(); |
485 |
Object structuredSelection = ((IStructuredSelection) selection).getFirstElement(); |
484 |
|
486 |
|
485 |
if (structuredSelection instanceof IMember) { |
487 |
if (structuredSelection instanceof IMember) { |
486 |
CallHierarchy.jumpToMember((IMember) structuredSelection); |
488 |
CallHierarchyUI.jumpToMember((IMember) structuredSelection); |
487 |
} else if (structuredSelection instanceof MethodWrapper) { |
489 |
} else if (structuredSelection instanceof MethodWrapper) { |
488 |
MethodWrapper methodWrapper = (MethodWrapper) structuredSelection; |
490 |
MethodWrapper methodWrapper = (MethodWrapper) structuredSelection; |
489 |
|
491 |
|
490 |
CallHierarchy.jumpToMember(methodWrapper.getMember()); |
492 |
CallHierarchyUI.jumpToMember(methodWrapper.getMember()); |
491 |
} else if (structuredSelection instanceof CallLocation) { |
493 |
} else if (structuredSelection instanceof CallLocation) { |
492 |
CallHierarchy.jumpToMember(((CallLocation) structuredSelection).getCalledMember()); |
494 |
CallHierarchyUI.jumpToMember(((CallLocation) structuredSelection).getCalledMember()); |
493 |
} |
495 |
} |
494 |
} |
496 |
} |
495 |
} |
497 |
} |
Lines 506-512
Link Here
|
506 |
if (firstCall != null) { |
508 |
if (firstCall != null) { |
507 |
jumpToLocation(firstCall); |
509 |
jumpToLocation(firstCall); |
508 |
} else { |
510 |
} else { |
509 |
CallHierarchy.jumpToMember(methodWrapper.getMember()); |
511 |
CallHierarchyUI.jumpToMember(methodWrapper.getMember()); |
510 |
} |
512 |
} |
511 |
} else if (structuredSelection instanceof CallLocation) { |
513 |
} else if (structuredSelection instanceof CallLocation) { |
512 |
jumpToLocation((CallLocation) structuredSelection); |
514 |
jumpToLocation((CallLocation) structuredSelection); |
Lines 557-564
Link Here
|
557 |
/** |
559 |
/** |
558 |
* @param selection |
560 |
* @param selection |
559 |
*/ |
561 |
*/ |
560 |
private void locationSelectionChanged(ISelection selection) { |
562 |
private void locationSelectionChanged(ISelection selection) {} |
561 |
} |
|
|
562 |
|
563 |
|
563 |
/** |
564 |
/** |
564 |
* @param selection |
565 |
* @param selection |
Lines 569-576
Link Here
|
569 |
|
570 |
|
570 |
if (selectedElement instanceof MethodWrapper) { |
571 |
if (selectedElement instanceof MethodWrapper) { |
571 |
MethodWrapper methodWrapper = (MethodWrapper) selectedElement; |
572 |
MethodWrapper methodWrapper = (MethodWrapper) selectedElement; |
572 |
|
573 |
|
573 |
revealElementInEditor(methodWrapper, fCallHierarchyViewer); |
574 |
revealElementInEditor(methodWrapper, fCallHierarchyViewer); |
574 |
updateLocationsView(methodWrapper); |
575 |
updateLocationsView(methodWrapper); |
575 |
} else { |
576 |
} else { |
576 |
updateLocationsView(null); |
577 |
updateLocationsView(null); |
Lines 581-601
Link Here
|
581 |
private void revealElementInEditor(Object elem, Viewer originViewer) { |
582 |
private void revealElementInEditor(Object elem, Viewer originViewer) { |
582 |
// only allow revealing when the type hierarchy is the active pagae |
583 |
// only allow revealing when the type hierarchy is the active pagae |
583 |
// no revealing after selection events due to model changes |
584 |
// no revealing after selection events due to model changes |
584 |
|
|
|
585 |
if (getSite().getPage().getActivePart() != this) { |
585 |
if (getSite().getPage().getActivePart() != this) { |
586 |
return; |
586 |
return; |
587 |
} |
587 |
} |
588 |
|
588 |
|
589 |
if (fSelectionProviderMediator.getViewerInFocus() != originViewer) { |
589 |
if (fSelectionProviderMediator.getViewerInFocus() != originViewer) { |
590 |
return; |
590 |
return; |
591 |
} |
591 |
} |
592 |
|
592 |
|
593 |
if (elem instanceof MethodWrapper) { |
593 |
if (elem instanceof MethodWrapper) { |
594 |
CallLocation callLocation= CallHierarchy.getCallLocation(elem); |
594 |
CallLocation callLocation = CallHierarchy.getCallLocation(elem); |
|
|
595 |
|
595 |
if (callLocation != null) { |
596 |
if (callLocation != null) { |
596 |
IEditorPart editorPart= CallHierarchy.isOpenInEditor(callLocation); |
597 |
IEditorPart editorPart = CallHierarchyUI.isOpenInEditor(callLocation); |
|
|
598 |
|
597 |
if (editorPart != null) { |
599 |
if (editorPart != null) { |
598 |
getSite().getPage().bringToTop(editorPart); |
600 |
getSite().getPage().bringToTop(editorPart); |
|
|
601 |
|
599 |
if (editorPart instanceof ITextEditor) { |
602 |
if (editorPart instanceof ITextEditor) { |
600 |
ITextEditor editor = (ITextEditor) editorPart; |
603 |
ITextEditor editor = (ITextEditor) editorPart; |
601 |
editor.selectAndReveal(callLocation.getStart(), |
604 |
editor.selectAndReveal(callLocation.getStart(), |
Lines 603-619
Link Here
|
603 |
} |
606 |
} |
604 |
} |
607 |
} |
605 |
} else { |
608 |
} else { |
606 |
IEditorPart editorPart= CallHierarchy.isOpenInEditor(elem); |
609 |
IEditorPart editorPart = CallHierarchyUI.isOpenInEditor(elem); |
607 |
getSite().getPage().bringToTop(editorPart); |
610 |
getSite().getPage().bringToTop(editorPart); |
608 |
EditorUtility.revealInEditor(editorPart, ((MethodWrapper) elem).getMember()); |
611 |
EditorUtility.revealInEditor(editorPart, |
|
|
612 |
((MethodWrapper) elem).getMember()); |
609 |
} |
613 |
} |
610 |
} else if (elem instanceof IJavaElement) { |
614 |
} else if (elem instanceof IJavaElement) { |
611 |
IEditorPart editorPart= EditorUtility.isOpenInEditor(elem); |
615 |
IEditorPart editorPart = EditorUtility.isOpenInEditor(elem); |
|
|
616 |
|
612 |
if (editorPart != null) { |
617 |
if (editorPart != null) { |
613 |
// getSite().getPage().removePartListener(fPartListener); |
618 |
// getSite().getPage().removePartListener(fPartListener); |
614 |
getSite().getPage().bringToTop(editorPart); |
619 |
getSite().getPage().bringToTop(editorPart); |
615 |
EditorUtility.revealInEditor(editorPart, (IJavaElement) elem); |
620 |
EditorUtility.revealInEditor(editorPart, (IJavaElement) elem); |
616 |
// getSite().getPage().addPartListener(fPartListener); |
621 |
|
|
|
622 |
// getSite().getPage().addPartListener(fPartListener); |
617 |
} |
623 |
} |
618 |
} |
624 |
} |
619 |
} |
625 |
} |
Lines 637-657
Link Here
|
637 |
|
643 |
|
638 |
protected void handleKeyEvent(KeyEvent event) { |
644 |
protected void handleKeyEvent(KeyEvent event) { |
639 |
if (event.stateMask == 0) { |
645 |
if (event.stateMask == 0) { |
640 |
// if (event.keyCode == SWT.F3) { |
646 |
// if (event.keyCode == SWT.F3) { |
641 |
// if ((fOpenDeclarationAction != null) && |
647 |
// if ((fOpenDeclarationAction != null) && |
642 |
// fOpenDeclarationAction.isEnabled()) { |
648 |
// fOpenDeclarationAction.isEnabled()) { |
643 |
// fOpenDeclarationAction.run(); |
649 |
// fOpenDeclarationAction.run(); |
644 |
|
650 |
// return; |
645 |
// return; |
651 |
// } |
646 |
// } |
652 |
// } else |
647 |
// } else |
653 |
if (event.keyCode == SWT.F5) { |
648 |
if (event.keyCode == SWT.F5) { |
654 |
if ((fRefreshAction != null) && fRefreshAction.isEnabled()) { |
649 |
if ((fRefreshAction != null) && fRefreshAction.isEnabled()) { |
655 |
fRefreshAction.run(); |
650 |
fRefreshAction.run(); |
656 |
|
651 |
|
657 |
return; |
652 |
return; |
|
|
653 |
} |
654 |
} |
658 |
} |
|
|
659 |
} |
655 |
} |
660 |
} |
656 |
} |
661 |
} |
657 |
|
662 |
|
Lines 659-683
Link Here
|
659 |
return getViewSite().getActionBars(); |
664 |
return getViewSite().getActionBars(); |
660 |
} |
665 |
} |
661 |
|
666 |
|
662 |
private void setCalleeRoot(CalleeMethodWrapper calleeRoot) { |
667 |
private void setCalleeRoot(MethodWrapper calleeRoot) { |
663 |
this.fCalleeRoot = calleeRoot; |
668 |
this.fCalleeRoot = calleeRoot; |
664 |
} |
669 |
} |
665 |
|
670 |
|
666 |
private MethodWrapper getCalleeRoot() { |
671 |
private MethodWrapper getCalleeRoot() { |
667 |
if (fCalleeRoot == null) { |
672 |
if (fCalleeRoot == null) { |
668 |
fCalleeRoot = (CalleeMethodWrapper) CallHierarchy.getDefault().getCalleeRoot(fShownMethod); |
673 |
fCalleeRoot = (MethodWrapper) CallHierarchy.getDefault().getCalleeRoot(fShownMethod); |
669 |
} |
674 |
} |
670 |
|
675 |
|
671 |
return fCalleeRoot; |
676 |
return fCalleeRoot; |
672 |
} |
677 |
} |
673 |
|
678 |
|
674 |
private void setCallerRoot(CallerMethodWrapper callerRoot) { |
679 |
private void setCallerRoot(MethodWrapper callerRoot) { |
675 |
this.fCallerRoot = callerRoot; |
680 |
this.fCallerRoot = callerRoot; |
676 |
} |
681 |
} |
677 |
|
682 |
|
678 |
private MethodWrapper getCallerRoot() { |
683 |
private MethodWrapper getCallerRoot() { |
679 |
if (fCallerRoot == null) { |
684 |
if (fCallerRoot == null) { |
680 |
fCallerRoot = (CallerMethodWrapper) CallHierarchy.getDefault().getCallerRoot(fShownMethod); |
685 |
fCallerRoot = (MethodWrapper) CallHierarchy.getDefault().getCallerRoot(fShownMethod); |
681 |
} |
686 |
} |
682 |
|
687 |
|
683 |
return fCallerRoot; |
688 |
return fCallerRoot; |
Lines 705-720
Link Here
|
705 |
fLocationViewer.setLabelProvider(new LocationLabelProvider()); |
710 |
fLocationViewer.setLabelProvider(new LocationLabelProvider()); |
706 |
fLocationViewer.setInput(new ArrayList()); |
711 |
fLocationViewer.setInput(new ArrayList()); |
707 |
fLocationViewer.getControl().addKeyListener(createKeyListener()); |
712 |
fLocationViewer.getControl().addKeyListener(createKeyListener()); |
708 |
|
713 |
|
709 |
fOpenLocationAction= new OpenLocationAction(getSite()); |
714 |
fOpenLocationAction = new OpenLocationAction(getSite()); |
710 |
fLocationViewer.addOpenListener(new IOpenListener() { |
715 |
fLocationViewer.addOpenListener(new IOpenListener() { |
711 |
public void open(OpenEvent event) { |
716 |
public void open(OpenEvent event) { |
712 |
fOpenLocationAction.run(); |
717 |
fOpenLocationAction.run(); |
713 |
} |
718 |
} |
714 |
}); |
719 |
}); |
715 |
|
|
|
716 |
// fListViewer.addDoubleClickListener(this); |
717 |
|
720 |
|
|
|
721 |
// fListViewer.addDoubleClickListener(this); |
718 |
MenuManager menuMgr = new MenuManager(); //$NON-NLS-1$ |
722 |
MenuManager menuMgr = new MenuManager(); //$NON-NLS-1$ |
719 |
menuMgr.setRemoveAllWhenShown(true); |
723 |
menuMgr.setRemoveAllWhenShown(true); |
720 |
menuMgr.addMenuListener(new IMenuListener() { |
724 |
menuMgr.addMenuListener(new IMenuListener() { |
Lines 726-733
Link Here
|
726 |
} |
730 |
} |
727 |
}); |
731 |
}); |
728 |
|
732 |
|
729 |
fListContextMenu = menuMgr.createContextMenu(fLocationViewer.getControl()); |
733 |
fLocationContextMenu = menuMgr.createContextMenu(fLocationViewer.getControl()); |
730 |
fLocationViewer.getControl().setMenu(fListContextMenu); |
734 |
fLocationViewer.getControl().setMenu(fLocationContextMenu); |
731 |
|
735 |
|
732 |
// Register viewer with site. This must be done before making the actions. |
736 |
// Register viewer with site. This must be done before making the actions. |
733 |
getSite().registerContextMenu(menuMgr, fLocationViewer); |
737 |
getSite().registerContextMenu(menuMgr, fLocationViewer); |
Lines 829-835
Link Here
|
829 |
fOpenDeclarationAction = new OpenDeclarationAction(this.getSite()); |
833 |
fOpenDeclarationAction = new OpenDeclarationAction(this.getSite()); |
830 |
fFocusOnSelectionAction = new FocusOnSelectionAction(this); |
834 |
fFocusOnSelectionAction = new FocusOnSelectionAction(this); |
831 |
fSearchScopeActions = new SearchScopeActionGroup(this); |
835 |
fSearchScopeActions = new SearchScopeActionGroup(this); |
832 |
fCustomFiltersActionGroup = new CustomFiltersActionGroup(this, |
836 |
fFiltersActionGroup = new CallHierarchyFiltersActionGroup(this, |
833 |
fCallHierarchyViewer); |
837 |
fCallHierarchyViewer); |
834 |
fHistoryDropDownAction = new HistoryDropDownAction(this); |
838 |
fHistoryDropDownAction = new HistoryDropDownAction(this); |
835 |
fHistoryDropDownAction.setEnabled(false); |
839 |
fHistoryDropDownAction.setEnabled(false); |
Lines 850-856
Link Here
|
850 |
|
854 |
|
851 |
fActionGroups = new CompositeActionGroup(new ActionGroup[] { |
855 |
fActionGroups = new CompositeActionGroup(new ActionGroup[] { |
852 |
new OpenViewActionGroup(this), new RefactorActionGroup(this), |
856 |
new OpenViewActionGroup(this), new RefactorActionGroup(this), |
853 |
fSearchScopeActions, fCustomFiltersActionGroup |
857 |
fSearchScopeActions, fFiltersActionGroup |
854 |
}); |
858 |
}); |
855 |
} |
859 |
} |
856 |
|
860 |
|
Lines 904-911
Link Here
|
904 |
} |
908 |
} |
905 |
|
909 |
|
906 |
static CallHierarchyViewPart findAndShowCallersView(IWorkbenchPartSite site) { |
910 |
static CallHierarchyViewPart findAndShowCallersView(IWorkbenchPartSite site) { |
907 |
IWorkbenchPage workbenchPage= site.getPage(); |
911 |
IWorkbenchPage workbenchPage = site.getPage(); |
908 |
CallHierarchyViewPart callersView= null; |
912 |
CallHierarchyViewPart callersView = null; |
909 |
|
913 |
|
910 |
try { |
914 |
try { |
911 |
callersView = (CallHierarchyViewPart) workbenchPage.showView(CallHierarchyViewPart.CALLERS_VIEW_ID); |
915 |
callersView = (CallHierarchyViewPart) workbenchPage.showView(CallHierarchyViewPart.CALLERS_VIEW_ID); |