com.cc.framework.ui.control
Class SchedulerControl

java.lang.Object
  extended bycom.cc.framework.ui.control.Control
      extended bycom.cc.framework.ui.control.SchedulerControl
All Implemented Interfaces:
AccessControlled, ActionBehavior, ClientHandler, SchedulerStateModel, java.io.Serializable, StateModel

public class SchedulerControl
extends Control
implements SchedulerStateModel

SchedulerControl

Version:
$Revision: 1.33 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  SchedulerControl childCtrl
          A Scheduler control can be used to control the state of a dependent child Scheduler control.
private  SchedulerDataModel dataModel
          DataModel
private  SchedulerDesignModel designModel
          DesignModell
private static long serialVersionUID
          Serial Version UID
private  SchedulerStateModel stateModel
          StateModel
 
Fields inherited from class com.cc.framework.ui.control.Control
log
 
Fields inherited from interface com.cc.framework.ui.model.SchedulerStateModel
PROP_VIEW
 
Fields inherited from interface com.cc.framework.ui.model.StateModel
PROP_CONTROL
 
Constructor Summary
SchedulerControl()
          Constructor
SchedulerControl(SchedulerDesignModel designModel)
          Constructor
 
Method Summary
 boolean compressWeekEnds()
           
protected  SchedulerStateModel doCreateStateModel()
          Creates the state model for this control instance
 Appointment getAppointmentFromId(java.lang.String uniqueId)
          Retrieves the appointment with the given key
 Appointment[] getAppointments(java.util.Calendar date)
          Liefert alle Termine für ein bestimmtes Datum
 int getCheckBoxMask()
          Retrieves a bit mask that indicates on what view levels a checkbox should be shown for this control
 int getColumns()
          Retrieves the number of columns in year view
 DataModel getDataModel()
          Returns the data model of the Control
 java.util.Calendar getDate()
          Retrieves the first visible Date in the Scheduler Control
 int getDayEndHour()
           
 int getDayStartHour()
           
 ControlDesignModel getDesignModel()
          Returns the design model of the control
 SchedulerControl getDetail()
          Retrieves the scheduler control that is controlled by this scheduler.
 boolean getFilter()
          Returns the Filter setting
 int getFirstDayOfWeek()
          Gets the first day of the week
 ImageModel getImage()
          Returns the image for the frames title
 ImageMap getImageMap()
          Returns the associated ImageMap
 InnerFrame[] getInnerFrames(java.lang.Object layoutHint)
          Retrieves a list of inner frames that are matching the given layout hint
 int getInterval()
           
 int getMaxVisible()
          Retrieves the maximum visible appointments for one Day
 int getMonthIncrement()
          retrieves the number of month to increment in year view when the user clicks on one of the navigation buttons.
 int getRows()
          Retrieves the number of rows in year view
 StateModel getStateModel()
          Returns the state model of the control
 java.util.TimeZone getTimeZone()
          Liefert die Zeitzone
 java.lang.String getTitle()
          Returns the Title
 SchedulerView getView()
           
 int getViewMask()
          Retrieves a bit mask with all the possible view buttons for this control
 int getWorkEndHour()
           
 int getWorkingDayMask()
          Retrieves a Mask with the weeks working days.
 int getWorkStartHour()
           
 boolean isWorkingDay(int dayOfWeek)
          Checks if the given day is configured as a working day
 boolean isWorkingHour(int dayOfWeek, int hour)
          This method checks if the given hour is a working hour
 void onAddAppointment(ControlRequestContext ctx, long timeInMillis)
          Default handler for the AddAppointment Event
 void onAppointmentClick(ControlRequestContext ctx, java.lang.String key, long timeInMillis)
          Default handler for the AppointmentCLick Event
 void onChangeDate(ControlRequestContext ctx, long timeInMillis, java.lang.String view)
          Rolls the specified Date field by the given delta value.
 void onCheckAppointment(ControlRequestContext ctx, java.lang.String uniqueId, long timeInMillis, boolean check)
          Default handler for the CheckAppointment Event
 void onCheckDate(ControlRequestContext ctx, long timeInMillis, SchedulerScope scope, boolean check)
          Default handler for the CheckAppointment Event
 void onCreate(ControlRequestContext ctx)
          Default handler for the Create Event
 void onExportList(ControlRequestContext ctx)
          Default handler for the ExportList Event
 void onPrintList(ControlRequestContext ctx)
          Default handler for the PrintList Event
 void onRefresh(ControlRequestContext ctx)
          Default Handler for the Refresh Event
 void onSelectDate(ControlRequestContext ctx, long timeInMillis, java.lang.String view)
          This method gets called when the user clicks on a date element.
 void onView(ControlRequestContext ctx, java.lang.String view)
          Default Handler for the View Event
 void reset()
          Resets the actual state of a control to the initial state
 void setDataModel(SchedulerDataModel dataModel)
          Sets the data model
 void setDate(java.util.Calendar date)
          Sets the first visible Date in the Scheduler Control
 void setDesignModel(SchedulerDesignModel designModel)
          Sets the designModel
 void setDetail(SchedulerControl child)
          A Scheduler control can be used to control the state of a dependent child Scheduler control.
 void setStateModel(SchedulerStateModel stateModel)
          Sets the StateModel
 void setView(SchedulerView view)
          Specifies the style used to display dates in a Scheduler control
 boolean showAllDayArea()
           
 boolean showButton(ControlButton button)
          This Method is called by the Painter before rendering a Button.
 boolean showFrame()
          Returns true if the frame should be painted
 boolean showPopups()
           
 boolean showWeekEndDays()
           
 
