Source:
public FileCommandToolbar(Commands commands, UserPrefs prefs) { super("File Commands"); StandardIcons icons = StandardIcons.INSTANCE; addLeftWidget(commands.newFolder().createToolbarButton()); addLeftSeparator(); addLeftWidget(commands.uploadFile().createToolbarButton()); addLeftSeparator(); addLeftWidget(commands.deleteFiles().createToolbarButton()); addLeftWidget(commands.renameFile().createToolbarButton()); addLeftSeparator(); ToolbarPopupMenu moreMenu = new ToolbarPopupMenu(); moreMenu.addItem(commands.copyFile().createMenuItem(false)); moreMenu.addItem(commands.copyFileTo().createMenuItem(false)); moreMenu.addItem(commands.moveFiles().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(commands.exportFiles().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(commands.setAsWorkingDir().createMenuItem(false)); moreMenu.addItem(commands.goToWorkingDir().createMenuItem(false)); moreMenu.addItem(commands.openNewTerminalAtFilePaneLocation().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(commands.showFolder().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(new UserPrefMenuItem<Boolean>( prefs.showHiddenFiles(), true, "Show Hidden Files", prefs)); ToolbarMenuButton moreButton = new ToolbarMenuButton( "More", "More file commands", new ImageResource2x(icons.more_actions2x()), moreMenu); addLeftWidget(moreButton); ToolbarButton refreshButton = commands.refreshFiles().createToolbarButton(); refreshButton.addStyleName(ThemeStyles.INSTANCE.refreshToolbarButton()); addRightWidget(refreshButton); }

Target:
public FileCommandToolbar(Commands commands, UserPrefs prefs) { super("File Commands"); StandardIcons icons = StandardIcons.INSTANCE; addLeftWidget(commands.newFolder().createToolbarButton()); addLeftSeparator(); addLeftWidget(commands.uploadFile().createToolbarButton()); addLeftSeparator(); addLeftWidget(commands.deleteFiles().createToolbarButton()); addLeftWidget(commands.renameFile().createToolbarButton()); addLeftSeparator(); ToolbarPopupMenu moreMenu = new ToolbarPopupMenu(); moreMenu.addItem(commands.copyFile().createMenuItem(false)); moreMenu.addItem(commands.copyFileTo().createMenuItem(false)); moreMenu.addItem(commands.moveFiles().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(commands.exportFiles().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(commands.setAsWorkingDir().createMenuItem(false)); moreMenu.addItem(commands.goToWorkingDir().createMenuItem(false)); moreMenu.addItem(commands.openNewTerminalAtFilePaneLocation().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(commands.showFolder().createMenuItem(false)); moreMenu.addSeparator(); moreMenu.addItem(new UserPrefMenuItem<Boolean>( prefs.showHiddenFiles(), true, "Show Hidden Files", prefs)); ToolbarMenuButton moreButton = new ToolbarMenuButton( "More", "More file commands", new ImageResource2x(icons.more_actions2x()), moreMenu); ElementIds.assignElementId(moreButton, ElementIds.MB_FILES_MORE); addLeftWidget(moreButton); ToolbarButton refreshButton = commands.refreshFiles().createToolbarButton(); refreshButton.addStyleName(ThemeStyles.INSTANCE.refreshToolbarButton()); addRightWidget(refreshButton); }