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

com.vaadin.polymer.paper.widget.PaperBadge 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-badge 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.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-badge> is a circular text badge that is displayed on the top right
corner of an element, representing a status or a notification. It will badge
the anchor element specified in the for attribute, or, if that doesn’t exist,
centered to the parent node containing it.

*

Example:

*
<div style="display:inline-block">
 *   <span>Inbox</span>
 *   <paper-badge label="3"></paper-badge>
 * </div>
 * 
 * <div>
 *   <paper-button id="btn">Status</button>
 *   <paper-badge for="btn" label="♥︎">b/paper-badge>
 * </div>
 * 
 * 
 * 

Styling

*

The following custom properties and mixins are available for styling:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Custom propertyDescriptionDefault
--paper-badge-backgroundThe background color of the badge--accent-color
--paper-badge-opacityThe opacity of the badge1.0
--paper-badge-text-colorThe color of the badge textwhite
--paper-badge-widthThe width of the badge circle22px
--paper-badge-heightThe height of the badge circle22px
--paper-badge-margin-leftOptional spacing added to the left of the badge.0px
--paper-badge-margin-bottomTOptional spacing added to the bottom of the badge.0px
--paper-badgeMixin applied to the badge{}
*/ public class PaperBadge extends PolymerWidget { /** * Default Constructor. */ public PaperBadge() { this(""); } /** * Constructor used by UIBinder to create widgets with content. */ public PaperBadge(String html) { super(PaperBadgeElement.TAG, PaperBadgeElement.SRC, html); } /** * Gets a handle to the Polymer object's underlying DOM element. */ public PaperBadgeElement getPolymerElement() { try { return (PaperBadgeElement) getElement(); } catch (ClassCastException e) { jsinteropError(); return null; } } /** *

The id of the element that the badge is anchored to. This element
must be a sibling of the badge.

* * JavaScript Info: * @property for * @type String * */ public String getFor(){ return getPolymerElement().getFor(); } /** *

The id of the element that the badge is anchored to. This element
must be a sibling of the badge.

* * JavaScript Info: * @property for * @type String * */ public void setFor(String value) { getPolymerElement().setFor(value); } /** *

The label displayed in the badge. The label is centered, and ideally
should have very few characters.

* * JavaScript Info: * @property label * @type String * */ public String getLabel(){ return getPolymerElement().getLabel(); } /** *

The label displayed in the badge. The label is centered, and ideally
should have very few characters.

* * JavaScript Info: * @property label * @type String * */ public void setLabel(String value) { getPolymerElement().setLabel(value); } /** *

Returns the target element that this badge is anchored to. It is
either the element given by the for attribute, or the immediate parent
of the badge.

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

Repositions the badge relative to its anchor element. This is called
automatically when the badge is attached or an iron-resize event is
fired (for exmaple if the window has resized, or your target is a
custom element that implements IronResizableBehavior).

*

You should call this in all other cases when the achor’s position
might have changed (for example, if it’s visibility has changed, or
you’ve manually done a page re-layout).

* * JavaScript Info: * @method updatePosition * */ public void updatePosition() { getPolymerElement().updatePosition(); } /** * * * JavaScript Info: * @method attached * */ public void attached() { getPolymerElement().attached(); } /** * * * 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); } /** *

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 PaperTabs */ 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 PaperTabs */ 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 PaperTabs */ 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 PaperTabs */ public void stopResizeNotificationsFor(JavaScriptObject target) { getPolymerElement().stopResizeNotificationsFor(target); } /** * * * JavaScript Info: * @method detached * @behavior PaperTabs */ public void detached() { getPolymerElement().detached(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy