org.wingx
Class XCalendar

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.SContainer
          extended by org.wingx.XCalendar
All Implemented Interfaces:
Serializable, Cloneable, EventListener, SDocumentListener, LowLevelEventListener, Renderable

public class XCalendar
extends SContainer
implements LowLevelEventListener, SDocumentListener

Author:
Erik Habicht
See Also:
Serialized Form

Field Summary
static SIcon DEFAULT_EDIT_ICON
          The XCalendar default SIcon for editing.
protected  boolean epochCheckEnabled
           
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
XCalendar()
          Creates a XCalendar with the current Date and a default SDateFormatter.
XCalendar(Date date, SDateFormatter formatter)
          Creates a XCalendar with the given Date and the specified SDateFormatter instance.
XCalendar(SDateFormatter formatter)
          Creates a XCalendar with the current Date and the specified SDateFormatter instance.
 
Method Summary
 void addActionListener(ActionListener listener)
          Adds an action listener to the XCalendar
 void changedUpdate(SDocumentEvent e)
          Gives notification that an attribute or set of attributes changed for styled documents.
protected  void fireActionPerformed(ActionEvent event)
          Fire an ActionEvent at each registered listener.
 void fireIntermediateEvents()
          fire events which describes a "in progress" state change, like TreeWillExpand, or ListSelectionEvent with getIsAdjusting() true, ...
 ActionListener[] getActionListeners()
          Returns an array of all the ActionListeners added to this AbstractButton with addActionListener().
 SIcon getClearIcon()
          Deprecated. Returns now the DEFAULT_EDIT_ICON
 Date getDate()
          Returns the current Date.
 SIcon getEditIcon()
          Returns the current SIcon to start the date picker.
 SFormattedTextField getFormattedTextField()
          Returns the current SFormattedTextField.
 SIcon getIcon()
          Deprecated. Use editIcon instead
 TimeZone getTimeZone()
          Returns the current TimeZone.
 void insertUpdate(SDocumentEvent e)
          Gives notification that there was an insert into the document.
 boolean isEpochCheckEnabled()
          Asks the low-level event listener if epoch checking should be perfomed on it.
 boolean isNullable()
          Deprecated.  
 void processLowLevelEvent(String action, String[] values)
          Deliver low level/http events (parameters).
 void removeActionListener(ActionListener listener)
          Removes the supplied Listener from the listener list
 void removeUpdate(SDocumentEvent e)
          Gives notification that a portion of the document has been removed.
 void setCG(CalendarCG cg)
          Set the look and feel delegate for this component
 void setClearIcon(SIcon clearIcon)
          Deprecated.  
 void setDate(Date date)
          Sets the current Date.
 void setEditIcon(SIcon icon)
          Sets the icon to use for calling the date picker.
 void setEpochCheckEnabled(boolean epochCheckEnabled)
           
 void setFocusTraversalIndex(int index)
          The index in which the focus is traversed using Tab.
 void setFormatter(SDateFormatter formatter)
          Sets the current SDateFormatter.
 void setIcon(SIcon icon)
          Deprecated. Use editIcon instead
 void setNullable(boolean nullable)
          Deprecated.  
 void setPreferredSize(SDimension dimension)
          Set the preferred size of the component
 void setTimeZone(TimeZone timeZone)
          Sets the current TimeZone.
 
Methods inherited from class org.wings.SContainer
add, add, add, add, addComponent, addComponent, addComponent, addComponent, addContainerListener, addNotify, clone, fireContainerEvent, getComponent, getComponentCount, getComponentList, getComponents, getConstraintAt, getConstraintList, getLayout, invite, inviteEachComponent, isShowingChildren, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCG, setLayout, setParentFrame, updateCG
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, fireComponentChangeEvent, fireFinalEvents, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getCG, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getRequestURL, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, setVisible, toString, update, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.wings.LowLevelEventListener
fireFinalEvents, getLowLevelEventId, getName, isEnabled
 

Field Detail

DEFAULT_EDIT_ICON

public static final SIcon DEFAULT_EDIT_ICON
The XCalendar default SIcon for editing.


epochCheckEnabled

protected boolean epochCheckEnabled
See Also:
LowLevelEventListener.isEpochCheckEnabled()
Constructor Detail

XCalendar

public XCalendar()
Creates a XCalendar with the current Date and a default SDateFormatter.


XCalendar

public XCalendar(SDateFormatter formatter)
Creates a XCalendar with the current Date and the specified SDateFormatter instance.

Parameters:
formatter - SDateFormatter to use for formatting.

XCalendar

public XCalendar(Date date,
                 SDateFormatter formatter)
Creates a XCalendar with the given Date and the specified SDateFormatter instance.

Parameters:
date - Date
formatter - SDateFormatter to use for formatting.
Method Detail

setCG

public void setCG(CalendarCG cg)
Set the look and feel delegate for this component

Parameters:
cg - the component's cg
See Also:
SComponent.setCG(org.wings.plaf.ComponentCG)

setIcon

public void setIcon(SIcon icon)
Deprecated. Use editIcon instead

Sets the XCalendar's default SIcon.

Parameters:
icon - the icon used as the default image.

getIcon

public SIcon getIcon()
Deprecated. Use editIcon instead

Returns the default SIcon.

Returns:
the default SIcon

setEditIcon

public void setEditIcon(SIcon icon)
Sets the icon to use for calling the date picker.

Parameters:
icon - the icon used as the trigger icon to start the date picker.

getEditIcon

public SIcon getEditIcon()
Returns the current SIcon to start the date picker.

Returns:
the default SIcon

getClearIcon

