Thread: [Japi-cvs] SF.net SVN: japi: [77] trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2006-04-16 12:47:08
|
Revision: 77 Author: christianhujer Date: 2006-04-16 05:46:46 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=77&view=rev Log Message: ----------- Added missing package documentation. Added missing javadoc documentation. Converted PrefsTreeNode to an interface. Minor cosmetic code improvements. I18N/L10N of column titles. Modified Paths: -------------- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action.properties Added Paths: ----------- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action_de.properties trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/package.html Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java 2006-04-16 12:46:46 UTC (rev 77) @@ -18,7 +18,6 @@ * 02111-1307, USA. */ - package net.sf.japi.tools.prefsbrowser; import java.util.prefs.Preferences; @@ -26,11 +25,10 @@ import java.util.List; import java.util.ArrayList; -/** - * TODO +/** Node describing a branch in preferences. * @author <a href="mailto:ch...@it...">Christian Hujer</a> */ -public class PrefsBranchNode extends PrefsTreeNode { +public class PrefsBranchNode implements PrefsTreeNode { /** The preferences of this branch node. */ private final Preferences prefs; @@ -78,7 +76,7 @@ } /** {@inheritDoc} */ - @Override public Object getValueAt(final int column) { + public Object getValueAt(final int column) { switch (column) { case 0: return prefs.name(); case 1: return ""; @@ -87,12 +85,12 @@ } /** {@inheritDoc} */ - @Override public PrefsTreeNode getChild(final int index) { + public PrefsTreeNode getChild(final int index) { return children.get(index); } /** {@inheritDoc} */ - @Override public int getChildCount() { + public int getChildCount() { return children.size(); } Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java 2006-04-16 12:46:46 UTC (rev 77) @@ -1,3 +1,24 @@ +/* + * JAPI - (Yet another (hopefully) useful) Java API + * + * Copyright (C) 2006 Christian Hujer + * + * 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. + */ + package net.sf.japi.tools.prefsbrowser; import javax.swing.JFrame; @@ -6,14 +27,22 @@ import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.treetable.JTreeTable; +/** Main class of PrefsBrowser. + * @author <a href="mailto:ch...@it...">Christian Hujer</a> + */ +// XXX this class isn't really a Utility class, it just looks like one. +@SuppressWarnings({"UtilityClassWithoutPrivateConstructor", "UtilityClassWithPublicConstructor", "UtilityClass"}) public class PrefsBrowser { + /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.tools.prefsbrowser"); /** Main program. * @param args command line arguments */ public static void main(final String... args) { + // XXX this class isn't really a Utility class, it just looks like one. + //noinspection ResultOfObjectAllocationIgnored,InstantiationOfUtilityClass new PrefsBrowser(); } Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java 2006-04-16 12:46:46 UTC (rev 77) @@ -18,16 +18,14 @@ * 02111-1307, USA. */ - package net.sf.japi.tools.prefsbrowser; import java.util.prefs.Preferences; -/** - * TODO +/** Node describing a leaf in preferences (key / value pair). * @author <a href="mailto:ch...@it...">Christian Hujer</a> */ -public class PrefsLeafNode extends PrefsTreeNode { +public class PrefsLeafNode implements PrefsTreeNode { /** The preferences of this leaf node. */ private final Preferences prefs; @@ -45,7 +43,7 @@ } /** {@inheritDoc} */ - @Override public Object getValueAt(final int column) { + public Object getValueAt(final int column) { switch (column) { case 0: return key; case 1: return prefs.get(key, ""); @@ -54,12 +52,12 @@ } /** {@inheritDoc} */ - @Override public PrefsTreeNode getChild(final int index) { + public PrefsTreeNode getChild(final int index) { throw new IllegalStateException(); } /** {@inheritDoc} */ - @Override public int getChildCount() { + public int getChildCount() { return 0; } Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java 2006-04-16 12:46:46 UTC (rev 77) @@ -22,14 +22,15 @@ import java.util.prefs.Preferences; -/** - * TODO +/** Node describing the root of preferences. * @author <a href="mailto:ch...@it...">Christian Hujer</a> */ -public class PrefsRootNode extends PrefsTreeNode { +public class PrefsRootNode implements PrefsTreeNode { + /** Branch node for system root of preferences. */ private PrefsBranchNode systemRoot; + /** Branch node for user root of preferences. */ private PrefsBranchNode userRoot; /** Create a root node for preferences. */ @@ -39,12 +40,12 @@ } /** {@inheritDoc} */ - @Override public Object getValueAt(final int column) { + public Object getValueAt(final int column) { return ""; } /** {@inheritDoc} */ - @Override public PrefsTreeNode getChild(final int index) { + public PrefsTreeNode getChild(final int index) { switch (index) { case 0: return systemRoot; case 1: return userRoot; @@ -53,7 +54,7 @@ } /** {@inheritDoc} */ - @Override public int getChildCount() { + public int getChildCount() { return 2; } Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java 2006-04-16 12:46:46 UTC (rev 77) @@ -18,19 +18,28 @@ * 02111-1307, USA. */ - package net.sf.japi.tools.prefsbrowser; -/** - * TODO +/** Superclass of PrefsTreeNode. * @author <a href="mailto:ch...@it...">Christian Hujer</a> */ -public abstract class PrefsTreeNode { +public interface PrefsTreeNode { - public abstract Object getValueAt(int column); + /** Get the value at a specific column. + * @param column Column to get value for + * @return value for column + */ + Object getValueAt(int column); - public abstract PrefsTreeNode getChild(int index); + /** Get a child with a specific index. + * @param index Index of child to get (<code>0 <= <var>index</var> < {@link #getChildCount()}</code>) + * @return child node + */ + PrefsTreeNode getChild(int index); - public abstract int getChildCount(); + /** Get the number of children. + * @return number of children + */ + int getChildCount(); } // class PrefsTreeNode Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java 2006-04-16 12:46:46 UTC (rev 77) @@ -18,18 +18,20 @@ * 02111-1307, USA. */ - package net.sf.japi.tools.prefsbrowser; import net.sf.japi.swing.treetable.AbstractTreeTableModel; import net.sf.japi.swing.treetable.TreeTableModel; +import net.sf.japi.swing.ActionFactory; -/** - * TODO +/** TreeTableModel for displaying preferences. * @author <a href="mailto:ch...@it...">Christian Hujer</a> */ public class PrefsTreeTableModel extends AbstractTreeTableModel<PrefsRootNode, PrefsTreeNode> { + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.tools.prefsbrowser"); + /** Create an AbstractTreeTableModel. */ protected PrefsTreeTableModel() { @@ -59,8 +61,8 @@ /** {@inheritDoc} */ public String getColumnName(final int column) { switch (column) { - case 0: return "key"; - case 1: return "value"; + case 0: return ACTION_FACTORY.getString("key.title"); + case 1: return ACTION_FACTORY.getString("value.title"); default: assert false; throw new IndexOutOfBoundsException("column must be >= 0 and <= " + getColumnCount() + " but was: " + column); } } Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action.properties =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action.properties 2006-04-16 03:02:17 UTC (rev 76) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action.properties 2006-04-16 12:46:46 UTC (rev 77) @@ -18,4 +18,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # + frame.title=Preferences Browser +key.title=Key +value.title=Value Added: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action_de.properties =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action_de.properties (rev 0) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action_de.properties 2006-04-16 12:46:46 UTC (rev 77) @@ -0,0 +1,24 @@ +# +# JAPI - (Yet another (hopefully) useful) Java API +# +# Copyright (C) 2006 Christian Hujer +# +# 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. +# + +frame.title=Preferences Browser +key.title=Schl\xFCssel +value.title=Wert Property changes on: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/action_de.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/package.html =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/package.html (rev 0) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/package.html 2006-04-16 12:46:46 UTC (rev 77) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- JAPI - (Yet another (hopefully) useful) Java API + - + - Copyright (C) 2006 Christian Hujer + - + - 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. + --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> + <title>net.sf.japi.tools.prefsbrowser</title> + </head> + <body> + <p> + Contains a full featured preferences browser. + </p> + </body> +</html> Property changes on: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/package.html ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-04-16 21:33:06
|
Revision: 85 Author: christianhujer Date: 2006-04-16 14:32:55 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/japi/?rev=85&view=rev Log Message: ----------- Updated my email address. Modified Paths: -------------- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java 2006-04-16 21:28:58 UTC (rev 84) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java 2006-04-16 21:32:55 UTC (rev 85) @@ -26,7 +26,7 @@ import java.util.ArrayList; /** Node describing a branch in preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class PrefsBranchNode implements PrefsTreeNode { Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java 2006-04-16 21:28:58 UTC (rev 84) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java 2006-04-16 21:32:55 UTC (rev 85) @@ -28,7 +28,7 @@ import net.sf.japi.swing.treetable.JTreeTable; /** Main class of PrefsBrowser. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ // XXX this class isn't really a Utility class, it just looks like one. @SuppressWarnings({"UtilityClassWithoutPrivateConstructor", "UtilityClassWithPublicConstructor", "UtilityClass"}) Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java 2006-04-16 21:28:58 UTC (rev 84) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java 2006-04-16 21:32:55 UTC (rev 85) @@ -23,7 +23,7 @@ import java.util.prefs.Preferences; /** Node describing a leaf in preferences (key / value pair). - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class PrefsLeafNode implements PrefsTreeNode { Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java 2006-04-16 21:28:58 UTC (rev 84) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java 2006-04-16 21:32:55 UTC (rev 85) @@ -23,7 +23,7 @@ import java.util.prefs.Preferences; /** Node describing the root of preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class PrefsRootNode implements PrefsTreeNode { Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java 2006-04-16 21:28:58 UTC (rev 84) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java 2006-04-16 21:32:55 UTC (rev 85) @@ -21,7 +21,7 @@ package net.sf.japi.tools.prefsbrowser; /** Superclass of PrefsTreeNode. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public interface PrefsTreeNode { Modified: trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java =================================================================== --- trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java 2006-04-16 21:28:58 UTC (rev 84) +++ trunk/tools/prefs/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java 2006-04-16 21:32:55 UTC (rev 85) @@ -25,7 +25,7 @@ import net.sf.japi.swing.ActionFactory; /** TreeTableModel for displaying preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class PrefsTreeTableModel extends AbstractTreeTableModel<PrefsRootNode, PrefsTreeNode> { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |