All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.polymer.paper.widget.PaperDialog Maven / Gradle / Ivy

There is a newer version: 1.9.3.1
Show newest version
/*
 * This code was generated with Vaadin Web Component GWT API Generator, 
 * from paper-dialog project by The Polymer Authors
 * that is licensed with http://polymer.github.io/LICENSE.txt license.
 */
package com.vaadin.polymer.paper.widget;

import com.vaadin.polymer.paper.element.*;

import com.vaadin.polymer.iron.widget.event.IronOverlayClosedEvent;
import com.vaadin.polymer.iron.widget.event.IronOverlayClosedEventHandler;

import com.vaadin.polymer.iron.widget.event.IronOverlayOpenedEvent;
import com.vaadin.polymer.iron.widget.event.IronOverlayOpenedEventHandler;

import com.vaadin.polymer.PolymerWidget;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;

/**
 * 

<paper-dialog> is a dialog with Material Design styling and optional animations when it is
opened or closed. It provides styles for a header, content area, and an action area for buttons.
You can use the <paper-dialog-scrollable element (in its own repository) if you need a scrolling
content area. See Polymer.PaperDialogBehavior for specifics.

*

For example, the following code implements a dialog with a header, scrolling content area and
buttons.

*
<paper-dialog>
 *   <h2>Header</h2>
 *   <paper-dialog-scrollable>
 *     Lorem ipsum...
 *   </paper-dialog-scrollable>
 *   <div class="buttons">
 *     <paper-button dialog-dismiss>Cancel</paper-button>
 *     <paper-button dialog-confirm>Accept</paper-button>
 *   </div>
 * </paper-dialog>
 * 
 * 
 * 

Styling

*

See the docs for Polymer.PaperDialogBehavior for the custom properties available for styling
this element.

*

Animations

*

Set the entry-animation and/or exit-animation attributes to add an animation when the dialog
is opened or closed. See the documentation in
PolymerElements/neon-animation for more info.

*

For example:

*
<link rel="import" href="components/neon-animation/animations/scale-up-animation.html">
 * <link rel="import" href="components/neon-animation/animations/fade-out-animation.html">
 * 
 * <paper-dialog entry-animation="scale-up-animation"
 *               exit-animation="fade-out-animation">
 *   <h2>Header</h2>
 *   <div>Dialog body</div>
 * </paper-dialog>
 * 
 * 
 * 

Accessibility

*

See the docs for Polymer.PaperDialogBehavior for accessibility features implemented by this
element.

*/ public class PaperDialog extends PolymerWidget { /** * Default Constructor. */ public PaperDialog() { this(""); } /** * Constructor used by UIBinder to create widgets with content. */ public PaperDialog(String html) { super(PaperDialogElement.TAG, PaperDialogElement.SRC, html); getPolymerElement().addEventListener( com.vaadin.polymer.iron.element.event.IronOverlayClosedEvent.NAME, new com.vaadin.polymer.iron.element.event.IronOverlayClosedEvent.Listener() { @Override protected void handleEvent(com.vaadin.polymer.iron.element.event.IronOverlayClosedEvent event) { fireEvent(new IronOverlayClosedEvent(event)); } }); getPolymerElement().addEventListener( com.vaadin.polymer.iron.element.event.IronOverlayOpenedEvent.NAME, new com.vaadin.polymer.iron.element.event.IronOverlayOpenedEvent.Listener() { @Override protected void handleEvent(com.vaadin.polymer.iron.element.event.IronOverlayOpenedEvent event) { fireEvent(new IronOverlayOpenedEvent(event)); } }); } /** * Gets a handle to the Polymer object's underlying DOM element. */ public PaperDialogElement getPolymerElement() { return (PaperDialogElement) getElement(); } /** * * * JavaScript Info: * @property listeners * @type Object * */ public JavaScriptObject getListeners(){ return getPolymerElement().getListeners(); } /** * * * JavaScript Info: * @property listeners * @type Object * */ public void setListeners(JavaScriptObject value) { getPolymerElement().setListeners(value); } /** *

If modal is true, this implies no-cancel-on-outside-click and with-backdrop.

* * JavaScript Info: * @property modal * @type Boolean * @behavior PaperDialog */ public boolean getModal(){ return getPolymerElement().getModal(); } /** *

If modal is true, this implies no-cancel-on-outside-click and with-backdrop.

* * JavaScript Info: * @property modal * @type Boolean * @behavior PaperDialog */ public void setModal(boolean value) { getPolymerElement().setModal(value); } /** * * * JavaScript Info: * @method attached * @behavior PaperDialog */ public void attached() { getPolymerElement().attached(); } /** * * * JavaScript Info: * @method detached * @behavior PaperDialog */ public void detached() { getPolymerElement().detached(); } /** * * * JavaScript Info: * @property hostAttributes * @type Object * @behavior PaperDialog */ public JavaScriptObject getHostAttributes(){ return getPolymerElement().getHostAttributes(); } /** * * * JavaScript Info: * @property hostAttributes * @type Object * @behavior PaperDialog */ public void setHostAttributes(JavaScriptObject value) { getPolymerElement().setHostAttributes(value); } /** *

The backdrop element.

* * JavaScript Info: * @method backdropElement * @behavior PaperDialog */ public void backdropElement() { getPolymerElement().backdropElement(); } /** *

Cancels the overlay.

* * JavaScript Info: * @method cancel * @behavior PaperDialog */ public void cancel() { getPolymerElement().cancel(); } /** *

True if the overlay was canceled when it was last closed.

* * JavaScript Info: * @property canceled * @type Boolean * @behavior PaperDialog */ public boolean getCanceled(){ return getPolymerElement().getCanceled(); } /** *

True if the overlay was canceled when it was last closed.

* * JavaScript Info: * @property canceled * @type Boolean * @behavior PaperDialog */ public void setCanceled(boolean value) { getPolymerElement().setCanceled(value); } /** *

Close the overlay.

* * JavaScript Info: * @method close * @behavior PaperDialog */ public void close() { getPolymerElement().close(); } /** *

Returns the reason this dialog was last closed.

* * JavaScript Info: * @property closingReason * @type Object * @behavior PaperDialog */ public JavaScriptObject getClosingReason(){ return getPolymerElement().getClosingReason(); } /** *

Returns the reason this dialog was last closed.

* * JavaScript Info: * @property closingReason * @type Object * @behavior PaperDialog */ public void setClosingReason(JavaScriptObject value) { getPolymerElement().setClosingReason(value); } /** *

Returns the reason this dialog was last closed.

* * JavaScript Info: * @attribute closing-reason * @behavior PaperDialog */ public void setClosingReason(String value) { getPolymerElement().setAttribute("closing-reason", value); } /** *

Set to true to disable auto-focusing the overlay or child nodes with
the autofocus attribute` when the overlay is opened.

* * JavaScript Info: * @property noAutoFocus * @type Boolean * @behavior PaperDialog */ public boolean getNoAutoFocus(){ return getPolymerElement().getNoAutoFocus(); } /** *

Set to true to disable auto-focusing the overlay or child nodes with
the autofocus attribute` when the overlay is opened.

* * JavaScript Info: * @property noAutoFocus * @type Boolean * @behavior PaperDialog */ public void setNoAutoFocus(boolean value) { getPolymerElement().setNoAutoFocus(value); } /** *

Set to true to disable canceling the overlay with the ESC key.

* * JavaScript Info: * @property noCancelOnEscKey * @type Boolean * @behavior PaperDialog */ public boolean getNoCancelOnEscKey(){ return getPolymerElement().getNoCancelOnEscKey(); } /** *

Set to true to disable canceling the overlay with the ESC key.

* * JavaScript Info: * @property noCancelOnEscKey * @type Boolean * @behavior PaperDialog */ public void setNoCancelOnEscKey(boolean value) { getPolymerElement().setNoCancelOnEscKey(value); } /** *

Set to true to disable canceling the overlay by clicking outside it.

* * JavaScript Info: * @property noCancelOnOutsideClick * @type Boolean * @behavior PaperDialog */ public boolean getNoCancelOnOutsideClick(){ return getPolymerElement().getNoCancelOnOutsideClick(); } /** *

Set to true to disable canceling the overlay by clicking outside it.

* * JavaScript Info: * @property noCancelOnOutsideClick * @type Boolean * @behavior PaperDialog */ public void setNoCancelOnOutsideClick(boolean value) { getPolymerElement().setNoCancelOnOutsideClick(value); } /** *

Open the overlay.

* * JavaScript Info: * @method open * @behavior PaperDialog */ public void open() { getPolymerElement().open(); } /** *

True if the overlay is currently displayed.

* * JavaScript Info: * @property opened * @type Boolean * @behavior PaperDialog */ public boolean getOpened(){ return getPolymerElement().getOpened(); } /** *

True if the overlay is currently displayed.

* * JavaScript Info: * @property opened * @type Boolean * @behavior PaperDialog */ public void setOpened(boolean value) { getPolymerElement().setOpened(value); } /** *

Toggle the opened state of the overlay.

* * JavaScript Info: * @method toggle * @behavior PaperDialog */ public void toggle() { getPolymerElement().toggle(); } /** *

Set to true to display a backdrop behind the overlay.

* * JavaScript Info: * @property withBackdrop * @type Boolean * @behavior PaperDialog */ public boolean getWithBackdrop(){ return getPolymerElement().getWithBackdrop(); } /** *

Set to true to display a backdrop behind the overlay.

* * JavaScript Info: * @property withBackdrop * @type Boolean * @behavior PaperDialog */ public void setWithBackdrop(boolean value) { getPolymerElement().setWithBackdrop(value); } /** * * * JavaScript Info: * @method registered * @behavior PaperDialog */ public void registered() { getPolymerElement().registered(); } /** *

Set to true to auto-fit on attach.

* * JavaScript Info: * @property autoFitOnAttach * @type Boolean * @behavior PaperDialog */ public boolean getAutoFitOnAttach(){ return getPolymerElement().getAutoFitOnAttach(); } /** *

Set to true to auto-fit on attach.

* * JavaScript Info: * @property autoFitOnAttach * @type Boolean * @behavior PaperDialog */ public void setAutoFitOnAttach(boolean value) { getPolymerElement().setAutoFitOnAttach(value); } /** *

Centers horizontally and vertically if not already positioned. This also sets
position:fixed.

* * JavaScript Info: * @method center * @behavior PaperDialog */ public void center() { getPolymerElement().center(); } /** *

Constrains the size of the element to the window or fitInfo by setting max-height
and/or max-width.

* * JavaScript Info: * @method constrain * @behavior PaperDialog */ public void constrain() { getPolymerElement().constrain(); } /** *

Fits and optionally centers the element into the window, or fitInfo if specified.

* * JavaScript Info: * @method fit * @behavior PaperDialog */ public void fit() { getPolymerElement().fit(); } /** *

The element to fit this into.

* * JavaScript Info: * @property fitInto * @type Object * @behavior PaperDialog */ public JavaScriptObject getFitInto(){ return getPolymerElement().getFitInto(); } /** *

The element to fit this into.

* * JavaScript Info: * @property fitInto * @type Object * @behavior PaperDialog */ public void setFitInto(JavaScriptObject value) { getPolymerElement().setFitInto(value); } /** *

The element to fit this into.

* * JavaScript Info: * @attribute fit-into * @behavior PaperDialog */ public void setFitInto(String value) { getPolymerElement().setAttribute("fit-into", value); } /** *

Equivalent to calling resetFit() and fit(). Useful to call this after the element,
the window, or the fitInfo element has been resized.

* * JavaScript Info: * @method refit * @behavior PaperDialog */ public void refit() { getPolymerElement().refit(); } /** *

Resets the target element’s position and size constraints, and clear
the memoized data.

* * JavaScript Info: * @method resetFit * @behavior PaperDialog */ public void resetFit() { getPolymerElement().resetFit(); } /** *

The element that will receive a max-height/width. By default it is the same as this,
but it can be set to a child element. This is useful, for example, for implementing a
scrolling region inside the element.

* * JavaScript Info: * @property sizingTarget * @type !Element * @behavior PaperDialog */ public JavaScriptObject getSizingTarget(){ return getPolymerElement().getSizingTarget(); } /** *

The element that will receive a max-height/width. By default it is the same as this,
but it can be set to a child element. This is useful, for example, for implementing a
scrolling region inside the element.

* * JavaScript Info: * @property sizingTarget * @type !Element * @behavior PaperDialog */ public void setSizingTarget(JavaScriptObject value) { getPolymerElement().setSizingTarget(value); } /** *

The element that will receive a max-height/width. By default it is the same as this,
but it can be set to a child element. This is useful, for example, for implementing a
scrolling region inside the element.

* * JavaScript Info: * @attribute sizing-target * @behavior PaperDialog */ public void setSizingTarget(String value) { getPolymerElement().setAttribute("sizing-target", value); } /** *

Used to assign the closest resizable ancestor to this resizable
if the ancestor detects a request for notifications.

* * JavaScript Info: * @method assignParentResizable * @param {} parentResizable * @behavior NeonAnimatedPages */ public void assignParentResizable(JavaScriptObject parentResizable) { getPolymerElement().assignParentResizable(parentResizable); } /** *

Can be called to manually notify a resizable and its descendant
resizables of a resize change.

* * JavaScript Info: * @method notifyResize * @behavior NeonAnimatedPages */ public void notifyResize() { getPolymerElement().notifyResize(); } /** *

This method can be overridden to filter nested elements that should or
should not be notified by the current element. Return true if an element
should be notified, or false if it should not be notified.

* * JavaScript Info: * @method resizerShouldNotify * @param {HTMLElement} element * @behavior NeonAnimatedPages */ public void resizerShouldNotify(JavaScriptObject element) { getPolymerElement().resizerShouldNotify(element); } /** *

Used to remove a resizable descendant from the list of descendants
that should be notified of a resize change.

* * JavaScript Info: * @method stopResizeNotificationsFor * @param {} target * @behavior NeonAnimatedPages */ public void stopResizeNotificationsFor(JavaScriptObject target) { getPolymerElement().stopResizeNotificationsFor(target); } /** *

Cancels the currently running animation.

* * JavaScript Info: * @method cancelAnimation * @behavior NeonAnimatedPages */ public void cancelAnimation() { getPolymerElement().cancelAnimation(); } /** *

Plays an animation with an optional type.

* * JavaScript Info: * @method playAnimation * @param {string=} type * @param {!Object=} cookie * @behavior NeonAnimatedPages */ public void playAnimation(JavaScriptObject type, JavaScriptObject cookie) { getPolymerElement().playAnimation(type, cookie); } /** *

Animation configuration. See README for more info.

* * JavaScript Info: * @property animationConfig * @type Object * @behavior NeonAnimatable */ public JavaScriptObject getAnimationConfig(){ return getPolymerElement().getAnimationConfig(); } /** *

Animation configuration. See README for more info.

* * JavaScript Info: * @property animationConfig * @type Object * @behavior NeonAnimatable */ public void setAnimationConfig(JavaScriptObject value) { getPolymerElement().setAnimationConfig(value); } /** *

Animation configuration. See README for more info.

* * JavaScript Info: * @attribute animation-config * @behavior NeonAnimatable */ public void setAnimationConfig(String value) { getPolymerElement().setAttribute("animation-config", value); } /** *

Convenience property for setting an ‘entry’ animation. Do not set animationConfig.entry
manually if using this. The animated node is set to this if using this property.

* * JavaScript Info: * @property entryAnimation * @type String * @behavior NeonAnimatable */ public String getEntryAnimation(){ return getPolymerElement().getEntryAnimation(); } /** *

Convenience property for setting an ‘entry’ animation. Do not set animationConfig.entry
manually if using this. The animated node is set to this if using this property.

* * JavaScript Info: * @property entryAnimation * @type String * @behavior NeonAnimatable */ public void setEntryAnimation(String value) { getPolymerElement().setEntryAnimation(value); } /** *

Convenience property for setting an ‘exit’ animation. Do not set animationConfig.exit
manually if using this. The animated node is set to this if using this property.

* * JavaScript Info: * @property exitAnimation * @type String * @behavior NeonAnimatable */ public String getExitAnimation(){ return getPolymerElement().getExitAnimation(); } /** *

Convenience property for setting an ‘exit’ animation. Do not set animationConfig.exit
manually if using this. The animated node is set to this if using this property.

* * JavaScript Info: * @property exitAnimation * @type String * @behavior NeonAnimatable */ public void setExitAnimation(String value) { getPolymerElement().setExitAnimation(value); } /** *

An element implementing Polymer.NeonAnimationRunnerBehavior calls this method to configure
an animation with an optional type. Elements implementing Polymer.NeonAnimatableBehavior
should define the property animationConfig, which is either a configuration object
or a map of animation type to array of configuration objects.

* * JavaScript Info: * @method getAnimationConfig * @param {} type * @behavior NeonAnimatable */ public void getAnimationConfig(JavaScriptObject type) { getPolymerElement().getAnimationConfig(type); } /** *

Fired after the iron-overlay closes.

* * JavaScript Info: * @event iron-overlay-closed */ public HandlerRegistration addIronOverlayClosedHandler(IronOverlayClosedEventHandler handler) { return addHandler(handler, IronOverlayClosedEvent.TYPE); } /** *

Fired after the iron-overlay opens.

* * JavaScript Info: * @event iron-overlay-opened */ public HandlerRegistration addIronOverlayOpenedHandler(IronOverlayOpenedEventHandler handler) { return addHandler(handler, IronOverlayOpenedEvent.TYPE); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy