_uiApp = (PersistentStoreDemo) UiApplication.getUiApplication();
_screen = this;
// Initialize UI components
_nameField =
new EditField("Meeting Name: ", _meeting
.getField(Meeting.MEETING_NAME));
_descField =
new EditField("Description: ", _meeting.getField(Meeting.DESC));
_dateField = new EditField("Date: ", _meeting.getField(Meeting.DATE));
_timeField = new EditField("Time: ", _meeting.getField(Meeting.TIME));
_notesField =
new EditField("Notes: ", _meeting.getField(Meeting.NOTES));
add(_nameField);
add(_descField);
add(_dateField);
add(_timeField);
add(_notesField);
// Menu item to save the displayed meeting
final MenuItem saveItem =
new MenuItem(new StringProvider("Save"), 0x230020, 11);
saveItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
if (onSave()) {
close();
}
}
}));
// Menu item to add an attendee to meeting
final MenuItem addAttendeeItem =
new MenuItem(new StringProvider("Add Attendee"), 0x230010, 10);
addAttendeeItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
final VerticalFieldManager vfm = new VerticalFieldManager();
_popUp = new PopupScreen(vfm);
_addAttendeeField = new EditField("Enter Name: ", "");
_popUp.add(_addAttendeeField);
final HorizontalFieldManager hfm =
new HorizontalFieldManager(Field.FIELD_HCENTER);
hfm.add(new AddButton());
hfm.add(new CancelButton());