Commit [9c2140] jedit-0-7 Maximize Restore History

import of jEdit-0.7

Slava Pestov Slava Pestov 1998-10-06

1 2 > >> (Page 1 of 2)
added doc/shortcuts.txt
added plugins/Rot13/Makefile
added plugins/Rot13/installit.bat
added plugins/Rot13/makeit.bat
added plugins/Rot13/rot13.props
changed bin/jedit
changed bin/jedit.bat
changed bin/jopen
changed bin/jopen.bat
changed doc/Makefile
changed doc/index.txt
changed doc/installing.txt
changed doc/menus.txt
changed doc/plugins.txt
changed doc/props.txt
changed doc/starting.txt
changed plugins/Send/SendDialog.java
changed plugins/Makefile
changed plugins/installit.bat
changed plugins/makeit.bat
changed src/View.java
changed src/jEdit.java
copied doc/editing.txt -> plugins/Rot13/Cmd_rot13.java
doc/shortcuts.txt Diff Switch to side-by-side view
Loading...
plugins/Rot13/Makefile Diff Switch to side-by-side view
Loading...
plugins/Rot13/installit.bat Diff Switch to side-by-side view
Loading...
plugins/Rot13/makeit.bat Diff Switch to side-by-side view
Loading...
plugins/Rot13/rot13.props Diff Switch to side-by-side view
Loading...
bin/jedit Diff Switch to side-by-side view
Loading...
bin/jedit.bat Diff Switch to side-by-side view
Loading...
bin/jopen Diff Switch to side-by-side view
Loading...
bin/jopen.bat Diff Switch to side-by-side view
Loading...
doc/Makefile Diff Switch to side-by-side view
Loading...
doc/index.txt Diff Switch to side-by-side view
Loading...
doc/installing.txt Diff Switch to side-by-side view
Loading...
doc/menus.txt Diff Switch to side-by-side view
Loading...
doc/plugins.txt Diff Switch to side-by-side view
Loading...
doc/props.txt Diff Switch to side-by-side view
Loading...
doc/starting.txt Diff Switch to side-by-side view
Loading...
plugins/Send/SendDialog.java Diff Switch to side-by-side view
Loading...
plugins/Makefile Diff Switch to side-by-side view
Loading...
plugins/installit.bat Diff Switch to side-by-side view
Loading...
plugins/makeit.bat Diff Switch to side-by-side view
Loading...
src/View.java Diff Switch to side-by-side view
Loading...
src/jEdit.java Diff Switch to side-by-side view
Loading...
doc/editing.txt to plugins/Rot13/Cmd_rot13.java
--- a/doc/editing.txt
+++ b/plugins/Rot13/Cmd_rot13.java
@@ -1,48 +1,59 @@
-ADVANCED TEXT EDITING WITH JEDIT (editing.txt, last modified 4 Oct 1998)
+/*
+ * Cmd_rot13.java - Simple plugin
+ * Copyright (C) 1998 Slava Pestov
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
 
-Contents
---------
-1. Markers
-2. Auto Indent
-3. Go To Line
-4. Search And Replace
-5. Open Selection
-6. Editing URLs
+import com.sun.java.swing.JTextArea;
+import java.util.Hashtable;
 
-1. Markers
-----------
-Most other editors can set `markers' in the text, and go to those markers.
-jEdit's markers, however are persistent across editing sessions and can have
-names of any length. Markers are set with the `Edit->Set Marker' command,
-cleared with `Edit->Clear Marker' and jumped to with `Edit->Go To Marker'.
+public class Cmd_rot13 implements Command
+{
+	public Object init(Hashtable args)
+	{
+		return null;
+	}
 
-2. Auto Indent
---------------
-This one's useful if you're using jEdit to edit program source code. When
-you press return, any white space or comment characters from the start of
-the previous line is copied to the start of the new one. Try it out, it's
-very useful.
+	public Object exec(Hashtable args)
+	{
+		View view = (View)args.get(VIEW);
+		if(view != null)
+		{
+			JTextArea textArea = view.getTextArea();
+			String selection = textArea.getSelectedText();
+			if(selection != null)
+				textArea.replaceSelection(rot13(selection));
+			else
+				view.getToolkit().beep();
+		}
+		return null;
+	}
 
-3. Go To Line
--------------
-The `Edit->Go To Line' command moves the caret to the start of the specified
-line. Useful for editing source code, for example.
-
-4. Search And Replace
----------------------
-Not finished yet.
-
-5. Open Selection
------------------
-The `File->Open Selection' command uses the current selection as the name of
-a file to open. This is useful in help files, for example.
-
-6. Editing URLs
----------------
-While everyone else is talking about full Internet integration, jEdit is
-doing it! The `File->Open URL' and `File->Save To URL' commands enable jEdit
-to edit files on the Internet. The protocols supported depend on your Java
-Virtual Machine. Sun's one supports http and ftp.
-
--- Slava Pestov
-<slava_pestov@geocities.com>
+	private String rot13(String str)
+	{
+		char[] chars = str.toCharArray();
+		for(int i = 0; i < chars.length; i++)
+		{
+			char c = chars[i];
+			if(c >= 'a' && c <= 'z')
+				c = (char)('a' + ((c - 'a') + 13) % 26);
+			else if(c >= 'A' && c <= 'Z')
+				c = (char)('A' + ((c - 'A') + 13) % 26);
+			chars[i] = c;
+		}
+		return new String(chars);
+	}
+}
1 2 > >> (Page 1 of 2)