Package org.rstudio.studio.client.workbench.model

Examples of org.rstudio.studio.client.workbench.model.SessionInfo


      commands.showFolder().setVisible(true);

      events.addHandler(SessionInitEvent.TYPE, new SessionInitHandler() {
         public void onSessionInit(SessionInitEvent sie)
         {
            final SessionInfo sessionInfo = session.getSessionInfo();
           
            toolbar_.completeInitialization(sessionInfo);
           
            new JSObjectStateValue(
                  "updates",
                  "ignoredUpdates",
                  ClientState.PERSISTENT,
                  session_.getSessionInfo().getClientState(),
                  false)
            {
               @Override
               protected void onInit(JsObject value)
               {
                  if (value != null)
                     ignoredUpdates_ = value.cast();
               }
        
               @Override
               protected JsObject getValue()
               {
                  ignoredUpdatesDirty_ = false;
                  return ignoredUpdates_.cast();
               }
              
               @Override
               protected boolean hasChanged()
               {
                  return ignoredUpdatesDirty_;
               }
            };

            Scheduler.get().scheduleFinally(new ScheduledCommand()
            {
               public void execute()
               {
                  Desktop.getFrame().onWorkbenchInitialized(
                        sessionInfo.getScratchDir());
                  if (!sessionInfo.getDisableCheckForUpdates() &&
                      pUIPrefs_.get().checkForUpdates().getValue())
                  {
                     checkForUpdates(false);
                  }
               }
View Full Code Here


  
  
   @Override
   protected boolean acceptNavigation()
   {
      SessionInfo sessionInfo =
                     RStudioGinjector.INSTANCE.getSession().getSessionInfo();
      if (!sessionInfo.isVcsAvailable(getVcsId()))
      {        
         NewProjectResources.Styles styles =
                                 NewProjectResources.INSTANCE.styles();  
        
         VerticalPanel verticalPanel = new VerticalPanel();
View Full Code Here

            "Create project as subdirectory of:", txtProjectName_);
      addWidget(newProjectParent_);
     
      // if git is available then add git init
      UIPrefs uiPrefs = RStudioGinjector.INSTANCE.getUIPrefs();
      SessionInfo sessionInfo =
         RStudioGinjector.INSTANCE.getSession().getSessionInfo();
     
      HorizontalPanel optionsPanel = null;
      if (getOptionsSideBySide())
         optionsPanel = new HorizontalPanel();
     
      chkGitInit_ = new CheckBox("Create a git repository");
      chkGitInit_.addStyleName(styles.wizardCheckbox());
      if (sessionInfo.isVcsAvailable(VCSConstants.GIT_ID))
      { 
         chkGitInit_.setValue(uiPrefs.newProjGitInit().getValue());
         chkGitInit_.getElement().getStyle().setMarginRight(7, Unit.PX);
         if (optionsPanel != null)
         {
View Full Code Here

  
   // called by main window to initialize sessionInfo
   private void setSessionInfo(JavaScriptObject si)
   {
      // get the session info and set it
      SessionInfo sessionInfo = si.<SessionInfo>cast();
      session_.setSessionInfo(sessionInfo);
 
      // ensure ui prefs initialize
      pUIPrefs_.get();
   }
View Full Code Here

      eventBus.addHandler(OpenProjectFileEvent.TYPE, this);
     
      eventBus.addHandler(SessionInitEvent.TYPE, new SessionInitHandler() {
         public void onSessionInit(SessionInitEvent sie)
         {
            SessionInfo sessionInfo = session.getSessionInfo();
           
            // ensure mru is initialized
            ProjectMRUList mruList = pMRUList_.get();
           
            // enable/disable commands
            String activeProjectFile = sessionInfo.getActiveProjectFile();
            boolean hasProject = activeProjectFile != null;
            commands.closeProject().setEnabled(hasProject);
            commands.projectOptions().setEnabled(hasProject);
           
            // remove version control commands if necessary
            if (!sessionInfo.isVcsEnabled())
            {
               commands.activateVcs().remove();
               commands.vcsCommit().remove();
               commands.vcsShowHistory().remove();
               commands.vcsPull().remove();
               commands.vcsPush().remove();
               commands.vcsCleanup().remove();
            }
            else
            {
               commands.activateVcs().setMenuLabel(
                                    "Show _" + sessionInfo.getVcsName());
              
               // customize for svn if necessary
               if (sessionInfo.getVcsName().equals(VCSConstants.SVN_ID))
               {
                  commands.vcsPush().remove();
                  commands.vcsPull().setButtonLabel("Update");
                  commands.vcsPull().setMenuLabel("_Update");
               }   
              
               // customize for git if necessary
               if (sessionInfo.getVcsName().equals(VCSConstants.GIT_ID))
               {
                  commands.vcsCleanup().remove();
               }
            }
           
View Full Code Here

  
   @Override
   public void openRStudioLink(String linkName, boolean includeVersionInfo)
   {
      // build url
      final SessionInfo sessionInfo = session_.getSessionInfo();
      String url = "http://www.rstudio.org/links/" ;
      url += URL.encodePathSegment(linkName) ;
      if (includeVersionInfo)
      {
         url += "?version=" + URL.encodeQueryString(sessionInfo.getRstudioVersion());
         url += "&mode=" + URL.encodeQueryString(sessionInfo.getMode());
      }
     
      // open window
      openWindow(url);
   }
View Full Code Here

      // create workbench
      Workbench wb = workbench_.get();
      eventBusProvider_.get().fireEvent(new SessionInitEvent()) ;

      // disable commands
      SessionInfo sessionInfo = session_.getSessionInfo();
      if (!sessionInfo.getAllowShell())
      {
         commands_.showShellDialog().remove();
      }
      if (!sessionInfo.getAllowPackageInstallation())
      {
         commands_.installPackage().remove();
         commands_.updatePackages().remove();
      }
      if (!sessionInfo.getAllowVcs())
      {
         commands_.versionControlProjectSetup().remove();
      }
      if (!sessionInfo.getAllowFileDownloads())
      {
         commands_.exportFiles().remove();
      }
     
      // disable rpubs if requested
      if (!sessionInfo.getAllowRpubsPublish())
      {
         commands_.publishHTML().remove();
         commands_.publishPlotToRPubs().remove();
         commands_.presentationPublishToRpubs().remove();
         commands_.viewerPublishToRPubs().remove();
View Full Code Here

      gitExePathChooser_ = new FileChooserTextBox("",
                                                  "(Not Found)",
                                                  null,
                                                  null);
      gitExePathLabel_ = new Label("Git executable:");
      SessionInfo sessionInfo = session.getSessionInfo();
      if (sessionInfo.getAllowVcsExeEdit())
         addTextBoxChooser(gitExePathLabel_, null, null, gitExePathChooser_);
      // use git bash
      chkUseGitBash_ = new CheckBox("Use Git Bash as shell for Git projects");
      if (haveGitBashPref())
      {
         extraSpaced(chkUseGitBash_);
         add(chkUseGitBash_);
      }
     
       
      // svn exe path chooser
      svnExePathLabel_ = new Label("SVN executable:");
      svnExePathChooser_ = new FileChooserTextBox("",
                                                  "(Not Found)",
                                                  null,
                                                  null);
      if (sessionInfo.getAllowVcsExeEdit())
         addTextBoxChooser(svnExePathLabel_, null, null, svnExePathChooser_);
     
      // terminal path
      terminalPathLabel_ = new Label("Terminal executable:");
      terminalPathChooser_ = new FileChooserTextBox("",
View Full Code Here

   }
  
   // NOTE: mirrors behavior of rEnvironmentDir in SessionMain.cpp
   public String getREnvironmentPath()
   {
      SessionInfo sessionInfo = session_.getSessionInfo();
      if (sessionInfo != null)
      {
         FileSystemItem rEnvDir = null;

         if (getActiveProjectDir() != null)
         {
            rEnvDir = getActiveProjectDir();
         }
         if (sessionInfo.getMode().equals(SessionInfo.DESKTOP_MODE))
         {
            rEnvDir = currentWorkingDir_;
         }
         else
         {
            rEnvDir = FileSystemItem.createDir(
                                       sessionInfo.getInitialWorkingDir());
         }
         return rEnvDir.completePath(".RData");
      }
      else
      {
View Full Code Here

  
   public FileSystemItem getActiveProjectDir()
   {
      if (activeProjectDir_ == null)
      {
         SessionInfo sessionInfo = session_.getSessionInfo();
         if (sessionInfo != null &&
             sessionInfo.getActiveProjectFile() != null)
         {
            activeProjectDir_ = FileSystemItem.createFile(
                           sessionInfo.getActiveProjectFile()).getParentPath();
         }
      }
      return activeProjectDir_;
   }
View Full Code Here

TOP

Related Classes of org.rstudio.studio.client.workbench.model.SessionInfo

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.