View Javadoc

1   /* (c) Copyright 2003 Caleigo AB, All rights reserved. 
2    * 
3    * This library is free software; you can redistribute it and/or
4    * modify it under the terms of the GNU Lesser General Public
5    * License as published by the Free Software Foundation; either
6    * version 2.1 of the License, or (at your option) any later version.
7    * 
8    * This library is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11   * Lesser General Public License for more details.
12   * 
13   * You should have received a copy of the GNU Lesser General Public
14   * License along with this library; if not, write to the Free Software
15   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16   *  
17   */
18  
19  package org.caleigo.core;
20  
21  
22  /*** <Description of IActionDataDescriptor>
23   *
24   * @author  Dennis Zikovic
25   * @version 1.00
26   *
27   *//*
28   *
29   * WHEN        WHO               WHY & WHAT
30   * -----------------------------------------------------------------------------
31   * 2002-09-09  Dennis Zikovic    Creation
32   */
33  public interface IDataBundleDescriptor
34  {
35      // Constants ---------------------------------------------------------------
36      
37      /*** Constant returned by the getItemType method for data items that are 
38       * single data fields defined by a DataType object.
39       */
40      public static final int DATA = 1;
41      
42      /*** Constant returned by the getItemType method for data items that are 
43       * IEntity objects defined by a IEntityDescriptor object.
44       */
45      public static final int ENTITY = 2;
46      
47      /*** Constant returned by the getItemType method for data items that are 
48       * a selection of IEntity objects defined by a IEntityDescriptor object.
49       */
50      public static final int SELECTION = 3;
51      
52      // Methods -----------------------------------------------------------------
53      
54      /*** This method returns the number of data item objects that are
55       * defined by the IActionDataDescriptor object.
56       */
57      public int getItemCount();
58      
59      /*** This method returns the item type of the indexed data item
60       * defined by the IActionDataDescriptor object.
61       */
62      public int getItemType(int index);
63      
64      /*** Returns the DataType of the indexed data item if that item is of the 
65       * type DATA otherwise null is returned.
66       */
67      public DataType getDataType(int index);
68      
69      /*** Returns the DataType of the indexed data item if that item is of the 
70       * type ENTITY or SELECTION otherwise null is returned.
71       */
72      public IEntityDescriptor getEntityDescriptor(int index);
73      
74      /*** Access method that returns the code name that can be used to identify
75       * the indexed data item.
76       */
77      public String getCodeName(int index);
78      
79      /*** Access method that returns a end-user presentable name that can be used 
80       * as button and meny labels for the indexed data item.
81       */
82      public String getDisplayName(int index);
83      
84      /*** Access method that returns a end-user presentable hint text that can be 
85       * used as a help text or fly-by hint.
86       */
87      public String getDisplayHint(int index);
88      
89      /*** Help method that returns the indexed of the named data item. If the
90       * code name can not be identified then a negative value is returned.
91       */
92      public int getItemIndex(String codeName);
93  
94      /*** Action method that creates IActionData object for the called ActionData-
95       * Descriptor. The created IActionData will be defined by the called
96       * IActionDataDescriptor and will only be complete if it contains all data
97       * specified by that descriptor.
98       */
99      public IDataBundle createActionData();
100     
101     /*** Help method that validates the provided IActionData object. The data
102      * object must have called descriptor as its defining descriptor or an
103      * IllegalArgumentException exception is thrown.
104      */
105     public ValidationResult validateData(IDataBundle actionData);
106     
107 }