KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > common > util > ResourceLocator


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: ResourceLocator.java,v 1.3 2005/06/08 06:19:08 nickb Exp $
16  */

17 package org.eclipse.emf.common.util;
18
19
20 import java.net.URL JavaDoc;
21
22
23 /**
24  * A locator of Java resources.
25  */

26 public interface ResourceLocator
27 {
28   /**
29    * Returns the URL from which all resources are based.
30    * @return the URL from which all resources are based.
31    */

32   URL JavaDoc getBaseURL();
33
34   /**
35    * Returns the description that can be used to create the image resource associated with the key.
36    * The description will typically be in the form of a URL to the image data.
37    * Creation of an actual image depends on the GUI environment;
38    * within Eclipse, org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry can be used.
39    * @param key the key of the image resource.
40    * @return the description on the image resource.
41    */

42   Object JavaDoc getImage(String JavaDoc key);
43
44   /**
45    * Returns the string resource associated with the key.
46    * @param key the key of the string resource.
47    * @return the string resource associated with the key.
48    */

49   String JavaDoc getString(String JavaDoc key);
50
51   /**
52    * Returns the string resource associated with the key.
53    * @param key the key of the string resource.
54    * @param translate whether the result is to be translated to the current locale.
55    * @return the string resource associated with the key.
56    */

57   String JavaDoc getString(String JavaDoc key, boolean translate);
58
59   /**
60    * Returns a string resource associated with the key, and peforms substitutions.
61    * @param key the key of the string.
62    * @param substitutions the message substitutions.
63    * @return a string resource associated with the key.
64    * @see #getString(String)
65    * @see java.text.MessageFormat#format(String, Object[])
66    */

67   String JavaDoc getString(String JavaDoc key, Object JavaDoc [] substitutions);
68
69   /**
70    * Returns a string resource associated with the key, and peforms substitutions.
71    * @param key the key of the string.
72    * @param substitutions the message substitutions.
73    * @param translate whether the result is to be translated to the current locale.
74    * @return a string resource associated with the key.
75    * @see #getString(String)
76    * @see java.text.MessageFormat#format(String, Object[])
77    */

78   String JavaDoc getString(String JavaDoc key, Object JavaDoc [] substitutions, boolean translate);
79 }
80
Popular Tags