Interface IRequestableComponent
-
- All Known Subinterfaces:
IRequestablePage
- All Known Implementing Classes:
AbstractCheckSelector,AbstractChoice,AbstractErrorPage,AbstractItem,AbstractLink,AbstractOutputTransformerContainer,AbstractPageableView,AbstractRepeater,AbstractSingleSelectChoice,AbstractSubmitLink,AbstractTextComponent,AccessDeniedPage,AjaxButton,AjaxCheckBox,AjaxFallbackButton,AjaxFallbackLink,AjaxLink,AjaxPagingNavigation,AjaxPagingNavigationIncrementLink,AjaxPagingNavigationLink,AjaxPagingNavigator,AjaxSubmitLink,Audio,AutoLabelResolver.AutoLabel,AutoLinkResolver.AutolinkBookmarkablePageLink,BaseWicketTester.StartComponentInPage,Body,BookmarkablePageLink,Border,Border.BorderBodyContainer,BorderPanel,BrowserInfoForm,BrowserInfoPage,Button,Check,CheckBox,CheckBoxMultipleChoice,CheckboxMultipleChoiceSelector,CheckBoxSelector,CheckGroup,CheckGroupSelector,ClientSideImageMap,Component,ComponentFeedbackPanel,ContextImage,DataView,DataViewBase,DownloadLink,DropDownChoice,DummyHomePage,DummyHomePage.TestLink,DummyPanelPage,EmailTextField,EmptyPanel,Enclosure,EnclosureContainer,EnumLabel,ExceptionErrorPage,ExternalImage,ExternalLink,ExternalSource,FeedbackPanel,FencedFeedbackPanel,FileUploadField,Form,FormComponent,FormComponentFeedbackBorder,FormComponentFeedbackIndicator,FormComponentLabel,FormComponentPanel,Fragment,GenericPanel,GenericWebMarkupContainer,GenericWebPage,GridView,HeaderPartContainer,HeaderResponseContainer,HiddenField,HtmlHeaderContainer,HtmlHeaderItemsContainer,Image,ImageButton,Include,InlineEnclosure,InlineFrame,InlineImage,InternalErrorPage,Item,Label,LabeledWebMarkupContainer,Link,ListChoice,ListItem,ListMultipleChoice,ListView,Loop,LoopItem,MarkupContainer,MediaComponent,MockHomePage,MultiFileUploadField,MultiLineLabel,NonCachingImage,NoopOutputTransformerContainer,NumberTextField,OddEvenItem,OddEvenListItem,Page,PageableListView,PageExpiredErrorPage,PageView,PagingNavigation,PagingNavigationIncrementLink,PagingNavigationLink,PagingNavigator,Panel,PasswordTextField,Picture,PopupCloseLink,PopupCloseLink.ClosePopupPage,PropertyListView,Radio,RadioChoice,RadioGroup,RangeTextField,RedirectPage,RefreshingView,RepeatingView,RequiredTextField,ResourceLink,SimpleFormComponentLabel,Source,Source,StatelessForm,StatelessLink,SubmitLink,TextArea,TextField,Track,TransparentWebMarkupContainer,UrlTextField,Video,WebComponent,WebMarkupContainer,WebPage,XsltOutputTransformerContainer
public interface IRequestableComponentBase interface for components. The purpose of this interface is to make certain parts of Wicket easier to mock and unit test.- Author:
- Matej Knopp
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanCallListenerAfterExpiry()voiddetach()Detaches the component.IRequestableComponentget(java.lang.String path)Gets the component at the given path.BehaviorgetBehaviorById(int id)Gets the behavior for the specified idintgetBehaviorId(Behavior behavior)Gets a stable id for the specified behavior.java.lang.StringgetId()Gets the id of this component.IRequestablePagegetPage()Returns page this component belongs to.java.lang.StringgetPageRelativePath()Gets this component's path.
-
-
-
Method Detail
-
getPageRelativePath
java.lang.String getPageRelativePath()
Gets this component's path.- Returns:
- Colon separated path to this component in the component hierarchy
-
getId
java.lang.String getId()
Gets the id of this component.- Returns:
- The id of this component
-
getPage
IRequestablePage getPage() throws WicketRuntimeException
Returns page this component belongs to.- Returns:
- The page holding this component
- Throws:
WicketRuntimeException- Thrown if component is not yet attached to a Page.
-
get
IRequestableComponent get(java.lang.String path)
Gets the component at the given path.- Parameters:
path- Path to component- Returns:
- The component at the path
-
getBehaviorId
int getBehaviorId(Behavior behavior)
Gets a stable id for the specified behavior. The id remains stable from the point this method is first called for the behavior until the behavior has been removed from the component- Parameters:
behavior-- Returns:
- a stable id for the specified behavior
-
getBehaviorById
Behavior getBehaviorById(int id)
Gets the behavior for the specified id- Parameters:
id-- Returns:
- behavior or
nullif none - Throws:
InvalidBehaviorIdException- when behavior with this id cannot be found
-
detach
void detach()
Detaches the component.NOTE: this method is not inherited from
IDetachableon purpose. in Wicket the assumption for a long time has been thatComponents do not implementIDetachable; doing so may lead to some very nasty side-effects. ConsiderAbstractPropertyModel#detach()which looks like this:public void detach() { // Detach nested object if it's a detachable if (target instanceof IDetachable) { ((IDetachable)target).detach(); } }If the model was constructed thusly, which is quite common:new PropertyModel(this, "person")andComponentimplementedIDetachablethen calling @{code model.detach()} will cause an infinite loop with the model trying to detach the component and the component trying to detach the model.
-
canCallListenerAfterExpiry
boolean canCallListenerAfterExpiry()
- Returns:
trueif it is save to call anIRequestListeneron this component when the owner page is freshly created after expiration
-
-