Package org.rstudio.core.client.dom

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


   }
  

   public Rectangle getPreviewClientRect()
   {
      WindowEx win = imageFrame_.getElement().<IFrameElementEx>cast()
            .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(),
View Full Code Here


         findTextBox_.addKeyUpHandler(new KeyUpHandler() {
           
            @Override
            public void onKeyUp(KeyUpEvent event)
            {    
               WindowEx contentWindow = getContentWindow();
               if (contentWindow != null)
               {
                  // escape or tab means exit find mode and put focus
                  // into the main content window
                  if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE ||
                      event.getNativeKeyCode() == KeyCodes.KEY_TAB)
                  {
                     event.preventDefault();
                     event.stopPropagation();
                     if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE)
                        clearTerm();
                     contentWindow.focus();
                  }
                  else
                  {
                     // prevent two enter keys in rapid succession from
                     // minimizing or maximizing the help pane
                     if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
                     {
                        event.preventDefault();
                        event.stopPropagation();
                     }
                     
                     // check for term
                     String term = findTextBox_.getValue().trim();
                    
                     // if there is a term then search for it
                     if (term.length() > 0)
                     {
                        // make buttons visible
                        setButtonVisibility(true);
                       
                        // perform the find (check for incremental)
                        if (isIncrementalFindSupported())
                        {
                           boolean incremental =
                            !event.isAnyModifierKeyDown() &&
                            (event.getNativeKeyCode() != KeyCodes.KEY_ENTER);  
                          
                           performFind(term, true, incremental);
                        }
                        else
                        {
                           if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
                              performFind(term, true, false);
                        }
                     }
                    
                     // no term means clear term and remove selection
                     else
                     {
                        if (isIncrementalFindSupported())
                        {
                           clearTerm();
                           contentWindow.removeSelection();
                        }
                     }
                  }
               }
            }
View Full Code Here

  
   private void performFind(String term,
                            boolean forwards,
                            boolean incremental)
   {
      WindowEx contentWindow = getContentWindow();
      if (contentWindow == null)
         return;
     
      // if this is an incremental search then reset the selection first
      if (incremental)
         contentWindow.removeSelection();
     
      contentWindow.find(term, false, !forwards, true, false);
   }
View Full Code Here

   }
  
   @Override
   public void focus()
   {
      WindowEx contentWindow = getContentWindow();
      if (contentWindow != null)
         contentWindow.focus();
   }
View Full Code Here

   }
  
   private void findInTopic(String term, CanFocus findInputSource)
   {
      // get content window
      WindowEx contentWindow = getContentWindow();
      if (contentWindow == null)
         return;
         
      if (!contentWindow.find(term, false, false, true, false))
      {
         globalDisplay_.showMessage(MessageDialog.INFO,
               "Find in Topic",
               "No occurences found",
               findInputSource);
View Full Code Here

      // check for a re-activation of an existing window
      for (ActiveSatellite satellite : satellites_)
      {
         if (satellite.getName().equals(name))
         {
            WindowEx window = satellite.getWindow();
            if (!window.isClosed())
            {
               // for web mode bring the window to the front, notify
               // it that it has been reactivated, then exit.
               if (!Desktop.isDesktop())
               {
                  // don't do this for chrome (since it doesn't allow
                  // window.focus). for chrome we'll just fall through
                  // and openSatelliteWindow will be called and the
                  // window will be reloaded)
                  if (!BrowseCap.isChrome())
                  {
                     window.focus();
                     callNotifyReactivated(window, params);
                     return;
                  }
                  else
                  {
View Full Code Here

         if (satellite.getName().equals(name) &&
             !satellite.getWindow().isClosed())
         {
            // save the window's geometry so we can restore it after the window
            // is destroyed
            final WindowEx win = satellite.getWindow();
            Document doc = win.getDocument();
            preferredSize = new Size(doc.getClientWidth(), doc.getClientHeight());
            preferredPos = new Point(win.getLeft(), win.getTop());
            callNotifyPendingReactivate(win);

            // close the window
            try
            {
               win.close();
            }
            catch(Throwable e)
            {
            }
            break;
View Full Code Here

            // If we're buffering events for this satellite, then don't dispatch
            // them
            if (pendingEventsBySatelliteName_.containsKey(satellite.getName()))
               continue;

            WindowEx satelliteWnd = satellite.getWindow();
            if (satelliteWnd.isClosed())
            {
               if (removeWindows == null)
                  removeWindows = new ArrayList<ActiveSatellite>();
               removeWindows.add(satellite);
            }
View Full Code Here

   {
      // get the satellite and add it to our list. in some cases (such as
      // the Ctrl+R reload of an existing satellite window) we actually
      // already have a reference to this satellite in our list so in that
      // case we make sure not to add a duplicate
      WindowEx satelliteWnd = wnd.<WindowEx>cast();
      ActiveSatellite satellite = new ActiveSatellite(name, satelliteWnd);
      if (!satellites_.contains(satellite))
         satellites_.add(satellite);
     
      // call setSessionInfo
View Full Code Here

                        }
                     });
            }
            else
            {
               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();
View Full Code Here

TOP

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

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.