Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui.resource   Previous This
Package
Next

 


Class ResourceDecoder

public abstract class ResourceDecoder
{
  // Constructors
  public ResourceDecoder();
  public ResourceDecoder(InputStream is);

  // Methods
  public abstract byte[] getBytes(int type, int strId)
        throws ResourceFormattingException ;
  public abstract byte[] getBytes(int type, String name)
        throws ResourceFormattingException ;
  public abstract UIDialog getDialog(int dlgId)
        throws ResourceFormattingException ;
  public abstract UIDialog getDialog(String dlgname)
        throws ResourceFormattingException ;
  public int getLocale();
  public abstract String getString(int strId)
        throws ResourceFormattingException ;
  public abstract void populateDialog(UIDialog dlg, int dlgId,
        int language) throws ResourceFormattingException ;
  public abstract void populateDialog(UIDialog dlg, String dlgname,
        int language) throws ResourceFormattingException ;
  public abstract void setLocale(int locale);
}

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

Constructors

ResourceDecoder

public ResourceDecoder();

Creates an empty resource decoder.

ResourceDecoder

public ResourceDecoder(InputStream is);

Creates a resource decoder based on a byte input stream.

ParameterDescription
is The InputStream object that the decoder is based on.

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.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the resource identifier is not valid.

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 UIDialog getDialog(int dlgId)
        throws ResourceFormattingException ;

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

ParameterDescription
dlgId The identifier of the dialog resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the dialog identifier is not valid.

getDialog

public abstract UIDialog getDialog(String dlgname)
        throws ResourceFormattingException ;

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

ParameterDescription
dlgname The name of the string resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the string resource name is not valid.

getLocale

public int getLocale();

Retrieves the current locale.

Return Value:

Returns 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.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the string identifier is not valid.

populateDialog

public abstract void populateDialog(UIDialog dlg, int dlgId,
        int language) throws ResourceFormattingException ;

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.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog identifier is not valid.

populateDialog

public abstract void populateDialog(UIDialog dlg, String dlgname,
        int language) throws ResourceFormattingException ;

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.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog name is not valid.

setLocale

public abstract void setLocale(int locale);

Sets the current locale.

ParameterDescription
locale The locale to be set.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.