package me.coley.recaf;

import org.pmw.tinylog.Configurator;
import org.pmw.tinylog.Logger;
import org.pmw.tinylog.writers.FileWriter;
import org.slf4j.LoggerFactory;
import org.slf4j.impl.SimpleLogger;
import picocli.CommandLine;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.lang.reflect.Field;

/**
 * Entry point &amp; version constant.
 *
 * @author Matt
 */
public class Recaf {
	/**
	 * Recaf version.
	 */
	public static final String VERSION = "2.0.0";

	public static void main(String[] args) {
		setupLogging();
		Logger.info("Starting Recaf-{}...", VERSION);
		// Invoke
		new CommandLine(new Initializer()).execute(args);
	}

	public static void setupLogging() {
		// Setup tinylog instance
		Configurator.defaultConfig()
				.formatPattern("{level}-{date}: {message|indent=4}")
				.writingThread(true)
				.addWriter(new FileWriter("rclog.txt"))
				.activate();
		// Disable Slf4j (Configured by Aether depenency)
		try {
			Field target = LoggerFactory.getLogger("ROOT").getClass().getDeclaredField("TARGET_STREAM");
			target.setAccessible(true);
			target.set(null, new PrintStream(new ByteArrayOutputStream()));
		} catch(Exception ex) {
			ex.printStackTrace();
		}
	}
}

@@ -18,16 +18,59 @@
 recaf;%0A%0A
+import me.coley.recaf.workspace.Workspace;%0A
 import o
@@ -366,16 +366,72 @@
 t.Field;
+%0Aimport java.util.*;%0Aimport java.util.function.Consumer;
 %0A%0A/**%0A *
@@ -591,179 +591,1016 @@
 0%22;%0A
-%0A%09public static void main(String%5B%5D args) %7B%0A%09%09setupLogging();%0A%09%09Logger.info(%22Starting Recaf-%7B%7D...%22, VERSION);%0A%09%09// Invoke%0A%09%09new CommandLine(new Initializer()).execute(args)
+%09/**%0A%09 * Current workspace.%0A%09 */%0A%09private static Workspace currentWorkspace;%0A%09/**%0A%09 * Listeners to call when the %7B@link #currentWorkspace current workspace%7D is changed.%0A%09 */%0A%09private static Set%3CConsumer%3CWorkspace%3E%3E workspaceSetListeners = new HashSet%3C%3E();%0A%0A%09/**%0A%09 * Start recaf.%0A%09 * @param args Optional args.%0A%09 */%0A%09public static void main(String%5B%5D args) %7B%0A%09%09setupLogging();%0A%09%09Logger.info(%22Starting Recaf-%7B%7D...%22, VERSION);%0A%09%09// Invoke%0A%09%09new CommandLine(new Initializer()).execute(args);%0A%09%7D%0A%0A%09/**%0A%09 * @param currentWorkspace Sets the current workspace.%0A%09 */%0A%09public static void setCurrentWorkspace(Workspace currentWorkspace) %7B%0A%09%09Recaf.currentWorkspace = currentWorkspace;%0A%09%7D%0A%0A%09/**%0A%09 * @return Current workspace.%0A%09 */%0A%09public static Workspace getCurrentWorkspace() %7B%0A%09%09return currentWorkspace;%0A%09%7D%0A%0A%09/**%0A%09 * @return Set of listeners to call when the %7B@link #currentWorkspace current workspace%7D is changed.%0A%09 */%0A%09public static Set%3CConsumer%3CWorkspace%3E%3E getWorkspaceSetListeners() %7B%0A%09%09return workspaceSetListeners
 ;%0A%09%7D

Add Workspace field + getter/setter/listeners