Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.MenuItem


                            (UnifiedSearchDemoEntity) element;
                    final UiAction action = item.getUiActions(null, null);

                    if (action != null) {
                        // Add the appropriate UiAction to the context menu
                        final MenuItem performActionItem =
                                new MenuItem(new StringProvider(action
                                        .toString()), 0x230010, 0);
                        performActionItem.setCommand(new Command(
                                new CommandHandler() {
                                    /**
                                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                                     *      Object)
                                     */
 
View Full Code Here


            _status = new EditField(Field.NON_FOCUSABLE);
            add(_status);

            // Sends an SMS message
            final MenuItem sendMenuItem =
                    new MenuItem(new StringProvider("Send"), 0x230010, 0);
            sendMenuItem.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

                new RichTextField(
                        "Select 'Go' from the menu to perform the test.");
        screen.add(_statusField);

        // Add the menu item
        final MenuItem go = new MenuItem(new StringProvider("Go"), 0x230010, 0);
        go.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

        setTitle("Core GPS Diagnostic Test");
        initFields();
        _isVerizonField.setChangeListener(this);

        // A MenuItem to start the diagnostic test
        final MenuItem startTestItem =
                new MenuItem(new StringProvider("Start Test"), 0x300010, 0);
        startTestItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Format the UI for output
                showOutputFields();

                if (_locThread != null) {
                    if (!_locThread.isStopped()) {
                        _locThread.stop();
                    }
                }

                _log.setText("");
                log("Core GPS API test starting");
                log("Device: " + DeviceInfo.getDeviceName());
                log("Device Software: " + DeviceInfo.getSoftwareVersion());
                log("Carrier: " + RadioInfo.getCurrentNetworkName());

                // Begin test
                _locThread = new LocationThread();
                _locThread.start();
            }
        }));
        addMenuItem(startTestItem);

        _stopTestItem =
                new MenuItem(new StringProvider("Stop Test"), 0x300020, 1);
        _stopTestItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Stop the thread
                log("Stopping test");
                _locThread.stop();
                _locThread = null;
            }
        }));
        addMenuItem(_stopTestItem);

        // A MenuItem to display the help dialog
        final MenuItem helpItem =
                new MenuItem(new StringProvider("Help"), 0x300030, 2);
        helpItem.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

        /*
         * Menu item for invoking the camera application. This provides a
         * 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

    protected void makeMenu(final Menu menu, final int context) {
        final LocalCommandRegistrarConnection connection =
                new LocalCommandRegistrarConnection();

        // Add a MenuItem for the PopupDialogCommand to the menu
        final MenuItem menuItem =
                new MenuItem(new StringProvider("Popup Dialog"), 0x230010, 0);
        menuItem.setCommand(connection.getCommand(new CommandRequest(
                "PopupDialogCommand")));
        menu.add(menuItem);

        super.makeMenu(menu, context);
    }
View Full Code Here

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

        setTitle("Extended GPS Diagnostic Test");
        initFields();
        _isVerizonField.setChangeListener(this);

        // A MenuItem to start the diagnostic test
        final MenuItem startTestItem =
                new MenuItem(new StringProvider("Start Test"), 0x300010, 0);
        ;
        startTestItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Format the UI for output
                showOutputFields();

                // Begin test
                if (_locThread != null) {
                    if (!_locThread.isStopped()) {
                        _locThread.stop();
                    }
                }

                _log.setText("");
                log("Extended GPS API test starting");
                log("Device: " + DeviceInfo.getDeviceName());
                log("Device Software: " + DeviceInfo.getSoftwareVersion());
                log("Carrier: " + RadioInfo.getCurrentNetworkName());

                _locThread = new LocationThread();
                _locThread.start();
            }
        }));
        addMenuItem(startTestItem);
        _stopTestItem =
                new MenuItem(new StringProvider("Stop Test"), 0x300020, 1);
        _stopTestItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Stop the thread
                log("Stopping test");
                _locThread.stop();
                _locThread = null;
            }
        }));
        addMenuItem(_stopTestItem);

        // A MenuItem to display the help dialog
        final MenuItem helpItem =
                new MenuItem(new StringProvider("Help"), 0x300030, 2);
        helpItem.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 LabelField();
        add(_statusField);

        // This menu item provides an alternative to clicking the send button
        final MenuItem sendItem =
                new MenuItem(new StringProvider("Send"), 0x230010, 0);
        sendItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                handleSend();
            }
        }));

        // This menu item provides an alternative to clicking the clear button
        final MenuItem clearItem =
                new MenuItem(new StringProvider("Clear"), 0x230020, 0);
        clearItem.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

        // Store the UiApplication for use in refreshing the message list field
        _uiApplication = UiApplication.getUiApplication();

        _changeViewMenuItem =
                new MenuItem(new StringProvider("Folders View"), 0x230020, 1);
        _changeViewMenuItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                _currentDisplayMode = FOLDERS_VIEW_MODE;

                final Folder currentFolder =
                        ((Message) getSelectedItem()).getFolder();

                final FoldersViewScreen foldersViewScreen =
                        new FoldersViewScreen(currentFolder);
                UiApplication.getUiApplication().pushScreen(foldersViewScreen);
            }
        }));

        _deleteMenuItem =
                new MenuItem(new StringProvider("Delete Message"), 0x230010, 0);
        _deleteMenuItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.MenuItem

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.