KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > riotfamily > riot > editor > EditorDefinition


1 /* ***** BEGIN LICENSE BLOCK *****
2  * Version: MPL 1.1
3  * The contents of this file are subject to the Mozilla Public License Version
4  * 1.1 (the "License"); you may not use this file except in compliance with
5  * the License. You may obtain a copy of the License at
6  * http://www.mozilla.org/MPL/
7  *
8  * Software distributed under the License is distributed on an "AS IS" basis,
9  * 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 JavaDoc;
27
28 import org.riotfamily.common.i18n.MessageResolver;
29 import org.riotfamily.riot.editor.ui.EditorReference;
30
31
32
33 /**
34  *
35  */

36 public interface EditorDefinition {
37
38     public String JavaDoc getId();
39     
40     public String JavaDoc getEditorType();
41     
42     public Class JavaDoc getBeanClass();
43     
44     public String JavaDoc getLabel(Object JavaDoc bean);
45     
46     public void setParentEditorDefinition(EditorDefinition parent);
47
48     public EditorDefinition getParentEditorDefinition();
49     
50     /**
51      * Returns a PathComponent for the given objectId and parentId that
52      * represents the complete path to the editor.
53      *
54      * This method is invoked by the PathController for the current (active)
55      * editor in order to build a breadcrumb navigation.
56      */

57     public EditorReference createEditorPath(
58             String JavaDoc objectId, String JavaDoc parentId, MessageResolver messageResolver);
59     
60     /**
61      * Returns a PathComponent for the given bean that represents the complete
62      * path to the editor.
63      *
64      * This method is usually invoked by descendant editors to create a
65      * complete path recursivly.
66      */

67     public EditorReference createEditorPath(Object JavaDoc bean,
68             MessageResolver messageResolver);
69     
70     /**
71      * Creates a reference to an editor. The method is used by the
72      * {@link org.riotfamily.riot.editor.ui.EditorGroupController
73      * EditorGroupController}.
74      */

75     public EditorReference createReference(String JavaDoc parentId,
76             MessageResolver messageResolver);
77     
78     
79     public void addReference(List JavaDoc refs, EditorDefinition parentDef,
80             Object JavaDoc parent, MessageResolver messageResolver);
81     
82     /**
83      *
84      */

85     public String JavaDoc getEditorUrl(String JavaDoc objectId, String JavaDoc parentId);
86     
87     /**
88      * Editors that are only used in choosers may return <code>true</code>
89      * in order to be excluded from group views.
90      *
91      * @see org.riotfamily.riot.editor.ui.EditorGroupController
92      */

93     public boolean isHidden();
94     
95 }
96
Popular Tags