Package org.rstudio.studio.client.common.presentation.model

Examples of org.rstudio.studio.client.common.presentation.model.SlideNavigationItem


           
            MenuItem defaultMenuItem = null;
            int length = slideNavigation.getItems().length();
            for (int i=0; i<length; i++)
            {
               SlideNavigationItem item = slideNavigation.getItems().get(i);
               String title = item.getTitle();
               if (StringUtil.isNullOrEmpty(title))
                  title = "(Untitled Slide)";
              
               StringBuilder indentBuilder = new StringBuilder();
               for (int level=0; level<item.getIndent(); level++)
                  indentBuilder.append("&nbsp;&nbsp;");
              
               SafeHtmlBuilder labelBuilder = new SafeHtmlBuilder();
               labelBuilder.appendHtmlConstant(indentBuilder.toString());
               labelBuilder.appendEscaped(title);

               final int targetSlide = i;
               final MenuItem menuItem = new MenuItem(
                  labelBuilder.toSafeHtml(),
                  new Command()
                  {
                     public void execute()
                     {
                        navigateToSlide(editor, targetSlide);
                     }          
                  });
               menu.addItem(menuItem);
              
               // see if this is the default menu item
               if (defaultMenuItem == null &&
                   item.getLine() >= (docDisplay_.getSelectionStart().getRow()))
               {
                  defaultMenuItem = menuItem;
               }
            }
            
View Full Code Here


     
         JsArray<SlideNavigationItem> items = slideNavigation_.getItems();
         for (int i=0; i<items.length(); i++)
         {
            // get slide
            final SlideNavigationItem item = items.get(i);
            
            // build html
            SafeHtmlBuilder menuHtml = new SafeHtmlBuilder();
            for (int j=0; j<item.getIndent(); j++)
               menuHtml.appendHtmlConstant("&nbsp;&nbsp;&nbsp;");
            menuHtml.appendEscaped(item.getTitle());
        
            navigationMenu.addItem(new MenuItem(menuHtml.toSafeHtml(),
                                           new Command() {
               @Override
               public void execute()
               {
                  view_.navigate(item.getIndex());
               }
            }));
        
        
         navigationMenu.setVisible(true);
View Full Code Here

TOP

Related Classes of org.rstudio.studio.client.common.presentation.model.SlideNavigationItem

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.