我正在利用WT MVP和UiBinder,与一家DockLayoutPanel一道制作一个信片。 我想,北部和南部的码头是固定的,有 but子和连接。 我想对中部和东部两处不同地区有积极的看法。 由于这些动态领域彼此独立,我正在为每个有活力的展示区、中心、东方和东西方建立了不同的活动管理和活动管理。
当申请装满时,我如何能够独立地启动这3个不同的展示区? 我如何能够在一个展示区从一个活动转向另一个活动,而不影响其他领域?
当我利用地方主计长前往一个地区从一个地方向另一个地方转移时,另一个地区的活动就会停止。
5月份,请帮助,或许是天!
以下是我的一些法典:
AppViewImpl.ui.xml
<g:DockLayoutPanel styleName="{style.dockPaneliii" unit="PX" width="975px" height="100%">
<!-- DOCK PANEL EAST -->
<g:east size="220">
<g:LayoutPanel styleName="{style.eastPaneliii">
<g:layer left="0px" width="220px" top="0px" height="105px">
<g:SimpleLayoutPanel ui:field="topRightPanel"/>
</g:layer>
<g:layer left="0px" width="220px" top="110px" height="340px">
<g:InlineLabel styleName="{style.labeliii" text="ANOTHER DISPLAY AREA"/>
</g:layer>
</g:LayoutPanel>
</g:east>
<!-- DOCK PANEL NORTH -->
<g:north size="110">
<g:LayoutPanel styleName="{style.northPaneliii">
<g:layer left="0px" width="755px" top="0px" height="105px">
<g:InlineLabel styleName="{style.labeliii" text="NORTH PANEL"/>
</g:layer>
</g:LayoutPanel>
</g:north>
<!-- DOCK PANEL SOUTH -->
<g:south size="20">
<g:LayoutPanel styleName="{style.southPaneliii">
<g:layer left="0px" width="755px" top="0px" height="20px">
<g:InlineLabel styleName="{style.labeliii" text="SOUTH PANEL"/>
</g:layer>
</g:LayoutPanel>
</g:south>
<!-- DOCK PANEL CENTER -->
<g:center>
<g:SimpleLayoutPanel ui:field="mainPanel" />
</g:center>
</g:DockLayoutPanel>
MyModule.java
公立学校 入口处
private Place defaultPlace = new DefaultPlace("");
public void onModuleLoad() {
// Create ClientFactory using deferred binding so we can replace with
// different impls in gwt.xml
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager for the main widget with our ActivityMapper
ActivityMapper topRightActivityMapper = new TopRightActivityMapper(clientFactory);
ActivityManager topRightActivityManager = new ActivityManager(topRightActivityMapper, eventBus);
topRightActivityManager.setDisplay(clientFactory.getAppView().getTopRightPanel());
// Start ActivityManager for the main widget with our ActivityMapper
ActivityMapper mainActivityMapper = new AppActivityMapper(clientFactory);
ActivityManager mainActivityManager = new ActivityManager(mainActivityMapper, eventBus);
mainActivityManager.setDisplay(clientFactory.getAppView().getMainPanel());
// Start PlaceHistoryHandler with our PlaceHistoryMapper
AppPlaceHistoryMapper historyMapper = GWT .create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
RootLayoutPanel.get().add(clientFactory.getAppView());
// Goes to place represented on URL or default place
historyHandler.handleCurrentHistory();
new AppController(clientFactory);
iii
iii
AppController.java
public class AppController implements AppView.Presenter {
private ClientFactory clientFactory;
AppController(ClientFactory clientFactory){
this.clientFactory = clientFactory;
goTo(new TopRightAPlace(""));
iii
@Override
public void goTo(Place place) {
clientFactory.getPlaceController().goTo(place);
iii
iii
TopRightAViewImpl.java
public class TopRightAViewImpl extends Composite implements TopRightAView {
interface Binder extends UiBinder<Widget, TopRightAViewImpl> {
iii
private static final Binder binder = GWT.create(Binder.class);
private Presenter listener;
@UiField
Button button;
public TopRightAViewImpl() {
initWidget(binder.createAndBindUi(this));
iii
@Override
public void setName(String name) {
button.setHTML(name);
iii
@Override
public void setPresenter(Presenter listener) {
this.listener = listener;
iii
@UiHandler("button")
void onButtonClick(ClickEvent event) {
listener.goTo(some other place);
iii
iii