public class AWTWindow extends AWTContainer implements IMoveable
Modifier | Constructor and Description |
---|---|
protected |
AWTWindow(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 AWTWindow。
|
Modifier and Type | Method and Description |
---|---|
void |
close()
关闭窗口。
|
void |
closeSynchron()
关闭窗口并等待直到窗口关闭。
|
void |
closeSynchron(boolean closeConfirm)
关闭窗口并等待直到窗口关闭。
|
List<IMoveable> |
getCloseWindows()
返回需关闭的窗口,以便只有应用程序的主窗口打开。
|
TestObject |
getFocus()
返回具有输入焦点的对象。
|
IMoveable |
getNextCloseWindow()
返回需关闭的下一个窗口,以关闭除应用程序主窗口以外的其他所有窗口。
|
int |
getWindowState()
获取 窗口状态。
|
boolean |
isActive()
返回窗口是否已设置为活动。
|
void |
maximize()
最大化窗口。
|
void |
minimize()
将窗口缩小为图标。
|
void |
move(Point pos)
移动窗口。
|
void |
restore()
将窗口还原为正常尺寸。
|
void |
setActive()
激活窗口。
|
void |
size(int width,
int height)
调整窗口大小。
|
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, getAccessibleName, getAccessibleRole, getBackground, getCursor, getFont, getForeground, getHeight, getName, getNativeHandle, getWidth, isEnabled, isFocusable, isFocused, mouseMove, mouseMove, openContextMenu, openContextMenu, pressKeys, pressKeys, pressMouse, pressMouse, pressMouse, pressMouse, releaseKeys, releaseKeys, releaseMouse, releaseMouse, releaseMouse, releaseMouse, scrollIntoView, setFocus, typeKeys, typeKeys, typeKeys, typePasswordKeys, typePasswordKeys, typePasswordKeys
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 AWTWindow(JtfObjectHandle handle, Desktop desktop)
handle
- 可确定 AWTWindow 的句柄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 void move(Point pos)
public void size(int width, int height)
public int getWindowState()
getWindowState
in interface IMoveable
Copyright 2009-2012 Micro Focus. All Rights Reserved.