From c510e1566aed784e5660f6329a4f968ba82a5ef4 Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 11 Jul 2014 18:38:38 +0000 Subject: [PATCH] Several enhancements for the handling of the new labels and hints: - Hints are now shown for ControlLinks - The standard theme uses an better symbol - Hints and new style labels now work for DHTMLEditors, and widgets Date, Time and DateTime git-svn-id: https://svn.libreccm.org/ccm/trunk@2755 8810af33-2d31-482b-a856-94f89814c4df --- .../com/arsdigita/cms/ui/CMSDHTMLEditor.java | 29 +- .../com/arsdigita/bebop/form/DHTMLEditor.java | 1 + .../src/com/arsdigita/bebop/form/Date.java | 1 + .../com/arsdigita/bebop/form/DateTime.java | 2 + .../com/arsdigita/bebop/form/TextArea.java | 82 ++- .../src/com/arsdigita/bebop/form/Time.java | 9 +- .../src/com/arsdigita/bebop/form/Widget.java | 316 ++++++----- .../web/themes/mandalay/css/screen/admin.css | 18 +- .../mandalay/includes/bebop/bebopEditors.xsl | 503 +++++++++--------- .../mandalay/includes/bebop/bebopLink.xsl | 12 + .../mandalay/includes/bebop/bebopWidget.xsl | 34 +- .../web/themes/mandalay/settings/bebop.xml | 3 +- 12 files changed, 531 insertions(+), 479 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java b/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java index 1cee4ef36..e17cc99c5 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java @@ -23,10 +23,9 @@ import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ContentSection; - /** - * - * + * + * */ public class CMSDHTMLEditor extends DHTMLEditor { @@ -35,33 +34,33 @@ public class CMSDHTMLEditor extends DHTMLEditor { ContentSection.getConfig().getDHTMLEditorConfig()); addPlugins(); hideButtons(); - + } public CMSDHTMLEditor(ParameterModel model) { - super(model, + super(model, ContentSection.getConfig().getDHTMLEditorConfig()); - addPlugins(); - hideButtons(); + addPlugins(); + hideButtons(); } - + private void addPlugins() { String[] plugins = ContentSection.getConfig().getDHTMLEditorPlugins(); if (plugins != null) { - for (int i = 0 ; i < plugins.length ; i++) { + for (int i = 0; i < plugins.length; i++) { addPlugin(plugins[i]); } } } private void hideButtons() { - String[] hiddenButtons = ContentSection.getConfig().getDHTMLEditorHiddenButtons(); - if (hiddenButtons != null) { - for (int i = 0 ; i < hiddenButtons.length ; i++) { - hideButton(hiddenButtons[i]); - } - } + String[] hiddenButtons = ContentSection.getConfig().getDHTMLEditorHiddenButtons(); + if (hiddenButtons != null) { + for (int i = 0; i < hiddenButtons.length; i++) { + hideButton(hiddenButtons[i]); + } + } } } diff --git a/ccm-core/src/com/arsdigita/bebop/form/DHTMLEditor.java b/ccm-core/src/com/arsdigita/bebop/form/DHTMLEditor.java index 84e18b324..016b301ab 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/DHTMLEditor.java +++ b/ccm-core/src/com/arsdigita/bebop/form/DHTMLEditor.java @@ -281,6 +281,7 @@ public class DHTMLEditor extends TextArea { Element editor = parent.newChildElement(getElementTag(), BEBOP_XML_NS); editor.addAttribute("name", getName()); + generateDescriptionXML(state, editor); // Set the needed config params so they don't have to be hardcoded in the theme editor.addAttribute("editor_url", Web.getWebappContextPath().concat(getEditorURL())); diff --git a/ccm-core/src/com/arsdigita/bebop/form/Date.java b/ccm-core/src/com/arsdigita/bebop/form/Date.java index 29482892f..311ca4514 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/Date.java +++ b/ccm-core/src/com/arsdigita/bebop/form/Date.java @@ -324,6 +324,7 @@ public class Date extends Widget implements BebopConstants { date.addAttribute("label", (String) getLabel().localize(ps.getRequest())); } exportAttributes(date); + generateDescriptionXML(ps, date); generateLocalizedWidget(ps, date); // If Element could be null insert an extra widget to clear entry diff --git a/ccm-core/src/com/arsdigita/bebop/form/DateTime.java b/ccm-core/src/com/arsdigita/bebop/form/DateTime.java index 7664c390d..35361c124 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/DateTime.java +++ b/ccm-core/src/com/arsdigita/bebop/form/DateTime.java @@ -112,6 +112,8 @@ public class DateTime extends Widget implements BebopConstants { m_date.generateLocalizedWidget(ps, datetime); m_time.generateLocalizedWidget(ps, datetime); + generateDescriptionXML(ps, datetime); + // If Element could be null insert a extra widget to clear entry if (!hasValidationListener(new NotNullValidationListener())) { datetime.newChildElement("NoDateTime"); diff --git a/ccm-core/src/com/arsdigita/bebop/form/TextArea.java b/ccm-core/src/com/arsdigita/bebop/form/TextArea.java index e950e7181..6951b904f 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/TextArea.java +++ b/ccm-core/src/com/arsdigita/bebop/form/TextArea.java @@ -18,7 +18,6 @@ */ package com.arsdigita.bebop.form; - import com.arsdigita.xml.Element; import com.arsdigita.bebop.PageState; @@ -28,22 +27,20 @@ import com.arsdigita.bebop.parameters.ParameterModel; // in a constant which is used when generating XML import com.arsdigita.bebop.util.BebopConstants; - - /** - * A class representing a textarea field in an HTML form. + * A class representing a textarea field in an HTML form. * - * @author Karl Goldstein - * @author Uday Mathur - * @author Rory Solomon - * @author Michael Pih - * @version $Id: TextArea.java 287 2005-02-22 00:29:02Z sskracic $ + * @author Karl Goldstein + * @author Uday Mathur + * @author Rory Solomon + * @author Michael Pih + * @version $Id: TextArea.java 287 2005-02-22 00:29:02Z sskracic $ */ public class TextArea extends Widget implements BebopConstants { /** * Constant for specifying OFF value for the - * WRAP attribute of this image input. See WRAP attribute of this image input. See here * for a description of what this attribute does. */ @@ -51,7 +48,7 @@ public class TextArea extends Widget implements BebopConstants { /** * Constant for specifying HARD value for the - * WRAP attribute of this image input. * See WRAP attribute of this image input. * See here * for a description of what this attribute does. */ @@ -59,7 +56,7 @@ public class TextArea extends Widget implements BebopConstants { /** * Constant for specifying SOFT value for the - * WRAP attribute of this image input. See WRAP attribute of this image input. See here * for a description of what this attribute does. */ @@ -68,13 +65,9 @@ public class TextArea extends Widget implements BebopConstants { // ------------------------------------- // * * * Fields * * * // ------------------------------------- - - // ------------------------------------- // * * * Methods * * * // ------------------------------------- - - public TextArea(String name) { super(name); } @@ -104,42 +97,42 @@ public class TextArea extends Widget implements BebopConstants { } /** - * Returns a string naming the type of this widget. + * Returns a string naming the type of this widget. */ public String getType() { return "textarea"; } /** - * Sets the ROWS attribute for the TEXTAREA tag. + * Sets the ROWS attribute for the TEXTAREA tag. */ public void setRows(int rows) { setAttribute("rows", String.valueOf(rows)); } /** - * Sets the COLS attribute for the TEXTAREA tag. + * Sets the COLS attribute for the TEXTAREA tag. */ public void setCols(int cols) { setAttribute("cols", String.valueOf(cols)); } /** - * Sets the WRAP attribute for the TEXTAREA tag. + * Sets the WRAP attribute for the TEXTAREA tag. */ public void setWrap(int wrap) { String wrapString = null; switch (wrap) { - case OFF: - wrapString = "off"; - break; - case HARD: - wrapString = "hard"; - break; - case SOFT: - wrapString = "soft"; - break; + case OFF: + wrapString = "off"; + break; + case HARD: + wrapString = "hard"; + break; + case SOFT: + wrapString = "soft"; + break; } if (wrapString != null) { @@ -149,45 +142,48 @@ public class TextArea extends Widget implements BebopConstants { /** * Set the default value (text) + * * @deprecated [since 17Aug2001] use {@link Widget#setDefaultValue(Object)} */ - public void setValue( String text ) { + public void setValue(String text) { this.setDefaultValue(text); } /** * Is this a compound widget? + * * @return false */ public boolean isCompound() { return false; } - /** The XML tag. - * @return The tag to be used for the top level DOM element - * generated for this type of Widget. */ + /** + * The XML tag. + * + * @return The tag to be used for the top level DOM element generated for this type of Widget. + */ protected String getElementTag() { return BEBOP_TEXTAREA; } /** * Generates the DOM for the textarea widget. - *

