Use only editWindow and remove createWindow for BaseCalendarCRUDController

FEA: ItEr75S14ShowInformationEditedEntity
This commit is contained in:
Manuel Rego Casasnovas 2011-07-20 12:42:42 +02:00
parent 0780d4f952
commit f87c4cb316
3 changed files with 14 additions and 32 deletions

View file

@ -65,8 +65,6 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
private Window listWindow;
private Window createWindow;
private Window editWindow;
private Window createNewVersion;
@ -115,13 +113,8 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
}
private void highlightDaysOnCalendar() {
if (baseCalendarModel.isEditing()) {
((CalendarHighlightedDays) editWindow.getFellow("calendarWidget"))
.highlightDays();
} else {
((CalendarHighlightedDays) createWindow.getFellow("calendarWidget"))
.highlightDays();
}
((CalendarHighlightedDays) editWindow.getFellow("calendarWidget"))
.highlightDays();
}
public void save() {
@ -156,8 +149,8 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
assignCreateController();
setSelectedDay(new LocalDate());
highlightDaysOnCalendar();
getVisibility().showOnly(createWindow);
Util.reloadBindings(createWindow);
getVisibility().showOnly(editWindow);
Util.reloadBindings(editWindow);
}
public void setSelectedDay(LocalDate date) {
@ -202,7 +195,7 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
private void assignCreateController() {
createController = new BaseCalendarEditionController(baseCalendarModel,
createWindow, createNewVersion, messagesForUser) {
editWindow, createNewVersion, messagesForUser) {
@Override
public void goToList() {
@ -226,7 +219,7 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
};
try {
createController.doAfterCompose(createWindow);
createController.doAfterCompose(editWindow);
} catch (Exception e) {
throw new RuntimeException(e);
}
@ -234,18 +227,13 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
private OnlyOneVisible getVisibility() {
if (visibility == null) {
visibility = new OnlyOneVisible(listWindow, createWindow,
editWindow);
visibility = new OnlyOneVisible(listWindow, editWindow);
}
return visibility;
}
private void reloadDayInformation() {
if (baseCalendarModel.isEditing()) {
Util.reloadBindings(editWindow.getFellow("dayInformation"));
} else {
Util.reloadBindings(createWindow.getFellow("dayInformation"));
}
Util.reloadBindings(editWindow.getFellow("dayInformation"));
highlightDaysOnCalendar();
}
@ -254,8 +242,8 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
assignCreateController();
setSelectedDay(new LocalDate());
highlightDaysOnCalendar();
getVisibility().showOnly(createWindow);
Util.reloadBindings(createWindow);
getVisibility().showOnly(editWindow);
Util.reloadBindings(editWindow);
}
public boolean isEditing() {
@ -267,8 +255,8 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
assignCreateController();
setSelectedDay(new LocalDate());
highlightDaysOnCalendar();
getVisibility().showOnly(createWindow);
Util.reloadBindings(createWindow);
getVisibility().showOnly(editWindow);
Util.reloadBindings(editWindow);
}
public BaseCalendarsTreeModel getBaseCalendarsTreeModel() {

View file

@ -19,7 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<window id="${arg.top_id}" title="${arg.title}">
<window id="${arg.top_id}">
<tabbox sclass="calendar-tabbox">
<tabs>

View file

@ -42,13 +42,7 @@
<list top_id="listWindow" />
<edition top_id="createWindow" title="${i18n:_('Create Calendar')}"
save_button_label="${i18n:_('Save')}"
save_button_visible="true"
saveandcontinue_button_label="${i18n:_('Save and Continue')}"
cancel_button_label="${i18n:_('Cancel')}" />
<edition top_id="editWindow" title="${i18n:_('Edit Calendar')}"
<edition top_id="editWindow"
save_button_label="${i18n:_('Save')}"
save_button_visible="true"
saveandcontinue_button_label="${i18n:_('Save and Continue')}"