Skip to content

Commit

Permalink
make file type names more expressive; add menu separator under R Scri…
Browse files Browse the repository at this point in the history
…pt doc type
  • Loading branch information
jjallaire committed Mar 19, 2012
1 parent 89200ba commit d7c454a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public GlobalToolbar(Commands commands,
// add new source doc commands
ToolbarPopupMenu newMenu = new ToolbarPopupMenu();
newMenu.addItem(commands.newSourceDoc().createMenuItem(false));
newMenu.addSeparator();
newMenu.addItem(commands.newSweaveDoc().createMenuItem(false));

// dynamically add other commands
newMenu.addSeparator();
ArrayList<FileTypeCommands.CommandWithId> fileNewCommands =
fileTypeCommands.commandsWithIds();
for (FileTypeCommands.CommandWithId cmd : fileNewCommands)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public FileTypeCommands(EventBus eventBus, Commands commands)
eventBus_ = eventBus;
commands_ = commands;

addType(FileTypeRegistry.TEXT);
addType(FileTypeRegistry.TEX);
addType(FileTypeRegistry.RD);
addType(FileTypeRegistry.TEXT, "_Text File");
addType(FileTypeRegistry.TEX, "Te_X Document");
addType(FileTypeRegistry.RD, "R _Documentation");
}


Expand All @@ -55,10 +55,10 @@ public ArrayList<CommandWithId> commandsWithIds()
return fileTypeCommands_;
}

private void addType(final TextFileType fileType)
private void addType(final TextFileType fileType, String menuLabel)
{
AppCommand command = new AppCommand();
command.setMenuLabel(fileType.getLabel());
command.setMenuLabel(menuLabel);
command.setImageResource(fileType.getDefaultIcon());
command.addHandler(new CommandHandler()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ well as menu structures (for main menu and popup menus).
<menu label="_File">
<menu label="_New">
<cmd refid="newSourceDoc"/>
<cmd refid="newSweaveDoc"/>
<separator/>
<cmd refid="newSweaveDoc"/>
<dynamic class="org.rstudio.studio.client.common.filetypes.NewFileMenu"/>
</menu>
<separator/>
Expand Down Expand Up @@ -382,7 +382,7 @@ well as menu structures (for main menu and popup menus).
desc="Create a new R script"/>

<cmd id="newSweaveDoc"
menuLabel="_Sweave"
menuLabel="_Sweave Document"
desc="Create a new Sweave document"/>

<cmd id="openSourceDoc"
Expand Down

0 comments on commit d7c454a

Please sign in to comment.