|
|
|||||||||||||
Class UIRowpublic 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 ConstructorsUIRowpublic UIRow(); UIRowpublic UIRow(Object columns[]); MethodsgetNamepublic String getName(); getRoleCodepublic int getRoleCode(); requestFocuspublic void requestFocus(); setSelectedpublic void setSelected(boolean on);
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |