Package org.rstudio.core.client.layout

Examples of org.rstudio.core.client.layout.WindowState


      topWindowStateChangeManager_ = new WindowStateChangeManager(session);
      bottomWindowStateChangeManager_ = new WindowStateChangeHandler()
      {
         public void onWindowStateChange(WindowStateChangeEvent event)
         {
            WindowState topState;
            switch (event.getNewState())
            {
               case NORMAL:
                  topState = NORMAL;
                  break;
               case MAXIMIZE:
                  topState = MINIMIZE;
                  break;
               case MINIMIZE:
                  topState = MAXIMIZE;
                  break;
               case HIDE:
                  topState = EXCLUSIVE;
                  break;
               case EXCLUSIVE:
                  topState = HIDE;
                  break;
               default:
                  throw new IllegalArgumentException(
                        "Unknown WindowState " + event.getNewState());
            }
            windowA_.onWindowStateChange(
                                    new WindowStateChangeEvent(topState));
         }
      };

      hookEvents();

      new WindowLayoutStateValue(session.getSessionInfo().getClientState(),
                                 clientStateKeyName,
                                 topWindowDefaultState,
                                 defaultSplitterPos);

      setWidget(layout_);

      if (eventBus != null)
      {
         layout_.addSplitterBeforeResizeHandler(new SplitterBeforeResizeHandler()
         {
            public void onSplitterBeforeResize(SplitterBeforeResizeEvent event)
            {
               // If the splitter ends up causing a minimize operation, then
               // we'll need to have saved the normal height for when the
               // user decides to restore the panel.
               snapMinimizeNormalHeight_ = new NormalHeight(
                     layout_.getSplitterBottom(),
                     layout_.getOffsetHeight(),
                     Window.getClientHeight());

               eventBus.fireEvent(new GlassVisibilityEvent(true));
            }
         });
         layout_.addSplitterResizedHandler(new SplitterResizedHandler()
         {
            public void onSplitterResized(SplitterResizedEvent event)
            {
               WindowState topState = resizePanes(layout_.getSplitterBottom());
              
               // we're already in normal if the splitter is being invoked
               if (topState != WindowState.NORMAL)
               {
                  topWindowStateChangeManager_.onWindowStateChange(
View Full Code Here


  
   // resize the panes based on the specified bottom height and return the
   // new window state for the top pane (this implements snap to minimize)
   private WindowState resizePanes(int bottom)
   {
      WindowState topState = null;
     
      int height = layout_.getOffsetHeight();

      // If the height of upper or lower panel is smaller than this
      // then that panel will minimize
View Full Code Here

      @Override
      protected void onInit(JsObject value)
      {
         normalHeight_ = new NormalHeight(defaultSplitterPos_, null, null);
         WindowState topWindowState = topWindowDefaultState_;

         try
         {
            if (value != null)
            {
View Full Code Here

         // ignore if this will reduce our size
         if (height <= targetWindow.getActiveWidget().getOffsetHeight())
            return;
        
         // resize bottom
         WindowState topState = resizePanes(height);
        
         if (topState != null)
         {
            topWindowStateChangeManager_.onWindowStateChange(
               new WindowStateChangeEvent(topState))
View Full Code Here

      return events_.addHandler(EnsureHeightEvent.TYPE, handler);
   }
  
   public void onWindowStateChange(WindowStateChangeEvent event)
   {
      WindowState newState = event.getNewState();
      if (state_ == EXCLUSIVE && newState == MAXIMIZE)
         newState = NORMAL;
      if (newState == state_)
         newState = NORMAL;
      events_.fireEvent(new WindowStateChangeEvent(newState));
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.layout.WindowState

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.