Google Apps Script

Class DecoratedStackPanel

A StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add rounded corners.

Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation directly. You can find the DecoratedStackPanel documentation here.

Methods

MethodReturn typeBrief description
add(widget)DecoratedStackPanelAdd a widget to the DecoratedStackPanel.
add(widget, text)DecoratedStackPanelAdds a widget to the stack with the given header text.
add(widget, text, asHtml)DecoratedStackPanelAdds a widget to the stack with the given header text.
addStyleDependentName(styleName)DecoratedStackPanelSets the dependent style name of this DecoratedStackPanel.
addStyleName(styleName)DecoratedStackPanelAdds a style name to this DecoratedStackPanel.
clear()DecoratedStackPanelRemove all widgets from the DecoratedStackPanel.
getId()StringReturns the id that has been assigned to this object.
getTag()StringGets the text tag of this DecoratedStackPanel.
getType()StringGets the type of this object.
remove(index)DecoratedStackPanelRemove the widget with the given index from the DecoratedStackPanel.
remove(widget)DecoratedStackPanelRemove the given widget from the DecoratedStackPanel.
setHeight(height)DecoratedStackPanelSets the height of this DecoratedStackPanel.
setId(id)DecoratedStackPanelSets the id of this DecoratedStackPanel.
setPixelSize(width, height)DecoratedStackPanelSets the size of this DecoratedStackPanel in pixels.
setSize(width, height)DecoratedStackPanelSets the size of this DecoratedStackPanel.
setStackText(index, text)DecoratedStackPanelSets the text associated with a child by its index.
setStackText(index, text, asHtml)DecoratedStackPanelSets the text associated with a child by its index.
setStyleAttribute(attribute, value)DecoratedStackPanelSets one of this DecoratedStackPanel's style attributes to a new value.
setStyleAttributes(attributes)DecoratedStackPanelSets this DecoratedStackPanel's style attributes.
setStyleName(styleName)DecoratedStackPanelSets the style name of this DecoratedStackPanel.
setStylePrimaryName(styleName)DecoratedStackPanelSets the primary style name of this DecoratedStackPanel.
setTag(tag)DecoratedStackPanelSets the text tag of this DecoratedStackPanel.
setTitle(title)DecoratedStackPanelSets the hover title of this DecoratedStackPanel.
setVisible(visible)DecoratedStackPanelSets whether this DecoratedStackPanel is visible.
setWidth(width)DecoratedStackPanelSets the width of this DecoratedStackPanel.

Detailed documentation

add(widget)

Add a widget to the DecoratedStackPanel.

Parameters

NameTypeDescription
widgetWidgetthe widget to add.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


add(widget, text)

Adds a widget to the stack with the given header text.

Parameters

NameTypeDescription
widgetWidgetthe widget to add.
textStringthe new header text.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


add(widget, text, asHtml)

Adds a widget to the stack with the given header text.

Parameters

NameTypeDescription
widgetWidgetthe widget to add.
textStringthe new header text.
asHtmlBooleanwhether to treat the text as HTML.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


addStyleDependentName(styleName)

Sets the dependent style name of this DecoratedStackPanel.

This is useful for debugging but is otherwise of minimal use since there is no way to use custom stylesheets in UiApp.

Parameters

NameTypeDescription
styleNameStringthe new style name.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


addStyleName(styleName)

Adds a style name to this DecoratedStackPanel.

This is useful for debugging but is otherwise of minimal use since there is no way to use custom stylesheets in UiApp.

Parameters

NameTypeDescription
styleNameStringthe new style name.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


clear()

Remove all widgets from the DecoratedStackPanel.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


getId()

Returns the id that has been assigned to this object.

This can be used in conjunction with app.getElementById() to retrieve a reference to this object.

Return

String — the id that has been assigned to this object


getTag()

Gets the text tag of this DecoratedStackPanel.

Return

String — the text tag.


getType()

Gets the type of this object.

Return

String — the object type


remove(index)

