
org.jbundle.main.calendar.screen.CalendarGridScreen Maven / Gradle / Ivy
/**
* @(#)CalendarGridScreen.
* Copyright © 2013 jbundle.org. All rights reserved.
* GPL3 Open Source Software License.
*/
package org.jbundle.main.calendar.screen;
import java.util.*;
import org.jbundle.base.db.*;
import org.jbundle.thin.base.util.*;
import org.jbundle.thin.base.db.*;
import org.jbundle.base.db.event.*;
import org.jbundle.base.db.filter.*;
import org.jbundle.base.field.*;
import org.jbundle.base.field.convert.*;
import org.jbundle.base.field.event.*;
import org.jbundle.base.screen.model.*;
import org.jbundle.base.screen.model.util.*;
import org.jbundle.base.model.*;
import org.jbundle.base.util.*;
import org.jbundle.model.*;
import org.jbundle.model.db.*;
import org.jbundle.model.screen.*;
import org.jbundle.main.calendar.db.*;
/**
* CalendarGridScreen - Calendar grid.
*/
public class CalendarGridScreen extends GridScreen
{
/**
* Default constructor.
*/
public CalendarGridScreen()
{
super();
}
/**
* Constructor.
* @param record The main record for this screen.
* @param itsLocation The location of this component within the parent.
* @param parentScreen The parent screen.
* @param fieldConverter The field this screen field is linked to.
* @param iDisplayFieldDesc Do I display the field desc?.
*/
public CalendarGridScreen(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map properties)
{
this();
this.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties);
}
/**
* Initialize class fields.
*/
public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map properties)
{
super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties);
}
/**
* Get the screen display title.
*/
public String getTitle()
{
return "Calendar grid";
}
/**
* Override this to open the main file.
*
You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)).
* @return The new record.
*/
public Record openMainRecord()
{
return new CalendarEntry(this);
}
/**
* Add all the screen listeners.
*/
public void addListeners()
{
super.addListeners();
this.getMainRecord().setKeyArea(CalendarEntry.START_DATE_TIME_KEY);
this.setEditing(true);
}
/**
* SetupSFields Method.
*/
public void setupSFields()
{
Record record = this.getMainRecord();
//this.addColumn(new MergeConverter(record, Animal.NAME));
this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.START_DATE_TIME));
this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.END_DATE_TIME));
this.addColumn(new MultipleTableFieldConverter(record, CalendarEntry.DESCRIPTION));
}
}