public CommandUI createCommandUI(Command command) { return new CommandImplUI(command); }
public void showNotify() { updateCommands(); }
private void updateCommands() { CommandManager.getInstance().updateCommands(getCommandsUI()); MIDletAccess ma = MIDletBridge.getMIDletAccess(); if (ma == null) { return; } DisplayAccess da = ma.getDisplayAccess(); if (da == null) { return; } da.repaint(); }
CommandManager.getInstance().commandAction(cmd); } else { da.commandAction(cmd, da.getCurrent());
public void updateCommands(Vector commands) lateInit(); fillPossibleCommands(buttons, commandsTable); return; fillPossibleCommands(buttons, commandsTable); while (menuList.size() > 0) { menuList.delete(0);
public void commandAction(Command command) { if (menuList == null) { lateInit(); } previous = MIDletBridge.getMIDletAccess().getDisplayAccess().getCurrent(); MIDletBridge.getMIDletAccess().getDisplayAccess().setCurrent(menuList); }
if (cmd != null) { if (cmd.equals(CommandManager.CMD_MENU)) { CommandManager.getInstance().commandAction(cmd); } else { da.commandAction(cmd, d);
public void removeCommandUI(CommandUI cmd) { commands.removeElement(cmd); if (displayable.isShown()) { updateCommands(); } }
CommandManager.getInstance().commandAction(cmd); } else { da.commandAction(cmd, da.getCurrent());
public void addCommandUI(CommandUI cmd) { // Check that its not the same command for (int i = 0; i < commands.size(); i++) { if (cmd == (CommandUI) commands.elementAt(i)) { // Its the same just return return; } } // Now insert it in order boolean inserted = false; for (int i = 0; i < commands.size(); i++) { if (cmd.getCommand().getPriority() < ((CommandUI) commands.elementAt(i)).getCommand().getPriority()) { commands.insertElementAt(cmd, i); inserted = true; break; } } if (inserted == false) { // Not inserted just place it at the end commands.addElement(cmd); } if (displayable.isShown()) { updateCommands(); } }