use of org.projectforge.web.wicket.flowlayout.FieldsetPanel in project projectforge by micromata.
the class ToDoListForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
gridBuilder.newSplitPanel(GridSize.COL66);
{
// Assignee
final FieldsetPanel fs = gridBuilder.newFieldset(getString("plugins.todo.assignee"));
final UserSelectPanel assigneeSelectPanel = new UserSelectPanel(fs.newChildId(), new Model<PFUserDO>() {
@Override
public PFUserDO getObject() {
return UserGroupCache.getInstance().getUser(getSearchFilter().getAssigneeId());
}
@Override
public void setObject(final PFUserDO object) {
if (object == null) {
getSearchFilter().setAssigneeId(null);
} else {
getSearchFilter().setAssigneeId(object.getId());
}
}
}, parentPage, "assigneeId");
fs.add(assigneeSelectPanel);
assigneeSelectPanel.setDefaultFormProcessing(false);
assigneeSelectPanel.init().withAutoSubmit(true);
}
gridBuilder.newSplitPanel(GridSize.COL33);
{
// Reporter
final FieldsetPanel fs = gridBuilder.newFieldset(getString("plugins.todo.reporter"));
final UserSelectPanel reporterSelectPanel = new UserSelectPanel(fs.newChildId(), new Model<PFUserDO>() {
@Override
public PFUserDO getObject() {
return UserGroupCache.getInstance().getUser(getSearchFilter().getReporterId());
}
@Override
public void setObject(final PFUserDO object) {
if (object == null) {
getSearchFilter().setReporterId(null);
} else {
getSearchFilter().setReporterId(object.getId());
}
}
}, parentPage, "reporterId");
fs.add(reporterSelectPanel);
reporterSelectPanel.setDefaultFormProcessing(false);
reporterSelectPanel.init().withAutoSubmit(true);
}
{
gridBuilder.newSplitPanel(GridSize.COL100);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("task")).suppressLabelForWarning();
final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new Model<TaskDO>() {
@Override
public TaskDO getObject() {
return getTaskTree().getTaskById(getSearchFilter().getTaskId());
}
@Override
public void setObject(final TaskDO task) {
if (task != null) {
getSearchFilter().setTaskId(task.getId());
} else {
getSearchFilter().setTaskId(null);
}
}
}, parentPage, "taskId");
fs.add(taskSelectPanel);
taskSelectPanel.init();
taskSelectPanel.setRequired(false);
}
}
use of org.projectforge.web.wicket.flowlayout.FieldsetPanel in project projectforge by micromata.
the class EmployeeBillingImportForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
gridBuilder.newGridPanel();
// Date DropDowns
final FieldsetPanel fsMonthYear = gridBuilder.newFieldset(I18nHelper.getLocalizedMessage("plugins.eed.listcare.yearmonth"));
dropDownMonth = new DropDownChoicePanel<>(fsMonthYear.newChildId(), new DropDownChoice<>(DropDownChoicePanel.WICKET_ID, new PropertyModel<>(this, "selectedMonth"), EEDHelper.MONTH_INTEGERS));
fsMonthYear.add(dropDownMonth);
dropDownYear = new DropDownChoicePanel<>(fsMonthYear.newChildId(), new DropDownChoice<>(DropDownChoicePanel.WICKET_ID, new PropertyModel<>(this, "selectedYear"), eedHelper.getDropDownYears()));
fsMonthYear.add(dropDownYear);
// upload buttons
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), "*.xls");
fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID) {
@Override
public final void onSubmit() {
final Date dateToSelectAttrRow = new GregorianCalendar(selectedYear, selectedMonth - 1, 1, 0, 0).getTime();
storagePanel.setDateToSelectAttrRow(dateToSelectAttrRow);
final boolean success = parentPage.doImport(dateToSelectAttrRow);
if (success) {
setDateDropDownsEnabled(false);
}
}
}, getString("upload"), SingleButtonPanel.NORMAL).setTooltip(getString("common.import.upload.tooltip")));
addClearButton(fs);
}
addImportFilterRadio(gridBuilder);
// preview of the imported data
gridBuilder.newGridPanel();
final DivPanel panel = gridBuilder.getPanel();
storagePanel = new EmployeeBillingImportStoragePanel(panel.newChildId(), parentPage, importFilter);
final Date dateToSelectAttrRow = new GregorianCalendar(selectedYear, selectedMonth - 1, 1, 0, 0).getTime();
storagePanel.setDateToSelectAttrRow(dateToSelectAttrRow);
panel.add(storagePanel);
}
use of org.projectforge.web.wicket.flowlayout.FieldsetPanel in project projectforge by micromata.
the class LiquidityEntryEditForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
{
// Date of payment
final FieldProperties<LocalDate> props = getDateOfPaymentProperties();
final FieldsetPanel fs = gridBuilder.newFieldset(LiquidityEntryDO.class, "dateOfPayment");
final LocalDatePanel dateOfPayment = new LocalDatePanel(fs.newChildId(), new LocalDateModel(props.getModel()));
fs.add(dateOfPayment);
if (isNew()) {
dateOfPayment.setFocus();
}
}
{
// Amount
final FieldsetPanel fs = gridBuilder.newFieldset(LiquidityEntryDO.class, "amount");
final RequiredMinMaxNumberField<BigDecimal> amount = new RequiredMinMaxNumberField<BigDecimal>(fs.getTextFieldId(), new PropertyModel<>(data, "amount"), Constants.TEN_BILLION_NEGATIVE, Constants.TEN_BILLION) {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public IConverter getConverter(final Class type) {
return new CurrencyConverter();
}
};
WicketUtils.setSize(amount, 8);
fs.add(amount);
if (!isNew()) {
amount.add(WicketUtils.setFocus());
}
}
{
final FieldsetPanel fs = gridBuilder.newFieldset(LiquidityEntryDO.class, "paid");
fs.addCheckBox(new PropertyModel<>(data, "paid"), null);
}
{
// Subject
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.rechnung.betreff"));
final RequiredMaxLengthTextField subject = new RequiredMaxLengthTextField(fs.getTextFieldId(), new PropertyModel<>(data, "subject"));
fs.add(subject);
}
{
// Text comment
final FieldsetPanel fs = gridBuilder.newFieldset(LiquidityEntryDO.class, "comment");
fs.add(new MaxLengthTextArea(fs.getTextAreaId(), new PropertyModel<>(data, "comment"))).setAutogrow();
}
addCloneButton();
}
use of org.projectforge.web.wicket.flowlayout.FieldsetPanel in project projectforge by micromata.
the class AccessEditForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
gridBuilder.newGridPanel();
{
// Task
final FieldsetPanel fs = gridBuilder.newFieldset(getString("task"));
final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(data, "task"), parentPage, "taskId");
fs.add(taskSelectPanel.setRequired(true));
taskSelectPanel.init();
}
{
// Group
final FieldsetPanel fs = gridBuilder.newFieldset(getString("group")).suppressLabelForWarning();
groupSelectPanel = new NewGroupSelectPanel(fs.newChildId(), new PropertyModel<GroupDO>(data, "group"), parentPage, "groupId");
fs.add(groupSelectPanel.setRequired(true));
groupSelectPanel.init();
}
{
// Option recursive
gridBuilder.newFieldset(getString("recursive")).addCheckBox(new PropertyModel<Boolean>(data, "recursive"), null).setTooltip(getString("access.recursive.help"));
}
{
// Access entries table
final FieldsetPanel fs = gridBuilder.newFieldset(getString("access.accessTable")).suppressLabelForWarning();
final AccessEditTablePanel accessEditTablePanel = new AccessEditTablePanel(fs.newChildId(), data);
fs.add(accessEditTablePanel);
accessEditTablePanel.init();
}
{
// Templates
final FieldsetPanel fs = gridBuilder.newFieldset(getString("access.templates")).suppressLabelForWarning();
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("clear")) {
@Override
public final void onSubmit() {
data.clear();
}
}, getString("access.templates.clear"), SingleButtonPanel.NORMAL));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("guest")) {
@Override
public final void onSubmit() {
data.guest();
}
}, getString("access.templates.guest"), SingleButtonPanel.NORMAL));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("employee")) {
@Override
public final void onSubmit() {
data.employee();
}
}, getString("access.templates.employee"), SingleButtonPanel.NORMAL));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("leader")) {
@Override
public final void onSubmit() {
data.leader();
}
}, getString("access.templates.leader"), SingleButtonPanel.NORMAL));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("administrator")) {
@Override
public final void onSubmit() {
data.administrator();
}
}, getString("access.templates.administrator"), SingleButtonPanel.DANGER));
}
{
// Description
final FieldsetPanel fs = gridBuilder.newFieldset(getString("description"));
fs.add(new MaxLengthTextArea(fs.getTextAreaId(), new PropertyModel<String>(data, "description")), true);
}
}
use of org.projectforge.web.wicket.flowlayout.FieldsetPanel in project projectforge by micromata.
the class AccessListForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
gridBuilder.newSplitPanel(GridSize.COL66);
{
// Group
final FieldsetPanel fs = gridBuilder.newFieldset(getString("group")).suppressLabelForWarning();
groupSelectPanel = new NewGroupSelectPanel(fs.newChildId(), new Model<GroupDO>() {
@Override
public GroupDO getObject() {
return groupService.getGroup(getSearchFilter().getGroupId());
}
@Override
public void setObject(final GroupDO object) {
if (object == null) {
getSearchFilter().setGroupId(null);
} else {
getSearchFilter().setGroupId(object.getId());
}
}
}, parentPage, "groupId");
fs.add(groupSelectPanel);
groupSelectPanel.setDefaultFormProcessing(false);
groupSelectPanel.init();
}
gridBuilder.newSplitPanel(GridSize.COL33);
{
// User
final FieldsetPanel fs = gridBuilder.newFieldset(getString("user")).suppressLabelForWarning();
final UserSelectPanel assigneeSelectPanel = new UserSelectPanel(fs.newChildId(), new Model<PFUserDO>() {
@Override
public PFUserDO getObject() {
return userGroupCache.getUser(getSearchFilter().getUserId());
}
@Override
public void setObject(final PFUserDO object) {
if (object == null) {
getSearchFilter().setUserId(null);
} else {
getSearchFilter().setUserId(object.getId());
}
}
}, parentPage, "userId");
fs.add(assigneeSelectPanel);
assigneeSelectPanel.setDefaultFormProcessing(false);
assigneeSelectPanel.init().withAutoSubmit(true);
fs.addHelpIcon(getString("access.tooltip.filter.user"));
}
gridBuilder.newGridPanel();
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("task")).suppressLabelForWarning();
final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new Model<TaskDO>() {
@Override
public TaskDO getObject() {
return taskTree.getTaskById(getSearchFilter().getTaskId());
}
@Override
public void setObject(final TaskDO task) {
if (task != null) {
getSearchFilter().setTaskId(task.getId());
} else {
getSearchFilter().setTaskId(null);
}
}
}, parentPage, "taskId");
fs.add(taskSelectPanel);
taskSelectPanel.init();
taskSelectPanel.setRequired(false);
}
}
Aggregations