/*
 * Copyright © 2016, Gábor Kolozsy. All rights reserved.
 */
package hu.gaborkolozsy.dictionary.model.interfaces.impl;

import hu.gaborkolozsy.dictionary.model.interfaces.Service;
import hu.gaborkolozsy.dictionary.model.Config;
import hu.gaborkolozsy.dictionary.view.Dictionary;
import java.io.IOException;
import java.lang.reflect.Method;

/**
 * Theme service.
 * 
 * @author Kolozsy Gábor (kolozsygabor@gmail.com)
 * 
 * @see hu.gaborkolozsy.dictionary.model.interfaces.Service
 * @see hu.gaborkolozsy.dictionary.model.Config
 * @see hu.gaborkolozsy.dictionary.view.Dictionary
 * @see java.io.IOException
 * @see java.lang.reflect.Method
 * @since 0.1.1
 */
public class ThemeServiceImpl implements Service<Method> {
    
    /** {@code Config} object. */
    private final Config config;
    
    /**
     * Constructor.
     * @param config the {@code Config} object
     * @throws IOException by failed I/O operations
     */
    public ThemeServiceImpl(Config config) throws IOException {
        this.config = config;
    }
    
    /**
     * Return theme method's name.
     * @return the actual theme method
     * @throws IOException by failed I/O operations
     * @throws NoSuchMethodException if method not found with specified name
     */
    @Override
    public Method get() throws IOException, NoSuchMethodException {
        return choose(config.getPropertie("Theme"));
    }
    
    /**
     * Set theme as an ID.
     * @param theme the actual theme ID
     */
    @Override
    public void set(String theme) throws IOException {
        this.config.storePropertie("Theme", theme);
    }
    
    /**
     * Choose method for theme.
     * @return the callable method
     * @throws NoSuchMethodException if a matching method is not found
     */
    @Override
    public Method choose(String text) throws NoSuchMethodException {
        Method m = null;
        switch(text) { 
            case "1": m = Dictionary.class.getDeclaredMethod("midnight"); break;
            case "2": m = Dictionary.class.getDeclaredMethod("dark");     break;
            case "3": m = Dictionary.class.getDeclaredMethod("light");    break;
        }
        return m;
    }
}

@@ -34,35 +34,14 @@
 ozsy
-. All rights reserved.
 %0A */%0A
+%0A
 pack
@@ -372,20 +372,33 @@
 or (
+gabor.
 kolozsy
-gabor
+.development
 @gma
@@ -409,20 +409,16 @@
 om)%0A
- * %0A
  * @see 
 hu.g
@@ -417,148 +417,39 @@
 see 
-hu.gaborkolozsy.dictionary.model.interfaces.Service%0A * @see hu.gaborkolozsy.dictionary.model.Config%0A * @see hu.gaborkolozsy.dictionary.view.
+Service%0A * @see Config%0A * @see 
 Dict
@@ -463,24 +463,16 @@
  * @see 
-java.io.
 IOExcept
@@ -483,34 +483,16 @@
  * @see 
-java.lang.reflect.
 Method%0A 

Update ThemeServiceImpl.java