Skip to content

Commit

Permalink
add accelerator keys to main gui
Browse files Browse the repository at this point in the history
  • Loading branch information
kryptonbutterfly committed Mar 17, 2023
1 parent 6a1180a commit a00e849
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A Language file Editor with special sauce for java projects.

java version | app version | jar | deb
:----------: | :---------: | :-: | :-:
18+ | 2.0.0 | [Localizer4J.jar](https://github.com/tinycodecrank/Localizer4J/releases/download/v2.0.0/Localizer4J.jar) | [Localizer4J-2.0.0.deb](https://github.com/tinycodecrank/Localizer4J/releases/download/v2.0.0/Localizer4J-2.0.0.deb)
18+ | 2.1.0 | [Localizer4J.jar](https://github.com/tinycodecrank/Localizer4J/releases/download/v2.1.0/Localizer4J.jar) | [Localizer4J-2.1.0.deb](https://github.com/tinycodecrank/Localizer4J/releases/download/v2.1.0/Localizer4J-2.1.0.deb)

## Dependencies

Expand Down
2 changes: 1 addition & 1 deletion deb-content/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0
15 changes: 9 additions & 6 deletions src/de/tinycodecrank/l4j/ui/main/MainGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
@SuppressWarnings("serial")
public class MainGui extends ObservableLangGui<BusinessLogic, Void, Localizer>
{
private final String countTitle = "Main.table.count";
private final String identifierTitle = "Main.table.identifier";
private static final String countTitle = "Main.table.count";
private static final String identifierTitle = "Main.table.identifier";

private final String lineTitle = "Main.table.Line";
private final String classTitle = "Main.table.Class";
private final String fileTitle = "Main.table.File";
private final String textTitle = "Main.table.Text";
private static final String lineTitle = "Main.table.Line";
private static final String classTitle = "Main.table.Class";
private static final String fileTitle = "Main.table.File";
private static final String textTitle = "Main.table.Text";

JMenu mnOpenRecent;
JMenuItem mnLanguage;
Expand Down Expand Up @@ -136,11 +136,13 @@ public MainGui(Consumer<GuiCloseEvent<Void>> closeListener, ProgramArgs args, Lo

JMenuItem mntmNewProject = new JMenuItem();
reg("Main.Menu.New", mntmNewProject::setText);
mntmNewProject.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK));
mnFile.add(mntmNewProject);
businessLogic.if_(bl -> mntmNewProject.addActionListener(bl::newProject));

JMenuItem mntmOpenProject = new JMenuItem();
reg("Main.Menu.Open", mntmOpenProject::setText);
mntmOpenProject.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
mnFile.add(mntmOpenProject);
businessLogic.if_(bl -> mntmOpenProject.addActionListener(bl::openProject));

Expand All @@ -150,6 +152,7 @@ public MainGui(Consumer<GuiCloseEvent<Void>> closeListener, ProgramArgs args, Lo

mntmSaveProject = new JMenuItem();
reg("Main.Menu.Save", mntmSaveProject::setText);
mntmSaveProject.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK));
mntmSaveProject.setEnabled(false);
mnFile.add(mntmSaveProject);
businessLogic.if_(bl -> mntmSaveProject.addActionListener(bl::saveProject));
Expand Down

0 comments on commit a00e849

Please sign in to comment.