Methods inherited from class com.cc.framework.ui.control.Control
addButton, allowAjaxRendering, execute, execute, execute, execute, execute, execute, execute, getAction, getAjaxId, getButtons, getControlName, getDesignRules, getFrameworkString, getHandler, getHandlers, getHeight, getHelp, getId, getLocaleName, getName, getPermission, getPrincipal, getProperty, getRunAt, getStyle, getStyleClass, getStyleId, getSummary, getTabIndex, getTooltip, getTransaction, getUniqueStyleId, getWidth, isAjaxEnabled, isDisabled, isFormElement, markDirty, onHelp, setAjaxAttribute, setHandler, setPrincipal, setValue, show, synchronizeState, synchronizeState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cc.framework.ui.model.StateModel
synchronizeState
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

dataModel

private SchedulerDataModel dataModel
DataModel


designModel

private SchedulerDesignModel designModel
DesignModell


stateModel

private SchedulerStateModel stateModel
StateModel


childCtrl

private SchedulerControl childCtrl
A Scheduler control can be used to control the state of a dependent child Scheduler control. It will dispatch all navigation commands to the child control

Constructor Detail

SchedulerControl

public SchedulerControl()
Constructor


SchedulerControl

public SchedulerControl(SchedulerDesignModel designModel)
Constructor

Parameters:
designModel - the design model
Method Detail

reset

public void reset()
Description copied from interface: StateModel
Resets the actual state of a control to the initial state

Specified by:
reset in interface StateModel
See Also:
StateModel.reset()

setStateModel

public void setStateModel(SchedulerStateModel stateModel)
Sets the StateModel

Parameters:
stateModel - TreeStateModel

doCreateStateModel

protected SchedulerStateModel doCreateStateModel()
Creates the state model for this control instance

Returns:
State model instance

getDataModel

public DataModel getDataModel()
Description copied from class: Control
Returns the data model of the Control

Specified by:
getDataModel in class Control
Returns:
The data model
See Also:
Control.getDataModel()

getDesignModel

public ControlDesignModel getDesignModel()
Description copied from class: Control
Returns the design model of the control

Specified by:
getDesignModel in class Control
Returns:
The ControlDesignModel
See Also:
Control.getDesignModel()

setDesignModel

public void setDesignModel(SchedulerDesignModel designModel)
Sets the designModel

Parameters:
designModel - The designModel to set

setDataModel

public void setDataModel(SchedulerDataModel dataModel)
Sets the data model

Parameters:
dataModel - TopsAndFlopsDataModel

getStateModel

public StateModel getStateModel()
Description copied from class: Control
Returns the state model of the control

Specified by:
getStateModel in class Control
Returns:
The state model
See Also:
Control.getStateModel()

getAppointments

public Appointment[] getAppointments(java.util.Calendar date)
Liefert alle Termine für ein bestimmtes Datum

Parameters:
date - Das Datum
Returns:
Terminliste

getAppointmentFromId

public Appointment getAppointmentFromId(java.lang.String uniqueId)
Retrieves the appointment with the given key

Parameters:
uniqueId - the unique identifier of the appointment
Returns:
Appointment or null

getTimeZone

public java.util.TimeZone getTimeZone()
Liefert die Zeitzone

Returns:
Zeitzone

getDate

public java.util.Calendar getDate()
Description copied from interface: SchedulerStateModel
Retrieves the first visible Date in the Scheduler Control

Specified by:
getDate in interface SchedulerStateModel
Returns:
First visible Date
See Also:
SchedulerStateModel.getDate()

