|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.antelmann.calendar.CalendarTableModel
public class CalendarTableModel
a special table model that can place values for specific dates into a table model; each model represents one month.
CalendarCell,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.util.Localizable |
|---|
Localizable.Adapter |
| Field Summary |
|---|
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
CalendarTableModel(CalendarModel cmodel)
calls this(cmodel, Calendar.getInstance()) |
|
CalendarTableModel(CalendarModel cmodel,
Calendar calendar)
calls this(cmodel, month, true, false) |
|
CalendarTableModel(CalendarModel cmodel,
Calendar calendar,
boolean withWeekNumber)
uses the default Locale |
|
CalendarTableModel(CalendarModel cmodel,
Calendar calendar,
Locale locale)
doesn't use week numbers |
|
CalendarTableModel(CalendarModel cmodel,
Calendar calendar,
Locale locale,
boolean withWeekNumber)
adds itself as a CalendarModelListener to the given CalendarModel |
|
CalendarTableModel(CalendarModel cmodel,
Date month)
|
|
| Method Summary | |
|---|---|
void |
calendarChanged(CalendarChangeEvent event)
|
protected void |
finalize()
|
Calendar |
getCalendar()
changing the calendar (for instance its date or the first day of the week) will change the contents of this model from behind, so instead of doing that, call setCalendar(Calendar). |
CalendarModel |
getCalendarModel()
|
Class<?> |
getColumnClass(int column)
returns CalendarCell for all columns |
int |
getColumnCount()
|
String |
getColumnName(int column)
|
Date |
getDateFor(int row,
int column)
|
Date |
getFirstVisibleDate()
|
Date |
getLastVisibleDate()
|
Locale |
getLocale()
allows access to the Locale that this instance currently uses to localize its messages, |
int |
getRowCount()
|
Object |
getValueAt(int row,
int column)
this implementation always returns a CalendarCell instance. |
boolean |
isWithWeekNumber()
|
void |
setCalendar(Calendar calendar)
also calls fireTableDataChanged() |
void |
setCalendarModel(CalendarModel cmodel)
|
void |
setLocale(Locale locale,
Object context)
sets the Locale for this object so that all subsequent return values of method calls to this instance can be localized accordingly until a different Locale is set. |
void |
setWithWeekNumber(boolean flag)
|
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CalendarTableModel(CalendarModel cmodel)
public CalendarTableModel(CalendarModel cmodel,
Date month)
public CalendarTableModel(CalendarModel cmodel,
Calendar calendar)
public CalendarTableModel(CalendarModel cmodel,
Calendar calendar,
Locale locale)
public CalendarTableModel(CalendarModel cmodel,
Calendar calendar,
boolean withWeekNumber)
public CalendarTableModel(CalendarModel cmodel,
Calendar calendar,
Locale locale,
boolean withWeekNumber)
| Method Detail |
|---|
public boolean isWithWeekNumber()
public void setWithWeekNumber(boolean flag)
public CalendarModel getCalendarModel()
public void setCalendarModel(CalendarModel cmodel)
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic Locale getLocale()
Localizable
getLocale in interface LocalizableLocalizable.setLocale(Locale, Object)
public void setLocale(Locale locale,
Object context)
Localizable
setLocale in interface Localizablelocale - the Locale that is to be used to determine return values for all methods
of this instance; if set to null, the default locale is to be used.context - a context that may be required for this instance to load the resources for the given locale;
this context may be null for objects that do not require an external context.
Examples of a context may be a database, a resource file, some map or no context at all.Localizable.getLocale()public Calendar getCalendar()
setCalendar(Calendar).
public void setCalendar(Calendar calendar)
public Class<?> getColumnClass(int column)
CalendarCell for all columns
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModel@Localized public String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModel
public Object getValueAt(int row,
int column)
ConvertedTableModel
getValueAt in interface TableModelCalendarCell
public Date getDateFor(int row,
int column)
public Date getFirstVisibleDate()
public Date getLastVisibleDate()
public void calendarChanged(CalendarChangeEvent event)
calendarChanged in interface CalendarModelListener
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||