1 /*******************************************************************************
2 * Copyright (c) 2010, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.callhierarchy;
13 import org.eclipse.core.runtime.Assert;
15 import org.eclipse.jface.action.Action;
16 import org.eclipse.jface.window.Window;
19 * Action class to create and open the search in dialog.
23 public class ShowSearchInDialogAction extends Action {
24 private CallHierarchyViewPart fPart;
26 private SearchInDialog fSearchInDialog;
29 * Action to show the <code>SearchInDialog</code>.
31 * @param part the call hierarchy view part
32 * @param viewer the call hierarchy viewer
34 public ShowSearchInDialogAction(CallHierarchyViewPart part, CallHierarchyViewer viewer) {
35 Assert.isNotNull(part);
36 Assert.isNotNull(viewer);
38 fSearchInDialog= new SearchInDialog(fPart.getViewSite().getShell());
39 setText(CallHierarchyMessages.ShowSearchInDialogAction_text);
43 * Returns the <code>SearchInDialog</code>.
45 * @return the <code>searchInDialog</code>
47 public SearchInDialog getSearchInDialog() {
48 return fSearchInDialog;
52 * @see org.eclipse.jface.action.Action#run()
56 SearchInDialog dialog= getSearchInDialog();
57 if (dialog.open() == Window.OK && dialog.isIncludeMaskChanged()) {
58 fPart.setInputElements(fPart.getInputElements());