Skip to content

Commit

Permalink
Fixed bug where handling selection of an already-open file didn't wor…
Browse files Browse the repository at this point in the history
…k correctly
  • Loading branch information
PranavAmarnath committed Mar 3, 2021
1 parent 6a6c3d2 commit de2056e
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions src/main/java/com/secres/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,13 @@ private void openOpenDialog() {
for(int i = 0; i < tabbedPane.getTabCount(); i++) {
if(tabbedPane.getTitleAt(i).equals(path.getName())) {
tabbedPane.setSelectedIndex(i);
break;
}
else {
tabbedPane.addTab(path.getName(), (Component) newPanels.keySet().toArray()[newPanels.size()-1]);
Main.createModel(path, ((TablePanel) newPanels.keySet().toArray()[newPanels.size()-1]).getTable());
tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
break;
return;
}
}
}
else {
tabbedPane.addTab(path.getName(), (Component) newPanels.keySet().toArray()[newPanels.size()-1]);
Main.createModel(path, ((TablePanel) newPanels.keySet().toArray()[newPanels.size()-1]).getTable());
tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
}
tabbedPane.addTab(path.getName(), (Component) newPanels.keySet().toArray()[newPanels.size()-1]);
Main.createModel(path, ((TablePanel) newPanels.keySet().toArray()[newPanels.size()-1]).getTable());
tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
}
}

Expand Down
Binary file modified target/classes/com/secres/View$TablePanel.class
Binary file not shown.
Binary file modified target/classes/com/secres/View.class
Binary file not shown.
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven
#Wed Mar 03 13:04:51 PST 2021
#Wed Mar 03 15:13:53 PST 2021
groupId=com.secres
artifactId=secrescsv
version=1.0-SNAPSHOT
Binary file modified target/original-secrescsv-1.0-SNAPSHOT.jar
Binary file not shown.
Binary file added target/secrescsv-1.0-SNAPSHOT-shaded.jar
Binary file not shown.
Binary file modified target/secrescsv-1.0-SNAPSHOT.jar
Binary file not shown.

0 comments on commit de2056e

Please sign in to comment.