|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.nebula.widgets.cdatetime.AbstractCombo
org.eclipse.swt.nebula.widgets.cdatetime.CDateTime
public class CDateTime
The CDateTime provides both textual and graphical means for setting the attributes of a java.util.Date class. As with other components having "combo" in their name, the base of this component is a text box which, if the DROP_DOWN style is set, is complimented by a down-arrow that will open / pop up / drop down a graphical component; for the CDateTime, the drop down component is a CDateTime (automatically set a style appropriate for date format of the text box). If the style DROP_DOWN is not set, then this combo will NOT show a drop down arrow button, but will instead show a spinner which can be used to increment / decrement the selected date field in the text box.
Field Summary |
---|
Fields inherited from class org.eclipse.swt.nebula.widgets.cdatetime.AbstractCombo |
---|
carbon, gtk, win32 |
Fields inherited from class org.eclipse.swt.widgets.Composite |
---|
embeddedHandle |
Fields inherited from class org.eclipse.swt.widgets.Widget |
---|
handle |
Constructor Summary | |
---|---|
CDateTime(org.eclipse.swt.widgets.Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
---|---|
void |
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener interface. |
java.util.Locale |
getLocale()
The locale currently in use by this CDateTime. |
java.lang.String |
getPattern()
Get the pattern of this CDateTime as used to set its format. |
java.util.Date |
getSelection()
Get the java.util.Date that is currently selected by this
CDateTime widget.Note that if a field is being edited, and has not yet been committed, then this value may not represent what is displayed in the text box. |
java.lang.String |
getText()
|
void |
removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the receiver's selection changes. |
void |
setFormat(int format)
Set the date and time format of this CDateTime uses style constants which correspond to the various forms of DateFormat.getXxxInstance(int). |
void |
setLocale(java.util.Locale locale)
Sets the Locale to be used by this CDateTime and causes all affected attributes to be updated If the provided locale is the same as the current locale then this method simply returns. |
void |
setOpen(boolean open)
If pop is true, then opens the popup shell (sets to visible) If pop is false, closes the popup shell (sets to not visible) If content == null this method simply returns.If popup == null then popup will be created. |
void |
setPattern(java.lang.String pattern)
Set the style of this CDateTime to work with dates and / or times as determined by the given pattern. |
void |
setSelection(java.util.Date date)
Set the selection for this CDateTime to that of the provided Date object.This method will update the text box and, if the DROP_DOWN
style is set, the selection of the associated drop down CDateTime. |
Methods inherited from class org.eclipse.swt.nebula.widgets.cdatetime.AbstractCombo |
---|
addModifyListener, addTraverseListener, getMenu, getStyle, isOpen, removeModifyListener, removeTraverseListener, setButtonVisibility, setButtonVisible, setEditable, setEnabled, setFocus, setFont, setHoldOpen, setMenu, setRedraw, setStretch |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setForeground, setLayoutData, setLocation, setLocation, setParent, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, dispose, getData, getData, getDisplay, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CDateTime(org.eclipse.swt.widgets.Composite parent, int style)
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to constructMethod Detail |
---|
public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the selection (date/time) changes.
widgetDefaultSelected
is when ENTER is pressed the text box.
listener
- the listener which should be notified
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
public java.lang.String getPattern()
setFormat(String)
this will return null
.
SimpleDateFormat
,
setFormat(int)
,
setPattern(String)
public java.util.Locale getLocale()
setLocale(Locale)
,
setLocale(Locale)
public java.util.Date getSelection()
java.util.Date
that is currently selected by this
CDateTime widget.
setSelection(Date)
public java.lang.String getText()
getText
in class AbstractCombo
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
listener
- the listener which should no longer be notified
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public void setFormat(int format) throws java.lang.IllegalArgumentException
Styles are bitwise OR'ed together, but only one "DATE" and one "TIME" may be set at a time.
Examples:
format
- the bitwise OR'ed Date and Time format to be set
java.lang.IllegalArgumentException
getPattern()
,
setPattern(String)
public void setOpen(boolean open)
AbstractCombo
content == null
this method simply returns.popup == null
then popup
will be created.
setOpen
in class AbstractCombo
public void setPattern(java.lang.String pattern) throws java.lang.IllegalArgumentException
DROP_DOWN
style is set, the fields of the
drop down component.
pattern
- the pattern to use, if it is invalid, the original is restored
java.lang.IllegalArgumentException
SimpleDateFormat
,
getPattern()
,
setFormat(int)
public void setLocale(java.util.Locale locale)
CDateTime
is of style DROP_DOWN
then the associated CDateTime
will be set to the same locale.
locale
- the Locale, or null to use the system's defaultgetLocale()
public void setSelection(java.util.Date date)
Date
object.DROP_DOWN
style is set, the selection of the associated drop down CDateTime.
date
- the Date
object to use for the new selectiongetSelection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |