diff --git a/data/resources/application/en.xml b/data/resources/application/en.xml
index 86418dc35..16113ef78 100644
--- a/data/resources/application/en.xml
+++ b/data/resources/application/en.xml
@@ -4,54 +4,54 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -221,7 +221,7 @@
-
+
diff --git a/data/resources/application/fi.xml b/data/resources/application/fi.xml
index 8244270e8..ade02d21a 100644
--- a/data/resources/application/fi.xml
+++ b/data/resources/application/fi.xml
@@ -4,54 +4,54 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -61,7 +61,7 @@
-
+
@@ -71,7 +71,7 @@
-
+
@@ -104,7 +104,7 @@
-
+
@@ -221,9 +221,9 @@
-
-
-
+
+
+
@@ -292,8 +292,8 @@
-
-
+
+
diff --git a/data/resources/application/fr.xml b/data/resources/application/fr.xml
index fae78eec6..7f8bd8ceb 100644
--- a/data/resources/application/fr.xml
+++ b/data/resources/application/fr.xml
@@ -5,54 +5,54 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -222,7 +222,7 @@
-
+
diff --git a/data/resources/application/it.xml b/data/resources/application/it.xml
index 53eb7adce..de91c2681 100644
--- a/data/resources/application/it.xml
+++ b/data/resources/application/it.xml
@@ -4,54 +4,54 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -221,7 +221,7 @@
-
+
diff --git a/data/resources/application/ru.xml b/data/resources/application/ru.xml
index bfcd629fd..61f959ec3 100644
--- a/data/resources/application/ru.xml
+++ b/data/resources/application/ru.xml
@@ -4,54 +4,54 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,7 +71,7 @@
-
+
@@ -221,7 +221,7 @@
-
+
diff --git a/data/resources/application/sv.xml b/data/resources/application/sv.xml
new file mode 100644
index 000000000..92e7ca4f8
--- /dev/null
+++ b/data/resources/application/sv.xml
@@ -0,0 +1,337 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/resources/application/uk.xml b/data/resources/application/uk.xml
index bb38857ca..56dc8554d 100644
--- a/data/resources/application/uk.xml
+++ b/data/resources/application/uk.xml
@@ -4,54 +4,54 @@
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,7 +71,7 @@
-
+
@@ -104,7 +104,7 @@
-
+
@@ -221,9 +221,9 @@
-
-
-
+
+
+
diff --git a/data/resources/zlibrary/sv.xml b/data/resources/zlibrary/sv.xml
new file mode 100644
index 000000000..1d4d1a55e
--- /dev/null
+++ b/data/resources/zlibrary/sv.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/icons/toolbar/addbook.png b/icons/toolbar/addBook.png
similarity index 100%
rename from icons/toolbar/addbook.png
rename to icons/toolbar/addBook.png
diff --git a/icons/toolbar/bookinfo.png b/icons/toolbar/bookInfo.png
similarity index 100%
rename from icons/toolbar/bookinfo.png
rename to icons/toolbar/bookInfo.png
diff --git a/icons/toolbar/findprev.png b/icons/toolbar/findNext.png
similarity index 100%
rename from icons/toolbar/findprev.png
rename to icons/toolbar/findNext.png
diff --git a/icons/toolbar/findnext.png b/icons/toolbar/findPrevious.png
similarity index 100%
rename from icons/toolbar/findnext.png
rename to icons/toolbar/findPrevious.png
diff --git a/icons/toolbar/home.png b/icons/toolbar/gotoHome.png
similarity index 100%
rename from icons/toolbar/home.png
rename to icons/toolbar/gotoHome.png
diff --git a/icons/toolbar/settings.png b/icons/toolbar/preferences.png
similarity index 100%
rename from icons/toolbar/settings.png
rename to icons/toolbar/preferences.png
diff --git a/icons/toolbar/rightarrow.png b/icons/toolbar/redo.png
similarity index 100%
rename from icons/toolbar/rightarrow.png
rename to icons/toolbar/redo.png
diff --git a/icons/toolbar/rotatescreen.png b/icons/toolbar/rotate.png
similarity index 100%
rename from icons/toolbar/rotatescreen.png
rename to icons/toolbar/rotate.png
diff --git a/icons/toolbar/find.png b/icons/toolbar/search.png
similarity index 100%
rename from icons/toolbar/find.png
rename to icons/toolbar/search.png
diff --git a/icons/toolbar/help.png b/icons/toolbar/showHelp.png
similarity index 100%
rename from icons/toolbar/help.png
rename to icons/toolbar/showHelp.png
diff --git a/icons/toolbar/books.png b/icons/toolbar/showLibrary.png
similarity index 100%
rename from icons/toolbar/books.png
rename to icons/toolbar/showLibrary.png
diff --git a/icons/toolbar/history.png b/icons/toolbar/showRecent.png
similarity index 100%
rename from icons/toolbar/history.png
rename to icons/toolbar/showRecent.png
diff --git a/icons/toolbar/contents.png b/icons/toolbar/toc.png
similarity index 100%
rename from icons/toolbar/contents.png
rename to icons/toolbar/toc.png
diff --git a/icons/toolbar/leftarrow.png b/icons/toolbar/undo.png
similarity index 100%
rename from icons/toolbar/leftarrow.png
rename to icons/toolbar/undo.png
diff --git a/platform/android/data/default/keymap.xml b/platform/android/data/default/keymap.xml
index 5363e6467..34c9c9f80 100644
--- a/platform/android/data/default/keymap.xml
+++ b/platform/android/data/default/keymap.xml
@@ -1,28 +1,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/platform/android/data/default/menubar.xml b/platform/android/data/default/menubar.xml
index 9a7f3de76..09fdb2f0a 100644
--- a/platform/android/data/default/menubar.xml
+++ b/platform/android/data/default/menubar.xml
@@ -1,38 +1,38 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
diff --git a/platform/swing/data/default/keymap.xml b/platform/swing/data/default/keymap.xml
index aa5a5bf12..365e2b57e 100644
--- a/platform/swing/data/default/keymap.xml
+++ b/platform/swing/data/default/keymap.xml
@@ -1,32 +1,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/platform/swing/data/default/toolbar.xml b/platform/swing/data/default/toolbar.xml
index 9a23af2e3..b586b89f9 100644
--- a/platform/swing/data/default/toolbar.xml
+++ b/platform/swing/data/default/toolbar.xml
@@ -1,23 +1,23 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
+
diff --git a/src/org/fbreader/fbreader/ActionCode.java b/src/org/fbreader/fbreader/ActionCode.java
index 08dde66f0..73e886ea1 100644
--- a/src/org/fbreader/fbreader/ActionCode.java
+++ b/src/org/fbreader/fbreader/ActionCode.java
@@ -1,44 +1,41 @@
package org.fbreader.fbreader;
public interface ActionCode {
- // please, don't change these numbers
- // add new action id's at the end of this list
- int NONE = 0;
- int SHOW_COLLECTION = 1;
- int SHOW_OPTIONS = 2;
- int UNDO = 3;
- int REDO = 4;
- int SHOW_CONTENTS = 5;
- int SEARCH = 6;
- int FIND_PREVIOUS = 7;
- int FIND_NEXT = 8;
- int LARGE_SCROLL_FORWARD = 9;
- int LARGE_SCROLL_BACKWARD = 10;
- int SMALL_SCROLL_FORWARD = 11;
- int SMALL_SCROLL_BACKWARD = 12;
- int MOUSE_SCROLL_FORWARD = 13;
- int MOUSE_SCROLL_BACKWARD = 14;
- int SCROLL_TO_HOME = 15;
- int SCROLL_TO_START_OF_TEXT = 16;
- int SCROLL_TO_END_OF_TEXT = 17;
- int CANCEL = 18;
- int INCREASE_FONT = 19;
- int DECREASE_FONT = 20;
- int SHOW_HIDE_POSITION_INDICATOR = 21;
- int TOGGLE_FULLSCREEN = 22;
- int FULLSCREEN_ON = 23;
- int ADD_BOOK = 24;
- int SHOW_BOOK_INFO = 25;
- int SHOW_HELP = 26;
- int ROTATE_SCREEN = 27;
- int SHOW_LAST_BOOKS = 28;
- int QUIT = 29;
- int OPEN_PREVIOUS_BOOK = 30;
- int FINGER_TAP_SCROLL_FORWARD = 31;
- int FINGER_TAP_SCROLL_BACKWARD = 32;
- int GOTO_NEXT_TOC_SECTION = 33;
- int GOTO_PREVIOUS_TOC_SECTION = 34;
- int COPY_SELECTED_TEXT_TO_CLIPBOARD = 35;
- int CLEAR_SELECTION = 36;
- int OPEN_SELECTED_TEXT_IN_DICTIONARY = 37;
+ String SHOW_COLLECTION = "showLibrary";
+ String SHOW_OPTIONS = "preferences";
+ String UNDO = "undo";
+ String REDO = "redo";
+ String SHOW_CONTENTS = "toc";
+ String SEARCH = "search";
+ String FIND_PREVIOUS = "findPrevious";
+ String FIND_NEXT = "findNext";
+ String LARGE_SCROLL_FORWARD = "largeScrollForward";
+ String LARGE_SCROLL_BACKWARD = "largeScrollBackward";
+ String SMALL_SCROLL_FORWARD = "smallScrollForward";
+ String SMALL_SCROLL_BACKWARD = "smallScrollBackward";
+ String MOUSE_SCROLL_FORWARD = "mouseScrollForward";
+ String MOUSE_SCROLL_BACKWARD = "mouseScrollBackward";
+ String SCROLL_TO_HOME = "gotoHome";
+ String SCROLL_TO_START_OF_TEXT = "gotoSectionStart";
+ String SCROLL_TO_END_OF_TEXT = "gotoSectionEnd";
+ String CANCEL = "cancel";
+ String INCREASE_FONT = "increaseFont";
+ String DECREASE_FONT = "decreaseFont";
+ String SHOW_HIDE_POSITION_INDICATOR = "toggleIndicator";
+ String TOGGLE_FULLSCREEN = "toggleFullscreen";
+ String FULLSCREEN_ON = "onFullscreen";
+ String ADD_BOOK = "addBook";
+ String SHOW_BOOK_INFO = "bookInfo";
+ String SHOW_HELP = "showHelp";
+ String ROTATE_SCREEN = "rotate";
+ String SHOW_LAST_BOOKS = "showRecent";
+ String QUIT = "quit";
+ String OPEN_PREVIOUS_BOOK = "previousBook";
+ String FINGER_TAP_SCROLL_FORWARD = "tapScrollForward";
+ String FINGER_TAP_SCROLL_BACKWARD = "tapScrollBackward";
+ String GOTO_NEXT_TOC_SECTION = "nextTOCSection";
+ String GOTO_PREVIOUS_TOC_SECTION = "previousTOCSection";
+ String COPY_SELECTED_TEXT_TO_CLIPBOARD = "copyToClipboard";
+ String CLEAR_SELECTION = "clearSelection";
+ String OPEN_SELECTED_TEXT_IN_DICTIONARY = "openInDictionary";
};
diff --git a/src/org/zlibrary/core/application/ZLApplication.java b/src/org/zlibrary/core/application/ZLApplication.java
index cdaedd801..3f5286fa2 100644
--- a/src/org/zlibrary/core/application/ZLApplication.java
+++ b/src/org/zlibrary/core/application/ZLApplication.java
@@ -45,8 +45,7 @@ public abstract class ZLApplication {
private ZLApplicationWindow myWindow;
private ZLView myInitialView;
- // TODO: 256!!!
- private final ZLAction[] myActionMap = new ZLAction[256];
+ private final HashMap myIdToActionMap = new HashMap();
private Toolbar myToolbar;
private Menubar myMenubar;
//private ZLTime myLastKeyActionTime;
@@ -141,10 +140,8 @@ public abstract class ZLApplication {
return (myWindow != null) && myWindow.isFullscreen();
}
- protected final void addAction(int actionId, ZLAction action) {
- if ((actionId >= 0) && (actionId < 256)) {
- myActionMap[actionId] = action;
- }
+ protected final void addAction(String actionId, ZLAction action) {
+ myIdToActionMap.put(actionId, action);
}
public final boolean isFullKeyboardControlSupported() {
@@ -181,24 +178,21 @@ public abstract class ZLApplication {
}
}
- private final ZLAction getAction(int actionId) {
- if ((actionId >= 0) && (actionId < 256)) {
- return myActionMap[actionId];
- }
- return null;
+ private final ZLAction getAction(String actionId) {
+ return (ZLAction)myIdToActionMap.get(actionId);
}
- public final boolean isActionVisible(int actionId) {
+ public final boolean isActionVisible(String actionId) {
ZLAction action = getAction(actionId);
return (action != null) && action.isVisible();
}
- public final boolean isActionEnabled(int actionId) {
+ public final boolean isActionEnabled(String actionId) {
ZLAction action = getAction(actionId);
return (action != null) && action.isEnabled();
}
- public final void doAction(int actionId) {
+ public final void doAction(String actionId) {
ZLAction action = getAction(actionId);
if (action != null) {
action.checkAndRun();
@@ -321,8 +315,8 @@ public abstract class ZLApplication {
private final ArrayList myItems = new ArrayList();
private final ZLResource myResource = ZLResource.resource("toolbar");
- private void addButton(int actionId, String key/*, ButtonGroup group*/) {
- ButtonItem button = new ButtonItem(actionId, key, myResource.getResource(key));
+ private void addButton(String actionId/*, ButtonGroup group*/) {
+ ButtonItem button = new ButtonItem(actionId, myResource.getResource(actionId));
myItems.add(button);
//button.setButtonGroup(group);
}
@@ -355,23 +349,21 @@ public abstract class ZLApplication {
}
public final class ButtonItem implements Item {
- private final int myActionId;
- private final String myIconName;
+ private final String myActionId;
private final ZLResource myTooltip;
//private ButtonGroup myButtonGroup;
- public ButtonItem(int actionId, String iconName, ZLResource tooltip) {
+ public ButtonItem(String actionId, ZLResource tooltip) {
myActionId = actionId;
- myIconName = iconName;
myTooltip = tooltip;
}
- public int getActionId() {
+ public String getActionId() {
return myActionId;
}
public String getIconName() {
- return myIconName;
+ return myActionId;
}
public String getTooltip() {
@@ -460,8 +452,8 @@ public abstract class ZLApplication {
return myResource;
}
- void addItem(int actionId, String key) {
- myItems.add(new Menubar.PlainItem(myResource.getResource(key).getValue(), actionId));
+ void addItem(String actionId) {
+ myItems.add(new Menubar.PlainItem(myResource.getResource(actionId).getValue(), actionId));
}
void addSeparator() {
@@ -487,9 +479,9 @@ public abstract class ZLApplication {
public static final class Menubar extends Menu {
public static final class PlainItem implements Item {
private final String myName;
- private final int myActionId;
+ private final String myActionId;
- public PlainItem(String name, int actionId) {
+ public PlainItem(String name, String actionId) {
myName = name;
myActionId = actionId;
}
@@ -498,7 +490,7 @@ public abstract class ZLApplication {
return myName;
}
- public int getActionId() {
+ public String getActionId() {
return myActionId;
}
};
@@ -571,14 +563,9 @@ public abstract class ZLApplication {
myToolbar = new Toolbar();
}
if (BUTTON == tag) {
- String action = attributes.getValue("action");
- String key = attributes.getValue("key");
- if ((action != null) && (key != null)) {
- try {
- int actionId = Integer.parseInt(action);
- myToolbar.addButton(actionId, key);
- } catch (NumberFormatException exception) {
- }
+ String id = attributes.getValue("id");
+ if (id != null) {
+ myToolbar.addButton(id);
}
} else if (SEPARATOR == tag) {
myToolbar.addSeparator();
@@ -599,19 +586,14 @@ public abstract class ZLApplication {
final ArrayList stack = mySubmenuStack;
Menu menu = stack.isEmpty() ? myMenubar : (Menu)stack.get(stack.size() - 1);
if (ITEM == tag) {
- String action = attributes.getValue("action");
- String key = attributes.getValue("key");
- if ((action != null) && (key != null)) {
- try {
- int actionId = Integer.parseInt(action);
- menu.addItem(actionId, key);
- } catch (NumberFormatException exception) {
- }
+ String id = attributes.getValue("id");
+ if (id != null) {
+ menu.addItem(id);
}
} else if (SUBMENU == tag) {
- String key = attributes.getValue("key");
- if (key != null) {
- stack.add(menu.addSubmenu(key));
+ String id = attributes.getValue("id");
+ if (id != null) {
+ stack.add(menu.addSubmenu(id));
}
}
}
diff --git a/src/org/zlibrary/core/application/ZLApplicationWindow.java b/src/org/zlibrary/core/application/ZLApplicationWindow.java
index 77fc18a30..5aaf36bf9 100644
--- a/src/org/zlibrary/core/application/ZLApplicationWindow.java
+++ b/src/org/zlibrary/core/application/ZLApplicationWindow.java
@@ -97,10 +97,10 @@ abstract public class ZLApplicationWindow {
} else */
if (item instanceof ZLApplication.Toolbar.ButtonItem) {
ZLApplication.Toolbar.ButtonItem button = (ZLApplication.Toolbar.ButtonItem)item;
- int id = button.getActionId();
+ final String id = button.getActionId();
- boolean visible = getApplication().isActionVisible(id);
- boolean enabled = getApplication().isActionEnabled(id);
+ final boolean visible = getApplication().isActionVisible(id);
+ final boolean enabled = getApplication().isActionEnabled(id);
if (visible) {
if (lastSeparator != null) {
diff --git a/src/org/zlibrary/core/application/ZLKeyBindings.java b/src/org/zlibrary/core/application/ZLKeyBindings.java
index 8c3d7afbd..ea745f2bf 100644
--- a/src/org/zlibrary/core/application/ZLKeyBindings.java
+++ b/src/org/zlibrary/core/application/ZLKeyBindings.java
@@ -24,14 +24,13 @@ public final class ZLKeyBindings {
myIsChanged = false;
}
- public void bindKey(String key, int code) {
- myBindingsMap.put(key, code);
+ public void bindKey(String key, String actionId) {
+ myBindingsMap.put(key, actionId);
myIsChanged = true;
}
- public int getBinding(String key) {
- Integer num = (Integer)myBindingsMap.get(key);
- return (num == null) ? 0 : num.intValue();
+ public String getBinding(String key) {
+ return (String)myBindingsMap.get(key);
}
/*
@@ -45,15 +44,15 @@ public final class ZLKeyBindings {
new ZLIntegerRangeOption(ZLOption.CONFIG_CATEGORY, myName, BINDINGS_NUMBER, 0, 256, 0).getValue();
final ZLStringOption keyOption =
new ZLStringOption(ZLOption.CONFIG_CATEGORY, myName, "", "");
- final ZLIntegerOption actionOption =
- new ZLIntegerOption(ZLOption.CONFIG_CATEGORY, myName, "", -1);
+ final ZLStringOption actionOption =
+ new ZLStringOption(ZLOption.CONFIG_CATEGORY, myName, "", "");
for (int i = 0; i < size; ++i) {
keyOption.changeName(BINDED_KEY + i);
String keyValue = keyOption.getValue();
if (keyValue.length() != 0) {
- keyOption.changeName(BINDED_ACTION + i);
- int actionValue = actionOption.getValue();
- if (actionValue != -1) {
+ actionOption.changeName(BINDED_ACTION + i);
+ String actionValue = actionOption.getValue();
+ if (actionValue.length() != 0) {
bindKey(keyValue, actionValue);
}
}
diff --git a/src/org/zlibrary/core/application/ZLKeyBindingsReader.java b/src/org/zlibrary/core/application/ZLKeyBindingsReader.java
index ef3828fca..1a3828469 100644
--- a/src/org/zlibrary/core/application/ZLKeyBindingsReader.java
+++ b/src/org/zlibrary/core/application/ZLKeyBindingsReader.java
@@ -15,13 +15,9 @@ class ZLKeyBindingsReader extends ZLXMLReaderAdapter {
public void startElementHandler(String tag, ZLStringMap attributes) {
if ("binding".equals(tag)) {
String key = attributes.getValue("key");
- String action = attributes.getValue("action");
- if ((key != null) && (action != null)) {
- try {
- int actionId = Integer.parseInt(action);
- myKeymap.put(key, actionId);
- } catch (NumberFormatException e) {
- }
+ String actionId = attributes.getValue("action");
+ if ((key != null) && (actionId != null)) {
+ myKeymap.put(key, actionId);
}
}
}
diff --git a/src/org/zlibrary/ui/android/application/ZLAndroidApplicationWindow.java b/src/org/zlibrary/ui/android/application/ZLAndroidApplicationWindow.java
index 9589f4487..6db774682 100644
--- a/src/org/zlibrary/ui/android/application/ZLAndroidApplicationWindow.java
+++ b/src/org/zlibrary/ui/android/application/ZLAndroidApplicationWindow.java
@@ -62,7 +62,7 @@ public final class ZLAndroidApplicationWindow extends ZLApplicationWindow {
protected void refresh() {
super.refresh();
for (Map.Entry
entry : myMenuItemMap.entrySet()) {
- final int actionId = entry.getValue().getActionId();
+ final String actionId = entry.getValue().getActionId();
final ZLApplication application = getApplication();
entry.getKey().setShown(application.isActionVisible(actionId) && application.isActionEnabled(actionId));
}