Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Braunch committed Aug 29, 2016
1 parent 64760a9 commit dfc898c
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/main/java/net/sf/jabref/gui/keyboard/KeyBindingsListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void keyPressed(KeyEvent evt) {
int code = evt.getKeyCode();
String newKey;
//skip the event triggered only by a modifier
if(code == KeyEvent.VK_ALT ||
if (code == KeyEvent.VK_ALT ||
code == KeyEvent.VK_TAB ||
code == KeyEvent.VK_BACK_SPACE ||
code == KeyEvent.VK_ENTER ||
Expand All @@ -54,12 +54,12 @@ public void keyPressed(KeyEvent evt) {
code == KeyEvent.VK_SHIFT) {
return;
}
if("".equals(modifier)) {
if(isFunctionKey) {
if ("".equals(modifier)) {
if (isFunctionKey) {
newKey = KeyEvent.getKeyText(code);
} else if(isEscapeKey) {
} else if (isEscapeKey) {
newKey = "ESCAPE";
} else if(isDeleteKey) {
} else if (isDeleteKey) {
newKey = "DELETE";
} else {
return;
Expand All @@ -84,22 +84,21 @@ public void keyPressed(KeyEvent evt) {
private String getModifierText(KeyEvent evt) {
ArrayList<String> modifiersList = new ArrayList<>();

if (evt.isControlDown()) {
modifiersList.add("ctrl");
}
if (evt.isAltDown()) {
modifiersList.add("alt");
}
if (evt.isShiftDown()) {
modifiersList.add("shift");
}
if (evt.isAltGraphDown()) {
modifiersList.add("alt gr");
}
if (evt.isMetaDown()) {
modifiersList.add("meta");

}
if (evt.isControlDown()) {
modifiersList.add("ctrl");
}
if (evt.isAltDown()) {
modifiersList.add("alt");
}
if (evt.isShiftDown()) {
modifiersList.add("shift");
}
if (evt.isAltGraphDown()) {
modifiersList.add("alt gr");
}
if (evt.isMetaDown()) {
modifiersList.add("meta");
}
//Now build the String with all the modifier texts
String modifiersAsString = "";
for (String s : modifiersList) {
Expand Down

0 comments on commit dfc898c

Please sign in to comment.