public void testPreferenceDependencies() throws RaplaException { Allocatable allocatable = facade.newResource(); facade.store(allocatable); CalendarSelectionModel calendar = facade.newCalendarModel(facade.getUser()); calendar.setSelectedObjects(Collections.singleton(allocatable)); calendar.setViewId(WeekViewFactory.WEEK_VIEW); CalendarModelConfiguration config = ((CalendarModelImpl) calendar).createConfiguration(); RaplaMap<CalendarModelConfiguration> calendarList = facade.newRaplaMap(Collections.singleton(config)); Preferences preferences = facade.getPreferences(); Preferences editPref = facade.edit(preferences); TypedComponentRole<RaplaMap<CalendarModelConfiguration>> TEST_ENTRY = new TypedComponentRole<RaplaMap<CalendarModelConfiguration>>("TEST"); editPref.putEntry(TEST_ENTRY, calendarList); facade.store(editPref); try { facade.remove(allocatable); fail("DependencyException should have thrown"); } catch (DependencyException ex) { } calendarList = facade.newRaplaMap(new ArrayList<CalendarModelConfiguration>()); editPref = facade.edit(preferences); editPref.putEntry(TEST_ENTRY, calendarList); facade.store(editPref); facade.remove(allocatable); }
public void commit() throws RaplaException { TypedComponentRole<RaplaConfiguration> configEntry = MailPlugin.MAILSERVER_CONFIG; RaplaConfiguration newConfig = new RaplaConfiguration("config"); addChildren(newConfig); preferences.putEntry(configEntry, newConfig); preferences.putEntry(MailPlugin.DEFAULT_SENDER_ENTRY, defaultSender.getText()); }
public void commit() { // Save the options boolean selected = showConflictWarningsField.isSelected(); preferences.putEntry(CalendarOptionsImpl.SHOW_CONFLICT_WARNING, selected); }
public void commit() { preferences.putEntry(MY_OPTION, checkBox.isSelected()); }
public void commit() { String language = languageChooser.getSelectedLanguage(); preferences.putEntry(RaplaLocale.LANGUAGE_ENTRY, language); }