setDate

public void setDate(java.util.Calendar date)
Description copied from interface: SchedulerStateModel
Sets the first visible Date in the Scheduler Control

Specified by:
setDate in interface SchedulerStateModel
Parameters:
date - The first visible Date
See Also:
SchedulerStateModel.setDate(java.util.Calendar)

isWorkingDay

public boolean isWorkingDay(int dayOfWeek)
Checks if the given day is configured as a working day

Parameters:
dayOfWeek - Day to check
Returns:
true if this is a working day

isWorkingHour

public boolean isWorkingHour(int dayOfWeek,
                             int hour)
This method checks if the given hour is a working hour

Parameters:
dayOfWeek - Day to check
hour - The hour to check
Returns:
true if the hour is a working hour

getTitle

public java.lang.String getTitle()
Returns the Title

Returns:
Title

showPopups

public boolean showPopups()
Returns:
true to show appointments in year view in a popup window

getCheckBoxMask

public int getCheckBoxMask()
Retrieves a bit mask that indicates on what view levels a checkbox should be shown for this control

Returns:
Bit combination of Scheduler views
See Also:
SchedulerScope

getColumns

public int getColumns()
Retrieves the number of columns in year view

Returns:
number of columns

getRows

public int getRows()
Retrieves the number of rows in year view

Returns:
number of rows

getFilter

public boolean getFilter()
Returns the Filter setting

Returns:
boolean

getImage

public ImageModel getImage()
Returns the image for the frames title

Returns:
ImageModel

getInnerFrames

public InnerFrame[] getInnerFrames(java.lang.Object layoutHint)
Retrieves a list of inner frames that are matching the given layout hint

Parameters:
layoutHint - The layout hint that specifies what frames should be selected: AlignmentType.TOP - header frames AlignmentType.BOTTOM - footer frames
Returns:
Frame list

showFrame

public boolean showFrame()
Returns true if the frame should be painted

Returns:
true if the frame should be painted

compressWeekEnds

public boolean compressWeekEnds()
Returns:
Gets a value indicating whether the weekends should be compressed in one day

getDayStartHour

public int getDayStartHour()
Returns:
Gets a value indicating the start of the hour range displayed by the Schedule on DayView.

getDayEndHour

public int getDayEndHour()
Returns:
Gets a value indicating the end of the hour range displayed by the Schedule on DayView.

getWorkStartHour

public int getWorkStartHour()
Returns:
Gets a value indicating the start time of the day for the working hours.

getWorkEndHour

public int getWorkEndHour()
Returns:
Gets a value indicating the end time of the day for the working hours.

getWorkingDayMask

public int getWorkingDayMask()
Retrieves a Mask with the weeks working days. The mask is a bitwise or combination of the following integer constants representing each day of the week:

Returns:
Mask

showAllDayArea

public boolean showAllDayArea()
Returns:
Gets a value specifying whether the all-day area is displayed.

showWeekEndDays

public boolean showWeekEndDays()
Returns:
Gets a value specifying whether the week end days are shown in week, month and navigator view.

getFirstDayOfWeek

public int getFirstDayOfWeek()
Gets the first day of the week

Returns:
Day index of the first Day of the week or 0 for the locales default

getInterval

public int getInterval()
Returns:
Gets a value specifying the interval in which the hour is divided.

getView

public SchedulerView getView()
Specified by:
getView in interface SchedulerStateModel
Returns:
Returns the style used to display dates in a Scheduler control

getImageMap

public ImageMap getImageMap()
Returns the associated ImageMap

Returns:
ImageMap or null

getMaxVisible

public int getMaxVisible()
Retrieves the maximum visible appointments for one Day

Returns:
Maximum visible Appointments for one Day

setView

public void setView(SchedulerView view)
Description copied from interface: SchedulerStateModel
Specifies the style used to display dates in a Scheduler control

Specified by:
setView in interface SchedulerStateModel
Parameters:
view - The View
See Also:
SchedulerStateModel.setView(com.cc.framework.ui.model.SchedulerView)

getViewMask

public int getViewMask()
Retrieves a bit mask with all the possible view buttons for this control

Returns:
Bit combination of Scheduler views
See Also:
SchedulerView

getMonthIncrement

public int getMonthIncrement()
retrieves the number of month to increment in year view when the user clicks on one of the navigation buttons. A value of 0 resets the the control to the default increment which is the number of visible months (= rows * columns)

Returns:
the number of month to increment

showButton

