01: /* ***** BEGIN LICENSE BLOCK *****
02: * Version: MPL 1.1
03: * The contents of this file are subject to the Mozilla Public License Version
04: * 1.1 (the "License"); you may not use this file except in compliance with
05: * the License. You may obtain a copy of the License at
06: * http://www.mozilla.org/MPL/
07: *
08: * Software distributed under the License is distributed on an "AS IS" basis,
09: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10: * for the specific language governing rights and limitations under the
11: * License.
12: *
13: * The Original Code is Riot.
14: *
15: * The Initial Developer of the Original Code is
16: * Neteye GmbH.
17: * Portions created by the Initial Developer are Copyright (C) 2006
18: * the Initial Developer. All Rights Reserved.
19: *
20: * Contributor(s):
21: * Felix Gnass [fgnass at neteye dot de]
22: *
23: * ***** END LICENSE BLOCK ***** */
24: package org.riotfamily.riot.editor;
25:
26: import java.util.List;
27:
28: import org.riotfamily.common.i18n.MessageResolver;
29: import org.riotfamily.riot.editor.ui.EditorReference;
30:
31: /**
32: *
33: */
34: public interface EditorDefinition {
35:
36: public String getId();
37:
38: public String getEditorType();
39:
40: public Class getBeanClass();
41:
42: public String getLabel(Object bean);
43:
44: public void setParentEditorDefinition(EditorDefinition parent);
45:
46: public EditorDefinition getParentEditorDefinition();
47:
48: /**
49: * Returns a PathComponent for the given objectId and parentId that
50: * represents the complete path to the editor.
51: *
52: * This method is invoked by the PathController for the current (active)
53: * editor in order to build a breadcrumb navigation.
54: */
55: public EditorReference createEditorPath(String objectId,
56: String parentId, MessageResolver messageResolver);
57:
58: /**
59: * Returns a PathComponent for the given bean that represents the complete
60: * path to the editor.
61: *
62: * This method is usually invoked by descendant editors to create a
63: * complete path recursivly.
64: */
65: public EditorReference createEditorPath(Object bean,
66: MessageResolver messageResolver);
67:
68: /**
69: * Creates a reference to an editor. The method is used by the
70: * {@link org.riotfamily.riot.editor.ui.EditorGroupController
71: * EditorGroupController}.
72: */
73: public EditorReference createReference(String parentId,
74: MessageResolver messageResolver);
75:
76: public void addReference(List refs, EditorDefinition parentDef,
77: Object parent, MessageResolver messageResolver);
78:
79: /**
80: *
81: */
82: public String getEditorUrl(String objectId, String parentId);
83:
84: /**
85: * Editors that are only used in choosers may return <code>true</code>
86: * in order to be excluded from group views.
87: *
88: * @see org.riotfamily.riot.editor.ui.EditorGroupController
89: */
90: public boolean isHidden();
91:
92: public boolean show(Object parent);
93:
94: }
|