protected boolean validate() { Presentations presentations = component.getPresentations(); //check that name is empty if (StringUtils.isEmpty(nameField.getValue())) { App.getInstance().getWindowManager().showNotification( messages.getMainMessage("PresentationsEditor.error"), messages.getMainMessage("PresentationsEditor.error.nameRequired"), Frame.NotificationType.HUMANIZED); return false; } //check that name is unique final Presentation pres = presentations.getPresentationByName(nameField.getValue()); if (pres != null && !pres.equals(presentation)) { App.getInstance().getWindowManager().showNotification( messages.getMainMessage("PresentationsEditor.error"), messages.getMainMessage("PresentationsEditor.error.nameAlreadyExists"), Frame.NotificationType.HUMANIZED); return false; } return true; }