Package org.uberfire.workbench.model.menu

Examples of org.uberfire.workbench.model.menu.Menus


                .build();

    }

    public static MenuItem buildCustomMenu() {
        Menus menu =  MenuFactory
                .newTopLevelCustomMenu( new MenuFactory.CustomMenuBuilder() {
                    @Override
                    public void push( MenuFactory.CustomMenuBuilder element ) {
                    }

                    @Override
                    public MenuItem build() {
                        return new MenuCustom<Widget>() {

                            @Override
                            public Widget build() {
                                return new ContextDropdownButton() {
                                    {
                                        displayCaret( false );
                                        setRightDropdown( true );
                                        setIcon( IconType.COG );
                                        setSize( MINI );
                                        add( new NavLink( "Business view" ) {{
                                            setIconSize( IconSize.SMALL );
                                        }} );
                                        add( new NavLink( "Tech view" ) {{
                                            setIcon( IconType.ASTERISK );
                                            setIconSize( IconSize.SMALL );
                                        }} );
                                        add( new Divider() );
                                        add( new NavLink( "Breadbrumb Explorer" ) {{
                                            setIcon( IconType.OK );
                                            setIconSize( IconSize.SMALL );
                                        }} );
                                        add( new NavLink( "Tree explorer" ) {{
                                        }} );
                                        add( new Divider() );
                                        add( new NavLink( "Flatten folders" ) {{
                                        }} );
                                        add( new NavLink( "Compact empty folders" ) {{
                                        }} );
                                        add( new NavLink( "Display hidden files" ) {{
                                        }} );
                                    }
                                };
                            }

                            @Override
                            public boolean isEnabled() {
                                return false;
                            }

                            @Override
                            public void setEnabled( boolean enabled ) {

                            }

                            @Override
                            public String getContributionPoint() {
                                return null;
                            }

                            @Override
                            public String getCaption() {
                                return null;
                            }

                            @Override
                            public MenuPosition getPosition() {
                                return null;
                            }

                            @Override
                            public int getOrder() {
                                return 0;
                            }

                            @Override
                            public void addEnabledStateChangeListener( EnabledStateChangeListener listener ) {

                            }

                            @Override
                            public String getSignatureId() {
                                return null;
                            }

                            @Override
                            public Collection<String> getRoles() {
                                return null;
                            }

                            @Override
                            public Collection<String> getTraits() {
                                return null;
                            }
                        };
                    }
                } ).endMenu().build();
        return menu.getItems().get( 0 );
    }
View Full Code Here


        return menu.getItems().get( 0 );
    }

    public static MenuItem buildMenuGroupItem() {

        Menus menu = buildMenuGroup();
        return  menu.getItems().get( 0 );
    }
View Full Code Here

    }

    @Test
    public void simpleAddMenuItems() {
        Menus item = MenusFixture.buildMenuGroup();
        pespectiveMenusViewUnitTestWrapper.buildMenu( item );
        verify( menuBar, Mockito.times( item.getItems().size() ) ).add( any( Widget.class ) );
    }
View Full Code Here

        verify( spy, Mockito.times( 1 ) ).makeMenuGroup( (MenuGroup) item );

    }
    @Test
    public void otherTypesOfMenusShouldReturnNull() {
        Menus item = MenusFixture.buildTopLevelMenu();
        pespectiveMenusViewUnitTestWrapper.buildMenu( item );
        verify( menuBar, never()).add( any( Widget.class ) );
    }
View Full Code Here

    }

    @Test
    public void simpleAddMenuItems() {
        Menus item = MenusFixture.buildMenuGroup();
        partContextMenusViewUnitTestWrapper.buildMenu( item );
        verify( menuBar, Mockito.times( item.getItems().size() ) ).add( any( Widget.class ) );
    }
View Full Code Here

        verify( spy, Mockito.times( 1 ) ).makeMenuGroup( (MenuGroup) item );

    }
    @Test
    public void otherTypesOfMenusShouldReturnNull() {
        Menus item = MenusFixture.buildTopLevelMenu();
        partContextMenusViewUnitTestWrapper.buildMenu( item );
        verify( menuBar, never()).add( any( Widget.class ) );
    }
View Full Code Here

    }

    private void setupMenu( @Observes final ApplicationReadyEvent event ) {
        final PerspectiveActivity defaultPerspective = getDefaultPerspectiveActivity();

        final Menus menus =
                newTopLevelMenu( "Home" )
                        .respondsWith( new Command() {
                            @Override
                            public void execute() {
                                if ( defaultPerspective != null ) {
View Full Code Here

TOP

Related Classes of org.uberfire.workbench.model.menu.Menus

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.