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

Class ResourceDecoder

Constructors , Methods

public abstract class ResourceDecoder {
  // Constructors
  public ResourceDecoder(String filename);
  public ResourceDecoder(URL url, String filename);
  public ResourceDecoder(URL url);
  // Methods
  public abstract Dialog getDialog(int dlgId);
  public abstract Dialog getDialog(String dlgname);
  public int getLocale();
  public abstract void setLocale(int locale);
  public abstract String getString(int strId) throws ResourceFormattingException;
  public abstract byte[] getBytes(int type, int strId) throws ResourceFormattingException;
  public abstract byte[] getBytes(int type, String name) throws ResourceFormattingException; 
  public abstract void populateDialog(Dialog dlg, int dlgId, int language);
  public abstract void populateDialog(Dialog dlg, String dlgname, int language);
}

This is an abstract class that reads resources out of a resource file. The format of the file is unspecified and is left to the classes deriving from this class.


Constructors


ResourceDecoder

public ResourceDecoder(String filename);

Creates a new resource decoder based on the file specified.

ParameterDescription
url The URL base for the resource file.
filename The filename base for the resource file.


ResourceDecoder

public ResourceDecoder(URL url, String filename);

Creates a new resource decoder based on the URL or file specified.

ParameterDescription
url The URL base for the resource file.
filename The file name base for the resource file.


ResourceDecoder

public ResourceDecoder(URL url);

Creates a new resource decoder based on the URL specified.

ParameterDescription
url The URL base for the resource file.


Methods


getBytes

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

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

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


getBytes

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

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

Return Value:

Returns the byte array.

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


getDialog

public abstract 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 abstract Dialog getDialog(String dlgname);

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

ParameterDescription
dlgname The name of the dialog resource.


getLocale

public int getLocale();

Retrieves the current locale.


getString

public abstract String getString(int strId) throws ResourceFormattingException;

Retrieves a string resource, with the specified identifier, in the current locale.

ParameterDescription
strID The identifier of the string resource.


populateDialog

public abstract void populateDialog(Dialog dlg, int dlgId, int language);

Fills an existing dialog box with components from a dialog resource using the dialog resource identifier.

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


populateDialog

public abstract void populateDialog(Dialog dlg, String dlgname, int language);

Fills an existing dialog box with components such as from a dialog resource using the dialog resource name.

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


setLocale

public abstract void setLocale(int locale);

Sets the current locale.

ParameterDescription
locale The locale to be set.



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