pydev-cvs Mailing List for PyDev for Eclipse (Page 311)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
(4) |
Mar
(48) |
Apr
(56) |
May
(64) |
Jun
(27) |
Jul
(66) |
Aug
(81) |
Sep
(148) |
Oct
(194) |
Nov
(78) |
Dec
(46) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(125) |
Feb
(126) |
Mar
(163) |
Apr
(133) |
May
(115) |
Jun
(307) |
Jul
(387) |
Aug
(417) |
Sep
(283) |
Oct
(148) |
Nov
(45) |
Dec
(53) |
2006 |
Jan
(240) |
Feb
(200) |
Mar
(267) |
Apr
(231) |
May
(245) |
Jun
(361) |
Jul
(142) |
Aug
(12) |
Sep
(210) |
Oct
(99) |
Nov
(7) |
Dec
(30) |
2007 |
Jan
(161) |
Feb
(511) |
Mar
(265) |
Apr
(74) |
May
(147) |
Jun
(151) |
Jul
(94) |
Aug
(68) |
Sep
(98) |
Oct
(144) |
Nov
(26) |
Dec
(36) |
2008 |
Jan
(98) |
Feb
(107) |
Mar
(199) |
Apr
(113) |
May
(119) |
Jun
(112) |
Jul
(92) |
Aug
(71) |
Sep
(101) |
Oct
(16) |
Nov
|
Dec
|
From: Aleksandar T. <at...@us...> - 2004-07-02 02:50:46
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18059/src/org/python/pydev/editor/actions Removed Files: PyUncommentTest.java PyStripTrailingWhitespaceTest.java PyAddBlockCommentTest.java PyCommentTest.java AllTests.java PyRemoveBlockCommentTest.java PyConvertSpaceToTabTest.java PyConvertTabToSpaceTest.java Log Message: 3.0 port --- PyConvertTabToSpaceTest.java DELETED --- --- PyStripTrailingWhitespaceTest.java DELETED --- --- PyCommentTest.java DELETED --- --- PyRemoveBlockCommentTest.java DELETED --- --- AllTests.java DELETED --- --- PyUncommentTest.java DELETED --- --- PyAddBlockCommentTest.java DELETED --- --- PyConvertSpaceToTabTest.java DELETED --- |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:50:35
|
Update of /cvsroot/pydev/org.python.pydev/doc/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18035/doc/test Log Message: Directory /cvsroot/pydev/org.python.pydev/doc/test added to the repository |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:27:07
|
Update of /cvsroot/pydev/org.pydev.jython In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14478 Modified Files: .classpath Log Message: 3.0 port, cleaning up the classpath Index: .classpath =================================================================== RCS file: /cvsroot/pydev/org.pydev.jython/.classpath,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .classpath 14 Jun 2004 12:44:55 -0000 1.5 --- .classpath 2 Jul 2004 02:26:58 -0000 1.6 *************** *** 1,9 **** <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry exported="true" kind="lib" path="jython.jar"/> ! <classpathentry kind="src" path="/org.eclipse.core.boot"/> ! <classpathentry kind="src" path="/org.eclipse.core.runtime"/> ! <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="jythonlib.jar"/> ! <classpathentry kind="output" path="bin"/> </classpath> --- 1,7 ---- <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry exported="true" kind="lib" path="jython.jar"/> ! <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> ! <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="output" path="bin"/> </classpath> |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:26:11
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunnerConfig.java PythonLaunchConfigurationDelegate.java Log Message: 3.0 port Index: PythonRunnerConfig.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PythonRunnerConfig.java 7 May 2004 21:50:59 -0000 1.5 --- PythonRunnerConfig.java 2 Jul 2004 02:26:01 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- import java.io.File; + import java.io.IOException; import java.net.URL; import java.util.Vector; *************** *** 14,21 **** import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; ! import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext; import org.python.pydev.debug.core.Constants; import org.python.pydev.debug.core.PydevDebugPlugin; --- 15,24 ---- import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; + import org.eclipse.core.runtime.Platform; + import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; ! import org.osgi.framework.Bundle; import org.python.pydev.debug.core.Constants; import org.python.pydev.debug.core.PydevDebugPlugin; *************** *** 38,41 **** --- 41,45 ---- public String debugScript; public int acceptTimeout = 5000; // miliseconds + public String[] envp = null; /** *************** *** 43,58 **** */ ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode, ExpandVariableContext resourceContext) throws CoreException { isDebug = mode.equals(ILaunchManager.DEBUG_MODE); ! file = ExternalToolsUtil.getLocation(conf, resourceContext); interpreter = conf.getAttribute(Constants.ATTR_INTERPRETER, "python"); ! arguments = ExternalToolsUtil.getArguments(conf, resourceContext); ! IPath workingPath = ExternalToolsUtil.getWorkingDirectory(conf, resourceContext); workingDirectory = workingPath == null ? null : workingPath.toFile(); if (isDebug) { debugScript = getDebugScript(); } ! // E3 String[] envp = DebugPlugin.getDefault().getLaunchManager().getEnvironment(conf); ! } --- 47,61 ---- */ ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode) throws CoreException { isDebug = mode.equals(ILaunchManager.DEBUG_MODE); ! file = ExternalToolsUtil.getLocation(conf); interpreter = conf.getAttribute(Constants.ATTR_INTERPRETER, "python"); ! arguments = ExternalToolsUtil.getArguments(conf); ! IPath workingPath = ExternalToolsUtil.getWorkingDirectory(conf); workingDirectory = workingPath == null ? null : workingPath.toFile(); if (isDebug) { debugScript = getDebugScript(); } ! envp = DebugPlugin.getDefault().getLaunchManager().getEnvironment(conf); } *************** *** 92,99 **** // IPath relative = new Path("pysrc").addTrailingSeparator().append("jpydaemon.py"); // IPath relative = new Path("pysrc").addTrailingSeparator().append("rpdb.py"); ! URL location = org.python.pydev.debug.core.PydevDebugPlugin.getDefault().find(relative); ! if (location == null) ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Internal pydev error: Cannot find pydevd.py", null)); ! return location.getPath(); } --- 95,111 ---- // IPath relative = new Path("pysrc").addTrailingSeparator().append("jpydaemon.py"); // IPath relative = new Path("pysrc").addTrailingSeparator().append("rpdb.py"); ! Bundle bundle = PydevDebugPlugin.getDefault().getBundle(); ! URL bundleURL = Platform.find( bundle, relative); ! URL fileURL; ! try { ! fileURL = Platform.resolve( bundleURL); ! String fixmePath = fileURL.getPath(); // this gets you /D:/eclipse3/workspace/org.python.pydev.debug/pysrc/pydevd.py ! if (fixmePath.charAt(2) == ':') // Windows path, fix remove the front slash ! fixmePath = fixmePath.substring(1); ! IPath fullPath = new Path(fixmePath); ! return fullPath.toOSString(); ! } catch (IOException e) { ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Can't find python debug script", null)); ! } } Index: PythonLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonLaunchConfigurationDelegate.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonLaunchConfigurationDelegate.java 7 May 2004 02:03:06 -0000 1.6 --- PythonLaunchConfigurationDelegate.java 2 Jul 2004 02:26:01 -0000 1.7 *************** *** 16,22 **** import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.ui.IWindowListener; - import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; - // import org.eclipse.ui.externaltools.internal.program.launchConfigurations.BackgroundResourceRefresher; - import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext; import org.python.pydev.debug.core.PydevDebugPlugin; --- 16,19 ---- *************** *** 47,52 **** monitor.beginTask("Preparing configuration", 3); ! ExpandVariableContext resourceContext = ExternalToolsUtil.getVariableContext(); ! PythonRunnerConfig runConfig = new PythonRunnerConfig(conf, mode, resourceContext); PythonRunner runner = new PythonRunner(); --- 44,48 ---- monitor.beginTask("Preparing configuration", 3); ! PythonRunnerConfig runConfig = new PythonRunnerConfig(conf, mode); PythonRunner runner = new PythonRunner(); *************** *** 62,79 **** // try { // PythonDebugClient test = new PythonDebugClient(); ! // test.init("localhost", 29000, -1, null, null, null); // do whatever needs the contextClassLoader // } catch (PythonDebugException e1) { // DebugPlugin.log(e1); // } finally { // cur.setContextClassLoader(save); ! // } ! // E3 if (CommonTab.isLaunchInBackground(conf)) { ! // E3 // refresh resources after process finishes ! // E3 if (RefreshTab.getRefreshScope(conf) != null) { ! // E3 BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(conf, process); ! // E3 refresher.startBackgroundRefresh(); ! // E3 } ! // refresh resources ! // E3 RefreshTab.refreshResources(conf, monitor); } } --- 58,77 ---- // try { // PythonDebugClient test = new PythonDebugClient(); ! // test.init("localhost", 29000, -1, null, null, null); // do whatever needs the ! // contextClassLoader // } catch (PythonDebugException e1) { // DebugPlugin.log(e1); // } finally { // cur.setContextClassLoader(save); ! // } ! // if (CommonTab.isLaunchInBackground(conf)) { ! // // refresh resources after process finishes ! // if (RefreshTab.getRefreshScope(conf) != null) { ! // BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(conf, process); ! // refresher.startBackgroundRefresh(); ! // } ! // // refresh resources ! // RefreshTab.refreshResources(conf, monitor); ! // } } } |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:26:11
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307/src/org/python/pydev/debug/model Modified Files: PyThread.java PyVariable.java PyDebugTarget.java PyStackFrame.java Log Message: 3.0 port Index: PyThread.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyThread.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyThread.java 7 May 2004 21:50:59 -0000 1.5 --- PyThread.java 2 Jul 2004 02:26:00 -0000 1.6 *************** *** 195,199 **** else if (adapter.equals(ITaskListResourceAdapter.class)) return null; ! else if (adapter.equals(IPropertySource.class) || adapter.equals(ITaskListResourceAdapter.class)) return super.getAdapter(adapter); else { --- 195,203 ---- else if (adapter.equals(ITaskListResourceAdapter.class)) return null; ! else if (adapter.equals(IPropertySource.class) ! || adapter.equals(ITaskListResourceAdapter.class) ! || adapter.equals(org.eclipse.debug.ui.actions.IToggleBreakpointsTarget.class) ! || adapter.equals(org.eclipse.debug.ui.actions.IRunToLineTarget.class) ! ) return super.getAdapter(adapter); else { Index: PyStackFrame.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyStackFrame.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyStackFrame.java 5 May 2004 02:02:00 -0000 1.3 --- PyStackFrame.java 2 Jul 2004 02:26:00 -0000 1.4 *************** *** 202,207 **** else if (adapter.equals(ITaskListResourceAdapter.class)) return null; ! else if (adapter.equals(IPropertySource.class) || ! adapter.equals(ITaskListResourceAdapter.class)) return super.getAdapter(adapter); // ongoing, I do not fully understand all the interfaces they'd like me to support --- 202,210 ---- else if (adapter.equals(ITaskListResourceAdapter.class)) return null; ! else if (adapter.equals(IPropertySource.class) ! || adapter.equals(ITaskListResourceAdapter.class) ! || adapter.equals(org.eclipse.debug.ui.actions.IToggleBreakpointsTarget.class) ! || adapter.equals(org.eclipse.debug.ui.actions.IRunToLineTarget.class) ! ) return super.getAdapter(adapter); // ongoing, I do not fully understand all the interfaces they'd like me to support Index: PyVariable.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyVariable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyVariable.java 7 May 2004 21:50:59 -0000 1.2 --- PyVariable.java 2 Jul 2004 02:26:00 -0000 1.3 *************** *** 100,105 **** public Object getAdapter(Class adapter) { ! if (adapter.equals(ILaunch.class) || ! adapter.equals(IResource.class)) return target.getAdapter(adapter); else if (adapter.equals(IPropertySource.class) || --- 100,104 ---- public Object getAdapter(Class adapter) { ! if (adapter.equals(ILaunch.class)) return target.getAdapter(adapter); else if (adapter.equals(IPropertySource.class) || *************** *** 108,111 **** --- 107,113 ---- adapter.equals(org.eclipse.ui.IActionFilter.class) || adapter.equals(org.eclipse.ui.model.IWorkbenchAdapter.class) + || adapter.equals(org.eclipse.debug.ui.actions.IToggleBreakpointsTarget.class) + || adapter.equals(org.eclipse.debug.ui.actions.IRunToLineTarget.class) + || adapter.equals(IResource.class) ) return super.getAdapter(adapter); Index: PyDebugTarget.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyDebugTarget.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyDebugTarget.java 7 May 2004 21:50:59 -0000 1.6 --- PyDebugTarget.java 2 Jul 2004 02:26:00 -0000 1.7 *************** *** 282,286 **** } else if (adapter.equals(IPropertySource.class)) return launch.getAdapter(adapter); ! else if (adapter.equals(ITaskListResourceAdapter.class)) return super.getAdapter(adapter); System.err.println("Need adapter " + adapter.toString()); --- 282,289 ---- } else if (adapter.equals(IPropertySource.class)) return launch.getAdapter(adapter); ! else if (adapter.equals(ITaskListResourceAdapter.class) ! || adapter.equals(org.eclipse.debug.ui.actions.IRunToLineTarget.class) ! || adapter.equals(org.eclipse.debug.ui.actions.IToggleBreakpointsTarget.class) ! ) return super.getAdapter(adapter); System.err.println("Need adapter " + adapter.toString()); |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:26:11
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307/src/org/python/pydev/debug/core Modified Files: PydevDebugPlugin.java Log Message: 3.0 port Index: PydevDebugPlugin.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/core/PydevDebugPlugin.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PydevDebugPlugin.java 17 May 2004 20:17:17 -0000 1.6 --- PydevDebugPlugin.java 2 Jul 2004 02:26:01 -0000 1.7 *************** *** 8,11 **** --- 8,12 ---- import org.eclipse.core.resources.*; import org.eclipse.jface.dialogs.ErrorDialog; + import org.osgi.framework.BundleContext; import org.python.pydev.ui.ImageCache; /** *************** *** 20,27 **** public ImageCache imageCache; ! public PydevDebugPlugin(IPluginDescriptor descriptor) { ! super(descriptor); plugin = this; ! imageCache = new ImageCache(getDescriptor().getInstallURL()); } --- 21,31 ---- public ImageCache imageCache; ! public PydevDebugPlugin() { plugin = this; ! } ! ! public void start(BundleContext context) throws Exception { ! super.start(context); ! imageCache = new ImageCache(PydevDebugPlugin.getDefault().getBundle().getEntry("/")); } *************** *** 31,35 **** public static String getPluginID() { ! return getDefault().getDescriptor().getUniqueIdentifier(); } --- 35,39 ---- public static String getPluginID() { ! return getDefault().getBundle().getSymbolicName(); } |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:26:11
|
Update of /cvsroot/pydev/org.python.pydev.debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307 Modified Files: .project .cvsignore plugin.xml Log Message: 3.0 port Index: .cvsignore =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 8 Jan 2004 22:47:21 -0000 1.1 --- .cvsignore 2 Jul 2004 02:26:01 -0000 1.2 *************** *** 1 **** --- 1,2 ---- bin + build.xml Index: .project =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/.project,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .project 17 May 2004 20:17:16 -0000 1.5 --- .project 2 Jul 2004 02:26:01 -0000 1.6 *************** *** 4,16 **** <comment></comment> <projects> - <project>org.apache.xerces</project> - <project>org.eclipse.core.boot</project> - <project>org.eclipse.core.resources</project> - <project>org.eclipse.core.runtime</project> - <project>org.eclipse.debug.core</project> - <project>org.eclipse.debug.ui</project> - <project>org.eclipse.ui</project> - <project>org.eclipse.ui.views</project> - <project>org.python.pydev</project> </projects> <buildSpec> --- 4,7 ---- Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/plugin.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** plugin.xml 17 May 2004 20:17:16 -0000 1.11 --- plugin.xml 2 Jul 2004 02:26:01 -0000 1.12 *************** *** 1,7 **** <?xml version="1.0" encoding="UTF-8"?> <plugin id="org.python.pydev.debug" name="Pydev debug" ! version="0.4.1" provider-name="Aleks Totic" class="org.python.pydev.debug.core.PydevDebugPlugin"> --- 1,8 ---- <?xml version="1.0" encoding="UTF-8"?> + <?eclipse version="3.0"?> <plugin id="org.python.pydev.debug" name="Pydev debug" ! version="0.5" provider-name="Aleks Totic" class="org.python.pydev.debug.core.PydevDebugPlugin"> *************** *** 22,26 **** <import plugin="org.eclipse.debug.ui"/> <import plugin="org.python.pydev"/> ! <import plugin="org.apache.xerces"/> </requires> --- 23,29 ---- <import plugin="org.eclipse.debug.ui"/> <import plugin="org.python.pydev"/> ! <import plugin="org.eclipse.ui.workbench.texteditor"/> ! <import plugin="org.eclipse.ui.ide"/> ! <import plugin="org.eclipse.core.variables"/> </requires> *************** *** 192,196 **** </extension> <extension ! point="org.eclipse.ui.markerImageProviders"> <imageprovider id="pythonBreakPointImage" markertype="org.python.pydev.debug.pyStopBreakpointMarker" --- 195,199 ---- </extension> <extension ! point="org.eclipse.ui.ide.markerImageProviders"> <imageprovider id="pythonBreakPointImage" markertype="org.python.pydev.debug.pyStopBreakpointMarker" |
From: Aleksandar T. <at...@us...> - 2004-07-02 02:26:10
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307/src/org/python/pydev/debug/ui Modified Files: PythonTabGroup.java PythonMainTab.java Log Message: 3.0 port Index: PythonTabGroup.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/PythonTabGroup.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonTabGroup.java 10 Jan 2004 03:13:18 -0000 1.2 --- PythonTabGroup.java 2 Jul 2004 02:26:00 -0000 1.3 *************** *** 8,15 **** import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; import org.eclipse.debug.ui.CommonTab; ! // E3 import org.eclipse.debug.ui.EnvironmentTab; import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchConfigurationTab; ! // E3 import org.eclipse.debug.ui.RefreshTab; /** --- 8,15 ---- import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; import org.eclipse.debug.ui.CommonTab; ! import org.eclipse.debug.ui.EnvironmentTab; import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchConfigurationTab; ! import org.eclipse.debug.ui.RefreshTab; /** *************** *** 23,28 **** ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new PythonMainTab(), ! // E3 new RefreshTab(), ! // E3 new EnvironmentTab(), new CommonTab() }; setTabs(tabs); --- 23,28 ---- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new PythonMainTab(), ! new RefreshTab(), ! new EnvironmentTab(), new CommonTab() }; setTabs(tabs); Index: PythonMainTab.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/PythonMainTab.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PythonMainTab.java 15 Apr 2004 23:24:49 -0000 1.5 --- PythonMainTab.java 2 Jul 2004 02:26:00 -0000 1.6 *************** *** 23,26 **** --- 23,27 ---- import org.eclipse.swt.widgets.*; import org.python.pydev.debug.core.*; + import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.plugin.PydevPrefs; import org.python.pydev.ui.InterpreterEditor; *************** *** 156,160 **** try { URL url = new URL( ! PydevDebugPlugin.getDefault().getDescriptor().getInstallURL(), Constants.MAIN_ICON); desc = ImageDescriptor.createFromURL(url); --- 157,161 ---- try { URL url = new URL( ! PydevPlugin.getDefault().getBundle().getEntry("/"), Constants.MAIN_ICON); desc = ImageDescriptor.createFromURL(url); *************** *** 177,181 **** * refresh in reverse (updateMessage, then buttons) * This does not work well (Message uses ol - * E3 fixes this problem */ protected void updateLaunchConfigurationDialog() { --- 178,181 ---- *************** *** 183,187 **** getLaunchConfigurationDialog().updateButtons(); getLaunchConfigurationDialog().updateMessage(); ! getLaunchConfigurationDialog().updateButtons(); } } --- 183,187 ---- getLaunchConfigurationDialog().updateButtons(); getLaunchConfigurationDialog().updateMessage(); ! // getLaunchConfigurationDialog().updateButtons(); } } |
From: Aleksandar T. <at...@us...> - 2004-06-25 00:05:34
|
Update of /cvsroot/pydev/org.python.pydev.feature In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24525 Modified Files: feature.xml Log Message: Version 0.4 Index: feature.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.feature/feature.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** feature.xml 10 Jan 2004 03:14:20 -0000 1.2 --- feature.xml 25 Jun 2004 00:05:23 -0000 1.3 *************** *** 3,7 **** id="org.python.pydev.feature" label="org.python.pydev.feature" ! version="0.3.0" provider-name="Aleks Totic"> --- 3,7 ---- id="org.python.pydev.feature" label="org.python.pydev.feature" ! version="0.4.2" provider-name="Aleks Totic"> *************** *** 35,38 **** --- 35,39 ---- <import plugin="org.eclipse.ui.workbench.texteditor"/> <import plugin="org.eclipse.jface.text"/> + <import plugin="org.eclipse.jdt.ui"/> <import plugin="org.eclipse.core.boot"/> <import plugin="org.eclipse.ui.externaltools"/> *************** *** 43,61 **** <plugin id="org.python.pydev" ! download-size="204" ! install-size="204" ! version="0.3.0"/> <plugin id="org.python.pydev.debug" ! download-size="50" ! install-size="50" ! version="0.3.0"/> <plugin id="org.python.pydev.help" ! download-size="50" ! install-size="50" ! version="0.3.0"/> </feature> --- 44,62 ---- <plugin id="org.python.pydev" ! download-size="275" ! install-size="275" ! version="0.4.2"/> <plugin id="org.python.pydev.debug" ! download-size="87" ! install-size="87" ! version="0.4.2"/> <plugin id="org.python.pydev.help" ! download-size="100" ! install-size="100" ! version="0.4.0"/> </feature> |
From: Parhaum T. <dre...@us...> - 2004-06-21 21:37:09
|
Update of /cvsroot/pydev/org.python.pydev.help/html/userguide In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21953/html/userguide Modified Files: editor_gotopmc.html editor_syntaxh.html preferences.html editor_autoi.html editor_stripw.html index.html editor_comment.html editor_gotonmc.html editor_gotofc.html editor_blockc.html Added Files: editor_converttts.html editor_convertstt.html Log Message: - Added JUnit test for editor actions that I've made or are related to ones I've made. This is something I need for my project that this is for, and in order to test things out like adding block comments, I had to revamp how they functioned to allow them to accept a mock Document as opposed to grabbing it from the Active Editor. This created the PySelection entity, which was basically being used anyway by many of the actions, which serves to accept a document input and make the proper selection given passed criteria. Since I didn't get a 'no' when I asked if the JUnit testing was ok, I assumed it wasn't a problem to put them in. I can revert them all back to their original form, if desired. - 2 new actions - ConvertTabToSpace and ConvertSpaceToTab, basically the user can select lines or none at all (to affect whole document) and convert tabs and tab-width-spaces back and forth - Plugin.xml adjusted to account for the new action - Skeleton help files added for new actions, TOC modified Index: index.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 14 Jun 2004 20:22:13 -0000 1.2 --- index.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: index.html Author: Parhaum Toofanian, Copyright 2004 *************** *** 47,50 **** --- 47,52 ---- <li><a href="editor_blockc.html">Block Commenting</a> <li><a href="editor_comment.html">Bulk Commenting</a> + <li><a href="editor_convertstt.html">Convert Space to Tab</a> + <li><a href="editor_converttts.html">Convert Tab to Space</a> <li><a href="editor_parsing.html">Error Parsing</a> <li><a href="editor_gotofc.html">Go to First Character</a> Index: editor_syntaxh.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_syntaxh.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_syntaxh.html 14 Jun 2004 20:22:13 -0000 1.2 --- editor_syntaxh.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_syntaxh.html Author: Parhaum Toofanian, Copyright 2004 --- NEW FILE: editor_convertstt.html --- <!--=============================================================================================== File: editor_convertstt.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Convert Space To Tab feature. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Convert Space To Tab'; links[i++] = 'editor_convertstt.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> Index: editor_stripw.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_stripw.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_stripw.html 14 Jun 2004 20:22:13 -0000 1.2 --- editor_stripw.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_stripw.html Author: Parhaum Toofanian, Copyright 2004 Index: editor_gotonmc.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_gotonmc.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_gotonmc.html 14 Jun 2004 20:22:13 -0000 1.1 --- editor_gotonmc.html 21 Jun 2004 21:36:51 -0000 1.2 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_nmc.html Author: Parhaum Toofanian, Copyright 2004 Index: editor_gotofc.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_gotofc.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_gotofc.html 14 Jun 2004 20:22:13 -0000 1.1 --- editor_gotofc.html 21 Jun 2004 21:36:51 -0000 1.2 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_gotofc.html Author: Parhaum Toofanian, Copyright 2004 Index: editor_autoi.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_autoi.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_autoi.html 14 Jun 2004 20:22:13 -0000 1.2 --- editor_autoi.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_autoi.html Author: Parhaum Toofanian, Copyright 2004 Index: preferences.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/preferences.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** preferences.html 14 Jun 2004 20:22:13 -0000 1.2 --- preferences.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: preferences.html Author: Parhaum Toofanian, Copyright 2004 --- NEW FILE: editor_converttts.html --- <!--=============================================================================================== File: editor_converttts.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Convert Tab To Space feature. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Convert Tab to Space'; links[i++] = 'editor_converttss.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> Index: editor_comment.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_comment.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_comment.html 14 Jun 2004 20:22:13 -0000 1.2 --- editor_comment.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_comment.html Author: Parhaum Toofanian, Copyright 2004 Index: editor_blockc.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_blockc.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_blockc.html 14 Jun 2004 20:22:13 -0000 1.2 --- editor_blockc.html 21 Jun 2004 21:36:51 -0000 1.3 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_blockc.html Author: Parhaum Toofanian, Copyright 2004 Index: editor_gotopmc.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_gotopmc.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_gotopmc.html 14 Jun 2004 20:22:13 -0000 1.1 --- editor_gotopmc.html 21 Jun 2004 21:36:51 -0000 1.2 *************** *** 1,5 **** <!--=============================================================================================== ! File: about.html Author: Parhaum Toofanian, Copyright 2004 --- 1,5 ---- <!--=============================================================================================== ! File: editor_gotopmc.html Author: Parhaum Toofanian, Copyright 2004 |
From: Parhaum T. <dre...@us...> - 2004-06-21 21:37:09
|
Update of /cvsroot/pydev/org.python.pydev.help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21953 Modified Files: toc_main.xml Log Message: - Added JUnit test for editor actions that I've made or are related to ones I've made. This is something I need for my project that this is for, and in order to test things out like adding block comments, I had to revamp how they functioned to allow them to accept a mock Document as opposed to grabbing it from the Active Editor. This created the PySelection entity, which was basically being used anyway by many of the actions, which serves to accept a document input and make the proper selection given passed criteria. Since I didn't get a 'no' when I asked if the JUnit testing was ok, I assumed it wasn't a problem to put them in. I can revert them all back to their original form, if desired. - 2 new actions - ConvertTabToSpace and ConvertSpaceToTab, basically the user can select lines or none at all (to affect whole document) and convert tabs and tab-width-spaces back and forth - Plugin.xml adjusted to account for the new action - Skeleton help files added for new actions, TOC modified Index: toc_main.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/toc_main.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** toc_main.xml 14 Jun 2004 20:22:13 -0000 1.4 --- toc_main.xml 21 Jun 2004 21:36:52 -0000 1.5 *************** *** 11,14 **** --- 11,16 ---- <topic label="Block Comment" href="html/userguide/editor_blockc.html"/> <topic label="Bulk Comment" href="html/userguide/editor_comment.html"/> + <topic label="Convert Space to Tab" href="html/userguide/editor_convertstt.html"/> + <topic label="Convert Tab to Space" href="html/userguide/editor_converttts.html"/> <topic label="Error Parsing" href="html/userguide/editor_parsing.html"/> <topic label="Go to First Character" href="html/userguide/editor_gotofc.html"/> |
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21826/src/org/python/pydev/editor/actions Modified Files: PyUncomment.java PyRemoveBlockComment.java PyAddBlockComment.java PyAction.java PyComment.java PyStripTrailingWhitespace.java Added Files: PyUncommentTest.java PyStripTrailingWhitespaceTest.java PyConvertSpaceToTab.java PyConvertTabToSpace.java PyConvertSpaceToTabTest.java PyAddBlockCommentTest.java PySelection.java PyConvertTabToSpaceTest.java PyCommentTest.java AllTests.java PyRemoveBlockCommentTest.java Log Message: - Added JUnit test for editor actions that I've made or are related to ones I've made. This is something I need for my project that this is for, and in order to test things out like adding block comments, I had to revamp how they functioned to allow them to accept a mock Document as opposed to grabbing it from the Active Editor. This created the PySelection entity, which was basically being used anyway by many of the actions, which serves to accept a document input and make the proper selection given passed criteria. Since I didn't get a 'no' when I asked if the JUnit testing was ok, I assumed it wasn't a problem to put them in. I can revert them all back to their original form, if desired. - 2 new actions - ConvertTabToSpace and ConvertSpaceToTab, basically the user can select lines or none at all (to affect whole document) and convert tabs and tab-width-spaces back and forth - Plugin.xml adjusted to account for the new action - Skeleton help files added for new actions, TOC modified --- NEW FILE: PyStripTrailingWhitespaceTest.java --- /* * Created on Jun 16, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.python.pydev.editor.actions; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import junit.framework.TestCase; /** * @author Dreamer * * Tests the 'Strip Trailing Whitespace' editor feature. It performs 4 checks. * * The first checks to see if the simple String-input 'trim' feature works properly. * * The other 3 are code-based checks. * * The first fakes a selection of a couple lines in a fake document, and checks * to see that the proper whitespace is removed. * * The second fakes a selection but stops in the * middle of a line, to make sure that the Whitespace handler doesn't just strip whitespace from * the partial selection unless that line has whitespace to be stripped. * * The third selects * nothing, and makes sure that the whole document is affected by whitespace stripping. */ public class PyStripTrailingWhitespaceTest extends TestCase { /* The document that will fake an editor environment */ IDocument document; /* Lines of 'code' in the fake document */ String [] documentLines; /* For my own debugging edification, to output the name later */ static final String TestFileName = "PyStripTrailingWhitespaceTest"; /** * Constructor for PyStripTrailingWhitespaceTest. * @param arg0 */ public PyStripTrailingWhitespaceTest(String arg0) { super(arg0); } /* * Sets up the document 'code' and adds it to the document. * * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); int i = -1; int length = 7; documentLines = new String[length]; documentLines[++i] = "def bar ( self ):"; documentLines[++i] = "\tprint \"foo1\"\t "; documentLines[++i] = "\tprint \"bar1\""; documentLines[++i] = "\t "; documentLines[++i] = "def foo ( self ): "; documentLines[++i] = "\tprint \"foo2\"\t "; documentLines[++i] = "\tprint \"bar2\" "; StringBuffer doc = new StringBuffer ( ); for ( i = 0; i < documentLines.length; i++ ) { doc.append ( documentLines[i] + ( i < documentLines.length - 1 ? "\n" : "" ) ); } document = new Document ( doc.toString ( ) ); } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } /* * Just to shorten the lines in the later tests, this calls the action's trim function * * @param in Line of 'code' to be stripped * @return String Stripped 'code' line */ public String callTrim ( String in ) { return PyStripTrailingWhitespace.trimTrailingWhitespace ( in ); } /* * Checks single-line trimming. */ public void testTrimTrailingWhitespace ( ) { // Preserves everything but last whitespace assertEquals ( "\tprint \"foo\"", callTrim ( "\tprint \"foo\"\t" ) ); // Ditto, without tab in front assertEquals ( "print \"foo\"", callTrim ( "print \"foo\" \t" ) ); // Full line blank assertEquals ( "", callTrim ( "\t \t" ) ); // Null input assertEquals ( "", callTrim ( null ) ); } /* * Checks multiple-line selection. */ public void testPerform1 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' the entire last def result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" startLineIndex = i + 1; selBegin = result.toString ( ).length ( ); result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "def foo ( self ): \n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( callTrim ( documentLines[++i] ) ); // "\tprint \"bar2\" \n" endLineIndex = i; selLength = document.get ( ).length ( ) - selBegin; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( document, startLineIndex, endLineIndex, selLength, true ); PyStripTrailingWhitespace.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform1: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks multiple-line selection with the last line partially selected. */ public void testPerform2 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' part of the last def result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" startLineIndex = i + 1; selBegin = result.toString ( ).length ( ); result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "def foo ( self ): \n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( documentLines[++i] ); // "\tprint \"bar2\" \n" endLineIndex = i; selLength = document.get ( ).length ( ) - selBegin - 6; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( document, startLineIndex, endLineIndex, selLength, true ); PyStripTrailingWhitespace.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform2: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks empty selection to affect cursor line. */ public void testPerform3 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' nothing, which should call action on the whole thing result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "def bar ( self ):\n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "\tprint \"bar1\"\n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "\n \n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "def foo ( self ): \n" result.append ( callTrim ( documentLines[++i] ) + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( callTrim ( documentLines[++i] ) ); // "\tprint \"bar2\" \n" endLineIndex = i; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( document, startLineIndex, endLineIndex, selLength, true ); PyStripTrailingWhitespace.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform3: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } } --- NEW FILE: PyConvertTabToSpace.java --- /* * @author: ptoofani * Created: June 2004 * License: Common Public License v1.0 */ package org.python.pydev.editor.actions; import org.eclipse.jface.action.IAction; /** * Converts tab-width spacing to tab characters in selection or entire document, if nothing * selected. * * @author Parhaum Toofanian */ public class PyConvertTabToSpace extends PyConvertSpaceToTab { /* Selection element */ private static PySelection ps; /** * Grabs the selection information and performs the action. */ public void run ( IAction action ) { try { // Select from text editor ps = new PySelection ( getTextEditor ( ), true ); // Perform the action perform ( ); // Put cursor at the first area of the selection getTextEditor ( ).selectAndReveal ( ps.getCursorOffset ( ), 0 ); } catch ( Exception e ) { beep ( e ); } } /** * Performs the action with the class' PySelection. * * @return boolean The success or failure of the action */ public static boolean perform ( ) { return perform ( ps ); } /** * Performs the action with a given PySelection * * @param ps Given PySelection * @return boolean The success or failure of the action */ public static boolean perform ( PySelection ps ) { // What we'll be replacing the selected text with StringBuffer strbuf = new StringBuffer ( ); // If they selected a partial line, count it as a full one ps.selectCompleteLines ( ); int i; try { // For each line, strip their whitespace for ( i = ps.startLineIndex; i <= ps.endLineIndex; i++ ) { String line = ps.doc.get ( ps.doc.getLineInformation ( i ).getOffset ( ), ps.doc.getLineInformation ( i ).getLength ( ) ); strbuf.append ( line.replaceAll ( "\t", getTabSpace ( ) ) + ( i < ps.endLineIndex ? ps.endLineDelim : "" ) ); } // If all goes well, replace the text with the modified information if ( strbuf.toString ( ) != null ) { ps.doc.replace ( ps.startLine.getOffset ( ), ps.selLength, strbuf.toString ( ) ); return true; } } catch ( Exception e ) { beep( e ); } // In event of problems, return false return false; } } --- NEW FILE: PyRemoveBlockCommentTest.java --- /* * Created on Jun 17, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.python.pydev.editor.actions; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import junit.framework.TestCase; /** * @author Dreamer * * Tests the 'Remove Block Comment' editor feature. It performs 3 checks. * * The first fakes a selection of a couple lines in a fake document, and checks to see that the * code is properly un-commented. * * The second fakes a selection but stops in the middle of a line, to make sure that the proper * lines are un-commented, including the beginning of partial lines. * * The third selects nothing, and makes sure that the no lines are otherwise affected. * TODO Maybe in the future, selecting anything within a comment block and calling the action will remove the entire surrounding block comment */ public class PyRemoveBlockCommentTest extends TestCase { /* The document that will fake an editor environment */ IDocument document; /* Lines of 'code' in the fake document */ String [] documentLines; /* For my own debugging edification, to output the name later */ static final String TestFileName = "PyRemoveBlockCommentTest"; /** * Constructor for PyAddBlockCommentTest. * @param arg0 */ public PyRemoveBlockCommentTest(String arg0) { super(arg0); } /* * Sets up the document 'code' and adds it to the document. * * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); int i = -1; int length = 7; documentLines = new String[length]; documentLines[++i] = "def bar ( self ):"; documentLines[++i] = "\tprint \"foo1\"\t "; documentLines[++i] = "\tprint \"bar1\""; documentLines[++i] = "\t "; documentLines[++i] = "def foo ( self ): "; documentLines[++i] = "\tprint \"foo2\"\t "; documentLines[++i] = "\tprint \"bar2\" "; StringBuffer doc = new StringBuffer ( ); for ( i = 0; i < documentLines.length; i++ ) { doc.append ( documentLines[i] + ( i < documentLines.length - 1 ? "\n" : "" ) ); } document = new Document ( doc.toString ( ) ); } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } /* * Just to shorten the lines in the later tests, this calls the action's get comment line * function * * @return String Comment line */ public String getFullCommentLine ( ) { return PyAddBlockComment.getFullCommentLine ( ); } /* * Just to shorten the lines in the later tests, this calls the action's comment function * * @param in Line of 'code' to be commented * @return String Commented 'code' line */ public boolean callComment ( PySelection ps ) { return PyRemoveBlockComment.perform ( ps ); } /* * Checks multiple-line selection. */ public void testPerform1 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' the entire last def result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" startLineIndex = i + 1; selBegin = result.toString ( ).length ( ); result.append ( "#" + getFullCommentLine ( ) + "\n" ); result.append ( "#" + documentLines[++i] + "\n" ); // "def foo ( self ): \n" result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"bar2\" \n" result.append ( "#" + getFullCommentLine ( ) ); endLineIndex = i + 2; selLength = result.toString ( ).length ( ) - selBegin; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( resultDoc, startLineIndex, endLineIndex, selLength, false ); PyRemoveBlockComment.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform1: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks multiple-line selection with the last line partially selected. */ public void testPerform2 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' part of the last def result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" startLineIndex = i + 1; selBegin = result.toString ( ).length ( ); result.append ( "#" + getFullCommentLine ( ) + "\n" ); result.append ( "#" + documentLines[++i] + "\n" ); // "def foo ( self ): \n" result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"bar2\" \n" result.append ( "#" + getFullCommentLine ( ) ); endLineIndex = i + 2; selLength = result.toString ( ).length ( ) - selBegin - 6; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( resultDoc, startLineIndex, endLineIndex, selLength, false ); PyRemoveBlockComment.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform2: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks multiple-line selection with the last line partially selected. */ public void testPerform3 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' in middle of one line, show that it blocks that whole line result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" result.append ( documentLines[++i] + "\n" ); // "def foo ( self ): \n" selBegin = result.toString ( ).length ( ) + 5; result.append ( "#" + getFullCommentLine ( ) + "\n" ); result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"foo2\"\t \n" startLineIndex = i + 1; endLineIndex = startLineIndex; result.append ( "#" + getFullCommentLine ( ) + "\n" ); result.append ( documentLines[++i] ); // "\tprint \"bar2\" \n" // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( resultDoc, startLineIndex, endLineIndex, selLength, false ); PyRemoveBlockComment.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform3: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( result.toString ( ), resultDoc.get ( ) ); } } Index: PyAction.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyAction.java 10 Apr 2004 01:48:14 -0000 1.4 --- PyAction.java 21 Jun 2004 21:36:29 -0000 1.5 *************** *** 60,64 **** * @throws BadLocationException */ ! protected String getDelimiter(IDocument doc, int startLineIndex) throws BadLocationException { String endLineDelim = doc.getLineDelimiter(startLineIndex); --- 60,64 ---- * @throws BadLocationException */ ! protected static String getDelimiter(IDocument doc, int startLineIndex) throws BadLocationException { String endLineDelim = doc.getLineDelimiter(startLineIndex); *************** *** 198,202 **** * Beep...humm... yeah....beep....ehehheheh */ ! protected void beep(Exception e) { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay().beep(); e.printStackTrace(); --- 198,202 ---- * Beep...humm... yeah....beep....ehehheheh */ ! protected static void beep(Exception e) { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay().beep(); e.printStackTrace(); Index: PyUncomment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyUncomment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyUncomment.java 28 Feb 2004 05:13:16 -0000 1.1 --- PyUncomment.java 21 Jun 2004 21:36:29 -0000 1.2 *************** *** 7,16 **** package org.python.pydev.editor.actions; /** * @author fabioz */ ! public class PyUncomment extends PyComment { /** * Same as comment, but remove the first char. --- 7,90 ---- package org.python.pydev.editor.actions; + import org.eclipse.jface.action.IAction; + /** * @author fabioz */ ! public class PyUncomment extends PyComment ! { ! /* Selection element */ ! private static PySelection ps; ! ! /** ! * Grabs the selection information and performs the action. ! */ ! public void run ( IAction action ) ! { ! try ! { ! // Select from text editor ! ps = new PySelection ( getTextEditor ( ), false ); ! // Perform the action ! perform ( ); ! ! // Put cursor at the first area of the selection ! getTextEditor ( ).selectAndReveal ( ps.endLine.getOffset ( ), 0 ); ! } ! catch ( Exception e ) ! { ! beep ( e ); ! } ! } ! ! ! /** ! * Performs the action with the class' PySelection. ! * ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( ) ! { ! return perform ( ps ); ! } ! ! ! /** ! * Performs the action with a given PySelection ! * ! * @param ps Given PySelection ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( PySelection ps ) ! { ! // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer ( ); ! ! // If they selected a partial line, count it as a full one ! ps.selectCompleteLines ( ); ! ! int i; ! try ! { ! // For each line, comment them out ! for ( i = ps.startLineIndex; i <= ps.endLineIndex; i++ ) ! { ! if ( ps.getLine ( i ).startsWith ( "#" ) ) ! strbuf.append ( ps.getLine ( i ).substring ( 1 ) + ( i < ps.endLineIndex ? ps.endLineDelim : "" ) ); ! } + // Replace the text with the modified information + ps.doc.replace ( ps.startLine.getOffset ( ), ps.selLength, strbuf.toString ( ) ); + return true; + } + catch ( Exception e ) + { + beep ( e ); + } + + // In event of problems, return false + return false; + } /** * Same as comment, but remove the first char. --- NEW FILE: PyUncommentTest.java --- /* * Created on Jun 17, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.python.pydev.editor.actions; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import junit.framework.TestCase; /** * @author Dreamer * * Tests the 'Uncomment' editor feature. It performs 3 checks. * * The first fakes a selection of a couple lines in a fake document, and checks to see that the * code is properly un-commented. * * The second fakes a selection but stops in the middle of a line, to make sure that the proper * lines are un-commented, including the beginning of partial lines. * * The third selects nothing, and makes sure that the only line affected is the one the cursor * is on. */ public class PyUncommentTest extends TestCase { /* The document that will fake an editor environment */ IDocument document; /* Lines of 'code' in the fake document */ String [] documentLines; /* For my own debugging edification, to output the name later */ static final String TestFileName = "PyUncommentTest"; /** * Constructor for PyUncommentTest. * @param arg0 */ public PyUncommentTest(String arg0) { super(arg0); } /* * Sets up the document 'code' and adds it to the document. * * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); int i = -1; int length = 7; documentLines = new String[length]; documentLines[++i] = "def bar ( self ):"; documentLines[++i] = "\tprint \"foo1\"\t "; documentLines[++i] = "\tprint \"bar1\""; documentLines[++i] = "\t "; documentLines[++i] = "def foo ( self ): "; documentLines[++i] = "\tprint \"foo2\"\t "; documentLines[++i] = "\tprint \"bar2\" "; StringBuffer doc = new StringBuffer ( ); for ( i = 0; i < documentLines.length; i++ ) { doc.append ( documentLines[i] + ( i < documentLines.length - 1 ? "\n" : "" ) ); } document = new Document ( doc.toString ( ) ); } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } /* * Just to shorten the lines in the later tests, this calls the action's uncomment function * * @param in Line of 'code' to be commented * @return String Commented 'code' line */ public boolean callComment ( PySelection ps ) { return PyUncomment.perform ( ps ); } /* * Checks multiple-line selection. */ public void testPerform1 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' the entire last def result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" startLineIndex = i + 1; selBegin = result.toString ( ).length ( ); result.append ( "#" + documentLines[++i] + "\n" ); // "def foo ( self ): \n" result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( "#" + documentLines[++i] ); // "\tprint \"bar2\" \n" endLineIndex = i; selLength = document.get ( ).length ( ) - selBegin; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( resultDoc, startLineIndex, endLineIndex, selLength, false ); PyUncomment.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform1: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks multiple-line selection with the last line partially selected. */ public void testPerform2 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' part of the last def result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" startLineIndex = i + 1; selBegin = result.toString ( ).length ( ); result.append ( "#" + documentLines[++i] + "\n" ); // "def foo ( self ): \n" result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"foo2\"\t \n" result.append ( "#" + documentLines[++i] ); // "\tprint \"bar2\" \n" endLineIndex = i; selLength = document.get ( ).length ( ) - selBegin - 6; // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( resultDoc, startLineIndex, endLineIndex, selLength, false ); PyUncomment.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform2: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks empty selection to affect cursor line. */ public void testPerform3 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' in middle of one line, show that it blocks that whole line only result.append ( documentLines[++i] + "\n" ); // "def bar ( self ):\n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"foo1\"\t \n" result.append ( documentLines[++i] + "\n" ); // "\tprint \"bar1\"\n" result.append ( documentLines[++i] + "\n" ); // "\n \n" result.append ( documentLines[++i] + "\n" ); // "def foo ( self ): \n" selBegin = result.toString ( ).length ( ) + 5; result.append ( "#" + documentLines[++i] + "\n" ); // "\tprint \"foo2\"\t \n" startLineIndex = i; endLineIndex = startLineIndex; result.append ( documentLines[++i] ); // "\tprint \"bar2\" \n" // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( resultDoc, startLineIndex, endLineIndex, selLength, false ); PyUncomment.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform3: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } } Index: PyAddBlockComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyAddBlockComment.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyAddBlockComment.java 11 Jun 2004 20:03:56 -0000 1.6 --- PyAddBlockComment.java 21 Jun 2004 21:36:29 -0000 1.7 *************** *** 9,12 **** --- 9,13 ---- import org.python.pydev.plugin.PydevPrefs; import org.eclipse.core.runtime.Preferences; + import org.eclipse.jface.action.IAction; import org.python.pydev.plugin.PydevPlugin; *************** *** 21,51 **** * @author Parhaum Toofanian */ ! public class PyAddBlockComment extends PyComment { /** ! * This method is called to return the text that should be replaced ! * by the text passed as a parameter. * ! * The text passed as a parameter represents the text from the whole ! * lines of the selection. * ! * @param str the string to be replaced. ! * @param endLineDelim delimiter used. ! * @return the new string. */ ! protected String replaceStr(String str, String endLineDelim) { ! return "#" + getFullCommentLine ( ) + endLineDelim + ! "#" + str.replaceAll(endLineDelim, endLineDelim + "#") + ! endLineDelim + "#" + getFullCommentLine ( ); } /** * Currently returns a string with the comment block. ! * @return Comment line string */ ! protected String getFullCommentLine(){ ! Preferences prefs = PydevPlugin.getDefault().getPluginPreferences(); ! return prefs.getString(PydevPrefs.BLOCK_COMMENT); } - } --- 22,123 ---- * @author Parhaum Toofanian */ ! public class PyAddBlockComment extends PyAction ! { ! /* Selection element */ ! private static PySelection ps; ! /** ! * Grabs the selection information and performs the action. ! */ ! public void run ( IAction action ) ! { ! try ! { ! // Select from text editor ! ps = new PySelection ( getTextEditor ( ), false ); ! // Perform the action ! perform ( ); ! ! // Put cursor at the first area of the selection ! getTextEditor ( ).selectAndReveal ( ps.endLine.getOffset ( ), 0 ); ! } ! catch ( Exception e ) ! { ! beep ( e ); ! } ! } ! ! ! /** ! * Performs the action with the class' PySelection. * ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( ) ! { ! return perform ( ps ); ! } ! ! ! /** ! * Performs the action with a given PySelection * ! * @param ps Given PySelection ! * @return boolean The success or failure of the action */ ! public static boolean perform ( PySelection ps ) ! { ! // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer ( ); ! ! // If they selected a partial line, count it as a full one ! ps.selectCompleteLines ( ); ! ! int i; ! try ! { ! // Start of block ! strbuf.append ( "#" + getFullCommentLine ( ) + ps.endLineDelim ); ! ! // For each line, comment them out ! for ( i = ps.startLineIndex; i <= ps.endLineIndex; i++ ) ! { ! strbuf.append ( "#" + ps.getLine ( i ) + ps.endLineDelim ); ! } ! ! // End of block ! strbuf.append ( "#" + getFullCommentLine ( ) ); ! ! // Replace the text with the modified information ! ps.doc.replace ( ps.startLine.getOffset ( ), ps.selLength, strbuf.toString ( ) ); ! return true; ! } ! catch ( Exception e ) ! { ! beep ( e ); ! } ! ! // In event of problems, return false ! return false; } + /** * Currently returns a string with the comment block. ! * ! * @return Comment line string, or a default one if Preferences are null */ ! protected static String getFullCommentLine ( ) ! { ! try ! { ! Preferences prefs = PydevPlugin.getDefault().getPluginPreferences(); ! return prefs.getString(PydevPrefs.BLOCK_COMMENT); ! } ! catch ( Exception e ) ! { ! return "========================="; ! } } } Index: PyRemoveBlockComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyRemoveBlockComment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyRemoveBlockComment.java 11 Jun 2004 20:03:56 -0000 1.1 --- PyRemoveBlockComment.java 21 Jun 2004 21:36:29 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- package org.python.pydev.editor.actions; + import org.eclipse.jface.action.IAction; + /** *************** *** 19,44 **** * @author Parhaum Toofanian */ ! public class PyRemoveBlockComment extends PyAddBlockComment { /** ! * This method is called to return the text that should be replaced ! * by the text passed as a parameter. * ! * The text passed as a parameter represents the text from the whole ! * lines of the selection. * ! * @param str the string to be replaced. ! * @param endLineDelim delimiter used. ! * @return the new string. */ ! protected String replaceStr(String str, String endLineDelim) { ! str = str.replaceAll(endLineDelim+"#", endLineDelim ); ! if (str.startsWith("#")){ ! str = str.substring(1); } - str = str.replaceAll(getFullCommentLine()+endLineDelim, ""); - str = str.replaceAll(endLineDelim+getFullCommentLine(), ""); ! return str; } --- 21,105 ---- * @author Parhaum Toofanian */ ! public class PyRemoveBlockComment extends PyAddBlockComment ! { ! /* Selection element */ ! private static PySelection ps; ! /** ! * Grabs the selection information and performs the action. ! */ ! public void run ( IAction action ) ! { ! try ! { ! // Select from text editor ! ps = new PySelection ( getTextEditor ( ), false ); ! // Perform the action ! perform ( ); ! ! // Put cursor at the first area of the selection ! getTextEditor ( ).selectAndReveal ( ps.endLine.getOffset ( ), 0 ); ! } ! catch ( Exception e ) ! { ! beep ( e ); ! } ! } ! ! ! /** ! * Performs the action with the class' PySelection. * ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( ) ! { ! return perform ( ps ); ! } ! ! ! /** ! * Performs the action with a given PySelection * ! * @param ps Given PySelection ! * @return boolean The success or failure of the action */ ! public static boolean perform ( PySelection ps ) ! { ! // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer ( ); ! ! // If they selected a partial line, count it as a full one ! ps.selectCompleteLines ( ); ! ! int i; ! try ! { ! // Start of block, if not block, don't bother ! if ( ! ps.getLine ( ps.startLineIndex ).equals ( "#" + getFullCommentLine ( ) ) ) ! return false; ! // End of block, if not block, don't bother ! if ( ! ps.getLine ( ps.endLineIndex ).equals ( "#" + getFullCommentLine ( ) ) ) ! return false; ! ! // For each line, comment them out ! for ( i = ps.startLineIndex + 1; i < ps.endLineIndex; i++ ) ! { ! if ( ps.getLine ( i ).startsWith ( "#" ) && ! ps.getLine ( i ).substring ( 1 ).equals ( getFullCommentLine ( ) ) ) ! strbuf.append ( ps.getLine ( i ).substring ( 1 ) + ( i < ps.endLineIndex - 1 ? ps.endLineDelim : "" ) ); ! } ! ! // Replace the text with the modified information ! ps.doc.replace ( ps.startLine.getOffset ( ), ps.selLength, strbuf.toString ( ) ); ! return true; ! } ! catch ( Exception e ) ! { ! beep ( e ); } ! // In event of problems, return false ! return false; } Index: PyComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyComment.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyComment.java 11 Jun 2004 20:03:56 -0000 1.3 --- PyComment.java 21 Jun 2004 21:36:29 -0000 1.4 *************** *** 8,82 **** import org.eclipse.jface.action.IAction; - import org.eclipse.jface.text.IDocument; - import org.eclipse.jface.text.IRegion; - import org.eclipse.jface.text.ITextSelection; - import org.eclipse.ui.texteditor.ITextEditor; /** * @author Fabio Zadrozny */ ! public class PyComment extends PyAction { /** ! * Comment the first lines. */ ! public void run(IAction action) { ! try { ! ! ITextEditor textEditor = getTextEditor(); ! ! IDocument doc = ! textEditor.getDocumentProvider().getDocument( ! textEditor.getEditorInput()); ! ITextSelection selection = ! (ITextSelection) textEditor ! .getSelectionProvider() ! .getSelection(); ! ! int startLineIndex = selection.getStartLine(); ! int endLineIndex = selection.getEndLine(); ! ! //special cases...first char of the editor, last char... ! if (endLineIndex < startLineIndex) { ! endLineIndex = startLineIndex; ! } ! ! IRegion startLine = doc.getLineInformation(startLineIndex); ! IRegion endLine = doc.getLineInformation(endLineIndex); ! ! int initialPos = startLine.getOffset(); ! int length = ! (endLine.getOffset() - startLine.getOffset()) ! + endLine.getLength(); ! ! String endLineDelim = getDelimiter(doc, startLineIndex); ! ! String str = doc.get(initialPos, length); ! ! str = replaceStr(str, endLineDelim); ! doc.replace(initialPos, length, str); ! ! // Select the new comment block automatically ! textEditor.selectAndReveal(initialPos,str.length()); ! } catch (Exception e) { ! beep(e); } } /** ! * This method is called to return the text that should be replaced ! * by the text passed as a parameter. ! * ! * The text passed as a parameter represents the text from the whole ! * lines of the selection. * ! * @param str the string to be replaced. ! * @param endLineDelim delimiter used. ! * @return the new string. */ ! protected String replaceStr(String str, String endLineDelim) { ! return "#" + str.replaceAll(endLineDelim, endLineDelim + "#"); } } --- 8,93 ---- import org.eclipse.jface.action.IAction; /** + * Creates a bulk comment. Comments all selected lines + * * @author Fabio Zadrozny + * @author Parhaum Toofanian */ ! public class PyComment extends PyAction ! { ! /* Selection element */ ! private static PySelection ps; ! /** ! * Grabs the selection information and performs the action. */ ! public void run ( IAction action ) ! { ! try ! { ! // Select from text editor ! ps = new PySelection ( getTextEditor ( ), false ); ! // Perform the action ! perform ( ); ! // Put cursor at the first area of the selection ! getTextEditor ( ).selectAndReveal ( ps.endLine.getOffset ( ), 0 ); ! } ! catch ( Exception e ) ! { ! beep ( e ); } } + /** ! * Performs the action with the class' PySelection. * ! * @return boolean The success or failure of the action */ ! public static boolean perform ( ) ! { ! return perform ( ps ); } + + /** + * Performs the action with a given PySelection + * + * @param ps Given PySelection + * @return boolean The success or failure of the action + */ + public static boolean perform ( PySelection ps ) + { + // What we'll be replacing the selected text with + StringBuffer strbuf = new StringBuffer ( ); + + // If they selected a partial line, count it as a full one + ps.selectCompleteLines ( ); + + int i; + try + { + // For each line, comment them out + for ( i = ps.startLineIndex; i < ps.endLineIndex; i++ ) + { + strbuf.append ( "#" + ps.getLine ( i ) + ps.endLineDelim ); + } + // Last line shouldn't add the delimiter + strbuf.append ( "#" + ps.getLine ( i ) ); + + // Replace the text with the modified information + ps.doc.replace ( ps.startLine.getOffset ( ), ps.selLength, strbuf.toString ( ) ); + return true; + } + catch ( Exception e ) + { + beep ( e ); + } + + // In event of problems, return false + return false; + } } --- NEW FILE: PyConvertTabToSpaceTest.java --- /* * Created on Jun 21, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.python.pydev.editor.actions; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import junit.framework.TestCase; /** * @author Dreamer * * Tests the 'Convert Tab to Space' editor feature. It performs 3 checks. * * The first fakes a selection of a couple lines in a fake document, and checks * to see that the proper tabs are converted to spaces. * * The second fakes a selection but stops in the middle of a line, to make sure that the * whole line is considered. * * The third selects nothing, and makes sure that the whole document is affected by * the conversion. */ public class PyConvertTabToSpaceTest extends TestCase { /* The document that will fake an editor environment */ IDocument document; /* Lines of 'code' in the fake document */ String [] documentLines; /* For my own debugging edification, to output the name later */ static final String TestFileName = "PyConvertTabToSpaceTest"; /** * Constructor for PyConvertTabToSpaceTest. * @param arg0 */ public PyConvertTabToSpaceTest(String arg0) { super(arg0); } /* * Sets up the document 'code' and adds it to the document. * * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); int i = -1; int length = 7; documentLines = new String[length]; // The X will be used to interchange tabs/spaces documentLines[++i] = "def bar ( self ):"; documentLines[++i] = "X" + "print \"foo1\"X "; documentLines[++i] = "X" + "print \"bar1\""; documentLines[++i] = "X "; documentLines[++i] = "def foo ( self ):X"; documentLines[++i] = "X" + "print \"foo2\"X "; documentLines[++i] = "X" + "print \"bar2\" "; StringBuffer doc = new StringBuffer ( ); for ( i = 0; i < documentLines.length; i++ ) { doc.append ( documentLines[i] + ( i < documentLines.length - 1 ? "\n" : "" ) ); } document = new Document ( doc.toString ( ) ); } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } /* * Just for this and the vice versa case, to make things easier * * @return String Space string */ public String from ( ) { return "\t"; } /* * Just for this and the vice versa case, to make things easier * * @return String Tab string */ public String to ( ) { return PyConvertTabToSpace.getTabSpace ( ); } /* * Just to shorten the lines in the later tests, this calls the action's get tab width * function * * @return int Tab width */ public int getTabWidth ( ) { return PyConvertTabToSpace.getTabWidth ( ); } /* * Just to shorten the lines in the later tests, this calls the action's trim function * * @param in Line of 'code' to be stripped * @return String Stripped 'code' line */ public String callTrim ( String in ) { return PyStripTrailingWhitespace.trimTrailingWhitespace ( in ); } /* * Checks multiple-line selection. */ public void testPerform1 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' the entire last def String [] strArr = document.get ( ).replaceAll ( "X", from ( ) ).split ( "\n" ); int len = 0; len += strArr[++i].length ( ) + 1; // "def bar ( self ):\n" len += strArr[++i].length ( ) + 1; // "\tprint \"foo1\"\t \n" len += strArr[++i].length ( ) + 1; // "\tprint \"bar1\"\n" len += strArr[++i].length ( ) + 1; // "\n \n" startLineIndex = i + 1; selBegin = len; len += strArr[++i].length ( ) + 1; // "def foo ( self ): len += strArr[++i].length ( ) + 1; // "\tprint \"foo2\"\t \n" len += strArr[++i].length ( ); // "\tprint \"bar2\" \n" endLineIndex = i; selLength = len - selBegin; // Create result document i = -1; result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", to ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", to ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", to ( ) ) ); // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data document.set ( document.get ( ).replaceAll ( "X", from ( ) ) ); long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( document, startLineIndex, endLineIndex, selLength, true ); PyConvertTabToSpace.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform1: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks multiple-line selection with the last line partially selected. */ public void testPerform2 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' the entire last def String [] strArr = document.get ( ).replaceAll ( "X", from ( ) ).split ( "\n" ); int len = 0; len += strArr[++i].length ( ) + 1; // "def bar ( self ):\n" len += strArr[++i].length ( ) + 1; // "\tprint \"foo1\"\t \n" len += strArr[++i].length ( ) + 1; // "\tprint \"bar1\"\n" len += strArr[++i].length ( ) + 1; // "\n \n" startLineIndex = i + 1; selBegin = len; len += strArr[++i].length ( ) + 1; // "def foo ( self ): len += strArr[++i].length ( ) + 1; // "\tprint \"foo2\"\t \n" len += strArr[++i].length ( ); // "\tprint \"bar2\" \n" endLineIndex = i; selLength = len - selBegin - 6; // Create result document i = -1; result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", from ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", to ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", to ( ) ) + "\n" ); result.append ( documentLines[++i].replaceAll ( "X", to ( ) ) ); // Our expected result IDocument resultDoc = new Document ( result.toString ( ) ); // For timing data document.set ( document.get ( ).replaceAll ( "X", from ( ) ) ); long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( document, startLineIndex, endLineIndex, selLength, true ); PyConvertTabToSpace.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform2: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } /* * Checks empty selection to affect cursor line. */ public void testPerform3 ( ) { StringBuffer result = new StringBuffer ( ); int i = -1; int startLineIndex = 0; int endLineIndex = 0; int selBegin = 0; int selLength = 0; // 'Select' the entire last def startLineIndex = endLineIndex = 1; selBegin = 1; selLength = 0; // Our expected result IDocument resultDoc = new Document ( document.get ( ).toString ( ).replaceAll ( "X", to ( ) ) ); // For timing data document.set ( document.get ( ).replaceAll ( "X", from ( ) ) ); long begin = System.currentTimeMillis ( ); PySelection ps = new PySelection ( document, startLineIndex, endLineIndex, selLength, true ); PyConvertTabToSpace.perform ( ps ); long end = System.currentTimeMillis ( ); // Timing result System.err.print ( TestFileName + " :: " ); System.err.println ( "testPerform3: " + ( end - begin ) + "ms" ); // Document affected properly? assertEquals ( document.get ( ), resultDoc.get ( ) ); } } Index: PyStripTrailingWhitespace.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyStripTrailingWhitespace.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyStripTrailingWhitespace.java 11 Jun 2004 20:03:56 -0000 1.1 --- PyStripTrailingWhitespace.java 21 Jun 2004 21:36:29 -0000 1.2 *************** *** 8,15 **** import org.eclipse.jface.action.IAction; ! import org.eclipse.jface.text.IDocument; ! import org.eclipse.jface.text.IRegion; ! import org.eclipse.jface.text.ITextSelection; ! import org.eclipse.ui.texteditor.ITextEditor; /** --- 8,12 ---- import org.eclipse.jface.action.IAction; ! /** *************** *** 19,120 **** * @author Parhaum Toofanian */ ! public class PyStripTrailingWhitespace extends PyAction { /** ! * Strip whitespace. */ ! public void run(IAction action) { ! try { ! // Grab the editor ! ITextEditor textEditor = getTextEditor(); ! // Grab the document ! IDocument doc = ! textEditor.getDocumentProvider().getDocument( ! textEditor.getEditorInput()); ! ! // Grab the selection ! ITextSelection selection = ! (ITextSelection) textEditor ! .getSelectionProvider() ! .getSelection(); ! ! // What we'll be modifying ! String str = new String ( ); ! // End line delimiter character ! String endLineDelim = new String ( ); ! ! // Get some line information ! int initialPos = 0; ! int length = 0; ! int startLineIndex = selection.getStartLine(); ! int endLineIndex = selection.getEndLine(); ! //special cases...first char of the editor, last char... ! if (endLineIndex < startLineIndex) { ! endLineIndex = startLineIndex; ! } ! IRegion startLine = doc.getLineInformation(startLineIndex); ! IRegion endLine = doc.getLineInformation(endLineIndex); ! ! // If anything is actually selected, we'll be modifying the selection only ! if ( selection.getLength ( ) > 0 ) ! { ! ! // Get offsets and lengths ! initialPos = startLine.getOffset(); ! length = ! (endLine.getOffset() - startLine.getOffset()) ! + endLine.getLength(); ! ! endLineDelim = getDelimiter(doc, startLineIndex); ! ! // Grab the selected text into our string ! str = doc.get(initialPos, length); ! } ! // Otherwise we'll modify the whole document ! else ! { ! // Grab the whole document ! str = doc.get ( ); ! endLineDelim = getDelimiter ( doc, 0 ); ! length = doc.getLength(); ! } ! // We can't use trim() since we only want to get rid of trailing whitespace, ! // so we need to go line by line. ! String [] lines = str.split ( endLineDelim ); ! // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer ( ); ! // For all but the last line, trim whitespace normally ! for ( int i = 0; i < lines.length - 1; i++ ) { ! strbuf.append ( trimTrailingWhitespace ( lines[i] ) + endLineDelim ); } ! // Handle the last line differently, because it might not be a full line with // and ending delimiter, so we don't just want to trim whitespace (it could be // ending in the middle of a line, and this would screw up the code, which we // imagine the developer doesn't want to do ! if ( lines.length > 0 ) { // Check if full last line is selected or not ! if ( lines[lines.length - 1].length ( ) == endLine.getLength ( ) ) ! strbuf.append ( trimTrailingWhitespace ( lines[lines.length - 1] ) ); else ! strbuf.append ( lines[lines.length - 1] ); } - - // Replace selection with our new stripped text - doc.replace(initialPos, length, strbuf.toString ( ) ); - - // Put cursor at the first area of the selection - textEditor.selectAndReveal(endLine.getOffset(),0); ! } catch (Exception e) { ! beep(e); ! } } /** * This method is called to check for trailing whitespace and get rid of it --- 16,115 ---- * @author Parhaum Toofanian */ ! public class PyStripTrailingWhitespace extends PyAction ! { ! /* Selection element */ ! private static PySelection ps; ! /** ! * Grabs the selection information and performs the action. */ ! public void run ( IAction action ) ! { ! try ! { ! // Select from text editor ! ps = new PySelection ( getTextEditor ( ), false ); ! // Perform the action ! perform ( ); ! // Put cursor at the first area of the selection ! getTextEditor ( ).selectAndReveal ( ps.endLine.getOffset ( ), 0 ); ! } ! catch ( Exception e ) ! { ! beep ( e ); ! } ! } ! ! /** ! * Performs the action with the class' PySelection. ! * ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( ) ! { ! return perform ( ps ); ! } ! ! ! /** ! * Performs the action with a given PySelection ! * ! * @param ps Given PySelection ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( PySelection ps ) ! { ! // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer ( ); ! int i; ! ! try ! { ! // For each line, strip their whitespace ! for ( i = ps.startLineIndex; i < ps.endLineIndex; i++ ) { ! strbuf.append ( trimTrailingWhitespace ( ps.doc.get ( ps.doc.getLineInformation ( i ).getOffset ( ), ps.doc.getLineInformation ( i ).getLength ( ) ) ) + ps.endLineDelim ); } ! // Handle the last line differently, because it might not be a full line with // and ending delimiter, so we don't just want to trim whitespace (it could be // ending in the middle of a line, and this would screw up the code, which we // imagine the developer doesn't want to do ! if ( ps.endLineIndex - ps.startLineIndex > 0 ) { + String lastline = ps.doc.get ( ps.endLine.getOffset ( ), ps.startLine.getOffset ( ) + ps.selLength - ps.endLine.getOffset ( ) ); + // Check if full last line is selected or not ! if ( lastline.length ( ) == ps.endLine.getLength ( ) ) ! { ! strbuf.append ( trimTrailingWhitespace ( lastline ) ); ! } else ! { ! strbuf.append ( lastline ); ! } } ! // If all goes well, replace the text with the modified information ! if ( strbuf.toString ( ) != null ) ! { ! ps.doc.replace ( ps.startLine.getOffset ( ), ps.selLength, strbuf.toString ( ) ); ! return true; ! } ! } ! catch ( Exception e ) ! { ! beep( e ); ! } ! ! // In event of problems, return false ! return false; } + /** * This method is called to check for trailing whitespace and get rid of it *************** *** 122,128 **** * @param str the string to be checked. * @return String the string, stripped of whitespace, or an empty string. ! */ private String trimTrailingWhitespace ( String str ) { // If nothing at all, just return if ( str.length ( ) == 0 ) return ""; --- 117,125 ---- * @param str the string to be checked. * @return String the string, stripped of whitespace, or an empty string. ! */ public static String trimTrailingWhitespace ( String str ) { // If nothing at all, just return + if ( str == null ) + return ""; if ( str.length ( ) == 0 ) return ""; *************** *** 153,156 **** } } - } --- 150,152 ---- --- NEW FILE: AllTests.java --- /* * Created on Jun 17, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.python.pydev.editor.actions; import junit.framework.Test; import junit.framework.TestSuite; /** * @author Dreamer * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class AllTests { public static String TestFileName = "Editor.Actions"; public static Test suite() { TestSuite suite = new TestSuite("Test for org.python.pydev.editor.actions"); //$JUnit-BEGIN$ suite.addTest(new TestSuite(PyCommentTest.class)); suite.addTest(new TestSuite(PyUncommentTest.class)); suite.addTest(new TestSuite(PyAddBlockCommentTest.class)); suite.addTest(new TestSuite(PyRemoveBlockCommentTest.class)); suite.addTest(new TestSuite(PyStripTrailingWhitespaceTest.class)); suite.addTest(new TestSuite(PyConvertSpaceToTabTest.class)); suite.addTest(new TestSuite(PyConvertTabToSpaceTest.class)); //$JUnit-END$ System.out.println ( "Running Test Suite '" + TestFileName + "'..." ); return suite; } } --- NEW FILE: PySelection.java --- /* * @author: ptoofani * Created: June 2004 * License: Common Public License v1.0 */ package org.python.pydev.editor.actions; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextSelection; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.texteditor.ITextEditor; /** * More for my benefit in making the unit tests, this assembles information from a document, * whether in Eclipse or faked from outside, and performs a common selection routine for many * of the actions in the editor. Serves to refactor repetitive code in some Actions and tests. * * @author Parhaum Toofanian */ public cla... [truncated message content] |
From: Parhaum T. <dre...@us...> - 2004-06-21 21:36:38
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21826 Modified Files: .project plugin.xml .classpath Log Message: - Added JUnit test for editor actions that I've made or are related to ones I've made. This is something I need for my project that this is for, and in order to test things out like adding block comments, I had to revamp how they functioned to allow them to accept a mock Document as opposed to grabbing it from the Active Editor. This created the PySelection entity, which was basically being used anyway by many of the actions, which serves to accept a document input and make the proper selection given passed criteria. Since I didn't get a 'no' when I asked if the JUnit testing was ok, I assumed it wasn't a problem to put them in. I can revert them all back to their original form, if desired. - 2 new actions - ConvertTabToSpace and ConvertSpaceToTab, basically the user can select lines or none at all (to affect whole document) and convert tabs and tab-width-spaces back and forth - Plugin.xml adjusted to account for the new action - Skeleton help files added for new actions, TOC modified Index: .project =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/.project,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .project 7 May 2004 02:07:18 -0000 1.3 --- .project 21 Jun 2004 21:36:29 -0000 1.4 *************** *** 4,13 **** <comment></comment> <projects> - <project>org.eclipse.core.boot</project> <project>org.eclipse.core.resources</project> - <project>org.eclipse.core.runtime</project> <project>org.eclipse.jdt.ui</project> <project>org.eclipse.ui</project> <project>org.eclipse.ui.views</project> </projects> <buildSpec> --- 4,12 ---- <comment></comment> <projects> <project>org.eclipse.core.resources</project> <project>org.eclipse.jdt.ui</project> <project>org.eclipse.ui</project> <project>org.eclipse.ui.views</project> + <project>org.pydev.jython</project> </projects> <buildSpec> Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** plugin.xml 11 Jun 2004 21:28:04 -0000 1.18 --- plugin.xml 21 Jun 2004 21:36:29 -0000 1.19 *************** *** 113,116 **** --- 113,130 ---- </action> <action + definitionId="org.python.pydev.editor.actions.convertSpaceToTab" + label="Convert space-tabs to tabs" + class="org.python.pydev.editor.actions.PyConvertSpaceToTab" + menubarPath="org.python.pydev.editor.actions.sourceMenu/whitespaceGroup" + id="org.python.pydev.editor.actions.convertSpaceToTab"> + </action> + <action + definitionId="org.python.pydev.editor.actions.convertTabToSpace" + label="Convert tabs to space-tabs" + class="org.python.pydev.editor.actions.PyConvertTabToSpace" + menubarPath="org.python.pydev.editor.actions.sourceMenu/whitespaceGroup" + id="org.python.pydev.editor.actions.convertTabToSpace"> + </action> + <action definitionId="org.python.pydev.editor.actions.stripTrailingWhitespace" label="Strip trailing whitespace" *************** *** 191,194 **** --- 205,220 ---- </menu> <action + label="Convert space-tabs to tabs" + class="org.python.pydev.editor.actions.PyConvertSpaceToTab" + menubarPath="org.python.pydev.editor.actions.editorPopup/whitespaceGroup" + id="org.python.pydev.editor.actions.convertSpaceToTab"> + </action> + <action + label="Convert tabs to space-tabs" + class="org.python.pydev.editor.actions.PyConvertTabToSpace" + menubarPath="org.python.pydev.editor.actions.editorPopup/whitespaceGroup" + id="org.python.pydev.editor.actions.convertTabToSpace"> + </action> + <action label="Strip trailing whitespace" class="org.python.pydev.editor.actions.PyStripTrailingWhitespace" *************** *** 288,291 **** --- 314,343 ---- configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> </keyBinding> + <!-- command: space to tab--> + <command + name="Convert space-tabs to tabs" + description="Converts tab-width space groups to tabs from selected region or whole document if nothing selected" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.convertSpaceToTab"> + </command> + <keyBinding + string="Shift+Ctrl+Tab" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.convertSpaceToTab" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> + <!-- command: tab to space--> + <command + name="Convert tabs to space-tabs" + description="Converts tabs to tab-width space groups from selected region or whole document if nothing selected" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.convertTabToSpace"> + </command> + <keyBinding + string="Ctrl+Tab" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.convertTabToSpace" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> <!-- command: whitespace--> <command Index: .classpath =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/.classpath,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** .classpath 10 Apr 2004 02:06:27 -0000 1.6 --- .classpath 21 Jun 2004 21:36:29 -0000 1.7 *************** *** 1,7 **** <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry kind="src" path="src/"/> ! <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/> </classpath> --- 1,8 ---- <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/> ! <classpathentry kind="src" path="src/"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="C:/eclipse2.1.3/plugins/org.junit_3.8.1/junit.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
Update of /cvsroot/pydev/org.python.pydev.help/html/userguide In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25994/html/userguide Modified Files: preferences.html editor_syntaxh.html editor_autoi.html index.html editor_stripw.html editor_comment.html editor_blockc.html Added Files: editor_hyperlinks.html editor_gotopmc.html debug_preferences.html editor_outline.html editor_autoc.html debug.html editor_gotonmc.html editor_parsing.html editor_gotofc.html about.html Log Message: Modified in org.python.pydev.help: userguide folder - Added stylesheet, script file, and more feature pages. --- NEW FILE: editor_autoc.html --- <!--=============================================================================================== File: editor_autoc.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Auto-Completion and Auto Activation in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Auto Completion'; links[i++] = 'editor_autoc.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> Index: index.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.html 11 Jun 2004 19:46:57 -0000 1.1 --- index.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,5 **** ! <h2>PyDev User Manual</h2> ! <p> ! Welcome to the PyDev Python IDE User Manual. This section of help will contain a list detailing the features available within the PyDev IDE. ! </p> --- 1,71 ---- ! <!--=============================================================================================== ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Index page of the User Guide. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p> ! Welcome to the PyDev Python IDE User Guide. This guide is used to describe the features available within this IDE in detail, so that new users can learn quickly and easily. The following is a list of the topics available: ! </p> ! ! <ul> ! <li>Features ! <ul> ! <li><a href="editor_autoc.html">Auto Completion</a> ! <li><a href="editor_autoi.html">Auto-Indentation</a> ! <li><a href="editor_blockc.html">Block Commenting</a> ! <li><a href="editor_comment.html">Bulk Commenting</a> ! <li><a href="editor_parsing.html">Error Parsing</a> ! <li><a href="editor_gotofc.html">Go to First Character</a> ! <li><a href="editor_gotopmc.html">Go to Previous Method/Class</a> ! <li><a href="editor_gotonmc.html">Go to Next Method/Class</a> ! <li><a href="editor_hyperlinks.html">Hyperlinks</a> ! <li><a href="editor_outline.html">Outline View</a> ! <li><a href="editor_stripw.html">Strip Whitespace</a> ! <li><a href="editor_syntaxh.html">Syntax Highlighting</a> ! </ul> ! ! <li><a href="preferences.html">Preferences</a> ! ! <li><a href="debug.html">Debugger</a> ! <ul> ! <li><a href="debug_preferences.html">Preferences</a> ! </ul> ! ! <li><a href="about.html">About</a> ! </ul> ! ! </body> ! ! </html> \ No newline at end of file --- NEW FILE: editor_parsing.html --- <!--=============================================================================================== File: editor_parsing.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Error Parsing in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Error Parsing'; links[i++] = 'editor_parsing.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> --- NEW FILE: debug.html --- <!--=============================================================================================== File: debug.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about the Debugger. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Debug'; links[i++] = 'debug.html'; writeHeading ( heads, links ); </script> <p>Here it is, try it out. You have: </p> <ul> <li>breakpoints</li> <li>step in/out/over</li> <li>multiple threads</li> <li>variable display</li> </ul> <p>The debugger can be invoked from the standard Eclipse debugger menus in the debug perspective, or through a context menu inside Navigator:</p> <p><img src="images/debugdialog.jpg" width="274" height="214"> or <img src="images/debug_menu.gif" width="328" height="373"></p> <p>Debug settings are configured in the standard dialog </p> <p><img src="images/debug_dialog.gif" width="612" height="434"> </p> <p>Here you can pick your program arguments, etc. The dialog will try to verify that your python interpreter is present. If it is not, go to Preferences:Pydev:Debug and configure a valid python executable.</p> <p>The program output is displayed in the console, and the errors in the console are hyperlinked back to the file:</p> <p><img src="images/debug_console.gif" width="600" height="498"> </p> <p>If you are running under the debugger, you'll get the standard debug interface:</p> <p><img src="images/debugger.gif" width="816" height="543"> </p> <p>See the <a href="http://pydev.sf.net/">pydev website</a> for the latest debugging info. </p> </body> </html> Index: editor_autoi.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_autoi.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_autoi.html 11 Jun 2004 19:46:57 -0000 1.1 --- editor_autoi.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,2 **** ! <h2>PyDev User Manual</h2> ! <h3>Editor :: Auto Indentation</h3> --- 1,51 ---- ! <!--=============================================================================================== ! ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Describes information about Auto-Indentation ! in the plug-in, along with screenshots and helpful information on hotkeys. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! heads[i] = 'Features'; ! links[i++] = ''; ! ! heads[i] = 'Auto Indentation'; ! links[i++] = 'editor_autoi.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p> ! ... ! </p> ! ! </body> ! ! </html> \ No newline at end of file Index: editor_syntaxh.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_syntaxh.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_syntaxh.html 11 Jun 2004 19:46:57 -0000 1.1 --- editor_syntaxh.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,2 **** ! <h2>PyDev User Manual</h2> ! <h3>Editor :: Syntax Highlighting</h3> --- 1,51 ---- ! <!--=============================================================================================== ! ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Describes information about Syntax Highlighting ! in the plug-in, along with screenshots and helpful information on hotkeys. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body class = BlueGray> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! heads[i] = 'Features'; ! links[i++] = ''; ! ! heads[i] = 'Syntax Highlighting'; ! links[i++] = 'editor_syntaxh.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p> ! ... ! </p> ! ! </body> ! ! </html> \ No newline at end of file --- NEW FILE: editor_outline.html --- <!--=============================================================================================== File: editor_outline.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about the Outline View in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Outline View'; links[i++] = 'editor_outline.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> --- NEW FILE: editor_gotonmc.html --- <!--=============================================================================================== File: about.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Goto Next Method/Class in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Go to Next Method/Class'; links[i++] = 'editor_gotonmc.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> --- NEW FILE: debug_preferences.html --- <!--=============================================================================================== File: debug_preferences.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about the Debug Preferences in the plug-in. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body class = BlueGray> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Debug'; links[i++] = 'debug.html'; heads[i] = 'Preferences'; links[i++] = 'debug_preferences.html'; writeHeading ( heads, links ); </script> <p>Configure your python executables here. By default, pydev will try to run "python".</p> <p><img src="images/db_prefs.gif" width="599" height="326"></p> </body> </html> --- NEW FILE: editor_gotopmc.html --- <!--=============================================================================================== File: about.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Goto Previous Method/Class in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Go to Previous Method/Class'; links[i++] = 'editor_gotopmc.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> --- NEW FILE: editor_gotofc.html --- <!--=============================================================================================== File: about.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Goto First Char in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Go to First Character'; links[i++] = 'editor_gotofc.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> Index: preferences.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/preferences.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** preferences.html 11 Jun 2004 19:46:57 -0000 1.1 --- preferences.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,2 **** ! <h2>PyDev User Manual</h2> ! <h3>Preferences</h3> --- 1,96 ---- ! <!--=============================================================================================== ! ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Describes information about the Preferences ! in the plug-in. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body class = BlueGray> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! heads[i] = 'Preferences'; ! links[i++] = 'preferences.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p><img src="images/ed_prefs.gif" width="600" height="260"></p> ! ! <p> ! <strong><u>Substitute spaces for tabs</u></strong> ! <br> ! Whether editor should insert spaces when you hit a tab. ! </p> ! ! <br> ! ! <p> ! <strong><u>Assume tab spacing when files contain tabs?</u></strong> ! <br> ! You'll like this preference if you swing both ways, and mix & match tabs and spaces, When this pref is on, if the file is tab-indented editor will do the right thing and leave your tabs alone. ! </p> ! ! <br> ! ! <p> ! <strong><u>Tab length</u></strong> ! <br> ! In inches. ! </p> ! ! <br> ! ! <p> ! <strong><u>Block comment separator</u></strong> ! <br> ! Used with the Add Block Comment feature (in the Source menu, or by pressing Ctrl+4). This feature adds a comment separator block to code that changes this: ! <br><br> ! print "foo"<br> ! print "bar" ! <br><br> ! Into: ! <br><br> ! #======<br> ! #print "foo"<br> ! #print "bar"<br> ! #======<br> ! <br> ! The comment separator (in this case ======, but it can be changed by the user's preference) is added to the beginning and end of the comment block. You can also select the blocked code and remove the block comment format with the Remove Block Comment feature in the Source menu, or by pressing Ctrl+5. ! </p> ! ! <br> ! ! <p> ! <strong><u>Colors</u></strong> ! <br> ! Are self-explanatary. The default colors have been borrowed from IDLE. ! </p> ! ! </body> ! ! </html> \ No newline at end of file --- NEW FILE: about.html --- <!--=============================================================================================== File: about.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes general information about the plug-in and its developers. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'About'; links[i++] = 'about.html'; writeHeading ( heads, links ); </script> <p> ... </p> </body> </html> Index: editor_comment.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_comment.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_comment.html 11 Jun 2004 19:46:57 -0000 1.1 --- editor_comment.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,27 **** ! <h2>PyDev User Manual</h2> ! <h3>Editor :: Comment</h3> ! <p> ! Besides regular commenting, PyDev allows you to comment out sections of code easily.<br> ! <br> ! From this:<br> ! <br> ! <img src="images/editor_blockc_06.jpg"><br> ! <br> ! To this:<br> ! <br> ! <img src="images/editor_blockc_05.jpg"><br> ! <br> ! In order to make bulk comments, highlight a body of text in the editor, and do one of the following:<br> ! <ul> ! <li>Source Menu -> Comment ! <li>Right-Click -> Source -> Comment ! <li>Ctrl+/ ! </ul> ! You may remove a selected bulk comment with:<br> ! <ul> ! <li>Source -> Comment ! <li>Right-Click -> Source -> Uncomment ! <li>Ctrl+\ ! </ul> ! </p> \ No newline at end of file --- 1,72 ---- ! <!--=============================================================================================== ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Describes information about Bulk Commenting ! in the plug-in, along with screenshots and helpful information on hotkeys. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body class = BlueGray> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! heads[i] = 'Features'; ! links[i++] = ''; ! ! heads[i] = 'Bulk Comment'; ! links[i++] = 'editor_comment.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p> ! Besides regular commenting, PyDev allows you to comment out sections of code easily.<br> ! <br> ! From this:<br> ! <br> ! <img src="images/editor_blockc_06.jpg"><br> ! <br> ! To this:<br> ! <br> ! <img src="images/editor_blockc_05.jpg"><br> ! <br> ! In order to make bulk comments, highlight a body of text in the editor, and do one of the following:<br> ! <ul> ! <li>Source Menu -> Comment ! <li>Right-Click -> Source -> Comment ! <li>Ctrl+/ ! </ul> ! You may remove a selected bulk comment with:<br> ! <ul> ! <li>Source -> Comment ! <li>Right-Click -> Source -> Uncomment ! <li>Ctrl+\ ! </ul> ! </p> ! ! </body> ! ! </html> \ No newline at end of file --- NEW FILE: editor_hyperlinks.html --- <!--=============================================================================================== File: editor_hyperlinks.html Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Part of PyDev User Guide in Eclipse. Describes information about Hyperlinks in the plug-in, along with screenshots and helpful information on hotkeys. ================================================================================================--> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <script src = "includes/script.js" language="javascript" type="text/javascript"></script> <link rel = stylesheet href = "includes/style.css" type = "text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PyDev User Guide</title> </head> <body> <script language="javascript"> var heads = new Array ( ); var links = new Array ( ); var i = 0; heads[i] = 'PyDev User Guide'; links[i++] = 'index.html'; heads[i] = 'Features'; links[i++] = ''; heads[i] = 'Hyperlinks'; links[i++] = 'editor_hyperlinks.html'; writeHeading ( heads, links ); </script> <p>If you press CTRL while mousing over function & import names you'll get a hyperlink to their definition. The hyperlinking only works for:</p> <ul> <li>functions defined in the same file</li> <li>imports that are on your import path. The import path includes python.exe/Lib, if you've defined python executable in your pydev:debug preferences.</li> </ul> <p><img src="images/hyperanim.gif" width="300" height="170" border="1"> </p> <p> </p> <p> </p> </body> </html> Index: editor_blockc.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_blockc.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_blockc.html 11 Jun 2004 19:46:57 -0000 1.1 --- editor_blockc.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,28 **** ! <h2>PyDev User Manual</h2> ! <h3>Editor :: Block Comment</h3> ! <p> ! Block Comments are lines of code with the <strong>#</strong> token preceding them, and with separators to make them stand out.<br> ! <br> ! From this:<br> ! <br> ! <img src="images/editor_blockc_06.jpg"><br> ! <br> ! To this:<br> ! <br> ! <img src="images/editor_blockc_01.jpg"><br> ! <br> ! In order to make block comments, highlight a body of text in the editor, and do one of the following:<br> ! <ul> ! <li>Source Menu -> Add Comment Block ! <li>Right-Click -> Source -> Add Comment Block ! <li>Ctrl+4 ! </ul> ! You may remove a selected comment block with:<br> ! <ul> ! <li>Source -> Remove Comment Block ! <li>Right-Click -> Source -> Remove Comment Block ! <li>Ctrl+5 ! </ul> ! The separator string (the =====) can be changed in the <a href="preferences.html">Preferences page</a>. <br> ! </p> --- 1,73 ---- ! <!--=============================================================================================== ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Describes information about Block Commenting ! in the plug-in, along with screenshots and helpful information on hotkeys. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body class = BlueGray> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! heads[i] = 'Features'; ! links[i++] = ''; ! ! heads[i] = 'Block Comment'; ! links[i++] = 'editor_blockc.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p> ! Block Comments are lines of code with the <strong>#</strong> token preceding them, and with separators to make them stand out.<br> ! <br> ! From this:<br> ! <br> ! <img src="images/editor_blockc_06.jpg"><br> ! <br> ! To this:<br> ! <br> ! <img src="images/editor_blockc_01.jpg"><br> ! <br> ! In order to make block comments, highlight a body of text in the editor, and do one of the following:<br> ! <ul> ! <li>Source Menu -> Add Comment Block ! <li>Right-Click -> Source -> Add Comment Block ! <li>Ctrl+4 ! </ul> ! You may remove a selected comment block with:<br> ! <ul> ! <li>Source -> Remove Comment Block ! <li>Right-Click -> Source -> Remove Comment Block ! <li>Ctrl+5 ! </ul> ! The separator string (the =====) can be changed in the <a href="preferences.html">Preferences page</a>. <br> ! </p> ! ! </body> ! ! </html> \ No newline at end of file Index: editor_stripw.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/userguide/editor_stripw.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_stripw.html 11 Jun 2004 19:46:57 -0000 1.1 --- editor_stripw.html 14 Jun 2004 20:22:13 -0000 1.2 *************** *** 1,12 **** ! <h2>PyDev User Manual</h2> ! <h3>Editor :: Strip Trailing Whitespace</h3> ! <p> ! Trailing whitespace is any tab, space, etc characters at the end of a line. ! <br><br> ! In order to strip whitespace, you can highlight a body of text in the editor, or select nothing and it will strip whitespace in the entire document. Do one of the following:<br> ! <ul> ! <li>Source Menu -> Strip Trailing Whitespace ! <li>Right-Click -> Source -> Strip Trailing Whitespace ! <li>Shift+Space ! </p> --- 1,57 ---- ! <!--=============================================================================================== ! File: about.html ! ! Author: Parhaum Toofanian, Copyright 2004 ! Contact: pto...@an... ! Created: 2004-06-14 ! Modified: 2004-06-14 ! ! Part of PyDev User Guide in Eclipse. Describes information about Strip Trailing Whitespace ! in the plug-in, along with screenshots and helpful information on hotkeys. ! ! ================================================================================================--> ! ! ! <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> ! <html> ! ! <head> ! <script src = "includes/script.js" language="javascript" type="text/javascript"></script> ! <link rel = stylesheet href = "includes/style.css" type = "text/css"> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <title>PyDev User Guide</title> ! </head> ! ! <body class = BlueGray> ! ! <script language="javascript"> ! var heads = new Array ( ); ! var links = new Array ( ); ! var i = 0; ! ! heads[i] = 'PyDev User Guide'; ! links[i++] = 'index.html'; ! ! heads[i] = 'Features'; ! links[i++] = ''; ! ! heads[i] = 'Strip Trailing Whitespace'; ! links[i++] = 'editor_stripw.html'; ! ! writeHeading ( heads, links ); ! </script> ! ! <p> ! Trailing whitespace is any tab, space, etc characters at the end of a line. ! <br><br> ! In order to strip whitespace, you can highlight a body of text in the editor, or select nothing and it will strip whitespace in the entire document. Do one of the following:<br> ! <ul> ! <li>Source Menu -> Strip Trailing Whitespace ! <li>Right-Click -> Source -> Strip Trailing Whitespace ! <li>Shift+Space ! </p> ! ! </body> ! ! </html> \ No newline at end of file |
From: Parhaum T. <dre...@us...> - 2004-06-14 20:22:23
|
Update of /cvsroot/pydev/org.python.pydev.help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25994 Modified Files: toc_main.xml Log Message: Modified in org.python.pydev.help: userguide folder - Added stylesheet, script file, and more feature pages. Index: toc_main.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/toc_main.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** toc_main.xml 11 Jun 2004 20:04:03 -0000 1.3 --- toc_main.xml 14 Jun 2004 20:22:13 -0000 1.4 *************** *** 1,3 **** ! <toc label="PyDev" topic="html/index.html"> <topic label="Editor" href="html/editor.html"> <topic label="Preferences" href="html/ed_prefs.html"/> --- 1,3 ---- ! <toc label="PyDev User Guide" topic="html/index.html"> <topic label="Editor" href="html/editor.html"> <topic label="Preferences" href="html/ed_prefs.html"/> *************** *** 8,20 **** <topic label="User Guide" href="html/userguide/index.html"> <topic label="Editor"> ! <topic label="Syntax Highlighting" href="html/userguide/editor_syntaxh.html"/> ! <topic label="Auto-Indentation" href="html/userguide/editor_autoi.html"/> ! <topic label="Comment" href="html/userguide/editor_comment.html"/> <topic label="Block Comment" href="html/userguide/editor_blockc.html"/> <topic label="Strip Trailing Whitespace" href="html/userguide/editor_stripw.html"/> </topic> <topic label="Preferences" href="html/userguide/preferences.html"/> ! <topic label="Debugger"/> ! <topic label="Developer Guide" href="html/devguide/index.html"/> </topic> </toc> \ No newline at end of file --- 8,28 ---- <topic label="User Guide" href="html/userguide/index.html"> <topic label="Editor"> ! <topic label="Auto Indentation" href="html/userguide/editor_autoi.html"/> <topic label="Block Comment" href="html/userguide/editor_blockc.html"/> + <topic label="Bulk Comment" href="html/userguide/editor_comment.html"/> + <topic label="Error Parsing" href="html/userguide/editor_parsing.html"/> + <topic label="Go to First Character" href="html/userguide/editor_gotofc.html"/> + <topic label="Go to Previous Method/Class" href="html/userguide/editor_gotopmc.html"/> + <topic label="Go to Next Method/Class" href="html/userguide/editor_gotonmc.html"/> + <topic label="Hyperlinks" href="html/userguide/editor_hyperlinks.html"/> + <topic label="Outline View" href="html/userguide/editor_outline.html"/> <topic label="Strip Trailing Whitespace" href="html/userguide/editor_stripw.html"/> + <topic label="Syntax Highlighting" href="html/userguide/editor_syntaxh.html"/> </topic> <topic label="Preferences" href="html/userguide/preferences.html"/> ! <topic label="Debugger" href="html/userguide/debug.html"> ! <topic label="Preferences" href="html/userguide/debug_preferences.html"/> ! </topic> ! <topic label="About" href="html/userguide/about.html"/> </topic> </toc> \ No newline at end of file |
From: Parhaum T. <dre...@us...> - 2004-06-14 20:22:22
|
Update of /cvsroot/pydev/org.python.pydev.help/html/userguide/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25994/html/userguide/includes Added Files: script.js style.css Log Message: Modified in org.python.pydev.help: userguide folder - Added stylesheet, script file, and more feature pages. --- NEW FILE: style.css --- /*================================================================================================= File: style.css Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Style file for PyDev User Guide in Eclipse. =================================================================================================*/ Body { scrollbar-3dlight-color: white; scrollbar-arrow-color: #005CA9; scrollbar-base-color: white; scrollbar-darkshadow-color: white; scrollbar-face- color: white; scrollbar-highlight-color: #4D8CC2; scrollbar-shadow-color: #014B8C; scrollbar-track-color: white; margin: 10px; padding: 0px; background-color: #10395E; color: #C2C2C2; font-family: arial; } A { font-family: courier; font-style: bold; text-decoration: none; color: white; } A:Visited { font-family: courier; font-style: bold; text-decoration: none; color: white; } A:Hover { font-family: courier; font-style: bold; text-decoration: none; /* underline overline */ color: orange; } A.Heading { font-size: 13pt; font-family: tahoma; font-style: bold; font-weight: 800; text-decoration: none; color: white; } A.Heading:Visited { font-size: 13pt; font-family: tahoma; font-style: bold; font-weight: 800; text-decoration: none; color: white; } A.Heading:Hover { font-size: 13pt; font-family: tahoma; font-style: bold; font-weight: 800; text-decoration: none; /* underline overline */ color: orange; } p.Heading { font-size: 13pt; font-style: normal; font-weight: 800; font-family: tahoma; cursor: default; } .MenuTable { border: 1px solid black; } .BannerTable { font-size: 24pt; color: white; background-color: #276295; border: 1px solid black; font-family: tahoma; cursor: default; } .LogoTable { font-size: 24pt; color: #276295; background-color: white; border: 1px solid white; font-family: tahoma; cursor: default; } .MenuRowInverse { font-size: 8pt; font-style: bold; font-weight: 800; color: #FF8A00; background-color: white; border: 1px solid black; cursor: default; } .CopyrightRowInverse { font-size: 8pt; color: #276295; background-color: white; border: 1px solid black; cursor: default; } .MenuRow { font-size: 9pt; color: white; background-color: #4D8CC2; border: 1px solid black; cursor: default; } .MenuRowOff { font-family: verdana; font-size: 8pt; color: white; background-color: #4D8CC2; border: 1px solid #4D8CC2; cursor: default; } .MenuRowOver { font-family: verdana; font-size: 8pt; color: white; background-color: #FF8A00; border: 1px solid black; cursor: hand; } .MenuBox { font-size: 9pt; color: white; background-color: #4D8CC2; border: 1px solid black; cursor: default; } .TheaterName { font-size: 14pt; font-style: bold; font-weight: 800; color: #26659B; background-color: white; border: 1px solid black; } .MovieName { font-family: verdana; font-size: 10pt; font-style: bold; color: white; background-color: gray; border: 1px solid black; } .ShowingText { font-family: verdana; font-size: 8pt; color: black; background-color: white; } .ShowingTextSoldOut { font-family: arial; font-size: 10pt; color: red; background-color: white; } .FormText { font-family: verdana; font-size: 12pt; font-style: bold; color: black; background-color: white; } .FormContents { font-family: verdana; font-size: 8pt; color: white; background-color: #4D8CC2; border: 1px solid black; } .Error { font-family: verdana; font-size: 10pt; color: red; background-color: white; } .Main { font-family: arial; font-size: 9pt; text-decoration: none; color: black; } A.Main { font-family: arial; font-size: 9pt; text-decoration: none; color: #26659B; } A.Main:Visited { font-family: arial; font-size: 9pt; text-decoration: none; color: #26659B; } A.Main:Hover { font-family: arial; font-size: 9pt; text-decoration: none; color: #4D8CC2; } A.Error { font-family: arial; font-size: 9pt; text-decoration: none; color: red; } A.Error:Visited { font-family: arial; font-size: 9pt; text-decoration: none; color: red; } A.Error:Hover { font-family: arial; font-size: 9pt; text-decoration: none; color: #FF4545; } .SoldOut { font-family: arial; font-size: 10pt; text-decoration: none; color: red; } .MovieTime { font-family: verdana; font-size: 8pt; color: black; background-color: white; text-decoration: none; } .Button { text-decoration: none; font-size: 8pt; font-family: verdana; color: #4D8CC2; background-color: white; border: 1px solid #4D8CC2; } A.Menu { text-decoration: none; color: white; } A.Menu:Visited { text-decoration: none; color: white; } A.Menu:Hover { text-decoration: none; color: white; } .MenuOff { text-decoration: none; font-size: 10pt; font-family: Arial; font-weight: 800; font-style: bold; color: white; background-color: #0067F6; background-image: url(../images/menu-off.jpg); /*background-image: url(../images/menu-off.jpg);*/ border: 1px solid black; cursor: hand; } .MenuCurrent { text-decoration: none; font-size: 10pt; font-family: Arial; font-weight: 800; font-style: bold; color: white; background-color: #FBA144; background-image: url(../images/menu-on.jpg); /*background-image: url(../images/menu-on.jpg);*/ border: 1px solid black; cursor: hand; } .MenuOver { text-decoration: none; font-size: 10pt; font-family: Arial; font-weight: 800; font-style: bold; color: white; background-color: #FBA144; background-image: url(../images/menu-on.jpg); /*background-image: url(../images/menu-on.jpg);*/ border: 1px solid black; cursor: hand; } .MenuTable { border: 1px solid black; } .LegalTable { font-size: 8pt; font-family: arial; font-weight: 400; color: black; border: 1px solid black; background-color: white; /*background-color: 005BA8; background-image: url(../images/menu-on.jpg);*/ margin: 0px; cursor: hand; } .Text-Content { font-size: 9pt; font-family: arial; color: black; background-color: white; } .Text-Headline { font-size: 9pt; font-family: arial; color: black; background-color: white; } .GalleryText { font-size: 9pt; font-family: arial; color: black; } .Gallery-Off { font-size: 9pt; font-family: arial; color: black; border: 1px solid white; } .Gallery-Curr { font-size: 9pt; font-family: arial; color: black; border: 1px solid #005eb5; cursor: default; } .Gallery-On { font-size: 9pt; font-family: arial; color: black; border: 1px solid #005eb5; cursor: hand; } .Tiny { font-size: 40pt; } TABLE.Text { font-size: 9pt; font-family: arial; color: black; } --- NEW FILE: script.js --- /*================================================================================================= File: script.js Author: Parhaum Toofanian, Copyright 2004 Contact: pto...@an... Created: 2004-06-14 Modified: 2004-06-14 Script file for PyDev User Guide in Eclipse. =================================================================================================*/ //////////////////////////////////////////////////////////////////////////////[ writeHeading ]///// // Name: writeHeading // // Desc: Writes a standard, formatted header for each page body. // // In: heads Array Stores multiple headlines // links Array Stores links to headlines // Out: - // // Sample usage: // // <script language="javascript"> // var heads = new Array ( ); // var links = new Array ( ); // // heads[0] = 'Foo'; // links[0] = 'foo.html'; // // writeHeading ( heads, links ); // </script> /////////////////////////////////////////////////////////////////////////////////////////////////// function writeHeading ( heads, links ) { document.write ( '<p class="Heading">' ); for ( var i = 0; i < heads.length; i++ ) { if ( links[i] != '' && i < heads.length - 1 ) document.write ( '<a class="Heading" href="' + links[i] + '">' ); document.write ( heads[i] ); if ( links[i] != '' && i < heads.length - 1 ) document.write ( '</a>' ); if ( i < heads.length - 1 ) document.write ( ' :: ' ); } document.write ( '</p>' ); document.write ( '<hr>' ); } //////////////////////////////////////////////////////////////////////////////[ writeHeading ]///// |
From: Parhaum T. <dre...@us...> - 2004-06-14 20:22:07
|
Update of /cvsroot/pydev/org.python.pydev.help/html/userguide/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25744/html/userguide/includes Log Message: Directory /cvsroot/pydev/org.python.pydev.help/html/userguide/includes added to the repository |
From: Fabio Z. <fa...@us...> - 2004-06-14 18:52:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26802/src/org/python/pydev/editor Modified Files: PythonCompletionProcessor.java Log Message: Added object class definition for new style classes (should be removed after jython gets there) Index: PythonCompletionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PythonCompletionProcessor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PythonCompletionProcessor.java 14 Jun 2004 12:50:10 -0000 1.5 --- PythonCompletionProcessor.java 14 Jun 2004 18:52:38 -0000 1.6 *************** *** 62,65 **** --- 62,66 ---- int qlen = qualifier.length(); try { + System.out.println("Interpreted doc: "+theDoc); PyList theList = autoComplete(interp, theDoc, activationToken); PyObject o = new PyObject(); *************** *** 98,101 **** --- 99,103 ---- interp.exec("from PyDev import jintrospect"); // System.out.println("DBG:from PyDev import jintrospect:done"); + interp.exec("class object:pass"); //TODO: REMOVE AFTER JYTHON ADDS SUPPORT TO NEW STYLE CLASSES. interp.exec(theCode); String xCommand = "theList = jintrospect.getAutoCompleteList(command='"+theActivationToken+"', locals=locals())"; |
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13903/src/org/python/pydev/editor Modified Files: PythonCompletionProcessor.java PyDoubleClickStrategy.java PyAutoIndentStrategy.java Hyperlink.java PyEdit.java Log Message: Removed unused imports... Index: PyAutoIndentStrategy.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyAutoIndentStrategy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyAutoIndentStrategy.java 22 Apr 2004 10:35:23 -0000 1.3 --- PyAutoIndentStrategy.java 14 Jun 2004 12:50:10 -0000 1.4 *************** *** 8,13 **** import org.eclipse.jface.text.BadLocationException; - import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.DefaultAutoIndentStrategy; import org.eclipse.jface.text.IDocument; import org.python.pydev.plugin.PydevPrefs; --- 8,13 ---- import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.DefaultAutoIndentStrategy; + import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IDocument; import org.python.pydev.plugin.PydevPrefs; Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PyEdit.java 7 May 2004 21:48:59 -0000 1.15 --- PyEdit.java 14 Jun 2004 12:50:10 -0000 1.16 *************** *** 17,20 **** --- 17,21 ---- import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Preferences; + import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.Assert; import org.eclipse.jface.text.BadLocationException; *************** *** 39,43 **** import org.python.parser.Token; import org.python.parser.TokenMgrError; - import org.python.pydev.plugin.*; import org.python.pydev.editor.actions.PyOpenAction; import org.python.pydev.editor.model.AbstractNode; --- 40,43 ---- *************** *** 48,53 **** import org.python.pydev.parser.IParserListener; import org.python.pydev.parser.PyParser; import org.python.pydev.ui.ColorCache; - import org.eclipse.jface.action.IAction; --- 48,54 ---- import org.python.pydev.parser.IParserListener; import org.python.pydev.parser.PyParser; + import org.python.pydev.plugin.PydevPlugin; + import org.python.pydev.plugin.PydevPrefs; import org.python.pydev.ui.ColorCache; Index: PyDoubleClickStrategy.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyDoubleClickStrategy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyDoubleClickStrategy.java 22 Apr 2004 10:35:23 -0000 1.2 --- PyDoubleClickStrategy.java 14 Jun 2004 12:50:10 -0000 1.3 *************** *** 12,19 **** import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; - import org.eclipse.jface.text.Region; - import org.eclipse.jface.text.ITextDoubleClickStrategy; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.source.ICharacterPairMatcher; --- 12,18 ---- import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextDoubleClickStrategy; import org.eclipse.jface.text.ITextViewer; + import org.eclipse.jface.text.Region; import org.eclipse.jface.text.source.ICharacterPairMatcher; Index: PythonCompletionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PythonCompletionProcessor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PythonCompletionProcessor.java 14 Jun 2004 06:40:20 -0000 1.4 --- PythonCompletionProcessor.java 14 Jun 2004 12:50:10 -0000 1.5 *************** *** 7,31 **** package org.python.pydev.editor; - import java.io.BufferedReader; - import java.io.FileInputStream; - import java.io.FileNotFoundException; - import java.io.FileReader; import java.io.IOException; - import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; - import java.util.Enumeration; import java.util.List; import java.util.Properties; - import java.util.ResourceBundle; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; - import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.CompletionProposal; - import org.eclipse.jface.text.contentassist.ContextInformation; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; --- 7,22 ---- *************** *** 33,50 **** import org.eclipse.jface.text.contentassist.IContextInformationValidator; import org.eclipse.swt.graphics.Point; ! ! import org.python.core.*; ! //import org.python.pydev.editor.test.Debug; ! //import org.python.pydev.editor.test.Inspect; ! //import org.python.pydev.editor.test.Introspect; ! //import org.python.pydev.editor.test.Jintrospect; ! //import org.python.pydev.editor.test.Sre_compile; ! //import org.python.pydev.editor.test.Sre_constants; ! //import org.python.pydev.editor.test.Token; ! //import org.python.pydev.editor.test.Tokenize; ! //import org.python.pydev.editor.test.Re; ! //import org.python.pydev.editor.test.Sre; ! //import org.python.pydev.editor.test.String; ! import org.python.pydev.plugin.PydevPlugin; import org.python.util.PythonInterpreter; --- 24,32 ---- import org.eclipse.jface.text.contentassist.IContextInformationValidator; import org.eclipse.swt.graphics.Point; ! import org.python.core.PyException; ! import org.python.core.PyList; ! import org.python.core.PyObject; ! import org.python.core.PyString; ! import org.python.core.PySystemState; import org.python.util.PythonInterpreter; Index: Hyperlink.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/Hyperlink.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Hyperlink.java 5 May 2004 02:05:20 -0000 1.5 --- Hyperlink.java 14 Jun 2004 12:50:10 -0000 1.6 *************** *** 13,17 **** import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; - import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.DocumentEvent; --- 13,16 ---- |
From: Fabio Z. <fa...@us...> - 2004-06-14 12:45:15
|
Update of /cvsroot/pydev/org.pydev.jython In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9736 Modified Files: .classpath Log Message: Changed path containing filesystem information. Index: .classpath =================================================================== RCS file: /cvsroot/pydev/org.pydev.jython/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .classpath 14 Jun 2004 06:35:54 -0000 1.4 --- .classpath 14 Jun 2004 12:44:55 -0000 1.5 *************** *** 5,9 **** <classpathentry kind="src" path="/org.eclipse.core.runtime"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="D:/pydevspace2/org.pydev.jython/jythonlib.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 5,9 ---- <classpathentry kind="src" path="/org.eclipse.core.runtime"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="jythonlib.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Aleksandar T. <at...@us...> - 2004-06-14 06:40:29
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21411/src/org/python/pydev/editor Modified Files: PythonCompletionProcessor.java Log Message: Fixed the include of test directories Index: PythonCompletionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PythonCompletionProcessor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PythonCompletionProcessor.java 14 Jun 2004 01:12:30 -0000 1.3 --- PythonCompletionProcessor.java 14 Jun 2004 06:40:20 -0000 1.4 *************** *** 35,48 **** import org.python.core.*; ! import org.python.pydev.editor.test.Debug; ! import org.python.pydev.editor.test.Inspect; ! import org.python.pydev.editor.test.Introspect; ! import org.python.pydev.editor.test.Jintrospect; ! import org.python.pydev.editor.test.Sre_compile; ! import org.python.pydev.editor.test.Sre_constants; ! import org.python.pydev.editor.test.Token; ! import org.python.pydev.editor.test.Tokenize; ! import org.python.pydev.editor.test.Re; ! import org.python.pydev.editor.test.Sre; //import org.python.pydev.editor.test.String; import org.python.pydev.plugin.PydevPlugin; --- 35,48 ---- import org.python.core.*; ! //import org.python.pydev.editor.test.Debug; ! //import org.python.pydev.editor.test.Inspect; ! //import org.python.pydev.editor.test.Introspect; ! //import org.python.pydev.editor.test.Jintrospect; ! //import org.python.pydev.editor.test.Sre_compile; ! //import org.python.pydev.editor.test.Sre_constants; ! //import org.python.pydev.editor.test.Token; ! //import org.python.pydev.editor.test.Tokenize; ! //import org.python.pydev.editor.test.Re; ! //import org.python.pydev.editor.test.Sre; //import org.python.pydev.editor.test.String; import org.python.pydev.plugin.PydevPlugin; |
From: Aleksandar T. <at...@us...> - 2004-06-14 06:36:03
|
Update of /cvsroot/pydev/org.pydev.jython In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18183 Modified Files: .classpath Log Message: Fixed the absolute include path Index: .classpath =================================================================== RCS file: /cvsroot/pydev/org.pydev.jython/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .classpath 14 Jun 2004 01:03:42 -0000 1.3 --- .classpath 14 Jun 2004 06:35:54 -0000 1.4 *************** *** 5,9 **** <classpathentry kind="src" path="/org.eclipse.core.runtime"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="C:/jython/jythonlib.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 5,9 ---- <classpathentry kind="src" path="/org.eclipse.core.runtime"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="D:/pydevspace2/org.pydev.jython/jythonlib.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Dana M. <dan...@us...> - 2004-06-14 01:12:41
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30964/editor Modified Files: PyEditConfiguration.java PythonCompletionProcessor.java Log Message: autocompletion version 1 Index: PyEditConfiguration.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyEditConfiguration.java 25 May 2004 21:10:40 -0000 1.10 --- PyEditConfiguration.java 14 Jun 2004 01:12:30 -0000 1.11 *************** *** 278,283 **** */ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ! // public final static String PY_SINGLELINE_STRING = "__python_singleline_string"; ! // public final static String PY_MULTILINE_STRING = "__python_multiline_string";); // create a content assistant: ContentAssistant assistant = new ContentAssistant(); --- 278,283 ---- */ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ! final String PY_SINGLELINE_STRING = "__python_singleline_string"; ! final String PY_MULTILINE_STRING = "__python_multiline_string"; // create a content assistant: ContentAssistant assistant = new ContentAssistant(); *************** *** 285,295 **** IContentAssistProcessor processor = new PythonCompletionProcessor(); // No code completion in strings ! // assistant.setContentAssistProcessor(processor,PyPartitionScanner.PY_SINGLELINE_STRING ); ! // assistant.setContentAssistProcessor(processor,PyPartitionScanner.PY_MULTILINE_STRING ); assistant.setContentAssistProcessor(processor,IDocument.DEFAULT_CONTENT_TYPE ); assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); // Allow automatic activation after 500 msec ! // assistant.enableAutoActivation(true); ! // assistant.setAutoActivationDelay(500); Color bgColor = colorCache.getColor(new RGB(230,255,230)); assistant.setProposalSelectorBackground(bgColor); --- 285,295 ---- IContentAssistProcessor processor = new PythonCompletionProcessor(); // No code completion in strings ! assistant.setContentAssistProcessor(processor,PyPartitionScanner.PY_SINGLELINE_STRING ); ! assistant.setContentAssistProcessor(processor,PyPartitionScanner.PY_MULTILINE_STRING ); assistant.setContentAssistProcessor(processor,IDocument.DEFAULT_CONTENT_TYPE ); assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); // Allow automatic activation after 500 msec ! assistant.enableAutoActivation(true); ! assistant.setAutoActivationDelay(500); Color bgColor = colorCache.getColor(new RGB(230,255,230)); assistant.setProposalSelectorBackground(bgColor); Index: PythonCompletionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PythonCompletionProcessor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonCompletionProcessor.java 27 Apr 2004 01:06:57 -0000 1.2 --- PythonCompletionProcessor.java 14 Jun 2004 01:12:30 -0000 1.3 *************** *** 7,13 **** --- 7,26 ---- package org.python.pydev.editor; + import java.io.BufferedReader; + import java.io.FileInputStream; + import java.io.FileNotFoundException; + import java.io.FileReader; + import java.io.IOException; + import java.io.InputStream; + import java.net.MalformedURLException; + import java.net.URL; import java.util.ArrayList; + import java.util.Enumeration; import java.util.List; + import java.util.Properties; + import java.util.ResourceBundle; + import org.eclipse.core.runtime.Platform; + import org.eclipse.core.runtime.Plugin; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; *************** *** 21,24 **** --- 34,51 ---- import org.eclipse.swt.graphics.Point; + import org.python.core.*; + import org.python.pydev.editor.test.Debug; + import org.python.pydev.editor.test.Inspect; + import org.python.pydev.editor.test.Introspect; + import org.python.pydev.editor.test.Jintrospect; + import org.python.pydev.editor.test.Sre_compile; + import org.python.pydev.editor.test.Sre_constants; + import org.python.pydev.editor.test.Token; + import org.python.pydev.editor.test.Tokenize; + import org.python.pydev.editor.test.Re; + import org.python.pydev.editor.test.Sre; + //import org.python.pydev.editor.test.String; + import org.python.pydev.plugin.PydevPlugin; + import org.python.util.PythonInterpreter; /** *************** *** 33,66 **** * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) */ public ICompletionProposal[] computeCompletionProposals( ITextViewer viewer, int documentOffset) { ! // get the document to be inspected... IDocument doc = viewer.getDocument(); ! // get the current selection range... Point selectedRange = viewer.getSelectedRange(); ! List propList = new ArrayList(); ! if (selectedRange.y > 0) { ! try { ! String text = doc.get(selectedRange.x, selectedRange.y); ! System.out.println("Document text:"+text); ! computeStyleProposals(text, selectedRange, propList); ! } catch (BadLocationException e) { ! // ??? ! return null; } } ! else{ ! //try to retrv a 'qualifier' from the doc. ! // for example, a partial python statement. This might be used to restrict the set of possible proposals ! String qualifier = getQualifier(doc, documentOffset); ! System.out.println("Document qualifier:"+qualifier); ! computeStructureProposals(qualifier, documentOffset, propList); ! } ! // create an array of completion proposals ! ICompletionProposal [] proposals = new ICompletionProposal[propList.size()]; propList.toArray(proposals); return proposals; ! } --- 60,125 ---- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) */ + int docBoundary = -1; // the document prior to the activation token + int docBoundary2 = 0; public ICompletionProposal[] computeCompletionProposals( ITextViewer viewer, int documentOffset) { ! List propList = new ArrayList(); IDocument doc = viewer.getDocument(); ! // System.out.println("The document:"+doc.get()); Point selectedRange = viewer.getSelectedRange(); ! // there may not be a selected range ! java.lang.String theDoc = doc.get(); ! calcDocBoundary(theDoc, documentOffset); ! String activationToken = this.getActivationToken(theDoc, documentOffset); ! // System.out.println("DBG:theActivationToken: "+activationToken); ! theDoc = partialDocument(theDoc, documentOffset); ! // System.out.println("DBG:theDoc: "+theDoc); ! PythonInterpreter interp = initInterpreter(null); ! java.lang.String qualifier = getQualifier(doc, documentOffset); ! int qlen = qualifier.length(); ! try { ! PyList theList = autoComplete(interp, theDoc, activationToken); ! PyObject o = new PyObject(); ! for (int i = 0; i < theList.__len__(); i++) { ! String p = theList.__getitem__(i).toString(); ! // System.out.println("Item:" + p); ! CompletionProposal proposal = ! new CompletionProposal( ! p, ! documentOffset - qlen, ! qlen, ! p.length()); ! propList.add(proposal); } + + } catch (PyException e) { + e.printStackTrace(); } ! ! PyObject theCode = null; ! ! ICompletionProposal[] proposals = ! new ICompletionProposal[propList.size()]; ! // and fill with list elements propList.toArray(proposals); + // Return the proposals return proposals; ! ! } ! private PyList autoComplete( ! PythonInterpreter interp, ! java.lang.String theCode, ! java.lang.String theActivationToken) ! throws PyException { ! StringBuffer example = new StringBuffer(); ! interp.exec("from PyDev import jintrospect"); ! // System.out.println("DBG:from PyDev import jintrospect:done"); ! interp.exec(theCode); ! String xCommand = "theList = jintrospect.getAutoCompleteList(command='"+theActivationToken+"', locals=locals())"; ! // System.out.println("DBG:xCommand:"+xCommand); ! interp.exec(xCommand); ! PyList theList = (PyList) interp.get("theList"); ! return theList; } *************** *** 70,148 **** * @param proposals */ ! private void computeStructureProposals(String qualifier, int documentOffset, List propList) { ! // Not sure how to adapt this one either. ! // The HTML example computes a part 'before the planned cursor' and a part 'after the planned cursor' ! // I think that here is where we want to somehow latch the pointer from the current parse tree. ! // we want to look at the text before the '.', and see what from the parse tree completes it... ! int qlen = qualifier.length(); ! for (int i = 0; i < STRUCTTAGS1.length; i++) { ! String startTag = STRUCTTAGS1[i]; ! // Check if proposal matches qualifier ! if (startTag.startsWith(qualifier)){ ! // Yes.. compute entire proposal text ! String text = startTag + STRUCTTAGS2[i]; ! int cursor = startTag.length(); ! // construct proposal ! CompletionProposal proposal = new CompletionProposal(text, documentOffset - qlen, qlen, cursor); ! // add to results ! propList.add(proposal); ! } ! ! } } /** ! * @param doc ! * @param documentOffset */ ! private String getQualifier(IDocument doc, int documentOffset) { ! // use a StringBuffer to collect the bunch of proposals ! // StringBuffer sB = new StringBuffer(); ! // while (true) { ! // try { ! // char c = doc.getChar(--documentOffset); ! // do something here to test if this was the start of a python statement ! // TODO: Figure this out. For sonmething like HTML, the test might be: ! // if (c == '>' || Character.isWhitespace(c) or something like that ! // Not really sure what our equivaent is? ! // for now.. ! // return ""; ! // } catch (BadLocationException e) { ! // return ""; ! // } ! // } ! return ""; ! } ! // Proposal part before cursor... ! // Let's stub in some static ones for the moment... ! private final static String[] STRUCTTAGS1 = ! {"Dana", "Bill", "Aleks", "Fabio"}; ! private final static String[] STRUCTTAGS2 = ! {"Moore", "Wright", "Totic", "Zadrozny"}; ! ! private final static String[] STYLETAGS = ! {"dana", "bill", "aleks", "fabio"}; ! private final static String[] STYLELABELS = ! {"DANA", "BILL", "ALEKS", "FABIO"}; /** ! * @param text ! * @param selectedRange ! * @param proposals */ ! private void computeStyleProposals(String selectedText, Point selectedRange, List propList) { ! // loop thru the styles.. what does this have to do with completion??? ! for (int i = 0; i < STYLETAGS.length; i++) { ! String tag = STYLETAGS[i]; ! // compute replacement text ! String replacement = "<"+tag+">"+ selectedText +"</"+tag+">"; ! int cursor = tag.length()+2; // ?? why plus 2 ! IContextInformation contextInfo = new ContextInformation(null, STYLELABELS[i]+" Style"); ! CompletionProposal proposal = new CompletionProposal(replacement, selectedRange.x, selectedRange.y, cursor, null, STYLELABELS[i], contextInfo, replacement); ! // add that to the list of proposals ! propList.add(proposal); ! } ! } --- 129,162 ---- * @param proposals */ ! public void calcDocBoundary(String theDoc, int documentOffset){ ! this.docBoundary = theDoc.substring(0, documentOffset).lastIndexOf('\n'); ! } ! public String getActivationToken(String theDoc, int documentOffset) { ! if (this.docBoundary < 0){ ! calcDocBoundary(theDoc,documentOffset); ! } ! return theDoc.substring(this.docBoundary+1, documentOffset); } /** ! * @param theDoc */ ! private String partialDocument(String theDoc, int documentOffset) { ! if (this.docBoundary < 0){ ! calcDocBoundary(theDoc,documentOffset); ! } ! ! String before = theDoc.substring(0, this.docBoundary); ! return before; ! } /** ! * @param doc ! * @param documentOffset */ ! private java.lang.String getQualifier(IDocument doc, int documentOffset) { ! // this routine should return any partial entry after the activation character ! return ""; } *************** *** 161,165 **** */ public char[] getCompletionProposalAutoActivationCharacters() { ! return new char[] {'.'}; } --- 175,179 ---- */ public char[] getCompletionProposalAutoActivationCharacters() { ! return new char[] { '.', '(' , '['}; } *************** *** 169,173 **** public char[] getContextInformationAutoActivationCharacters() { // is this _really_ what we want to use?? ! return new char[] {'.'}; } --- 183,187 ---- public char[] getContextInformationAutoActivationCharacters() { // is this _really_ what we want to use?? ! return new char[] { '.' }; } *************** *** 175,179 **** * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() */ ! public String getErrorMessage() { // TODO Auto-generated method stub return null; --- 189,193 ---- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() */ ! public java.lang.String getErrorMessage() { // TODO Auto-generated method stub return null; *************** *** 187,190 **** --- 201,250 ---- return null; } + // 1. create the PythonSystemState with the embedded $py.class files inserted into its path + // 2. + protected PythonInterpreter initInterpreter(java.lang.String[] argv) { + Properties p = System.getProperties(); + // p.setProperty("python.path", "c:\\Jython\\Lib"); + PySystemState.initialize(); + PythonInterpreter.initialize(System.getProperties(), p, null); + return new PythonInterpreter(null, createPySystemState()); + } + /** + * Create a new Python interpreter system state object aware for standard + * Jython library. + * + * @return Python interpreter system state. + * + * @throws JythonRuntimeException if it fails to locate the Jython + * libraries. The exception message will contain an explanation of the + * reason to fail. + */ + private String _jythonLib = null; + public PySystemState createPySystemState() { + if (_jythonLib == null) { + // Locate org.jython plugin and grab the jar location + Plugin jythonPlugin = Platform.getPlugin("org.pydev.jython"); + + String jythonPath = + jythonPlugin.getDescriptor().getInstallURL().toString() + "jythonlib.jar"; + try { + _jythonLib = Platform.asLocalURL(new URL(jythonPath)).getFile(); + // System.out.println("_jythonLib:"+_jythonLib); + } catch (MalformedURLException e) { + System.out.println( + "Failed to located Python System library because of invalid URL."+ + e); + } catch (IOException e) { + System.out.println( + "Failed to located Python System library because of IO Error."+ + e); + } + } + PySystemState result = new PySystemState(); + result.path.insert(0, new PyString(_jythonLib + "/Lib")); + // System.out.println("result.path: "+result.path); + // Location of the jython/python modules + return result; + } } |
From: Dana M. <dan...@us...> - 2004-06-14 01:06:19
|
Update of /cvsroot/pydev/org.pydev.jython In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25512 Added Files: jythonlib.jar Log Message: facilitate autocomplete --- NEW FILE: jythonlib.jar --- (This appears to be a binary file; contents omitted.) |
From: Dana M. <dan...@us...> - 2004-06-14 01:03:52
|
Update of /cvsroot/pydev/org.pydev.jython In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24867 Modified Files: .classpath plugin.xml Log Message: facilitate autocomplete Index: .classpath =================================================================== RCS file: /cvsroot/pydev/org.pydev.jython/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 27 May 2004 18:29:35 -0000 1.2 --- .classpath 14 Jun 2004 01:03:42 -0000 1.3 *************** *** 1,7 **** --- 1,9 ---- <?xml version="1.0" encoding="UTF-8"?> <classpath> + <classpathentry exported="true" kind="lib" path="jython.jar"/> <classpathentry kind="src" path="/org.eclipse.core.boot"/> <classpathentry kind="src" path="/org.eclipse.core.runtime"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="C:/jython/jythonlib.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.pydev.jython/plugin.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plugin.xml 25 May 2004 18:01:57 -0000 1.1 --- plugin.xml 14 Jun 2004 01:03:42 -0000 1.2 *************** *** 10,13 **** --- 10,16 ---- <packages prefixes="org.python"/> </library> + <library name="libjython.jar"> + <packages prefixes="Lib"/> + </library> </runtime> |