com.vaadin.polymer.app.widget.AppDrawerLayout Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from app-layout project by The Polymer Authors
* that is licensed with https://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.app.widget;
import com.vaadin.polymer.app.*;
import com.vaadin.polymer.*;
import com.vaadin.polymer.elemental.*;
import com.vaadin.polymer.PolymerWidget;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;
/**
* app-drawer-layout is a wrapper element that positions an app-drawer and other content. When
the viewport width is smaller than responsiveWidth
, this element changes to narrow layout.
In narrow layout, the drawer will be stacked on top of the main content. The drawer will slide
in/out to hide/reveal the main content.
* By default the drawer is aligned to the start, which is left in LTR layouts:
* <app-drawer-layout>
* <app-drawer>
* drawer content
* </app-drawer>
* <div>
* main content
* </div>
* </app-drawer-layout>
*
* Align the drawer at the end:
* <app-drawer-layout>
* <app-drawer align="end">
* drawer content
* </app-drawer>
* <div>
* main content
* </div>
* </app-drawer-layout>
*
* With an app-header-layout:
* <app-drawer-layout>
* <app-drawer>
* drawer-content
* </app-drawer>
* <app-header-layout>
* <app-header>
* <app-toolbar>
* <div main-title>App name</div>
* </app-toolbar>
* </app-header>
*
* main content
*
* </app-header-layout>
* </app-drawer-layout>
*
* Add the drawer-toggle
attribute to elements inside app-drawer-layout
that toggle the drawer on tap events:
* <app-drawer-layout>
* <app-drawer>
* drawer-content
* </app-drawer>
* <app-header-layout>
* <app-header>
* <app-toolbar>
* <paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
* <div main-title>App name</div>
* </app-toolbar>
* </app-header>
*
* main content
*
* </app-header-layout>
* </app-drawer-layout>
*
* Add the fullbleed
attribute to app-drawer-layout to make it fit the size of its container:
* <app-drawer-layout fullbleed>
* <app-drawer>
* drawer content
* </app-drawer>
* <div>
* main content
* </div>
* </app-drawer-layout>
*
* Styling
*
*
*
* Custom property
* Description
* Default
*
*
*
*
* --app-drawer-layout-content-transition
* Transition for the content container
* none
*
*
*
*/
public class AppDrawerLayout extends PolymerWidget {
/**
* Default Constructor.
*/
public AppDrawerLayout() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public AppDrawerLayout(String html) {
super(AppDrawerLayoutElement.TAG, AppDrawerLayoutElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public AppDrawerLayoutElement getPolymerElement() {
return (AppDrawerLayoutElement) getElement();
}
/**
* Returns true if it is in narrow layout. This is useful if you need to show/hide
elements based on the layout.
*
* JavaScript Info:
* @property narrow
* @type Boolean
*
*/
public boolean getNarrow() {
return getPolymerElement().getNarrow();
}
/**
* Returns true if it is in narrow layout. This is useful if you need to show/hide
elements based on the layout.
*
* JavaScript Info:
* @property narrow
* @type Boolean
*
*/
public void setNarrow(boolean value) {
getPolymerElement().setNarrow(value);
}
/**
* If true, the drawer will initially be opened when in narrow layout mode.
*
* JavaScript Info:
* @property openedWhenNarrow
* @type Boolean
*
*/
public boolean getOpenedWhenNarrow() {
return getPolymerElement().getOpenedWhenNarrow();
}
/**
* If true, the drawer will initially be opened when in narrow layout mode.
*
* JavaScript Info:
* @property openedWhenNarrow
* @type Boolean
*
*/
public void setOpenedWhenNarrow(boolean value) {
getPolymerElement().setOpenedWhenNarrow(value);
}
/**
* If true, ignore responsiveWidth
setting and force the narrow layout.
*
* JavaScript Info:
* @property forceNarrow
* @type Boolean
*
*/
public boolean getForceNarrow() {
return getPolymerElement().getForceNarrow();
}
/**
* If true, ignore responsiveWidth
setting and force the narrow layout.
*
* JavaScript Info:
* @property forceNarrow
* @type Boolean
*
*/
public void setForceNarrow(boolean value) {
getPolymerElement().setForceNarrow(value);
}
/**
* If the viewport’s width is smaller than this value, the panel will change to narrow
layout. In the mode the drawer will be closed.
*
* JavaScript Info:
* @property responsiveWidth
* @type String
*
*/
public String getResponsiveWidth() {
return getPolymerElement().getResponsiveWidth();
}
/**
* If the viewport’s width is smaller than this value, the panel will change to narrow
layout. In the mode the drawer will be closed.
*
* JavaScript Info:
* @property responsiveWidth
* @type String
*
*/
public void setResponsiveWidth(String value) {
getPolymerElement().setResponsiveWidth(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 VaadinSplitLayout
*
*/
public void assignParentResizable(Object parentResizable) {
getPolymerElement().assignParentResizable(parentResizable);
}
/**
* 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 VaadinSplitLayout
*
*/
public void stopResizeNotificationsFor(Object target) {
getPolymerElement().stopResizeNotificationsFor(target);
}
/**
*
*
* JavaScript Info:
* @method resetLayout
*
*
*/
public void resetLayout() {
getPolymerElement().resetLayout();
}
/**
* Can be called to manually notify a resizable and its descendant
resizables of a resize change.
*
* JavaScript Info:
* @method notifyResize
* @behavior VaadinSplitLayout
*
*/
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 VaadinSplitLayout
* @return {boolean}
*/
public boolean resizerShouldNotify(JavaScriptObject element) {
return getPolymerElement().resizerShouldNotify(element);
}
}