final PhoneCallTable tableRef = table;
if (tableRef.getNumberOfRows() > 0) {
final CallLog callLog = table.getSelectedItem();
// Create menu item to view the currently selected call
final MenuItem viewItem =
new MenuItem(new StringProvider("View"), 0x230010,
100);
viewItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(
final ReadOnlyCommandMetadata metadata,
final Object context) {
PhoneLogsDemo.this
.pushScreen(new ViewCallLogScreen(callLog,
tableRef.getSelectedIndex(),
tableRef.getModel()));
}
}));
menu.add(viewItem);
// Create menu item to edit the currently selected call
final MenuItem editItem =
new MenuItem(new StringProvider("Edit"), 0x230020,
110);
editItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(
final ReadOnlyCommandMetadata metadata,
final Object context) {
PhoneLogsDemo.this
.pushScreen(new EditCallLogScreen(callLog,
tableRef.getSelectedIndex(),
tableRef.getModel()));
}
}));
menu.add(editItem);
// Create menu item to delete the currently selected call
final MenuItem deleteItem =
new MenuItem(new StringProvider("Delete"),
0x230030, 120);
deleteItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(