Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [c35e8c] jedit-0-4 Maximize Restore History

import of jEdit-0.4

Slava Pestov Slava Pestov 1998-10-01

1 2 > >> (Page 1 of 2)
added doc/plugins.txt
added plugins/Reverse
added plugins/Reverse/Cmd_Reverse.java
added plugins/Reverse/Makefile
added plugins/Reverse/Reverse.props
added plugins/ToLower
added plugins/ToLower/Cmd_ToLower.java
added plugins/ToLower/Makefile
added plugins/ToLower/ToLower.props
added plugins/ToUpper
added plugins/ToUpper/Cmd_ToUpper.java
added plugins/ToUpper/Makefile
added plugins/ToUpper/ToUpper.props
added plugins/WordCount
added plugins/WordCount/Cmd_WordCount.java
added plugins/WordCount/Makefile
added plugins/WordCount/WordCount.props
changed Makefile
changed Rules.make
changed VERSION
changed bin
changed bin/Makefile
changed doc
changed doc/Makefile
changed doc/index.txt
changed doc/menus.txt
changed doc/old
changed doc/props.txt
changed doc/starting.txt
changed installit.bat
changed plugins
changed plugins/HelloWorld
changed plugins/HelloWorld/Cmd_HelloWorld.java
changed plugins/HelloWorld/HelloWorld.props
changed plugins/Makefile
changed src
changed src/Buffer.java
changed src/BufferMgr.java
changed src/Cmd_set_marker.java
changed src/CommandMgr.java
changed src/Makefile
changed src/View.java
changed src/jEdit.java
changed src/properties
copied doc/old/menus.txt -> src/Options.java
copied doc/old/plugins.txt -> src/Cmd_options.java
doc/plugins.txt Diff Switch to side-by-side view
Loading...
plugins/Reverse
Directory.
plugins/Reverse/Cmd_Reverse.java Diff Switch to side-by-side view
Loading...
plugins/Reverse/Makefile Diff Switch to side-by-side view
Loading...
plugins/Reverse/Reverse.props Diff Switch to side-by-side view
Loading...
plugins/ToLower
Directory.
plugins/ToLower/Cmd_ToLower.java Diff Switch to side-by-side view
Loading...
plugins/ToLower/Makefile Diff Switch to side-by-side view
Loading...
plugins/ToLower/ToLower.props Diff Switch to side-by-side view
Loading...
plugins/ToUpper
Directory.
plugins/ToUpper/Cmd_ToUpper.java Diff Switch to side-by-side view
Loading...
plugins/ToUpper/Makefile Diff Switch to side-by-side view
Loading...
plugins/ToUpper/ToUpper.props Diff Switch to side-by-side view
Loading...
plugins/WordCount
Directory.
plugins/WordCount/Cmd_WordCount.java Diff Switch to side-by-side view
Loading...
plugins/WordCount/Makefile Diff Switch to side-by-side view
Loading...
plugins/WordCount/WordCount.props Diff Switch to side-by-side view
Loading...
Makefile Diff Switch to side-by-side view
Loading...
Rules.make Diff Switch to side-by-side view
Loading...
VERSION Diff Switch to side-by-side view
Loading...
bin
Directory.
bin/Makefile Diff Switch to side-by-side view
Loading...
doc
Directory.
doc/Makefile Diff Switch to side-by-side view
Loading...
doc/index.txt Diff Switch to side-by-side view
Loading...
doc/menus.txt Diff Switch to side-by-side view
Loading...
doc/old
Directory.
doc/props.txt Diff Switch to side-by-side view
Loading...
doc/starting.txt Diff Switch to side-by-side view
Loading...
installit.bat Diff Switch to side-by-side view
Loading...
plugins
Directory.
plugins/HelloWorld
Directory.
plugins/HelloWorld/Cmd_HelloWorld.java Diff Switch to side-by-side view
Loading...
plugins/HelloWorld/HelloWorld.props Diff Switch to side-by-side view
Loading...
plugins/Makefile Diff Switch to side-by-side view
Loading...
src
Directory.
src/Buffer.java Diff Switch to side-by-side view
Loading...
src/BufferMgr.java Diff Switch to side-by-side view
Loading...
src/Cmd_set_marker.java Diff Switch to side-by-side view
Loading...
src/CommandMgr.java Diff Switch to side-by-side view
Loading...
src/Makefile 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...
src/properties Diff Switch to side-by-side view
Loading...
doc/old/menus.txt to src/Options.java
--- a/doc/old/menus.txt
+++ b/src/Options.java
@@ -1,107 +1,120 @@
-JEDIT MENU CONFIGURATION
+/*
+ * Options.java - Options dialog
+ * 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.
+ */
 
