use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method populateMonthlyMonths.
private void populateMonthlyMonths(GridModel model) {
model.clearRows();
// Get current list of months
Recurrence r = ((TaskMaintenanceComponent) getComponent()).getRecurrence();
Recurrence.Month[] months = r != null && r instanceof Recurrence.Monthly ? ((Recurrence.Monthly) r).getMonths() : null;
if (months != null)
Arrays.sort(months);
// Get all possible months
Recurrence.Month[] allMonths = Recurrence.Month.values();
// Create rows, such that the labels appear vertically-sorted.. like a newspaper !!
// To begin with, select all the months
int noOfRows = allMonths.length % MONTHS_GRID_COLUMNS == 0 ? allMonths.length / MONTHS_GRID_COLUMNS : (allMonths.length / MONTHS_GRID_COLUMNS) + 1;
for (int i = 0; i < MONTHS_GRID_COLUMNS; i++) {
for (int j = 0; j < noOfRows; j++) {
int index = (i * noOfRows) + j;
if (index >= allMonths.length)
break;
Recurrence.Month month = allMonths[index];
Boolean selected = months == null ? Boolean.TRUE : Arrays.binarySearch(months, month) >= 0;
GridModelRow row = (i == 0) ? model.newRow() : model.getRow(j);
row.addElement("label" + i, "label.Jaffa.Scheduler.ScheduledTask.Recurrence.MONTHLY.Month." + month);
row.addElement("value" + i, month);
row.addElement("selected" + i, new SimpleWidgetModel(selected));
}
}
}
use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method getDescriptionWM.
/**
* Getter for property description. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
* @return Value of property description.
*/
public SimpleWidgetModel getDescriptionWM() {
SimpleWidgetModel w_description = (SimpleWidgetModel) getWidgetCache().getModel("description");
if (w_description == null) {
w_description = new SimpleWidgetModel(getDescription());
getWidgetCache().addModel("description", w_description);
}
return w_description;
}
use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method getMonthlyWeekFrequencyWM.
/**
* Getter for property monthlyWeekFrequency. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
* @return Value of property monthlyWeekFrequency.
*/
public SimpleWidgetModel getMonthlyWeekFrequencyWM() {
SimpleWidgetModel w_monthlyWeekFrequency = (SimpleWidgetModel) getWidgetCache().getModel("monthlyWeekFrequency");
if (w_monthlyWeekFrequency == null) {
w_monthlyWeekFrequency = new SimpleWidgetModel(getMonthlyWeekFrequency());
addWeekFrequencyOptions(w_monthlyWeekFrequency);
getWidgetCache().addModel("monthlyWeekFrequency", w_monthlyWeekFrequency);
}
return w_monthlyWeekFrequency;
}
use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method getStartOnWM.
/**
* Getter for property startOn. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
* @return Value of property startOn.
*/
public SimpleWidgetModel getStartOnWM() {
SimpleWidgetModel w_startOn = (SimpleWidgetModel) getWidgetCache().getModel("startOn");
if (w_startOn == null) {
w_startOn = new SimpleWidgetModel(getStartOn());
getWidgetCache().addModel("startOn", w_startOn);
}
return w_startOn;
}
use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method getCreatedOnWM.
/**
* Getter for property createdOn. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
* @return Value of property createdOn.
*/
public SimpleWidgetModel getCreatedOnWM() {
SimpleWidgetModel w_createdOn = (SimpleWidgetModel) getWidgetCache().getModel("createdOn");
if (w_createdOn == null) {
w_createdOn = new SimpleWidgetModel(getCreatedOn());
getWidgetCache().addModel("createdOn", w_createdOn);
}
return w_createdOn;
}
Aggregations