[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor PyEdit.java,1.33,1.34
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-02-18 11:14:45
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18423/src/org/python/pydev/editor Modified Files: PyEdit.java Log Message: Added patch to enable better color management. Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** PyEdit.java 31 Jan 2005 17:23:12 -0000 1.33 --- PyEdit.java 18 Feb 2005 11:14:34 -0000 1.34 *************** *** 20,26 **** import org.eclipse.core.runtime.Preferences; import org.eclipse.jface.action.IAction; - import org.eclipse.jface.preference.IPreferenceStore; - import org.eclipse.jface.preference.PreferenceStore; - import org.eclipse.jface.resource.StringConverter; import org.eclipse.jface.text.Assert; import org.eclipse.jface.text.BadLocationException; --- 20,23 ---- *************** *** 37,42 **** import org.eclipse.ui.editors.text.ILocationProvider; import org.eclipse.ui.part.FileEditorInput; - import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; - import org.eclipse.ui.texteditor.AbstractTextEditor; import org.eclipse.ui.texteditor.DefaultRangeIndicator; import org.eclipse.ui.texteditor.IEditorStatusLine; --- 34,37 ---- *************** *** 126,140 **** colorCache = new ColorCache(pluginPrefs); - //call updatePyDevPluginPrefs() when Pydev prefs are modified - //TODO: update the syntax highlighting colors too - Preferences.IPropertyChangeListener listener = new Preferences.IPropertyChangeListener() { - public void propertyChange(Preferences.PropertyChangeEvent event) { - updatePyDevPluginPrefs(); - } - }; - pluginPrefs.addPropertyChangeListener(listener); - - updatePyDevPluginPrefs(); - if (getDocumentProvider() == null) { setDocumentProvider(new PyDocumentProvider()); --- 121,124 ---- *************** *** 570,605 **** } ! //TODO: REMOVED: when not using it, some things are not editable (I guess that we have to move all that ! //to the plugin in order to get this kind of 'independence'. ! // protected void initializeEditor() ! // { ! // //Use a fresh PreferenceStore to avoid modifying the default TextEditor PreferenceStore ! // //All the TextEditor defaults will be used unless explicitly set in this PreferenceStore ! // super.initializeEditor(); ! // this.setPreferenceStore(new PreferenceStore()); ! // } ! ! private void updatePyDevPluginPrefs() { ! Preferences pluginPrefs = PydevPrefs.getPreferences(); ! colorCache = new ColorCache(pluginPrefs); ! IPreferenceStore edprefs = getPreferenceStore(); ! ! if(edprefs == null){ ! edprefs = new PreferenceStore(); ! this.setPreferenceStore(edprefs); ! } ! ! edprefs.setValue(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, ! pluginPrefs.getBoolean(PydevPrefs.EDITOR_CURRENT_LINE)); ! edprefs.setValue(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR, ! StringConverter.asString(colorCache.getNamedColor( ! PydevPrefs.EDITOR_CURRENT_LINE_COLOR).getRGB())); ! ! edprefs.setValue(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, ! !pluginPrefs.getBoolean(PydevPrefs.EDITOR_USE_CUSTOM_BACKGROUND_COLOR)); ! edprefs.setValue(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, ! StringConverter.asString(colorCache.getNamedColor( ! PydevPrefs.EDITOR_BACKGROUND_COLOR).getRGB())); } } --- 554,561 ---- } ! protected void initializeEditor() { ! super.initializeEditor(); ! this.setPreferenceStore(PydevPlugin.getDefault().getPreferenceStore()); } } |