Package net.rim.device.api.ui.container

Examples of net.rim.device.api.ui.container.VerticalFieldManager


      } else{
        statusField.setText("Last known location not available! Please acquire a single location or a tracking session first.");
      }
    } else if(field==satellitesField){
      if(location!=null){
        final PopupScreen satPopup = new PopupScreen(new VerticalFieldManager()){

          protected boolean keyDown(int keycode, int time) {
            int key = Keypad.key(keycode);
            if(key==Keypad.KEY_ESCAPE){
              Screen screen = getScreen();                                     
View Full Code Here


    /**
     * Creates a new TransitionScreen object
     */
    public TransitionScreen(final String title, final int color) {
        setTitle(title);
        final VerticalFieldManager manager =
                (VerticalFieldManager) getMainManager();
        manager.setBackground(BackgroundFactory.createSolidBackground(color));
    }
View Full Code Here

                new BasicEditField("Destination: ", "", 500,
                        TextField.NO_NEWLINE);
        add(_addressField);

        // Start/end time selection
        final VerticalFieldManager vfm = new VerticalFieldManager();
        _choiceField =
                new ObjectChoiceField("When:", new Object[] { "Depart Now",
                        "Depart At", "Arrive At" }, 0);
        _choiceField.setChangeListener(new FieldChangeListener() {
            /**
             * @see net.rim.device.api.ui.FieldChangeListener#fieldChanged(Field,
             *      int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (context == ChoiceField.CONTEXT_CHANGE_OPTION) {
                    final int idx = _choiceField.getSelectedIndex();
                    if (idx == DEPART_NOW) {
                        _dateField.setEnabled(false);
                    } else {
                        _dateField.setEnabled(true);
                        _dateField.setFocus();
                    }
                }
            }
        });
        vfm.add(_choiceField);

        final DateFormat dateFormat =
                DateFormat.getInstance(DateFormat.DATETIME_DEFAULT);
        _dateField = new DateField("", System.currentTimeMillis(), dateFormat);
        _dateField.setEnabled(false);
        vfm.add(_dateField);

        add(vfm);

        // Initialize a button for intitiating a travel time query
        final HorizontalFieldManager hfm =
View Full Code Here

                    new LabelField("", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH);
            _addressBar2 =
                    new LabelField("", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH);

            // Add the address label fields to the screen's status section.
            final VerticalFieldManager statusVFM = new VerticalFieldManager();
            statusVFM.add(_addressBar1);
            statusVFM.add(_addressBar2);
            setStatus(statusVFM);

            createMenuItems();

        } catch (final IOException e) {
View Full Code Here

     */
    public SpinnerDemoScreen() {
        setTitle("Spinner Demo");

        // Initialize a VerticalFieldManager
        final VerticalFieldManager fieldManager = new VerticalFieldManager();

        final Background background =
                BackgroundFactory.createSolidBackground(Color.LIGHTBLUE);

        final LabelField dateLabel =
                new LabelField("Date Field", Field.FIELD_HCENTER);
        dateLabel.setBackground(background);
        fieldManager.add(dateLabel);

        // Add a typical date field to the VerticalFieldManager
        _dateField =
                new DateField("Date/time: ", System.currentTimeMillis(),
                        DateField.DATE_TIME);
        fieldManager.add(_dateField);

        fieldManager.add(new SeparatorField());

        // Add UI elements to the VerticalFieldManager, including fields
        // which will allow a user to make selections from date/time and
        // custom spinners.
        final LabelField dateTimeLabel =
                new LabelField("Date Time Picker", Field.FIELD_HCENTER);
        dateTimeLabel.setBackground(background);
        fieldManager.add(dateTimeLabel);

        _editFieldDefault = new SelectionField("Default: ");
        fieldManager.add(_editFieldDefault);

        _editFieldDate = new SelectionField("Date only: ");
        fieldManager.add(_editFieldDate);

        _editFieldTime = new SelectionField("Time only: ");
        fieldManager.add(_editFieldTime);

        _editFieldLong = new SelectionField("Long date: ");
        fieldManager.add(_editFieldLong);

        _editFieldExpiry = new SelectionField("Expiry date: ");
        fieldManager.add(_editFieldExpiry);

        fieldManager.add(new SeparatorField());

        final LabelField textSpinLabel =
                new LabelField("Text Spin Box Field", Field.FIELD_HCENTER);
        textSpinLabel.setBackground(background);
        fieldManager.add(textSpinLabel);

        _editFieldSpinbox = new SelectionField("City: ");
        fieldManager.add(_editFieldSpinbox);

        // Add the VerticalFieldManager to the screen
        add(fieldManager);
    }
View Full Code Here

        _bitmapField = new DemoBitmapField(bitmap, FIELD_HCENTER);

        // Center BitmapField using managers
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(USE_ALL_HEIGHT);
        final VerticalFieldManager vfm =
                new VerticalFieldManager(USE_ALL_WIDTH | FIELD_VCENTER);
        vfm.add(_bitmapField);
        hfm.add(vfm);
        add(hfm);

        // Enable pinch
        final InputSettings inputSettings =
View Full Code Here

        spinBoxManager.add(spinBoxFieldGreen);
        spinBoxManager.add(spinBoxFieldBlue);
        spinBoxManager.setVisibleRows(3);
        spinBoxManager.setRowHeight(ROW_HEIGHT);

        final VerticalFieldManager vfm =
                new VerticalFieldManager(Field.FIELD_HCENTER);
        vfm.setBackground(BackgroundFactory.createSolidBackground(Color.BLACK));
        vfm.add(spinBoxManager);
        add(vfm);

        add(new SeparatorField());

        add(colorBox);
View Full Code Here

     * Adds UI components to a VerticalFieldManager
     *
     * @return Manager containing UI components
     */
    private Manager createStructuredManager() {
        final VerticalFieldManager manager = new VerticalFieldManager();

        _addressEditField = new BasicEditField("Address: ", "");
        manager.add(_addressEditField);

        _cityEditField = new BasicEditField("City: ", "");
        manager.add(_cityEditField);

        _districtEditField = new BasicEditField("Province: ", "");
        manager.add(_districtEditField);

        _countryEditField = new BasicEditField("Country: ", "");
        manager.add(_countryEditField);

        _zipEditField = new BasicEditField("Postal Code: ", "");
        manager.add(_zipEditField);

        return manager;
    }
View Full Code Here

        /**
         * Creates a new CustomSpinnerPopup object
         */
        public CustomSpinnerPopup() {
            super(new VerticalFieldManager(), Screen.DEFAULT_CLOSE);
            final String[] choices =
                    { "New York", "Paris", "Barcelona", "Beijing", "Moscow",
                            "Brasilia", "Melbourne" };
            _spinBoxField = new TextSpinBoxField(choices);
            _spinBoxField.setVisibleRows(3);
View Full Code Here

            // Instantiate the model for the pane manager and enable looping
            final PaneManagerModel model = new PaneManagerModel();
            model.enableLooping(true);

            // Create a pane
            VerticalFieldManager vfm = new VerticalFieldManager();
            vfm.add(new LabelField("Data 1"));
            final XYEdges edgesOne = new XYEdges(1, 1, 1, 1);
            vfm.setBorder(BorderFactory.createRoundedBorder(edgesOne));
            final Pane pane =
                    new Pane(new LabelField("Pane 1", Field.FOCUSABLE
                            | Field.FIELD_HCENTER), vfm);

            // Add the pane to the model
            model.addPane(pane);

            // Create a second pane
            vfm = new VerticalFieldManager();
            for (int i = 0; i < 30; i++) {
                vfm.add(new LabelField("Data " + i, Field.FOCUSABLE));
            }
            final LabelField iconTextLabelField =
                    new LabelField("Pane 2", Field.FOCUSABLE
                            | Field.FIELD_HCENTER);
            model.addPane(new Pane(iconTextLabelField, vfm));

            // Create a third pane
            vfm = new VerticalFieldManager();
            final ButtonField button =
                    new ButtonField("Button", ButtonField.CONSUME_CLICK
                            | ButtonField.NEVER_DIRTY);
            button.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(final Field field, final int context) {
                    Dialog.inform("Button activated.");
                }
            });
            vfm.add(button);
            model.addPane(new Pane(new LabelField("Pane 3", Field.FOCUSABLE
                    | Field.FIELD_HCENTER), vfm));

            // Choose which pane the model is displaying
            model.setCurrentlySelectedIndex(1);
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.container.VerticalFieldManager

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.