org.apache.wicket.request.component
Interface IRequestableComponent

All Known Subinterfaces:
IRequestablePage
All Known Implementing Classes:
AbstractCalendar, AbstractCheckSelector, AbstractChoice, AbstractColumnsView, AbstractDataGridView, AbstractErrorPage, AbstractFilter, AbstractItem, AbstractLink, AbstractOptions, AbstractOutputTransformerContainer, AbstractPageableView, AbstractRepeater, AbstractSingleSelectChoice, AbstractSubmitLink, AbstractTextComponent, AbstractToolbar, AbstractTree, AccessDeniedPage, AdminAnnotationsBookmarkablePage, AdminAnnotationsInternalPage, AdminBookmarkablePage, AdminInternalPage, AdminPage, AjaxButton, AjaxCheckBox, AjaxDataTablePage, AjaxEditableChoiceLabel, AjaxEditableLabel, AjaxEditableMultiLineLabel, AjaxFallbackButton, AjaxFallbackDefaultDataTable, AjaxFallbackHeadersToolbar, AjaxFallbackLink, AjaxFallbackOrderByBorder, AjaxFallbackOrderByLink, AjaxLazyLoadPanel, AjaxLink, AjaxNavigationToolbar, AjaxPagingNavigation, AjaxPagingNavigationIncrementLink, AjaxPagingNavigationLink, AjaxPagingNavigator, AjaxSubmitLink, AjaxTabbedPanel, AlternativePageFromWebContext, AnnotationsPanelsPage, AnnotPage, ApplicationView, AuthenticatedWebPage, AuthenticatedWebPage, AutoCompletePage, AutoCompleteTextField, AutoLabelResolver.AutoLabel, AutoLinkResolver.AutolinkBookmarkablePageLink, Banner, Banner1, Banner2, BasePage, BasePage, BasePage, BasePage, BasePage, BasePage, BaseTree, BaseTreePage, BaseWicketTester.StartComponentInPage, Body, BodyFrame, BookDetails, BookDetails, BookmarkablePage, BookmarkablePageLink, BookmarkablePageLinkPage, Border, Border.BorderBodyContainer, BorderPage, BorderPanel, BoxBorder, BreadCrumbBar, BreadCrumbBar.BreadCrumbsListView, BreadCrumbLink, BreadCrumbPanel, BreadCrumbPanelLink, BrowserInfoForm, BrowserInfoPage, BrowserPanel, Button, ButtonPage, CancelButton, Captcha, Check, CheckBox, CheckBoxMultipleChoice, CheckBoxMultipleChoicePage, CheckboxMultipleChoiceSelector, CheckBoxPage, CheckBoxSelector, CheckBoxSelectorPage, CheckGroup, CheckGroupPage, CheckGroupPage2, CheckGroupSelector, ChoiceFilter, ChoicePage, Choices, ClientSideImageMap, Clock, ClockPage, Component, ComponentFeedbackPanel, ContactsDisplayPage, ContextImage, DataGridPage, DataGridView, DataTable, DataTablePage, DataView, DataViewBase, DateField, DateLabel, DatesPage, DateTextField, DateTextField, DateTimeField, DebugBar, DecoupledAjaxUpdatePage, DecoupledAjaxUpdatePage.CounterLabel, DefaultAbstractTree, DefaultCssAutoCompleteTextField, DefaultDataTable, DevUtilsPage, DevUtilsPanel, DiskStoreBrowserPage, DownloadLink, DropDownChoice, DropDownChoicePage, DummyHomePage, DummyHomePage.TestLink, DummyPanelPage, DynamicPage, DynamicWizardStep, Echo, EditableLabelPage, EditablePanel, EditableTreeTablePage, EditBook, EditBook.EditBookForm, EffectsPage, EmailTextField, EmptyPanel, Enclosure, EnclosureContainer, EnumLabel, ExampleFrame, ExamplePage, ExceptionErrorPage, ExternalLink, ExternalLinkPage, FeedbackPanel, FileUploadField, FileUploadPage, FilterForm, FilterToolbar, FinishButton, FirstPanel, Form, FormComponent, FormComponentFeedbackBorder, FormComponentFeedbackIndicator, FormComponentLabel, FormComponentPanel, FormInput, FormPage, FormPage, FormPage, FourthPanel, Fragment, FragmentPage, GenericPanel, GenericWebPage, GoAndClearFilter, GoFilter, GridView, GridViewPage, Guess, GuestBook, GuestBook, GuestBook.CommentForm, GuestBook.CommentForm, HangmanPage, HeaderPartContainer, HeaderResponseFilteredResponseContainer, HeadersToolbar, HelloBrowser, HelloWorld, HiddenField, Home, Home, Home, Home, Home, Home, Home, Home, Home, Home, Home, Home, Home, Home, Home, HomePage, HomePage, HomePage, HomePage, HomePage, HomePage, HtmlHeaderContainer, HttpsPage, Image, ImageButton, Include, IncludePage, Index, Index, Index, Index, Index, Index, Index, Index, Index, Index, IndexPage, IndicatingAjaxButton, IndicatingAjaxFallbackLink, IndicatingAjaxLink, InlineEnclosure, InlineFrame, InspectorBug, InspectorDebugPanel, InspectorPage, InternalErrorPage, Item, KittenCaptchaPanel, Label, LabeledWebMarkupContainer, LabelIconPanel, LabelPage, LabelTree, LastButton, LazyLoadingPage, LeftFrame, Link, LinkIconPanel, LinkPage, LinksPage, LinkTree, ListChoice, ListChoicePage, ListItem, ListMultipleChoice, ListMultipleChoicePage, ListView, LiveSessionsPage, LocalizedPage, Loop, LoopItem, Lose, MarkupContainer, MockHomePage, ModalContent1Page, ModalContent2Page, ModalPanel1, ModalWindow, ModalWindowPage, MultiFileUploadField, MultiLineLabel, MultiLineLabelPage, Multiply, MultiUploadPage, MySignInPage, NavigationToolbar, NavigatorLabel, NavomaticBorder, NewUserWizard, NextButton, NoFilter, NonBookmarkablePage, NonCachingImage, NoopOutputTransformerContainer, NoRecordsToolbar, NumberTextField, OddEvenItem, OddEvenListItem, OIRPage, OnChangeAjaxBehaviorPage, OrderByBorder, OrderByLink, PackageMountedPage, Page, Page1, Page1, Page1, Page1, Page1, Page1, Page2, Page2, Page2, Page2, Page2, Page2, Page2QP, Page3, Page3, Page3, Page4, Page5, PageableListView, PageablesPage, PageExpiredErrorPage, PageFromWebContext, PageLinkPage, PageSizeDebugPanel, PageView, PageWithCustomLoading, PagingNavigation, PagingNavigationIncrementLink, PagingNavigationLink, PagingNavigator, PagingPage, Palette, PalettePage, Panel, Panel1, PanelPage, PanelsPage, PasswordTextField, Popup, PopupCloseLink, PopupCloseLink.ClosePopupPage, PreviousButton, PropertyListView, Radio, RadioChoice, RadioChoicePage, RadioGroup, RadioGroupPage, RadioGroupPage2, RangeTextField, RatingPanel, RatingsPage, Recorder, RecursivePanel, RedirectPage, RefreshingPage, RefreshingView, RepeatingPage, RepeatingView, RequestMapperHomePage, RequestsPage, RequiredTextField, ResourceLink, ResourceTestPage, ResultPanel, SecondPanel, Select, Selection, SelectOption, SelectOptions, SelectPage, SessionSizeDebugPanel, SessionView, SignIn, SignIn, SignIn.SignInForm, SignIn2, SignInPage, SignInPanel, SignInPanel.SignInForm, SignOut, SignOut, SignOut, SignOut, SignOutPage, SimpleFormComponentLabel, SimplePage, SimpleTreePage, SmartLinkLabel, SmartLinkMultiLineLabel, SortingPage, SourcesPage, SourcesPage.CodePanel, SourcesPage.FilesBrowser, StandardDebugPanel, StatefulPage, StatelessForm, StatelessLink, StatelessPage, StatelessPage1, StatelessPage2, StatelessPage3, StaticContentStep, StaticWizard, StaticWizardWithPanels, StockQuoteLabel, StockQuoteLabel2, StockQuotePage, SubmitLink, SubmitLinkPage, TabbedPanel, TabbedPanelPage, TabbedPanelPage, TabbedPanelPage.CssSwitchingLink, TemplateBorder, TemplatePage, TemplatePage, TemplatePanel, TextArea, TextAreaPage, TextField, TextFieldPage, TextFilter, ThirdPanel, TimeField, TodoList, TodoList.AddItemsContainer, TodoList.TodoItemsContainer, TopFrame, TransparentWebMarkupContainer, Tree, TreeTable, TreeTablePage, UnicodeConverter, UploadPage, UploadProgressBar, UrlTextField, VelocityPanel, WebComponent, WebMarkupContainer, WebPage, WicketExampleHeader, WicketExamplePage, Win, Wizard, WizardButton, WizardButtonBar, WizardPage, WizardStep, WorldClockPage, XmlPage, XsltOutputTransformerContainer

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
 boolean canCallListenerInterface()
          Returns true if the listener interface method can be called on this component.
 void detach()
          Detaches the component.
 IRequestableComponent get(java.lang.String path)
          Gets the component at the given path.
 Behavior getBehaviorById(int id)
          Gets the behavior for the specified id
 int getBehaviorId(Behavior behavior)
          Gets a stable id for the specified behavior.
 java.lang.String getId()
          Gets the id of this component.
 IRequestablePage getPage()
          Returns page this component belongs to.
 java.lang.String getPageRelativePath()
          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()
Returns page this component belongs to.

Returns:
page instance or null

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

canCallListenerInterface

boolean canCallListenerInterface()
Returns true if the listener interface method can be called on this component. Normally this would check if component is enabled and visible in hierarchy.

Returns:
true if the listener can be called, false otherwise.

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 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 that Components do not implement IDetachable; doing so may lead to some very nasty side-effects. Consider AbstractPropertyModel#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") and Component implemented IDetachable 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.



Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.