|
@@ -41,6 +41,7 @@ import javax.swing.text.html.HTMLDocument;
|
41
|
41
|
import javax.swing.text.html.HTMLEditorKit;
|
42
|
42
|
import javax.swing.tree.DefaultMutableTreeNode;
|
43
|
43
|
import javax.swing.tree.DefaultTreeModel;
|
|
44
|
+import javax.swing.tree.TreeSelectionModel;
|
44
|
45
|
import net.miginfocom.layout.PlatformDefaults;
|
45
|
46
|
|
46
|
47
|
import net.miginfocom.swing.MigLayout;
|
|
@@ -119,6 +120,8 @@ public final class LicencesPanel extends JPanel implements TreeSelectionListener
|
119
|
120
|
list.setCellRenderer(new LicenceRenderer());
|
120
|
121
|
list.setRootVisible(false);
|
121
|
122
|
list.setOpaque(false);
|
|
123
|
+ list.getSelectionModel().setSelectionMode(TreeSelectionModel.
|
|
124
|
+ SINGLE_TREE_SELECTION);
|
122
|
125
|
new TreeScroller(list);
|
123
|
126
|
new LicenceLoader(list, listModel).execute();
|
124
|
127
|
licence = new JEditorPane();
|
|
@@ -134,6 +137,9 @@ public final class LicencesPanel extends JPanel implements TreeSelectionListener
|
134
|
137
|
/** {@inheritDoc} */
|
135
|
138
|
@Override
|
136
|
139
|
public void valueChanged(final TreeSelectionEvent e) {
|
|
140
|
+ if (list.getSelectionCount() == 0) {
|
|
141
|
+ list.setSelectionPath(e.getOldLeadSelectionPath());
|
|
142
|
+ }
|
137
|
143
|
list.scrollPathToVisible(e.getPath());
|
138
|
144
|
final Object userObject = ((DefaultMutableTreeNode) e.getPath().
|
139
|
145
|
getLastPathComponent()).getUserObject();
|