From 628749337bb278d97a06db6948b7f3316eaaaf4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 19 Aug 2017 00:32:40 +0200 Subject: [PATCH] Added event for when a locale has changed. The new locale is included in the event class. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../events/locale/LocaleChangeEvent.java | 52 +++++++++++++++++++ .../locale/ObservableLocaleChangeEvent.java | 36 +++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 src/org/mxchange/jcoreee/events/locale/LocaleChangeEvent.java create mode 100644 src/org/mxchange/jcoreee/events/locale/ObservableLocaleChangeEvent.java diff --git a/src/org/mxchange/jcoreee/events/locale/LocaleChangeEvent.java b/src/org/mxchange/jcoreee/events/locale/LocaleChangeEvent.java new file mode 100644 index 0000000..e8a2a04 --- /dev/null +++ b/src/org/mxchange/jcoreee/events/locale/LocaleChangeEvent.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcoreee.events.locale; + +import java.util.Locale; + +/** + * An event being fired when a helper bean should be cleaned. + *

+ * @author Roland Häder + */ +public class LocaleChangeEvent implements ObservableLocaleChangeEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 14_689_371_541_856L; + + /** + * New locale instance + */ + private final Locale locale; + + /** + * Default constructor with new locale + *

+ * @param locale New locale instance + */ + public LocaleChangeEvent (final Locale locale) { + this.locale = locale; + } + + @Override + public Locale getLocale () { + return this.locale; + } + +} diff --git a/src/org/mxchange/jcoreee/events/locale/ObservableLocaleChangeEvent.java b/src/org/mxchange/jcoreee/events/locale/ObservableLocaleChangeEvent.java new file mode 100644 index 0000000..310aada --- /dev/null +++ b/src/org/mxchange/jcoreee/events/locale/ObservableLocaleChangeEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcoreee.events.locale; + +import java.io.Serializable; +import java.util.Locale; + +/** + * An event being fired when a helper bean should be cleaned. + *

+ * @author Roland Häder + */ +public interface ObservableLocaleChangeEvent extends Serializable { + + /** + * Getter for locale instance + *

+ * @return Locale instance + */ + Locale getLocale (); + +} -- 2.39.5