refactored code, removed useless outdated classes
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/invite-friends-vre@114417 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
050d77e3a8
commit
cc12dd1ffd
|
@ -4,13 +4,12 @@ import org.gcube.portlets.user.invitefriends.client.ui.InviteWidget;
|
|||
|
||||
import com.google.gwt.core.client.EntryPoint;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
|
||||
/**
|
||||
* Entry point classes define <code>onModuleLoad()</code>.
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
*
|
||||
*/
|
||||
public class InviteFriends implements EntryPoint {
|
||||
|
||||
|
||||
/**
|
||||
* This is the entry point method.
|
||||
*/
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package org.gcube.portlets.user.invitefriends.client;
|
||||
|
||||
public interface Messages extends com.google.gwt.i18n.client.Messages {
|
||||
|
||||
@DefaultMessage("Enter your name")
|
||||
String nameField();
|
||||
|
||||
@DefaultMessage("Send")
|
||||
String sendButton();
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package org.gcube.portlets.user.invitefriends.client.resources;
|
||||
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
|
||||
public interface Images extends ClientBundle {
|
||||
|
||||
@Source("members-loader.gif")
|
||||
ImageResource membersLoader();
|
||||
|
||||
@Source("mail-32.png")
|
||||
ImageResource postToIcon();
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
|
@ -1,17 +1,10 @@
|
|||
package org.gcube.portlets.user.invitefriends.client.ui;
|
||||
|
||||
import org.gcube.portlets.user.invitefriends.client.validation.ValidationErrorsActivity;
|
||||
import org.gcube.portlets.user.invitefriends.client.validation.FormErrorsValidation;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.Form;
|
||||
import com.github.gwtbootstrap.client.ui.HelpBlock;
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.SimplePanel;
|
||||
|
@ -25,33 +18,18 @@ public class InviteWidget extends Composite{
|
|||
|
||||
public static final String DISPLAY_NAME = "Invite people to this VRE";
|
||||
|
||||
private static InviteWidgetUiBinder uiBinder = GWT
|
||||
.create(InviteWidgetUiBinder.class);
|
||||
private static InviteWidgetUiBinder uiBinder = GWT.create(InviteWidgetUiBinder.class);
|
||||
|
||||
interface InviteWidgetUiBinder extends UiBinder<Widget, InviteWidget> {
|
||||
}
|
||||
interface InviteWidgetUiBinder extends UiBinder<Widget, InviteWidget> { }
|
||||
|
||||
@UiField HTML header;
|
||||
|
||||
@UiField SimplePanel validationErrorsFormPanel;
|
||||
|
||||
public InviteWidget() {
|
||||
super();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
header.setText(DISPLAY_NAME);
|
||||
|
||||
new ValidationErrorsActivity().start(validationErrorsFormPanel, null);
|
||||
new FormErrorsValidation().start(validationErrorsFormPanel, null);
|
||||
}
|
||||
//
|
||||
// @UiHandler("openModal")
|
||||
// public void onClick(ClickEvent e) {
|
||||
// helpBlock.setText("We will send the invitation email to: "+emailAddress.getText());
|
||||
// modalWindow.show();
|
||||
// }
|
||||
//
|
||||
// @UiHandler("cancelInvite")
|
||||
// public void onCancelClick(ClickEvent e) {
|
||||
// modalWindow.hide();
|
||||
// }
|
||||
//
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import javax.validation.ConstraintViolation;
|
|||
import javax.validation.Path;
|
||||
import javax.validation.metadata.ConstraintDescriptor;
|
||||
|
||||
import org.gcube.portlets.user.invitefriends.client.validation.ValidationErrorsView.UserDetails;
|
||||
import org.gcube.portlets.user.invitefriends.client.validation.FormView.UserDetails;
|
||||
|
||||
import com.google.gwt.activity.shared.AbstractActivity;
|
||||
import com.google.gwt.editor.client.EditorDriver;
|
||||
|
@ -19,22 +19,19 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
|||
import com.google.gwt.validation.client.impl.PathImpl;
|
||||
|
||||
/**
|
||||
* Showcase for <code>ErrorEditor</code>s validation decoration of <code>TextBox</code>es.
|
||||
*
|
||||
* @author ivangsa
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
*
|
||||
*/
|
||||
public class ValidationErrorsActivity extends AbstractActivity implements ValidationErrorsView.Delegate {
|
||||
|
||||
private ValidationErrorsView view;
|
||||
|
||||
public class FormErrorsValidation extends AbstractActivity implements FormView.Delegate {
|
||||
|
||||
private FormView view;
|
||||
/**
|
||||
* @see com.google.gwt.activity.shared.Activity#start(com.google.gwt.user.client.ui.AcceptsOneWidget, com.google.gwt.event.shared.EventBus)
|
||||
*/
|
||||
@Override
|
||||
public void start(AcceptsOneWidget panel, EventBus eventBus) {
|
||||
view = new ValidationErrorsViewImpl(this);
|
||||
view = new FormViewImpl(this);
|
||||
panel.setWidget(view);
|
||||
}
|
||||
|
||||
|
@ -44,7 +41,7 @@ public class ValidationErrorsActivity extends AbstractActivity implements Valida
|
|||
EditorDriver<UserDetails> editorDriver = view.getEditorDriver();
|
||||
UserDetails login = editorDriver.flush();
|
||||
Set<ConstraintViolation<UserDetails>> violations = validate(login);
|
||||
/* This will decorate widgets implementing HasEditorErrors with validation messages */
|
||||
//decorate widgets implementing HasEditorErrors with validation messages
|
||||
return editorDriver.setConstraintViolations( (Set) violations);
|
||||
}
|
||||
|
|
@ -7,10 +7,11 @@ import com.google.gwt.editor.client.EditorDriver;
|
|||
import com.google.gwt.user.client.ui.IsWidget;
|
||||
|
||||
/**
|
||||
* @author ivangsa
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
*
|
||||
*/
|
||||
public interface ValidationErrorsView extends IsWidget {
|
||||
public interface FormView extends IsWidget {
|
||||
|
||||
public static class UserDetails {
|
||||
String email;
|
|
@ -19,15 +19,16 @@ import com.google.gwt.user.client.ui.Composite;
|
|||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
* @author ivangsa
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
*
|
||||
*/
|
||||
public class ValidationErrorsViewImpl extends Composite implements ValidationErrorsView, Editor<ValidationErrorsView.UserDetails> {
|
||||
public class FormViewImpl extends Composite implements FormView, Editor<FormView.UserDetails> {
|
||||
|
||||
interface Binder extends UiBinder<Widget, ValidationErrorsViewImpl> {}
|
||||
interface Binder extends UiBinder<Widget, FormViewImpl> {}
|
||||
private static Binder uiBinder = GWT.create(Binder.class);
|
||||
|
||||
interface Driver extends SimpleBeanEditorDriver<ValidationErrorsView.UserDetails, ValidationErrorsViewImpl> { }
|
||||
interface Driver extends SimpleBeanEditorDriver<FormView.UserDetails, FormViewImpl> { }
|
||||
private Driver driver = GWT.create(Driver.class);
|
||||
|
||||
private final Delegate delegate;
|
||||
|
@ -45,7 +46,7 @@ public class ValidationErrorsViewImpl extends Composite implements ValidationErr
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public ValidationErrorsViewImpl(Delegate delegate) {
|
||||
public FormViewImpl(Delegate delegate) {
|
||||
super();
|
||||
this.delegate = delegate;
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
@ -69,7 +70,7 @@ public class ValidationErrorsViewImpl extends Composite implements ValidationErr
|
|||
|
||||
|
||||
@Override
|
||||
public EditorDriver<ValidationErrorsView.UserDetails> getEditorDriver() {
|
||||
public EditorDriver<FormView.UserDetails> getEditorDriver() {
|
||||
return driver;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue