Package net.rim.device.api.command

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


            }

            // Create a menu item to save the new call
            final MenuItem saveItem =
                    new MenuItem(new StringProvider("Save"), 0x230010, 100);
            saveItem.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


        for (int i = 0; i < numFields; ++i) {
            add((Field) fields.elementAt(i));
        }

        _editItem = new MenuItem(new StringProvider("Edit"), 0x230010, 0);
        _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) {
                /* outer. */makeEditScreen();
            }
        }));

        _saveItem = new MenuItem(new StringProvider("Save"), 0x230010, 0);
        _saveItem.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 menu item to save the new call
            final MenuItem saveItem =
                    new MenuItem(new StringProvider("Save"), 0x230010, 100);
            saveItem.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

            for (int i = 0; i < _pictureDirectoryURLs.size(); i++) {
                _list.add((String) _pictureDirectoryURLs.elementAt(i));
            }

            // Set the list to display when a list item is activated
            _list.setCommand(new Command(new CommandHandler() {
                /**
                 * @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
View Full Code Here

        // Closes the screen
        final MenuItem closeSP =
                new MenuItem(new StringProvider("Close serial port"), 0x230010,
                        0);
        closeSP.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                close();
            }
        }));

        // Displays the DTR line's state
        final MenuItem dtr =
                new MenuItem(new StringProvider("Get DTR"), 0x230020, 1);
        dtr.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                try {
                    Status.show("DTR: " + _port.getDtr());
                } catch (final IOException ioex) {
                    Status.show("");
                    BluetoothDemo
                            .errorDialog("BluetoothSerialPort#getDtr() threw "
                                    + ioex.toString());
                }
            }
        }));

        // Turns DSR on
        final MenuItem dsrOn =
                new MenuItem(new StringProvider("DSR on"), 0x230030, 2);
        dsrOn.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                Status.show("DSR on");
                try {
                    _port.setDsr(true);
                } catch (final IOException ioex) {
                    Status.show("");
                    BluetoothDemo
                            .errorDialog("BluetoothSerialPort#setDsr(boolean) threw "
                                    + ioex.toString());
                }
            }
        }));

        // Turns DSR off
        final MenuItem dsrOff =
                new MenuItem(new StringProvider("DSR off"), 0x230040, 3);
        dsrOff.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                Status.show("DSR off");
                try {
                    _port.setDsr(false);
                } catch (final IOException ioex) {
                    Status.show("");
                    BluetoothDemo
                            .errorDialog("BluetoothSerialPort#setDsr(boolean) threw "
                                    + ioex.toString());
                }
            }
        }));

        // Enables loop back
        final MenuItem enableLoopback =
                new MenuItem(new StringProvider("Enable loopback"), 0x230050, 4);
        enableLoopback.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                _loopback = true;
            }
        }));

        // Disables loop back
        final MenuItem disableLoopback =
                new MenuItem(new StringProvider("Disable loopback"), 0x230060,
                        5);
        disableLoopback.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                _loopback = false;
            }
        }));

        // Sends 1kb of information to the other device
        final MenuItem send1k =
                new MenuItem(new StringProvider("Send 1k"), 0x230070, 6);
        send1k.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

            if (HomeScreen.supportsIcons()) {
                final MenuItem setIconItem =
                        new MenuItem(
                                new StringProvider("Set Home Screen Icon"),
                                0x230010, 0);
                setIconItem.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 Bitmap bitmap =
                                Bitmap.getBitmapResource("img/logo_blue.jpg");
                        HomeScreen.updateIcon(bitmap);
                    }
                }));
                menu.add(setIconItem);

                final MenuItem setRolloverItem =
                        new MenuItem(new StringProvider("Set Rollover Icon"),
                                0x230020, 1);
                setRolloverItem.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

        _statusField = new RichTextField(Field.NON_FOCUSABLE);
        add(_statusField);

        final MenuItem infoScreen =
                new MenuItem(new StringProvider("Info Screen"), 0x230010, 1);
        infoScreen.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

        add(_view);

        final MenuItem connectToDevice =
                new MenuItem(new StringProvider("Connect to Device"), 0x230020,
                        0);
        connectToDevice.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 new AddParticipant object
             */
            public AddParticipant() {
                super(new StringProvider("Add Participant"), 0x230020, 110);
                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

             */
            public DeleteParticipant(final int index, final Field field) {
                super(new StringProvider("Delete Participant"), 0x230030, 110);
                _index = index;
                _field = field;
                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

TOP

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

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.