[Tynstep-svn] r137 - in trunk/step-web-app/src/main: java/com/tyndalehouse/step/web/client/framework java/com/tyndalehouse/step/web/client/presenter java/com/tyndalehouse/step/web/client/view resources/com/tyndalehouse/step/web/client/view
ChrisBurrell at crosswire.org
ChrisBurrell at crosswire.org
Sun Jun 20 02:06:24 MST 2010
Author: ChrisBurrell
Date: 2010-06-20 02:06:24 -0700 (Sun, 20 Jun 2010)
New Revision: 137
Added:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.java
trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.ui.xml
Modified:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/StepEventBus.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/StepPresenter.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java
Log:
updates to include a box to search
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/StepEventBus.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/StepEventBus.java 2010-06-19 17:36:35 UTC (rev 136)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/framework/StepEventBus.java 2010-06-20 09:06:24 UTC (rev 137)
@@ -34,9 +34,12 @@
void setSidebar(StepViewInterface w);
@Event(handlers = StepPresenter.class)
- void setTop(StepViewInterface w);
+ void setTopLeftPanel(StepViewInterface w);
@Event(handlers = StepPresenter.class)
+ void setTopRightPanel(StepViewInterface w);
+
+ @Event(handlers = StepPresenter.class)
void setFilterPanel(StepViewInterface w);
@Event(handlers = StepPresenter.class)
Added: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java 2010-06-20 09:06:24 UTC (rev 137)
@@ -0,0 +1,46 @@
+package com.tyndalehouse.step.web.client.presenter;
+
+import net.customware.gwt.dispatch.client.DispatchAsync;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.inject.Inject;
+import com.mvp4g.client.annotation.Presenter;
+import com.mvp4g.client.presenter.BasePresenter;
+import com.tyndalehouse.step.web.client.framework.StepEventBus;
+import com.tyndalehouse.step.web.client.framework.StepViewInterface;
+import com.tyndalehouse.step.web.client.view.ScriptureSelectorView;
+
+ at Presenter(view = ScriptureSelectorView.class, multiple = true)
+public class ScriptureSelectorPresenter extends BasePresenter<ScriptureSelectorPresenter.Display, StepEventBus> {
+ private final DispatchAsync dispatcher;
+
+ /** contact with the sidebar view */
+ public interface Display extends StepViewInterface {
+
+ /** returns the component that can be clicked */
+ HasClickHandlers getSelectReferenceButton();
+
+ /** returns the current reference, as typed in the box */
+ HasText getScriptureReference();
+
+ }
+
+ @Inject
+ ScriptureSelectorPresenter(final DispatchAsync dispatcher) {
+ this.dispatcher = dispatcher;
+ }
+
+ @Override
+ public void bind() {
+ super.bind();
+
+ view.getSelectReferenceButton().addClickHandler(new ClickHandler() {
+ public void onClick(final ClickEvent event) {
+ eventBus.scriptureChanged(view.getScriptureReference().getText());
+ }
+ });
+ }
+}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/StepPresenter.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/StepPresenter.java 2010-06-19 17:36:35 UTC (rev 136)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/StepPresenter.java 2010-06-20 09:06:24 UTC (rev 137)
@@ -29,8 +29,10 @@
public interface Display extends StepViewInterface {
void setSideBar(StepViewInterface w);
- void setTop(StepViewInterface w);
+ void setTopLeftPanel(StepViewInterface w);
+ void setTopRightPanel(StepViewInterface w);
+
void setLeftColumn(StepViewInterface w);
void setRightColumn(StepViewInterface w);
@@ -47,6 +49,10 @@
public void onStart() {
view.setLeftColumn(eventBus.addHandler(ScripturePresenter.class).getView());
view.setRightColumn(eventBus.addHandler(ScripturePresenter.class).getView());
+
+ view.setTopLeftPanel(eventBus.addHandler(ScriptureSelectorPresenter.class).getView());
+ view.setTopRightPanel(eventBus.addHandler(ScriptureSelectorPresenter.class).getView());
+
}
@Override
@@ -71,10 +77,14 @@
super.view.setSideBar(v);
}
- public void onSetTop(final StepViewInterface v) {
- super.view.setTop(v);
+ public void onSetTopLeftPanel(final StepViewInterface v) {
+ super.view.setTopLeftPanel(v);
}
+ public void onSetTopRightPanel(final StepViewInterface v) {
+ super.view.setTopRightPanel(v);
+ }
+
public void onSetFilterPanel(final StepViewInterface v) {
super.view.setFilterPanel(v);
}
Added: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.java 2010-06-20 09:06:24 UTC (rev 137)
@@ -0,0 +1,41 @@
+package com.tyndalehouse.step.web.client.view;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+import com.tyndalehouse.step.web.client.presenter.ScriptureSelectorPresenter;
+
+public class ScriptureSelectorView extends Composite implements ScriptureSelectorPresenter.Display {
+
+ interface Binder extends UiBinder<Widget, ScriptureSelectorView> {
+ }
+
+ private static Binder uiBinder = GWT.create(Binder.class);
+
+ @UiField
+ protected TextBox referenceTextbox;
+ @UiField
+ protected Button selectReferenceButton;
+
+ public ScriptureSelectorView() {
+ initWidget(ScriptureSelectorView.uiBinder.createAndBindUi(this));
+ }
+
+ public HasClickHandlers getSelectReferenceButton() {
+ return selectReferenceButton;
+ }
+
+ public HasText getScriptureReference() {
+ return referenceTextbox;
+ }
+
+ public Widget getContainerWidget() {
+ return this;
+ }
+}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java 2010-06-19 17:36:35 UTC (rev 136)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java 2010-06-20 09:06:24 UTC (rev 137)
@@ -25,7 +25,8 @@
private static final String VISIBLE = "visible";
private static final String INVISIBLE = "invisible";
- final private SimplePanel topPanel = new SimplePanel();
+ final private SimplePanel topLeftPanel = new SimplePanel();
+ final private SimplePanel topRightPanel = new SimplePanel();
final private SimplePanel sidePanel = new SimplePanel();
final private SimplePanel leftColumnPanel = new SimplePanel();
final private SimplePanel centerPanel = new SimplePanel();
@@ -57,12 +58,11 @@
}
private void addPanelsToLayout() {
- // stepPanelLayout.add(topPanel);
+ stepPanelLayout.add(topLeftPanel);
+ stepPanelLayout.add(topRightPanel);
stepPanelLayout.add(sidePanel);
- // stepPanelLayout.add(leftScriptureSelectorPanel);
stepPanelLayout.add(leftColumnPanel);
stepPanelLayout.add(centerPanel);
- // stepPanelLayout.add(rightScriptureSelectorPanel);
stepPanelLayout.add(rightColumnPanel);
stepPanelLayout.add(filterPanel);
@@ -80,6 +80,8 @@
}
private void setInitialLayout() {
+ stepPanelLayout.setWidgetTopHeight(topLeftPanel, TOP_PANEL_TOP, Unit.PX, TOP_PANEL_HEIGHT, Unit.PX);
+ stepPanelLayout.setWidgetTopHeight(topRightPanel, TOP_PANEL_TOP, Unit.PX, TOP_PANEL_HEIGHT, Unit.PX);
stepPanelLayout.setWidgetLeftWidth(sidePanel, SIDE_PANEL_LEFT, Unit.PX, SIDE_PANEL_WIDTH, Unit.PX);
stepPanelLayout.setWidgetLeftWidth(filterPanel, FILTER_PANEL_LEFT, Unit.PX, FILTER_PANEL_WIDTH, Unit.PX);
stepPanelLayout.setWidgetTopBottom(leftColumnPanel, COLUMN_TOP, Unit.PX, COLUMN_BOTTOM, Unit.PX);
@@ -103,22 +105,18 @@
replaceContents(sidePanel, w);
}
- public void setTop(final StepViewInterface w) {
- replaceContents(topPanel, w);
+ public void setTopLeftPanel(final StepViewInterface w) {
+ replaceContents(topLeftPanel, w);
}
+ public void setTopRightPanel(final StepViewInterface w) {
+ replaceContents(topLeftPanel, w);
+ }
+
public void setCenterPanel(final StepViewInterface w) {
replaceContents(centerPanel, w);
}
- public void setLeftScriptureSelectorPanel(final StepViewInterface w) {
- // replaceContents(leftScriptureSelectorPanel, w);
- }
-
- public void setRightScriptureSelectorPanel(final StepViewInterface w) {
- // replaceContents(rightScriptureSelectorPanel, w);
- }
-
private void replaceContents(final Panel p, final StepViewInterface w) {
p.clear();
p.add(w.getContainerWidget());
@@ -154,12 +152,14 @@
repositionVertically(sidePanel, windowHeight, sidePanelHeight);
repositionVertically(filterPanel, windowHeight, sidePanelHeight);
-
stepPanelLayout.setWidgetLeftWidth(centerPanel, centerPanelLeft, Unit.PX, CENTER_PANEL_WIDTH, Unit.PX);
- stepPanelLayout.setWidgetLeftRight(leftColumnPanel, SIDE_PANEL_LEFT + SIDE_PANEL_WIDTH, Unit.PX,
- centerPanelLeft + CENTER_PANEL_WIDTH - SIDE_PANEL_WIDTH, Unit.PX);
+ stepPanelLayout.setWidgetLeftRight(topLeftPanel, SCRIPTURE_PANEL_LEFT, Unit.PX, centerPanelLeft
+ + CENTER_PANEL_WIDTH - SIDE_PANEL_WIDTH, Unit.PX);
+ stepPanelLayout.setWidgetLeftRight(leftColumnPanel, SCRIPTURE_PANEL_LEFT, Unit.PX, centerPanelLeft
+ + CENTER_PANEL_WIDTH - SIDE_PANEL_WIDTH, Unit.PX);
+ stepPanelLayout.setWidgetLeftRight(topRightPanel, centerPanelLeft + CENTER_PANEL_WIDTH, Unit.PX, 0, Unit.PX);
stepPanelLayout.setWidgetLeftRight(rightColumnPanel, centerPanelLeft + CENTER_PANEL_WIDTH, Unit.PX, 0, Unit.PX);
setFilterPanelVisible(false);
Added: trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.ui.xml
===================================================================
--- trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.ui.xml (rev 0)
+++ trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/client/view/ScriptureSelectorView.ui.xml 2010-06-20 09:06:24 UTC (rev 137)
@@ -0,0 +1,9 @@
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui' >
+
+ <g:FlowPanel>
+ <g:TextBox ui:field='referenceTextbox' />
+ <g:Button ui:field='selectReferenceButton' text='>' />
+ </g:FlowPanel>
+
+</ui:UiBinder>
More information about the Tynstep-svn
mailing list