[Japi-cvs] SF.net SVN: japi: [474] tools/prefsbrowser/trunk
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2007-06-30 12:04:19
|
Revision: 474 http://svn.sourceforge.net/japi/?rev=474&view=rev Author: christianhujer Date: 2007-06-30 05:04:18 -0700 (Sat, 30 Jun 2007) Log Message: ----------- Changed package documentation to be package-info.java instead of package.html. Added missing @Nullable / @NotNull annotations. Added missing Javadoc comments. Added missing module dependencies. Modified Paths: -------------- tools/prefsbrowser/trunk/prefsbrowser.iml tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java Added Paths: ----------- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package-info.java Removed Paths: ------------- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package.html Modified: tools/prefsbrowser/trunk/prefsbrowser.iml =================================================================== --- tools/prefsbrowser/trunk/prefsbrowser.iml 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/prefsbrowser.iml 2007-06-30 12:04:18 UTC (rev 474) @@ -26,6 +26,8 @@ <SOURCES /> </library> </orderEntry> + <orderEntry type="module" module-name="libs-swing-action" /> + <orderEntry type="module" module-name="libs-swing-treetable" /> <orderEntryProperties /> </component> <component name="copyright"> Modified: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java 2007-06-30 12:04:18 UTC (rev 474) @@ -24,6 +24,7 @@ import java.util.prefs.BackingStoreException; import java.util.List; import java.util.ArrayList; +import org.jetbrains.annotations.NotNull; /** Node describing a branch in preferences. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -31,19 +32,19 @@ public class PrefsBranchNode implements PrefsTreeNode { /** The preferences of this branch node. */ - private final Preferences prefs; + @NotNull private final Preferences prefs; /** The Children. */ - private List<PrefsTreeNode> children = new ArrayList<PrefsTreeNode>(); + @NotNull private List<PrefsTreeNode> children = new ArrayList<PrefsTreeNode>(); /** Name. */ - private String name; + @NotNull private String name; /** Create a PrefsLeafNode. * @param prefs Preferences to create leaf branch for * @param name Name */ - public PrefsBranchNode(final Preferences prefs, final String name) { + public PrefsBranchNode(@NotNull final Preferences prefs, @NotNull final String name) { this.prefs = prefs; this.name = name; initChildren(); @@ -52,11 +53,12 @@ /** Create a PrefsLeafNode. * @param prefs Preferences to create leaf branch for */ - public PrefsBranchNode(final Preferences prefs) { + public PrefsBranchNode(@NotNull final Preferences prefs) { this.prefs = prefs; initChildren(); } + /** Initializes the children of this PrefsBranchNode. */ private void initChildren() { children.clear(); try { @@ -76,7 +78,7 @@ } /** {@inheritDoc} */ - public Object getValueAt(final int column) { + @NotNull public Object getValueAt(final int column) { switch (column) { case 0: return prefs.name(); case 1: return ""; @@ -85,7 +87,7 @@ } /** {@inheritDoc} */ - public PrefsTreeNode getChild(final int index) { + @NotNull public PrefsTreeNode getChild(final int index) { return children.get(index); } @@ -95,7 +97,7 @@ } /** {@inheritDoc} */ - @Override public String toString() { + @Override @NotNull public String toString() { return name != null ? name : prefs.name(); } Modified: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java 2007-06-30 12:04:18 UTC (rev 474) @@ -26,6 +26,7 @@ import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.treetable.JTreeTable; +import org.jetbrains.annotations.NotNull; /** Main class of PrefsBrowser. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -35,12 +36,12 @@ public class PrefsBrowser { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.tools.prefsbrowser"); + @NotNull 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) { + public static void main(@NotNull final String... args) { // XXX this class isn't really a Utility class, it just looks like one. //noinspection ResultOfObjectAllocationIgnored,InstantiationOfUtilityClass new PrefsBrowser(); Modified: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsLeafNode.java 2007-06-30 12:04:18 UTC (rev 474) @@ -20,6 +20,7 @@ package net.sf.japi.tools.prefsbrowser; import java.util.prefs.Preferences; +import org.jetbrains.annotations.NotNull; /** Node describing a leaf in preferences (key / value pair). * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -27,22 +28,22 @@ public class PrefsLeafNode implements PrefsTreeNode { /** The preferences of this leaf node. */ - private final Preferences prefs; + @NotNull private final Preferences prefs; /** The key of this leaf node. */ - private final String key; + @NotNull private final String key; /** Create a PrefsLeafNode. * @param prefs Preferences to create leaf node for * @param key Key to create leaf node for */ - public PrefsLeafNode(final Preferences prefs, final String key) { + public PrefsLeafNode(@NotNull final Preferences prefs, @NotNull final String key) { this.prefs = prefs; this.key = key; } /** {@inheritDoc} */ - public Object getValueAt(final int column) { + @NotNull public Object getValueAt(final int column) { switch (column) { case 0: return key; case 1: return prefs.get(key, ""); @@ -51,7 +52,7 @@ } /** {@inheritDoc} */ - public PrefsTreeNode getChild(final int index) { + @NotNull public PrefsTreeNode getChild(final int index) { throw new IllegalStateException(); } @@ -61,7 +62,7 @@ } /** {@inheritDoc} */ - @Override public String toString() { + @Override @NotNull public String toString() { return key; } Modified: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsRootNode.java 2007-06-30 12:04:18 UTC (rev 474) @@ -21,6 +21,7 @@ package net.sf.japi.tools.prefsbrowser; import java.util.prefs.Preferences; +import org.jetbrains.annotations.NotNull; /** Node describing the root of preferences. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -28,10 +29,10 @@ public class PrefsRootNode implements PrefsTreeNode { /** Branch node for system root of preferences. */ - private PrefsBranchNode systemRoot; + @NotNull private PrefsBranchNode systemRoot; /** Branch node for user root of preferences. */ - private PrefsBranchNode userRoot; + @NotNull private PrefsBranchNode userRoot; /** Create a root node for preferences. */ public PrefsRootNode() { @@ -40,12 +41,12 @@ } /** {@inheritDoc} */ - public Object getValueAt(final int column) { + @NotNull public Object getValueAt(final int column) { return ""; } /** {@inheritDoc} */ - public PrefsTreeNode getChild(final int index) { + @NotNull public PrefsTreeNode getChild(final int index) { switch (index) { case 0: return systemRoot; case 1: return userRoot; @@ -59,7 +60,7 @@ } /** {@inheritDoc} */ - @Override public String toString() { + @Override @NotNull public String toString() { return ""; } Modified: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeNode.java 2007-06-30 12:04:18 UTC (rev 474) @@ -20,6 +20,8 @@ package net.sf.japi.tools.prefsbrowser; +import org.jetbrains.annotations.NotNull; + /** Superclass of PrefsTreeNode. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @@ -29,13 +31,13 @@ * @param column Column to get value for * @return value for column */ - Object getValueAt(int column); + @NotNull Object getValueAt(int column); /** 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); + @NotNull PrefsTreeNode getChild(int index); /** Get the number of children. * @return number of children Modified: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java 2007-06-30 12:04:18 UTC (rev 474) @@ -23,6 +23,7 @@ import net.sf.japi.swing.treetable.AbstractTreeTableModel; import net.sf.japi.swing.treetable.TreeTableModel; import net.sf.japi.swing.ActionFactory; +import org.jetbrains.annotations.NotNull; /** TreeTableModel for displaying preferences. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -30,7 +31,7 @@ public class PrefsTreeTableModel extends AbstractTreeTableModel<PrefsRootNode, PrefsTreeNode> { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.tools.prefsbrowser"); + @NotNull private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.tools.prefsbrowser"); /** Create an AbstractTreeTableModel. */ @@ -39,17 +40,17 @@ } /** {@inheritDoc} */ - public PrefsTreeNode getChild(final PrefsTreeNode parent, final int index) { + @NotNull public PrefsTreeNode getChild(@NotNull final PrefsTreeNode parent, final int index) { return parent.getChild(index); } /** {@inheritDoc} */ - public int getChildCount(final PrefsTreeNode node) { + public int getChildCount(@NotNull final PrefsTreeNode node) { return node.getChildCount(); } /** {@inheritDoc} */ - @Override public Class<?> getColumnClass(final int column) { + @NotNull @Override public Class<?> getColumnClass(final int column) { return column == 0 ? TreeTableModel.class : String.class; } @@ -68,12 +69,12 @@ } /** {@inheritDoc} */ - public Object getValueAt(final PrefsTreeNode node, final int column) { + @NotNull public Object getValueAt(@NotNull final PrefsTreeNode node, final int column) { return node.getValueAt(column); } /** {@inheritDoc} */ - @Override public boolean isLeaf(final PrefsTreeNode node) { + @Override public boolean isLeaf(@NotNull final PrefsTreeNode node) { return node instanceof PrefsLeafNode; } Added: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package-info.java =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package-info.java (rev 0) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package-info.java 2007-06-30 12:04:18 UTC (rev 474) @@ -0,0 +1,28 @@ +/* + * PrefsBrowser is a tool for browsing preferences in a GUI. + * Copyright (C) 2007 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * This package contains a preferences browser that allows browsing Java preferences. + * @see java.util.prefs + * @todo Add a menu. + * @todo Add a toolbar. + * @todo Allow editing of preferences. + * @todo Implement hot update of preferences (listen to changes). + */ +package net.sf.japi.tools.prefsbrowser; Property changes on: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package-info.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Deleted: tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package.html =================================================================== --- tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package.html 2007-06-30 11:52:00 UTC (rev 473) +++ tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/package.html 2007-06-30 12:04:18 UTC (rev 474) @@ -1,33 +0,0 @@ -<?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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |