Package com.vaadin.v7.client.ui
Class VScrollTable.HeaderCell
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.vaadin.v7.client.ui.VScrollTable.HeaderCell
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsWidget
- Direct Known Subclasses:
VScrollTable.RowHeadersHeaderCell
- Enclosing class:
- VScrollTable
public class VScrollTable.HeaderCell extends com.google.gwt.user.client.ui.Widget
-
-
Constructor Summary
Constructors Constructor Description HeaderCell(String colId, String headerText)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableAutoWidthCalculation()chargetAlign()StringgetCaption()StringgetColKey()floatgetExpandRatio()intgetMinWidth()intgetNaturalColumnWidth(int columnIndex)Detects the natural minimum width for the column of this header cell.intgetWidth()Returns the pixels width of the header cell.protected intgetWidthWithIndent()This method exists for the needs ofVTreeTableonly.protected voidhandleCaptionEvent(com.google.gwt.user.client.Event event)booleanisDefinedWidth()Detects if width is fixed by developer on server side or resized to current width by user.booleanisEnabled()booleanisSorted()voidonBrowserEvent(com.google.gwt.user.client.Event event)Handle column reordering.voidresizeCaptionContainer(int rightSpacing)Makes room for the sorting indicator in case the column that the header cell belongs to is sorted.protected voidsaveNaturalColumnWidthIfNotSaved(int columnIndex)Saves natural column width if it hasn't been saved already.voidsetAlign(char c)voidsetExpandRatio(float floatAttribute)voidsetNaturalMinimumColumnWidth(int w)voidsetSortable(boolean b)voidsetText(String headerText)voidsetUndefinedWidth()voidsetWidth(int w, boolean ensureDefinedWidth)Sets width to the header cell.protected voidupdateStyleNames(String primaryStyleName)-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, 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, toString
-
-
-
-
Method Detail
-
setSortable
public void setSortable(boolean b)
-
resizeCaptionContainer
public void resizeCaptionContainer(int rightSpacing)
Makes room for the sorting indicator in case the column that the header cell belongs to is sorted. This is done by resizing the width of the caption container element by the correct amount
-
setNaturalMinimumColumnWidth
public void setNaturalMinimumColumnWidth(int w)
-
updateStyleNames
protected void updateStyleNames(String primaryStyleName)
-
disableAutoWidthCalculation
public void disableAutoWidthCalculation()
-
setWidth
public void setWidth(int w, boolean ensureDefinedWidth)Sets width to the header cell. This width should not include any possible indent modifications that are present inVScrollTable.VScrollTableBody.getMaxIndent().- Parameters:
w- required width of the cell sans indentationsensureDefinedWidth- disables expand ratio if required
-
setUndefinedWidth
public void setUndefinedWidth()
-
isDefinedWidth
public boolean isDefinedWidth()
Detects if width is fixed by developer on server side or resized to current width by user.- Returns:
- true if defined, false if "natural" width
-
getWidthWithIndent
protected int getWidthWithIndent()
This method exists for the needs ofVTreeTableonly. Returns the pixels width of the header cell. This includes the indent, if applicable.- Returns:
- The width in pixels
-
getWidth
public int getWidth()
Returns the pixels width of the header cell.- Returns:
- The width in pixels
-
setText
public void setText(String headerText)
-
getColKey
public String getColKey()
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
Handle column reordering.- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget
-
handleCaptionEvent
protected void handleCaptionEvent(com.google.gwt.user.client.Event event)
-
getMinWidth
public int getMinWidth()
-
getCaption
public String getCaption()
-
isEnabled
public boolean isEnabled()
-
setAlign
public void setAlign(char c)
-
getAlign
public char getAlign()
-
saveNaturalColumnWidthIfNotSaved
protected void saveNaturalColumnWidthIfNotSaved(int columnIndex)
Saves natural column width if it hasn't been saved already.- Parameters:
columnIndex-- Since:
- 7.3.9
-
getNaturalColumnWidth
public int getNaturalColumnWidth(int columnIndex)
Detects the natural minimum width for the column of this header cell. If column is resized by user or the width is defined by server the actual width is returned. Else the natural min width is returned.- Parameters:
columnIndex- column index hint, if -1 (unknown) it will be detected- Returns:
-
setExpandRatio
public void setExpandRatio(float floatAttribute)
-
getExpandRatio
public float getExpandRatio()
-
isSorted
public boolean isSorted()
-
-