POS - Using shortkeys in menu items
Code snippetName: POS - Using shortkeys in menu items
|
This code snippet is intented to use shortkeys in the Openbravo POS left menu items. For example, Sales, Edit sales, Customers, Payments, Close cash, Cash closed, Customers, Stock...
This code has been copied from this forum thread.
Go to the constructor of 'MenuPanelAction (com.openbravo.pos.forms) class.
Check the content of the keytext parameter and add mnemonic.
In this example pressing Alt+E keys you will view the Edit sales panel.
//View Edit sales panel if (keytext.equals("Menu.TicketEdit")) { putValue(Action.MNEMONIC_KEY, KeyEvent.VK_E); }
All the together looks like:
public MenuPanelAction(AppView app, String icon, String keytext, String sMyView) { putValue(Action.SMALL_ICON, new ImageIcon(JPrincipalApp.class.getResource(icon))); putValue(Action.NAME, AppLocal.getIntString(keytext)); //View Edit sales panel if (keytext.equals("Menu.TicketEdit")) { putValue(Action.MNEMONIC_KEY, KeyEvent.VK_E); } putValue(AppUserView.ACTION_TASKNAME, sMyView); m_App = app; m_sMyView = sMyView; }