Package net.rim.device.api.ui.component

Examples of net.rim.device.api.ui.component.ButtonField


        screen.setTitle("GPS Advanced Demo");
        final LabelField apiChoiceMessage =
                new LabelField("Please select an API to test:",
                        Field.USE_ALL_WIDTH | Field.FIELD_HCENTER);
        _coreTestButton =
                new ButtonField("Core GPS API Test", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _extendedTestButton =
                new ButtonField("Extended GPS API Test",
                        ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
        _coreTestButton.setChangeListener(this);
        _extendedTestButton.setChangeListener(this);

        screen.add(apiChoiceMessage);
View Full Code Here


        emailField2.setCommandItemProvider(itemProvider);

        add(new SeparatorField());

        // Create ButtonField with command context
        final ButtonField buttonField =
                new ButtonField("Test Button", ButtonField.CONSUME_CLICK
                        | Field.FIELD_HCENTER);
        buttonField.setCommandContext(new Object() {
            public String toString() {
                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

        WireFrameLayoutDemoScreen() {
            setTitle("Wire Frame Layout Demo");

            // Instantiate buttons
            _basicScrollingButton =
                    new ButtonField("Basic Scrolling Screen",
                            ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
            _invertedScrollingButton =
                    new ButtonField("Inverted Scrolling Screen",
                            ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
            _searchButton =
                    new ButtonField("Search Screen", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);
            _horizontalVerticalCenteredButton =
                    new ButtonField("Horizontal Vertical Centered Screen",
                            ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
            _gridFieldButton =
                    new ButtonField("Grid Field Screen",
                            ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
            _mediaHubButton =
                    new ButtonField("Media Hub Screen", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);

            // Make this class a change listener for the buttons
            _basicScrollingButton.setChangeListener(this);
            _invertedScrollingButton.setChangeListener(this);
View Full Code Here

        verticalManager.add(_messageField);
        add(verticalManager);

        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(Field.FIELD_HCENTER);
        _sendButton = new ButtonField("Send", ButtonField.CONSUME_CLICK);
        _sendButton.setChangeListener(this);
        _clearButton = new ButtonField("Clear", ButtonField.CONSUME_CLICK);
        _clearButton.setChangeListener(this);
        hfm.add(_sendButton);
        hfm.add(_clearButton);
        add(hfm);
View Full Code Here

        add(_customSpanField);

        if (VirtualKeyboard.isSupported()) {
            // Create a button to toggle the visibility of the virtual keyboard
            _keyboardButton =
                    new ButtonField("Toggle Keyboard",
                            ButtonField.CONSUME_CLICK);
            _keyboardButton.setChangeListener(this);
            add(_keyboardButton);
        }
View Full Code Here

            final int canvasX = (displayWidth - (VIDEO_WIDTH + MARGIN)) / 2;
            final int canvasY = (displayHeight - (VIDEO_HEIGHT + MARGIN)) / 2;
            absoluteFieldManager.add(componentCanvas, canvasX, canvasY);

            // Button for pausing the video
            final ButtonField pauseButton =
                    new ButtonField("Pause", ButtonField.CONSUME_CLICK
                            | ButtonField.NEVER_DIRTY);
            pauseButton.setCommand(new Command(new CommandHandler() {
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object object) {
                    // Pause the video
                    try {
                        _player.stop();
                    } catch (final Exception e) {
                        NWMDemo.errorDialog(e.toString());
                    }
                }
            }));

            final Image pauseImage =
                    ImageFactory.createImage(Bitmap
                            .getBitmapResource("pause.png"));
            pauseButton.setImage(pauseImage);
            componentCanvas.add(pauseButton, 0, VIDEO_HEIGHT - 15);

            // Button to start/re-start the video
            final ButtonField playButton =
                    new ButtonField("Play", ButtonField.CONSUME_CLICK
                            | ButtonField.NEVER_DIRTY);
            playButton.setCommand(new Command(new CommandHandler() {
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object object) {
                    // Start the video
                    try {
                        _player.start();
                    } catch (final Exception e) {
                        NWMDemo.errorDialog(e.toString());
                    }
                }
            }));

            final Image playImage =
                    ImageFactory.createImage(Bitmap
                            .getBitmapResource("play.png"));
            playButton.setImage(playImage);
            componentCanvas
                    .add(playButton, VIDEO_WIDTH - 80, VIDEO_HEIGHT - 15);
        }
    }
View Full Code Here

        add(vfm);

        // Initialize a button for intitiating a travel time query
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(Field.FIELD_HCENTER);
        final ButtonField travelButton =
                new ButtonField("Get Travel Time", ButtonField.CONSUME_CLICK
                        | ButtonField.NEVER_DIRTY);
        hfm.add(travelButton);
        add(hfm);
        travelButton.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(final Field field, final int context) {
                findTravelTime();
            }
        });
View Full Code Here

                new LabelField("Open the menu to begin creating touch events.");
        add(_helpText);

        // Initialize button field
        _sampleButton =
                new ButtonField("Sample Button", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        add(_sampleButton);
        _sampleButton.setChangeListener(_listener);

        // Initialize output label field
View Full Code Here

                            "OpenGL ES 2.0" }, 1, Field.FIELD_HCENTER);
            vfm.add(_glVersionField);
        }

        // Initialize "Controls" button
        _controlsButton = new ButtonField("Controls", Field.FIELD_HCENTER);
        _controlsButton.setChangeListener(this);

        // Initialize "Start" button
        _startButton = new ButtonField("Start", Field.FIELD_HCENTER);
        _startButton.setChangeListener(this);

        // Add buttons
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(Field.FIELD_HCENTER);
View Full Code Here

                        BasicEditField.FILTER_URL);
        add(_urlEditField);

        // Display "Connect" button that triggers connection to be established
        // with the specified URL.
        final ButtonField connectBtn =
                new ButtonField("Connect", Field.FIELD_HCENTER
                        | ButtonField.CONSUME_CLICK);
        connectBtn.setChangeListener(this);

        // Display "Show Options" button that displays connection options when
        // clicked
        _optionsBtn =
                new ButtonField("Show Options", Field.FIELD_HCENTER
                        | ButtonField.CONSUME_CLICK);
        _optionsBtn.setChangeListener(this);
        _optionsHidden = true;

        add(new SeparatorField());
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.component.ButtonField

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.