package devopsdistilled.operp.client.main;

import javax.inject.Inject;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;

import devopsdistilled.operp.client.abstracts.ViewPane;

public class NavigationPane extends ViewPane implements TreeSelectionListener {

	@Inject
	private NavigationTree navigationTree;

	@Inject
	private MainWindow mainWindow;

	@Override
	public JComponent getPane() {
		navigationTree.setListener(this);
		return new JScrollPane(navigationTree.getTree());
	}

	@Override
	public void valueChanged(TreeSelectionEvent e) {
		System.out.println("Value Changed");
	}

}

@@ -221,16 +221,120 @@
 stener;%0A
+import javax.swing.tree.DefaultMutableTreeNode;%0A%0Aimport devopsdistilled.operp.client.abstracts.TaskPane;
 %0Aimport 
@@ -751,48 +751,449 @@
 nt e
+vent
 ) %7B%0A
+%0A
 %09%09
-System.out.println(%22Value Changed%22
+DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) event%0A%09%09%09%09.getPath().getLastPathComponent();%0A%0A%09%09DefaultMutableTreeNode prevNode = (DefaultMutableTreeNode) event%0A%09%09%09%09.getOldLeadSelectionPath().getLastPathComponent();%0A%0A%09%09TaskPane newTaskPane = (TaskPane) selectedNode.getUserObject();%0A%0A%09%09TaskPane oldTaskPane = (TaskPane) prevNode.getUserObject();%0A%0A%09%09mainWindow.getController().changeTaskPane(newTaskPane, oldTaskPane
 );%0A%09

Change taskpane upon navigation menu selection