Package com.ms.ui.resource |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class Win32ResourceDecoder extends ResourceDecoder { // Constructors public Win32ResourceDecoder(String filename) throws FileNotFoundException; public Win32ResourceDecoder(URL u, String filename) throws MalformedURLException, IOException; public Win32ResourceDecoder(URL url) throws MalformedURLException, IOException; // Methods public Dialog getDialog(int dlgId); public Dialog getDialog(String dlgname); public void populateDialog(Dialog dlg, int dlgId, int language); public void populateDialog(Dialog dlg, String dlgname, int language); public void setLocale(int locale); public String getString(int strId) throws ResourceFormattingException; public void enumerateResources(ResourceTypeListener rtl) throws ResourceFormattingException; public synchronized void enumerateResources(ResourceTypeListener rtl, int lang, int type) throws ResourceFormattingException; public byte[] getBytes(int type, int id) throws ResourceFormattingException; public byte[] getBytes(int type, String name) throws ResourceFormattingException; }
This class is used to utilize Win32 resource (.res) files. This class is provided to help developers maximize any investment they have already made in Win32 resources for Windows applications by being able to use the same resources files in their Java applications and applets.
Resource files are particularly useful for localizing content, because the user interface (UI) elements—or—resources can be maintained in a separate file and localized apart from the source code. These resources are referenced either by name or resource identifier by this class and instantiated in the Java applet or application.
public Win32ResourceDecoder(String filename) throws FileNotFoundException;Creates a new Win32 resource (.res) decoder based on the file specified.
Parameter Description filename The file containing the resources.
public Win32ResourceDecoder(URL u, String filename) throws MalformedURLException, IOException;Creates a new Win32 resource (.res) decoder based on the URL or file specified.
Parameter Description u The URL containing the resources. filename The file containing the resources.
public Win32ResourceDecoder(URL url) throws MalformedURLException, IOException;Creates a new Win32 resource (.res) decoder based on the URL specified.
Parameter Description u The URL containing the resources.
public void enumerateResources(ResourceTypeListener rtl) throws ResourceFormattingException;Enumerates back to the application all the resources in the file.
Parameter Description rtl The object supporting a ResourceTypeListener interface.
public synchronized void enumerateResources(ResourceTypeListener rtl, int lang, int type) throws ResourceFormattingException;Enumerates back to the application all resources, conforming to the language and type specified.
Parameter Description rtl lang The language of resources to enumerate. Type The type of resources to enumerate. For a list of types, see the .
public byte[] getBytes(int type, int id) throws ResourceFormattingException;Retrieves a byte block, of the resource type specified, with the given identifier.
Parameter Description type The resource type of the byte block. strId The string identifier of the byte block.
public byte[] getBytes(int type, String name) throws ResourceFormattingException;Retrieves a byte block, of the resource type specified, with the given name.
Parameter Description type The resource type of the byte block. name The resource name of the byte block.
public Dialog getDialog(int dlgId);Retrieves a dialog box, in the current locale, with the specified dialog identifier.
Parameter Description dlgId The identifier of the dialog resource.
public Dialog getDialog(String dlgname);Retrieves a dialog box, in the current locale, with the specified name.
Parameter Description dlgname The name of the dialog resource.
public String getString(int strId) throws ResourceFormattingException;Retrieves a dialog box, in the current locale, with the specified dialog identifier.
Parameter Description dlgId The identifier of the dialog resource.
public void populateDialog(Dialog dlg, int dlgId, int language);Fills an existing dialog box, in the current locale with the specified identifier with the data and/or controls as specified in the resource. This is useful for classes that are derived from dialog.
Parameter Description dlg The dialog object to populate. dlgid The identifier of the dialog resource containing the components. language The language of the resources.
public void populateDialog(Dialog dlg, String dlgname, int language);Fills an existing dialog box, in the current locale with the specified name with the data and/or controls as specified in the resource. This is useful for classes which are derived from dialog.
Parameter Description dlg The dialog object to populate. dlgname The name of the dialog resource containing the components. language The language of the resources.
public void setLocale(int locale);Sets the current locale.
Parameter Description locale The locale to be set.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.