[Pydev-cvs] org.python.pydev/src/org/python/pydev/ui/pythonpathconf JythonInterpreterPreferencesPage
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-08-10 12:26:59
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24235/src/org/python/pydev/ui/pythonpathconf Modified Files: JythonInterpreterPreferencesPage.java AbstractInterpreterPreferencesPage.java InterpreterInfo.java JythonInterpreterEditor.java PythonInterpreterPreferencesPage.java Log Message: jython integration is happening... Index: JythonInterpreterPreferencesPage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/JythonInterpreterPreferencesPage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JythonInterpreterPreferencesPage.java 9 Aug 2005 01:22:27 -0000 1.4 --- JythonInterpreterPreferencesPage.java 10 Aug 2005 12:26:51 -0000 1.5 *************** *** 8,11 **** --- 8,13 ---- + import java.util.List; + import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.swt.widgets.Composite; *************** *** 43,45 **** --- 45,53 ---- monitor.done(); } + + @Override + protected void doClear(List<String> allButTheseInterpreters, IProgressMonitor monitor) { + IInterpreterManager iMan = PydevPlugin.getJythonInterpreterManager(); + iMan.clearAllBut(allButTheseInterpreters); + } } Index: JythonInterpreterEditor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/JythonInterpreterEditor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JythonInterpreterEditor.java 9 Aug 2005 01:22:27 -0000 1.3 --- JythonInterpreterEditor.java 10 Aug 2005 12:26:51 -0000 1.4 *************** *** 8,12 **** import org.eclipse.swt.widgets.Composite; - import org.python.pydev.runners.SimplePythonRunner; import org.python.pydev.ui.interpreters.IInterpreterManager; --- 8,11 ---- Index: AbstractInterpreterPreferencesPage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/AbstractInterpreterPreferencesPage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractInterpreterPreferencesPage.java 9 Aug 2005 01:22:27 -0000 1.1 --- AbstractInterpreterPreferencesPage.java 10 Aug 2005 12:26:51 -0000 1.2 *************** *** 7,12 **** --- 7,15 ---- import java.lang.reflect.InvocationTargetException; + import java.util.ArrayList; + import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; + import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; *************** *** 95,98 **** --- 98,108 ---- */ protected abstract void doRestore(final String defaultSelectedInterpreter, IProgressMonitor monitor); + + /** + * all the information should be cleared but the related to the interpreters passed + * @param allButTheseInterpreters + * @param monitor + */ + protected abstract void doClear(final List<String> allButTheseInterpreters, IProgressMonitor monitor); protected boolean isEditorChanged() { *************** *** 125,128 **** --- 135,139 ---- if(pathEditor.getExesList().getItemCount() <= 0){ + doClear(new ArrayList<String>(),new NullProgressMonitor()); return; *************** *** 132,135 **** --- 143,153 ---- ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(this.getShell()); monitorDialog.setBlockOnOpen(false); + + final List<String> exesToKeep = new ArrayList<String>(); + org.eclipse.swt.widgets.List exesList = pathEditor.getExesList(); + String[] items = exesList.getItems(); + for (String exeToKeep : items) { + exesToKeep.add(exeToKeep); + } try { *************** *** 137,140 **** --- 155,162 ---- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + //clear all but the ones that appear + doClear(exesToKeep,monitor); + + //restore the default doRestore(item, monitor); }}; Index: InterpreterInfo.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** InterpreterInfo.java 8 Aug 2005 19:47:57 -0000 1.18 --- InterpreterInfo.java 10 Aug 2005 12:26:51 -0000 1.19 *************** *** 237,243 **** forcedLibs.add("sys"); forcedLibs.add("datetime"); ! forcedLibs.add("OpenGL"); ! forcedLibs.add("wxPython"); ! forcedLibs.add("itertools"); } --- 237,247 ---- forcedLibs.add("sys"); forcedLibs.add("datetime"); ! if(isJythonInfo()){ ! ! }else{ ! forcedLibs.add("OpenGL"); ! forcedLibs.add("wxPython"); ! forcedLibs.add("itertools"); ! } } *************** *** 265,267 **** --- 269,288 ---- restorePythonpath(buffer.toString(), monitor); } + + /** + * @return whether this info belongs to jython + */ + public boolean isJythonInfo() { + return isJythonExecutable(executableOrJar); + } + + /** + * @param executable the executable we want to know about + * @return if the executable is the jython jar. + */ + public static boolean isJythonExecutable(String executable) { + return executable.endsWith(".jar"); + } + + } \ No newline at end of file Index: PythonInterpreterPreferencesPage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/PythonInterpreterPreferencesPage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonInterpreterPreferencesPage.java 9 Aug 2005 01:22:27 -0000 1.2 --- PythonInterpreterPreferencesPage.java 10 Aug 2005 12:26:51 -0000 1.3 *************** *** 7,10 **** --- 7,12 ---- package org.python.pydev.ui.pythonpathconf; + import java.util.List; + import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.swt.widgets.Composite; *************** *** 46,50 **** monitor.done(); } ! } --- 48,57 ---- monitor.done(); } ! ! @Override ! protected void doClear(List<String> allButTheseInterpreters, IProgressMonitor monitor) { ! IInterpreterManager iMan = PydevPlugin.getPythonInterpreterManager(); ! iMan.clearAllBut(allButTheseInterpreters); ! } } |