auto-sync

This commit is contained in:
rusEfi 2015-03-14 00:04:48 -05:00
parent d60a065eb2
commit e0414eb31c
1 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,7 @@ import javax.swing.Action;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
import com.romraider.editor.ecu.ECUEditor; import com.romraider.editor.ecu.ECUEditor;
import com.romraider.editor.ecu.ECUEditorManager; import com.romraider.editor.ecu.ECUEditorManager;
@ -75,8 +76,15 @@ public class RomTree extends JTree implements MouseListener {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
TreePath treePath = getPathForLocation(e.getX(), e.getY());
if (treePath == null)
return;
Object selectedRow = treePath.getLastPathComponent();
if (selectedRow instanceof Rom) {
// we do not really need this collapse/expand action in rusEfi
return;
}
try{ try{
Object selectedRow = getPathForLocation(e.getX(), e.getY()).getLastPathComponent();
if(selectedRow instanceof TableTreeNode) { if(selectedRow instanceof TableTreeNode) {
if (e.getClickCount() >= SettingsManager.getSettings().getTableClickCount()) { if (e.getClickCount() >= SettingsManager.getSettings().getTableClickCount()) {