Minor formatting and documentation.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2114 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-04-06 22:40:51 +00:00
parent d90a13e60b
commit 3fd45cbb63
5 changed files with 51 additions and 24 deletions

View File

@ -58,7 +58,9 @@ class BaseCategoryForm extends BaseForm {
final TextField m_url; final TextField m_url;
final RadioGroup m_isAbstract; final RadioGroup m_isAbstract;
final RadioGroup m_isEnabled; final RadioGroup m_isEnabled;
private Label m_script = new Label("<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>", false); private Label m_script = new Label(
"<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
false);

View File

@ -55,8 +55,14 @@ final class CategoryAddForm extends BaseCategoryForm {
} }
private final class ProcessListener implements FormProcessListener { private final class ProcessListener implements FormProcessListener {
/**
*
* @param e
* @throws FormProcessException
*/
public final void process(final FormSectionEvent e) public final void process(final FormSectionEvent e)
throws FormProcessException { throws FormProcessException {
s_log.debug("Adding a category"); s_log.debug("Adding a category");
final PageState state = e.getPageState(); final PageState state = e.getPageState();
@ -64,8 +70,8 @@ final class CategoryAddForm extends BaseCategoryForm {
final Category parent = m_parent.getCategory(state); final Category parent = m_parent.getCategory(state);
final String name = (String) m_name.getValue(state); final String name = (String) m_name.getValue(state);
final String description = (String) m_description.getValue(state); final String description = (String) m_description.getValue(state);
final String url = (String) m_url.getValue(state); final String url = (String) m_url.getValue(state);
final String isAbstract = (String) m_isAbstract.getValue(state); final String isAbstract = (String) m_isAbstract.getValue(state);
Assert.exists(parent, "Category parent"); Assert.exists(parent, "Category parent");
@ -76,14 +82,14 @@ final class CategoryAddForm extends BaseCategoryForm {
if (parent.canEdit()) { if (parent.canEdit()) {
final Category category = new Category(name, description, url); final Category category = new Category(name, description, url);
// this seems anti-intuitive but the question is "can you place // this seems anti-intuitive but the question is "can you place
// items in this category. If the user says "yes" then the // items in this category. If the user says "yes" then the
// category is not abstract // category is not abstract
if ("yes".equals(isAbstract)) { if ("yes".equals(isAbstract)) {
category.setAbstract(false); category.setAbstract(false);
} else if ("no".equals(isAbstract)) { } else if ("no".equals(isAbstract)) {
category.setAbstract(true); category.setAbstract(true);
} }
category.save(); // XXX this is necessary? category.save(); // XXX this is necessary?
parent.addChild(category); parent.addChild(category);

View File

@ -27,9 +27,9 @@ import com.arsdigita.util.Assert;
import com.arsdigita.util.Lockable; import com.arsdigita.util.Lockable;
/** /**
* A standard implementation of <code>SingleSelectionModel</code> and <code>Lockable</code>. Those * A standard implementation of <code>SingleSelectionModel</code> and
* wishing to define a SingleSelectionModel will ordinarily want to extend * <code>Lockable</code>. Those wishing to define a SingleSelectionModel
* this class. * will ordinarily want to extend this class.
* *
* @version $Id: AbstractSingleSelectionModel.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: AbstractSingleSelectionModel.java 287 2005-02-22 00:29:02Z sskracic $
*/ */

View File

@ -29,19 +29,12 @@ public final class Bebop {
private static final Logger s_log = Logger.getLogger(Bebop.class); private static final Logger s_log = Logger.getLogger(Bebop.class);
private static BebopConfig s_config; private static BebopConfig s_config = BebopConfig.getInstance();
/** /**
* Gets the <code>BebopConfig</code> object. * Gets the <code>BebopConfig</code> object.
*/ */
public static final BebopConfig getConfig() { public static BebopConfig getConfig() {
if (s_config == null) {
s_config = new BebopConfig();
// deprecated, use load() instead, load the default config db,
// which is ccm-core /bebop.properties for BebogConfig by definition
// s_config.load("ccm-core/bebop.properties");
s_config.load();
}
return s_config; return s_config;
} }
} }

View File

@ -38,7 +38,30 @@ import org.apache.log4j.Logger;
*/ */
public final class BebopConfig extends AbstractConfig { public final class BebopConfig extends AbstractConfig {
/** A logger instance to assist debugging. */
private static final Logger s_log = Logger.getLogger(BebopConfig.class); private static final Logger s_log = Logger.getLogger(BebopConfig.class);
/** Singleton config object. */
private static BebopConfig s_config;
/**
* Gain a BebopConfig object.
*
* Singleton pattern, don't instantiate a config object using the
* constructor directly!
* @return
*/
public static synchronized BebopConfig getInstance() {
if (s_config == null) {
s_config = new BebopConfig();
s_config.load();
}
return s_config;
}
// set of configuration parameters
// /////////////////////////////////////////////////////////////////
/** /**
* *
@ -81,6 +104,9 @@ public final class BebopConfig extends AbstractConfig {
("waf.bebop.show_class_name", Parameter.OPTIONAL, Boolean.FALSE); ("waf.bebop.show_class_name", Parameter.OPTIONAL, Boolean.FALSE);
/** /**
* Constructor.
* Singelton pattern, don't instantiate a config object using the
* constructor directly! Use getConfig() instead.
* *
*/ */
public BebopConfig() { public BebopConfig() {