int index = toolTip.indexOf('$'); if(index != -1) { toolTip = toolTip.substring(0,index) .concat(toolTip.substring(index + 1)); } if(toolTip.endsWith("...")) toolTip = toolTip.substring(0,toolTip.length() - 3);
toolTip = prettifyMenuLabel(toolTip);
	public static JButton loadToolButton(String name)	{		String iconName = jEdit.getProperty(name + ".icon");		if(iconName == null)		{			System.out.println("Tool button icon is null: " + name);			return null;		}		URL url = GUIUtilities.class.getResource("toolbar/" + iconName);		if(url == null)		{			System.out.println("Tool button icon is null: " + name);			return null;		}		JButton button = new JButton(new ImageIcon(url));		button.setRequestFocusEnabled(false);		String toolTip = jEdit.getProperty(name + ".label");		if(toolTip == null)		{			System.out.println("Tool button label is null: " + name);			return null;		}		int index = toolTip.indexOf('$');		if(index != -1)		{			toolTip = toolTip.substring(0,index)				.concat(toolTip.substring(index + 1));		}		if(toolTip.endsWith("..."))			toolTip = toolTip.substring(0,toolTip.length() - 3);		String shortcut = jEdit.getProperty(name + ".shortcut");		if(shortcut != null)			toolTip = toolTip + " (" + shortcut + ")";		button.setToolTipText(toolTip);		index = name.indexOf('@');		String actionCommand;		if(index != -1)		{			actionCommand = name.substring(index + 1);			name = name.substring(0,index);		}		else			actionCommand = null;		EditAction action = jEdit.getAction(name);		if(action == null)			button.setEnabled(false);		else		{			button.addActionListener(action);			button.setActionCommand(actionCommand);		}		return button;	}