package com.danielvaughan.rssreader.client;
import com.danielvaughan.rssreader.client.services.FeedService;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.data.BeanModel;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class RSSReader implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
// create the FeedService and store it in the registry
Registry.register(RSSReaderConstants.FEED_SERVICE, GWT.create(FeedService.class));
// create the feed store and store it in the registry
Registry.register(RSSReaderConstants.FEED_STORE, new ListStore<BeanModel>());
Viewport viewport = new Viewport();
viewport.setLayout(new BorderLayout());
HTML htmlNewHtml = new HTML("<h1>RSS Reader</h1>", true);
BorderLayoutData bld_htmlNewHtml = new BorderLayoutData(LayoutRegion.NORTH, 20);
bld_htmlNewHtml.setCollapsible(false);
viewport.add(htmlNewHtml, bld_htmlNewHtml);
ContentPanel mainPanel = new RssMainPanel();
mainPanel.setCollapsible(false);
viewport.add(mainPanel, new BorderLayoutData(LayoutRegion.CENTER));
ContentPanel navPanel = new RssNavigationPanel();
navPanel.setCollapsible(true);
BorderLayoutData bld_navPanel = new BorderLayoutData(LayoutRegion.WEST, 200, 150, 300);
bld_navPanel.setSplit(true);
bld_navPanel.setCollapsible(true);
viewport.add(navPanel, bld_navPanel);
RootPanel.get().add(viewport);
}
}