public class SLDataGrid extends SLBase
如果数据网格具有垂直滚动条,则不在数据网格可见区域中的行不会显示任何信息(例如文本、标题)。要与此类行进行交互或检索关于行的信息,首选需要将行滚动至视图。
| Modifier | Constructor and Description |
|---|---|
protected |
SLDataGrid(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 SLDataGrid。
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSelectMultiple()
获取 数据网格是否允许同时选中多行。
|
int |
getColumnCount()
获取 数据网格中的列数。
|
List<SLHeaderItem> |
getColumnHeaders()
获取 包含每列的标题项目的列表。
|
List<String> |
getColumnHeaderTexts()
获取 包含每列的标题项目文本的列表。
|
double |
getHorizontalScrollPercent()
获取 当前水平滚动位置,如果无有效的滚动位置,则为负值 (-1)。
|
int |
getRowCount()
获取 数据网格中的行数。
|
List<SLDataGridRow> |
getRows()
获取 数据网格中行的列表。
|
List<String> |
getRowTexts()
获取 数据网格中行文本的列表。
|
SLDataGridCell |
getSelectedCell()
获取 如果未选择单元格,则值为当前所选单元格或
null。 |
String |
getSelectedCellText()
获取 如果未选择单元格,则值为当前所选单元格的文本或空字符串。
|
SLDataGridRow |
getSelectedRow()
获取 如果未选择行,则值为当前所选行或
null。 |
List<SLDataGridRow> |
getSelectedRows()
获取 如果未选择行,则值为当前所选行的列表或空列表。
|
String |
getSelectedRowText()
获取 如果未选择行,则值为当前所选行文本或空字符串。
|
List<String> |
getSelectedRowTexts()
获取 如果未选择行,则值为当前所选行文本或空列表。
|
double |
getVerticalScrollPercent()
获取 当前垂直滚动位置,如果无有效的滚动位置,则为负值 (-1)。
|
boolean |
isHorizontallyScrollable()
获取 表示数据网格是否可以水平滚动的值。
|
boolean |
isVerticallyScrollable()
获取 表示数据网格是否可以垂直滚动的值。
|
void |
scrollHorizontal(ScrollAmount scrollAmount)
将内容区域的当前可见区域水平滚动指定 ScrollAmount。
|
void |
scrollIntoView(int rowIndex)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(int rowIndex,
int columnIndex)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(int rowIndex,
ItemIdentifier column)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(int rowIndex,
String columnText)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(ItemIdentifier row)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(ItemIdentifier row,
int columnIndex)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(ItemIdentifier row,
ItemIdentifier column)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(ItemIdentifier row,
String columnText)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(String rowText)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(String rowText,
int columnIndex)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(String rowText,
ItemIdentifier column)
滚动指定行或单元格至视图。
|
void |
scrollIntoView(String rowText,
String columnText)
滚动指定行或单元格至视图。
|
void |
scrollVertical(ScrollAmount scrollAmount)
将内容区域的当前可见区域垂直滚动指定 ScrollAmount。
|
void |
select(int itemIndex)
选择指定行。
|
void |
select(int itemIndex,
ModifierKey modifiers)
选择指定行。
|
void |
select(ItemIdentifier item)
选择指定行。
|
void |
select(ItemIdentifier item,
ModifierKey modifiers)
选择指定行。
|
void |
select(String itemText)
选择指定行。
|
void |
select(String itemText,
ModifierKey modifiers)
选择指定行。
|
void |
selectCell(int rowIndex,
int columnIndex)
选择指定单元格。
|
void |
selectCell(int rowIndex,
int columnIndex,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(int rowIndex,
ItemIdentifier column)
选择指定单元格。
|
void |
selectCell(int rowIndex,
ItemIdentifier column,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(int rowIndex,
String columnText)
选择指定单元格。
|
void |
selectCell(int rowIndex,
String columnText,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(ItemIdentifier row,
int columnIndex)
选择指定单元格。
|
void |
selectCell(ItemIdentifier row,
int columnIndex,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(ItemIdentifier row,
ItemIdentifier column)
选择指定单元格。
|
void |
selectCell(ItemIdentifier row,
ItemIdentifier column,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(ItemIdentifier row,
String columnText)
选择指定单元格。
|
void |
selectCell(ItemIdentifier row,
String columnText,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(String rowText,
int columnIndex)
选择指定单元格。
|
void |
selectCell(String rowText,
int columnIndex,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(String rowText,
ItemIdentifier column)
选择指定单元格。
|
void |
selectCell(String rowText,
ItemIdentifier column,
ModifierKey modifiers)
选择指定单元格。
|
void |
selectCell(String rowText,
String columnText)
选择指定单元格。
|
void |
selectCell(String rowText,
String columnText,
ModifierKey modifiers)
选择指定单元格。
|
void |
setHorizontalScrollPercent(double percent)
设置水平滚动位置占数据网格内全部内容区域的百分比。
|
void |
setVerticalScrollPercent(double percent)
设置垂直滚动位置占数据网格内全部内容区域的百分比。
|
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, getAutomationId, getClassName, getName, getRawChildren, getRawChildren, isEnabled, isFocused, mouseMove, mouseMove, pressKeys, pressKeys, pressMouse, pressMouse, pressMouse, pressMouse, releaseKeys, releaseKeys, releaseMouse, releaseMouse, releaseMouse, releaseMouse, setFocus, typeKeys, typeKeys, typeKeys, typePasswordKeys, typePasswordKeys, typePasswordKeyscaptureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getText, getValue, highlightObject, highlightObject, highlightObject, invokeMethods, textCapture, textCapture, textClick, textClick, textClick, textClick, textClick, textClick, textExists, textExists, textExists, textExists, textExists, textRectangle, textRectangle, textRectangle, textRectangle, textRectangle, waitForChildDisappearance, waitForChildDisappearance, waitForDisappearance, waitForDisappearance, waitForObject, waitForObject, waitForProperty, waitForPropertyequals, exists, find, find, findAll, findAll, getCustomTypeName, getDesktop, getHandle, getLocator, getProperty, getTypeName, hashCode, imageClick, imageClick, imageClick, imageClick, imageClick, imageClick, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageExists, imageExists, imageExists, imageExistsFile, imageExistsFile, imageExistsFile, imageRectangle, imageRectangle, imageRectangle, imageRectangleFile, imageRectangleFile, imageRectangleFile, invoke, preventFinalLocator, setProperty, toStringprotected SLDataGrid(JtfObjectHandle handle, Desktop desktop)
handle - 可确定 SLDataGrid 的句柄desktop - 此对象所在的桌面public void scrollHorizontal(ScrollAmount scrollAmount)
scrollAmount - 可滚动的方向和距离public void scrollIntoView(ItemIdentifier row)
row - 可滚动至的行public void scrollIntoView(ItemIdentifier row, ItemIdentifier column)
row - 可滚动至的行column - 可滚动至的列public void scrollIntoView(ItemIdentifier row, String columnText)
row - 可滚动至的行columnText - 可滚动至的列public void scrollIntoView(ItemIdentifier row, int columnIndex)
row - 可滚动至的行columnIndex - 可滚动至的列public void scrollIntoView(String rowText)
rowText - 可滚动至的行public void scrollIntoView(String rowText, ItemIdentifier column)
rowText - 可滚动至的行column - 可滚动至的列public void scrollIntoView(String rowText, String columnText)
rowText - 可滚动至的行columnText - 可滚动至的列public void scrollIntoView(String rowText, int columnIndex)
rowText - 可滚动至的行columnIndex - 可滚动至的列public void scrollIntoView(int rowIndex)
rowIndex - 可滚动至的行public void scrollIntoView(int rowIndex,
ItemIdentifier column)
rowIndex - 可滚动至的行column - 可滚动至的列public void scrollIntoView(int rowIndex,
String columnText)
rowIndex - 可滚动至的行columnText - 可滚动至的列public void scrollIntoView(int rowIndex,
int columnIndex)
rowIndex - 可滚动至的行columnIndex - 可滚动至的列public void scrollVertical(ScrollAmount scrollAmount)
scrollAmount - 可滚动的方向和距离public void select(ItemIdentifier item)
示例使用情况要选择包含分别带文本“单元格 1”和“单元格 2”类型的两个单元格的行:
dataGrid.select("cell 1 cell 2");
或
dataGrid.select("*cell 1*");
要选择数据网格类型中的第三行:
dataGrid.select(2);要选择数据网格中的多行,请使用修饰键(例如 Ctrl 或 Shift)。 要选择支持多项选择的数据网格中的第一和第三行,请键入以下内容:
dataGrid.select(0); dataGrid.select(2, ModifierKey.Control);
item - 可选择的行public void select(ItemIdentifier item, ModifierKey modifiers)
示例使用情况要选择包含分别带文本“单元格 1”和“单元格 2”类型的两个单元格的行:
dataGrid.select("cell 1 cell 2");
或
dataGrid.select("*cell 1*");
要选择数据网格类型中的第三行:
dataGrid.select(2);要选择数据网格中的多行,请使用修饰键(例如 Ctrl 或 Shift)。 要选择支持多项选择的数据网格中的第一和第三行,请键入以下内容:
dataGrid.select(0); dataGrid.select(2, ModifierKey.Control);
item - 可选择的行modifiers - 选择行时按的修饰键。使用修饰键选择多行。public void select(String itemText)
示例使用情况要选择包含分别带文本“单元格 1”和“单元格 2”类型的两个单元格的行:
dataGrid.select("cell 1 cell 2");
或
dataGrid.select("*cell 1*");
要选择数据网格类型中的第三行:
dataGrid.select(2);要选择数据网格中的多行,请使用修饰键(例如 Ctrl 或 Shift)。 要选择支持多项选择的数据网格中的第一和第三行,请键入以下内容:
dataGrid.select(0); dataGrid.select(2, ModifierKey.Control);
itemText - 可选择的行public void select(String itemText, ModifierKey modifiers)
示例使用情况要选择包含分别带文本“单元格 1”和“单元格 2”类型的两个单元格的行:
dataGrid.select("cell 1 cell 2");
或
dataGrid.select("*cell 1*");
要选择数据网格类型中的第三行:
dataGrid.select(2);要选择数据网格中的多行,请使用修饰键(例如 Ctrl 或 Shift)。 要选择支持多项选择的数据网格中的第一和第三行,请键入以下内容:
dataGrid.select(0); dataGrid.select(2, ModifierKey.Control);
itemText - 可选择的行modifiers - 选择行时按的修饰键。使用修饰键选择多行。public void select(int itemIndex)
示例使用情况要选择包含分别带文本“单元格 1”和“单元格 2”类型的两个单元格的行:
dataGrid.select("cell 1 cell 2");
或
dataGrid.select("*cell 1*");
要选择数据网格类型中的第三行:
dataGrid.select(2);要选择数据网格中的多行,请使用修饰键(例如 Ctrl 或 Shift)。 要选择支持多项选择的数据网格中的第一和第三行,请键入以下内容:
dataGrid.select(0); dataGrid.select(2, ModifierKey.Control);
itemIndex - 可选择的行public void select(int itemIndex,
ModifierKey modifiers)
示例使用情况要选择包含分别带文本“单元格 1”和“单元格 2”类型的两个单元格的行:
dataGrid.select("cell 1 cell 2");
或
dataGrid.select("*cell 1*");
要选择数据网格类型中的第三行:
dataGrid.select(2);要选择数据网格中的多行,请使用修饰键(例如 Ctrl 或 Shift)。 要选择支持多项选择的数据网格中的第一和第三行,请键入以下内容:
dataGrid.select(0); dataGrid.select(2, ModifierKey.Control);
itemIndex - 可选择的行modifiers - 选择行时按的修饰键。使用修饰键选择多行。public void selectCell(ItemIdentifier row, ItemIdentifier column)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
row - 可选择的行column - 可选择的单元格public void selectCell(ItemIdentifier row, ItemIdentifier column, ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
row - 可选择的行column - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(ItemIdentifier row, String columnText)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
row - 可选择的行columnText - 可选择的单元格public void selectCell(ItemIdentifier row, String columnText, ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
row - 可选择的行columnText - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(ItemIdentifier row, int columnIndex)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
row - 可选择的行columnIndex - 可选择的单元格public void selectCell(ItemIdentifier row, int columnIndex, ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
row - 可选择的行columnIndex - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(String rowText, ItemIdentifier column)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowText - 可选择的行column - 可选择的单元格public void selectCell(String rowText, ItemIdentifier column, ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowText - 可选择的行column - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(String rowText, String columnText)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowText - 可选择的行columnText - 可选择的单元格public void selectCell(String rowText, String columnText, ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowText - 可选择的行columnText - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(String rowText, int columnIndex)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowText - 可选择的行columnIndex - 可选择的单元格public void selectCell(String rowText, int columnIndex, ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowText - 可选择的行columnIndex - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(int rowIndex,
ItemIdentifier column)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowIndex - 可选择的行column - 可选择的单元格public void selectCell(int rowIndex,
ItemIdentifier column,
ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowIndex - 可选择的行column - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(int rowIndex,
String columnText)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowIndex - 可选择的行columnText - 可选择的单元格public void selectCell(int rowIndex,
String columnText,
ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowIndex - 可选择的行columnText - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void selectCell(int rowIndex,
int columnIndex)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowIndex - 可选择的行columnIndex - 可选择的单元格public void selectCell(int rowIndex,
int columnIndex,
ModifierKey modifiers)
示例使用情况要选择第三行类型中带文本“单元格 1”的单元格:
dataGrid.selectCell(2, "cell 1");
rowIndex - 可选择的行columnIndex - 可选择的单元格modifiers - 选择单元格时按的修饰键。使用修饰键选择多个单元格。public void setHorizontalScrollPercent(double percent)
percent - 全部水平内容区域的百分比public void setVerticalScrollPercent(double percent)
percent - 全部垂直内容区域的百分比public boolean canSelectMultiple()
public int getColumnCount()
public List<SLHeaderItem> getColumnHeaders()
public boolean isHorizontallyScrollable()
public double getHorizontalScrollPercent()
public int getRowCount()
public List<SLDataGridRow> getRows()
如果数据网格具有垂直滚动条,则不在数据网格可见区域中的行不会显示任何信息(例如文本、标题)。要与此类行进行交互或检索关于行的信息,首选需要将行滚动至视图。
public List<String> getRowTexts()
如果数据网格具有垂直滚动条,则不在数据网格可见区域中的行会返回空文本。要检索此类行的文本,首选需要将行滚动至视图。
public SLDataGridCell getSelectedCell()
null。public String getSelectedCellText()
public SLDataGridRow getSelectedRow()
null。public List<SLDataGridRow> getSelectedRows()
public String getSelectedRowText()
public boolean isVerticallyScrollable()
public double getVerticalScrollPercent()
Copyright 2009-2012 Micro Focus. All Rights Reserved.