private void startComponents() { this.cmdBack = new Command("Back", Command.BACK, 0); this.addCommand(this.cmdBack); this.cmdCreate = new Command("Create", Command.ITEM, 1); this.addCommand(this.cmdCreate); this.cmdEdit = new Command("Edit", Command.ITEM, 2); this.addCommand(this.cmdEdit); this.cmdDelete = new Command("Delete", Command.ITEM, 3); this.addCommand(this.cmdDelete); this.setCommandListener(this); }
public boolean preferredCommandType(Command cmd) { for (Enumeration ct = commandTypes.elements(); ct.hasMoreElements();) { if (cmd.getCommandType() == ((Integer) ct.nextElement()).intValue()) { return true; } } return false; }
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(); } }
break; if (commandToSort.getPriority() < ((Command) commandsTable.elementAt(i)).getPriority()) { for (int j = commandsTable.size() - 1; j > i; j--) { if (commandsTable.elementAt(j - 1) != null) { menuList.append(((Command) commandsTable.elementAt(i)).getLabel(), null);
private void startComponents() { this.cmdBack = new Command("Back", Command.BACK, 0); this.addCommand(this.cmdBack); this.cmdCreate = new Command("Create", Command.ITEM, 1); this.addCommand(this.cmdCreate); this.cmdEdit = new Command("Edit", Command.ITEM, 2); this.addCommand(this.cmdEdit); this.cmdDelete = new Command("Delete", Command.ITEM, 3); this.addCommand(this.cmdDelete); this.setCommandListener(this); }
public boolean preferredCommandType(Command cmd) { for (Enumeration ct = commandTypes.elements(); ct.hasMoreElements();) { if (cmd.getCommandType() == ((Integer) ct.nextElement()).intValue()) { return true; } } return false; }
private void startComponents() { this.cmdBack = new Command("Back", Command.BACK, 0); this.addCommand(this.cmdBack); this.cmdCreate = new Command("Create", Command.ITEM, 1); this.addCommand(this.cmdCreate); this.cmdEdit = new Command("Edit", Command.ITEM, 2); this.addCommand(this.cmdEdit); this.cmdDelete = new Command("Delete", Command.ITEM, 3); this.addCommand(this.cmdDelete); this.setCommandListener(this); }
private void startComponents() { this.cmdBack = new Command("Back", Command.BACK, 0); this.addCommand(this.cmdBack); this.cmdCreate = new Command("Create", Command.ITEM, 1); this.addCommand(this.cmdCreate); this.cmdEdit = new Command("Edit", Command.ITEM, 2); this.addCommand(this.cmdEdit); this.cmdDelete = new Command("Delete", Command.ITEM, 3); this.addCommand(this.cmdDelete); this.cmdSearch = new Command("Search", Command.ITEM, 4); this.addCommand(this.cmdSearch); this.setCommandListener(this); }
private void startComponents() { this.cmdBack = new Command("Back", Command.BACK, 0); this.addCommand(this.cmdBack); this.setCommandListener(this); }
private void startComponents() { this.txtSearch = new TextField("Name", null, 20, TextField.ANY); this.append(this.txtSearch); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
private void startComponents() { this.txtFormation = new TextField("Formation", formation.getFormation(), 30, TextField.ANY); this.append(this.txtFormation); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
private void startComponents() { this.txtBedNumber = new TextField("Bed number", String.valueOf(bed.getNumber()), 3, TextField.NUMERIC); this.append(this.txtBedNumber); this.txtBedFloor = new TextField("Bed floor", String.valueOf(bed.getFloor()), 15, TextField.NUMERIC); this.append(this.txtBedFloor); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
private void startComponents() { this.dtEnter = new DateField("Enter date", DateField.DATE); this.dtEnter.setDate(new Date()); this.append(this.dtEnter); this.txtReason = new TextField("Reason", internment.getReason(), 100, TextField.ANY); this.append(this.txtReason); this.cgPatients = new ChoiceGroup("Patient", ChoiceGroup.EXCLUSIVE); this.append(cgPatients); this.cgDoctors = new ChoiceGroup("Doctor", ChoiceGroup.EXCLUSIVE); this.append(cgDoctors); this.cgBeds = new ChoiceGroup("Beds", ChoiceGroup.EXCLUSIVE); this.append(cgBeds); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
private void startComponents() { this.txtName = new TextField("Name", doctor.getName(), 30, TextField.ANY); this.append(this.txtName); this.txtPassport = new TextField("Passport", doctor.getPassport(), 30, TextField.ANY); this.append(this.txtPassport); this.dtBornDate = new DateField("Born date", DateField.DATE); this.dtBornDate.setDate(doctor.getBornDate()); this.append(this.dtBornDate); this.txtCRM = new TextField("CRM", doctor.getCrm(), 30, TextField.ANY); this.append(this.txtCRM); this.cgFormation = new ChoiceGroup("Formation", ChoiceGroup.MULTIPLE); this.append(cgFormation); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
/** * DOCUMENT ME! */ protected void startComponents() { this.append("Formations", null); this.append("Beds", null); this.append("Doctors", null); this.append("Patients", null); this.append("-----", null); this.append("Add internment", null); this.append("Leave patient", null); this.append("-----", null); this.append("Free beds report", null); this.cmdExit = new Command("Exit", Command.ITEM, 3); this.addCommand(this.cmdExit); this.setCommandListener(this); } }
cmd_exit = new Command("Exit", Command.EXIT, 0); aForm.addCommand(cmd_exit); aForm.setCommandListener(this);