|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.datepicker.client.CellGridImpl.Cell com.google.gwt.user.datepicker.client.DefaultCalendarView.CellGrid.DateCell
class DefaultCalendarView.CellGrid.DateCell
A cell representing a date.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
DefaultCalendarView.CellGrid.DateCell(boolean isWeekend)
|
Method Summary | |
---|---|
void |
addStyleName(java.lang.String styleName)
Adds a secondary or dependent style name to this object. |
boolean |
isFiller()
|
void |
onHighlighted(boolean highlighted)
|
void |
onSelected(boolean selected)
|
void |
removeStyleName(java.lang.String styleName)
Removes a style name. |
void |
setAriaSelected(boolean value)
|
(package private) void |
update(java.util.Date current)
|
void |
updateStyle()
|
Methods inherited from class com.google.gwt.user.datepicker.client.CellGridImpl.Cell |
---|
getValue, isEnabled, isHighlighted, isSelected, nextItem, onEnabled, previousItem, setEnabled, verticalNavigation |
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, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
DefaultCalendarView.CellGrid.DateCell(boolean isWeekend)
Method Detail |
---|
public void addStyleName(java.lang.String styleName)
UIObject
class
attribute
for this object's root element.
The most important use for this method is to add a special kind of
secondary style name called a dependent style name. To add a
dependent style name, use UIObject.addStyleDependentName(String)
, which
will prefix the 'style' argument with the result of
UIObject.getStylePrimaryName()
(followed by a '-'). For example, suppose
the primary style name is gwt-TextBox
. If the following method
is called as obj.setReadOnly(true)
:
public void setReadOnly(boolean readOnly) { isReadOnlyMode = readOnly; // Create a dependent style name. String readOnlyStyle = "readonly"; if (readOnly) { addStyleDependentName(readOnlyStyle); } else { removeStyleDependentName(readOnlyStyle); } }
then both of the CSS style rules below will be applied:
// This rule is based on the primary style name and is always active. .gwt-TextBox { font-size: 12pt; } // This rule is based on a dependent style name that is only active // when the widget has called addStyleName(getStylePrimaryName() + // "-readonly"). .gwt-TextBox-readonly { background-color: lightgrey; border: none; }
The code can also be simplified with
UIObject.setStyleDependentName(String, boolean)
:
public void setReadOnly(boolean readOnly) { isReadOnlyMode = readOnly; setStyleDependentName("readonly", readOnly); }
Dependent style names are powerful because they are automatically updated whenever the primary style name changes. Continuing with the example above, if the primary style name changed due to the following call:
setStylePrimaryName("my-TextThingy");
then the object would be re-associated with following style rules, removing those that were shown above.
.my-TextThingy { font-size: 20pt; } .my-TextThingy-readonly { background-color: red; border: 2px solid yellow; }
Secondary style names that are not dependent style names are not automatically updated when the primary style name changes.
addStyleName
in class UIObject
styleName
- the secondary style name to be addedUIObject
,
UIObject.removeStyleName(String)
public boolean isFiller()
public void onHighlighted(boolean highlighted)
onHighlighted
in class CellGridImpl.Cell
public void onSelected(boolean selected)
onSelected
in class CellGridImpl.Cell
public void removeStyleName(java.lang.String styleName)
UIObject
removeStyleName
in class UIObject
styleName
- the secondary style name to be removedUIObject.addStyleName(String)
,
UIObject.setStyleName(String, boolean)
public void setAriaSelected(boolean value)
public void updateStyle()
updateStyle
in class CellGridImpl.Cell
void update(java.util.Date current)
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |