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

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


     
      new Thread () {
        public void run() {
          try
          {
            MainScreen ms = (MainScreen)_browserField.getScreen();
            //LabelField label = new LabelField (_text, LabelField.USE_ALL_WIDTH);
            ms.setTitle(_text);
            ms.getDelegate().invalidate();
            //ms.doPaint();
          }
          catch (Exception e) {
            //throw new RuntimeException(e.getMessage());
          }
View Full Code Here


    {
      Object result = Boolean.FALSE;

      if (args.length >= 2 && menu == null)
      {
        MainScreen screen = (MainScreen) SendMenuExtension.getBrowserField().getScreen();
   
        int sendType = Integer.parseInt(args[0].toString());
        boolean getAll = (args.length>=3) ? ((Boolean) args[2]).booleanValue() : false;
        int ordering = (args.length>=4) ? Integer.parseInt(args[3].toString()) : 0;
        int priority = (args.length>=5) ? Integer.parseInt(args[4].toString()) : 0;
       
        try
        {
          JSONObject context = new JSONObject(args[1].toString());
         
          SendCommand[] sendCommands = SendCommandRepository.getInstance().get(sendType,context,getAll);
         
          if(sendCommands != null && sendCommands.length > 0)
          {
            if(args.length >= 6 && args[5] != null)
            {
              try
              {
                JSONObject filterArgs = new JSONObject(args[5].toString());
                SendContextFilter filter = new SendContextFilter(filterArgs);
                for (int i = 0; i < sendCommands.length; i++)
                {
                  sendCommands[i].setSendCommandContextFilter(filter);
                }
              } catch (JSONException e) {
                System.out.println(e.toString());
              }
            }
            SendCommandMenu sendCommandmenu = new SendCommandMenu(sendCommands, 0, 0);
            SendCommandMenuItem[] menuItems = sendCommandmenu.getSendCommandMenuItems();
            menu = new SubMenu(menuItems,menuLabel,ordering,priority);
            screen.addMenuItem(menu.getMenuItem());
            result = Boolean.TRUE;
          }
        }
        catch (JSONException e)
        {
View Full Code Here

    public Object invoke(Object obj, Object[] args) throws Exception
    {
      if (menu != null)
      {
        MainScreen screen = (MainScreen) SendMenuExtension.getBrowserField().getScreen();
        screen.removeMenuItem(menu.getMenuItem());
        menu = null;
        return Boolean.TRUE;
      }
     
      return Boolean.FALSE;
View Full Code Here

    /**
     * @see blackberry.core.ScriptableFunctionBase#execute(Object, Object[])
     */
    public Object execute( Object thiz, Object[] args ) throws Exception {
        // Get the screen that currently owns the BrowserField
        MainScreen screen = (MainScreen) MenuExtension.getBrowserField().getScreen();
        ShowMenu thread = new ShowMenu( screen.getMenu( Menu.INSTANCE_DEFAULT ) );
        screen.getApplication().invokeLater( thread );

        return UNDEFINED;
    }
View Full Code Here

     * @see blackberry.core.ScriptableFunctionBase#execute(Object, Object[])
     */

    public Object execute( Object thiz, Object[] args ) throws Exception {
        // Get the screen that currently owns the BrowserField
        MainScreen screen = (MainScreen) MenuExtension.getBrowserField().getScreen();
        Object[] list = MenuItemObjectManager.getMenuItemObjects();

        for( int i = 0; i < list.length; i++ ) {
            screen.removeMenuItem( ( (MenuItemObject) list[ i ] ).getMenuItem() );
        }
        MenuItemObjectManager.clearMenuItemObjects();

        return UNDEFINED;
    }
View Full Code Here

    /**
     * @see blackberry.core.ScriptableFunctionBase#execute(Object, Object[])
     */
    public Object execute( Object thiz, Object[] args ) throws Exception {
        // Get the screen that currently owns the BrowserField
        MainScreen screen = (MainScreen) MenuExtension.getBrowserField().getScreen();
        MenuItemObject menuItem = (MenuItemObject) args[ 0 ];

        boolean addSucceed = MenuItemObjectManager.addMenuItemObject( menuItem );

        if( addSucceed ) {
            screen.addMenuItem( menuItem.getMenuItem() );
        }
        return UNDEFINED;
    }
View Full Code Here

    /**
     * @see blackberry.core.ScriptableFunctionBase#execute(Object, Object[])
     */
    public Object execute( Object thiz, Object[] args ) throws Exception {
        // Get the screen that currently owns the BrowserField
        MainScreen screen = (MainScreen) MenuExtension.getBrowserField().getScreen();
        MenuItemObject menuItem = (MenuItemObject) args[ 0 ];

        screen.removeMenuItem( menuItem.getMenuItem() );
        MenuItemObjectManager.removeMenuItemObject( menuItem );
        return UNDEFINED;
    }
View Full Code Here

    public Object execute( Object thiz, Object[] args ) throws Exception {
        MenuItemObject menuItem = (MenuItemObject) args[ 0 ];

        if( !( (Boolean) menuItem.getField( MenuItemObject.FIELD_ISSEPARATOR ) ).booleanValue() ) {
            // Get the screen that currently owns the BrowserField
            MainScreen screen = (MainScreen) MenuExtension.getBrowserField().getScreen();
            MenuItem defaultItem = screen.getDefaultMenuItem( Menu.INSTANCE_DEFAULT );
            if( defaultItem == null ) {
                menuItem.setPriority( Integer.MAX_VALUE );
            } else {
                menuItem.setPriority( defaultItem.getPriority() - 1 );
            }
View Full Code Here

            return _isSeparator;
        } else if( name.equals( FIELD_ORDINAL ) ) {
            return _ordinal;
        } else if( name.equals( FIELD_ISDEFAULT ) ) {
            // Get the screen that currently owns the BrowserField
            MainScreen screen = (MainScreen) MenuExtension.getBrowserField().getScreen();

            MenuItem mi = screen.getDefaultMenuItem( Menu.INSTANCE_DEFAULT );
            if( mi == null ) {
                return Boolean.FALSE;
            }
            return new Boolean( mi.equals( _menuItem ) );
        }
View Full Code Here

public class CreateUriTagCommand extends AlwaysExecutableCommand {

  public void execute(ReadOnlyCommandMetadata metadata, Object context) {
    synchronized(UiApplication.getUiApplication().getEventLock()) {
        MainScreen screen = new UriTagScreen();
        UiApplication.getUiApplication().pushScreen(screen);
    }
  }
View Full Code Here

TOP

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

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.