Interface IRequestableComponent
-
- All Known Subinterfaces:
IRequestablePage
- All Known Implementing Classes:
AbstractCheckSelector
,AbstractChoice
,AbstractDataGridView
,AbstractErrorPage
,AbstractFilter
,AbstractItem
,AbstractLink
,AbstractOptions
,AbstractOutputTransformerContainer
,AbstractPageableView
,AbstractRepeater
,AbstractSingleSelectChoice
,AbstractSubmitLink
,AbstractTextComponent
,AbstractToolbar
,AbstractTree
,AccessDeniedPage
,AjaxButton
,AjaxCheckBox
,AjaxEditableChoiceLabel
,AjaxEditableLabel
,AjaxEditableMultiLineLabel
,AjaxFallbackButton
,AjaxFallbackDefaultDataTable
,AjaxFallbackHeadersToolbar
,AjaxFallbackLink
,AjaxFallbackOrderByBorder
,AjaxLazyLoadPanel
,AjaxLink
,AjaxListPanel
,AjaxNavigationToolbar
,AjaxOrderByLink
,AjaxPagingNavigation
,AjaxPagingNavigationIncrementLink
,AjaxPagingNavigationLink
,AjaxPagingNavigator
,AjaxSubmitLink
,AjaxTabbedPanel
,AjaxWizardButtonBar
,ApplicationView
,Audio
,AutoCompleteTextField
,AutoLabelResolver.AutoLabel
,AutoLinkResolver.AutolinkBookmarkablePageLink
,BaseWicketTester.StartComponentInPage
,Body
,BookmarkablePageLink
,Border
,Border.BorderBodyContainer
,BorderPanel
,BranchItem
,BreadCrumbBar
,BreadCrumbBar.BreadCrumbsListView
,BreadCrumbLink
,BreadCrumbPanel
,BreadCrumbPanelLink
,BrowserInfoForm
,BrowserInfoPage
,Button
,CancelButton
,Check
,CheckBox
,CheckBoxMultipleChoice
,CheckboxMultipleChoiceSelector
,CheckBoxSelector
,CheckedFolder
,CheckFolder
,CheckGroup
,CheckGroupSelector
,ChoiceFilter
,Choices
,ClientSideImageMap
,ColGroup
,ColGroup.Col
,Component
,ComponentFeedbackPanel
,ContextImage
,DataGridView
,DataTable
,DataTable.Caption
,DataView
,DataViewBase
,DateTextField
,DebugBar
,DefaultCssAutoCompleteTextField
,DefaultDataTable
,DefaultNestedTree
,DefaultTableTree
,DevUtilsPage
,DevUtilsPanel
,DownloadLink
,DropDownChoice
,DummyHomePage
,DummyHomePage.TestLink
,DummyPanelPage
,DynamicWizardStep
,EmailTextField
,EmptyPanel
,Enclosure
,EnclosureContainer
,EnhancedPageView
,EnumLabel
,ExceptionErrorPage
,ExportToolbar
,ExternalImage
,ExternalLink
,ExternalSource
,FeedbackPanel
,FencedFeedbackPanel
,FileUploadField
,FilterForm
,FilterToolbar
,FinishButton
,Folder
,Form
,FormComponent
,FormComponentFeedbackBorder
,FormComponentFeedbackIndicator
,FormComponentLabel
,FormComponentPanel
,Fragment
,GenericPanel
,GenericWebMarkupContainer
,GenericWebPage
,GoAndClearFilter
,GoFilter
,GridView
,GroupedDropDownChoice
,HeaderPartContainer
,HeaderResponseContainer
,HeadersToolbar
,HiddenField
,HtmlHeaderContainer
,HtmlHeaderItemsContainer
,Image
,ImageButton
,Include
,IndicatingAjaxButton
,IndicatingAjaxFallbackLink
,IndicatingAjaxLink
,InlineEnclosure
,InlineFrame
,InlineImage
,InspectorDebugPanel
,InspectorPage
,InternalErrorPage
,Item
,KittenCaptchaPanel
,Label
,LabeledWebMarkupContainer
,LastButton
,Link
,ListChoice
,ListItem
,ListMultipleChoice
,ListView
,LiveSessionsPage
,LocalDateTextField
,LocalDateTimeField
,LocalDateTimeTextField
,LocalTimeTextField
,Loop
,LoopItem
,MarkupContainer
,MediaComponent
,MockHomePage
,ModalDialog
,ModalWindow
,MultiFileUploadField
,MultiLineLabel
,NavigationToolbar
,NavigatorLabel
,NestedTree
,NextButton
,Node
,NoFilter
,NonCachingImage
,NoopOutputTransformerContainer
,NoRecordsToolbar
,NumberTextField
,OddEvenItem
,OddEvenListItem
,OrderByBorder
,OrderByLink
,Page
,PageableListView
,PageExpiredErrorPage
,PageStoreDebugPanel
,PageStorePage
,PageView
,PagingNavigation
,PagingNavigationIncrementLink
,PagingNavigationLink
,PagingNavigator
,Palette
,Panel
,PasswordTextField
,PersistedPanel
,Picture
,PopupCloseLink
,PopupCloseLink.ClosePopupPage
,PreviousButton
,PropertyListView
,Radio
,RadioChoice
,RadioGroup
,RangeTextField
,RatingPanel
,Recorder
,RedirectPage
,RefreshingView
,RepeatingView
,RequestsPage
,RequiredTextField
,ResourceLink
,Select
,Selection
,SelectOption
,SelectOptions
,SessionSizeDebugPanel
,SessionView
,SignInPage
,SignInPanel
,SignInPanel.SignInForm
,SignOutPage
,SimpleFormComponentLabel
,SmartLinkLabel
,SmartLinkMultiLineLabel
,Source
,Source
,StandardDebugPanel
,StatelessForm
,StatelessLink
,StaticContentStep
,StyledLinkLabel
,SubmitLink
,Subtree
,TabbedPanel
,TableTree
,TextArea
,TextField
,TextFilter
,TimeField
,Track
,TransparentWebMarkupContainer
,UploadProgressBar
,UrlTextField
,Video
,WebComponent
,WebMarkupContainer
,WebPage
,Wizard
,WizardButton
,WizardButtonBar
,WizardStep
,XsltOutputTransformerContainer
,ZonedDateTimeField
public interface IRequestableComponent
Base 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 boolean
canCallListenerAfterExpiry()
void
detach()
Detaches the component.IRequestableComponent
get(String path)
Gets the component at the given path.Behavior
getBehaviorById(int id)
Gets the behavior for the specified idint
getBehaviorId(Behavior behavior)
Gets a stable id for the specified non-temporary behavior.String
getId()
Gets the id of this component.IRequestablePage
getPage()
Returns page this component belongs to.String
getPageRelativePath()
Gets this component's path.
-
-
-
Method Detail
-
getPageRelativePath
String getPageRelativePath()
Gets this component's path.- Returns:
- Colon separated path to this component in the component hierarchy
-
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(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 non-temporary 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. This includes from one request to the next, when the component itself is retained for the next request (i.e. is stateful). Note that the bookkeeping required for these stable ids increases the memory footprint of the component.- Parameters:
behavior
-- Returns:
- a stable id for the specified behavior
- Throws:
IllegalArgumentException
- when the behavior is temporary
-
getBehaviorById
Behavior getBehaviorById(int id)
Gets the behavior for the specified id- Parameters:
id
-- Returns:
- behavior or
null
if none - Throws:
InvalidBehaviorIdException
- when behavior with this id cannot be found
-
detach
void detach()
Detaches the component.NOTE: this method is not inherited from
IDetachable
on purpose. in Wicket the assumption for a long time has been thatComponent
s 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")
andComponent
implementedIDetachable
then 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:
true
if it is save to call anIRequestListener
on this component when the owner page is freshly created after expiration
-
-