XML Feed leitet jetzt von den Basic-Properties zum nächsten Schritt weiter.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2355 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2013-10-15 13:37:36 +00:00
parent af55a2d00f
commit b9e4dda96c
1 changed files with 17 additions and 14 deletions

View File

@ -15,10 +15,8 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
package com.arsdigita.cms.contenttypes.xmlfeed.ui; package com.arsdigita.cms.contenttypes.xmlfeed.ui;
import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
@ -32,7 +30,6 @@ import com.arsdigita.cms.ui.formbuilder.FormProperties;
import com.arsdigita.cms.contenttypes.xmlfeed.XMLFeed; import com.arsdigita.cms.contenttypes.xmlfeed.XMLFeed;
import com.arsdigita.cms.contenttypes.xmlfeed.util.XMLFeedGlobalizationUtil; import com.arsdigita.cms.contenttypes.xmlfeed.util.XMLFeedGlobalizationUtil;
public class XMLFeedProperties extends FormProperties { public class XMLFeedProperties extends FormProperties {
public XMLFeedProperties(ItemSelectionModel model, public XMLFeedProperties(ItemSelectionModel model,
@ -42,7 +39,7 @@ public class XMLFeedProperties extends FormProperties {
@Override @Override
protected BasicPageForm buildEditForm(ItemSelectionModel model) { protected BasicPageForm buildEditForm(ItemSelectionModel model) {
return new XMLFeedPropertyEditForm(model); return new XMLFeedPropertyEditForm(model, this);
} }
@Override @Override
@ -55,7 +52,12 @@ public class XMLFeedProperties extends FormProperties {
private TextField m_url; private TextField m_url;
public XMLFeedPropertyEditForm(ItemSelectionModel model) { public XMLFeedPropertyEditForm(ItemSelectionModel model) {
super(model); //super(model);
this(model, null);
}
public XMLFeedPropertyEditForm(ItemSelectionModel model, XMLFeedProperties feedProperties) {
super(model, feedProperties);
} }
@Override @Override
@ -64,39 +66,40 @@ public class XMLFeedProperties extends FormProperties {
m_url = new TextField(new StringParameter("url")); m_url = new TextField(new StringParameter("url"));
m_url.setHint(XMLFeedGlobalizationUtil.globalize( m_url.setHint(XMLFeedGlobalizationUtil.globalize(
"cms.contenttypes.ui.xmlfeed.feed_url_hint")); "cms.contenttypes.ui.xmlfeed.feed_url_hint"));
m_url.setSize(50); m_url.setSize(50);
add(new Label(XMLFeedGlobalizationUtil.globalize( add(new Label(XMLFeedGlobalizationUtil.globalize(
"cms.contenttypes.ui.xmlfeed.feed_url")) ); "cms.contenttypes.ui.xmlfeed.feed_url")));
add(m_url); add(m_url);
} }
@Override @Override
public ContentPage initBasicWidgets(FormSectionEvent e) { public ContentPage initBasicWidgets(FormSectionEvent e) {
XMLFeed item = (XMLFeed)super.initBasicWidgets(e); XMLFeed item = (XMLFeed) super.initBasicWidgets(e);
m_url.setValue(e.getPageState(), item.getURL()); m_url.setValue(e.getPageState(), item.getURL());
return item; return item;
} }
@Override @Override
public ContentPage processBasicWidgets(FormSectionEvent e) { public ContentPage processBasicWidgets(FormSectionEvent e) {
XMLFeed item = (XMLFeed)super.processBasicWidgets(e); XMLFeed item = (XMLFeed) super.processBasicWidgets(e);
item.setURL((String)m_url.getValue(e.getPageState())); item.setURL((String) m_url.getValue(e.getPageState()));
return item; return item;
} }
} }
protected class XMLFeedPropertySheet extends FormPropertySheet { protected class XMLFeedPropertySheet extends FormPropertySheet {
public XMLFeedPropertySheet(ItemSelectionModel model) { public XMLFeedPropertySheet(ItemSelectionModel model) {
super(model); super(model);
add(XMLFeedGlobalizationUtil.globalize( add(XMLFeedGlobalizationUtil.globalize(
"cms.contenttypes.ui.xmlfeed.url"), "cms.contenttypes.ui.xmlfeed.url"),
XMLFeed.URL); XMLFeed.URL);
} }
}
}
} }