-1. Introduction
----------------
-jEdit stores it's menus in property files (see props.txt). This has a number of
-advantages to compiling them into the program:
-- They're easier to modify.
-- One can make JARs that add support for other languages.
-- One can make JARs that add support for other key bindings, eg Emacs.
+import com.sun.java.swing.ButtonGroup;
+import com.sun.java.swing.JCheckBox;
+import com.sun.java.swing.JDialog;
+import com.sun.java.swing.JLabel;
+import com.sun.java.swing.JPanel;
+import com.sun.java.swing.JRadioButton;
+import com.sun.java.swing.JTextField;
+import com.sun.java.swing.border.TitledBorder;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
 
-2. Menubar Definition
----------------------
-When a module wants to load a property-based menubar, it calls the
-jEdit.loadMenubar(View view, String name) method. The method does the
-following:
-- It loads the property `name'. This is assumed to be a while space separated
-  list of menu names.
-- It creates an empty menubar.
-- It calls loadMenu() for each of the menus specified and adds them to the
-  menubar.
-- It returns the menubar.
+public class Options extends JDialog
+implements ActionListener
+{	
+	private JRadioButton metal;
+	private JRadioButton motif;
+	private JRadioButton windows;
+	private JCheckBox server;
+	private JTextField maxrecent;
+	
+	public Options(View view)
+	{
+		super(view,jEdit.props.getProperty("options.title"),true);
+		GridBagLayout layout = new GridBagLayout();
+		GridBagConstraints constraints = new GridBagConstraints();
+		constraints.fill = constraints.HORIZONTAL;
+		constraints.gridwidth = constraints.REMAINDER;
+		getContentPane().setLayout(layout);
+		JPanel panel = createLfPanel();
+		layout.setConstraints(panel,constraints);
+		getContentPane().add(panel);
+		panel = createOpeningPanel();
+		layout.setConstraints(panel,constraints);
+		getContentPane().add(panel);
+		Dimension screen = getToolkit().getScreenSize();
+		pack();
+		setLocation((screen.width - getSize().width) / 2,
+			(screen.height - getSize().height) / 2);
+		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+		show();
+	}
 
-3. Menu Definition
-------------------
-The loadMenu(View view, String name) method is usually called by loadMenubar(),
-but it can be called manually to load popup menus, etc. It does the following:
-- It loads the property `name'. This is assumed to be a while space separated
-  list of menu item names.
-- It creates an empty menu whose label is the value of the property
-  `name'.label.
-- It adds a separator to the menu if a menu item is '-', otherwise it calls
-  loadMenuItem(). It then adds the separator/menu/menu item to the menu.
-- It returns the menu.
+	private JPanel createLfPanel()
+	{
+		JPanel panel = new JPanel();
+		panel.setBorder(new TitledBorder(jEdit.props.getProperty(
+			"options.lf")));
+		ButtonGroup grp = new ButtonGroup();
+		metal = new JRadioButton(jEdit.props.getProperty(
+			"options.lf.metal"));
+		grp.add(metal);
+		panel.add(metal);
+		motif = new JRadioButton(jEdit.props.getProperty(
+			"options.lf.motif"));
+		grp.add(motif);
+		panel.add(motif);
+		windows = new JRadioButton(jEdit.props.getProperty(
+			"options.lf.windows"));
+		grp.add(windows);
+		panel.add(windows);
+		return panel;
+	}
 
-4. Menu Item Definition
------------------------
-The loadMenuItem(View view, String name) method is usually called by
-loadMenu(), but it can be called manually for on-the-fly menu creation, etc. If
-`name' starts with '%', it loads the menu whose name is `name', *NOT* including
-the '%'. Otherwise, it creates a menu item whose label is the value of the
-property `name'.label and whose shortcut is the value of the property
-`name'.shortcut. Shortcuts are parsed as follows:
-- An 'A' character adds ALT to the shortcut's modifier mask.
-- An 'C' character adds CONTROL to the shortcut's modifier mask.
-- An 'M' character adds META to the shortcut's modifier mask. This is probably
-  the right alt key.
-- An 'S' character adds SHIFT to the shortcut's modifier mask.
-- The last character that is not an uppercase A, C, M or S is the key.
-
-5. Commands
------------
-When a menu item is selected, the command with the menu item's name (NOT the
-label) is executed. For more information on commands, see commands.txt.
-
-6. Dynamic Menus
-----------------
-jEdit automatically generates some menus that you can insert in your menubar.
-jEdit currently supports the following dynamic menus:
-- `plugins': a list of installed plugins
-- `buffers': a list of opened buffers
-- `open_recent': a list of recently opened files
-- `goto_marker': a list of markers, with each menuitem bound to goto_marker
-- `clear_marker': a list of markers, with each menuitem bound to clear_marker
-  
-Note: A dynamic menu can only be included once in each menubar.
-
-7. Example Menubar Definition
------------------------------
-This is a simple menu bar definition. So if you didn't understand the above
-description, this will help. If you want a more complex one, take a look at the
-jEdit properties file.
-###
-app_mbar=file edit window help
-file=new open close - save save_as - exit
-file.label=File
-new.label=New
-new.shortcut=An ### Alt-N
-open.label=Open
-open.shortcut=Ao
-close.label=Close
-close.shortcut=Aw
-save.label=Save
-save.shortcut=As
-save_as.label=Save As...
-save_as.shortcut=ASs ### Alt-Shift-S
-exit.label=Exit
-exit.shortcut=Aq
-edit=undo redo - cut copy paste clear select_all
-edit.label=Edit
-undo.label=Undo
-undo.shortcut=Cz ### Control-z
-redo.label=Redo
-redo.shortcut=CSz ### Control-Shift-z
-cut.label=Cut
-cut.shortcut=Cx
-copy.label=Copy
-copy.shortcut=Cc
-paste.label=Paste
-paste.shortcut=Cv
-clear.label=Clear
-clear.shortcut=CSx
-select_all.label=Select All
-select_all.shortcut=Ca
-###
-
--- Slava Pestov
-<slava_pestov@geocities.com>
+	private JPanel createOpeningPanel()
+	{
+		JPanel panel = new JPanel();
+		panel.setBorder(new TitledBorder(jEdit.props.getProperty(
+			"options.opening")));
+		GridBagLayout layout = new GridBagLayout();
+		GridBagConstraints constraints = new GridBagConstraints();
+		constraints.gridwidth=2;
+		constraints.gridheight=1;
+		constraints.anchor=constraints.WEST;
+		constraints.fill=constraints.BOTH;
+		panel.setLayout(layout);
+		server = new JCheckBox(jEdit.props.getProperty(
+			"options.opening.server"));
+		layout.setConstraints(server,constraints);
+		panel.add(server);
+		constraints.gridwidth=1;
+		constraints.gridy=2;
+		JLabel label = new JLabel(jEdit.props.getProperty(
+			"options.opening.maxrecent"));
+		layout.setConstraints(label,constraints);
+		panel.add(label);
+		maxrecent = new JTextField(2);
+		layout.setConstraints(maxrecent,constraints);
+		panel.add(maxrecent);
+		return panel;
+	}
+	
+	public void actionPerformed(ActionEvent evt)
+	{
+	}
+}
doc/old/plugins.txt to src/Cmd_options.java
--- a/doc/old/plugins.txt
+++ b/src/Cmd_options.java
@@ -1,23 +1,38 @@
-JEDIT PLUGIN INTERFACE VERSION 1
+/*
+ * Cmd_options.java - Command
+ * 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.
+ */
 
-1. Using Plugins
-----------------
-jEdit is extensible using plugins. A plugin is a JAR file with class and/or
-property files. Plugins are searched for in the plugin path. The default path
-is:
-- The system plugin directory, (/opt/slava/share/jedit/1.00 on Unix,
-  \Program Files\jEdit\share on Windows 95/NT).
-- The user plugin directory (~/.jedit-jars on Unix, some JVM-dependent
-  directory on Windows 95/NT).
-Directories can be added to the plugin path with the -plugindir= parameter.
+import java.io.File;
+import java.util.Hashtable;
 
-2. Developing Plugins
----------------------
-To be useful, the JAR files must contain at least one .class or .props file.
-The .props files are in standard Java property format. See props.txt for more
-info. Each .class file is loaded into the runtime, and if it implements the
-Command interface, a new instance of it is created and added to the command
-list. See commands.txt for details.
+public class Cmd_options implements Command
+{
+	public Object init(Hashtable args)
+	{
+		return null;
+	}
 
--- Slava Pestov
-<slava_pestov@geocities.com>
+	public Object exec(Hashtable args)
+	{
+		View view = (View)args.get(VIEW);
+		String arg = (String)args.get(ARG);
+		if(view != null)
+			new Options(view);
+		return null;
+	}
+}
1 2 > >> (Page 1 of 2)