Revision 764aabcc
b/gss/src/gr/ebs/gss/client/FileUploadDialog.java | ||
---|---|---|
89 | 89 |
public FileUploadDialog(final Images _images, List<FileResource> _files) { |
90 | 90 |
images = _images; |
91 | 91 |
files = _files; |
92 |
// Use this opportunity to set the dialog's caption.
|
|
92 |
// Set the dialog's caption.
|
|
93 | 93 |
setText("File upload"); |
94 | 94 |
setAnimationEnabled(true); |
95 |
//form.setAction(FILE_UPLOAD_PATH); |
|
96 |
// Because we're going to add a FileUpload widget, we'll need to set the |
|
95 |
// Since we're going to add a FileUpload widget, we'll need to set the |
|
97 | 96 |
// form to use the POST method, and multipart MIME encoding. |
98 | 97 |
form.setEncoding(FormPanel.ENCODING_MULTIPART); |
99 | 98 |
form.setMethod(FormPanel.METHOD_POST); |
100 | 99 |
|
101 | 100 |
// Create a panel to hold all of the form widgets. |
102 |
final VerticalPanel panel = new VerticalPanel();
|
|
101 |
VerticalPanel panel = new VerticalPanel(); |
|
103 | 102 |
form.setWidget(panel); |
104 | 103 |
final Hidden date = new Hidden("Date", ""); |
105 | 104 |
panel.add(date); |
106 | 105 |
final Hidden auth = new Hidden("Authorization", ""); |
107 | 106 |
panel.add(auth); |
108 | 107 |
// Add an informative label with the folder name. |
109 |
final Object selection = GSS.get().getFolders().getCurrent().getUserObject();
|
|
108 |
Object selection = GSS.get().getFolders().getCurrent().getUserObject(); |
|
110 | 109 |
folder = (FolderResource) selection; |
111 | 110 |
upload.setName("file"); |
112 |
final Grid generalTable = new Grid(2, 2);
|
|
111 |
Grid generalTable = new Grid(2, 2); |
|
113 | 112 |
generalTable.setText(0, 0, "Folder"); |
114 | 113 |
generalTable.setText(1, 0, "File"); |
115 | 114 |
generalTable.setText(0, 1, folder.getName()); |
... | ... | |
123 | 122 |
panel.add(generalTable); |
124 | 123 |
|
125 | 124 |
// Create a panel to hold the buttons. |
126 |
final HorizontalPanel buttons = new HorizontalPanel();
|
|
125 |
HorizontalPanel buttons = new HorizontalPanel(); |
|
127 | 126 |
|
128 | 127 |
// Create the 'upload' button, along with a listener that submits the |
129 | 128 |
// form. |
130 |
final Button submit = new Button("Create", new ClickListener() { |
|
131 |
|
|
129 |
final Button submit = new Button("Upload", new ClickListener() { |
|
132 | 130 |
public void onClick(Widget sender) { |
133 | 131 |
prepareAndSubmit(); |
134 |
|
|
135 | 132 |
} |
136 | 133 |
}); |
137 | 134 |
buttons.add(submit); |
138 | 135 |
buttons.setCellHorizontalAlignment(submit, HasHorizontalAlignment.ALIGN_CENTER); |
139 | 136 |
// Create the 'Cancel' button, along with a listener that hides the |
140 |
// dialog |
|
141 |
// when the button is clicked. |
|
137 |
// dialog when the button is clicked. |
|
142 | 138 |
final Button cancel = new Button("Cancel", new ClickListener() { |
143 | 139 |
|
144 | 140 |
public void onClick(Widget sender) { |
Also available in: Unified diff