/** * Removes the given tool from the list of tools. * * @param aTool the tool to remove, cannot be <code>null</code>. */ public void removeTool(final Tool aTool) { if (this.mainFrame != null) { this.mainFrame.removeToolMenuItem(aTool.getName()); } updateActions(); }
/** * Searches for the tool with the given name. * * @param aToolName the name of the tool to search for, cannot be <code>null</code>. * @return the tool with the given name, can be <code>null</code> if no such tool can be found. */ private Tool findToolByName(final String aToolName) { Tool tool = null; final Collection<Tool> tools = getTools(); for (Tool _tool : tools) { if (aToolName.equals(_tool.getName())) { tool = _tool; break; } } return tool; }