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 java.util.Arrays;
15 import java.util.Iterator;
18 import org.eclipse.core.runtime.IAdaptable;
20 import org.eclipse.core.resources.IFile;
21 import org.eclipse.core.resources.IResource;
23 import org.eclipse.search.ui.text.Match;
25 public class FileEntry implements IAdaptable {
27 private IFile fPropertiesFile;
28 private String fMessage;
30 public FileEntry(IFile propertiesFile, String message) {
31 fPropertiesFile= propertiesFile;
35 public IFile getPropertiesFile() {
36 return fPropertiesFile;
39 public String getMessage() {
44 public String toString() {
48 public Object getAdapter(Class adapter) {
49 if (IResource.class.equals(adapter))
50 return fPropertiesFile;
54 public void generated_6187658147420924307(IFile file, Set<Match> matches, NLSSearchResult nlssearchresult) {
55 if (getPropertiesFile().equals(file)) {
56 matches.addAll(Arrays.asList(nlssearchresult.getMatches(this)));
60 public void generated_2140360628205478014(NLSSearchResultRequestor nlssearchresultrequestor, Iterator<Object> iter) {
61 while (iter.hasNext()) {
62 String propertyName= (String) iter.next();
63 nlssearchresultrequestor.addMatch(this, propertyName);
65 nlssearchresultrequestor.fResult.addFileEntryGroup(this);