Package com.ms.ui.resource Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class Win32ResourceDecoder

Constructors , Methods

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.


Constructors


Win32ResourceDecoder

public Win32ResourceDecoder(String filename) throws FileNotFoundException;

Creates a new Win32 resource (.res) decoder based on the file specified.

ParameterDescription
filename The file containing the resources.


Win32ResourceDecoder

public Win32ResourceDecoder(URL u, String filename) throws MalformedURLException, IOException;

Creates a new Win32 resource (.res) decoder based on the URL or file specified.

ParameterDescription
u The URL containing the resources.
filename The file containing the resources.


Win32ResourceDecoder

public Win32ResourceDecoder(URL url) throws MalformedURLException, IOException;

Creates a new Win32 resource (.res) decoder based on the URL specified.

ParameterDescription
u The URL containing the resources.


Methods


enumerateResources

public void enumerateResources(ResourceTypeListener rtl)										throws ResourceFormattingException;

Enumerates back to the application all the resources in the file.

ParameterDescription
rtl The object supporting a ResourceTypeListener interface.


enumerateResources

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.

ParameterDescription
rtl
lang The language of resources to enumerate.
Type The type of resources to enumerate. For a list of types, see the .


getBytes

public byte[] getBytes(int type, int id) throws ResourceFormattingException;

Retrieves a byte block, of the resource type specified, with the given identifier.

ParameterDescription
type The resource type of the byte block.
strId The string identifier of the byte block.


getBytes

public byte[] getBytes(int type, String name) throws ResourceFormattingException;

Retrieves a byte block, of the resource type specified, with the given name.

ParameterDescription
type The resource type of the byte block.
name The resource name of the byte block.


getDialog

public Dialog getDialog(int dlgId);

Retrieves a dialog box, in the current locale, with the specified dialog identifier.

ParameterDescription
dlgId The identifier of the dialog resource.


getDialog

public Dialog getDialog(String dlgname);

Retrieves a dialog box, in the current locale, with the specified name.

ParameterDescription
dlgname The name of the dialog resource.


getString

public String getString(int strId) throws ResourceFormattingException;

Retrieves a dialog box, in the current locale, with the specified dialog identifier.

ParameterDescription
dlgId The identifier of the dialog resource.


populateDialog

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.

ParameterDescription
dlg The dialog object to populate.
dlgid The identifier of the dialog resource containing the components.
language The language of the resources.


populateDialog

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.

ParameterDescription
dlg The dialog object to populate.
dlgname The name of the dialog resource containing the components.
language The language of the resources.


setLocale

public void setLocale(int locale);

Sets the current locale.

ParameterDescription
locale The locale to be set.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.