Bug 28400 JavaEditorPreferencePage and JavaColorManager leak Colors
20021216 everytime you do this: 1. open java editor pref page 2. close the pref page you end up having allocated and not disposed 8 colors 1 is allocated like this at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createColor(JavaEditorPreferencePage.java:560) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.initializeViewerColors(JavaEditorPreferencePage.java:534) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createPreviewer(JavaEditorPreferencePage.java:493) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createSyntaxPage(JavaEditorPreferencePage.java:433) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createContents(JavaEditorPreferencePage.java:942) at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:209) and the other 7 are allocated like this: at org.eclipse.jdt.internal.ui.text.JavaColorManager.getColor(JavaColorManager.java:62) at org.eclipse.jdt.internal.ui.text.JavaColorManager.getColor(JavaColorManager.java:85) at org.eclipse.jdt.internal.ui.text.AbstractJavaScanner.addToken(AbstractJavaScanner.java:90) at org.eclipse.jdt.internal.ui.text.AbstractJavaScanner.initialize(AbstractJavaScanner.java:75) at org.eclipse.jdt.internal.ui.text.java.JavaCodeScanner.<init>(JavaCodeScanner.java:126) at org.eclipse.jdt.ui.text.JavaTextTools.<init>(JavaTextTools.java:80) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createPreviewer(JavaEditorPreferencePage.java:486) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createSyntaxPage(JavaEditorPreferencePage.java:433) at org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage.createContents(JavaEditorPreferencePage.java:942) at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:209)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
{PreferencesMessages.getString("JavaEditorPreferencePage.currentLineHighlighColor"), PreferenceConstants.EDITOR_CURRENT_LINE_COLOR}, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.printMarginColor2"), PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR}, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.findScopeColor2"), PreferenceConstants.EDITOR_FIND_SCOPE_COLOR}, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.linkedPositionColor2"), PreferenceConstants.EDITOR_LINKED_POSITION_COLOR}, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.linkColor2"), PreferenceConstants.EDITOR_LINK_COLOR}, 
	};
	
	private final String[][] fAnnotationColorListModel= new String[][] {
		{PreferencesMessages.getString("JavaEditorPreferencePage.annotations.errors"), PreferenceConstants.EDITOR_PROBLEM_INDICATION_COLOR, PreferenceConstants.EDITOR_PROBLEM_INDICATION, PreferenceConstants.EDITOR_ERROR_INDICATION_IN_OVERVIEW_RULER }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.annotations.warnings"), PreferenceConstants.EDITOR_WARNING_INDICATION_COLOR, PreferenceConstants.EDITOR_WARNING_INDICATION, PreferenceConstants.EDITOR_WARNING_INDICATION_IN_OVERVIEW_RULER }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.annotations.tasks"), PreferenceConstants.EDITOR_TASK_INDICATION_COLOR, PreferenceConstants.EDITOR_TASK_INDICATION, PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.annotations.searchResults"), PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_COLOR, PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION, PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.annotations.bookmarks"), PreferenceConstants.EDITOR_BOOKMARK_INDICATION_COLOR, PreferenceConstants.EDITOR_BOOKMARK_INDICATION, PreferenceConstants.EDITOR_BOOKMARK_INDICATION_IN_OVERVIEW_RULER }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.annotations.others"), PreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR, PreferenceConstants.EDITOR_UNKNOWN_INDICATION, PreferenceConstants.EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER } 
	};
	private final String[][] fContentAssistColorListModel= new String[][] {
		{PreferencesMessages.getString("JavaEditorPreferencePage.backgroundForCompletionProposals"), PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.foregroundForCompletionProposals"), PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.backgroundForMethodParameters"), PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.foregroundForMethodParameters"), PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.backgroundForCompletionReplacement"), PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND }, 
		{PreferencesMessages.getString("JavaEditorPreferencePage.foregroundForCompletionReplacement"), PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND } 
	};
	private OverlayPreferenceStore fOverlayStore;
	private JavaTextTools fJavaTextTools;
	private JavaEditorHoverConfigurationBlock fJavaEditorHoverConfigurationBlock;
	
	private Map fColorButtons= new HashMap();
	private SelectionListener fColorButtonListener= new SelectionListener() {
		public void widgetDefaultSelected(SelectionEvent e) {