Author: ulhume
Date: 2008-08-31 04:10:08 +0200 (Sun, 31 Aug 2008)
New Revision: 1661
Modified:
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadgetConfiguration.java
Log:
Handle superclass configuration properties
Modified:
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
===================================================================
---
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
2008-08-31 01:46:18 UTC (rev 1660)
+++
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
2008-08-31 02:10:08 UTC (rev 1661)
@@ -91,12 +91,17 @@
String stringValue = environement.get(key);
key =
key.substring(ENVIRONEMENT_PREFIX.length());
throwTrace(" " + key + ":" + stringValue);
- Field field;
- try {
- field =
configuration.getClass().getField(key);
- } catch (SecurityException e) {
- throw new
SimpleGadgetException("Internal error while acessing '" + key + "' field.");
- } catch (NoSuchFieldException e1) {
+ Field field = null;
+
+ Class<?> class1 = configuration.getClass();
+ while (class1 != null) {
+ try {
+ field =
class1.getDeclaredField(key);
+ } catch (Exception e) {
+ }
+ class1 = class1.getSuperclass();
+ }
+ if (field == null) {
throw new SimpleGadgetException("Unable
to find '" + key + "' field.");
}
field.setAccessible(true);
Modified:
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadgetConfiguration.java
===================================================================
---
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadgetConfiguration.java
2008-08-31 01:46:18 UTC (rev 1660)
+++
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadgetConfiguration.java
2008-08-31 02:10:08 UTC (rev 1661)
@@ -24,8 +24,72 @@
public class SimpleGadgetConfiguration {
private boolean traces;
+ private int pitch;
+ private String language;
+ private String country;
+ private String locutor;
/**
+ * @return the pitch
+ */
+ public int getPitch() {
+ return pitch;
+ }
+
+ /**
+ * @param pitch
+ * the pitch to set
+ */
+ public void setPitch(int pitch) {
+ this.pitch = pitch;
+ }
+
+ /**
+ * @return the language
+ */
+ public String getLanguage() {
+ return language;
+ }
+
+ /**
+ * @param language
+ * the language to set
+ */
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ /**
+ * @return the country
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * @param country
+ * the country to set
+ */
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ /**
+ * @return the locutor
+ */
+ public String getLocutor() {
+ return locutor;
+ }
+
+ /**
+ * @param locutor
+ * the locutor to set
+ */
+ public void setLocutor(String locutor) {
+ this.locutor = locutor;
+ }
+
+ /**
* @return the traces
*/
public boolean isTraces() {
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn