Packages
 In this topic

*Constructors

*Methods

 

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

 


Class UIRow

public class UIRow extends UIPanel
{
  // Constructors
  public UIRow();
  public UIRow(Object columns[]);

  // Methods
  public String getName();
  public int getRoleCode();
  public void requestFocus();
  public void setSelected(boolean on);
}

This class implements a row control. Typically,UIRow objects are used to populate a list object, such as UIList, when the viewing object displays data in columns. UIScrollViewer and its derivative, UIColumnViewer, both (typically) use lists populated with UIRow objects. Other containers, such as UIPanel and Panel, can also use UIRow objects for various content.

The following example shows how to construct various UIRow objects.

// You must pass the UIRow constructor an array of IUIComponent
//  or String objects. This array can perhaps represent
// the results of a database query. 
 String objectArray[] = {queryResultName, queryResultAddress,
           queryResultCity, queryResultState, queryResultZip};

 UIRow databaseQueryResult = new UIRow(objectArray);

// You can also easy construct a row of different types.
 objectArray[0] = (new UIGraphic(fileImage, UIStatic.LEFT));
 objectArray[1] = names[file.type];
 objectArray[2] = file.lastModified();
 objectArray[3] = "" + file.size + " bytes";

 UIRow fileInformation = new UIRow(objectArray);

// Set the layout of the row using the setLayout
// method. Use the appropriate UILayoutManager for the
// container.
 fileInformation.setLayout(layoutManager);

// Typically, you will handle many row objects in one 
// viewer or container.
// Add the current row to some type of list object.
 fileList.add(fileInformation);
// or,
 dbPossibleMatches.add(databaseQueryResult);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRow

Constructors

UIRow

public UIRow();

Creates a row object with no content.

UIRow

public UIRow(Object columns[]);

Creates a row object using an array of columns.

ParameterDescription
columns The object array that comprises a row. The row must be either an array of IUIComponent objects or an array of String objects.

Methods

getName

public String getName();

Retrieves the name of the row (this is the name of the first object in the row). If there is one or fewer objects in the row, the method returns the name of the parent component.

Return Value:

Returns the String that displays the row's associated name.

Overrides:

getName() in UIPanel.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the row.

Return Value:

Returns the ROLE_SYSTEM_ROW code.

requestFocus

public void requestFocus();

Requests focus for the row, if the row is keyable.

Return Value:

No return value.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the row.

Return Value:

No return value.

ParameterDescription
on If true, the row is selected; otherwise, it is deselected.

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