public class Window extends WebContent
connection, identity
Modifier | Constructor and Description |
---|---|
protected |
Window(Application application)
Window constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(String type,
EventListener listener,
AckListener callback)
Registers an event listener on the specified event
|
void |
animate(AnimationTransitions transitions,
AnimationOptions options,
AckListener listener)
Performs the specified window transitions
|
void |
authenticate(String username,
String password,
boolean cancel,
AckListener listener)
authenticate a user.
|
void |
blur()
Removes focus to the window
|
void |
blur(AckListener listener)
Removes focus to the window
|
void |
bringToFront()
Brings the window to the front of the window stack
|
void |
bringToFront(AckListener listener)
Brings the window to the front of the window stack
|
void |
close()
Closes the window
|
void |
close(AckListener listener)
Closes the window
|
void |
close(Boolean force,
AckListener ackListener)
Closes the window
|
CompletableFuture<Ack> |
closeAsync(Boolean force) |
void |
disableFrame(AckListener listener)
Prevents a user from changing a window's size/position when using the window's frame
|
void |
embedComponentSizeChange(int width,
int height)
Update width and height of parent window for embedded window
|
void |
embedComponentSizeChange(int left,
int top,
int width,
int height)
Update width and height of parent window for embedded window
|
void |
embedInto(long parentHwndId,
int width,
int height,
AckListener callback)
Embeds a window in a target window
|
void |
embedInto(long parentHwndId,
int left,
int top,
int width,
int height,
AckListener callback)
Embeds a window in a target window
|
void |
enableFrame(AckListener listener)
Allows a user from changing a window's size/position when using the window's frame
|
void |
executeJavaScript(String code,
AsyncCallback<Object> callback,
AckListener listener)
Executes Javascript on the window, restricted to windows you own or windows owned by applications you have created.
|
void |
flash(AckListener callback)
Draws attention to the window by flashing the taskbar and window caption.
|
void |
focus()
Gives focus to the window
|
void |
focus(AckListener listener)
Gives focus to the window
|
void |
getBounds(AsyncCallback<WindowBounds> callback,
AckListener listener)
Gets the current bounds (top, left, width, height) of the window
|
protected String |
getEventTopicName() |
void |
getGroup(AsyncCallback<List<Window>> groupHandler,
AckListener listener)
Passes a list of wrapped windows in the same group
An empty list is returned if the window is not in a group.
|
void |
getInfo(String code,
AsyncCallback<org.json.JSONObject> callback,
AckListener listener)
Gets the window information
|
void |
getNativeId(AckListener listener)
Gets HWND of the current window
|
void |
getOptions(AsyncCallback<WindowOptions> callback,
AckListener listener)
Returns the current options as stored in the desktop
|
Application |
getParentApplication()
Returns the wrapped application that this window belongs to
|
Window |
getParentWindow()
Get parent window
|
void |
getSnapshot(AckListener callback)
Gets a base64 encoded PN snapshot of the window
|
void |
getState(AckListener listener)
Gets the current state ("minimized", "maximized", or "restored") of the window
|
void |
getZoomLevel(AsyncCallback<Double> callback,
AckListener listener)
Gets the current zoom level of the window
|
void |
hide()
Hides the window if it is shown
|
void |
hide(AckListener listener)
Hides the window if it is shown
|
void |
isShowing(AckListener listener)
Determines if the window is currently showing
|
void |
joinGroup(Window window)
Joins the same window group as the specified window
When windows are joined, if the user moves one of the windows,
all other windows in the same group move too.
|
void |
joinGroup(Window window,
AckListener listener)
Joins the same window group as the specified window
|
void |
leaveGroup()
Leaves the current window group so that the window
can be move independently of those in the group.
|
void |
leaveGroup(AckListener listener)
Leaves the current window group so that the window
can be move independently of those in the group.
|
void |
maximize()
Maximizes the window
|
void |
maximize(AckListener listener)
Maximizes the window
|
void |
mergeGroups(Window window)
Merges the instance's window group with the same window group as the specified window.
|
void |
mergeGroups(Window window,
AckListener listener)
Merges the instance's window group with the same window group as the specified window.
|
void |
minimize()
Minimizes the window
|
void |
minimize(AckListener listener)
Minimizes the window
|
void |
moveBy(int deltaLeft,
int deltaTop)
Moves the window by a specified amount
|
void |
moveBy(int deltaLeft,
int deltaTop,
AckListener listener)
Moves the window by a specified amount
|
void |
moveTo(int left,
int top)
Moves the window to a specified location
|
void |
moveTo(int left,
int top,
AckListener listener)
Moves the window to a specified location
|
void |
navigate(String url,
AckListener listener)
Navigates the Widnow to the specified address
|
void |
navigateBack(AckListener listener)
Navigates the window back one page.
|
void |
navigateForward(AckListener listener)
Navigates the window forward one page.
|
void |
reload(boolean ignoreCache,
AckListener listener)
Reloads the window current page
|
void |
removeEventListener(String type,
EventListener listener,
AckListener callback)
Removes a previously registered event listener from the specified event
|
void |
resizeBy(int deltaWidth,
int deltaHeight,
String anchor)
Resizes the window by the specified amount
|
void |
resizeBy(int deltaWidth,
int deltaHeight,
String anchor,
AckListener listener)
Resizes the window by the specified amount
|
void |
resizeTo(int width,
int height,
AckListener listener)
Resizes the window to the specified dimensions
|
void |
resizeTo(int width,
int height,
String anchor)
Resizes the window to the specified dimensions
|
void |
resizeTo(int width,
int height,
String anchor,
AckListener listener)
Resizes the window to the specified dimensions
|
void |
restore()
Restores the window
|
void |
restore(AckListener listener)
Restores the window
|
void |
setAsForeground(AckListener listener)
Set's the window as the foreground window
The window is activated(focused) and brought to front
|
void |
setBounds(int left,
int top,
int width,
int height,
AckListener listener)
Sets the current bounds (top, left, width, height) of the window
|
void |
setZoomLevel(double level,
AckListener listener)
Sets the zoom level of the window
|
void |
show()
Shows the window if it is hidden
|
void |
show(AckListener listener)
Shows the window if it is hidden
|
void |
showAt(int left,
int top,
boolean toggle)
Shows the window if it is hidden at the specified location
|
void |
showAt(int left,
int top,
boolean toggle,
AckListener listener)
Shows the window if it is hidden at the specified location
|
void |
showDeveloperTools(AckListener listener)
Shows window's developer tools
|
void |
stopFlashing(AckListener callback)
Stops flashing of taskbar and window caption
|
void |
stopWindowNavigation(AckListener listener)
Stops window navigation.
|
void |
updateOptions(org.json.JSONObject options)
Changes a window's options that were defined upon creation
|
void |
updateOptions(WindowOptions options,
AckListener listener)
Changes a window's options that were defined upon creation
|
static Window |
wrap(String applicationUuid,
String windowName,
DesktopConnection connection)
Attaches a Window object to an application Window that already exists
|
addEventListener, executeJavaScript, findInPage, focusAsync, getConnection, getIdentity, getName, getPrinters, getUuid, getZoomLevel, navigate, navigateBack, navigateForward, printAsync, reloadAsync, removeEventListener, setZoomLevel, showDeveloperTools, stopFindInPage, stopNavigation
protected Window(Application application)
application
- Parent Applicationprotected String getEventTopicName()
getEventTopicName
in class WebContent
public Application getParentApplication()
public Window getParentWindow()
public void getSnapshot(AckListener callback)
callback
- AckListener for the requestAckListener
public void show() throws DesktopException
DesktopException
- if the window fails to showDesktopException
public void show(AckListener listener)
listener
- AckListener for the requestAckListener
public void hide() throws DesktopException
DesktopException
- if the window fails to hideDesktopException
public void hide(AckListener listener)
listener
- AckListener for the requestAckListener
public void close() throws DesktopException
DesktopException
- if the window fails to closeDesktopException
public void close(AckListener listener)
listener
- AckListener for the requestAckListener
public void close(Boolean force, AckListener ackListener)
force
- Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for the windowackListener
- AckListener for the requestAckListener
public CompletableFuture<Ack> closeAsync(Boolean force)
public void minimize() throws DesktopException
DesktopException
- if the window fails to minimizeDesktopException
public void minimize(AckListener listener)
listener
- AckListener for the requestAckListener
public void maximize() throws DesktopException
DesktopException
- if the window fails to maximizeDesktopException
public void maximize(AckListener listener)
listener
- AckListener for the requestAckListener
public void restore() throws DesktopException
DesktopException
- if the window fails to restoreDesktopException
public void restore(AckListener listener)
listener
- AckListener for the requestAckListener
public void focus() throws DesktopException
DesktopException
- if the windw fails to gain focusDesktopException
public void focus(AckListener listener)
listener
- AckListener for the requestAckListener
public void blur() throws DesktopException
DesktopException
- if the window fails to lose focusDesktopException
public void blur(AckListener listener)
listener
- AckListener for the requestAckListener
public void flash(AckListener callback)
callback
- AckListener for the requestAckListener
public void stopFlashing(AckListener callback)
callback
- AckListener for the requestAckListener
public void showAt(int left, int top, boolean toggle) throws DesktopException
left
- The left position of the windowtop
- The right position of the windowtoggle
- If true, the window will alternate between showing and hiding in subsequent callsDesktopException
- if the window fails to showDesktopException
public void showAt(int left, int top, boolean toggle, AckListener listener) throws DesktopException
left
- The left position of the windowtop
- The right position of the windowtoggle
- If true, the window will alternate between showing and hiding in subsequent callslistener
- AckListener for the requestDesktopException
- if the window fails to showAckListener
,
DesktopException
public void moveTo(int left, int top) throws DesktopException
left
- The left position of the windowtop
- The right position of the windowDesktopException
- if the window fails to moveDesktopException
public void moveTo(int left, int top, AckListener listener) throws DesktopException
left
- The left position of the windowtop
- The right position of the windowlistener
- AckListener for the requestDesktopException
- if the window fails to moveAckListener
,
DesktopException
public void moveBy(int deltaLeft, int deltaTop) throws DesktopException
deltaLeft
- The change in the left position of the windowdeltaTop
- The change in the top position of the windowDesktopException
- if the window fails to moveDesktopException
public void moveBy(int deltaLeft, int deltaTop, AckListener listener) throws DesktopException
deltaLeft
- The change in the left position of the windowdeltaTop
- The change in the top position of the windowlistener
- AckListener for the requestDesktopException
- if the window fails to moveAckListener
,
DesktopException
public void resizeTo(int width, int height, String anchor) throws DesktopException
width
- Width of the windowheight
- Height of the windowanchor
- Specifies a corner to remain fixed during the resize.
Can take the values:
"top-left"
"top-right"
"bottom-left"
"bottom-right"
If undefined, the default is "top-left".DesktopException
- if the windw fails to resizeDesktopException
public void resizeTo(int width, int height, String anchor, AckListener listener) throws DesktopException
width
- Width of the windowheight
- Height of the windowanchor
- Specifies a corner to remain fixed during the resize.
Can take the values:
"top-left"
"top-right"
"bottom-left"
"bottom-right"
If undefined, the default is "top-left".listener
- AckListener for the requestDesktopException
- if the window fails to resizeAckListener
,
DesktopException
public void resizeTo(int width, int height, AckListener listener) throws DesktopException
width
- Width of the windowheight
- Height of the windowlistener
- AckListener for the requestDesktopException
- if the window fails to resizeAckListener
,
DesktopException
public void resizeBy(int deltaWidth, int deltaHeight, String anchor) throws DesktopException
deltaWidth
- Width delta of the windowdeltaHeight
- Height delta of the windowanchor
- Specifies a corner to remain fixed during the resize. Please check resizeTo method for more informationDesktopException
- if the window fails to resizeDesktopException
public void resizeBy(int deltaWidth, int deltaHeight, String anchor, AckListener listener) throws DesktopException
deltaWidth
- Width delta of the windowdeltaHeight
- Height delta of the windowanchor
- Specifies a corner to remain fixed during the resize. Please check resizeTo method for more informationlistener
- AckListener for the requestDesktopException
- if the window fails to resizeAckListener
,
DesktopException
public void getState(AckListener listener)
listener
- AckListener for the requestAckListener
public void bringToFront(AckListener listener)
listener
- AckListener for the requestAckListener
public void isShowing(AckListener listener)
listener
- AckListener for the requestAckListener
public void getBounds(AsyncCallback<WindowBounds> callback, AckListener listener)
callback
- A function that is called if the method succeedslistener
- A function that is called if the method failsAsyncCallback
,
AckListener
public void setBounds(int left, int top, int width, int height, AckListener listener)
left
- The left position of the window.top
- The top position of the window.width
- The width position of the window.height
- The height position of the window.listener
- AckListener for the requestAckListener
public void bringToFront() throws DesktopException
DesktopException
- if the window fails to be brought to frontDesktopException
public void updateOptions(WindowOptions options, AckListener listener)
options
- The window options to changelistener
- AckListener for the requestWindowOptions
,
AckListener
public void getOptions(AsyncCallback<WindowOptions> callback, AckListener listener)
callback
- A function that is called if the method succeedslistener
- A function that is called if the method failsAsyncCallback
,
AckListener
public void setAsForeground(AckListener listener)
listener
- AckListener for the requestAckListener
public void enableFrame(AckListener listener)
listener
- AckListener for the requestAckListener
public void disableFrame(AckListener listener)
listener
- AckListener for the requestAckListener
public void updateOptions(org.json.JSONObject options) throws DesktopException
options
- The window options to changeDesktopException
- if this method fails to update window optionspublic void getNativeId(AckListener listener)
listener
- A function that is called if the method failsAsyncCallback
,
AckListener
public static Window wrap(String applicationUuid, String windowName, DesktopConnection connection)
applicationUuid
- UUID of the parent ApplicationwindowName
- name of the Windowconnection
- Connection object to the AppDesktoppublic void joinGroup(Window window) throws DesktopException
window
- The window whose group is to be joinedDesktopException
- if this window fails to join a grouppublic void joinGroup(Window window, AckListener listener)
window
- The window whose group is to be joinedlistener
- AckListener for the requestAckListener
public void mergeGroups(Window window) throws DesktopException
window
- The window whose group is to be mergedDesktopException
- if this window fails to merge into a groupDesktopException
public void mergeGroups(Window window, AckListener listener)
window
- The window whose group is to be mergedlistener
- AckListener for the requestAckListener
public void leaveGroup() throws DesktopException
DesktopException
- if this window fails to leave a grouppublic void leaveGroup(AckListener listener)
listener
- AckListener for the requestAckListener
public void animate(AnimationTransitions transitions, AnimationOptions options, AckListener listener)
transitions
- Describes the animations to preformoptions
- Options for the animationlistener
- AckListener for the requestAnimationTransitions
,
AnimationOptions
,
AckListener
public void getGroup(AsyncCallback<List<Window>> groupHandler, AckListener listener)
groupHandler
- A class that receives a list of wrapped windows in the same group.listener
- AckListener for the requestAsyncCallback
,
AckListener
public void addEventListener(String type, EventListener listener, AckListener callback)
Supported window event types are: app-connected same as connected. @Deprecated app-loaded same as connected. @Deprecated blurred bounds-changed bounds-changing closed close-requested disabled-frame-bounds-changed disabled-frame-bounds-changing focused frame-disabled frame-enabled group-changed hidden maximized minimized connected (this window is connected to Runtime with javascript API) restored shown
type
- Event typelistener
- Listener for the eventcallback
- AckListener for the requestEventListener
,
AckListener
public void removeEventListener(String type, EventListener listener, AckListener callback)
type
- Event typelistener
- Listener for the eventcallback
- AckListener for the requestEventListener
,
AckListener
public void embedInto(long parentHwndId, int width, int height, AckListener callback)
parentHwndId
- This will be the parent window handlewidth
- width of parent windowheight
- height of parent windowcallback
- AckListener for the requestAckListener
public void embedInto(long parentHwndId, int left, int top, int width, int height, AckListener callback)
parentHwndId
- This will be the parent window handleleft
- The new position of the left side of the window.top
- The new position of the top of the window.width
- width of parent windowheight
- height of parent windowcallback
- AckListener for the requestAckListener
public void executeJavaScript(String code, AsyncCallback<Object> callback, AckListener listener)
code
- JavaScript code to be executed on the windowcallback
- A function that is called if the method succeedslistener
- A function that is called if the method failsAsyncCallback
,
AckListener
public void showDeveloperTools(AckListener listener)
listener
- A function that is called if the method failsAckListener
public void navigate(String url, AckListener listener)
url
- The URL that you want to navigate tolistener
- A function that is called if the method failsAckListener
public void navigateForward(AckListener listener)
listener
- A function that is called if the method failsAckListener
public void navigateBack(AckListener listener)
listener
- A function that is called if the method failsAckListener
public void stopWindowNavigation(AckListener listener)
listener
- A function that is called if the method failsAckListener
public void authenticate(String username, String password, boolean cancel, AckListener listener)
username
- user namepassword
- passwprdcancel
- true to cancel the requestlistener
- A function that is called if the method failspublic void getInfo(String code, AsyncCallback<org.json.JSONObject> callback, AckListener listener)
code
- JavaScript code to be executed on the windowcallback
- A function that is called if the method succeedslistener
- A function that is called if the method failsAsyncCallback
,
AckListener
public void embedComponentSizeChange(int width, int height)
width
- width of parent windowheight
- height of parent windowpublic void embedComponentSizeChange(int left, int top, int width, int height)
left
- The new position of the left side of the window.top
- The new position of the top of the window.width
- width of parent windowheight
- height of parent windowpublic void getZoomLevel(AsyncCallback<Double> callback, AckListener listener)
callback
- A function that is called if the method succeedslistener
- A function that is called if the method failsAsyncCallback
,
AckListener
public void setZoomLevel(double level, AckListener listener)
level
- The zoom level.listener
- AckListener for the requestAckListener
public void reload(boolean ignoreCache, AckListener listener)
ignoreCache
- Specifies if the cache should be ignored during page reloadlistener
- AckListener for the requestAckListener
Copyright © 2022. All rights reserved.