Package arez.dom
Class DocumentVisibility
java.lang.Object
arez.dom.DocumentVisibility
- All Implemented Interfaces:
Disposable
Exposes
document.visibilityState
as an observable property for specified documents.
A very simple example
import arez.Arez;
import arez.dom.DocumentVisibility;
import com.google.gwt.core.client.EntryPoint;
import akasha.Console;
public class DocumentVisibilityExample
implements EntryPoint
{
public void onModuleLoad()
{
final DocumentVisibility v = DocumentVisibility.create();
Arez.context().observer( () -> Console.log( "Document Visibility: " + v.getVisibility() ) );
}
}
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The visibility state of the document. -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentVisibility
create()
Create component monitoring the default document.static DocumentVisibility
create
(akasha.Document document) Create component monitoring specific document.void
dispose()
Dispose the element.akasha.Document
Return the document that monitoring visibility state.Return the visibility state of the document as an enum.Return the visibility state of the document as a string.boolean
Return true if dispose() has been called on object.boolean
isHidden()
Return true if visibility state is "hidden".boolean
Return true if visibility state is "visible".void
setDocument
(akasha.Document document) Change the document that is having visibility state monitored.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arez.Disposable
isNotDisposed
-
Method Details
-
create
Create component monitoring the default document.- Returns:
- the new component.
-
create
Create component monitoring specific document.- Parameters:
document
- the document.- Returns:
- the new component.
-
getDocument
Return the document that monitoring visibility state.- Returns:
- the document.
-
setDocument
Change the document that is having visibility state monitored.- Parameters:
document
- the new document.
-
getVisibility
Return the visibility state of the document as an enum.- Returns:
- the visibility state as an enum.
-
getVisibilityState
Return the visibility state of the document as a string.- Returns:
- the visibility state as a string.
-
isVisible
Return true if visibility state is "visible".- Returns:
- true if visibility state is "visible".
-
isHidden
Return true if visibility state is "hidden".- Returns:
- true if visibility state is "hidden".
-
dispose
Description copied from interface:Disposable
Dispose the element. SeeDisposable
for a description of the implications.- Specified by:
dispose
in interfaceDisposable
-
isDisposed
Description copied from interface:Disposable
Return true if dispose() has been called on object.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if dispose has been called.
-