Package net.rim.device.api.command

Examples of net.rim.device.api.command.CommandHandler


            /**
             * Creates a TreeScreenMenuItem object
             */
            public TreeScreenMenuItem() {
                super(new StringProvider("Tree Screen"), 0x230040, 3);
                this.setCommand(new Command(new CommandHandler() {
                    /**
                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                     *      Object)
                     */
                    public void execute(final ReadOnlyCommandMetadata metadata,
View Full Code Here


            /**
             * Create a TableAdapterScreenMenuItem object
             */
            public TableAdapterScreenMenuItem() {
                super(new StringProvider("Table Adapter Screen"), 0x230050, 4);
                this.setCommand(new Command(new CommandHandler() {
                    /**
                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                     *      Object)
                     */
                    public void execute(final ReadOnlyCommandMetadata metadata,
View Full Code Here

        _model = new TableModel();

        _view = new TableView(_model);
        final TableController controller = new TableController(_model, _view);
        controller.setFocusPolicy(TableController.ROW_FOCUS);
        controller.setCommand(new Command(new CommandHandler() {
            /**
             * @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
View Full Code Here

         * convenient method of adding a file to the device file system in order
         * to demonstrate the FileSystemJournalListener.
         */
        final MenuItem cameraItem =
                new MenuItem(new StringProvider("Camera"), 0x230010, 0);
        cameraItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,
                        new CameraArguments());
            }
        }));

        // Menu item for deleting the selected file
        final MenuItem deleteItem =
                new MenuItem(new StringProvider("Delete"), 0x230020, 1);
        deleteItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                deleteAction();
            }
        }));

        // Menu item for displaying information on the selected file
        final MenuItem selectItem =
                new MenuItem(new StringProvider("Select"), 0x230030, 2);
        selectItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                selectAction();
            }
        }));

        // Menu item for going back one directory in the directory hierarchy
        final MenuItem backItem =
                new MenuItem(new StringProvider("Go Back"), 0x230040, 3);
        backItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
View Full Code Here

         */
        SaveMenuItem(final String text, final byte[] raw) {
            super(new StringProvider(text), 0x230010, 0);

            _raw = raw;
            setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
View Full Code Here

                return "My Context Object";
            }
        });

        // Set command to be invoked by the ButtonField
        buttonField.setCommand(new Command(new CommandHandler() {
            /**
             * @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
View Full Code Here

        /**
         * Creates a new AddContactAction object
         */
        private AddContactAction() {
            super(new StringProvider("Add"), 0x230000, 10);
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * Adds a contact to the contact list
                 *
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

         *            The index of the contact from the contact list to view
         */
        private ViewContactAction(final int index) {
            super(new StringProvider("View"), 0x230020, 5);
            _index = index;
            this.setCommand(new Command(new CommandHandler() {

                /**
                 * Displays the contact information.
                 *
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
View Full Code Here

        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,
View Full Code Here

         *            The index of the contact in the contact list to edit
         */
        private EditContactAction(final int index) {
            super(new StringProvider("Edit"), 0x230030, 6);
            _index = index;
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * Edits the contact
                 *
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

TOP

Related Classes of net.rim.device.api.command.CommandHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.