Packages
 In this topic

*Constructors

*Methods

 

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

 


Class AwtUIColumnViewer

public class AwtUIColumnViewer extends AwtUIControl implements 
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUIColumnViewer();
  public AwtUIColumnViewer(Object columns[], IUIComponent list);

  // Methods
  public IUIComponent add(Object columns[]);
  public IUIComponent add(Object columns[], int index);
  public IUIComponent add(Object columns[], Object constraints);
  public IUIComponent add(Object columns[], Object constraints, int
        index);
  public void addActionListener(ActionListener l);
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  public int getOrderIndex(int index);
  public int getWidth(int index);
  public int[] getWidths();
  public void moveColumn(int from, int to);
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
  public void setWidth(int index, int width);
  public void setWidths(int width);
  public void setWidths(int widths[]);
}

This class implements the functionality of a UIColumnViewer object in an AWT-based control. An AwtUIColumnViewer control is an AwtUIHost component whose associated root container holds a UIColumnViewer object. By hosting this object, an AwtUIColumnViewer control integrates AFC with AWT. Although an AwtUIColumnViewer control is fully compatible with AWT, a UIColumnViewer control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIColumnViewer

Constructors

AwtUIColumnViewer

public AwtUIColumnViewer();

Creates an AWT-based column viewer control with no column headers or content.

AwtUIColumnViewer

public AwtUIColumnViewer(Object columns[], IUIComponent list);

Creates an AWT-based column viewer control using an array of objects for headers and a component list for content.

ParameterDescription
columns The array of column objects.
list The component list.

Methods

add

public IUIComponent add(Object columns[]);

Adds an Object array to the end of a UIColumnViewer object's contained list.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

ParameterDescription
columns An array of objects to add to the column viewer.

add

public IUIComponent add(Object columns[], int index);

Adds an Object array to the UIColumnViewer object's contained list, at a specified index.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

ParameterDescription
columns An array of objects to add to the column viewer.
index The position of the row object when added to the list. Set this value to -1 if the row is added to the end of the list.

add

public IUIComponent add(Object columns[], Object constraints);

Adds an Object array to the end of a UIColumnViewer object's contained list.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

ParameterDescription
columns An array of objects to add to the column viewer.
constraints The layout constraints of the content container for the column viewer.

add

public IUIComponent add(Object columns[], Object constraints, int index);

Adds an Object array to the UIColumnViewer object's contained list, at a specified insertion index.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

ParameterDescription
columns An array of objects to add to the column viewer.
constraints The layout constraints of the content container for the column viewer.
index The position of the row object when added to the list.

addActionListener

public void addActionListener(ActionListener l);

Adds the specified action listener. The listener receives all action events generated for the control.

Return Value:

No return value.

ParameterDescription
l The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(ItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control.

Return Value:

No return value.

ParameterDescription
l The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIColumnViewer object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIColumnViewer object.

getOrderIndex

public int getOrderIndex(int index);

Retrieves the order of the column at the specified index.

Return Value:

Returns the zero-based order of the column.

ParameterDescription
index The zero-based index of the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

getWidth

public int getWidth(int index);

Retrieves the current width of the column at the specified index.

Return Value:

Returns the width (in pixels) of the specified column.

ParameterDescription
index The zero-based index of the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: setWidth

getWidths

public int[] getWidths();

Retrieves the current widths (in pixels) for all the columns.

Return Value:

Returns an array of the widths for each of the columns.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: setWidths

moveColumn

public void moveColumn(int from, int to);

Moves a column from one location to another.

Return Value:

No return value.

ParameterDescription
from The zero-based index that identifies the column to move.
to The zero-based index that identifies where the column is moving to.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

ParameterDescription
e The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

ParameterDescription
e The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type Method called
action event processActionEvent
item event processItemEvent
container event processContainerEvent (inherited through AwtUIHost)
focus event processFocusEvent (inherited through AwtUIHost)
key event processKeyEvent (inherited through AwtUIHost)
mouse event processMouseEvent (inherited through AwtUIHost)
mouse motion event processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

ParameterDescription
e The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeActionListener

public synchronized void removeActionListener(ActionListener l);

Removes the specified action listener. The listener no longer receives the control's action events.

Return Value:

No return value.

ParameterDescription
l The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

Removes the specified item listener. The listener no longer receives the control's item events.

Return Value:

No return value.

ParameterDescription
l The item listener to be removed.

See Also: addItemListener

setWidth

public void setWidth(int index, int width);

Sets the width of the column at the specified index.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the column.
width The new width (in pixels) for the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidth

setWidths

public void setWidths(int width);

Sets the widths of all columns to the specified width

Return Value:

No return value.

ParameterDescription
width The new width (in pixels) for each column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidths

setWidths

public void setWidths(int widths[]);

Sets all the column widths to the specified widths (in pixels).

Return Value:

No return value.

ParameterDescription
widths The array of new widths for each column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidths

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