Generates DOM fragment: - *

<bebop:textarea name=... value=... [onXXX=...]/> - * + *

+ * Generates DOM fragment: + *

+ * <bebop:textarea name=... value=... [onXXX=...]/> + * */ - public void generateWidget( PageState state, Element parent ) { + public void generateWidget(PageState state, Element parent) { Element textarea = parent.newChildElement(getElementTag(), BEBOP_XML_NS); textarea.addAttribute("name", getName()); - if (getLabel() != null) - textarea.addAttribute("label", - (String)getLabel().localize(state.getRequest())); - + generateDescriptionXML(state, textarea); ParameterData pData = getParameterData(state); - if( null != pData ) { + if (null != pData) { String value = pData.marshal(); - if ( value == null ) { + if (value == null) { value = ""; } textarea.addAttribute("value", value); diff --git a/ccm-core/src/com/arsdigita/bebop/form/Time.java b/ccm-core/src/com/arsdigita/bebop/form/Time.java index 030d1efec..0b1c3fe4f 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/Time.java +++ b/ccm-core/src/com/arsdigita/bebop/form/Time.java @@ -21,7 +21,13 @@ package com.arsdigita.bebop.form; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.parameters.*; +import com.arsdigita.bebop.parameters.DateTimeParameter; +import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.bebop.parameters.NumberInRangeValidationListener; +import com.arsdigita.bebop.parameters.ParameterData; +import com.arsdigita.bebop.parameters.ParameterModel; +import com.arsdigita.bebop.parameters.TimeParameter; + import com.arsdigita.bebop.util.BebopConstants; import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.util.Assert; @@ -258,6 +264,7 @@ public class Time extends Widget implements BebopConstants { Element time = parent.newChildElement(getElementTag(), BEBOP_XML_NS); time.addAttribute("name", getParameterModel().getName()); + generateDescriptionXML(ps, time); generateLocalizedWidget(ps, time); // If Element could be null insert a extra widget to clear entry diff --git a/ccm-core/src/com/arsdigita/bebop/form/Widget.java b/ccm-core/src/com/arsdigita/bebop/form/Widget.java index 56ce1cee8..20ab19480 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/Widget.java +++ b/ccm-core/src/com/arsdigita/bebop/form/Widget.java @@ -52,26 +52,24 @@ import com.arsdigita.xml.Element; *

* *

- * A widget may correspond to a standard HTML form element, or to a more - * specific element or set of elements, such as a date widget that allows - * input of month, day and year (and possibly time as well).

+ * A widget may correspond to a standard HTML form element, or to a more specific element or set of + * elements, such as a date widget that allows input of month, day and year (and possibly time as + * well).

* *

- * This class and its subclasses provide methods to set all element attributes - * except for VALUE, which is typically dependent on the request. - * At the time of a request, a widget object merges a dynamically specified - * value or set of values with its own set of persistent attributes to render - * the final HTML for the widget. Other dynamic attributes may be associated - * with the form component via a WidgetPeer associated with the - * widget.

+ * This class and its subclasses provide methods to set all element attributes except for + * VALUE, which is typically dependent on the request. At the time of a request, a + * widget object merges a dynamically specified value or set of values with its own set of + * persistent attributes to render the final HTML for the widget. Other dynamic attributes may be + * associated with the form component via a WidgetPeer associated with the widget.

* * @author Karl Goldstein * @author Uday Mathur * @author Rory Solomon * @version $Id: Widget.java 1537 2007-03-23 15:33:34Z chrisgilbert23 $ */ -public abstract class Widget extends DescriptiveComponent - implements Cloneable, BebopConstants { +public abstract class Widget extends DescriptiveComponent + implements Cloneable, BebopConstants { private static final Logger s_log = Logger.getLogger(Widget.class); @@ -80,7 +78,9 @@ public abstract class Widget extends DescriptiveComponent private ParameterListener m_forwardParameter = null; private PrintListener m_printListener; private Form m_form; - /** The optional (localized) label (or title) of this widget. */ + /** + * The optional (localized) label (or title) of this widget. + */ // Use parent's class' instead // private GlobalizedMessage m_label; @@ -96,7 +96,6 @@ public abstract class Widget extends DescriptiveComponent static final String ON_CHANGE = "onChange"; static final String ON_KEY_UP = "onKeyUp"; - /** * Constructor, creates a new widget. * @@ -110,9 +109,9 @@ public abstract class Widget extends DescriptiveComponent * Constructor, creates a new widget. * *

- * Each new widget is associated with a ParameterModel describing the - * data object(s) submitted from the widget. - * + * Each new widget is associated with a ParameterModel describing the data object(s) submitted + * from the widget. + * * @param model */ protected Widget(ParameterModel model) { @@ -121,33 +120,33 @@ public abstract class Widget extends DescriptiveComponent m_parameterModel = model; } - /** * Returns true if the widget consists of multiple HTML elements. - * - * @return + * + * @return */ public abstract boolean isCompound(); /** - * Returns a string naming the type of this widget. Must be implemented by - * subclasses! - * - * @return + * Returns a string naming the type of this widget. Must be implemented by subclasses! + * + * @return */ protected abstract String getType(); /** - * - * @return + * + * @return */ protected ParameterListener createParameterListener() { return new ParameterListener() { + @Override public void validate(ParameterEvent evt) - throws FormProcessException { + throws FormProcessException { fireValidation(new ParameterEvent(Widget.this, evt.getParameterData())); } + }; } @@ -161,18 +160,18 @@ public abstract class Widget extends DescriptiveComponent } protected void fireValidation(ParameterEvent evt) - throws FormProcessException { + throws FormProcessException { Assert.isLocked(this); PageState ps = evt.getPageState(); - if ( (!validateInvisible() && !ps.isVisibleOnPage(this)) - || ((m_guard != null) && m_guard.shouldValidate(ps)) ) { + if ((!validateInvisible() && !ps.isVisibleOnPage(this)) + || ((m_guard != null) && m_guard.shouldValidate(ps))) { return; } for (Iterator it - = m_listeners.getListenerIterator(ParameterListener.class); + = m_listeners.getListenerIterator(ParameterListener.class); it.hasNext();) { ((ParameterListener) it.next()).validate(evt); } @@ -198,6 +197,7 @@ public abstract class Widget extends DescriptiveComponent * Test for existens of a particular type of ValidationListener * * @param listener Subtype of ParameterListern which is tested for + * * @return true if subtype is in the list */ public boolean hasValidationListener(ParameterListener listener) { @@ -208,17 +208,18 @@ public abstract class Widget extends DescriptiveComponent } /** - * Adds a print listener for this widget. Only one print listener can - * be set for a widget, since the PrintListener is expected - * to modify the target of the PrintEvent. + * Adds a print listener for this widget. Only one print listener can be set for a widget, since + * the PrintListener is expected to modify the target of the + * PrintEvent. * * @param listener the print listener - * @throws IllegalArgumentException listener is null + * + * @throws IllegalArgumentException listener is null * @throws TooManyListenersException a print listener has previously been added * @pre listener != null */ public void addPrintListener(PrintListener listener) - throws TooManyListenersException, IllegalArgumentException { + throws TooManyListenersException, IllegalArgumentException { if (listener == null) { throw new IllegalArgumentException("Argument listener can not be null"); } @@ -229,17 +230,17 @@ public abstract class Widget extends DescriptiveComponent } /** - * Set the print listener for this widget. Since there can only be one - * print listener for a widget, this lets you just set it and avoid - * writing a try/catch block for "TooManyListenersException". Any existing - * listener will be overwritten. + * Set the print listener for this widget. Since there can only be one print listener for a + * widget, this lets you just set it and avoid writing a try/catch block for + * "TooManyListenersException". Any existing listener will be overwritten. * * @param listener the print listener + * * @throws IllegalArgumentException listener is null * @pre listener != null */ public void setPrintListener(PrintListener listener) - throws IllegalArgumentException { + throws IllegalArgumentException { if (listener == null) { throw new IllegalArgumentException("Argument listener can not be null"); } @@ -247,19 +248,18 @@ public abstract class Widget extends DescriptiveComponent } /** - * Remove a previously added print listener. - * If listener is not the listener that has been added with - * {@link #addPrintListener addPrintListener}, an IllegalArgumentException + * Remove a previously added print listener. If listener is not the listener that + * has been added with {@link #addPrintListener addPrintListener}, an IllegalArgumentException * will be thrown. * - * @param listener the listener that had been added with - * addPrintListener - * @throws IllegalArgumentException listener is not the - * currently registered print listener or is null. + * @param listener the listener that had been added with addPrintListener + * + * @throws IllegalArgumentException listener is not the currently registered print + * listener or is null. * @pre listener != null */ public void removePrintListener(PrintListener listener) - throws IllegalArgumentException { + throws IllegalArgumentException { if (listener == null) { throw new IllegalArgumentException("listener can not be null"); } @@ -270,10 +270,9 @@ public abstract class Widget extends DescriptiveComponent } /** - * Registers the ParameterModel of this Widget with the containing Form. - * This method is used by the Bebop framework and should not be used by - * application developers. - * + * Registers the ParameterModel of this Widget with the containing Form. This method is used by + * the Bebop framework and should not be used by application developers. + * * @param form * @param model */ @@ -285,44 +284,44 @@ public abstract class Widget extends DescriptiveComponent } /** - * Sets the Form Object for this Widget. - * This method will throw an exception if the _form pointer is already set. - * To explicity change the m_form pointer the developer must first call + * Sets the Form Object for this Widget. This method will throw an exception if the _form + * pointer is already set. To explicity change the m_form pointer the developer must first call * setForm(null) * * @param form The Form Object for this Widget + * * @exception IllegalStateException if form already set. */ public void setForm(final Form form) { if (m_form != null && form != null) { - throw new IllegalStateException("Form " + form.getName() - + " already set for " - + getName()); + throw new IllegalStateException("Form " + form.getName() + + " already set for " + + getName()); } m_form = form; } /** - * Gets the Form Object for this Widget. - * Throws an exception if the Widget doesn't belong to a form. + * Gets the Form Object for this Widget. Throws an exception if the Widget doesn't belong to a + * form. * * @return the {@link Form} Object for this Widget. + * * @post return != null */ public Form getForm() throws RuntimeException { if (m_form == null) { throw new RuntimeException("Widget " + this + " (" + getName() + ") " - + "isn't associated with any Form"); + + "isn't associated with any Form"); } return m_form; } /** - * Sets the ONFOCUS attribute for the HTML tags that compose - * this element. - * + * Sets the ONFOCUS attribute for the HTML tags that compose this element. + * * @param javascriptCode */ public void setOnFocus(String javascriptCode) { @@ -330,9 +329,8 @@ public abstract class Widget extends DescriptiveComponent } /** - * Sets the ONBLUR attribute for the HTML tags that compose - * this element. - * + * Sets the ONBLUR attribute for the HTML tags that compose this element. + * * @param javascriptCode */ public void setOnBlur(String javascriptCode) { @@ -340,9 +338,8 @@ public abstract class Widget extends DescriptiveComponent } /** - * Sets the ONSELECT attribute for the HTML tags that compose - * this element. - * + * Sets the ONSELECT attribute for the HTML tags that compose this element. + * * @param javascriptCode */ public void setOnSelect(String javascriptCode) { @@ -350,9 +347,8 @@ public abstract class Widget extends DescriptiveComponent } /** - * Sets the ONCHANGE attribute for the HTML tags that compose - * this element. - * + * Sets the ONCHANGE attribute for the HTML tags that compose this element. + * * @param javascriptCode */ public void setOnChange(String javascriptCode) { @@ -360,8 +356,7 @@ public abstract class Widget extends DescriptiveComponent } /** - * Sets the ON_KEY_UP attribute for the HTML tags that compose - * this element. + * Sets the ON_KEY_UP attribute for the HTML tags that compose this element. * * @param javascriptCode */ @@ -370,10 +365,9 @@ public abstract class Widget extends DescriptiveComponent } /** - * Sets the default value in the parameter model for this element. - * This is a static property and this method should not be invoked - * at request time (not even in a PrintListener). - * + * Sets the default value in the parameter model for this element. This is a static property and + * this method should not be invoked at request time (not even in a PrintListener). + * * @param value */ public void setDefaultValue(Object value) { @@ -381,9 +375,8 @@ public abstract class Widget extends DescriptiveComponent } /** - * Marks this widget as readonly, which has the effect of preventing the - * user from modifying the widget's contents. - * This method can only be called on unlocked widgets. + * Marks this widget as readonly, which has the effect of preventing the user from modifying the + * widget's contents. This method can only be called on unlocked widgets. */ public void setReadOnly() { Assert.isUnlocked(this); @@ -391,9 +384,8 @@ public abstract class Widget extends DescriptiveComponent } /** - * Marks this widget as disabled, which has the effect of preventing the - * widget's value being submitted with the form, and will typically cause - * the widget to be 'grayed out' on the form. + * Marks this widget as disabled, which has the effect of preventing the widget's value being + * submitted with the form, and will typically cause the widget to be 'grayed out' on the form. * This method can only be called on unlocked widgets. */ public void setDisabled() { @@ -405,8 +397,9 @@ public abstract class Widget extends DescriptiveComponent * Sets a popup hint for the widget. * * @param hint - * @deprecated refactor to use a GlobalizedMessage instead and use - * setHint(GlobalizedMessage hint) + * + * @deprecated refactor to use a GlobalizedMessage instead and use setHint(GlobalizedMessage + * hint) */ public void setHint(String hint) { Assert.isUnlocked(this); @@ -415,7 +408,7 @@ public abstract class Widget extends DescriptiveComponent /** * Sets a popup hint for the widget. - * + * * @param hint */ // Use parent's class method instead @@ -424,31 +417,28 @@ public abstract class Widget extends DescriptiveComponent // Assert.isUnlocked(this); // setAttribute("hint", (String) hint.localize()); // } - /** * Sets a Label for the widget. - * + * * @param label */ // Use parent's class method instead // public void setLabel(GlobalizedMessage label) { // m_label = label; // } - /** * Sets a Label for the widget. - * - * @return + * + * @return */ // Use parent's class method instead // public GlobalizedMessage getLabel() { // return m_label; // } - /** * Gets the default value in the parameter model for this element. - * - * @return + * + * @return */ public String getDefaultValue() { Object o = m_parameterModel.getDefaultValue(); @@ -463,30 +453,28 @@ public abstract class Widget extends DescriptiveComponent } /** - * The "pass in" property determines whether the value for this parameter - * is generally passed in from the outside. - * If this property is true, the model always tries to get the - * parameter value from the request, no matter whether the request is the - * initial request or a submission of the form to which the widget belongs. + * The "pass in" property determines whether the value for this parameter is generally passed in + * from the outside. If this property is true, the model always tries to get the + * parameter value from the request, no matter whether the request is the initial request or a + * submission of the form to which the widget belongs. * *

- * If this property is false, the parameter value is only read - * from the request if it is a submission of the form containing the widget. + * If this property is false, the parameter value is only read from the request if + * it is a submission of the form containing the widget. * *

* By default, this property is false. * - * @return true if an attempt should always be made to - * retrieve the parameter value from the request. + * @return true if an attempt should always be made to retrieve the parameter value + * from the request. */ public final boolean isPassIn() { return getParameterModel().isPassIn(); } /** - * Set whether this parameter should be treated as a "pass in" parameter. - * This is a static property of the ParameterModel and this method should - * not be invoked at request-time. + * Set whether this parameter should be treated as a "pass in" parameter. This is a static + * property of the ParameterModel and this method should not be invoked at request-time. * * @see #isPassIn * @param v true if this parameter is a pass in parameter. @@ -497,11 +485,9 @@ public abstract class Widget extends DescriptiveComponent } /** - * The ParameterModel is normally set via the constructors. - * This method is only rarely needed. - * Please note that the previous ParameterModel and all its listeners - * will be lost. - * + * The ParameterModel is normally set via the constructors. This method is only rarely needed. + * Please note that the previous ParameterModel and all its listeners will be lost. + * * @param parameterModel */ public final void setParameterModel(ParameterModel parameterModel) { @@ -510,13 +496,12 @@ public abstract class Widget extends DescriptiveComponent } /** - * Allows access to underlying parameterModel. The ParameterModel contains - * static (request-independent) properties of a Widget such as its name, - * default value and its listeners. The ParameterModel can not be modified - * once Page.lock() has been invoked (not even in a PrintListener). - * This is done after the Page has been built, normally at server startup. - * - * @return + * Allows access to underlying parameterModel. The ParameterModel contains static + * (request-independent) properties of a Widget such as its name, default value and its + * listeners. The ParameterModel can not be modified once Page.lock() has been invoked (not even + * in a PrintListener). This is done after the Page has been built, normally at server startup. + * + * @return */ public final ParameterModel getParameterModel() { return m_parameterModel; @@ -524,15 +509,14 @@ public abstract class Widget extends DescriptiveComponent /** *

- * This method creates the DOM for the widget. The method is called by the - * Bebop framework and should not be invoked by application developers. + * This method creates the DOM for the widget. The method is called by the Bebop framework and + * should not be invoked by application developers. *

* *

- * The method first fires the print event allowing application developers - * to set certain properties of the Widget at request time in a - * PrintListener. The methods generateWidget and generateErrors will then - * be invoked to generate either of the following + * The method first fires the print event allowing application developers to set certain + * properties of the Widget at request time in a PrintListener. The methods generateWidget and + * generateErrors will then be invoked to generate either of the following *

* *

@@ -541,7 +525,7 @@ public abstract class Widget extends DescriptiveComponent * *

* - * <bebop:formWidget name=... type=... label=... value=... + * <bebop:formWidget name=... type=... label=... value=... * [hint=...] [onXXX=...] </bebop:formWidget> * *

@@ -580,8 +564,7 @@ public abstract class Widget extends DescriptiveComponent /** * The XML tag. * - * @return The tag to be used for the top level DOM element generated for - * this type of Widget. + * @return The tag to be used for the top level DOM element generated for this type of Widget. */ protected String getElementTag() { return BEBOP_FORMWIDGET; @@ -594,7 +577,7 @@ public abstract class Widget extends DescriptiveComponent *

* <bebop:formWidget name=... type=... value=... [onXXX=...]> * </bebop:formWidget> - * + * * @param state * @param parent */ @@ -605,11 +588,11 @@ public abstract class Widget extends DescriptiveComponent widget.addAttribute("type", getType()); widget.addAttribute("name", getName()); widget.addAttribute("class", getName().replace(".", " ")); - generateDescriptionXML(state,widget); + generateDescriptionXML(state, widget); // if (m_label != null) { - // widget.addAttribute("label", - // (String) m_label.localize(state.getRequest())); - // } + // widget.addAttribute("label", + // (String) m_label.localize(state.getRequest())); + // } exportAttributes(widget); String value = null; ParameterData p = getParameterData(state); @@ -625,11 +608,10 @@ public abstract class Widget extends DescriptiveComponent /** * Generates the XML for the given widget. *

- * Generates XML fragment: - * <bebop:formErrors message=... id=name> + * Generates XML fragment: <bebop:formErrors message=... id=name> * </bebop:formErrors> *

- * + * * @param state * @param parent */ @@ -646,15 +628,15 @@ public abstract class Widget extends DescriptiveComponent } /** - * Get the value associated with this widget in the request described by - * ps. - * The type of the returned object depends on the ParameterModel - * underlying this widget. This method is typically called in a - * FormProcessListener to access the value that was submitted for a Widget - * in the Form. + * Get the value associated with this widget in the request described by ps. The + * type of the returned object depends on the ParameterModel underlying this + * widget. This method is typically called in a FormProcessListener to access the value that was + * submitted for a Widget in the Form. * * @param ps describes the request currently being processed - * @return + * + * @return + * * @pre ps != null * @post may return null */ @@ -676,22 +658,22 @@ public abstract class Widget extends DescriptiveComponent } /** - * Set the value of the parameter associated with this widget to a new value. - * The exact type of value depends on the - * ParameterModel underlying the widget. This method is typically - * called in a FormInitListener to initialize the value of a Widget in the + * Set the value of the parameter associated with this widget to a new value. The exact type of + * value depends on the ParameterModel underlying the widget. This + * method is typically called in a FormInitListener to initialize the value of a Widget in the * Form at request time. * * @param ps * @param value + * * @pre ps != null * @post value == getValue(ps) * - * @throws IllegalStateException the form to which the widget belongs has - * not been processed yet. + * @throws IllegalStateException the form to which the widget belongs has not been processed + * yet. */ public void setValue(PageState ps, Object value) - throws IllegalStateException { + throws IllegalStateException { Assert.exists(ps, "PageState"); ParameterData p = getParameterData(ps); // set value in session if it is being held - allows @@ -706,9 +688,9 @@ public abstract class Widget extends DescriptiveComponent } else { throw new IllegalStateException("Cannot set value for widget '" + getName() - + "': corresponding form '" - + getForm().getName() - + "' has not been processed yet."); + + "': corresponding form '" + + getForm().getName() + + "' has not been processed yet."); } } @@ -722,9 +704,11 @@ public abstract class Widget extends DescriptiveComponent } /** - * + * * @param ps + * * @return the parameter value for this widget + * * @post returns null if the FormData are missing */ protected ParameterData getParameterData(PageState ps) { @@ -737,11 +721,10 @@ public abstract class Widget extends DescriptiveComponent } /** - * Respond to an incoming request by calling respond on the - * form to which the widget belongs. This method is called by the Bebop - * framework and should not be invoked by application developers. It is - * somewhat questionable that this method should ever be called, rather - * than having {@link Form#respond Form.respond()} called directly. + * Respond to an incoming request by calling respond on the form to which the + * widget belongs. This method is called by the Bebop framework and should not be invoked by + * application developers. It is somewhat questionable that this method should ever be called, + * rather than having {@link Form#respond Form.respond()} called directly. * * @throws javax.servlet.ServletException * @pre state != null @@ -759,8 +742,8 @@ public abstract class Widget extends DescriptiveComponent } /** - * Specify a Widget. ValidationGuard implementation to use to determine if - * this widget should run its validation listeners. + * Specify a Widget. ValidationGuard implementation to use to determine if this widget should + * run its validation listeners. * * @param guard the Widget.ValidationGuard. */ @@ -770,12 +753,13 @@ public abstract class Widget extends DescriptiveComponent } /** - * Inner interface used to determine if the validation listeners should be - * run for this widget or not. + * Inner interface used to determine if the validation listeners should be run for this widget + * or not. */ public interface ValidationGuard { boolean shouldValidate(PageState ps); + } /** @@ -792,6 +776,7 @@ public abstract class Widget extends DescriptiveComponent * Adds an error to be displayed with this parameter. * * @param error A string showing the error to the user. + * * @deprecated refactor to use addError(GlobalizedMessage) instead. */ public void addError(String error) { @@ -802,4 +787,5 @@ public abstract class Widget extends DescriptiveComponent public String toString() { return super.toString() + " [" + getName() + "]"; } + } diff --git a/ccm-sci-bundle/web/themes/mandalay/css/screen/admin.css b/ccm-sci-bundle/web/themes/mandalay/css/screen/admin.css index e3b57a935..99fc3242d 100644 --- a/ccm-sci-bundle/web/themes/mandalay/css/screen/admin.css +++ b/ccm-sci-bundle/web/themes/mandalay/css/screen/admin.css @@ -443,7 +443,7 @@ div#left { width: 25%; } -div#left, div#right{ +div#left, div#right { top: 0 !important; bottom: 0; } @@ -1482,9 +1482,11 @@ input#draft_search:active { #content form fieldset { border: none; margin: 0.5em 0em 1em 0.3em; - border-top: 1px dotted #0776A0; - border-bottom: 1px dotted #0776A0; - padding: 0.3em 0em; + /*border-top: 1px dotted #0776A0; */ + /*border-bottom: 1px dotted #0776A0; */ + border: 1px dotted #0776A0; + /*padding: 0.3em 0em;*/ + padding: 1em; color: #0776A0; font-weight: bold; } @@ -1570,6 +1572,10 @@ div.bebopGridPanel{ margin-top: 15px; } +.hint { + font-size: 1.6em; +} + .hint:hover:after { position: absolute; box-shadow: 0 0 5px #4a4a4a; @@ -1579,7 +1585,9 @@ div.bebopGridPanel{ top: auto; right: auto; width: 30%; - background-image: inear-gradient(top, #eeeeee, #cccccc); + font-size: 0.63em; + z-index: 65535; + background-image: linear-gradient(top, #eeeeee, #cccccc); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc)); background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); diff --git a/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopEditors.xsl b/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopEditors.xsl index c56fcbfab..3b4b2ef01 100644 --- a/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopEditors.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopEditors.xsl @@ -31,282 +31,291 @@ + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + xmlns:nav="http://ccm.redhat.com/navigation" + xmlns:mandalay="http://mandalay.quasiweb.de" + exclude-result-prefixes="xsl bebop cms nav mandalay" + version="1.0"> - - - + + + - - - - + + + + - + - - - + function wordClean_() { + editor_._wordClean(); + } + + + -
- -
+ + + +
+ +
-
+
- - - + + + - - - + + + - - + + - + - + - - - - - - - - - - - - - - - - - - - + - - + + + + + - + - - + + + + +
diff --git a/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopLink.xsl b/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopLink.xsl index b5699591a..2c22d3d63 100644 --- a/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopLink.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopLink.xsl @@ -112,6 +112,18 @@ {$alt} + + + + + + + + + + + + diff --git a/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopWidget.xsl b/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopWidget.xsl index f0ce3f61e..c0cd9c16e 100644 --- a/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopWidget.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/includes/bebop/bebopWidget.xsl @@ -208,15 +208,45 @@
+ + + + + + + + + + + +
- + +
+ + + + + + + + + + + + + + + + +
diff --git a/ccm-sci-bundle/web/themes/mandalay/settings/bebop.xml b/ccm-sci-bundle/web/themes/mandalay/settings/bebop.xml index 9c65b78a1..b56dfb7cf 100644 --- a/ccm-sci-bundle/web/themes/mandalay/settings/bebop.xml +++ b/ccm-sci-bundle/web/themes/mandalay/settings/bebop.xml @@ -24,8 +24,9 @@ false cccccc + - (?) + /images/bebop/checkBoxChecked.gif /images/bebop/checkBoxUnchecked.gif