1
|
package eu.dnetlib.repo.manager.client.datasources.utils;
|
2
|
|
3
|
import com.google.gwt.core.client.GWT;
|
4
|
import com.google.gwt.event.dom.client.ChangeEvent;
|
5
|
import com.google.gwt.event.dom.client.ChangeHandler;
|
6
|
import com.google.gwt.event.dom.client.ClickEvent;
|
7
|
import com.google.gwt.event.dom.client.ClickHandler;
|
8
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
9
|
import com.google.gwt.user.client.ui.FlowPanel;
|
10
|
import com.google.gwt.user.client.ui.HTML;
|
11
|
import com.google.gwt.user.client.ui.IsWidget;
|
12
|
import com.google.gwt.user.client.ui.Widget;
|
13
|
import eu.dnetlib.domain.data.RepositoryInterface;
|
14
|
import eu.dnetlib.gwt.client.MyFormGroup;
|
15
|
import eu.dnetlib.repo.manager.client.services.RepositoryService;
|
16
|
import eu.dnetlib.repo.manager.client.services.RepositoryServiceAsync;
|
17
|
import eu.dnetlib.repo.manager.client.services.ValidationService;
|
18
|
import eu.dnetlib.repo.manager.client.services.ValidationServiceAsync;
|
19
|
import eu.dnetlib.repo.manager.client.widgets.TextBox;
|
20
|
import eu.dnetlib.repo.manager.client.widgets.ValueChangeEvent;
|
21
|
import eu.dnetlib.repo.manager.client.widgets.ValueChangeHandler;
|
22
|
import eu.dnetlib.repo.manager.shared.Constants;
|
23
|
import eu.dnetlib.repo.manager.shared.InterfaceInformation;
|
24
|
import org.gwtbootstrap3.client.ui.*;
|
25
|
import org.gwtbootstrap3.client.ui.constants.*;
|
26
|
|
27
|
import java.util.HashMap;
|
28
|
import java.util.Map;
|
29
|
|
30
|
/**
|
31
|
* Created by stefania on 12/23/15.
|
32
|
*/
|
33
|
public class InterfaceFields implements IsWidget {
|
34
|
|
35
|
private boolean isValid = true;
|
36
|
|
37
|
private FlowPanel interfacePanel = new FlowPanel();
|
38
|
private FlowPanel interfaceBoxPanel = new FlowPanel();
|
39
|
private FlowPanel interfaceBoxContentPanel = new FlowPanel();
|
40
|
private FlowPanel interfaceBoxTitlePanel = new FlowPanel();
|
41
|
private HTML title = new HTML();
|
42
|
|
43
|
private FlowPanel actionsPanel = new FlowPanel();
|
44
|
|
45
|
private Anchor deleteIcon = new Anchor();
|
46
|
private Anchor saveIcon = new Anchor();
|
47
|
|
48
|
private Form interfaceForm = new Form();
|
49
|
|
50
|
private Alert interfaceErrorAlert = new Alert();
|
51
|
private Alert interfaceSuccessAlert = new Alert();
|
52
|
|
53
|
private TextBox baseURL = new TextBox();
|
54
|
private MyFormGroup baseURLFormGroup = new MyFormGroup(true, "Base OAI-PMH URL (*)", baseURL);
|
55
|
|
56
|
private RadioButton addACustomValidationSetRadio = new RadioButton("validationSet", "or a custom one", false);
|
57
|
private TextBox validationSetTextBox = new TextBox();
|
58
|
private RadioButton chooseExistingValidationSetRadio = new RadioButton("validationSet", "Choose existing", false);
|
59
|
private ListBox existingValidationSetsListBox = new ListBox();
|
60
|
private Map<String, Integer> existingValidationSetsValuesMap = new HashMap<String, Integer>();
|
61
|
|
62
|
private ListBox desiredCompatibilityLevelListBox = new ListBox();
|
63
|
private MyFormGroup desiredCompatibilityLevelFormGroup = new MyFormGroup(false, "Desired Compatibility Level (*)", desiredCompatibilityLevelListBox);
|
64
|
private Map<String, Integer> desiredCompatibilityValuesMap = new HashMap<String, Integer>();
|
65
|
|
66
|
private HTML currentCompatibilityLevel = new HTML();
|
67
|
|
68
|
private RepositoryInterface existingRepositoryInterface;
|
69
|
private String repositoryId;
|
70
|
|
71
|
private DeleteInterfaceListener deleteInterfaceListener;
|
72
|
|
73
|
private ValidationServiceAsync validationService = GWT.create(ValidationService.class);
|
74
|
private RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class);
|
75
|
|
76
|
private String mode;
|
77
|
private boolean isUpdate;
|
78
|
|
79
|
public InterfaceFields(boolean hasSave, Map<String, String> compatibilityClasses, String mode, final boolean isUpdate) {
|
80
|
|
81
|
this.mode = mode;
|
82
|
this.isUpdate = isUpdate;
|
83
|
|
84
|
// interfacePanel.addStyleName("col-md-6");
|
85
|
interfacePanel.add(interfaceBoxPanel);
|
86
|
|
87
|
// interfaceBoxPanel.addStyleName("ibox interface-box");
|
88
|
interfaceBoxPanel.addStyleName("el-item uk-card uk-card-default uk-card-body uk-scrollspy-inview uk-animation-fade");
|
89
|
interfaceBoxPanel.add(interfaceBoxTitlePanel);
|
90
|
interfaceBoxPanel.add(interfaceBoxContentPanel);
|
91
|
|
92
|
// interfaceBoxContentPanel.addStyleName("ibox-content");
|
93
|
|
94
|
// interfaceBoxTitlePanel.addStyleName("ibox-title");
|
95
|
interfaceBoxTitlePanel.add(title);
|
96
|
interfaceBoxTitlePanel.add(actionsPanel);
|
97
|
|
98
|
actionsPanel.addStyleName("interfaceActionsPanel");
|
99
|
|
100
|
deleteIcon.setIcon(IconType.REMOVE);
|
101
|
deleteIcon.setIconSize(IconSize.LARGE);
|
102
|
deleteIcon.addClickHandler(new ClickHandler() {
|
103
|
@Override
|
104
|
public void onClick(ClickEvent event) {
|
105
|
if(deleteInterfaceListener!=null)
|
106
|
deleteInterfaceListener.deleteInterface(isUpdate);
|
107
|
}
|
108
|
});
|
109
|
|
110
|
saveIcon.setIcon(IconType.SAVE);
|
111
|
saveIcon.setIconSize(IconSize.LARGE);
|
112
|
saveIcon.addClickHandler(new ClickHandler() {
|
113
|
@Override
|
114
|
public void onClick(ClickEvent event) {
|
115
|
saveInterface();
|
116
|
}
|
117
|
});
|
118
|
|
119
|
if(hasSave)
|
120
|
actionsPanel.add(saveIcon);
|
121
|
actionsPanel.add(deleteIcon);
|
122
|
|
123
|
interfaceSuccessAlert.setType(AlertType.SUCCESS);
|
124
|
interfaceSuccessAlert.setDismissable(false);
|
125
|
interfaceSuccessAlert.setVisible(false);
|
126
|
interfaceBoxContentPanel.add(interfaceSuccessAlert);
|
127
|
|
128
|
interfaceErrorAlert.setType(AlertType.DANGER);
|
129
|
interfaceErrorAlert.setDismissable(false);
|
130
|
interfaceErrorAlert.setVisible(false);
|
131
|
interfaceBoxContentPanel.add(interfaceErrorAlert);
|
132
|
|
133
|
interfaceBoxContentPanel.add(interfaceForm);
|
134
|
|
135
|
desiredCompatibilityLevelListBox.addItem("-- none selected --", "noneSelected");
|
136
|
int counter = 1;
|
137
|
for(String compatibility : compatibilityClasses.keySet()) {
|
138
|
desiredCompatibilityLevelListBox.addItem(compatibilityClasses.get(compatibility), compatibility);
|
139
|
desiredCompatibilityValuesMap.put(compatibility, counter);
|
140
|
counter++;
|
141
|
}
|
142
|
|
143
|
baseURL.addChangeHandler(new ChangeHandler() {
|
144
|
@Override
|
145
|
public void onChange(ChangeEvent event) {
|
146
|
|
147
|
baseURLFormGroup.setFormGroupValidationState(ValidationState.NONE);
|
148
|
getInterfaceInformation(null);
|
149
|
}
|
150
|
});
|
151
|
|
152
|
interfaceForm.add(baseURLFormGroup);
|
153
|
|
154
|
FlowPanel customValidationRadioPanel = new FlowPanel();
|
155
|
addACustomValidationSetRadio.setType(ButtonType.LINK);
|
156
|
addACustomValidationSetRadio.addStyleName("validationSetRadio");
|
157
|
addACustomValidationSetRadio.addChangeHandler(new ChangeHandler() {
|
158
|
@Override
|
159
|
public void onChange(ChangeEvent event) {
|
160
|
if(addACustomValidationSetRadio.getValue()) {
|
161
|
validationSetTextBox.setEnabled(true);
|
162
|
existingValidationSetsListBox.setEnabled(false);
|
163
|
}
|
164
|
}
|
165
|
});
|
166
|
addACustomValidationSetRadio.setEnabled(false);
|
167
|
customValidationRadioPanel.add(addACustomValidationSetRadio);
|
168
|
|
169
|
validationSetTextBox.setEnabled(false);
|
170
|
|
171
|
FlowPanel chooseExistingValidationRadioPanel = new FlowPanel();
|
172
|
chooseExistingValidationSetRadio.setValue(true);
|
173
|
chooseExistingValidationSetRadio.setType(ButtonType.LINK);
|
174
|
chooseExistingValidationSetRadio.addStyleName("validationSetRadio");
|
175
|
chooseExistingValidationSetRadio.addChangeHandler(new ChangeHandler() {
|
176
|
@Override
|
177
|
public void onChange(ChangeEvent event) {
|
178
|
existingValidationSetsListBox.setEnabled(true);
|
179
|
validationSetTextBox.setEnabled(false);
|
180
|
}
|
181
|
});
|
182
|
chooseExistingValidationSetRadio.setEnabled(false);
|
183
|
chooseExistingValidationRadioPanel.add(chooseExistingValidationSetRadio);
|
184
|
|
185
|
existingValidationSetsListBox.addItem("-- none selected --", "noneSelected");
|
186
|
existingValidationSetsListBox.setEnabled(false);
|
187
|
|
188
|
interfaceForm.add(new MyFormGroup(false, "Validation Set", chooseExistingValidationRadioPanel, existingValidationSetsListBox,
|
189
|
customValidationRadioPanel, validationSetTextBox));
|
190
|
|
191
|
interfaceForm.add(desiredCompatibilityLevelFormGroup);
|
192
|
|
193
|
currentCompatibilityLevel.setText("not available");
|
194
|
interfaceForm.add(new MyFormGroup(false, "Current Compatibility Level", currentCompatibilityLevel));
|
195
|
|
196
|
addValueChangeHandlersToFormFields();
|
197
|
}
|
198
|
|
199
|
@Override
|
200
|
public Widget asWidget() {
|
201
|
return interfacePanel;
|
202
|
}
|
203
|
|
204
|
public void setRepositoryId(String repositoryId) {
|
205
|
this.repositoryId = repositoryId;
|
206
|
}
|
207
|
|
208
|
public interface DeleteInterfaceListener {
|
209
|
void deleteInterface(boolean checkForLastOne);
|
210
|
}
|
211
|
|
212
|
public void setDeleteInterfaceListener(DeleteInterfaceListener deleteInterfaceListener) {
|
213
|
this.deleteInterfaceListener = deleteInterfaceListener;
|
214
|
}
|
215
|
|
216
|
public void loadRepositoryInterface(RepositoryInterface repositoryInterface, String repositoryId) {
|
217
|
|
218
|
this.existingRepositoryInterface = repositoryInterface;
|
219
|
this.repositoryId = repositoryId;
|
220
|
|
221
|
if(repositoryInterface!=null) {
|
222
|
|
223
|
if(!repositoryInterface.isRemovable()) {
|
224
|
|
225
|
if(mode.equals(Constants.REPOSITORY_MODE_OPENDOAR))
|
226
|
title.setHTML("<h5>OpenDOAR Interface (non-removable)</h5>");
|
227
|
else if(mode.equals(Constants.REPOSITORY_MODE_RE3DATA))
|
228
|
title.setHTML("<h5>Re3data Interface (non-removable)</h5>");
|
229
|
|
230
|
actionsPanel.remove(deleteIcon);
|
231
|
}
|
232
|
|
233
|
baseURL.setValue(repositoryInterface.getBaseUrl());
|
234
|
getInterfaceInformation(repositoryInterface.getAccessSet());
|
235
|
|
236
|
|
237
|
if(repositoryInterface.getDesiredCompatibilityLevel()!=null && !repositoryInterface.getDesiredCompatibilityLevel().equalsIgnoreCase("UNKNOWN"))
|
238
|
desiredCompatibilityLevelListBox.setSelectedIndex(desiredCompatibilityValuesMap.get(repositoryInterface.getDesiredCompatibilityLevel()));
|
239
|
|
240
|
if(repositoryInterface.getComplianceName()!=null && !repositoryInterface.getComplianceName().isEmpty())
|
241
|
currentCompatibilityLevel.setText(repositoryInterface.getComplianceName());
|
242
|
}
|
243
|
|
244
|
if(existingRepositoryInterface!=null && existingRepositoryInterface.getId()!=null) {
|
245
|
baseURL.setEnabled(false);
|
246
|
addACustomValidationSetRadio.setEnabled(false);
|
247
|
chooseExistingValidationSetRadio.setEnabled(false);
|
248
|
validationSetTextBox.setEnabled(false);
|
249
|
existingValidationSetsListBox.setEnabled(false);
|
250
|
}
|
251
|
}
|
252
|
|
253
|
private void saveInterface() {
|
254
|
|
255
|
interfaceErrorAlert.setVisible(false);
|
256
|
interfaceSuccessAlert.setVisible(false);
|
257
|
|
258
|
RepositoryInterface repositoryInterface = getRepositoryInterface(false);
|
259
|
if(repositoryInterface!=null && isValid) {
|
260
|
|
261
|
final HTML loadingWheel = new HTML("<div class=\"loader-small\" style=\"text-align: center; padding-top: 35%; " +
|
262
|
"color: rgb(47, 64, 80); font-weight: bold;\">Saving interface information</div><div class=\"whiteFilm\"></div>");
|
263
|
interfaceBoxContentPanel.addStyleName("loading");
|
264
|
interfaceBoxContentPanel.add(loadingWheel);
|
265
|
|
266
|
if (repositoryInterface.getId() == null) {
|
267
|
|
268
|
repositoryService.insertInterface(repositoryInterface, repositoryId, mode, new AsyncCallback<RepositoryInterface>() {
|
269
|
|
270
|
@Override
|
271
|
public void onFailure(Throwable caught) {
|
272
|
|
273
|
interfaceBoxContentPanel.removeStyleName("loading");
|
274
|
interfaceBoxContentPanel.remove(loadingWheel);
|
275
|
|
276
|
interfaceErrorAlert.setText("System error saving interface information ");
|
277
|
interfaceErrorAlert.setVisible(true);
|
278
|
}
|
279
|
|
280
|
@Override
|
281
|
public void onSuccess(RepositoryInterface repositoryInterface) {
|
282
|
|
283
|
interfaceBoxContentPanel.removeStyleName("loading");
|
284
|
interfaceBoxContentPanel.remove(loadingWheel);
|
285
|
|
286
|
interfaceSuccessAlert.setText("Interface saved successfully");
|
287
|
interfaceSuccessAlert.setVisible(true);
|
288
|
|
289
|
existingRepositoryInterface.setId(repositoryInterface.getId());
|
290
|
desiredCompatibilityLevelListBox.setSelectedIndex(0);
|
291
|
currentCompatibilityLevel.setText(repositoryInterface.getComplianceName());
|
292
|
|
293
|
baseURL.setEnabled(false);
|
294
|
addACustomValidationSetRadio.setEnabled(false);
|
295
|
chooseExistingValidationSetRadio.setEnabled(false);
|
296
|
validationSetTextBox.setEnabled(false);
|
297
|
existingValidationSetsListBox.setEnabled(false);
|
298
|
}
|
299
|
});
|
300
|
|
301
|
} else {
|
302
|
|
303
|
repositoryService.updateInterface(repositoryInterface, repositoryId, mode, new AsyncCallback<RepositoryInterface>() {
|
304
|
|
305
|
@Override
|
306
|
public void onFailure(Throwable caught) {
|
307
|
|
308
|
interfaceBoxContentPanel.removeStyleName("loading");
|
309
|
interfaceBoxContentPanel.remove(loadingWheel);
|
310
|
|
311
|
interfaceErrorAlert.setText("System error updating interface information ");
|
312
|
interfaceErrorAlert.setVisible(true);
|
313
|
}
|
314
|
|
315
|
@Override
|
316
|
public void onSuccess(RepositoryInterface repositoryInterface) {
|
317
|
|
318
|
interfaceBoxContentPanel.removeStyleName("loading");
|
319
|
interfaceBoxContentPanel.remove(loadingWheel);
|
320
|
|
321
|
interfaceSuccessAlert.setText("Interface updated successfully");
|
322
|
interfaceSuccessAlert.setVisible(true);
|
323
|
|
324
|
existingRepositoryInterface.setId(repositoryInterface.getId());
|
325
|
|
326
|
desiredCompatibilityLevelListBox.setSelectedIndex(0);
|
327
|
currentCompatibilityLevel.setText(repositoryInterface.getComplianceName());
|
328
|
}
|
329
|
});
|
330
|
}
|
331
|
}
|
332
|
}
|
333
|
|
334
|
private void getInterfaceInformation(final String validationSet) {
|
335
|
|
336
|
interfaceErrorAlert.setVisible(false);
|
337
|
|
338
|
final HTML loadingWheel = new HTML("<div class=\"loader-small\" style=\"text-align: center; padding-top: 35%; " +
|
339
|
"color: rgb(47, 64, 80); font-weight: bold;\">Fetching interface information</div><div class=\"whiteFilm\"></div>");
|
340
|
interfaceBoxContentPanel.addStyleName("loading");
|
341
|
interfaceBoxContentPanel.add(loadingWheel);
|
342
|
|
343
|
validationService.getInterfaceInformation(baseURL.getValue(), new AsyncCallback<InterfaceInformation>() {
|
344
|
|
345
|
@Override
|
346
|
public void onFailure(Throwable caught) {
|
347
|
|
348
|
interfaceBoxContentPanel.removeStyleName("loading");
|
349
|
interfaceBoxContentPanel.remove(loadingWheel);
|
350
|
|
351
|
interfaceErrorAlert.setText("System error fetching interface information ");
|
352
|
interfaceErrorAlert.setVisible(true);
|
353
|
}
|
354
|
|
355
|
@Override
|
356
|
public void onSuccess(InterfaceInformation interfaceInformation) {
|
357
|
|
358
|
interfaceBoxContentPanel.removeStyleName("loading");
|
359
|
interfaceBoxContentPanel.remove(loadingWheel);
|
360
|
|
361
|
if(interfaceInformation.isIdentified()) {
|
362
|
|
363
|
baseURLFormGroup.displayInlineSuccess("Identified");
|
364
|
|
365
|
if(existingRepositoryInterface==null || existingRepositoryInterface.getId()==null) {
|
366
|
chooseExistingValidationSetRadio.setEnabled(true);
|
367
|
addACustomValidationSetRadio.setEnabled(true);
|
368
|
|
369
|
if (chooseExistingValidationSetRadio.getValue())
|
370
|
existingValidationSetsListBox.setEnabled(true);
|
371
|
else
|
372
|
validationSetTextBox.setEnabled(true);
|
373
|
}
|
374
|
|
375
|
existingValidationSetsListBox.clear();
|
376
|
existingValidationSetsListBox.addItem("-- none selected --", "noneSelected");
|
377
|
int counter = 1;
|
378
|
for(String validationSet : interfaceInformation.getSets()) {
|
379
|
existingValidationSetsListBox.addItem(validationSet, validationSet);
|
380
|
existingValidationSetsValuesMap.put(validationSet, counter);
|
381
|
counter++;
|
382
|
}
|
383
|
|
384
|
} else {
|
385
|
baseURLFormGroup.displayInlineError("Not Identified");
|
386
|
}
|
387
|
|
388
|
if(validationSet!=null) {
|
389
|
|
390
|
if (interfaceInformation.getSets().contains(validationSet)) {
|
391
|
existingValidationSetsListBox.setSelectedIndex(existingValidationSetsValuesMap.get(validationSet));
|
392
|
} else {
|
393
|
|
394
|
chooseExistingValidationSetRadio.setValue(false);
|
395
|
addACustomValidationSetRadio.setValue(true);
|
396
|
if(existingRepositoryInterface==null || existingRepositoryInterface.getId()==null) {
|
397
|
existingValidationSetsListBox.setEnabled(false);
|
398
|
validationSetTextBox.setEnabled(true);
|
399
|
}
|
400
|
validationSetTextBox.setValue(validationSet);
|
401
|
}
|
402
|
}
|
403
|
}
|
404
|
});
|
405
|
}
|
406
|
|
407
|
public RepositoryInterface getRepositoryInterface(boolean forDeletion) {
|
408
|
|
409
|
if(!forDeletion) {
|
410
|
|
411
|
isValid = true;
|
412
|
|
413
|
if (isEmpty()) {
|
414
|
return null;
|
415
|
}
|
416
|
|
417
|
if (isComplete()) {
|
418
|
|
419
|
if (existingRepositoryInterface == null) {
|
420
|
existingRepositoryInterface = new RepositoryInterface();
|
421
|
}
|
422
|
|
423
|
existingRepositoryInterface.setCompliance("UNKNOWN");
|
424
|
|
425
|
existingRepositoryInterface.setBaseUrl(baseURL.getValue().trim());
|
426
|
|
427
|
if (chooseExistingValidationSetRadio.getValue() && !existingValidationSetsListBox.getSelectedValue().equals("noneSelected"))
|
428
|
existingRepositoryInterface.setAccessSet(existingValidationSetsListBox.getSelectedValue());
|
429
|
else if (addACustomValidationSetRadio.getValue() && validationSetTextBox.getValue() != null && !validationSetTextBox.getValue().trim().isEmpty())
|
430
|
existingRepositoryInterface.setAccessSet(validationSetTextBox.getValue().trim());
|
431
|
else
|
432
|
existingRepositoryInterface.setAccessSet("");
|
433
|
|
434
|
existingRepositoryInterface.setDesiredCompatibilityLevel(desiredCompatibilityLevelListBox.getSelectedValue());
|
435
|
|
436
|
return existingRepositoryInterface;
|
437
|
}
|
438
|
|
439
|
isValid = false;
|
440
|
return new RepositoryInterface();
|
441
|
|
442
|
} else {
|
443
|
|
444
|
if (isEmpty()) {
|
445
|
return null;
|
446
|
}
|
447
|
|
448
|
return existingRepositoryInterface;
|
449
|
}
|
450
|
}
|
451
|
|
452
|
private boolean isEmpty() {
|
453
|
|
454
|
if(chooseExistingValidationSetRadio.getValue()) {
|
455
|
|
456
|
if ((baseURL.getValue() == null || baseURL.getValue().trim().equals(""))
|
457
|
&& existingValidationSetsListBox.getSelectedValue().equals("noneSelected")
|
458
|
&& desiredCompatibilityLevelListBox.getSelectedValue().equals("noneSelected")) {
|
459
|
return true;
|
460
|
}
|
461
|
|
462
|
} else {
|
463
|
|
464
|
if ((baseURL.getValue() == null || baseURL.getValue().trim().equals(""))
|
465
|
&& (validationSetTextBox.getValue() == null || validationSetTextBox.getValue().trim().equals(""))
|
466
|
&& desiredCompatibilityLevelListBox.getSelectedValue().equals("noneSelected")) {
|
467
|
return true;
|
468
|
}
|
469
|
}
|
470
|
|
471
|
return false;
|
472
|
}
|
473
|
|
474
|
private boolean isComplete() {
|
475
|
|
476
|
boolean isComplete = true;
|
477
|
|
478
|
interfaceErrorAlert.setVisible(false);
|
479
|
|
480
|
if(baseURL.getValue()==null || baseURL.getValue().trim().isEmpty()) {
|
481
|
isComplete = false;
|
482
|
baseURLFormGroup.setFormGroupValidationState(ValidationState.ERROR);
|
483
|
}
|
484
|
|
485
|
if(desiredCompatibilityLevelListBox.getSelectedValue().equals("noneSelected")) {
|
486
|
isComplete = false;
|
487
|
desiredCompatibilityLevelFormGroup.setFormGroupValidationState(ValidationState.ERROR);
|
488
|
}
|
489
|
|
490
|
if(!isComplete) {
|
491
|
interfaceErrorAlert.setText("All fields marked with * are mandatory.");
|
492
|
interfaceErrorAlert.setVisible(true);
|
493
|
}
|
494
|
|
495
|
return isComplete;
|
496
|
}
|
497
|
|
498
|
private void addValueChangeHandlersToFormFields() {
|
499
|
|
500
|
baseURL.setValueChangeHandler(new ValueChangeHandler() {
|
501
|
@Override
|
502
|
public void handle(ValueChangeEvent valueChangeEvent) {
|
503
|
baseURLFormGroup.setFormGroupValidationState(ValidationState.NONE);
|
504
|
}
|
505
|
});
|
506
|
|
507
|
desiredCompatibilityLevelListBox.addChangeHandler(new ChangeHandler() {
|
508
|
@Override
|
509
|
public void onChange(ChangeEvent event) {
|
510
|
desiredCompatibilityLevelFormGroup.setFormGroupValidationState(ValidationState.NONE);
|
511
|
}
|
512
|
});
|
513
|
}
|
514
|
|
515
|
public boolean isValid() {
|
516
|
return isValid;
|
517
|
}
|
518
|
}
|