Skip to content
Snippets Groups Projects
Commit 8e269d0c authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#683 - added new hotkey to hotkey page

parent 475457e1
No related branches found
No related tags found
No related merge requests found
package de.deadlocker8.budgetmaster.hotkeys;
import de.thecodelabs.utils.util.Localization;
import java.text.MessageFormat;
public enum ChartHotkeys implements HotKey
{
SHIFT_CLICK("hotkeys.charts.shift.click", true);
private final String localizationKey;
private final boolean hasModifier;
ChartHotkeys(String localizationKey, boolean hasModifier)
{
this.localizationKey = localizationKey;
this.hasModifier = hasModifier;
}
@Override
public String getModifierLocalized()
{
if(hasModifier)
{
return getLocalized("modifier");
}
return null;
}
@Override
public String getKeyLocalized()
{
return getLocalized("key");
}
@Override
public String getTextLocalized()
{
return getLocalized(null);
}
private String getLocalized(String keySuffix)
{
if(keySuffix == null)
{
return Localization.getString(localizationKey);
}
return Localization.getString(MessageFormat.format("{0}.{1}", localizationKey, keySuffix));
}
@Override
public String toString()
{
return "ChartHotkeys{" +
"localizationKey='" + localizationKey + '\'' +
", hasModifier=" + hasModifier +
"} " + super.toString();
}
}
...@@ -15,6 +15,7 @@ public class HotKeysController extends BaseController ...@@ -15,6 +15,7 @@ public class HotKeysController extends BaseController
public static final String HOTKEYS_GENERAL = "hotkeysGeneral"; public static final String HOTKEYS_GENERAL = "hotkeysGeneral";
public static final String HOTKEYS_DATEPICKER = "hotkeysGlobalDatePicker"; public static final String HOTKEYS_DATEPICKER = "hotkeysGlobalDatePicker";
public static final String HOTKEYS_ACCOUNT_SELECT = "hotkeysAccountSelect"; public static final String HOTKEYS_ACCOUNT_SELECT = "hotkeysAccountSelect";
public static final String HOTKEYS_CHARTS = "hotkeysCharts";
} }
private static class ReturnValues private static class ReturnValues
...@@ -28,6 +29,7 @@ public class HotKeysController extends BaseController ...@@ -28,6 +29,7 @@ public class HotKeysController extends BaseController
model.addAttribute(ModelAttributes.HOTKEYS_GENERAL, GeneralHotKey.values()); model.addAttribute(ModelAttributes.HOTKEYS_GENERAL, GeneralHotKey.values());
model.addAttribute(ModelAttributes.HOTKEYS_DATEPICKER, GlobalDatePickerHotKey.values()); model.addAttribute(ModelAttributes.HOTKEYS_DATEPICKER, GlobalDatePickerHotKey.values());
model.addAttribute(ModelAttributes.HOTKEYS_ACCOUNT_SELECT, GlobalAccountSelectHotKey.values()); model.addAttribute(ModelAttributes.HOTKEYS_ACCOUNT_SELECT, GlobalAccountSelectHotKey.values());
model.addAttribute(ModelAttributes.HOTKEYS_CHARTS, ChartHotkeys.values());
return ReturnValues.HOTKEYS; return ReturnValues.HOTKEYS;
} }
} }
\ No newline at end of file
...@@ -557,6 +557,10 @@ hotkeys.global.account.select.open.key=a ...@@ -557,6 +557,10 @@ hotkeys.global.account.select.open.key=a
hotkeys.global.account.select.open=Kontoauswahl öffnen hotkeys.global.account.select.open=Kontoauswahl öffnen
hotkeys.global.account.select.by.number.key=0 - 9 hotkeys.global.account.select.by.number.key=0 - 9
hotkeys.global.account.select.by.number=Konto auswählen hotkeys.global.account.select.by.number=Konto auswählen
hotkeys.charts=Diagramme
hotkeys.charts.shift.click.key=Klick
hotkeys.charts.shift.click=Zugehörige Buchungen für angeklickten Bereich anzeigen
hotkeys.charts.shift.click.modifier=Umschalt
# charts # charts
......
...@@ -557,6 +557,10 @@ hotkeys.global.account.select.open.key=a ...@@ -557,6 +557,10 @@ hotkeys.global.account.select.open.key=a
hotkeys.global.account.select.open=Open account select hotkeys.global.account.select.open=Open account select
hotkeys.global.account.select.by.number.key=0 - 9 hotkeys.global.account.select.by.number.key=0 - 9
hotkeys.global.account.select.by.number=Choose account hotkeys.global.account.select.by.number=Choose account
hotkeys.charts=Charts
hotkeys.charts.shift.click.key=Click
hotkeys.charts.shift.click=Show related transactions for clicked area
hotkeys.charts.shift.click.modifier=Shift
# charts # charts
chart.display.type=Display type chart.display.type=Display type
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
<@listHotKeys locale.getString("hotkeys.global.datepicker") hotkeysGlobalDatePicker/> <@listHotKeys locale.getString("hotkeys.global.datepicker") hotkeysGlobalDatePicker/>
<@listHotKeys locale.getString("hotkeys.global.account.select") hotkeysAccountSelect/> <@listHotKeys locale.getString("hotkeys.global.account.select") hotkeysAccountSelect/>
<@listHotKeys locale.getString("hotkeys.charts") hotkeysCharts/>
</@header.content> </@header.content>
</div> </div>
</main> </main>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment