// ///////////////////////////////
// GANTT
// ///////////////////////////////
gridBuilder.newGridPanel();
{
final ToggleContainerPanel extendedSettingsPanel = new ToggleContainerPanel(gridBuilder.getPanel().newChildId()) {
/**
* @see org.projectforge.web.wicket.flowlayout.ToggleContainerPanel#wantsOnStatusChangedNotification()
*/
@Override
protected boolean wantsOnStatusChangedNotification()
{
return true;
}
};
extendedSettingsPanel.setHeading(getString("task.gantt.settings"));
gridBuilder.getPanel().add(extendedSettingsPanel);
extendedSettingsPanel.setClosed();
final GridBuilder innerGridBuilder = extendedSettingsPanel.createGridBuilder();
innerGridBuilder.newSplitPanel(GridSize.COL50);
{
// Gantt object type:
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.objectType"));
final LabelValueChoiceRenderer<GanttObjectType> objectTypeChoiceRenderer = new LabelValueChoiceRenderer<GanttObjectType>(fs,
GanttObjectType.values());
final DropDownChoice<GanttObjectType> objectTypeChoice = new DropDownChoice<GanttObjectType>(fs.getDropDownChoiceId(),
new PropertyModel<GanttObjectType>(data, "ganttObjectType"), objectTypeChoiceRenderer.getValues(), objectTypeChoiceRenderer);
objectTypeChoice.setNullValid(true);
fs.add(objectTypeChoice);
}
{
// Gantt: start date
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.startDate"));
final DatePanel startDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "startDate"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class).withSelectProperty("startDate"));
fs.add(startDatePanel);
}
{
// Gantt: end date
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.endDate"));
final DatePanel endDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "endDate"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class).withSelectProperty("endDate"));
fs.add(endDatePanel);
dependentFormComponents[1] = endDatePanel;
}
innerGridBuilder.newSplitPanel(GridSize.COL50);
{
// Progress
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("task.progress")).setUnit("%");
final MinMaxNumberField<Integer> progressField = new MinMaxNumberField<Integer>(InputPanel.WICKET_ID, new PropertyModel<Integer>(
data, "progress"), 0, 100) {
@SuppressWarnings({ "unchecked", "rawtypes"})
@Override
public IConverter getConverter(final Class type)
{
return new IntegerPercentConverter(0);
}
};
WicketUtils.setSize(progressField, 3);
fs.add(progressField);
}
{
// Gantt: duration
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.duration")).suppressLabelForWarning();
final MinMaxNumberField<BigDecimal> durationField = new MinMaxNumberField<BigDecimal>(InputPanel.WICKET_ID,
new PropertyModel<BigDecimal>(data, "duration"), BigDecimal.ZERO, TaskEditForm.MAX_DURATION_DAYS);
WicketUtils.setSize(durationField, 6);
fs.add(durationField);
dependentFormComponents[0] = durationField;
}
{
// Gantt: predecessor offset
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.predecessorOffset")).setUnit(getString("days"));
final MinMaxNumberField<Integer> ganttPredecessorField = new MinMaxNumberField<Integer>(InputPanel.WICKET_ID,
new PropertyModel<Integer>(data, "ganttPredecessorOffset"), Integer.MIN_VALUE, Integer.MAX_VALUE);
WicketUtils.setSize(ganttPredecessorField, 6);
fs.add(ganttPredecessorField);
}
innerGridBuilder.newGridPanel();
{
// Gantt relation type:
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.relationType"));
final LabelValueChoiceRenderer<GanttRelationType> relationTypeChoiceRenderer = new LabelValueChoiceRenderer<GanttRelationType>(fs,
GanttRelationType.values());
final DropDownChoice<GanttRelationType> relationTypeChoice = new DropDownChoice<GanttRelationType>(fs.getDropDownChoiceId(),
new PropertyModel<GanttRelationType>(data, "ganttRelationType"), relationTypeChoiceRenderer.getValues(),
relationTypeChoiceRenderer);
relationTypeChoice.setNullValid(true);
fs.add(relationTypeChoice);
}
{
// Gantt: predecessor
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.predecessor"));
final TaskSelectPanel ganttPredecessorSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(data, "ganttPredecessor"),
parentPage, "ganttPredecessorId");
fs.add(ganttPredecessorSelectPanel);
ganttPredecessorSelectPanel.setShowFavorites(true);
ganttPredecessorSelectPanel.init();
}
}
// ///////////////////////////////
// FINANCE ADMINISTRATION
// ///////////////////////////////
gridBuilder.newGridPanel();
{
final ToggleContainerPanel extendedSettingsPanel = new ToggleContainerPanel(gridBuilder.getPanel().newChildId()) {
/**
* @see org.projectforge.web.wicket.flowlayout.ToggleContainerPanel#wantsOnStatusChangedNotification()
*/
@Override
protected boolean wantsOnStatusChangedNotification()
{
return true;
}
};
extendedSettingsPanel.setHeading(getString("financeAdministration"));
gridBuilder.getPanel().add(extendedSettingsPanel);
extendedSettingsPanel.setClosed();
final GridBuilder innerGridBuilder = extendedSettingsPanel.createGridBuilder();
innerGridBuilder.newSplitPanel(GridSize.COL50);
if (Configuration.getInstance().isCostConfigured() == true) {
// Cost 2 settings
final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("fibu.kost2"));