Package com.tick42.glue.desktop.windows
Interface Window
-
- All Superinterfaces:
AsynchronousCloseable,AutoCloseable
public interface Window extends AsynchronousCloseable
Glue desktop window.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<?>addFrameButton(String buttonId, ButtonOptions options)Adds a button to the window frame.CompletionStage<?>changeBounds(Bounds bounds)Changes the window position and sizeCompletionStage<?>changeChannel(String channel)Changes the window channelCompletionStage<?>changeContext(Map<String,Object> context)Changes the window contextCompletionStage<?>changeTitle(String title)Changes the window titleCompletionStage<?>changeVisibility(boolean visible)Changes the visibility.CompletionStage<?>collapse()Collapses the window.CompletionStage<?>expand()Expands the window.CompletionStage<?>focus()Focuses the window.CompletionStage<?>maximize()Minimizes the window.CompletionStage<?>minimize()Maximizes the window.GlueEvent.Subscription<WindowBoundsChangedEvent>onBoundsChanged(WindowBoundsChangedEvent.Listener listener)Registers a callback to be notified when window bounds change.GlueEvent.Subscription<WindowCollapsedChangedEvent>onCollapsedChanged(WindowCollapsedChangedEvent.Listener listener)Registers a callback to be notified when window collapsed changes.AsynchronousCloseableonContextUpdated(WindowContextUpdatedEvent.Listener listener)Registers a callback to be notified upon context update.GlueEvent.Subscription<WindowFocusChangedEvent>onFocusChanged(WindowFocusChangedEvent.Listener listener)Registers a callback to be notified when window focus changes.GlueEvent.Subscription<WindowFrameButtonClickedEvent>onFrameButtonClicked(WindowFrameButtonClickedEvent.Listener listener)Registers a callback to be notified when some button from the window frame is clicked.GlueEvent.Subscription<WindowHibernateEvent>onHibernated(WindowHibernateEvent.Listener listener)Registers a callback to be notified when the current layout is about to be suspended/hibernated.GlueEvent.Subscription<WindowResumedEvent>onResumed(WindowResumedEvent.Listener listener)Registers a callback to be notified when the current layout is about to be resumed.GlueEvent.Subscription<WindowStateChangedEvent>onStateChanged(WindowStateChangedEvent.Listener listener)Registers a callback to be notified when window state changes.GlueEvent.Subscription<WindowTitleChangedEvent>onTitleChanged(WindowTitleChangedEvent.Listener listener)Registers a callback to be notified when window titles changes.GlueEvent.Subscription<WindowVisibilityChangedEvent>onVisibilityChanged(WindowVisibilityChangedEvent.Listener listener)Registers a callback to be notified when window visibility changes.CompletionStage<?>removeFrameButton(String buttonId)Removes a button from the window frame.CompletionStage<?>restore()Restores the window.CompletionStage<?>toggleCollapse()Toggles the window collapsed state.-
Methods inherited from interface com.tick42.glue.core.AsynchronousCloseable
close, closeAsync, onClose
-
-
-
-
Method Detail
-
changeTitle
CompletionStage<?> changeTitle(String title)
Changes the window title- Parameters:
title- the title to be displayed- Returns:
- completion stage that completes when title is changed, never
null
-
changeChannel
CompletionStage<?> changeChannel(String channel)
Changes the window channel- Parameters:
channel- the new channel- Returns:
- completion stage that completes when channel is changed, never
null
-
changeBounds
CompletionStage<?> changeBounds(Bounds bounds)
Changes the window position and size- Parameters:
bounds- the new position and window- Returns:
- completion stage that completes when bounds are changed, never
null
-
changeVisibility
CompletionStage<?> changeVisibility(boolean visible)
Changes the visibility. This also affects the window icon in the taskbar- Parameters:
visible- flag indicating whether the window should be shown or hidden- Returns:
- completion stage that completes when visibility is changed, never
null
-
maximize
CompletionStage<?> maximize()
Minimizes the window.- Returns:
- completion stage that completes when minimized, never
null - Since:
- 1.4.9
-
minimize
CompletionStage<?> minimize()
Maximizes the window.- Returns:
- completion stage that completes when maximized, never
null - Since:
- 1.4.9
-
restore
CompletionStage<?> restore()
Restores the window. (set window state to normal)- Returns:
- completion stage that completes when restored, never
null - Since:
- 1.4.9
-
collapse
CompletionStage<?> collapse()
Collapses the window.- Returns:
- completion stage that completes when collapsed, never
null - Since:
- 1.4.9
-
expand
CompletionStage<?> expand()
Expands the window.- Returns:
- completion stage that completes when expanded, never
null - Since:
- 1.4.9
-
toggleCollapse
CompletionStage<?> toggleCollapse()
Toggles the window collapsed state.- Returns:
- completion stage that completes when collapse is toggled, never
null - Since:
- 1.4.9
-
focus
CompletionStage<?> focus()
Focuses the window.- Returns:
- completion stage that completes when focus is gained, never
null - Since:
- 1.4.9
-
changeContext
CompletionStage<?> changeContext(Map<String,Object> context)
Changes the window context- Parameters:
context- context for the window- Returns:
- completion stage that completes when context is changed, never
null
-
addFrameButton
CompletionStage<?> addFrameButton(String buttonId, ButtonOptions options)
Adds a button to the window frame.- Parameters:
buttonId- id of the button to addoptions- options for the button to add- Returns:
- completion stage that completes when to button is added, never
null
-
removeFrameButton
CompletionStage<?> removeFrameButton(String buttonId)
Removes a button from the window frame.- Parameters:
buttonId- id of the button to remove- Returns:
- completion stage that completes when the button is removed, never
null
-
onFrameButtonClicked
GlueEvent.Subscription<WindowFrameButtonClickedEvent> onFrameButtonClicked(WindowFrameButtonClickedEvent.Listener listener)
Registers a callback to be notified when some button from the window frame is clicked.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null
-
onHibernated
GlueEvent.Subscription<WindowHibernateEvent> onHibernated(WindowHibernateEvent.Listener listener)
Registers a callback to be notified when the current layout is about to be suspended/hibernated.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null
-
onResumed
GlueEvent.Subscription<WindowResumedEvent> onResumed(WindowResumedEvent.Listener listener)
Registers a callback to be notified when the current layout is about to be resumed.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null
-
onContextUpdated
AsynchronousCloseable onContextUpdated(WindowContextUpdatedEvent.Listener listener)
Registers a callback to be notified upon context update.- Parameters:
listener- callback to be registered- Returns:
subscription objectthat can be used to unsubscribe from events, nevernull.
-
onBoundsChanged
GlueEvent.Subscription<WindowBoundsChangedEvent> onBoundsChanged(WindowBoundsChangedEvent.Listener listener)
Registers a callback to be notified when window bounds change.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null - Since:
- 1.4.6
-
onVisibilityChanged
GlueEvent.Subscription<WindowVisibilityChangedEvent> onVisibilityChanged(WindowVisibilityChangedEvent.Listener listener)
Registers a callback to be notified when window visibility changes.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null - Since:
- 1.4.6
-
onFocusChanged
GlueEvent.Subscription<WindowFocusChangedEvent> onFocusChanged(WindowFocusChangedEvent.Listener listener)
Registers a callback to be notified when window focus changes.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null - Since:
- 1.4.6
-
onTitleChanged
GlueEvent.Subscription<WindowTitleChangedEvent> onTitleChanged(WindowTitleChangedEvent.Listener listener)
Registers a callback to be notified when window titles changes.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null - Since:
- 1.4.6
-
onCollapsedChanged
GlueEvent.Subscription<WindowCollapsedChangedEvent> onCollapsedChanged(WindowCollapsedChangedEvent.Listener listener)
Registers a callback to be notified when window collapsed changes.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null - Since:
- 1.4.9
-
onStateChanged
GlueEvent.Subscription<WindowStateChangedEvent> onStateChanged(WindowStateChangedEvent.Listener listener)
Registers a callback to be notified when window state changes.- Parameters:
listener- callback to be registered- Returns:
- subscription object that can be used to unregister the callback, never
null - Since:
- 1.4.9
-
-