Revision 5ec7b091 src/gr/grnet/pithos/web/client/GroupCreateDialog.java

b/src/gr/grnet/pithos/web/client/GroupCreateDialog.java
41 41
import com.google.gwt.event.dom.client.ClickHandler;
42 42
import com.google.gwt.event.dom.client.KeyCodes;
43 43
import com.google.gwt.event.dom.client.KeyDownEvent;
44
import com.google.gwt.user.client.Command;
44 45
import com.google.gwt.user.client.Event.NativePreviewEvent;
45 46
import com.google.gwt.user.client.ui.Anchor;
46 47
import com.google.gwt.user.client.ui.Button;
......
57 58

  
58 59
    protected Pithos app;
59 60

  
61
    private Command callback;
62
    
60 63
	/**
61 64
	 * The widget that holds the folderName of the folder.
62 65
	 */
......
64 67

  
65 68
	final VerticalPanel inner;
66 69

  
70
	public GroupCreateDialog(final Pithos app) {
71
		this(app, null);
72
	}
73
	
67 74
	/**
68 75
	 * The widget's constructor.
69 76
	 */
70
	public GroupCreateDialog(final Pithos app) {
77
	public GroupCreateDialog(final Pithos app, Command callback) {
71 78
        this.app = app;
79
        this.callback = callback;
80
        
72 81
		Anchor close = new Anchor();
73 82
		close.addStyleName("close");
74 83
		close.addClickHandler(new ClickHandler() {
......
160 169
	public void closeDialog() {
161 170
		Pithos.preventIESelection();
162 171
		hide();
172
		if (callback != null)
173
			callback.execute();
163 174
	}
164 175

  
165 176
	/**
166 177
	 * Generate an RPC request to create a new folder.
167 178
	 */
168
	private void createGroup() {
179
	void createGroup() {
169 180
		String name = groupName.getText().trim();
170 181
		if (name.length() == 0)
171 182
			return;

Also available in: Unified diff