[Jsxe-cvs] SF.net SVN: jsxe: [942] trunk/jsxe
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-06-12 20:22:20
|
Revision: 942 Author: ian_lewis Date: 2006-06-12 13:22:09 -0700 (Mon, 12 Jun 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=942&view=rev Log Message: ----------- moved the global options pane to it's own file Modified Paths: -------------- trunk/jsxe/build.xml trunk/jsxe/messages/messages.en trunk/jsxe/src/net/sourceforge/jsxe/gui/GlobalOptionsDialog.java trunk/jsxe/src/net/sourceforge/jsxe/jsXe.java Added Paths: ----------- trunk/jsxe/src/net/sourceforge/jsxe/options/GeneralOptionPane.java Modified: trunk/jsxe/build.xml =================================================================== --- trunk/jsxe/build.xml 2006-06-12 16:09:07 UTC (rev 941) +++ trunk/jsxe/build.xml 2006-06-12 20:22:09 UTC (rev 942) @@ -70,6 +70,13 @@ </fileset> </path> + <path id="run-classpath"> + <pathelement location="${root.dir}/${app.name}.jar"/> + <fileset dir="${lib.dir}"> + <include name="**/*.jar"/> + </fileset> + </path> + <!-- set whether we have the source for the default views --> <available file="${plugin.dir}/treeview/build.xml" property="treeview.avail"/> <available file="${plugin.dir}/sourceview/build.xml" property="sourceview.avail"/> @@ -193,7 +200,14 @@ <ant inheritAll="false" dir="${plugin.dir}/sourceview/" target="compile"/> </target> <!-- }}} --> - <!-- {{{ ============ Prepares for a build ============================= --> + <!-- {{{ ============ Run the program ================================== --> + <target depends="compile" name="run" description="run jsXe"> + <java fork="true" classname="${main.class}"> + <classpath refid="classpath"/> + </java> + </target> + <!-- }}} --> + <!-- {{{ ============ Prepares for a build ============================= --> <target depends="init" name="prepare-build"> <!-- lib --> <mkdir dir="${build.dir}/lib"/> Modified: trunk/jsxe/messages/messages.en =================================================================== --- trunk/jsxe/messages/messages.en 2006-06-12 16:09:07 UTC (rev 941) +++ trunk/jsxe/messages/messages.en 2006-06-12 20:22:09 UTC (rev 942) @@ -59,7 +59,7 @@ #{{{ Global Options Global.Options.Dialog.Title=Global Options -Global.Options.Title=jsXe Global Options +Global.Options.Title=General Global.Options.Max.Recent.Files=Recent files to remember: Global.Options.Max.Recent.Files.ToolTip=The maximum number of files that jsXe remembers in the recent files menu. Global.Options.network-off=Always cache without asking Modified: trunk/jsxe/src/net/sourceforge/jsxe/gui/GlobalOptionsDialog.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/gui/GlobalOptionsDialog.java 2006-06-12 16:09:07 UTC (rev 941) +++ trunk/jsxe/src/net/sourceforge/jsxe/gui/GlobalOptionsDialog.java 2006-06-12 20:22:09 UTC (rev 942) @@ -63,7 +63,7 @@ DocumentBuffer buffer = view.getDocumentView().getDocumentBuffer(); - OptionPane pane = jsXe.getOptionPane(); + OptionPane pane = new GeneralOptionPane(); if (pane != null) { addOptionPane(pane); } Modified: trunk/jsxe/src/net/sourceforge/jsxe/jsXe.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/jsXe.java 2006-06-12 16:09:07 UTC (rev 941) +++ trunk/jsxe/src/net/sourceforge/jsxe/jsXe.java 2006-06-12 20:22:09 UTC (rev 942) @@ -1176,18 +1176,6 @@ return m_actionSets; }//}}} - //{{{ getOptionsPanel() - /** - * Gets the option pane for the jsXe application. - * @return The OptionPane with the options for jsXe. - */ - public static final OptionPane getOptionPane() { - if (jsXeOptions == null) { - jsXeOptions = new jsXeOptionPane(); - } - return jsXeOptions; - }//}}} - //{{{ getPluginLoader() /** * Gets the plugin loader that is used to load @@ -1342,85 +1330,6 @@ }//}}} - //{{{ jsXeOptionPane class - - private static class jsXeOptionPane extends AbstractOptionPane { - - //{{{ jsXeOptionPane constructor - public jsXeOptionPane() { - super("jsxeoptions"); - }//}}} - - //{{{ getTitle() - public String getTitle() { - return Messages.getMessage("Global.Options.Title"); - }//}}} - - //{{{ _init() - protected void _init() { - - //{{{ max recent files - - int maxRecentFiles = jsXe.getIntegerProperty("max.recent.files", 20); - - Vector sizes = new Vector(4); - sizes.add("10"); - sizes.add("20"); - sizes.add("30"); - sizes.add("40"); - maxRecentFilesComboBox = new JComboBox(sizes); - maxRecentFilesComboBox.setEditable(true); - maxRecentFilesComboBox.setSelectedItem(Integer.toString(maxRecentFiles)); - - addComponent(Messages.getMessage("Global.Options.Max.Recent.Files"), - maxRecentFilesComboBox, - Messages.getMessage("Global.Options.Max.Recent.Files.ToolTip")); - - //}}} - - //{{{ network - - String[] networkValues = { - Messages.getMessage("Global.Options.network-always"), - Messages.getMessage("Global.Options.network-cache"), - Messages.getMessage("Global.Options.network-off") - - }; - - network = new JComboBox(networkValues); - network.setSelectedIndex(jsXe.getIntegerProperty("xml.cache", 1)); - - addComponent(Messages.getMessage("Global.Options.network"), - network); - - //}}} - - }//}}} - - //{{{ _save() - protected void _save() { - try { - //don't need to set dirty, no change to text - jsXe.setProperty("max.recent.files", (new Integer(maxRecentFilesComboBox.getSelectedItem().toString())).toString()); - } catch (NumberFormatException nfe) { - //Bad input, don't save. - } - jsXe.setIntegerProperty("xml.cache",network.getSelectedIndex()); - CatalogManager.propertiesChanged(); - }//}}} - - //{{{ toString() - public String toString() { - return getTitle(); - }//}}} - - //{{{ Private Members - private JComboBox maxRecentFilesComboBox; - private JComboBox network; - //}}} - - }//}}} - //{{{ printUsage() private static void printUsage() { Added: trunk/jsxe/src/net/sourceforge/jsxe/options/GeneralOptionPane.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/options/GeneralOptionPane.java (rev 0) +++ trunk/jsxe/src/net/sourceforge/jsxe/options/GeneralOptionPane.java 2006-06-12 20:22:09 UTC (rev 942) @@ -0,0 +1,118 @@ +/* +GeneralOptionPane.java +:tabSize=4:indentSize=4:noTabs=true: +:folding=explicit:collapseFolds=1: + +Copyright (C) 2006 Ian Lewis (Ian...@me...) + +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 (at your option) 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. +Optionally, you may find a copy of the GNU General Public License +from http://www.fsf.org/copyleft/gpl.txt +*/ + +package net.sourceforge.jsxe.options; + +//{{{ imports +import net.sourceforge.jsxe.jsXe; +import net.sourceforge.jsxe.CatalogManager; +import net.sourceforge.jsxe.gui.Messages; +import javax.swing.JComboBox; +import java.util.Vector; +//}}} + +/** + * The OptionPane containing jsXe's general options in the Global Options + * Dialog. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @see net.sourceforge.jsxe.gui.GlobalOptionsDialog + */ +public class GeneralOptionPane extends AbstractOptionPane { + + //{{{ GeneralOptionPane constructor + public GeneralOptionPane() { + super("jsxeoptions"); + }//}}} + + //{{{ getTitle() + public String getTitle() { + return Messages.getMessage("Global.Options.Title"); + }//}}} + + //{{{ _init() + protected void _init() { + + //{{{ max recent files + + int maxRecentFiles = jsXe.getIntegerProperty("max.recent.files", 20); + + Vector sizes = new Vector(4); + sizes.add("10"); + sizes.add("20"); + sizes.add("30"); + sizes.add("40"); + maxRecentFilesComboBox = new JComboBox(sizes); + maxRecentFilesComboBox.setEditable(true); + maxRecentFilesComboBox.setSelectedItem(Integer.toString(maxRecentFiles)); + + addComponent(Messages.getMessage("Global.Options.Max.Recent.Files"), + maxRecentFilesComboBox, + Messages.getMessage("Global.Options.Max.Recent.Files.ToolTip")); + + //}}} + + //{{{ network + + String[] networkValues = { + Messages.getMessage("Global.Options.network-always"), + Messages.getMessage("Global.Options.network-cache"), + Messages.getMessage("Global.Options.network-off") + + }; + + network = new JComboBox(networkValues); + network.setSelectedIndex(jsXe.getIntegerProperty("xml.cache", 1)); + + addComponent(Messages.getMessage("Global.Options.network"), + network); + + //}}} + + }//}}} + + //{{{ _save() + protected void _save() { + try { + //don't need to set dirty, no change to text + jsXe.setProperty("max.recent.files", (new Integer(maxRecentFilesComboBox.getSelectedItem().toString())).toString()); + } catch (NumberFormatException nfe) { + //Bad input, don't save. + } + jsXe.setIntegerProperty("xml.cache",network.getSelectedIndex()); + CatalogManager.propertiesChanged(); + }//}}} + + //{{{ toString() + public String toString() { + return getTitle(); + }//}}} + + //{{{ Private Members + private JComboBox maxRecentFilesComboBox; + private JComboBox network; + //}}} + +} Property changes on: trunk/jsxe/src/net/sourceforge/jsxe/options/GeneralOptionPane.java ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |