Package org.rstudio.core.client.dom

Examples of org.rstudio.core.client.dom.ElementEx


            .getContentWindow();
      Document doc = win.getDocument();
      NodeList<Element> images = doc.getElementsByTagName("img");
      if (images.getLength() > 0)
      {
         ElementEx img = images.getItem(0).cast();
         return new Rectangle(img.getClientLeft(),
                              img.getClientTop(),
                              img.getClientWidth(),
                              img.getClientHeight());
      }
      else
      {
         return new Rectangle(0,0,0,0);
      }
View Full Code Here


   private void helpNavigated(Document doc)
   {
      NodeList<Element> elements = doc.getElementsByTagName("a") ;
      for (int i = 0; i < elements.getLength(); i++)
      {
         ElementEx a = (ElementEx) elements.getItem(i) ;
         String href = a.getAttribute("href", 2) ;
         if (href == null)
            continue ;

         if (href.contains(":") || href.endsWith(".pdf"))
         {
            // external links
            AnchorElement aElement = a.cast();
            aElement.setTarget("_blank") ;
         }
         else
         {
            // Internal links need to be handled in JavaScript so that
            // they can participate in virtual session history. This
            // won't have any effect for right-click > Show in New Window
            // but that's a good thing.
            a.setAttribute("onclick",
                           "window.parent.helpNavigate(this.href);return false") ;
         }
      }
     
      String effectiveTitle = getDocTitle(doc);
View Full Code Here

         {
            // hide gripper
            sizeEditor.setGripperVisible(false);
           
            // get the preview iframe rect
            ElementEx iframe = sizeEditor.getPreviewIFrame().<ElementEx>cast();
            final Rectangle viewerRect = new Rectangle(
                   iframe.getClientLeft(),
                   iframe.getClientTop(),
                   iframe.getClientWidth(),
                   iframe.getClientHeight()).inflate(-1);
           
            // perform the export
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
               @Override
               public void execute()
View Full Code Here

public class DomUtilsStandardImpl implements DomUtilsImpl
{
   public void focus(Element element, boolean alwaysDriveSelection)
   {
      ElementEx el = (ElementEx)element ;

      el.focus() ;
      if (alwaysDriveSelection
            || (el.getContentEditable() &&
                (el.getInnerText() == null || el.getInnerText() == "")))
      {
         Document doc = el.getOwnerDocument();
         Range range = Range.create(doc) ;
         range.selectNodeContents(el) ;
         Selection sel = Selection.get(NativeWindow.get(doc)) ;
         sel.setRange(range);
      }
View Full Code Here

      int y = span.getAbsoluteTop() ;
      int w = 0;
      int h = span.getOffsetHeight() ;
      Rectangle result = new Rectangle(x, y, w, h) ;

      ElementEx parent = (ElementEx)span.getParentElement() ;
      parent.removeChild(span) ;
      parent.normalize() ;
      sel.setRange(selRng);
      return result;
   }
View Full Code Here

public class DomUtilsIE10Impl implements DomUtilsImpl
{
   public void focus(Element element, boolean alwaysDriveSelection)
   {
      ElementEx el = (ElementEx) element;
      el.focus();
   }
View Full Code Here

               WindowEx win = sizeEditor.getPreviewIFrame().getContentWindow();
               Document doc = win.getDocument();
               NodeList<Element> images = doc.getElementsByTagName("img");
               if (images.getLength() > 0)
               {
                  ElementEx img = images.getItem(0).cast();
                  DesktopFrame frame = Desktop.getFrame();
                  frame.copyImageToClipboard(img.getClientLeft(),
                                             img.getClientTop(),
                                             img.getClientWidth(),
                                             img.getClientHeight());
               }
              
               onCompleted.execute();
            }
         }
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.dom.ElementEx

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.