Skip to content

Commit

Permalink
implement initial scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Nov 22, 2019
1 parent 2797dce commit 9252546
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/gwt/src/org/rstudio/studio/client/RStudioGinModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@
import org.rstudio.studio.client.workbench.views.terminal.TerminalPane;
import org.rstudio.studio.client.workbench.views.terminal.TerminalTab;
import org.rstudio.studio.client.workbench.views.terminal.TerminalTabPresenter;
import org.rstudio.studio.client.workbench.views.tutorial.TutorialPane;
import org.rstudio.studio.client.workbench.views.tutorial.TutorialPresenter;
import org.rstudio.studio.client.workbench.views.tutorial.TutorialTab;
import org.rstudio.studio.client.workbench.views.vcs.VCSTab;
import org.rstudio.studio.client.workbench.views.vcs.common.diff.LineTablePresenter;
import org.rstudio.studio.client.workbench.views.vcs.common.diff.LineTableView;
Expand Down Expand Up @@ -350,6 +353,7 @@ protected void configure()
bind(Edit.Display.class).to(EditView.class);
bind(GitPresenter.Display.class).to(GitPane.class);
bind(SVNPresenter.Display.class).to(SVNPane.class);
bind(TutorialPresenter.Display.class).to(TutorialPane.class);
bind(BuildPresenter.Display.class).to(BuildPane.class);
bind(Presentation.Display.class).to(PresentationPane.class);
bind(EnvironmentPresenter.Display.class).to(EnvironmentPane.class);
Expand Down Expand Up @@ -385,6 +389,7 @@ protected void configure()
bindTab("Jobs", JobsTab.class);
bindTab("Launcher", LauncherJobsTab.class);
bindTab("Data Output", DataOutputTab.class);
bindTab("Tutorial", TutorialTab.class);

bind(Shell.Display.class).to(ShellPane.class) ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ well as menu structures (for main menu and popup menus).
<cmd refid="layoutZoomEnvironment"/>
<cmd refid="layoutZoomViewer"/>
<cmd refid="layoutZoomVcs"/>
<cmd refid="layoutZoomTutorial"/>
<cmd refid="layoutZoomBuild"/>
<cmd refid="layoutZoomConnections"/>
</menu>
Expand Down Expand Up @@ -869,6 +870,7 @@ well as menu structures (for main menu and popup menus).
<shortcut refid="layoutZoomVcs" value="Ctrl+Shift+F1"/>
<shortcut refid="layoutZoomBuild" value="Ctrl+Shift+F2"/>
<shortcut refid="layoutZoomConnections" value="Ctrl+Shift+F5"/>
<shortcut refid="layoutZoomTutorial" value="Ctrl+Shift+F6"/>
</shortcutgroup>

</shortcuts>
Expand Down Expand Up @@ -1377,6 +1379,12 @@ well as menu structures (for main menu and popup menus).
menuLabel="Zoom VCS"
windowMode="main"/>

<cmd id="layoutZoomTutorial"
checkable="true"
label="Zoom Tutorial"
menuLabel="Zoom Tutorial"
windowMode="main"/>

<cmd id="layoutZoomBuild"
checkable="true"
label="Zoom Build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@
public abstract AppCommand layoutZoomVcs();
public abstract AppCommand vcsResolve();

// Tutorial
public abstract AppCommand layoutZoomTutorial();

// PDF
public abstract AppCommand showPdfExternal();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static PaneConfig createDefault()
tabSet1.push("Connections");
tabSet1.push("Build");
tabSet1.push("VCS");
tabSet1.push("Tutorial");
tabSet1.push("Presentation");

JsArrayString tabSet2 = createArray().cast();
Expand Down Expand Up @@ -80,7 +81,7 @@ public static String[] getAllTabs()
// A list of all the tabs. Order matters; the Presentation tab must be the
// last element in this array that's part of the first tabset (ts1)
return new String[] {"Environment", "History", "Files", "Plots", "Connections",
"Packages", "Help", "Build", "VCS", "Viewer", "Presentation"};
"Packages", "Help", "Build", "VCS", "Tutorial", "Viewer", "Presentation"};
}

public static String[] getAlwaysVisibleTabs()
Expand All @@ -91,13 +92,13 @@ public static String[] getAlwaysVisibleTabs()

public static String[] getHideableTabs()
{
return new String[] {"Build", "VCS", "Presentation", "Connections", "Packages" };
return new String[] {"Build", "VCS", "Tutorial", "Presentation", "Connections", "Packages" };
}

// Any tabs that were added after our first public release.
public static String[] getAddableTabs()
{
return new String[] {"Build", "VCS", "Presentation", "Connections", "Viewer" };
return new String[] {"Build", "VCS", "Tutorial", "Presentation", "Connections", "Viewer" };
}

// Tabs that have been replaced by newer versions/replaceable supersets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class PaneManager
public interface Binder extends CommandBinder<Commands, PaneManager> {}

public enum Tab {
History, Files, Plots, Packages, Help, VCS, Build, Connections,
History, Files, Plots, Packages, Help, VCS, Tutorial, Build, Connections,
Presentation, Environment, Viewer, Source, Console
}

