r129 - in trunk: . gwt gwt/mc-form gwt/mc-form/src gwt/mc-form/src/org gwt/mc-form/src/org/movecommons gwt/mc-form/src/org/movecommons/client gwt/mc-form/test gwt/mc-form/test/org gwt/mc-form/test/org/movecommons gwt/mc-form/war gwt/mc-form/war/WEB-INF
Author: vjrj_ Date: 2011-03-05 01:32:21 +0100 (Sat, 05 Mar 2011) New Revision: 129 Added: trunk/gwt/ trunk/gwt/mc-form/ trunk/gwt/mc-form/.classpath trunk/gwt/mc-form/.project trunk/gwt/mc-form/src/ trunk/gwt/mc-form/src/org/ trunk/gwt/mc-form/src/org/movecommons/ trunk/gwt/mc-form/src/org/movecommons/Mc_form.gwt.xml trunk/gwt/mc-form/src/org/movecommons/client/ trunk/gwt/mc-form/src/org/movecommons/client/McFormEntryPoint.java trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.java trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.ui.xml trunk/gwt/mc-form/src/org/movecommons/client/McFormPresenter.java trunk/gwt/mc-form/test/ trunk/gwt/mc-form/test/org/ trunk/gwt/mc-form/test/org/movecommons/ trunk/gwt/mc-form/test/org/movecommons/client/ trunk/gwt/mc-form/war/ trunk/gwt/mc-form/war/Mc_form.css trunk/gwt/mc-form/war/Mc_form.html trunk/gwt/mc-form/war/WEB-INF/ trunk/gwt/mc-form/war/WEB-INF/web.xml Log: initial mc gwt project Added: trunk/gwt/mc-form/.classpath =================================================================== --- trunk/gwt/mc-form/.classpath (rev 0) +++ trunk/gwt/mc-form/.classpath 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" output="test-classes" path="test"/> + <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="war/WEB-INF/classes"/> +</classpath> Added: trunk/gwt/mc-form/.project =================================================================== --- trunk/gwt/mc-form/.project (rev 0) +++ trunk/gwt/mc-form/.project 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>mc-form</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.google.gdt.eclipse.core.webAppProjectValidator</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.google.gwt.eclipse.core.gwtProjectValidator</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>com.google.gwt.eclipse.core.gwtNature</nature> + </natures> +</projectDescription> Added: trunk/gwt/mc-form/src/org/movecommons/Mc_form.gwt.xml =================================================================== --- trunk/gwt/mc-form/src/org/movecommons/Mc_form.gwt.xml (rev 0) +++ trunk/gwt/mc-form/src/org/movecommons/Mc_form.gwt.xml 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module rename-to='mc_form'> + <!-- Inherit the core Web Toolkit stuff. --> + <inherits name='com.google.gwt.user.User'/> + + <!-- Inherit the default GWT style sheet. You can change --> + <!-- the theme of your GWT application by uncommenting --> + <!-- any one of the following lines. --> + <inherits name='com.google.gwt.user.theme.standard.Standard'/> + <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --> + <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> --> + + <!-- Other module inherits --> + + <!-- Specify the app entry point class. --> + <entry-point class='org.movecommons.client.McFormEntryPoint'/> + + <!-- Specify the paths for translatable code --> + <source path='client'/> + +</module> Added: trunk/gwt/mc-form/src/org/movecommons/client/McFormEntryPoint.java =================================================================== --- trunk/gwt/mc-form/src/org/movecommons/client/McFormEntryPoint.java (rev 0) +++ trunk/gwt/mc-form/src/org/movecommons/client/McFormEntryPoint.java 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,23 @@ +package org.movecommons.client; + +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.user.client.ui.RootPanel; + +/** + * Entry point classes define <code>onModuleLoad()</code>. + */ +public class McFormEntryPoint implements EntryPoint { + + /** + * This is the entry point method. + */ + @Override + public void onModuleLoad() { + // Here we use MVC pattern (in a simple way): + // https://secure.wikimedia.org/wikipedia/en/wiki/Model%E2%80%93View%E2%80%93Co... + final McFormPanel panel = new McFormPanel(); + final McFormPresenter presenter = new McFormPresenter(); + presenter.init(panel); + RootPanel.get().add(panel); + } +} Added: trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.java =================================================================== --- trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.java (rev 0) +++ trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.java 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,140 @@ +package org.movecommons.client; + +import org.movecommons.client.McFormPresenter.McFormView; + +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.CaptionPanel; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.FocusPanel; +import com.google.gwt.user.client.ui.HasText; +import com.google.gwt.user.client.ui.InlineLabel; +import com.google.gwt.user.client.ui.IsWidget; +import com.google.gwt.user.client.ui.ListBox; +import com.google.gwt.user.client.ui.PushButton; +import com.google.gwt.user.client.ui.TextBox; +import com.google.gwt.user.client.ui.Widget; + +public class McFormPanel extends Composite implements McFormView { + + interface McFormPanelUiBinder extends UiBinder<Widget, McFormPanel> { + } + private static McFormPanelUiBinder uiBinder = GWT.create(McFormPanelUiBinder.class); + + @UiField + PushButton addKeywordBtn; + @UiField + InlineLabel catIntroLabel; + @UiField + FocusPanel grPanel; + @UiField + TextBox initiativeName; + @UiField + InlineLabel initiativeNameLabel; + @UiField + TextBox keyword1; + @UiField + TextBox keyword2; + @UiField + TextBox keyword3; + @UiField + InlineLabel keywords; + @UiField + ListBox language; + @UiField + InlineLabel languageLabel; + @UiField + TextBox location; + @UiField + InlineLabel locationLabel; + @UiField + FlowPanel mainPanel; + @UiField + InlineLabel npLabel; + @UiField + FocusPanel npPanel; + @UiField + CaptionPanel optionalCaption; + @UiField + FlowPanel optionalFlow; + @UiField + FocusPanel rcPanel; + @UiField + FocusPanel rpPanel; + @UiField + TextBox website; + @UiField + InlineLabel websiteLabel; + + /** + * Check the <a href= + * "https://code.google.com/intl/en/webtoolkit/doc/latest/DevGuideUiBinder.html" + * >Ui Binder Dev Guide</a> for more info. + */ + public McFormPanel() { + initWidget(uiBinder.createAndBindUi(this)); + } + + @Override + public HasClickHandlers getGrPanel() { + return grPanel; + } + + @Override + public HasText getInitiativeName() { + return initiativeName; + } + + @Override + public HasText getInitiativeNameLabel() { + return initiativeNameLabel; + } + + @Override + public HasText getLanguageLabel() { + return languageLabel; + } + + @Override + public HasText getLocation() { + return location; + } + + @Override + public HasText getLocationLabel() { + return locationLabel; + } + + @Override + public HasClickHandlers getNpPanel() { + return npPanel; + } + + @Override + public IsWidget getOptionalPanel() { + return optionalFlow; + } + + @Override + public HasClickHandlers getRcPanel() { + return rcPanel; + } + + @Override + public HasClickHandlers getRpPanel() { + return rpPanel; + } + + @Override + public HasText getWebsite() { + return website; + } + + @Override + public HasText getWebsiteLabel() { + return websiteLabel; + } +} Added: trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.ui.xml =================================================================== --- trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.ui.xml (rev 0) +++ trunk/gwt/mc-form/src/org/movecommons/client/McFormPanel.ui.xml 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,76 @@ +<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> +<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" + xmlns:g="urn:import:com.google.gwt.user.client.ui"> + <ui:style> + .mainPanel { } + .intro {} + .initiative-name-label {} + .initiative-name {} + .website-label {} + .website {} + .location-label {} + .location {} + .language-label {} + .language {} + .np-panel { background-color: gray; cursor: pointer;} + .rp-panel { background-color: blue; cursor: pointer;} + .rc-panel { background-color: blue; cursor: pointer;} + .gr-panel { background-color: gray; cursor: pointer;} + </ui:style> + <!-- + See: + https://code.google.com/intl/en/webtoolkit/doc/latest/DevGuideUiBinder.html + --> + + <g:FlowPanel ui:field="mainPanel" styleName='{style.mainPanel}'> + <g:InlineHTML styleName='{style.intro}'>MC + allows...</g:InlineHTML> + <g:InlineLabel ui:field="initiativeNameLabel" + styleName='{style.initiative-name-label}' horizontalAlignment="ALIGN_CENTER" /> + <g:TextBox ui:field="initiativeName" styleName='{style.initiative-name}' /> + <g:InlineLabel ui:field="websiteLabel" styleName='{style.website-label}' /> + <g:TextBox ui:field="website" styleName='{style.website}' /> + <g:InlineLabel ui:field="languageLabel" styleName='{style.language-label}' /> + <g:ListBox visibleItemCount="5" ui:field="language" + styleName='{style.language}' /> + <g:InlineLabel ui:field="locationLabel" styleName='{style.location-label}' /> + <g:TextBox ui:field="location" styleName='{style.location}' /> + <g:InlineLabel ui:field="keywords" /> + <g:FlowPanel> + <g:TextBox ui:field="keyword1" /> + <g:TextBox ui:field="keyword2" /> + <g:TextBox ui:field="keyword3" /> + <g:PushButton ui:field="addKeywordBtn" /> + </g:FlowPanel> + <g:InlineLabel ui:field="catIntroLabel" /> + <g:LayoutPanel width="100%" height="200px"> + <g:layer left="0.0pct" width="50.0pct" top="0px" height="50.0pct"> + <g:FocusPanel width="50%" height="50%" ui:field="npPanel" + styleName='{style.np-panel}'> + <g:InlineLabel width="100%" height="100%" + ui:field="npLabel" /> + </g:FocusPanel> + </g:layer> + <g:layer top="0px" height="50.0pct" left="50.0pct" width="50.0pct"> + <g:FocusPanel width="50%" height="50%" ui:field="rpPanel" + styleName='{style.rp-panel}' /> + </g:layer> + <g:layer left="0.0pct" width="50.0pct" top="50.0pct" + height="50.0pct"> + <g:FocusPanel width="50%" height="50%" ui:field="rcPanel" + styleName='{style.rc-panel}' /> + </g:layer> + <g:layer top="50.0pct" height="50.0pct" left="50.0pct" + width="50.0pct"> + <g:FocusPanel width="50%" height="50%" ui:field="grPanel" + styleName='{style.gr-panel}' /> + </g:layer> + </g:LayoutPanel> + <g:CaptionPanel captionText="Optional" ui:field="optionalCaption"> + <g:FlowPanel ui:field="optionalFlow" width="5cm" + height="3cm"> + <g:InlineLabel text="Some sample text" /> + </g:FlowPanel> + </g:CaptionPanel> + </g:FlowPanel> +</ui:UiBinder> \ No newline at end of file Added: trunk/gwt/mc-form/src/org/movecommons/client/McFormPresenter.java =================================================================== --- trunk/gwt/mc-form/src/org/movecommons/client/McFormPresenter.java (rev 0) +++ trunk/gwt/mc-form/src/org/movecommons/client/McFormPresenter.java 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,95 @@ +package org.movecommons.client; + +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.gwt.user.client.ui.IsWidget; + +public class McFormPresenter { + + public interface McFormView { + HasClickHandlers getGrPanel(); + + HasText getInitiativeName(); + + HasText getInitiativeNameLabel(); + + HasText getLanguageLabel(); + + HasText getLocation(); + + HasText getLocationLabel(); + + HasClickHandlers getNpPanel(); + + IsWidget getOptionalPanel(); + + HasClickHandlers getRcPanel(); + + HasClickHandlers getRpPanel(); + + HasText getWebsite(); + + HasText getWebsiteLabel(); + } + + private boolean isGR; + private boolean isNP; + private boolean isRC; + private boolean isRP; + private McFormView view; + + public McFormPresenter() { + isNP = false; + isRC = false; + isRP = false; + isGR = false; + } + + public void init(final McFormView view) { + this.view = view; + reset(view); + } + + private void reset(final McFormView view) { + view.getOptionalPanel().asWidget().setVisible(false); + view.getNpPanel().addClickHandler(new ClickHandler() { + + @Override + public void onClick(final ClickEvent event) { + isNP = !isNP; + view.getOptionalPanel().asWidget().setVisible(isNP); + } + }); + view.getRpPanel().addClickHandler(new ClickHandler() { + + @Override + public void onClick(final ClickEvent event) { + isRP = !isRP; + view.getOptionalPanel().asWidget().setVisible(isRP); + } + }); + view.getRcPanel().addClickHandler(new ClickHandler() { + + @Override + public void onClick(final ClickEvent event) { + isRC = !isRC; + view.getOptionalPanel().asWidget().setVisible(isRC); + } + }); + view.getRcPanel().addClickHandler(new ClickHandler() { + + @Override + public void onClick(final ClickEvent event) { + isGR = !isGR; + view.getOptionalPanel().asWidget().setVisible(isGR); + } + }); + // FIXME i18n + view.getInitiativeNameLabel().setText("Name of the initiative:"); + view.getLocationLabel().setText("Location"); + view.getLanguageLabel().setText("Language(s)"); + view.getWebsiteLabel().setText("Website"); + } +} Property changes on: trunk/gwt/mc-form/war ___________________________________________________________________ Name: svn:ignore + mc_form Added: trunk/gwt/mc-form/war/Mc_form.css =================================================================== --- trunk/gwt/mc-form/war/Mc_form.css (rev 0) +++ trunk/gwt/mc-form/war/Mc_form.css 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,2 @@ +/** Add css rules here for your application. */ + Added: trunk/gwt/mc-form/war/Mc_form.html =================================================================== --- trunk/gwt/mc-form/war/Mc_form.html (rev 0) +++ trunk/gwt/mc-form/war/Mc_form.html 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,50 @@ +<!doctype html> +<!-- The DOCTYPE declaration above will set the --> +<!-- browser's rendering engine into --> +<!-- "Standards Mode". Replacing this declaration --> +<!-- with a "Quirks Mode" doctype may lead to some --> +<!-- differences in layout. --> + +<html> +<head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> + +<!-- --> +<!-- Consider inlining CSS to reduce the number of requested files --> +<!-- --> +<link type="text/css" rel="stylesheet" href="Mc_form.css"> + +<!-- --> +<!-- Any title is fine --> +<!-- --> +<title>FIXME: How to set the title dinamically</title> + +<!-- --> +<!-- This script loads your compiled module. --> +<!-- If you add any GWT meta tags, they must --> +<!-- be added before this line. --> +<!-- --> +<script type="text/javascript" language="javascript" + src="mc_form/mc_form.nocache.js"></script> +</head> + +<!-- --> +<!-- The body can have arbitrary html, or --> +<!-- you can leave the body empty if you want --> +<!-- to create a completely dynamic UI. --> +<!-- --> +<body> + +<!-- OPTIONAL: include this if you want history support --> +<!--<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'--> +<!-- style="position: absolute; width: 0; height: 0; border: 0"></iframe>--> + +<!-- RECOMMENDED if your web app will not function without JavaScript enabled --> +<noscript> +<div + style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> +Your web browser must have JavaScript enabled in order for this +application to display correctly.</div> +</noscript> +</body> +</html> Property changes on: trunk/gwt/mc-form/war/WEB-INF ___________________________________________________________________ Name: svn:ignore + lib classes deploy Added: trunk/gwt/mc-form/war/WEB-INF/web.xml =================================================================== --- trunk/gwt/mc-form/war/WEB-INF/web.xml (rev 0) +++ trunk/gwt/mc-form/war/WEB-INF/web.xml 2011-03-05 00:32:21 UTC (rev 129) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE web-app + PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> + +<web-app> + + <!-- Default page to serve --> + <welcome-file-list> + <welcome-file>Mc_form.html</welcome-file> + </welcome-file-list> + +</web-app>
participants (1)
-
Vicente J. Ruiz Jurado