1 /*******************************************************************************
2 * Copyright (c) 2000, 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 *******************************************************************************/
12 package org.eclipse.jdt.internal.ui.refactoring.nls.search;
14 import org.eclipse.search.ui.text.Match;
16 import org.eclipse.jdt.core.IJavaElement;
18 import org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener;
22 public class NLSSearchEditorOpener extends JavaSearchEditorOpener {
24 protected Object getElementToOpen(Match match) {
25 Object element= match.getElement();
26 if (element instanceof IJavaElement) {
28 } else if (element instanceof FileEntry) {
29 FileEntry fileEntry= (FileEntry) element;
30 return fileEntry.getPropertiesFile();
31 } else if (element instanceof CompilationUnitEntry) {
32 return ((CompilationUnitEntry)element).getCompilationUnit();
34 // this should not happen