Expand Down Expand Up @@ -225,6 +225,7 @@ public PaneManager(Provider<MainSplitPanel> pSplitPanel,
@Named("Jobs") final WorkbenchTab jobsTab,
@Named("Launcher") final WorkbenchTab launcherJobsTab,
@Named("Data Output") final WorkbenchTab dataTab,
@Named("Tutorial") final WorkbenchTab tutorialTab,
final MarkersOutputTab markersTab,
final FindOutputTab findOutputTab,
OptionsLoader.Shim optionsLoader)
Expand Down Expand Up @@ -258,6 +259,7 @@ public PaneManager(Provider<MainSplitPanel> pSplitPanel,
optionsLoader_ = optionsLoader;
testsTab_ = testsTab;
dataTab_ = dataTab;
tutorialTab_ = tutorialTab;

binder.bind(commands, this);

Expand Down Expand Up @@ -812,6 +814,8 @@ public WorkbenchTab getTab(Tab tab)
return helpTab_;
case VCS:
return vcsTab_;
case Tutorial:
return tutorialTab_;
case Build:
return buildTab_;
case Presentation:
Expand All @@ -833,7 +837,7 @@ public WorkbenchTab[] getAllTabs()
{
return new WorkbenchTab[] { historyTab_, filesTab_,
plotsTab_, packagesTab_, helpTab_,
vcsTab_, buildTab_, presentationTab_,
vcsTab_, tutorialTab_, buildTab_, presentationTab_,
environmentTab_, viewerTab_,
connectionsTab_, jobsTab_, launcherJobsTab_ };
}
Expand Down Expand Up @@ -1073,6 +1077,8 @@ private Tab tabForName(String name)
return Tab.Help;
if (name.equalsIgnoreCase("vcs"))
return Tab.VCS;
if (name.equalsIgnoreCase("tutorial"))
return Tab.Tutorial;
if (name.equalsIgnoreCase("build"))
return Tab.Build;
if (name.equalsIgnoreCase("presentation"))
Expand Down Expand Up @@ -1108,6 +1114,7 @@ private AppCommand getLayoutCommandForTab(Tab tab)
case Plots: return commands_.layoutZoomPlots();
case Source: return commands_.layoutZoomSource();
case VCS: return commands_.layoutZoomVcs();
case Tutorial: return commands_.layoutZoomTutorial();
case Viewer: return commands_.layoutZoomViewer();
case Connections: return commands_.layoutZoomConnections();
default:
Expand Down Expand Up @@ -1155,6 +1162,7 @@ private List<AppCommand> getLayoutCommands()
commands.add(commands_.layoutZoomPlots());
commands.add(commands_.layoutZoomSource());
commands.add(commands_.layoutZoomVcs());
commands.add(commands_.layoutZoomTutorial());
commands.add(commands_.layoutZoomViewer());
commands.add(commands_.layoutZoomConnections());

Expand Down Expand Up @@ -1200,6 +1208,7 @@ private PaneConfig getCurrentConfig()
private final WorkbenchTab jobsTab_;
private final WorkbenchTab launcherJobsTab_;
private final WorkbenchTab dataTab_;
private final WorkbenchTab tutorialTab_;
private final OptionsLoader.Shim optionsLoader_;
private final MainSplitPanel panel_;
private LogicalWindow sourceLogicalWindow_;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* TutorialPane.java
*
* Copyright (C) 2009-19 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
*
*/
package org.rstudio.studio.client.workbench.views.tutorial;

import org.rstudio.core.client.widget.RStudioFrame;
import org.rstudio.studio.client.common.AutoGlassPanel;
import org.rstudio.studio.client.workbench.ui.WorkbenchPane;

import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class TutorialPane
extends WorkbenchPane
implements TutorialPresenter.Display
{
@Inject
protected TutorialPane()
{
super("Tutorial");
ensureWidget();
}

@Override
protected Widget createMainWidget()
{
frame_ = new RStudioFrame("Tutorial Pane");
frame_.setSize("100%", "100%");
frame_.addStyleName("ace_editor_theme");
frame_.setUrl("about:blank");
return new AutoGlassPanel(frame_);
}

private RStudioFrame frame_;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* TutorialPresenter.java
*
* Copyright (C) 2009-19 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
*
*/
package org.rstudio.studio.client.workbench.views.tutorial;

import org.rstudio.studio.client.workbench.WorkbenchView;
import org.rstudio.studio.client.workbench.views.BasePresenter;

import com.google.inject.Inject;

public class TutorialPresenter
extends BasePresenter
{
public interface Display extends WorkbenchView
{
}

@Inject
protected TutorialPresenter(Display display)
{
super(display);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* TutorialTab.java
*
* Copyright (C) 2009-18 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
*
*/
package org.rstudio.studio.client.workbench.views.tutorial;

import org.rstudio.studio.client.workbench.ui.DelayLoadTabShim;
import org.rstudio.studio.client.workbench.ui.DelayLoadWorkbenchTab;

import com.google.inject.Inject;

public class TutorialTab extends DelayLoadWorkbenchTab<TutorialPresenter>
{
public abstract static class Shim
extends DelayLoadTabShim<TutorialPresenter, TutorialTab>
{
}

@Inject
public TutorialTab(Shim shim)
{
super("Tutorial", shim);
shim_ = shim;
}


@SuppressWarnings("unused")
private final Shim shim_;
}

0 comments on commit 9252546

Please sign in to comment.