[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor PyEdit.java, 1.130, 1.131
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/src/org/python/pydev/editor Modified Files: PyEdit.java Log Message: Removing some compile errors in eclipse 3.4 Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** PyEdit.java 1 Jun 2008 20:44:41 -0000 1.130 --- PyEdit.java 28 Jun 2008 13:29:19 -0000 1.131 *************** *** 26,29 **** --- 26,32 ---- import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.resource.FontDescriptor; + import org.eclipse.jface.resource.JFaceResources; + import org.eclipse.jface.resource.LocalResourceManager; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; *************** *** 41,45 **** import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.widgets.Composite; - import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorActionBarContributor; --- 44,47 ---- *************** *** 48,52 **** import org.eclipse.ui.PartInitException; import org.eclipse.ui.editors.text.TextFileDocumentProvider; - import org.eclipse.ui.internal.util.SWTResourceUtil; import org.eclipse.ui.part.EditorActionBarContributor; import org.eclipse.ui.part.FileEditorInput; --- 50,53 ---- *************** *** 735,738 **** --- 736,744 ---- cache.clear(); cache = null; + + if(this.resourceManager != null){ + this.resourceManager.dispose(); + this.resourceManager = null; + } }catch (Throwable e) { PydevPlugin.log(e); *************** *** 1176,1188 **** } ! /** * Used in the script pyedit_list_bindings.py */ public Font getFont(FontData descriptor) { ! Font font = (Font) SWTResourceUtil.getFontTable().get(descriptor); ! if (font == null) { ! font = new Font(Display.getCurrent(), descriptor); ! SWTResourceUtil.getFontTable().put(descriptor, font); ! } return font; } --- 1182,1206 ---- } ! private LocalResourceManager resourceManager; ! ! public LocalResourceManager getResourceManager() { ! if(resourceManager == null){ ! resourceManager = new LocalResourceManager(JFaceResources.getResources()); ! } ! return resourceManager; ! } ! ! /** * Used in the script pyedit_list_bindings.py */ public Font getFont(FontData descriptor) { ! Font font = getResourceManager().createFont(FontDescriptor.createFrom(descriptor)); ! ! // Old implementation (for Eclipse 3.3) ! // Font font = (Font) SWTResourceUtil.getFontTable().get(descriptor); ! // if (font == null) { ! // font = new Font(Display.getCurrent(), descriptor); ! // SWTResourceUtil.getFontTable().put(descriptor, font); ! // } return font; } |