| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Component |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2007 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 1.0 (the | |
| 5 | * "License"); you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl1.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
| 13 | * License for the specific language governing permissions and limitations under | |
| 14 | * the License. | |
| 15 | */ | |
| 16 | package org.kuali.rice.krad.uif.core; | |
| 17 | ||
| 18 | import org.kuali.rice.krad.uif.container.View; | |
| 19 | import org.kuali.rice.krad.uif.modifier.ComponentModifier; | |
| 20 | import org.kuali.rice.krad.uif.service.ViewHelperService; | |
| 21 | ||
| 22 | import java.io.Serializable; | |
| 23 | import java.util.List; | |
| 24 | import java.util.Map; | |
| 25 | import java.util.Set; | |
| 26 | ||
| 27 | /** | |
| 28 | * All classes of the UIF that are used as a rendering element implement the | |
| 29 | * component interface. This interface defines basic properties and methods that | |
| 30 | * all such classes much implement. All components within the framework have the | |
| 31 | * following structure: | |
| 32 | * <ul> | |
| 33 | * <li>Dictionary Configuration/Composition</li> | |
| 34 | * <li>Java Class (the Component implementation</li> | |
| 35 | * <li>>JSP Template Renderer</li> | |
| 36 | * </ul> | |
| 37 | * | |
| 38 | * There are three basic types of components: | |
| 39 | * <ul> | |
| 40 | * <li>Container Components: <code>View</code>, <code>Group</code></li> | |
| 41 | * <li>Field Components: <code>Field</code></li> | |
| 42 | * <li>Widget Components: <code>Widget</code></li> | |
| 43 | * </ul> | |
| 44 | * | |
| 45 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 46 | * @see org.kuali.rice.krad.uif.container.Container | |
| 47 | * @see org.kuali.rice.krad.uif.field.Field | |
| 48 | * @see org.kuali.rice.krad.uif.widget.Widget | |
| 49 | */ | |
| 50 | public interface Component extends Serializable, Ordered, ScriptEventSupport { | |
| 51 | ||
| 52 | /** | |
| 53 | * The unique id (within a given tree) for the component | |
| 54 | * | |
| 55 | * <p> | |
| 56 | * The id will be used by renderers to set the HTML element id. This gives a | |
| 57 | * way to find various elements for scripting. If the id is not given, a | |
| 58 | * default will be generated by the framework | |
| 59 | * </p> | |
| 60 | * | |
| 61 | * @return String id | |
| 62 | */ | |
| 63 | public String getId(); | |
| 64 | ||
| 65 | /** | |
| 66 | * Sets the unique id (within a given tree) for the component | |
| 67 | * | |
| 68 | * @param id - string to set as the component id | |
| 69 | */ | |
| 70 | public void setId(String id); | |
| 71 | ||
| 72 | /** | |
| 73 | * The name for the component type | |
| 74 | * | |
| 75 | * <p> | |
| 76 | * This is used within the rendering layer to pass the component instance | |
| 77 | * into the template. The component instance is exported under the name | |
| 78 | * given by this method. | |
| 79 | * </p> | |
| 80 | * | |
| 81 | * @return String type name | |
| 82 | */ | |
| 83 | public String getComponentTypeName(); | |
| 84 | ||
| 85 | /** | |
| 86 | * The path to the JSP file that should be called to render the component | |
| 87 | * | |
| 88 | * <p> | |
| 89 | * The path should be relative to the web root. An attribute will be | |
| 90 | * available to the component to use under the name given by the method | |
| 91 | * <code>getComponentTypeName</code>. Based on the component type, | |
| 92 | * additional attributes could be available for use. See the component | |
| 93 | * documentation for more information on such attributes. | |
| 94 | * </p> | |
| 95 | * | |
| 96 | * <p> | |
| 97 | * e.g. '/krad/WEB-INF/jsp/tiles/component.jsp' | |
| 98 | * </p> | |
| 99 | * | |
| 100 | * @return String representing the template path | |
| 101 | */ | |
| 102 | public String getTemplate(); | |
| 103 | ||
| 104 | /** | |
| 105 | * Setter for the components template | |
| 106 | * | |
| 107 | * @param template | |
| 108 | */ | |
| 109 | public void setTemplate(String template); | |
| 110 | ||
| 111 | /** | |
| 112 | * A title for the component. Depending on the component can be used in | |
| 113 | * various ways. For example with a Container component the title is used to | |
| 114 | * set the header text. For components like controls other other components | |
| 115 | * that render an HTML element it is used to set the HTML title attribute | |
| 116 | * | |
| 117 | * @return String title for component | |
| 118 | */ | |
| 119 | public String getTitle(); | |
| 120 | ||
| 121 | /** | |
| 122 | * Setter for the components title | |
| 123 | * | |
| 124 | * @param title | |
| 125 | */ | |
| 126 | public void setTitle(String title); | |
| 127 | ||
| 128 | /** | |
| 129 | * Should be called to initialize the component | |
| 130 | * | |
| 131 | * <p> | |
| 132 | * Where components can set defaults and setup other necessary state. The | |
| 133 | * initialize method should only be called once per component lifecycle and | |
| 134 | * is invoked within the initialize phase of the view lifecylce. | |
| 135 | * </p> | |
| 136 | * | |
| 137 | * @param view - view instance in which the component belongs | |
| 138 | * @see ViewHelperService#initializeComponent | |
| 139 | */ | |
| 140 | public void performInitialization(View view); | |
| 141 | ||
| 142 | /** | |
| 143 | * Called after the initialize phase to perform conditional logic based on | |
| 144 | * the model data | |
| 145 | * | |
| 146 | * <p> | |
| 147 | * Where components can perform conditional logic such as dynamically | |
| 148 | * generating new fields or setting field state based on the given data | |
| 149 | * </p> | |
| 150 | * | |
| 151 | * @param view - view instance to which the component belongs | |
| 152 | * @param model - Top level object containing the data (could be the form or a | |
| 153 | * top level business object, dto) | |
| 154 | */ | |
| 155 | public void performApplyModel(View view, Object model, Component parent); | |
| 156 | ||
| 157 | /** | |
| 158 | * The last phase before the view is rendered. Here final preparations can | |
| 159 | * be made based on the updated view state | |
| 160 | * | |
| 161 | * @param view - view instance that should be finalized for rendering | |
| 162 | * @param model - top level object containing the data | |
| 163 | * @param parent - parent component | |
| 164 | */ | |
| 165 | public void performFinalize(View view, Object model, Component parent); | |
| 166 | ||
| 167 | /** | |
| 168 | * List of components that are contained within the component | |
| 169 | * | |
| 170 | * <p> | |
| 171 | * Used by <code>ViewHelperService</code> for the various lifecycle | |
| 172 | * callbacks | |
| 173 | * </p> | |
| 174 | * | |
| 175 | * @return List<Component> child components | |
| 176 | */ | |
| 177 | public List<Component> getNestedComponents(); | |
| 178 | ||
| 179 | /** | |
| 180 | * <code>ComponentModifier</code> instances that should be invoked to | |
| 181 | * initialize the component | |
| 182 | * | |
| 183 | * <p> | |
| 184 | * These provide dynamic initialization behavior for the component and are | |
| 185 | * configured through the components definition. Each initializer will get | |
| 186 | * invoked by the initialize method. | |
| 187 | * </p> | |
| 188 | * | |
| 189 | * @return List of component modifiers | |
| 190 | * @see ViewHelperService#initializeComponent | |
| 191 | */ | |
| 192 | public List<ComponentModifier> getComponentModifiers(); | |
| 193 | ||
| 194 | /** | |
| 195 | * Setter for the components List of <code>ComponentModifier</code> | |
| 196 | * instances | |
| 197 | * | |
| 198 | * @param componentModifiers | |
| 199 | */ | |
| 200 | public void setComponentModifiers(List<ComponentModifier> componentModifiers); | |
| 201 | ||
| 202 | /** | |
| 203 | * Used by the copy process to determine for which properties only the value | |
| 204 | * reference should be copied (not a new copy instance). Subclasses can | |
| 205 | * define the properties for which only the reference should be copied | |
| 206 | * | |
| 207 | * @return Set<String> property names for which only the value reference | |
| 208 | * should be copied | |
| 209 | * @see org.kuali.rice.krad.uif.util.ComponentUtils.copy(T) | |
| 210 | */ | |
| 211 | public Set<String> getPropertiesForReferenceCopy(); | |
| 212 | ||
| 213 | /** | |
| 214 | * Indicates whether the component should be rendered in the UI | |
| 215 | * | |
| 216 | * <p> | |
| 217 | * If set to false, the corresponding component template will not be invoked | |
| 218 | * (therefore nothing will be rendered to the UI). | |
| 219 | * </p> | |
| 220 | * | |
| 221 | * @return boolean true if the component should be rendered, false if it | |
| 222 | * should not be | |
| 223 | */ | |
| 224 | public boolean isRender(); | |
| 225 | ||
| 226 | /** | |
| 227 | * Setter for the components render indicator | |
| 228 | * | |
| 229 | * @param render | |
| 230 | */ | |
| 231 | public void setRender(boolean render); | |
| 232 | ||
| 233 | /** | |
| 234 | * Expression language string for conditionally setting the render property | |
| 235 | * | |
| 236 | * @return String el that should evaluate to boolean | |
| 237 | */ | |
| 238 | public String getConditionalRender(); | |
| 239 | ||
| 240 | /** | |
| 241 | * Setter for the conditional render string | |
| 242 | * | |
| 243 | * @param conditionalRender | |
| 244 | */ | |
| 245 | public void setConditionalRender(String conditionalRender); | |
| 246 | ||
| 247 | /** | |
| 248 | * Indicates whether the component should be hidden in the UI | |
| 249 | * | |
| 250 | * <p> | |
| 251 | * How the hidden data is maintained depends on the views persistence mode. | |
| 252 | * If the mode is request, the corresponding data will be rendered to the UI | |
| 253 | * but not visible. If the mode is session, the data will not be rendered to | |
| 254 | * the UI but maintained server side. | |
| 255 | * </p> | |
| 256 | * | |
| 257 | * <p> | |
| 258 | * For a <code>Container</code> component, the hidden setting will apply to | |
| 259 | * all contained components (making a section hidden makes all fields within | |
| 260 | * the section hidden) | |
| 261 | * </p> | |
| 262 | * | |
| 263 | * @return boolean true if the component should be hidden, false if it | |
| 264 | * should be visible | |
| 265 | */ | |
| 266 | public boolean isHidden(); | |
| 267 | ||
| 268 | /** | |
| 269 | * Setter for the hidden indicator | |
| 270 | * | |
| 271 | * @param hidden | |
| 272 | */ | |
| 273 | public void setHidden(boolean hidden); | |
| 274 | ||
| 275 | /** | |
| 276 | * Indicates whether the component can be edited | |
| 277 | * | |
| 278 | * <p> | |
| 279 | * When readOnly the controls and widgets of <code>Field</code> components | |
| 280 | * will not be rendered. If the Field has an underlying value it will be | |
| 281 | * displayed readOnly to the user. | |
| 282 | * </p> | |
| 283 | * | |
| 284 | * <p> | |
| 285 | * For a <code>Container</code> component, the readOnly setting will apply | |
| 286 | * to all contained components (making a section readOnly makes all fields | |
| 287 | * within the section readOnly) | |
| 288 | * </p> | |
| 289 | * </p> | |
| 290 | * | |
| 291 | * @return boolean true if the component should be readOnly, false if is | |
| 292 | * allows editing | |
| 293 | */ | |
| 294 | public boolean isReadOnly(); | |
| 295 | ||
| 296 | /** | |
| 297 | * Setter for the read only indicator | |
| 298 | * | |
| 299 | * @param readOnly | |
| 300 | */ | |
| 301 | public void setReadOnly(boolean readOnly); | |
| 302 | ||
| 303 | /** | |
| 304 | * Expression language string for conditionally setting the readOnly | |
| 305 | * property | |
| 306 | * | |
| 307 | * @return String el that should evaluate to boolean | |
| 308 | */ | |
| 309 | public String getConditionalReadOnly(); | |
| 310 | ||
| 311 | /** | |
| 312 | * Setter for the conditional readOnly string | |
| 313 | * | |
| 314 | * @param conditionalReadOnly | |
| 315 | */ | |
| 316 | public void setConditionalReadOnly(String conditionalReadOnly); | |
| 317 | ||
| 318 | /** | |
| 319 | * Indicates whether the component is required | |
| 320 | * | |
| 321 | * <p> | |
| 322 | * At the general component level required means there is some action the | |
| 323 | * user needs to take within the component. For example, within a section it | |
| 324 | * might mean the fields within the section should be completed. At a field | |
| 325 | * level, it means the field should be completed. This provides the ability | |
| 326 | * for the renderers to indicate the required action. | |
| 327 | * </p> | |
| 328 | * | |
| 329 | * @return boolean true if the component is required, false if it is not | |
| 330 | * required | |
| 331 | */ | |
| 332 | public Boolean getRequired(); | |
| 333 | ||
| 334 | /** | |
| 335 | * Setter for the required indicator | |
| 336 | * | |
| 337 | * @param required | |
| 338 | */ | |
| 339 | public void setRequired(Boolean required); | |
| 340 | ||
| 341 | /** | |
| 342 | * CSS style string to be applied to the component | |
| 343 | * | |
| 344 | * <p> | |
| 345 | * Any style override or additions can be specified with this attribute. | |
| 346 | * This is used by the renderer to set the style attribute on the | |
| 347 | * corresponding element. | |
| 348 | * </p> | |
| 349 | * | |
| 350 | * <p> | |
| 351 | * e.g. 'color: #000000;text-decoration: underline;' | |
| 352 | * </p> | |
| 353 | * | |
| 354 | * @return String css style string | |
| 355 | */ | |
| 356 | public String getStyle(); | |
| 357 | ||
| 358 | /** | |
| 359 | * Setter for the components style | |
| 360 | * | |
| 361 | * @param style | |
| 362 | */ | |
| 363 | public void setStyle(String style); | |
| 364 | ||
| 365 | /** | |
| 366 | * CSS style class(s) to be applied to the component | |
| 367 | * | |
| 368 | * <p> | |
| 369 | * Declares style classes for the component. Multiple classes are specified | |
| 370 | * with a space delimiter. This is used by the renderer to set the class | |
| 371 | * attribute on the corresponding element. The class(s) declared must be | |
| 372 | * available in the common style sheets or the style sheets specified for | |
| 373 | * the view | |
| 374 | * </p> | |
| 375 | * | |
| 376 | * <p> | |
| 377 | * e.g. 'header left' | |
| 378 | * </p> | |
| 379 | * | |
| 380 | * @return List<String> css style classes to apply | |
| 381 | */ | |
| 382 | public List<String> getStyleClasses(); | |
| 383 | ||
| 384 | /** | |
| 385 | * Setter for the components style classes | |
| 386 | * | |
| 387 | * @param styleClass | |
| 388 | */ | |
| 389 | public void setStyleClasses(List<String> styleClasses); | |
| 390 | ||
| 391 | /** | |
| 392 | * Adds a single style to the list of styles on this component | |
| 393 | * | |
| 394 | * @param style | |
| 395 | */ | |
| 396 | public void addStyleClass(String styleClass); | |
| 397 | ||
| 398 | /** | |
| 399 | * TODO: javadoc | |
| 400 | * | |
| 401 | * @param itemStyle | |
| 402 | */ | |
| 403 | public void appendToStyle(String itemStyle); | |
| 404 | ||
| 405 | /** | |
| 406 | * Number of places the component should take up horizontally in the | |
| 407 | * container | |
| 408 | * | |
| 409 | * <p> | |
| 410 | * All components belong to a <code>Container</code> and are placed using a | |
| 411 | * <code>LayoutManager</code>. This property specifies how many places | |
| 412 | * horizontally the component should take up within the container. This is | |
| 413 | * only applicable for table based layout managers. Default is 1 | |
| 414 | * </p> | |
| 415 | * | |
| 416 | * TODO: this should not be on component interface since it only applies if | |
| 417 | * the layout manager supports it, need some sort of layoutOptions map for | |
| 418 | * field level options that depend on the manager | |
| 419 | * | |
| 420 | * @return int number of columns to span | |
| 421 | */ | |
| 422 | public int getColSpan(); | |
| 423 | ||
| 424 | /** | |
| 425 | * Setter for the components column span | |
| 426 | * | |
| 427 | * @param colSpan | |
| 428 | */ | |
| 429 | public void setColSpan(int colSpan); | |
| 430 | ||
| 431 | /** | |
| 432 | * Number of places the component should take up vertically in the container | |
| 433 | * | |
| 434 | * <p> | |
| 435 | * All components belong to a <code>Container</code> and are placed using a | |
| 436 | * <code>LayoutManager</code>. This property specifies how many places | |
| 437 | * vertically the component should take up within the container. This is | |
| 438 | * only applicable for table based layout managers. Default is 1 | |
| 439 | * </p> | |
| 440 | * | |
| 441 | * TODO: this should not be on component interface since it only applies if | |
| 442 | * the layout manager supports it, need some sort of layoutOptions map for | |
| 443 | * field level options that depend on the manager | |
| 444 | * | |
| 445 | * @return int number of rows to span | |
| 446 | */ | |
| 447 | public int getRowSpan(); | |
| 448 | ||
| 449 | /** | |
| 450 | * Setter for the component row span | |
| 451 | * | |
| 452 | * @param rowSpan | |
| 453 | */ | |
| 454 | public void setRowSpan(int rowSpan); | |
| 455 | ||
| 456 | /** | |
| 457 | * Context map for the component | |
| 458 | * | |
| 459 | * <p> | |
| 460 | * Any el statements configured for the components properties (e.g. | |
| 461 | * title="@{foo.property}") are evaluated using the el context map. This map | |
| 462 | * will get populated with default objects like the model, view, and request | |
| 463 | * from the <code>ViewHelperService</code>. Other components can push | |
| 464 | * further objects into the context so that they are available for use with | |
| 465 | * that component. For example, <code>Field</code> instances that are part | |
| 466 | * of a collection line as receive the current line instance | |
| 467 | * </p> | |
| 468 | * | |
| 469 | * <p> | |
| 470 | * Context map also provides objects to methods that are invoked for | |
| 471 | * <code>GeneratedField</code> instances | |
| 472 | * </p> | |
| 473 | * | |
| 474 | * <p> | |
| 475 | * The Map key gives the name of the variable that can be used within | |
| 476 | * expressions, and the Map value gives the object instance for which | |
| 477 | * expressions containing the variable should evaluate against | |
| 478 | * </p> | |
| 479 | * | |
| 480 | * <p> | |
| 481 | * NOTE: Calling getContext().putAll() will skip updating any configured property replacers for the | |
| 482 | * component. Instead you should call #pushAllToContext | |
| 483 | * </p> | |
| 484 | * | |
| 485 | * @return Map<String, Object> context | |
| 486 | */ | |
| 487 | public Map<String, Object> getContext(); | |
| 488 | ||
| 489 | /** | |
| 490 | * Setter for the context Map | |
| 491 | * | |
| 492 | * @param context | |
| 493 | */ | |
| 494 | public void setContext(Map<String, Object> context); | |
| 495 | ||
| 496 | /** | |
| 497 | * Places the given object into the context Map for the component with the | |
| 498 | * given name | |
| 499 | * | |
| 500 | * <p> | |
| 501 | * Note this also will push context to property replacers configured on the component. | |
| 502 | * To place multiple objects in the context, you should use #pushAllToContext since that | |
| 503 | * will call this method for each and update property replacers. Using #getContext().putAll() | |
| 504 | * will bypass property replacers. | |
| 505 | * </p> | |
| 506 | * | |
| 507 | * @param objectName - name the object should be exposed under in the context map | |
| 508 | * @param object - object instance to place into context | |
| 509 | */ | |
| 510 | public void pushObjectToContext(String objectName, Object object); | |
| 511 | ||
| 512 | /** | |
| 513 | * Places each entry of the given Map into the context for the component | |
| 514 | * | |
| 515 | * <p> | |
| 516 | * Note this will call #pushObjectToContext for each entry which will update any configured property | |
| 517 | * replacers as well. This should be used in place of getContext().putAll() | |
| 518 | * </p> | |
| 519 | * | |
| 520 | * @param objects - Map<String, Object> objects to add to context, where the entry key will be the context key | |
| 521 | * and the entry value will be the context value | |
| 522 | */ | |
| 523 | public void pushAllToContext(Map<String, Object> objects); | |
| 524 | ||
| 525 | /** | |
| 526 | * List of <code>PropertyReplacer</code> instances that will be evaluated | |
| 527 | * during the view lifecycle to conditional set properties on the | |
| 528 | * <code>Component</code> based on expression evaluations | |
| 529 | * | |
| 530 | * @return List<PropertyReplacer> replacers to evaluate | |
| 531 | */ | |
| 532 | public List<PropertyReplacer> getPropertyReplacers(); | |
| 533 | ||
| 534 | /** | |
| 535 | * Setter for the components property substitutions | |
| 536 | * | |
| 537 | * @param propertyReplacers | |
| 538 | */ | |
| 539 | public void setPropertyReplacers(List<PropertyReplacer> propertyReplacers); | |
| 540 | ||
| 541 | /** | |
| 542 | * Options that are passed through to the Component renderer. The Map key is | |
| 543 | * the option name, with the Map value as the option value. See | |
| 544 | * documentation on the particular widget render for available options. | |
| 545 | * | |
| 546 | * @return Map<String, String> options | |
| 547 | */ | |
| 548 | public Map<String, String> getComponentOptions(); | |
| 549 | ||
| 550 | /** | |
| 551 | * Setter for the widget's options | |
| 552 | * | |
| 553 | * @param widgetOptions | |
| 554 | */ | |
| 555 | public void setComponentOptions(Map<String, String> componentOptions); | |
| 556 | ||
| 557 | /** | |
| 558 | * Can be used to order a component within a List of other components, lower | |
| 559 | * numbers are placed higher up in the list, while higher numbers are placed | |
| 560 | * lower in the list | |
| 561 | * | |
| 562 | * @return int ordering number | |
| 563 | * @see org.springframework.core.Ordered#getOrder() | |
| 564 | */ | |
| 565 | public int getOrder(); | |
| 566 | ||
| 567 | /** | |
| 568 | * Setter for the component's order | |
| 569 | * | |
| 570 | * @param order | |
| 571 | */ | |
| 572 | public void setOrder(int order); | |
| 573 | ||
| 574 | /** | |
| 575 | * Name of the method that should be invoked for finalizing the component | |
| 576 | * configuration (full method name, without parameters or return type) | |
| 577 | * | |
| 578 | * <p> | |
| 579 | * Note the method can also be set with the finalizeMethodInvoker | |
| 580 | * targetMethod property. If the method is on the configured | |
| 581 | * <code>ViewHelperService</code>, only this property needs to be configured | |
| 582 | * </p> | |
| 583 | * | |
| 584 | * <p> | |
| 585 | * The model backing the view will be passed as the first argument method and then | |
| 586 | * the <code>Component</code> instance as the second argument. If any additional method | |
| 587 | * arguments are declared with the finalizeMethodAdditionalArguments, they will then | |
| 588 | * be passed in the order declared in the list | |
| 589 | * </p> | |
| 590 | * | |
| 591 | * <p> | |
| 592 | * If the component is selfRendered, the finalize method can return a string which | |
| 593 | * will be set as the component's renderOutput. The selfRendered indicator will also | |
| 594 | * be set to true on the component. | |
| 595 | * </p> | |
| 596 | * | |
| 597 | * @return String method name | |
| 598 | */ | |
| 599 | public String getFinalizeMethodToCall(); | |
| 600 | ||
| 601 | /** | |
| 602 | * List of Object instances that should be passed as arguments to the finalize method | |
| 603 | * | |
| 604 | * <p> | |
| 605 | * These arguments are passed to the finalize method after the standard model and component | |
| 606 | * arguments. They are passed in the order declared in the list | |
| 607 | * </p> | |
| 608 | * | |
| 609 | * @return List<Object> additional method arguments | |
| 610 | */ | |
| 611 | public List<Object> getFinalizeMethodAdditionalArguments(); | |
| 612 | ||
| 613 | /** | |
| 614 | * <code>MethodInvokerConfig</code> instance for the method that should be invoked | |
| 615 | * for finalizing the component configuration | |
| 616 | * | |
| 617 | * <p> | |
| 618 | * MethodInvoker can be configured to specify the class or object the method | |
| 619 | * should be called on. For static method invocations, the targetClass | |
| 620 | * property can be configured. For object invocations, that targetObject | |
| 621 | * property can be configured | |
| 622 | * </p> | |
| 623 | * | |
| 624 | * <p> | |
| 625 | * If the component is selfRendered, the finalize method can return a string which | |
| 626 | * will be set as the component's renderOutput. The selfRendered indicator will also | |
| 627 | * be set to true on the component. | |
| 628 | * </p> | |
| 629 | * | |
| 630 | * @return MethodInvokerConfig instance | |
| 631 | */ | |
| 632 | public MethodInvokerConfig getFinalizeMethodInvoker(); | |
| 633 | ||
| 634 | /** | |
| 635 | * Indicates whether the component contains its own render output (through | |
| 636 | * the renderOutput property) | |
| 637 | * | |
| 638 | * <p> | |
| 639 | * If self rendered is true, the corresponding template for the component | |
| 640 | * will not be invoked and the renderOutput String will be written to the | |
| 641 | * response as is. | |
| 642 | * </p> | |
| 643 | * | |
| 644 | * @return boolean true if component is self rendered, false if not (renders | |
| 645 | * through template) | |
| 646 | */ | |
| 647 | public boolean isSelfRendered(); | |
| 648 | ||
| 649 | /** | |
| 650 | * Setter for the self render indicator | |
| 651 | * | |
| 652 | * @param selfRendered | |
| 653 | */ | |
| 654 | public void setSelfRendered(boolean selfRendered); | |
| 655 | ||
| 656 | /** | |
| 657 | * Rendering output for the component that will be sent as part of the | |
| 658 | * response (can contain static text and HTML) | |
| 659 | * | |
| 660 | * @return String render output | |
| 661 | */ | |
| 662 | public String getRenderOutput(); | |
| 663 | ||
| 664 | /** | |
| 665 | * Setter for the component's render output | |
| 666 | * | |
| 667 | * @param renderOutput | |
| 668 | */ | |
| 669 | public void setRenderOutput(String renderOutput); | |
| 670 | ||
| 671 | /** | |
| 672 | * @return the progressiveRender | |
| 673 | */ | |
| 674 | public String getProgressiveRender(); | |
| 675 | ||
| 676 | /** | |
| 677 | * @param progressiveRender the progressiveRender to set | |
| 678 | */ | |
| 679 | public void setProgressiveRender(String progressiveRender); | |
| 680 | ||
| 681 | /** | |
| 682 | * @return the conditionalRefresh | |
| 683 | */ | |
| 684 | public String getConditionalRefresh(); | |
| 685 | ||
| 686 | /** | |
| 687 | * @param conditionalRefresh the conditionalRefresh to set | |
| 688 | */ | |
| 689 | public void setConditionalRefresh(String conditionalRefresh); | |
| 690 | ||
| 691 | /** | |
| 692 | * @return the progressiveDisclosureControlNames | |
| 693 | */ | |
| 694 | public List<String> getProgressiveDisclosureControlNames(); | |
| 695 | ||
| 696 | /** | |
| 697 | * @return the progressiveDisclosureConditionJs | |
| 698 | */ | |
| 699 | public String getProgressiveDisclosureConditionJs(); | |
| 700 | ||
| 701 | /** | |
| 702 | * @return the conditionalRefreshConditionJs | |
| 703 | */ | |
| 704 | public String getConditionalRefreshConditionJs(); | |
| 705 | ||
| 706 | /** | |
| 707 | * @return the conditionalRefreshControlNames | |
| 708 | */ | |
| 709 | public List<String> getConditionalRefreshControlNames(); | |
| 710 | ||
| 711 | /** | |
| 712 | * @return the progressiveRenderViaAJAX | |
| 713 | */ | |
| 714 | public boolean isProgressiveRenderViaAJAX(); | |
| 715 | ||
| 716 | /** | |
| 717 | * @param progressiveRenderViaAJAX the progressiveRenderViaAJAX to set | |
| 718 | */ | |
| 719 | public void setProgressiveRenderViaAJAX(boolean progressiveRenderViaAJAX); | |
| 720 | ||
| 721 | /** | |
| 722 | * If true, when the progressiveRender condition is satisfied, the component | |
| 723 | * will always be retrieved from the server and shown(as opposed to being | |
| 724 | * stored on the client, but hidden, after the first retrieval as is the | |
| 725 | * case with the progressiveRenderViaAJAX option). <b>By default, this is | |
| 726 | * false, so components with progressive render capabilities will always be | |
| 727 | * already within the client html and toggled to be hidden or visible.</b> | |
| 728 | * | |
| 729 | * @return the progressiveRenderAndRefresh | |
| 730 | */ | |
| 731 | public boolean isProgressiveRenderAndRefresh(); | |
| 732 | ||
| 733 | /** | |
| 734 | * @param progressiveRenderAndRefresh the progressiveRenderAndRefresh to set | |
| 735 | */ | |
| 736 | public void setProgressiveRenderAndRefresh(boolean progressiveRenderAndRefresh); | |
| 737 | ||
| 738 | /** | |
| 739 | * Specifies a property by name that when it value changes will | |
| 740 | * automatically perform a refresh on this component. This can be a comma | |
| 741 | * separated list of multiple properties that require this component to be | |
| 742 | * refreshed when any of them change. <Br>DO NOT use with progressiveRender | |
| 743 | * unless it is know that progressiveRender condition will always be | |
| 744 | * satisfied before one of these fields can be changed. | |
| 745 | * | |
| 746 | * @return the refreshWhenChanged | |
| 747 | */ | |
| 748 | public String getRefreshWhenChanged(); | |
| 749 | ||
| 750 | /** | |
| 751 | * @param refreshWhenChanged the refreshWhenChanged to set | |
| 752 | */ | |
| 753 | public void setRefreshWhenChanged(String refreshWhenChanged); | |
| 754 | ||
| 755 | /** | |
| 756 | * Result of the conditionalRefresh expression, true if satisfied, otherwise false. | |
| 757 | * Note: not currently used for any processing, required by the expression evaluator. | |
| 758 | * | |
| 759 | * @return the refresh | |
| 760 | */ | |
| 761 | public boolean isRefresh(); | |
| 762 | ||
| 763 | /** | |
| 764 | * @param refresh the refresh to set | |
| 765 | */ | |
| 766 | public void setRefresh(boolean refresh); | |
| 767 | ||
| 768 | /** | |
| 769 | * Control names which will refresh this component when they are changed, added | |
| 770 | * internally | |
| 771 | * | |
| 772 | * @return the refreshWhenChangedControlNames | |
| 773 | */ | |
| 774 | public List<String> getRefreshWhenChangedControlNames(); | |
| 775 | ||
| 776 | /** | |
| 777 | * The original generated id assigned for the underlying Spring bean. During the component lifecycle | |
| 778 | * the id may get manipulated and changed based on the type of component it is. This id represents the original id | |
| 779 | * assigned before any additional suffixes were appended. | |
| 780 | * | |
| 781 | * @return the baseId | |
| 782 | */ | |
| 783 | public String getBaseId(); | |
| 784 | ||
| 785 | /** | |
| 786 | * @param baseId the baseId to set | |
| 787 | */ | |
| 788 | public void setBaseId(String baseId); | |
| 789 | } |