public class Window extends Object
| 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
Supported system event types are:
blurred
bounds-changed
bounds-changing
closed
focused
maximized
minimized
restored
|
void |
animate(AnimationTransitions transitions,
AnimationOptions options,
AckListener callback)
Performs the specified window transitions
|
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 |
disableFrame(AckListener callback)
Prevents a user from changing a window's size/position when using the window's frame
|
void |
enableFrame(AckListener callback)
Allows a user from changing a window's size/position when using the window's frame
|
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
|
void |
getGroup(AsyncCallback<List<Window>> groupHandler,
AckListener callback)
Passes a list of wrapped windows in the same group
An empty list is returned if the window is not in a group.
|
String |
getName()
Gets name
|
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
|
String |
getUuid()
Gets UUID
|
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 callback)
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(Window window,
AckListener callback)
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)
Mazimizes 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 callback)
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,
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 |
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 callback)
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 |
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 |
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
|
protected Window(Application application)
application - Parent Applicationpublic String getUuid()
public String getName()
public Application getParentApplication()
public Window getParentWindow()
public void getSnapshot(AckListener callback)
callback - AckListener for the requestAckListenerpublic void show()
public void show(AckListener listener)
listener - AckListener for the requestAckListenerpublic void hide()
public void hide(AckListener listener)
listener - AckListener for the requestAckListenerpublic void close()
public void close(AckListener listener)
listener - AckListener for the requestAckListenerpublic void minimize()
public void minimize(AckListener listener)
listener - AckListener for the requestAckListenerpublic void maximize()
public void maximize(AckListener listener)
listener - AckListener for the requestAckListenerpublic void restore()
public void restore(AckListener listener)
listener - AckListener for the requestAckListenerpublic void focus()
public void focus(AckListener listener)
listener - AckListener for the requestAckListenerpublic void blur()
public void blur(AckListener listener)
listener - AckListener for the requestAckListenerpublic void flash(AckListener callback)
callback - AckListener for the requestAckListenerpublic void showAt(int left,
int top,
boolean toggle)
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 callspublic void showAt(int left,
int top,
boolean toggle,
AckListener listener)
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 requestAckListenerpublic void moveTo(int left,
int top)
left - The left position of the windowtop - The right position of the windowpublic void moveTo(int left,
int top,
AckListener listener)
left - The left position of the windowtop - The right position of the windowlistener - AckListener for the requestAckListenerpublic void moveBy(int deltaLeft,
int deltaTop,
AckListener listener)
deltaLeft - The change in the left position of the windowdeltaTop - The change in the top position of the windowlistener - AckListener for the requestAckListenerpublic void resizeTo(int width,
int height,
String anchor)
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".public void resizeTo(int width,
int height,
String anchor,
AckListener listener)
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 requestAckListenerpublic void resizeTo(int width,
int height,
AckListener listener)
width - Width of the windowheight - Height of the windowlistener - AckListener for the requestAckListenerpublic void resizeBy(int deltaWidth,
int deltaHeight,
String anchor)
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 informationpublic void resizeBy(int deltaWidth,
int deltaHeight,
String anchor,
AckListener listener)
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 requestAckListenerpublic void getState(AckListener listener)
listener - AckListener for the requestAckListenerpublic void bringToFront(AckListener listener)
listener - AckListener for the requestAckListenerpublic void isShowing(AckListener listener)
listener - AckListener for the requestAckListenerpublic 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,
AckListenerpublic 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 requestAckListenerpublic void bringToFront()
public void updateOptions(WindowOptions options, AckListener listener)
options - The window options to changelistener - AckListener for the requestWindowOptions,
AckListenerpublic 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,
AckListenerpublic void setAsForeground(AckListener callback)
callback - AckListener for the requestAckListenerpublic void enableFrame(AckListener callback)
callback - AckListener for the requestAckListenerpublic void disableFrame(AckListener callback)
callback - AckListener for the requestAckListenerpublic void updateOptions(org.json.JSONObject options)
options - The window options to changepublic 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)
window - The window whose group is to be joinedpublic void joinGroup(Window window, AckListener callback)
window - The window whose group is to be joinedcallback - AckListener for the requestAckListenerpublic void mergeGroups(Window window)
window - The window whose group is to be mergedpublic void mergeGroups(Window window, AckListener callback)
window - The window whose group is to be mergedcallback - AckListener for the requestAckListenerpublic void leaveGroup()
public void leaveGroup(Window window, AckListener callback)
callback - AckListener for the requestAckListenerpublic void animate(AnimationTransitions transitions, AnimationOptions options, AckListener callback)
transitions - Describes the animations to preformoptions - Options for the animationcallback - AckListener for the requestAnimationTransitions,
AnimationOptions,
AckListenerpublic void getGroup(AsyncCallback<List<Window>> groupHandler, AckListener callback)
groupHandler - A class that receives a list of wrapped windows in the same group.callback - AckListener for the requestAsyncCallback,
AckListenerpublic void addEventListener(String type, EventListener listener, AckListener callback)
type - Event typelistener - Listener for the eventcallback - AckListener for the requestEventListener,
AckListenerpublic void removeEventListener(String type, EventListener listener, AckListener callback)
type - Event typelistener - Listener for the eventcallback - AckListener for the requestEventListener,
AckListenerCopyright © 2014. All rights reserved.