Elexis API documentation
Version 2.1.6 as of December 11 2011

com.tiff.common.ui.datepicker
Class DatePickerCombo

java.lang.Object
  extended by Composite
      extended by com.tiff.common.ui.datepicker.DatePickerCombo

public final class DatePickerCombo
extends Composite

The combo widget with drop-down date-picker panel. changes by jense128 (Laurent Dutheil) * combo box is now smaller than the calendar widget changes by gis (Carsten Pfeiffer) * fixed focus handling as described in bug 1187304 changes by andyglow + added method setEnabled to properly manage state of control changes by sebthom * declared package accessible methods as private * declared getEditable() as public + added useSingleMouseClickToCommit behaviour + manually modifying the date in the text field is reflected in the date picker + setDate(null) clears the date. + added getText & setText()

Version:
$Revision: 1.1 $
Author:
Andrey Onistchuk

Constructor Summary
DatePickerCombo(Composite parent, int style)
          Creates a new DatePickerCombo object.
 
Method Summary
 void addModifyListener(ModifyListener listener)
          Adds the listener to receive events.
 void addSelectionListener(SelectionListener listener)
          Adds the listener to receive events.
static int checkStyle(int style)
          Style cheking
 void clearSelection()
          Clears the current selection.
 Point computeSize(int wHint, int hHint, boolean changed)
           
 Control[] getChildren()
           
 java.util.Date getDate()
           
 boolean getEditable()
           
 java.lang.String getText()
           
 int getTextHeight()
          Returns the height of Text widget
 boolean isApplyCellEditorFix()
           
 boolean isClosePopupWithSingleMouseClick()
          determines if you need to double click a date in the expanded calender control to hide it default is false meaning you have to double click a date
 boolean isFocusControl()
          Retirns true if control is in focus
 void redraw(int x, int y, int width, int height, boolean all)
          Drawing stuff
 void removeModifyListener(ModifyListener listener)
          Removes the listener.
 void removeSelectionListener(SelectionListener listener)
          Removes the listener.
 void setApplyCellEditorFix(boolean applyCellEditorFix)
           
 void setBackground(Color color)
          Set up background of control
 void setClosePopupWithSingleMouseClick(boolean isClosePopupWithSingleMouseClick)
          set if you need to double click a date in the expanded calender control to hide it default is false meaning you have to double click a date
 void setDate(java.util.Date date)
          Set up the date of control
 void setEnabled(boolean enabled)
          Enable/disable widget
 boolean setFocus()
          Set the focus to control
 void setFont(Font font)
          DOCUMENT ME!
 void setForeground(Color color)
          Set up the control foreground color
 void setFormat(java.text.DateFormat format)
          Set DateFormat object, which is parser/formatter of control's content
 void setSelection(Point selection)
          Sets the new selection.
 void setText(java.lang.String txt)
          Deprecated. use setDate(date) instead
 void setTextLimit(int limit)
          Sets the text limit
 void setToolTipText(java.lang.String string)
          Set up control tool-tip
 void setVisible(boolean visible)
          Set up visibility of control
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatePickerCombo

public DatePickerCombo(Composite parent,
                       int style)
Creates a new DatePickerCombo object.

Parameters:
parent - parent Composite
style - SWT style
Method Detail

checkStyle

public static int checkStyle(int style)
Style cheking

Parameters:
style - STT style
Returns:
style

addModifyListener

public void addModifyListener(ModifyListener listener)
Adds the listener to receive events.

Parameters:
listener - the listener
Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed
SWTError - (ERROR_NULL_ARGUMENT) when listener is null
See Also:
ModifyListener, removeModifyListener(ModifyListener)

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Adds the listener to receive events.

Parameters:
listener - the listener
Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed
SWTError - (ERROR_NULL_ARGUMENT) when listener is null
See Also:
SelectionListener, removeSelectionListener(SelectionListener)

clearSelection

public void clearSelection()
Clears the current selection.

Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed

computeSize

public Point computeSize(int wHint,
                         int hHint,
                         boolean changed)

getChildren

public Control[] getChildren()

getDate

public java.util.Date getDate()

getEditable

public boolean getEditable()

getText

public java.lang.String getText()

getTextHeight

public int getTextHeight()
Returns the height of Text widget

Returns:
height

isClosePopupWithSingleMouseClick

public boolean isClosePopupWithSingleMouseClick()
determines if you need to double click a date in the expanded calender control to hide it default is false meaning you have to double click a date


isFocusControl

public boolean isFocusControl()
Retirns true if control is in focus

Returns:
focus state

redraw

public void redraw(int x,
                   int y,
                   int width,
                   int height,
                   boolean all)
Drawing stuff

Parameters:
x - x
y - y
width - width
height - height
all - must we redraw all of controls?

removeModifyListener

public void removeModifyListener(ModifyListener listener)
Removes the listener.

Parameters:
listener - the listener
Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed
SWTError - (ERROR_NULL_ARGUMENT) when listener is null
See Also:
ModifyListener, addModifyListener(ModifyListener)

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Removes the listener.

Parameters:
listener - the listener
Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed
SWTError - (ERROR_NULL_ARGUMENT) when listener is null
See Also:
SelectionListener, addSelectionListener(SelectionListener)

setBackground

public void setBackground(Color color)
Set up background of control

Parameters:
color - background color

setClosePopupWithSingleMouseClick

public void setClosePopupWithSingleMouseClick(boolean isClosePopupWithSingleMouseClick)
set if you need to double click a date in the expanded calender control to hide it default is false meaning you have to double click a date

Parameters:
isClosePopupWithSingleMouseClick -

setDate

public void setDate(java.util.Date date)
Set up the date of control

Parameters:
date - Date

setEnabled

public void setEnabled(boolean enabled)
Enable/disable widget

Parameters:
enabled -

setFocus

public boolean setFocus()
Set the focus to control

Returns:
result of action

setFont

public void setFont(Font font)
DOCUMENT ME!

Parameters:
font - DOCUMENT ME!

setForeground

public void setForeground(Color color)
Set up the control foreground color

Parameters:
color - Foreground color

setFormat

public void setFormat(java.text.DateFormat format)
Set DateFormat object, which is parser/formatter of control's content

Parameters:
format -

setSelection

public void setSelection(Point selection)
Sets the new selection.

Parameters:
selection - point representing the start and the end of the new selection
Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed
SWTError - (ERROR_NULL_ARGUMENT) when selection is null

setText

public void setText(java.lang.String txt)
Deprecated. use setDate(date) instead

Set uu the date in text mode

Parameters:
txt - text representation of Date

setTextLimit

public void setTextLimit(int limit)
Sets the text limit

Parameters:
limit - new text limit
Throws:
SWTError - (ERROR_THREAD_INVALID_ACCESS) when called from the wrong thread
SWTError - (ERROR_WIDGET_DISPOSED) when the widget has been disposed
SWTError - (ERROR_CANNOT_BE_ZERO) when limit is 0

setToolTipText

public void setToolTipText(java.lang.String string)
Set up control tool-tip

Parameters:
string - Text of tool-tip

setVisible

public void setVisible(boolean visible)
Set up visibility of control

Parameters:
visible - visibility state

isApplyCellEditorFix

public boolean isApplyCellEditorFix()
Returns:
Returns the applyCellEditorFix.

setApplyCellEditorFix

public void setApplyCellEditorFix(boolean applyCellEditorFix)
Parameters:
applyCellEditorFix - The applyCellEditorFix to set.

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis