g-Eclipse
Release 1.0.0

eu.geclipse.ui.widgets
Class DateTimeText

java.lang.Object
  extended by eu.geclipse.ui.widgets.DateTimeText

public class DateTimeText
extends java.lang.Object

Widgets, which allow to edit date and time


Nested Class Summary
static class DateTimeText.Style
          Widget style
 
Constructor Summary
DateTimeText(Composite parent, DateTimeText.Style style, boolean allowEmpty)
           
 
Method Summary
 java.util.Date getDate()
           
 Shell getShell()
           
 java.lang.String getValidDateFormat()
           
 void openCalendarDialog()
          Opens popup dialog with calendar to easy selecting date and time
 void setDate(java.util.Date date)
           
 void setEnabled(boolean enabled)
           
 boolean setFocus()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeText

public DateTimeText(Composite parent,
                    DateTimeText.Style style,
                    boolean allowEmpty)
Parameters:
parent -
style -
allowEmpty - if false, then getDate() throw an exception for empty date
Method Detail

setDate

public void setDate(java.util.Date date)
Parameters:
date - date which will be shown in widget

getDate

public java.util.Date getDate()
                       throws ProblemException
Returns:
Date entered in control, or null if allowEmpty is true and entered date is empty
Throws:
ProblemException - thrown when user entered date in wrong format
See Also:
ProblemDialog.openProblem(Shell, String, String, Throwable)

getValidDateFormat

public java.lang.String getValidDateFormat()
Returns:
String containing format in which date should be entered.

getShell

public Shell getShell()
Returns:
shell, on which control is placed

openCalendarDialog

public void openCalendarDialog()
Opens popup dialog with calendar to easy selecting date and time


setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - true if widget should allow editing, false if should work in readonly mode

setFocus

public boolean setFocus()
Returns:
@see org.eclipse.swt.widgets.Text#setFocus()

g-Eclipse
Release 1.0.0