|
From: <mb...@re...> - 2004-11-05 20:04:38
|
Author: mbooth
Date: 2004-11-05 20:57:28 +0100 (Fri, 05 Nov 2004)
New Revision: 83
Modified:
ccm-core/trunk/src/com/arsdigita/formbuilder/ui/ControlEditor.java
ccm-core/trunk/src/com/arsdigita/formbuilder/ui/MetaObjectProperties.java
ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesEditor.java
ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesForm.java
ccm-core/trunk/src/com/arsdigita/formbuilder/ui/editors/OptionGroupEditor.java
Log:
Fix "unable to cancel checkbox creation" bug
Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/ui/ControlEditor.java
===================================================================
--- ccm-core/trunk/src/com/arsdigita/formbuilder/ui/ControlEditor.java 2004-11-05 19:56:43 UTC (rev 82)
+++ ccm-core/trunk/src/com/arsdigita/formbuilder/ui/ControlEditor.java 2004-11-05 19:57:28 UTC (rev 83)
@@ -18,50 +18,48 @@
*/
package com.arsdigita.formbuilder.ui;
-import com.arsdigita.bebop.event.FormProcessListener;
-import com.arsdigita.bebop.event.FormSectionEvent;
-import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.formbuilder.PersistentComponent;
+import com.arsdigita.formbuilder.PersistentComponentFactory;
import com.arsdigita.formbuilder.PersistentForm;
-import com.arsdigita.bebop.Component;
-import com.arsdigita.bebop.Container;
-import com.arsdigita.bebop.PageState;
-import java.math.BigDecimal;
import com.arsdigita.formbuilder.PersistentFormSection;
-import com.arsdigita.bebop.ColumnPanel;
-import com.arsdigita.bebop.FormSection;
-import com.arsdigita.formbuilder.PersistentComponentFactory;
-import com.arsdigita.formbuilder.PersistentComponent;
import com.arsdigita.formbuilder.PersistentWidget;
import com.arsdigita.formbuilder.WidgetLabel;
+import com.arsdigita.formbuilder.util.FormBuilderUtil;
+import com.arsdigita.formbuilder.util.GlobalizationUtil;
+
+import com.arsdigita.bebop.BaseLink;
import com.arsdigita.bebop.BoxPanel;
+import com.arsdigita.bebop.ColumnPanel;
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.Container;
+import com.arsdigita.bebop.ControlLink;
import com.arsdigita.bebop.Form;
+import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.bebop.FormSection;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.Link;
import com.arsdigita.bebop.MetaForm;
-import com.arsdigita.formbuilder.util.FormBuilderUtil;
+import com.arsdigita.bebop.Page;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.ParameterSingleSelectionModel;
import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.bebop.SingleSelectionModel;
+import com.arsdigita.bebop.event.ActionEvent;
+import com.arsdigita.bebop.event.ActionListener;
+import com.arsdigita.bebop.event.FormProcessListener;
+import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.bebop.event.PrintListener;
+import com.arsdigita.bebop.form.Widget;
+import com.arsdigita.bebop.parameters.BigDecimalParameter;
+import com.arsdigita.bebop.util.Traversal;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.persistence.OID;
import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.formbuilder.ui.BaseEditAddObserver;
-import com.arsdigita.formbuilder.ui.NewControl;
-import com.arsdigita.bebop.ParameterSingleSelectionModel;
-import com.arsdigita.bebop.Page;
-import com.arsdigita.bebop.parameters.BigDecimalParameter;
-import com.arsdigita.formbuilder.ui.ControlProperties;
-import com.arsdigita.formbuilder.util.GlobalizationUtil;
-import com.arsdigita.formbuilder.util.FormBuilderUtil;
-import com.arsdigita.bebop.ControlLink;
-import com.arsdigita.bebop.BaseLink;
-import com.arsdigita.bebop.Link;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.SingleSelectionModel;
-import com.arsdigita.bebop.event.ActionListener;
-import com.arsdigita.bebop.event.ActionEvent;
-import com.arsdigita.bebop.util.Traversal;
-import com.arsdigita.bebop.form.Widget;
-import com.arsdigita.bebop.event.PrintListener;
+import java.math.BigDecimal;
+import org.apache.log4j.Logger;
/**
* This class provides a basic UI component for editing the
@@ -70,6 +68,8 @@
* infrasructure
*/
public class ControlEditor extends SimpleContainer {
+ private static final Logger s_log = Logger.getLogger( ControlEditor.class );
+
private ParameterSingleSelectionModel m_control;
private SingleSelectionModel m_form;
@@ -249,6 +249,9 @@
private class NewSectionProcessListener implements FormProcessListener {
public void process(FormSectionEvent e)
throws FormProcessException {
+
+ s_log.debug( "NewSectionProcessListener().process()" );
+
PageState state = e.getPageState();
BigDecimal form_id = (BigDecimal)m_form.getSelectedKey(state);
@@ -264,6 +267,8 @@
public void process(FormSectionEvent e)
throws FormProcessException {
+ s_log.debug( "NewControlProcessListener.process()" );
+
m_control.setSelectedKey(e.getPageState(), null);
m_view_form.setVisible(e.getPageState(), false);
m_control_props.setVisible(e.getPageState(), true);
@@ -274,6 +279,8 @@
public void complete(FormSectionEvent e)
throws FormProcessException {
+ s_log.debug( "ControlPropsCompletionListener.complete()" );
+
m_control.setSelectedKey(e.getPageState(), null);
m_view_form.setVisible(e.getPageState(), true);
m_control_props.setVisible(e.getPageState(), false);
@@ -283,6 +290,8 @@
private class MoveControlActionListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
+ s_log.debug( "MoveControlActionListener.actionPerformed()" );
+
m_control.setSelectedKey(e.getPageState(), null);
m_view_form.setVisible(e.getPageState(), true);
m_move_control.setVisible(e.getPageState(), false);
Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/ui/MetaObjectProperties.java
===================================================================
--- ccm-core/trunk/src/com/arsdigita/formbuilder/ui/MetaObjectProperties.java 2004-11-05 19:56:43 UTC (rev 82)
+++ ccm-core/trunk/src/com/arsdigita/formbuilder/ui/MetaObjectProperties.java 2004-11-05 19:57:28 UTC (rev 83)
@@ -18,30 +18,33 @@
*/
package com.arsdigita.formbuilder.ui;
-
+import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.bebop.Page;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.bebop.event.FormProcessListener;
+import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.bebop.event.FormSubmissionListener;
+import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.formbuilder.MetaObject;
import com.arsdigita.formbuilder.MetaObjectCollection;
+import com.arsdigita.util.UncheckedWrapperException;
+
import java.math.BigDecimal;
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.util.UncheckedWrapperException;
+import java.util.Iterator;
import java.util.HashMap;
-import java.util.Iterator;
-import com.arsdigita.bebop.PageState;
-import com.arsdigita.bebop.Page;
-import com.arsdigita.bebop.event.FormProcessListener;
-import com.arsdigita.bebop.SimpleContainer;
-import com.arsdigita.bebop.event.FormSubmissionListener;
-import com.arsdigita.bebop.FormProcessException;
-import com.arsdigita.bebop.event.FormSectionEvent;
+import org.apache.log4j.Logger;
-
public abstract class MetaObjectProperties extends SimpleContainer {
private HashMap m_widget_map;
private HashMap m_id_map;
private String m_app;
private Class m_type;
+ private static final Logger s_log =
+ Logger.getLogger( MetaObjectProperties.class );
+
public MetaObjectProperties(String app,
Class type) {
m_type = type;
@@ -128,6 +131,11 @@
PropertiesEditor f = (PropertiesEditor)e.getSource();
+ if( s_log.isDebugEnabled() ) {
+ s_log.debug( "MetaObjectListener.process(): " +
+ f.getClass().getName() );
+ }
+
if (f.isComplete(e.getPageState())) {
m_l.complete(new FormSectionEvent(m_source,
e.getPageState(),
@@ -140,6 +148,11 @@
PropertiesEditor f = (PropertiesEditor)e.getSource();
+ if( s_log.isDebugEnabled() ) {
+ s_log.debug( "MetaObjectListener.submitted(): " +
+ f.getClass().getName() );
+ }
+
if (f.isCancelled(e.getPageState())) {
m_l.complete(new FormSectionEvent(m_source,
e.getPageState(),
Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesEditor.java
===================================================================
--- ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesEditor.java 2004-11-05 19:56:43 UTC (rev 82)
+++ ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesEditor.java 2004-11-05 19:57:28 UTC (rev 83)
@@ -18,17 +18,20 @@
*/
package com.arsdigita.formbuilder.ui;
+import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.SimpleContainer;
-import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.event.FormSubmissionListener;
-import com.arsdigita.bebop.FormProcessException;
+import org.apache.log4j.Logger;
-
public class PropertiesEditor extends SimpleContainer {
+ private static final Logger s_log =
+ Logger.getLogger( PropertiesEditor.class );
+
PropertiesForm m_form;
String m_app;
@@ -77,6 +80,11 @@
public void process(FormSectionEvent e)
throws FormProcessException {
+ if( s_log.isDebugEnabled() ) {
+ s_log.debug( "PropertiesFormProcessListener.process(): " +
+ m_l.getClass().getName() );
+ }
+
m_l.process(new FormSectionEvent(PropertiesEditor.this,
e.getPageState(),
e.getFormData()));
@@ -93,6 +101,11 @@
public void submitted(FormSectionEvent e)
throws FormProcessException {
+ if( s_log.isDebugEnabled() ) {
+ s_log.debug( "PropertiesFormSubmissionListener.submitted(): " +
+ m_l.getClass().getName() );
+ }
+
m_l.submitted(new FormSectionEvent(PropertiesEditor.this,
e.getPageState(),
e.getFormData()));
Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesForm.java
===================================================================
--- ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesForm.java 2004-11-05 19:56:43 UTC (rev 82)
+++ ccm-core/trunk/src/com/arsdigita/formbuilder/ui/PropertiesForm.java 2004-11-05 19:57:28 UTC (rev 83)
@@ -22,16 +22,14 @@
import com.arsdigita.formbuilder.util.GlobalizationUtil ;
import com.arsdigita.bebop.Form;
-import com.arsdigita.bebop.SaveCancelSection;
-import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.FormSection;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.SaveCancelSection;
import com.arsdigita.bebop.event.FormSectionEvent;
-import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.event.FormSubmissionListener;
-import com.arsdigita.bebop.Label;
-
-
public class PropertiesForm extends Form {
SaveCancelSection m_buttons;
String m_app;
@@ -42,13 +40,13 @@
createWidgets();
addSubmissionListener(new FormSubmissionListener() {
- public void submitted(FormSectionEvent e)
- throws FormProcessException {
+ public void submitted(FormSectionEvent e)
+ throws FormProcessException {
- if (m_buttons.getCancelButton().isSelected(e.getPageState()))
- throw new FormProcessException("Cancel pressed");
- }
- });
+ if (m_buttons.getCancelButton().isSelected(e.getPageState()))
+ throw new FormProcessException("Cancel pressed");
+ }
+ });
}
public void setApplication(String app) {
Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/ui/editors/OptionGroupEditor.java
===================================================================
--- ccm-core/trunk/src/com/arsdigita/formbuilder/ui/editors/OptionGroupEditor.java 2004-11-05 19:56:43 UTC (rev 82)
+++ ccm-core/trunk/src/com/arsdigita/formbuilder/ui/editors/OptionGroupEditor.java 2004-11-05 19:57:28 UTC (rev 83)
@@ -19,18 +19,17 @@
package com.arsdigita.formbuilder.ui.editors;
import com.arsdigita.formbuilder.ui.PropertiesEditor;
-import com.arsdigita.bebop.event.FormProcessListener;
-import com.arsdigita.bebop.SingleSelectionModel;
-import com.arsdigita.bebop.event.FormSectionEvent;
+
+import com.arsdigita.bebop.BoxPanel;
+import com.arsdigita.bebop.Form;
import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.PageState;
-import com.arsdigita.bebop.Form;
+import com.arsdigita.bebop.SingleSelectionModel;
+import com.arsdigita.bebop.event.FormProcessListener;
+import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.form.Submit;
-import com.arsdigita.bebop.BoxPanel;
import com.arsdigita.xml.Element;
-
-
public class OptionGroupEditor extends PropertiesEditor {
private Form m_editor;
@@ -100,8 +99,4 @@
public boolean isComplete(PageState state) {
return m_done.isSelected(state);
}
-
- public boolean isCancelled(PageState state) {
- return false;
- }
}
|