public class SapWindow extends SapComponent implements IMoveable
Modifier | Constructor and Description |
---|---|
protected |
SapWindow(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 SapWindow。
|
Modifier and Type | Method and Description |
---|---|
void |
close()
关闭窗口。
|
void |
closeSynchron()
关闭窗口并等待直到窗口关闭。
|
void |
closeSynchron(boolean closeConfirm)
关闭窗口并等待直到窗口关闭。
|
List<IMoveable> |
getCloseWindows()
返回需关闭的窗口,以便只有应用程序的主窗口打开。
|
TestObject |
getFocus()
返回具有输入焦点的对象。
|
SapComponent |
getGuiFocus()
获取 当前具有焦点的 SAP GUI 内的元素。
|
IMoveable |
getNextCloseWindow()
返回需关闭的下一个窗口,以关闭除应用程序主窗口以外的其他所有窗口。
|
SapComponent |
getSystemFocus()
获取 从服务器应用程序来看,具有焦点的 SAP GUI 内的元素。
|
int |
getWindowHandle()
获取 与 GuiShell 连接的控件的窗口句柄。
|
int |
getWindowState()
获取 窗口状态。
|
int |
getWorkingPaneHeight()
获取 工作窗格的当前高度。
|
int |
getWorkingPaneWidth()
获取 工作窗格的当前宽度。
|
boolean |
isActive()
返回窗口是否已设置为活动。
|
boolean |
isButtonbarVisible()
获取 SAP GUI 内的应用程序工具栏和下方工具栏是否可见。
|
boolean |
isStatusbarVisible()
获取 状态栏是否可见。
|
boolean |
isTitlebarVisible()
获取 标题栏是否可见。
|
boolean |
isToolbarVisible()
获取 工具栏是否可见。
|
boolean |
isVkeyAllowed(VKey vkey)
如果在当前屏幕上执行指定虚拟键,则此方法返回 True。
|
void |
jumpBackward()
在窗口上执行 Ctrl+Shift+Tab 键以向后跳一个块。
|
void |
jumpForward()
在窗口上执行 Ctrl+Shift+Tab 键以向前跳一个块。
|
void |
maximize()
最大化窗口。
|
void |
minimize()
将窗口缩小为图标。
|
void |
move(Point pos)
移动窗口。
|
void |
resizeWorkingPane(int width,
int height,
boolean throwOnFail)
ResizeWorkingPane 功能将调整窗口大小,以便可用工作区域有指定宽度和高度(字符度量)。
|
void |
resizeWorkingPaneEx(int width,
int height,
boolean throwOnFail)
ResizeWorkingPaneEx 功能将调整窗口大小,以便可用工作区域有指定宽度和高度(像素)。
|
void |
restore()
将窗口还原为正常尺寸。
|
void |
sendVKey(VKey vkey)
发送虚拟键至系统。
|
void |
setActive()
激活窗口。
|
void |
size(int width,
int height)
调整窗口大小。
|
void |
tabBackward()
在窗口上执行 Shift+Tab 键以向后跳一个元素。
|
void |
tabForward()
在窗口上执行 Tab 键以向前跳一个元素。
|
getAccessibilityText, getAccessibilityTextOnRequest, getAccessibilityTooltip, getDefaultTooltip, getHeight, getIconName, getLeft, getName, getScreenLeft, getScreenTop, getTooltip, getTop, getWidth, isChangeable, isFocused, isModified, isSymbolFont, setFocus, showContextMenu
captureBitmap, 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, waitForProperty
equals, 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, toString
protected SapWindow(JtfObjectHandle handle, Desktop desktop)
handle
- 可确定 SapWindow 的句柄desktop
- 此对象所在的桌面public void closeSynchron()
方法通过尝试以下事件试图关闭窗口,窗口关闭时按此顺序停止:
close()
方法。closeConfirm
参数设置为 true
:单击用选项 OPT_CLOSE_WINDOW_BUTTONS 指定的按钮列表。此方法支持您制定的多个规范以帮助开放代理关闭窗口。您可以通过 Desktop.setOption(字符串,对象)制定这些规范以为涉及的选项设置相应值。例如,如果关闭窗口会打开确认对话框,其带有包含“不保存”文本的按钮,则使用:
desktop.setOption(CommonOptions.OPT_CLOSE_CONFIRM_BUTTONS, Arrays.asList("Do not save"));
关闭可能失败。例如,如果关闭窗口会导致应用程序显示消息框并且 closeConfirm 设置为 false
;或者如果用于关闭消息框的按钮未包含在 OPT_CLOSE_CONFIRM_BUTTONS 选项下,则调用将失败并且引发 CloseFailedException。
closeSynchron
in interface IMoveable
public void closeSynchron(boolean closeConfirm)
方法通过尝试以下事件试图关闭窗口,窗口关闭时按此顺序停止:
close()
方法。closeConfirm
参数设置为 true
:单击用选项 OPT_CLOSE_WINDOW_BUTTONS 指定的按钮列表。此方法支持您制定的多个规范以帮助开放代理关闭窗口。您可以通过 Desktop.setOption(字符串,对象)制定这些规范以为涉及的选项设置相应值。例如,如果关闭窗口会打开确认对话框,其带有包含“不保存”文本的按钮,则使用:
desktop.setOption(CommonOptions.OPT_CLOSE_CONFIRM_BUTTONS, Arrays.asList("Do not save"));
关闭可能失败。例如,如果关闭窗口会导致应用程序显示消息框并且 closeConfirm 设置为 false
;或者如果用于关闭消息框的按钮未包含在 OPT_CLOSE_CONFIRM_BUTTONS 选项下,则调用将失败并且引发 CloseFailedException。
closeSynchron
in interface IMoveable
closeConfirm
- 指定关闭窗口时是否关闭可能弹出的确认对话框,如“保存更改”对话框。如果确认对话框弹出,则使用 true
关闭确认对话框和 false
以引发异常。如果设置为选项 true
值,则 OPT_CLOSE_CONFIRM_BUTTONS 将用于确定要选择哪个按钮才能关闭确认对话框。public List<IMoveable> getCloseWindows()
getCloseWindows
in interface IMoveable
public TestObject getFocus()
public IMoveable getNextCloseWindow()
getNextCloseWindow
in interface IMoveable
public boolean isVkeyAllowed(VKey vkey)
vkey
- 可评估的键public void jumpBackward()
public void jumpForward()
public void move(Point pos)
public void resizeWorkingPane(int width, int height, boolean throwOnFail)
width
- 新的工作窗格宽度(像素)height
- 新的工作窗格高度(像素)throwOnFail
- 出现故障时是否应抛出异常public void resizeWorkingPaneEx(int width, int height, boolean throwOnFail)
width
- 新的工作窗格宽度(像素)height
- 新的工作窗格高度(像素)throwOnFail
- 出现故障时是否应抛出异常public void sendVKey(VKey vkey)
vkey
- 可发送的虚拟键public void size(int width, int height)
public void tabBackward()
public void tabForward()
public boolean isButtonbarVisible()
public SapComponent getGuiFocus()
public boolean isStatusbarVisible()
public SapComponent getSystemFocus()
public boolean isTitlebarVisible()
public boolean isToolbarVisible()
public int getWindowHandle()
public int getWindowState()
getWindowState
in interface IMoveable
public int getWorkingPaneHeight()
public int getWorkingPaneWidth()
Copyright 2009-2012 Micro Focus. All Rights Reserved.