@Target(value={TYPE,METHOD}) public @interface TabInfo
container()
parameter is mandatory. This annotation can be used in one of three ways:
1) Annotating the proxylabel()
parameter must be specified. For example:
If this presenter is not a place then you also need to specify the@
ProxyCodeSplit@
NameToken("HOME")@
TabInfo( container = TabStripPresenter.class, priority = 0, label = "Home Page" ) public interface MyProxy extends TabContentProxyPlace<HomeTabPresenter> { }
nameToken()
parameter. This is useful for setting up nested tab panels, for example:
2) Annotating a static method returning@
ProxyCodeSplit@
TabInfo( container = TabStripPresenter.class, priority = 1, nameToken = "SETTINGS-USER") public interface MyProxy extends TabContentProxy<SettingsTabStripPresenter> { }
String
String
, in which case you must
not specify the label()
. Again, specify the nameToken()
parameter only
if your presenter is not a place.
The method you annotate can optionally accept exactly 1 parameter having the type
of your custom Ginjector
. Here's an example of
this usage:
3) Annotating a static method returning@
ProxyCodeSplit@
NameToken("HOME") public interface MyProxy extends TabContentProxyPlace<HomeTabPresenter> { }@
TabInfo( container = TabStripPresenter.class, priority = 0 ) static String getLabel(MyGingector ginjector) { return gingector.getTranslations().homePageLabel(); }
TabData
TabData
,
in which case you must not specify either the label()
nor the priority()
.
Again, specify the nameToken()
parameter only if your presenter is not a place.
The method you annotate can optionally accept parameters having either the type
of your custom Ginjector
or any type that is provided by
the ginjector. Here are two examples of this usage:
@
ProxyCodeSplit public interface MyProxy extends TabContentProxy<SettingsTabStripPresenter> { }@
TabInfo( container = TabStripPresenter.class, priority = 1, nameToken = "SETTINGS-USER") static TabData getTabData(MyGingector ginjector) { return ginjector.getTabDataFactory().createUserTabData(); }
@
TabInfo(container = ApplicationPresenter.class)
static TabData getTabData(Messages msgs, IsAdminGateKeeper keeper) {
return new TabDataExt(msgs.adminTitle(), 1000, keeper);;
}
Modifier and Type | Required Element and Description |
---|---|
Class<? extends TabContainerPresenter<?,?>> |
container
This parameter indicates the presenter into which this tab will be
displayed.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
label
A static string corresponding to the label to display on the tab.
|
String |
nameToken
The name token indicates which place should be visited when you click
on this tab.
|
int |
priority
The priority is a non-negative integer that controls the order
in which tabs are displayed.
|
public abstract Class<? extends TabContainerPresenter<?,?>> container
public abstract String label
TabInfo
annotation.public abstract int priority
TabData.getPriority()
.public abstract String nameToken
Copyright © 2010–2014 Arcbees. All rights reserved.