public SIcon getClearIcon()
Deprecated. Returns now the DEFAULT_EDIT_ICON

The current icon to use for clearing the input/ date.

Returns:
The current icon to use for clearing the input/ date.

setClearIcon

public void setClearIcon(SIcon clearIcon)
Deprecated. 

The icon to use for clearing the input/ date.

Parameters:
clearIcon - The new icon to use for clearing the input/ date.

isNullable

public boolean isNullable()
Deprecated. 

Defines if the user should be able to select also null values.

NOTE: He can always do this manually. Default is false

Returns:
true if the user has an clear icon to define a null date

setNullable

public void setNullable(boolean nullable)
Deprecated. 

Defines if the user has an clear icon to reset the picked date to null.

Parameters:
nullable - true if the user should be able to clear the date.

setFormatter

public void setFormatter(SDateFormatter formatter)
Sets the current SDateFormatter.

Parameters:
formatter - SDateFormatter to use for formatting

setTimeZone

public void setTimeZone(TimeZone timeZone)
Sets the current TimeZone.

Parameters:
timeZone - TimeZone

getTimeZone

public TimeZone getTimeZone()
Returns the current TimeZone.

Returns:
TimeZone

getDate

public Date getDate()
Returns the current Date.

Returns:
the current Date

setDate

public void setDate(Date date)
Sets the current Date.

Parameters:
date - the current Date

setPreferredSize

public void setPreferredSize(SDimension dimension)
Set the preferred size of the component

Overrides:
setPreferredSize in class SComponent
Parameters:
dimension - SDimension
See Also:
SComponent.getPreferredSize()

fireActionPerformed

protected void fireActionPerformed(ActionEvent event)
Fire an ActionEvent at each registered listener.

Parameters:
event - supplied ActionEvent

addActionListener

public void addActionListener(ActionListener listener)
Adds an action listener to the XCalendar

Parameters:
listener - the ActionListener to be added

removeActionListener

public void removeActionListener(ActionListener listener)
Removes the supplied Listener from the listener list

Parameters:
listener - ActionListener

getActionListeners

public ActionListener[] getActionListeners()
Returns an array of all the ActionListeners added to this AbstractButton with addActionListener().

Returns:
all of the ActionListeners added or an empty array if no listeners have been added

getFormattedTextField

public SFormattedTextField getFormattedTextField()
Returns the current SFormattedTextField.

Returns:
the current SFormattedTextField

setFocusTraversalIndex

public void setFocusTraversalIndex(int index)
Description copied from class: SComponent
The index in which the focus is traversed using Tab. This is a very simplified notion of traversing the focus, but that is, what browser like interfaces currently offer. This has a bit rough edge, since you have to make sure, that the index is unique within the whole frame. You probably don't want to change this programmatically, but this is set usually by the template property manager.

Overrides:
setFocusTraversalIndex in class SComponent
Parameters:
index - the focus traversal index. Pressing the focus traversal key (usually TAB) in the browser jumps to the next index. Must not be zero.

insertUpdate

public void insertUpdate(SDocumentEvent e)
Description copied from interface: SDocumentListener
Gives notification that there was an insert into the document. The range given by the DocumentEvent bounds the freshly inserted region.

Specified by:
insertUpdate in interface SDocumentListener
Parameters:
e - the document event
See Also:
SDocumentListener#insertUpdate()

removeUpdate

public void removeUpdate(SDocumentEvent e)
Description copied from interface: SDocumentListener
Gives notification that a portion of the document has been removed. The range is given in terms of what the view last saw (that is, before updating sticky positions).

Specified by:
removeUpdate in interface SDocumentListener
Parameters:
e - the document event
See Also:
SDocumentListener#removeUpdate()

changedUpdate

public void changedUpdate(SDocumentEvent e)
Description copied from interface: SDocumentListener
Gives notification that an attribute or set of attributes changed for styled documents.

NOTE: This is for swing compatibility. Currently you will not receive this event at any time inside web contexts!

Specified by:
changedUpdate in interface SDocumentListener
Parameters:
e - the document event
See Also:
SDocumentListener#changedUpdate()

isEpochCheckEnabled

public boolean isEpochCheckEnabled()
Description copied from interface: LowLevelEventListener
Asks the low-level event listener if epoch checking should be perfomed on it. If true the Dispatcher will ignore request originating from old views (typically iniated by triggering browser back and clicking somewhere.)

Specified by:
isEpochCheckEnabled in interface LowLevelEventListener
Returns:
true if epoch checking should be perfomed, false if all request for this component should be processed.
See Also:
LowLevelEventListener.isEpochCheckEnabled()

setEpochCheckEnabled

public void setEpochCheckEnabled(boolean epochCheckEnabled)
See Also:
LowLevelEventListener#setEpochCheckEnabled()

fireIntermediateEvents

public void fireIntermediateEvents()
Description copied from interface: LowLevelEventListener
fire events which describes a "in progress" state change, like TreeWillExpand, or ListSelectionEvent with getIsAdjusting() true, ...

Specified by:
fireIntermediateEvents in interface LowLevelEventListener
See Also:
LowLevelEventListener.fireIntermediateEvents()

processLowLevelEvent

public void processLowLevelEvent(String action,
                                 String[] values)
Description copied from interface: LowLevelEventListener
Deliver low level/http events (parameters). The name-value-pairs of the HTTPRequest are considered low level events.

Specified by:
processLowLevelEvent in interface LowLevelEventListener
Overrides:
processLowLevelEvent in class SComponent
Parameters:
action - the name-value-pair's name
values - the name-value-pair's values
See Also:
LowLevelEventListener.processLowLevelEvent(String action, String[] values)


wingS Swings ;-)