Packages
 In this topic

*Constructors

*Methods

*Fields

 

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

 


Class UIPropertyDialog

public class UIPropertyDialog extends UIDialog
{
  // Fields
  public static final int CENTER;
  public static final int LARGE;
  public static final int LEFT;
  public static final int MEDIUM;
  public static final int RIGHT;
  public static final int SMALL;

  // Constructors
  public UIPropertyDialog(UIFrame frame, String title,
        boolean modal, int pageSize);
  public UIPropertyDialog(UIFrame frame, String title,
        boolean modal);

  // Methods
  public boolean action(Event e, Object o);
  public void addNotify();
  public void addPage(UIPanel comp);
  public void addPage(String name, IUIComponent comp);
  public Object display();
  public boolean doApplyAction(Event e, Object o);
  public boolean doCancelAction(Event e, Object o);
  public boolean doOKAction(Event e, Object o);
  public int getButtonAlignment();
  public Insets getInsets();
  public Dimension getPageDimension();
  public int getPageSize();
  public Insets insets();
  public boolean isApplyable();
  public void setApplyable(boolean apply);
  public void setButtonAlignment(int Align);
  public void setPageSize(int size);
}

This class implements a property dialog window. An UIPropertyDialog control contains a set of UIPropertyPage objects.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIPropertyDialog

Constructors

UIPropertyDialog

public UIPropertyDialog(UIFrame frame, String title, boolean modal,
        int pageSize);

Creates an empty property dialog window.

Comments:To add a page to the dialog window, call addPage.

Note Clicking on the close window button will not close the window if the window is non-modal.

ParameterDescription
frame The parent frame.
title The title of the dialog window.
modal If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.
pageSize The size of the pages in the dialog window. Possible values include SMALL, MEDIUM, and LARGE.

UIPropertyDialog

public UIPropertyDialog(UIFrame frame, String title, boolean modal);

Creates an empty property dialog window.

Comments:
By default, the size of the pages in the property dialog window are set to MEDIUM. To add a page to the dialog window, call addPage.

Note Clicking on the close window button will not close the window if the window is non-modal.

ParameterDescription
frame The parent frame.
title The title of the dialog window.
modal If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.

Methods

action

public boolean action(Event e, Object o);

Responds to the buttons in the property dialog window being clicked.

Comments:
Depending on the button that was clicked, action calls one of the following methods.

Button Method called
OK doOKAction
Cancel doCancelAction
Apply doApplyAction

Note When cancelling the dialog, the method calls UIDialog.dispose.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the property dialog window.
o The object that posted the event.

addNotify

public void addNotify();

Called to perform initialization when the graphics context is first available.

Comments:This method adds OK, Cancel, and Apply buttons to the property dialog window.

Return Value:

No return value.

addPage

public void addPage(UIPanel comp);

Adds the specified panel to the property dialog window.

Return Value:

No return value.

ParameterDescription
comp The UIPanel to add to the dialog box. The name of the page is retrieved from the getName method in the UIPanel class.

addPage

public void addPage(String name, IUIComponent comp);

Adds the specified page to the property dialog window.

Return Value:

No return value.

ParameterDescription
name The name of the page.
comp The page component to be added. Typically, you pass a UIPropertyPage object.

display

public Object display();

Displays the property dialog window and its pages.

Return Value:

Returns the button that was clicked; otherwise, returns null if the dialog window was cancelled.

doApplyAction

public boolean doApplyAction(Event e, Object o);

Responds to the Apply button being clicked.

Comments:
This method is invoked by action. If the Apply button can change the state of the application, this method calls the doApplyAction method for each page in the dialog window.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the property dialog window.
o The object that posted the event.

See Also: isApplyable

doCancelAction

public boolean doCancelAction(Event e, Object o);

Responds to the Cancel button being clicked.

Comments:
This method is invoked by action, and by default, simply returns true.

Return Value:

Returns true if the event was handled; otherwise, returns false. If this method returns false, the dialog was not dismissed.

ParameterDescription
e The event posted to the property dialog window.
o The object that posted the event.

doOKAction

public boolean doOKAction(Event e, Object o);

Responds to the OK button being clicked.

Comments:
This method is invoked by action and by default, calls doApplyAction. If this method returns false, the dialog is not dismissed. If a page returned false from doApplyAction, that page is selected.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the property dialog window.
o The object that posted the event.

getButtonAlignment

public int getButtonAlignment();

Retrieves the alignment of the buttons in the property dialog window.

Return Value:

Returns an integer identifying the button alignment. Possible values include LEFT, CENTER, and RIGHT.

See Also: setButtonAlignment

getInsets

public Insets getInsets();

Retrieves the insets of the property dialog box. This method performs the same function as the insets method.

Return Value:

Returns an Insets object containing the insets.

See Also: insets

getPageDimension

public Dimension getPageDimension();

Retrieves the dimensions of the pages in the property dialog window. Override this method to specify custom page sizes.

Return Value:

Returns the dimensions that correspond to the size of the pages (SMALL, MEDIUM, or LARGE).

See Also: getPageSize

getPageSize

public int getPageSize();

Retrieves the size of the pages in the property dialog window.

Return Value:

Returns an integer identifying the page size. Possible values include SMALL, MEDIUM, and LARGE.

See Also: setPageSize

insets

public Insets insets();

Retrieves the insets of the property dialog window. This method performs the same function as the getInsets method.

Return Value:

Returns an Insets object containing the insets.

See Also: getInsets

isApplyable

public boolean isApplyable();

Determines whether changes made to the property page by the user will be applied when the Apply button is pressed.

Return Value:

Returns true if the isApplyable method of any page in the dialog window returns true; otherwise, returns false.

See Also: setApplyable

setApplyable

public void setApplyable(boolean apply);

Sets the state of the Apply button.

Return Value:

No return value.

ParameterDescription
apply If true, changes will be applied to the application when the Apply button is pressed; otherwise, changes will not be applied.

See Also: isApplyable

setButtonAlignment

public void setButtonAlignment(int Align);

Sets the alignment of the buttons in the property dialog window.

Return Value:

No return value.

ParameterDescription
Align The button alignment. Possible values include LEFT, CENTER, and RIGHT.

See Also: getButtonAlignment

setPageSize

public void setPageSize(int size);

Sets the size of the pages in the property dialog window.

Return Value:

No return value.

ParameterDescription
size The page size. Possible values include SMALL, MEDIUM, and LARGE.

See Also: getPageSize

Fields

CENTER
The buttons in the property dialog window are horizontally centered.
LARGE
The pages in the property dialog window have a width of 235 pixels and a height of 156 pixels.
LEFT
The buttons in the property dialog window are left-aligned.
MEDIUM
The pages in the property dialog window have a width of 210 pixels and a height of 154 pixels.
RIGHT
The buttons in the property dialog window are right-aligned.
SMALL
The pages in the property dialog window have a width of 195 pixels and a height of 127 pixels.

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