package me.coley.recaf.config.impl;

import me.coley.logging.Level;
import me.coley.recaf.config.Conf;
import me.coley.recaf.config.Config;

/**
 * Options for user-interface.
 * 
 * @author Matt
 */
public class ConfDisplay extends Config {
	/**
	 * Simplify descriptor displays.
	 */
	@Conf(category = "display", key = "simplfy")
	public boolean simplify = true;
	/**
	 * Show in-line hints
	 */
	@Conf(category = "display", key = "jumphelp")
	public boolean jumpHelp = true;
	/**
	 * Editor windows become topmost.
	 */
	@Conf(category = "display", key = "topmost")
	public boolean topmost = true;
	/**
	 * Editor windows become topmost.
	 */
	@Conf(category = "display", key = "showsearchmethodtype")
	public boolean showSearchMethodType;
	/**
	 * UI language.
	 */
	@Conf(category = "display", key = "language")
	public String language = "en";
	/**
	 * Logging level to display in UI.
	 */
	@Conf(category = "display", key = "loglevel")
	public Level loglevel = Level.INFO;
	
	/**
	 * Show button bar in main window. Disable and relaunch for more vertical space.
	 */
	@Conf(category = "display", key = "buttonbar")
	public boolean toolbar = true;
	/**
	 * Max length of class-name shown in class tree. Helpful for obfuscated programs with long names.
	 */
	@Conf(category = "display", key = "maxlength.tree")
	public int maxLengthTree = 75;


	public ConfDisplay() {
		super("rc_display");
		load();
	}

	/**
	 * Static getter.
	 * 
	 * @return ConfDisplay instance.
	 */
	public static ConfDisplay instance() {
		return ConfDisplay.instance(ConfDisplay.class);
	}

}

@@ -30,16 +30,94 @@
 .impl;%0A%0A
+import com.eclipsesource.json.Json;%0Aimport com.eclipsesource.json.JsonValue;%0A%0A
 import m
@@ -1054,10 +1054,9 @@
 FO;%0A
-%09
 %0A
+
 %09/**
@@ -1130,16 +1130,20 @@
 vertical
+%0A%09 *
  space.%0A
@@ -1304,16 +1304,20 @@
 fuscated
+%0A%09 *
  program
@@ -1426,17 +1426,16 @@
  = 75;%0A%0A
-%0A
 %09public 
@@ -1473,16 +1473,16 @@
 play%22);%0A
-
 %09%09load()
@@ -1487,16 +1487,359 @@
 ();%0A%09%7D%0A%0A
+%09@Override%0A%09protected JsonValue convert(Class%3C?%3E type, Object value) %7B%0A%09%09if (type.equals(Level.class)) %7B%0A%09%09%09return Json.value(((Level) value).name());%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%0A%09@Override%0A%09protected Object parse(Class%3C?%3E type, JsonValue value) %7B%0A%09%09if (type.equals(Level.class)) %7B%0A%09%09%09return Level.valueOf(value.asString());%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%0A
 %09/**%0A%09 *

Fix #63