Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.ActionConfiguration


  private void createReadBookPage( UIConfiguration configuration ) {
    PageConfiguration page = new PageConfiguration( ReadBookPage.class.getName(),
                                                    ReadBookPage.class );
    page.setTitle( "Book" );
    ActionConfiguration action = new ActionConfiguration( ChangeThemeAction.class.getName(),
                                                          ChangeThemeAction.class );
    action.setImage( getImage( IMAGE_ACTION_THEME ) );
    action.setTitle( "Change Theme" );
    page.addActionConfiguration( action );
    configuration.addPageConfiguration( page );
  }
View Full Code Here


                                                    SearchResultsPage.class );
    configuration.addPageConfiguration( page );
  }

  private void createGlobalActions( UIConfiguration configuration ) {
    ActionConfiguration action = new ActionConfiguration( BookSearchAction.class.getName(),
                                                          BookSearchAction.class );
    action.setImage( getImage( IMAGE_ACTION_SEARCH ) );
    action.setTitle( "Search" );
    action.setPlacementPriority( PlacementPriority.HIGH );
    configuration.addActionConfiguration( action );
    action = new ActionConfiguration( SettingsAction.class.getName(), SettingsAction.class );
    action.setPlacementPriority( PlacementPriority.LOW );
    action.setImage( getImage( IMAGE_ACTION_SETTINGS ) );
    action.setTitle( "Settings" );
    configuration.addActionConfiguration( action );
  }
View Full Code Here

    addRootPageButton.addSelectionListener( new SelectionAdapter() {
      @Override
      public void widgetSelected( SelectionEvent e ) {
        String id = createId();
        InputStream image = DynamicPage.class.getResourceAsStream( "/action_share.png" );
        ActionConfiguration actionConfiguration = new ActionConfiguration( id, DynamicAction.class ).setImage( image );
        PageConfiguration pageConfiguration = new PageConfiguration( id, DynamicPage.class )
                                                .setTitle( "Root Page: " + id )
                                                .setTopLevel( true );
        pageConfiguration.addActionConfiguration( actionConfiguration );
        getUIConfiguration().addPageConfiguration( pageConfiguration );
View Full Code Here

      @Override
      public void widgetSelected( SelectionEvent e ) {
        String id = createId();
        pageActiondIds.add( id );
        InputStream image = DynamicPage.class.getResourceAsStream( "/action_theme.png" );
        ActionConfiguration actionConfiguration = new ActionConfiguration( id, DynamicAction.class ).setImage( image );
        getUIConfiguration().getPageConfiguration( getPageId() ).addActionConfiguration( actionConfiguration );
      }
    } );
  }
View Full Code Here

      @Override
      public void widgetSelected( SelectionEvent e ) {
        String id = createId();
        globalActiondIds.add( id );
        InputStream image = DynamicPage.class.getResourceAsStream( "/action_settings.png" );
        ActionConfiguration actionConfiguration = new ActionConfiguration( id, DynamicAction.class ).setImage( image );
        getUIConfiguration().addActionConfiguration( actionConfiguration );
      }
    } );
  }
View Full Code Here

    PageConfiguration pageConfiguration = ui.getPageConfiguration( to );
    dispatchEvent( EventType.PAGE_VIEW, createInfo( ui.getDisplay() ), pageConfiguration.getId() );
  }

  private void dispatchAction( UI ui, Action action ) {
    ActionConfiguration actionConfiguration = ui.getActionConfiguration( action );
    dispatchEvent( EventType.ACTION, createInfo( ui.getDisplay() ), actionConfiguration.getId() );
  }
View Full Code Here

    ActionConfiguration actionConfiguration = ui.getActionConfiguration( action );
    dispatchEvent( EventType.ACTION, createInfo( ui.getDisplay() ), actionConfiguration.getId() );
  }

  private void dispatchSearch( UI ui, Action action, String query ) {
    ActionConfiguration actionConfiguration = ui.getActionConfiguration( action );
    TrackingInfo info = createInfo( ui.getDisplay() );
    info.setSearchQuery( query );
    dispatchEvent( EventType.SEARCH, info, actionConfiguration.getId() );
  }
View Full Code Here

    }
    return null;
  }

  public ActionConfiguration getActionConfiguration( Action action ) {
    ActionConfiguration configuration = findGlobalActionConfiguration( action );
    if( configuration != null ) {
      return configuration;
    }
    return findPageActionConfiguration( action );
  }
View Full Code Here

    // Add a normal page
    PageConfiguration page = new PageConfiguration( "page", Page.class );
    page.setTitle( "Page" );
   
    // Add a page action
    ActionConfiguration pageAction = new ActionConfiguration( "pageAction", PageAction.class );
    pageAction.setImage( Configuration.class.getResourceAsStream( "/share.png" ) );
    page.addActionConfiguration( pageAction );
    uiConfiguration.addPageConfiguration( page );
   
    // Add a global action
    ActionConfiguration globalAction = new ActionConfiguration( "globalAction", GlobalAction.class );
    globalAction.setImage( Configuration.class.getResourceAsStream( "/page.png" ) );
    uiConfiguration.addActionConfiguration( globalAction );
   
    return uiConfiguration;
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.ui.ActionConfiguration

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.