Package com.smartgwt.client.widgets.menu

Examples of com.smartgwt.client.widgets.menu.MenuItem


   * @param action
   * @return
   */
  public static MenuItem createMenuItem( final IGWTAction action ) {

    MenuItem menuItem = new MenuItem( action.getText() );
    if ( action.getIcon() != null ) {
      menuItem.setIcon( action.getIcon() );
    }
    menuItem.addClickHandler( new com.smartgwt.client.widgets.menu.events.ClickHandler() {

      public void onClick( MenuItemClickEvent event ) {

        action.execute();
      }
View Full Code Here


   */
  private void createContextMenu() {

    Menu contextMenu = new Menu();

    MenuItem createItem = UIFactory.createMenuItem( ActionRegistry.NEW_FOLDER );
    createItem.setEnableIfCondition( new MenuItemIfFunction() {

      public boolean execute( Canvas target, Menu menu, MenuItem item ) {

        IGWTFolder folder = GWTUtil.getGwtFolder( (TreeNode) tree.getSelectedRecord() );
        return folder.isCreateSubfolderSupported();
      }
    } );

    MenuItem deleteItem = UIFactory.createMenuItem( ActionRegistry.DELETE_FOLDER );
    deleteItem.setEnableIfCondition( new MenuItemIfFunction() {

      public boolean execute( Canvas target, Menu menu, MenuItem item ) {

        IGWTFolder folder = GWTUtil.getGwtFolder( (TreeNode) tree.getSelectedRecord() );
        return folder.isDeleteSupported();
      }
    } );

    MenuItem emptyItem = UIFactory.createMenuItem( ActionRegistry.EMPTY_FOLDER );
    emptyItem.setEnableIfCondition( new MenuItemIfFunction() {

      public boolean execute( Canvas target, Menu menu, MenuItem item ) {

        IGWTFolder folder = GWTUtil.getGwtFolder( (TreeNode) tree.getSelectedRecord() );
        return folder.isEmptySupported();
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.menu.MenuItem

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.