public boolean showButton(ControlButton button)
Description copied from class: Control
This Method is called by the Painter before rendering a Button. By overwriting this method a derived class can show or hide buttons.

Overrides:
showButton in class Control
Parameters:
button - ControlButton
Returns:
boolean
See Also:
Control.showButton(com.cc.framework.ui.control.ControlButton)

setDetail

public void setDetail(SchedulerControl child)
A Scheduler control can be used to control the state of a dependent child Scheduler control. It will dispatch all navigation commands to the child control. In addition the control will retrieve its selection state from the child control. (master -> detail relationship)

Parameters:
child - The dependent scheduler control

getDetail

public SchedulerControl getDetail()
Retrieves the scheduler control that is controlled by this scheduler.

Returns:
the controlled scheduler or null

onCreate

public void onCreate(ControlRequestContext ctx)
              throws java.lang.Exception
Default handler for the Create Event

Parameters:
ctx - ControlRequestContext
Throws:
java.lang.Exception - is thrown when an error occurs

onRefresh

public void onRefresh(ControlRequestContext ctx)
               throws java.lang.Exception
Default Handler for the Refresh Event

Parameters:
ctx - ControlRequestContext
Throws:
java.lang.Exception - is thrown when an error occurs

onView

public void onView(ControlRequestContext ctx,
                   java.lang.String view)
            throws java.lang.Exception
Default Handler for the View Event

Parameters:
ctx - ControlRequestContext
view - The view to switch to
Throws:
java.lang.Exception - is thrown when an error occurs

onChangeDate

public void onChangeDate(ControlRequestContext ctx,
                         long timeInMillis,
                         java.lang.String view)
                  throws java.lang.Exception
Rolls the specified Date field by the given delta value. This positions the Scheduler on another date.

Parameters:
ctx - ControlRequestContext
timeInMillis - The new Time in milliseconds in UTC
view - the View (SchedulerView)
Throws:
java.lang.Exception - is thrown when an error occurs

onSelectDate

public void onSelectDate(ControlRequestContext ctx,
                         long timeInMillis,
                         java.lang.String view)
                  throws java.lang.Exception
This method gets called when the user clicks on a date element.

Parameters:
ctx - ControlRequestContext
timeInMillis - The new Time in milliseconds in UTC
view - the View (SchedulerView)
Throws:
java.lang.Exception - is thrown when an error occurs

onAppointmentClick

public void onAppointmentClick(ControlRequestContext ctx,
                               java.lang.String key,
                               long timeInMillis)
                        throws java.lang.Exception
Default handler for the AppointmentCLick Event

Parameters:
ctx - ControlRequestContext
key - Unique Id as generated by the data model to identify the Row
timeInMillis - Timestamp in UTC
Throws:
java.lang.Exception - is thrown when an error occurs

onAddAppointment

public void onAddAppointment(ControlRequestContext ctx,
                             long timeInMillis)
                      throws java.lang.Exception
Default handler for the AddAppointment Event

Parameters:
ctx - ControlRequestContext
timeInMillis - Timestamp in UTC
Throws:
java.lang.Exception - is thrown when an error occurs

onCheckAppointment

public void onCheckAppointment(ControlRequestContext ctx,
                               java.lang.String uniqueId,
                               long timeInMillis,
                               boolean check)
                        throws java.lang.Exception
Default handler for the CheckAppointment Event

Parameters:
ctx - ControlRequestContext
uniqueId - Unique Id as generated by the data model to identify the Row
timeInMillis - Timestamp in UTC
check - indicates if the appointment was checked or unchecked
Throws:
java.lang.Exception - is thrown when an error occurs

onCheckDate

public void onCheckDate(ControlRequestContext ctx,
                        long timeInMillis,
                        SchedulerScope scope,
                        boolean check)
                 throws java.lang.Exception
Default handler for the CheckAppointment Event

Parameters:
ctx - ControlRequestContext
timeInMillis - Timestamp in UTC
scope - The scope (range of appointments) that is affected by this event
check - indicates if the appointment was checked or unchecked
Throws:
java.lang.Exception - is thrown when an error occurs

onExportList

public void onExportList(ControlRequestContext ctx)
                  throws java.lang.Exception
Default handler for the ExportList Event

Parameters:
ctx - ControlRequestContext
Throws:
java.lang.Exception - is thrown when an error occurs

onPrintList

public void onPrintList(ControlRequestContext ctx)
                 throws java.lang.Exception
Default handler for the PrintList Event

Parameters:
ctx - ControlRequestContext
Throws:
java.lang.Exception - is thrown when an error occurs


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.