1 11 package org.eclipse.ant.internal.ui; 12 13 import org.eclipse.ant.internal.ui.editor.text.IAntEditorColorConstants; 14 import org.eclipse.ant.internal.ui.preferences.AntEditorPreferenceConstants; 15 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 16 import org.eclipse.jface.preference.IPreferenceStore; 17 import org.eclipse.jface.preference.PreferenceConverter; 18 import org.eclipse.swt.graphics.RGB; 19 import org.eclipse.ui.editors.text.EditorsUI; 20 21 public class AntUIPreferenceInitializer extends AbstractPreferenceInitializer { 22 23 public AntUIPreferenceInitializer() { 24 super(); 25 } 26 27 32 public void initializeDefaultPreferences() { 33 IPreferenceStore prefs = AntUIPlugin.getDefault().getPreferenceStore(); 34 prefs.setDefault(IAntUIPreferenceConstants.ANT_FIND_BUILD_FILE_NAMES, "build.xml"); 36 prefs.setDefault(IAntUIPreferenceConstants.DOCUMENTATION_URL, "http://ant.apache.org/manual"); 38 prefs.setDefault(IAntUIPreferenceConstants.ANT_COMMUNICATION_TIMEOUT, 20000); 39 40 EditorsUI.useAnnotationsPreferencePage(prefs); 41 EditorsUI.useQuickDiffPreferencePage(prefs); 42 if (AntUIPlugin.isMacOS()) { 43 prefs.setDefault(IAntUIPreferenceConstants.ANT_TOOLS_JAR_WARNING, false); 45 } else { 46 prefs.setDefault(IAntUIPreferenceConstants.ANT_TOOLS_JAR_WARNING, true); 47 } 48 49 prefs.setDefault(IAntUIPreferenceConstants.ANT_ERROR_DIALOG, true); 50 51 prefs.setDefault(IAntUIPreferenceConstants.ANTEDITOR_FILTER_INTERNAL_TARGETS, false); 52 prefs.setDefault(IAntUIPreferenceConstants.ANTEDITOR_FILTER_IMPORTED_ELEMENTS, false); 53 prefs.setDefault(IAntUIPreferenceConstants.ANTEDITOR_FILTER_PROPERTIES, false); 54 prefs.setDefault(IAntUIPreferenceConstants.ANTEDITOR_FILTER_TOP_LEVEL, false); 55 56 PreferenceConverter.setDefault(prefs, IAntEditorColorConstants.TEXT_COLOR, IAntEditorColorConstants.DEFAULT); 58 PreferenceConverter.setDefault(prefs, IAntEditorColorConstants.PROCESSING_INSTRUCTIONS_COLOR, IAntEditorColorConstants.PROC_INSTR); 59 PreferenceConverter.setDefault(prefs, IAntEditorColorConstants.STRING_COLOR, IAntEditorColorConstants.STRING); 60 PreferenceConverter.setDefault(prefs, IAntEditorColorConstants.TAG_COLOR, IAntEditorColorConstants.TAG); 61 PreferenceConverter.setDefault(prefs, IAntEditorColorConstants.XML_COMMENT_COLOR, IAntEditorColorConstants.XML_COMMENT); 62 PreferenceConverter.setDefault(prefs, IAntEditorColorConstants.XML_DTD_COLOR, IAntEditorColorConstants.XML_DTD); 63 64 PreferenceConverter.setDefault(prefs, IAntUIPreferenceConstants.CONSOLE_ERROR_COLOR, new RGB(255, 0, 0)); PreferenceConverter.setDefault(prefs, IAntUIPreferenceConstants.CONSOLE_WARNING_COLOR, new RGB(250, 100, 0)); PreferenceConverter.setDefault(prefs, IAntUIPreferenceConstants.CONSOLE_INFO_COLOR, new RGB(0, 0, 255)); PreferenceConverter.setDefault(prefs, IAntUIPreferenceConstants.CONSOLE_VERBOSE_COLOR, new RGB(0, 200, 125)); PreferenceConverter.setDefault(prefs, IAntUIPreferenceConstants.CONSOLE_DEBUG_COLOR, new RGB(0, 0, 0)); 70 AntEditorPreferenceConstants.initializeDefaultValues(prefs); 71 } 72 } 73 | Popular Tags |