public class Slot extends com.google.gwt.user.client.ui.SimplePanel implements HasErrorIndicatorElement
| Modifier and Type | Field and Description |
|---|---|
static String |
SLOT_CLASSNAME
The default classname for this widget.
|
| Constructor and Description |
|---|
Slot()
Constructs a slot.
|
Slot(VAbstractOrderedLayout layout,
com.google.gwt.user.client.ui.Widget widget)
Deprecated.
use
GWT.create(Class), setWidget(Widget) and
setLayout(VAbstractOrderedLayout) instead |
| Modifier and Type | Method and Description |
|---|---|
AlignmentInfo |
getAlignment()
Returns the alignment for the slot.
|
com.google.gwt.user.client.Element |
getCaptionElement()
Get the slots caption element.
|
CaptionPosition |
getCaptionPosition()
Get the position of the caption relative to the slot.
|
ElementResizeListener |
getCaptionResizeListener()
Returns the caption resize listener for this slot if one has been set.
|
protected com.google.gwt.user.client.Element |
getContainerElement() |
com.google.gwt.dom.client.Element |
getErrorIndicatorElement()
Gets the error indicator element.
|
double |
getExpandRatio()
Get the expand ratio for the slot.
|
protected int |
getHorizontalSpacing()
Get the horizontal amount of pixels of the spacing.
|
com.google.gwt.user.client.Element |
getSpacingElement()
Get the element which is added to make the spacing.
|
ElementResizeListener |
getSpacingResizeListener()
Returns the spacing element resize listener for this slot if one has been
set.
|
protected int |
getVerticalSpacing()
Get the vertical amount in pixels of the spacing.
|
ElementResizeListener |
getWidgetResizeListener()
Returns the widget resize listener for this slot if one has been set.
|
boolean |
hasCaption()
Does the slot have a caption.
|
boolean |
hasRelativeHeight()
Returns whether the slot's height is relative.
|
boolean |
hasRelativeWidth()
Returns whether the slot's width is relative.
|
boolean |
hasSpacing()
Does the slot have spacing.
|
boolean |
isRelativeInDirection(boolean vertical)
Returns whether this slot has relative size in the indicated direction.
|
protected void |
onAttach() |
void |
onBrowserEvent(com.google.gwt.user.client.Event event) |
protected void |
onDetach() |
boolean |
remove(com.google.gwt.user.client.ui.Widget w) |
void |
setAlignment(AlignmentInfo alignment)
Sets how the widget is aligned inside the slot.
|
void |
setCaption(String captionText,
Icon icon,
List<String> styles,
String error,
boolean showError,
boolean required,
boolean enabled)
Set the caption of the slot as text.
|
void |
setCaption(String captionText,
Icon icon,
List<String> styles,
String error,
boolean showError,
boolean required,
boolean enabled,
boolean captionAsHtml)
Set the caption of the slot.
|
void |
setCaption(String captionText,
Icon icon,
List<String> styles,
String error,
ErrorLevel errorLevel,
boolean showError,
boolean required,
boolean enabled,
boolean captionAsHtml)
Set the caption of the slot.
|
void |
setCaption(String captionText,
String iconUrl,
List<String> styles,
String error,
boolean showError,
boolean required,
boolean enabled)
Deprecated.
|
void |
setCaptionPosition(CaptionPosition captionPosition)
Set the position of the caption relative to the slot.
|
void |
setCaptionResizeListener(ElementResizeListener captionResizeListener)
Sets the caption resize listener for this slot.
|
void |
setErrorIndicatorElementVisible(boolean visible)
Sets the visibility of the error indicator element.
|
void |
setExpandRatio(double expandRatio)
Set how the slot should be expanded relative to the other slots.
|
void |
setLayout(VAbstractOrderedLayout layout)
Set the layout in which this slot is.
|
void |
setRelativeHeight(boolean relativeHeight)
Set if the slot has a relative height.
|
void |
setRelativeWidth(boolean relativeWidth)
Set if the slot has a relative width.
|
void |
setSpacing(boolean spacing)
Set the spacing for the slot.
|
void |
setSpacingResizeListener(ElementResizeListener spacingResizeListener)
Sets the spacing element resize listener for this slot.
|
protected void |
setStyleNames(String... stylenames)
Sets the style names for the slot containing the widget.
|
void |
setWidget(com.google.gwt.user.client.ui.Widget w) |
void |
setWidgetResizeListener(ElementResizeListener widgetResizeListener)
Sets the widget resize listener for this slot.
|
add, getWidget, iterator, setWidgetadd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final String SLOT_CLASSNAME
public Slot()
@Deprecated public Slot(VAbstractOrderedLayout layout, com.google.gwt.user.client.ui.Widget widget)
GWT.create(Class), setWidget(Widget) and
setLayout(VAbstractOrderedLayout) insteadlayout - The layout to which this slot belongswidget - The widget to put in the slotpublic void setLayout(VAbstractOrderedLayout layout)
VAbstractOrderedLayout.createSlot(Widget).layout - the layout containing the slotpublic boolean remove(com.google.gwt.user.client.ui.Widget w)
remove in interface com.google.gwt.user.client.ui.HasWidgetsremove in class com.google.gwt.user.client.ui.SimplePanelpublic void setWidget(com.google.gwt.user.client.ui.Widget w)
setWidget in interface com.google.gwt.user.client.ui.HasOneWidgetsetWidget in class com.google.gwt.user.client.ui.SimplePanelpublic ElementResizeListener getCaptionResizeListener()
null if not setpublic void setCaptionResizeListener(ElementResizeListener captionResizeListener)
captionResizeListener - the listener to set, or null to remove a previously
set listenerpublic ElementResizeListener getWidgetResizeListener()
null if not setpublic void setWidgetResizeListener(ElementResizeListener widgetResizeListener)
widgetResizeListener - the listener to set, or null to remove a previously
set listenerpublic ElementResizeListener getSpacingResizeListener()
null if not setpublic void setSpacingResizeListener(ElementResizeListener spacingResizeListener)
spacingResizeListener - the listener to set, or null to remove a previously
set listenerpublic AlignmentInfo getAlignment()
protected void setStyleNames(String... stylenames)
stylenames - The style names for the slotpublic void setAlignment(AlignmentInfo alignment)
alignment - The alignment inside the slotpublic void setExpandRatio(double expandRatio)
expandRatio - The ratio of the space the slot should occupypublic double getExpandRatio()
setExpandRatio(double)public void setSpacing(boolean spacing)
spacing - Should spacing be enabledpublic com.google.gwt.user.client.Element getSpacingElement()
public boolean hasSpacing()
true if the slot has spacing, false otherwiseprotected int getVerticalSpacing()
protected int getHorizontalSpacing()
public void setCaptionPosition(CaptionPosition captionPosition)
captionPosition - The position of the captionpublic CaptionPosition getCaptionPosition()
@Deprecated public void setCaption(String captionText, String iconUrl, List<String> styles, String error, boolean showError, boolean required, boolean enabled)
setCaption(String, Icon, List, String, boolean, boolean, boolean)
insteadcaptionText - The text of the captioniconUrl - The icon URL, must already be run trough translateVaadinUri()styles - The style nameserror - The error messageshowError - Should the error message be shownrequired - Is the (field) requiredenabled - Is the component enabledpublic void setCaption(String captionText, Icon icon, List<String> styles, String error, boolean showError, boolean required, boolean enabled)
captionText - The text of the captionicon - The iconstyles - The style nameserror - The error messageshowError - Should the error message be shownrequired - Is the (field) requiredenabled - Is the component enabledpublic void setCaption(String captionText, Icon icon, List<String> styles, String error, boolean showError, boolean required, boolean enabled, boolean captionAsHtml)
captionText - The text of the captionicon - The iconstyles - The style nameserror - The error messageshowError - Should the error message be shownrequired - Is the (field) requiredenabled - Is the component enabledcaptionAsHtml - true if the caption should be rendered as HTML, false
otherwisepublic void setCaption(String captionText, Icon icon, List<String> styles, String error, ErrorLevel errorLevel, boolean showError, boolean required, boolean enabled, boolean captionAsHtml)
captionText - The text of the captionicon - The iconstyles - The style nameserror - The error messageerrorLevel - The error levelshowError - Should the error message be shownrequired - Is the (field) requiredenabled - Is the component enabledcaptionAsHtml - true if the caption should be rendered as HTML, false
otherwisepublic boolean hasCaption()
true if the slot has a caption, false otherwisepublic com.google.gwt.user.client.Element getCaptionElement()
null if there is no captionpublic void setRelativeWidth(boolean relativeWidth)
relativeWidth - True if slot uses relative width, false if the slot has a
static widthpublic boolean hasRelativeWidth()
true if the slot uses relative width, false if
the slot has a static widthpublic void setRelativeHeight(boolean relativeHeight)
relativeHeight - True if the slot uses a relative height, false if the slot has
a static heightpublic boolean hasRelativeHeight()
true if the slot uses relative height, false if
the slot has a static heightpublic void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent in interface com.google.gwt.user.client.EventListeneronBrowserEvent in class com.google.gwt.user.client.ui.Widgetprotected com.google.gwt.user.client.Element getContainerElement()
getContainerElement in class com.google.gwt.user.client.ui.SimplePanelprotected void onDetach()
onDetach in class com.google.gwt.user.client.ui.Widgetprotected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetpublic boolean isRelativeInDirection(boolean vertical)
vertical - true if the height should be checked, false if
the width should be checkedtrue if the slot's indicated dimension is relative,
false otherwisepublic com.google.gwt.dom.client.Element getErrorIndicatorElement()
HasErrorIndicatorElementgetErrorIndicatorElement in interface HasErrorIndicatorElementpublic void setErrorIndicatorElementVisible(boolean visible)
HasErrorIndicatorElementsetErrorIndicatorElementVisible in interface HasErrorIndicatorElementvisible - true to show the error indicator element,
false to hide itCopyright © 2023 Vaadin Ltd. All rights reserved.