Remove the widget with the given index from the DecoratedStackPanel. Indexes begin from 0. This will fail if the index is greater than or equal to the number of elements in the DecoratedStackPanel.

Parameters

NameTypeDescription
indexIntegerthe index of the widget to remove.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


remove(widget)

Remove the given widget from the DecoratedStackPanel. This will fail if the widget is not actually a child of the DecoratedStackPanel.

Parameters

NameTypeDescription
widgetWidgetthe widget to remove.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setHeight(height)

Sets the height of this DecoratedStackPanel.

Parameters

NameTypeDescription
heightStringthe new height in any CSS unit such as "10px" or "50%".

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setId(id)

Sets the id of this DecoratedStackPanel.

Parameters

NameTypeDescription
idStringthe new id, which can be used to retrieve the DecoratedStackPanel from app.getElementById(id).

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setPixelSize(width, height)

Sets the size of this DecoratedStackPanel in pixels.

Parameters

NameTypeDescription
widthIntegerthe new width in pixels.
heightIntegerthe new height in pixels.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setSize(width, height)

Sets the size of this DecoratedStackPanel.

Parameters

NameTypeDescription
widthStringthe new width in any CSS unit such as "10px" or "50%".
heightStringthe new height in any CSS unit such as "10px" or "50%".

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setStackText(index, text)

Sets the text associated with a child by its index.

Parameters

NameTypeDescription
indexIntegerthe index of the stack element whose text we want to change.
textStringthe new text.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setStackText(index, text, asHtml)

Sets the text associated with a child by its index.

Parameters

NameTypeDescription
indexIntegerthe index of the stack element whose text we want to change.
textStringthe new text.
asHtmlBooleanwhether to treat the text as HTML.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setStyleAttribute(attribute, value)

Sets one of this DecoratedStackPanel's style attributes to a new value. Valid attributes are listed here; the values for each attribute are the same as those available in CSS style sheets.

 
// Change the widget's background to black and text color to green.
 widget.setStyleAttribute("background", "black")
     .setStyleAttribute("color", "green");
 

Parameters

NameTypeDescription
attributeStringthe CSS attribute, in camel-case ("fontSize", not "font-size"), as listed here
valueStringthe CSS value

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setStyleAttributes(attributes)

Sets this DecoratedStackPanel's style attributes. This is a convenience method that is equivalent to calling setStyleAttribute with every key/value pair in the attributes object. Valid attributes are listed here; the values for each attribute are the same as those available in CSS style sheets.

 
// Change the widget's background to black and text color to green.
 widget.setStyleAttributes({background: "black", color: "green"});
 

Parameters

NameTypeDescription
attributesObjectan object of key/value pairs for the CSS attributes and values to set; valid attributes are listed here

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setStyleName(styleName)

Sets the style name of this DecoratedStackPanel.

This is useful for debugging but is otherwise of minimal use since there is no way to use custom stylesheets in UiApp.

Parameters

NameTypeDescription
styleNameStringthe new style name.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setStylePrimaryName(styleName)

Sets the primary style name of this DecoratedStackPanel.

This is useful for debugging but is otherwise of minimal use since there is no way to use custom stylesheets in UiApp.

Parameters

NameTypeDescription
styleNameStringthe new style name.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setTag(tag)

Sets the text tag of this DecoratedStackPanel.

Parameters

NameTypeDescription
tagStringthe new text tag, which can be anything you wish to store with the widget.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setTitle(title)

Sets the hover title of this DecoratedStackPanel.

Not all browsers will show this.

Parameters

NameTypeDescription
titleStringthe hover title.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setVisible(visible)

Sets whether this DecoratedStackPanel is visible.

Parameters

NameTypeDescription
visibleBooleanwhether this DecoratedStackPanel should be visible or not.

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.


setWidth(width)

Sets the width of this DecoratedStackPanel.

Parameters

NameTypeDescription
widthStringthe new width in any CSS unit such as "10px" or "50%".

Return

DecoratedStackPanel — the DecoratedStackPanel itself, useful for chaining.

Deprecated methods

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.