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

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


  private int mStatusColor;

  public EnterKeyScreen() {
    setTitle(sResources.getString(ENTER_KEY_TITLE));
    VerticalFieldManager manager = new VerticalFieldManager();
    mDescriptionText = new LabelField(sResources.getString(ENTER_KEY_HELP));
    mAccountName = new EditField(EditField.NO_NEWLINE);
    mAccountName.setLabel(sResources.getString(ENTER_ACCOUNT_LABEL));
    mKeyEntryField = new EditField(EditField.NO_NEWLINE);
    mKeyEntryField.setLabel(sResources.getString(ENTER_KEY_LABEL));
    mType = new ObjectChoiceField(sResources.getString(TYPE_PROMPT), OtpType
        .values());
    mStatusText = new LabelField() {
      protected void paint(Graphics graphics) {
        int savedColor = graphics.getColor();
        graphics.setColor(mStatusColor);
        super.paint(graphics);
        graphics.setColor(savedColor);
      }
    };
    mKeyEntryField.setChangeListener(this);
    manager.add(mDescriptionText);
    manager.add(new LabelField()); // Spacer
    manager.add(mAccountName);
    manager.add(mKeyEntryField);
    manager.add(mStatusText);
    manager.add(mType);

    HorizontalFieldManager buttons = new HorizontalFieldManager(FIELD_HCENTER);
    mSubmitButton = new ButtonField(sResources.getString(SUBMIT),
        ButtonField.CONSUME_CLICK);
    mClearButton = new ButtonField(sResources.getString(CLEAR),
View Full Code Here


    LabelField _labelTwitter;
    LabelField _labelAlipay;

    public AboutScreen(String title, String version, String intro, String author, String email, String weibo, String facebook, String twitter, String alipay)
    {
      super(new VerticalFieldManager(FOCUSABLE | NO_VERTICAL_SCROLL));

      Languages language = new Languages();

      setBorder(AboutScreenConfig.border_popup_Transparent);
      setBackground(AboutScreenConfig.bg_popup_Transparent);

        LabelField labelAbout = new LabelField(language.getAbout(), USE_ALL_WIDTH | LabelField.ELLIPSIS);
        labelAbout.setFont(AboutScreenConfig.FONT_ABOUT_TITLE);
        labelAbout.setPadding(0, 0, 1, 0);

        LabelField labelTitle = new LabelField(title, USE_ALL_WIDTH | LabelField.ELLIPSIS);
        labelTitle.setFont(AboutScreenConfig.FONT_ABOUT_LARGE);

        LabelField labelVersion = new LabelField(language.getVersion() + version, USE_ALL_WIDTH | LabelField.ELLIPSIS | LabelField.RIGHT);
        labelVersion.setFont(AboutScreenConfig.FONT_ABOUT_SMALL);

      VerticalFieldManager vfmTitle = new VerticalFieldManager(FIELD_VCENTER);
        vfmTitle.add(labelAbout);
        vfmTitle.add(new SeparatorField());
        vfmTitle.add(labelTitle);
        vfmTitle.add(labelVersion);

      VerticalFieldManager vfmContent = new VerticalFieldManager(VERTICAL_SCROLL);
      HorizontalFieldManager horizontalContactTitle = new HorizontalFieldManager();
      //HorizontalFieldManager horizontalShortcutTitle = new HorizontalFieldManager();
      //VerticalButtonFieldSet vbf = new VerticalButtonFieldSet(USE_ALL_WIDTH);

        LabelField labelIntro = new LabelField(intro);

        LabelField labelContact = new LabelField(language.getContact(), USE_ALL_WIDTH | LabelField.ELLIPSIS);
        labelContact.setFont(AboutScreenConfig.FONT_ABOUT_HEADLINE);

        LabelField labelAuthor = addLabel("\u2022 " + author);
        if (!email.equalsIgnoreCase("")) {_labelEmail = addLabel("\u2022 " + language.getEmail() + email);}
        if (!weibo.equalsIgnoreCase("")) {_labelWeibo = addLabel("\u2022 " + language.getWeibo() + weibo);}
        if (!facebook.equalsIgnoreCase("")) {_labelFacebook = addLabel("\u2022 " + language.getFacebook() + facebook);}
        if (!twitter.equalsIgnoreCase("")) {_labelTwitter = addLabel("\u2022 " + language.getTwitter() + twitter);}
        if (!alipay.equalsIgnoreCase("")) {_labelAlipay = addLabel("\u2022 " + language.getAlipay() + alipay);}

        /*
        LabelField labelShortcut = new LabelField("快捷键:", USE_ALL_WIDTH | LabelField.ELLIPSIS);
        labelShortcut.setFont(AboutScreenConfig.FONT_ABOUT_HEADLINE);

        LabelField shortB=addLabel("\u2022 B:列表滚动到底部");
        LabelField shortT=addLabel("\u2022 T:列表滚动到顶部");
        LabelField shortL=addLabel("\u2022 L:获取最新新闻");
        LabelField shortH=addLabel("\u2022 H:获取热门新闻");
        LabelField shortS=addLabel("\u2022 S:获取专题分类");
        LabelField shortC=addLabel("\u2022 C:选择往期新闻");
        LabelField shortN=addLabel("\u2022 N:下一期新闻");
        LabelField shortP=addLabel("\u2022 P:上一期新闻");
        LabelField shortA=addLabel("\u2022 A:显示本窗口");
        LabelField shortX=addLabel("\u2022 X:退出程序");

        ButtonField btnWriteAReview = new ButtonField("编写评论", ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
        btnWriteAReview.setChangeListener(new FieldChangeListener() {
        public void fieldChanged(Field field, int context)
        {
          try
                {
                    openAppWorld(AboutScreenConfig.BBW_APPID);
                } catch(final Exception e)
                {
                    UiApplication.getUiApplication().invokeLater(new Runnable()
                    {
                        public void run()
                        {
                          if(e instanceof ContentHandlerException)
                          {
                            Dialog.alert("BlackBerry World is not installed!");
                          } else {
                            Dialog.alert("Problems opening App World: " + e.getMessage());
                          }
                        }
                    });
                }
        }
      });

        ButtonField btnBrowseOtherApps = new ButtonField("浏览其它软件", ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
        btnBrowseOtherApps.setChangeListener(new FieldChangeListener() {
        public void fieldChanged(Field field, int context)
        {
          BrowserSession browser=Browser.getDefaultSession();
            browser.displayPage("http://appworld.blackberry.com/webstore/vendor/69061");
        }
      });
      */

        horizontalContactTitle.add(labelContact);
        horizontalContactTitle.add(new LabelField("", LabelField.FOCUSABLE));
        vfmContent.add(labelIntro);
        vfmContent.add(new LabelField());
        vfmContent.add(horizontalContactTitle);
        vfmContent.add(labelAuthor);
        if (_labelEmail != null) {vfmContent.add(_labelEmail);}
        if (_labelWeibo != null) {vfmContent.add(_labelWeibo);}
        if (_labelAlipay != null) {vfmContent.add(_labelAlipay);}
        if (_labelFacebook != null) {vfmContent.add(_labelFacebook);}
        if (_labelTwitter != null) {vfmContent.add(_labelTwitter);}
        vfmContent.add(new LabelField());

      /*
        horizontalShortcutTitle.add(labelShortcut);
        horizontalShortcutTitle.add(new LabelField("", LabelField.FOCUSABLE));
        vfmContent.add(horizontalShortcutTitle);
View Full Code Here

  /**
   * Creates a new CustomSpinnerPopup object
   */
  public SpinnerScreen(String title, String[] choices, int visibleRows, int rowHeight, int selectedIndex)
  {          
    super(new VerticalFieldManager(), Screen.DEFAULT_CLOSE);  
    
    _spinBoxField = new CustomTextSpinBoxField(choices);
    _spinBoxField.setVisibleRows(visibleRows);
    _spinBoxField.setRowHeight(rowHeight);
    if (selectedIndex < choices.length && selectedIndex > 0)
View Full Code Here

        _tintChooser = new TintChooser( initialColor );
        _tintChooser.setPadding( PADDING, PADDING, PADDING, PADDING );
        _tintChooser.setChangeListener( this );
        add( _tintChooser );

        VerticalFieldManager previewPane = new VerticalFieldManager();

        _previewField = new ColorPreviewField( initialColor );
        _previewField.setPadding( PADDING, PADDING, PADDING + PADDING_BOTTOM, PADDING );
        previewPane.add( _previewField );

        _okButton = new ButtonField( OK );
        _okButton.setChangeListener( this );
        previewPane.add( _okButton );

        add( previewPane );
    }
View Full Code Here

    private int _selectedIndex;
   
    private boolean _dialogAccepted;

    public SelectDialog( boolean allowMultiple, String[] labels, boolean[] enableds, boolean[] selecteds, int[] types ) {
        super( new VerticalFieldManager( VERTICAL_SCROLL | VERTICAL_SCROLLBAR ) );
        _choiceLength = labels.length;
        _allowMultiple = allowMultiple;
        _response = new Vector();
        _selectedIndex = -1;
        _dialogAccepted = false;

        _listItems = new ListItem[ _choiceLength ];
        int indexAssignment = 0;
        for( int index = 0; index < _choiceLength; index++ ) {
            if( _selectedIndex == -1 && selecteds[ index ] && enableds[ index ] ) {
                _selectedIndex = index;
            }
            if( types[ index ] == SelectAsyncFunction.POPUP_ITEM_TYPE_OPTION ) {
                _listItems[ index ] = new ListItem( labels[ index ], enableds[ index ], selecteds[ index ], types[ index ],
                        indexAssignment );
                indexAssignment++;
            } else {
                _listItems[ index ] = new ListItem( labels[ index ], enableds[ index ], selecteds[ index ], types[ index ], -1 );
            }
        }

        _list = new SelectListField();
        _list.setChangeListener( this );
        _vfm = new VerticalFieldManager( NO_HORIZONTAL_SCROLL | NO_HORIZONTAL_SCROLLBAR | VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
        _vfm.add( _list );
        add( _vfm );

        if( _allowMultiple ) {
            _doneButton = new ButtonField( "Done", Field.FIELD_HCENTER );
View Full Code Here

      public void fieldChanged(Field field, int context) {
        execution.execute(null);
      }
    };
    buttonField.setChangeListener(changeListener);
    VerticalFieldManager vfmLeft = new VerticalFieldManager();
    VerticalFieldManager vfmRight = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
    vfmLeft.add(labelField);
    vfmRight.add(buttonField);
    HorizontalFieldManager hfm = new HorizontalFieldManager();
    hfm.add(vfmLeft);
    hfm.add(vfmRight);
   
    return hfm;
View Full Code Here

    };
    buttonField2.setChangeListener(changeListener2);
        HorizontalFieldManager hfm1 = new HorizontalFieldManager(HorizontalFieldManager.FIELD_RIGHT);
        hfm1.add(buttonField1);
        hfm1.add(buttonField2);
        VerticalFieldManager vfmLeft = new VerticalFieldManager();
        VerticalFieldManager vfmRight = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
        vfmLeft.add(labelField);
        vfmRight.add(hfm1);
        HorizontalFieldManager hfm = new HorizontalFieldManager();
        hfm.add(vfmLeft);
        hfm.add(vfmRight);
   
    return hfm;
View Full Code Here

            // navController depends on navExtension. Initialize navExtension first
            _navigationJS = new NavigationExtension();
            _navigationExtension = new NavigationNamespace( this, (WidgetFieldManager) _manager );
            _navigationController = new NavigationController( this );
        } else {
            _manager = new VerticalFieldManager( Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | Manager.HORIZONTAL_SCROLL
                    | Manager.HORIZONTAL_SCROLLBAR );
        }

        // Add BrowserField/Manager to the Screen.
        _manager.add( _browserField );
View Full Code Here

        image.setSpace(2, 2);
        image.setCommandAction(new ThumbnailClick(data));
        data.setBitmapField(image);
        resultsList.add(image);
        // Text column
        VerticalFieldManager vfm = new VerticalFieldManager();
        vfm.add(new LabelField(data.getTitle(), LabelField.NON_FOCUSABLE));
        vfm.add(new LabelField(data.getDescription(), LabelField.USE_ALL_HEIGHT | LabelField.NON_FOCUSABLE
            | LabelField.ELLIPSIS));
        resultsList.add(vfm);
        // Break
        resultsList.add(new NullField(NullField.NON_FOCUSABLE));
        resultsList.add(new SeparatorField());
View Full Code Here

    add(geoTimeoutField)
    add(new SeparatorField());
    add(maxRetryDelayField);
    add(new SeparatorField());
    HorizontalFieldManager hfm = new HorizontalFieldManager(Field.USE_ALL_WIDTH);
    VerticalFieldManager vfmLeft = new VerticalFieldManager();
    VerticalFieldManager vfmRight = new VerticalFieldManager(DrawStyle.RIGHT|Field.FIELD_RIGHT);
    vfmLeft.add(startTrackingField);
    vfmLeft.add(stopTrackingField);
    vfmLeft.add(restartField);
    vfmRight.add(getSingleLocationField);
    vfmRight.add(getLastLocationField);
    vfmRight.add(satellitesField);
    hfm.add(vfmLeft);
    hfm.add(vfmRight);
    add(hfm);   
    add(new SeparatorField());
    add(statusField);
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.