Skip to content

Commit

Permalink
Move filters Button in Call Hierarchy view to the top level Bar (#26):
Browse files Browse the repository at this point in the history
Before the changes the filters could only be accessed through the "View
Menu" (three dots), which is inconvenient considering that the filters
button is rather important and frequently used.
After the changes the filters can be accessed by clicking on the icon in
the top level bar as well as the old way through the view menu.
  • Loading branch information
jannisCode committed Sep 25, 2024
1 parent 30472e0 commit 1557309
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ protected void open(ISelection selection, boolean activate) {
private IPartListener2 fPartListener;
private boolean fIsPinned;
private PinCallHierarchyViewAction fPinViewAction;
private FiltersAction fFiltersAction;


public CallHierarchyViewPart() {
Expand Down Expand Up @@ -1024,6 +1025,7 @@ private void fillActionBars() {
}
toolBar.add(fHistoryDropDownAction);
toolBar.add(fPinViewAction);
toolBar.add(fFiltersAction);
}

private void makeActions() {
Expand All @@ -1048,6 +1050,9 @@ private void makeActions() {
fExpandWithConstructorsAction= new ExpandWithConstructorsAction(this, fCallHierarchyViewer);
fRemoveFromViewAction= new RemoveFromViewAction(this, fCallHierarchyViewer);
fPinViewAction= new PinCallHierarchyViewAction(this);

fFiltersAction = new FiltersAction(this);

fToggleOrientationActions = new ToggleOrientationAction[] {
new ToggleOrientationAction(this, VIEW_ORIENTATION_VERTICAL),
new ToggleOrientationAction(this, VIEW_ORIENTATION_HORIZONTAL),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.eclipse.jdt.internal.ui.callhierarchy;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.window.Window;

import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPluginImages;

public class FiltersAction extends Action {
private CallHierarchyViewPart fPart;


public FiltersAction (CallHierarchyViewPart view) {


super();
fPart = view;
setToolTipText(CallHierarchyMessages.ShowFilterDialogAction_text);

setText(CallHierarchyMessages.ShowFilterDialogAction_text);
setImageDescriptor(JavaPluginImages.DESC_ELCL_FILTER);
setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_FILTER);

PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_REFRESH_VIEW_ACTION);

}

@Override
public void run() {

openFiltersDialog();

}

private void openFiltersDialog() {
FiltersDialog dialog= new FiltersDialog(
fPart.getViewSite().getShell());

if(Window.OK == dialog.open()) {
fPart.refresh();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ protected boolean isResizable() {
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite) super.createDialogArea(parent);


createTestCodeArea(composite);
createNamesArea(composite);
new Label(composite, SWT.NONE); // Filler
Expand Down

0 comments on commit 1557309

Please sign in to comment.