KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > runtime > adaptor > BundleLocalizationImpl


1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.runtime.adaptor;
12
13 import java.util.ArrayList JavaDoc;
14 import java.util.ResourceBundle JavaDoc;
15 import org.eclipse.osgi.service.localization.BundleLocalization;
16 import org.osgi.framework.Bundle;
17
18 /**
19  * The implementation of the service that gets ResourceBundle objects from a given
20  * bundle with a given locale.
21  *
22  * <p>Internal class.</p>
23  */

24
25 public class BundleLocalizationImpl implements BundleLocalization {
26     ArrayList JavaDoc encountered = new ArrayList JavaDoc();
27
28     /**
29      * The getLocalization method gets a ResourceBundle object for the given
30      * locale and bundle.
31      *
32      * @return A <code>ResourceBundle</code> object for the given bundle and locale.
33      * If null is passed for the locale parameter, the default locale is used.
34      */

35     public ResourceBundle JavaDoc getLocalization(Bundle JavaDoc bundle, String JavaDoc locale) {
36         return ((org.eclipse.osgi.framework.internal.core.AbstractBundle) (bundle)).getResourceBundle(locale);
37     }
38 }
Popular Tags