I have been reading Thomas Broyer's blog now for a full day and am
still having an issue with loading my application. Attached it the
EntryPoint. If you can tell me what I might be doing wrong that would
be awesome.
public class Library implements EntryPoint {
Logger logger = Logger.getLogger("LibraryLogger");
private Place defaultPlace = new HomePlace("Welcome");
private LayoutPanel layoutPanel = new LayoutPanel();
private SimplePanel headerPanel = new SimplePanel();
AcceptsOneWidget headerDisplay = new AcceptsOneWidget() {
public void setWidget(IsWidget w) {
Widget widget = Widget.asWidgetOrNull(w);
layoutPanel.setWidgetVisible(headerPanel, widget !=
null);
headerPanel.setWidget(widget);
}
};
private SimplePanel mainPanel = new SimplePanel();
AcceptsOneWidget mainDisplay = new AcceptsOneWidget() {
public void setWidget(IsWidget w) {
Widget widget = Widget.asWidgetOrNull(w);
layoutPanel.setWidgetVisible(mainPanel, widget != null);
mainPanel.setWidget(widget);
}
};
private SimplePanel sidePanel = new SimplePanel();
AcceptsOneWidget sideDisplay = new AcceptsOneWidget() {
public void setWidget(IsWidget w) {
Widget widget = Widget.asWidgetOrNull(w);
layoutPanel.setWidgetVisible(sidePanel, widget != null);
sidePanel.setWidget(widget);
}
};
private SimplePanel footerPanel = new SimplePanel();
AcceptsOneWidget footerDisplay = new AcceptsOneWidget() {
public void setWidget(IsWidget w) {
Widget widget = Widget.asWidgetOrNull(w);
layoutPanel.setWidgetVisible(footerPanel, widget !=
null);
footerPanel.setWidget(widget);
}
};
/**
* This is the entry point method.
*/
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 headerActivityMapper = new
HeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager = new
ActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(headerDisplay);
ActivityMapper sideActivityMapper = new
SideActivityMapper(clientFactory);
ActivityManager sideActivityManager = new
ActivityManager(sideActivityMapper, eventBus);
sideActivityManager.setDisplay(sideDisplay);
ActivityMapper footerActivityMapper = new
FooterActivityMapper(clientFactory);
ActivityManager footerActivityManager = new
ActivityManager(footerActivityMapper, eventBus);
footerActivityManager.setDisplay(footerDisplay);
ActivityMapper mainActivityMapper = new
MainActivityMapper(clientFactory);
ActivityManager mainActivityManager = new
ActivityManager(mainActivityMapper, eventBus);
mainActivityManager.setDisplay(mainDisplay);
// Start PlaceHistoryHandler with our PlaceHistoryMapper
AppPlaceHistoryMapper historyMapper=
GWT.create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new
PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus,
defaultPlace);
logger.info("Layout Panel "+layoutPanel);
RootPanel.get().add(layoutPanel);
// Goes to place represented on URL or default place
historyHandler.handleCurrentHistory();
}
}
On Nov 12, 10:08 am, koma <[email protected]> wrote:
> I think i start to understand, after reading the blog posts from
> Thomas Broyer
> here:http://tbroyer.posterous.com/gwt-21-activities-nesting-yagni
> and the other posts in this series
>
> Looking at a host page, you can identify different display areas.
> Every "dynamic" area - not the static part of the host page - is
> managed by an activity manager, which decides the activity to live in
> the display area.
> The applications switches between places and changing places triggers
> each activity manager to update its part of the display area;
>
> So I think I have to create a
> - menu activity manager
> - main content activity manager
> - login/logout link activity manager
> - sidebar activity manager.
>
> What do think ? Is my understanding of the "big picture" correct ?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.