RelatedLink
RelatedLink kann nun auf einfache Weise abgeleitet werden, um eine spezialisierte Version zu erzeugen. Dazu muß der RelatedLinkInitializer abgeleitet werden und die Methoden getAuthoringStep(), getAuthoringStepLabel() und getAuthoringStepDescription() überschrieben werden. Außerdem muß RelatedLinkPropertiesStep abgeleitet und die Methoden-Variablen m_linkListName und m_contentType angepaßt werden. git-svn-id: https://svn.libreccm.org/ccm/trunk@624 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7bf1e264fa
commit
75bacac675
|
|
@ -18,6 +18,7 @@ import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.FormSection;
|
import com.arsdigita.bebop.FormSection;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.contenttypes.ui.LinkPropertiesStep;
|
import com.arsdigita.cms.contenttypes.ui.LinkPropertiesStep;
|
||||||
|
|
@ -29,6 +30,7 @@ import com.arsdigita.cms.contenttypes.ui.LinkTable;
|
||||||
public class RelatedLinkPropertiesStep extends LinkPropertiesStep {
|
public class RelatedLinkPropertiesStep extends LinkPropertiesStep {
|
||||||
|
|
||||||
protected String m_linkListName = "";
|
protected String m_linkListName = "";
|
||||||
|
protected ContentType m_contentType = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Creates a <code>RelatedLinkPropertiesStep</code> given an
|
* Constructor. Creates a <code>RelatedLinkPropertiesStep</code> given an
|
||||||
|
|
@ -48,6 +50,7 @@ public class RelatedLinkPropertiesStep extends LinkPropertiesStep {
|
||||||
* Sets a RelatedLinkSelectionModel as the
|
* Sets a RelatedLinkSelectionModel as the
|
||||||
* LinkSelectionModel for this authoring step.
|
* LinkSelectionModel for this authoring step.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void setLinkSelectionModel() {
|
protected void setLinkSelectionModel() {
|
||||||
setLinkSelectionModel(
|
setLinkSelectionModel(
|
||||||
new RelatedLinkSelectionModel(getLinkParam()));
|
new RelatedLinkSelectionModel(getLinkParam()));
|
||||||
|
|
@ -83,7 +86,8 @@ public class RelatedLinkPropertiesStep extends LinkPropertiesStep {
|
||||||
protected FormSection getEditSheet() {
|
protected FormSection getEditSheet() {
|
||||||
return new RelatedLinkPropertyForm(getItemSelectionModel(),
|
return new RelatedLinkPropertyForm(getItemSelectionModel(),
|
||||||
getLinkSelectionModel(),
|
getLinkSelectionModel(),
|
||||||
m_linkListName);
|
m_linkListName,
|
||||||
|
m_contentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,14 @@ public class RelatedLinkPropertyForm extends LinkPropertyForm {
|
||||||
public RelatedLinkPropertyForm(ItemSelectionModel itemModel,
|
public RelatedLinkPropertyForm(ItemSelectionModel itemModel,
|
||||||
LinkSelectionModel link, String linkListName) {
|
LinkSelectionModel link, String linkListName) {
|
||||||
|
|
||||||
super(itemModel, link);
|
this(itemModel, link, linkListName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelatedLinkPropertyForm(ItemSelectionModel itemModel,
|
public RelatedLinkPropertyForm(ItemSelectionModel itemModel,
|
||||||
LinkSelectionModel link, ContentType contentType) {
|
LinkSelectionModel link, String linkListName, ContentType contentType) {
|
||||||
|
|
||||||
super(itemModel, link, contentType);
|
super(itemModel, link, contentType);
|
||||||
|
m_linkListName = linkListName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ public class LinkPropertyForm extends FormSection
|
||||||
add(m_targetURI);
|
add(m_targetURI);
|
||||||
|
|
||||||
add(new Label("Content Item:"));
|
add(new Label("Content Item:"));
|
||||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, m_itemModel.getContentType());
|
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, m_contentType);
|
||||||
m_itemSearch.getSearchButton().setOnFocus("toggle_link_fields(true)");
|
m_itemSearch.getSearchButton().setOnFocus("toggle_link_fields(true)");
|
||||||
m_itemSearch.getClearButton().setOnFocus("toggle_link_fields(true)");
|
m_itemSearch.getClearButton().setOnFocus("toggle_link_fields(true)");
|
||||||
add(m_itemSearch);
|
add(m_itemSearch);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue