for (int i = 0; i < _pictureFileNames.size(); i++) {
_picturesList.add((String) _pictureFileNames.elementAt(i));
}
_picturesList.setCommand(new Command(new CommandHandler() {
/**
* @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
setImage();
}
}));
add(vfm);
final SeparatorField separator = new SeparatorField();
separator.setPadding(50, 0, 0, 0);
add(separator);
add(new LabelField("Add shortcut to the home screen",
Field.FIELD_HCENTER));
add(new SeparatorField());
_homeScreenLocationPicker = HomeScreenLocationPicker.create();
add(_homeScreenLocationPicker);
// Create a button to add a shortcut to this screen on the home screen
_shortcutButton =
new ButtonField("Add shortcut", Field.FIELD_HCENTER
| ButtonField.CONSUME_CLICK);
_shortcutButton.setChangeListener(new FieldChangeListener() {
public void fieldChanged(final Field field, final int context) {
addShortcut();
}
});
add(_shortcutButton);
_setHomeScreenImage =
new MenuItem(new StringProvider("Set as Home Screen Image"),
0x230010, 0);
_setHomeScreenImage.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
setImage();
}
}));
_addHomeScreenShortCut =
new MenuItem(new StringProvider("Add Shortcut"), 0x230020, 1);
_addHomeScreenShortCut.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,