src/main/java/eu/etaxonomy/cdm/vaadin/component/NewTaxonBaseComposite.java -text
src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java -text
src/main/java/eu/etaxonomy/cdm/vaadin/container/CdmSQLContainer.java -text
-src/main/java/eu/etaxonomy/cdm/vaadin/container/CdmSpringConnectionPool.java -text
src/main/java/eu/etaxonomy/cdm/vaadin/container/IdAndUuid.java -text
src/main/java/eu/etaxonomy/cdm/vaadin/container/LeafNodeTaxonContainer.java -text
src/main/java/eu/etaxonomy/cdm/vaadin/jscomponent/D3ConceptRelationshipTree.java -text
}
-
- /**
- * @param printStream
- */
@Override
protected void printLegend(PrintStream printStream) {
printStream.println("PersistentContextAnalyzer legend: ");
return flags;
}
- /**
- * @return the showHashCodes
- */
public boolean isShowHashCodes() {
return showHashCodes;
}
-
- /**
- * @param showHashCodes the showHashCodes to set
- */
public void setShowHashCodes(boolean showHashCodes) {
boolean runUpdate = this.showHashCodes != showHashCodes;
this.showHashCodes = showHashCodes;
update();
}
}
-
-}
+}
\ No newline at end of file
/**
* Internationalization class.
* @author freimeier
- *
*/
public class Messages implements Serializable {
public DTO toDTO(CDM bean);
- /**
- * @return
- */
public Class<DTO> getDTOType();
}
*
* @author a.kohlbecker
* @since Apr 6, 2017
- *
*/
@Service
public class CdmBeanItemContainerFactory {
return termItemContainer;
}
-
@Transactional(readOnly=true)
public BeanItemContainer<DefinedTermBase> buildVocabularyTermsItemContainer(UUID vocabularyUuid) {
clearSession();
- TermVocabulary vocab = repo.getVocabularyService().find(vocabularyUuid);
+ TermVocabulary<?> vocab = repo.getVocabularyService().find(vocabularyUuid);
Pager<DefinedTermBase> terms = repo.getVocabularyService().getTerms(vocab, null, null, orderHints, INIT_STRATEGY);
BeanItemContainer<DefinedTermBase> termItemContainer = new BeanItemContainer<>(DefinedTermBase.class);
termItemContainer.addAll(terms.getRecords());
public <DTO extends Object> BeanItemContainer<DTO> buildVocabularyTermsItemContainer(UUID vocabularyUuid, BeanToDTOConverter<TermBase, DTO> converter) {
clearSession();
- TermVocabulary vocab = repo.getVocabularyService().find(vocabularyUuid);
+ TermVocabulary<?> vocab = repo.getVocabularyService().find(vocabularyUuid);
Pager<DefinedTermBase> terms = repo.getVocabularyService().getTerms(vocab, null, null, orderHints, INIT_STRATEGY);
BeanItemContainer<DTO> termItemContainer = new BeanItemContainer<>(converter.getDTOType());
termItemContainer.addAll(terms.getRecords().stream().map(b -> converter.toDTO(b)).collect(Collectors.toList()));
BeanItemContainer<TypeDesignationStatusBase> termItemContainer = new BeanItemContainer<>(DefinedTermBase.class);
termItemContainer.addAll(terms.stream()
.filter(t -> t instanceof TypeDesignationStatusBase)
- .map(t -> (TypeDesignationStatusBase)t)
+ .map(t -> (TypeDesignationStatusBase<?>)t)
.filter(tsb ->
!withHasDesignationSource.isPresent()
|| withHasDesignationSource.get().equals(false)
return container;
}
-
@Transactional(readOnly=true)
public <T extends CdmBase> BeanItemContainer<T> buildBeanItemContainer(Class<T> type, List<OrderHint> orderHints) {
public void clearSession() {
repo.clearSession();
}
-
-}
+}
\ No newline at end of file
* @author a.kohlbecker
* @since Jun 7, 2017
*/
-public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends T> implements FilterablePagingProvider<V>, FilterableCountProvider {
+public class CdmFilterablePagingProvider<T extends IdentifiableEntity<?>, V extends T> implements FilterablePagingProvider<V>, FilterableCountProvider {
private static final Logger logger = LogManager.getLogger();
public static final String QUERY_STRING_PLACEHOLDER = "{query-string}";
-
private int pageSize = 20;
private IIdentifiableEntityService<T> service;
private List<OrderHint> orderHints = OrderHint.ORDER_BY_TITLE_CACHE.asList();
- List<String> initStrategy = DEFAULT_INIT_STRATEGY;
+ private List<String> initStrategy = DEFAULT_INIT_STRATEGY;
private List<Criterion> criteria = new ArrayList<>();
private List<Restriction<?>> restrictions = new ArrayList<>();
-
- /**
- * @return the matchMode
- */
protected MatchMode getMatchMode() {
return matchMode;
}
-
- /**
- * @param matchMode the matchMode to set
- */
protected void setMatchMode(MatchMode matchMode) {
this.matchMode = matchMode;
}
- /**
- * @return the orderHints
- */
protected List<OrderHint> getOrderHints() {
return orderHints;
}
-
- /**
- * @param orderHints the orderHints to set
- */
protected void setOrderHints(List<OrderHint> orderHints) {
this.orderHints = orderHints;
}
/**
* With defaults for matchMode = MatchMode.ANYWHERE and orderHints = OrderHint.ORDER_BY_TITLE_CACHE
- *
*/
public CdmFilterablePagingProvider(IIdentifiableEntityService<T> service) {
this(service, null);
/**
* With defaults for matchMode = MatchMode.ANYWHERE and orderHints = OrderHint.ORDER_BY_TITLE_CACHE
- *
*/
public CdmFilterablePagingProvider(IIdentifiableEntityService<T> service, Class<V> type) {
super();
values.add(v);
}
}
- prepared.add(new Restriction(r.getPropertyName(), r.getOperator(), r.getMatchMode(), values.toArray(new Object[values.size()])));
+ prepared.add(new Restriction<>(r.getPropertyName(), r.getOperator(), r.getMatchMode(), values.toArray(new Object[values.size()])));
}
return prepared;
}
}
public CdmFilterablePagingProvider<AgentBase, TeamOrPersonBase> teamOrPersonPagingProvider() {
- return new CdmFilterablePagingProvider<AgentBase, TeamOrPersonBase>(repo.getAgentService(), TeamOrPersonBase.class, MatchMode.BEGINNING, OrderHint.ORDER_BY_TITLE_CACHE.asList());
+ return new CdmFilterablePagingProvider<>(repo.getAgentService(), TeamOrPersonBase.class, MatchMode.BEGINNING, OrderHint.ORDER_BY_TITLE_CACHE.asList());
}
public CdmFilterablePagingProvider<AgentBase, Person> personPagingProvider() {
* @since Jun 26, 2017
*
* TODO better naming of this class, ServiceWrapper, ServiceOperator, ...?
- *
*/
@SpringComponent
@ViewScope
}
-
- /**
- * @param txStatus
- */
public void transactionRollbackIfNotCompleted(TransactionStatus txStatus) {
if(!txStatus.isCompleted()){
repo.getTransactionManager().rollback(txStatus);
}
/**
- *
- * @param bean
* @return a EntityChangeEvent in case the deletion was successful otherwise <code>null</code>.
*/
- public final <T extends CdmBase> EntityChangeEvent deleteBean(T bean, AbstractView view) {
+ public final <T extends CdmBase> EntityChangeEvent<T> deleteBean(T bean, AbstractView<?> view) {
IService<T> typeSpecificService = serviceFor(bean);
logger.trace(this._toString() + ".deleteBean - deleting" + bean.toString());
DeleteResult result = typeSpecificService.delete(bean);
if (result.isOk()) {
- return new EntityChangeEvent(bean, Type.REMOVED, view);
+ return new EntityChangeEvent<>(bean, Type.REMOVED, view);
} else {
- handleDeleteresultInError(result);
+ handleDeleteResultInError(result);
}
} finally {
repo.clearSession(); // #7559
return null;
}
- /**
- * @param result
- */
- public static void handleDeleteresultInError(DeleteResult result) {
+ public static void handleDeleteResultInError(DeleteResult result) {
String notificationTitle;
StringBuffer messageBody = new StringBuffer();
if (result.isAbort()) {
result.getRelatedObjects().forEach(e -> {
messageBody.append("<li>");
if (IdentifiableEntity.class.isAssignableFrom(e.getClass())) {
- messageBody.append(((IdentifiableEntity) e).getTitleCache());
+ messageBody.append(((IdentifiableEntity<?>) e).getTitleCache());
} else {
messageBody.append(e.toString());
}
throw new RuntimeException("Implementation to find service for " + cdmType + " still missing.");
}
}
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since Sep 24, 2018
- *
*/
-public interface FilterableStringRepresentationPagingProvider<IDTYPE> extends FilterablePagingProvider<String> {
+public interface IFilterableStringRepresentationPagingProvider<IDTYPE> extends FilterablePagingProvider<String> {
public IDTYPE idFor(String stringRepresentation);
- /**
- *
- */
public void clearIdCache();
-
-
-}
+}
\ No newline at end of file
return repo;
}
-
@Override
public Registration createRegistration(TaxonName taxonName, List<Registration> preparedBlockingRegistrations) {
return reg;
}
-
@Override
public boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws TypeDesignationSetException {
return null;
}
- /**
- * @param registration
- * @return
- */
@Override
public Registration reloadRegistration(Registration registration) {
if(registration.isPersited()){
return !getRepo().getRegistrationService().checkRegistrationExistsFor(name) && checkWokingsetContainsProtologe(workingset, name);
}
- /**
- * @param name
- * @return
- */
@Override
public boolean checkWokingsetContainsProtologe(RegistrationWorkingSet workingset, TaxonName name) {
Reference nomRef = name.getNomenclaturalReference();
);
// @formatter:on
}
-
-}
+}
\ No newline at end of file
);
@Autowired
- IRegistrationWorkingSetService registrationWorkingSetService;
+ private IRegistrationWorkingSetService registrationWorkingSetService;
@Qualifier("cdmRepository")
@Autowired
- CdmRepository repo;
+ private CdmRepository repo;
@Override
public SpecimenTypeDesignationSetDTO<Registration> create(UUID registrationUuid, UUID typifiedNameUuid) {
protected SpecimenTypeDesignationSetDTO<Registration> specimenTypeDesignationSetDTO(
RegistrationDTO regDTO, VersionableEntity baseEntity) {
+ @SuppressWarnings("rawtypes")
Set<TypeDesignationBase> typeDesignations = regDTO.getTypeDesignationsInWorkingSet(baseEntity);
List<SpecimenTypeDesignation> specimenTypeDesignations = new ArrayList<>(typeDesignations.size());
typeDesignations.forEach(td -> specimenTypeDesignations.add((SpecimenTypeDesignation)td));
fieldUnit = repo.getOccurrenceService().save(fieldUnit);
VersionableEntity baseEntity = bean.getBaseEntity();
+ @SuppressWarnings("rawtypes")
Set<TypeDesignationBase> typeDesignations = regDTO.getTypeDesignationsInWorkingSet(baseEntity);
for(TypeDesignationBase<?> td : typeDesignations){
DerivationEvent de = DerivationEvent.NewInstance(DerivationEventType.GATHERING_IN_SITU());
}
- /**
- * @param dto
- * @param specimenDeleteConfigurer
- * @param std
- */
protected void deleteSpecimenTypeDesignation(SpecimenTypeDesignationSetDTO<? extends VersionableEntity> dto, SpecimenTypeDesignation std) {
// if(dto.getOwner() instanceof Registration){
// }
}
- /**
- * @param session
- * @param fieldUnit
- * @param specimenTypeDesignation
- */
protected void assureFieldUnit(FieldUnit fieldUnit,
SpecimenTypeDesignation specimenTypeDesignation) {
try {
}
}
- /**
- * @param std
- * @return
- * @throws Exception
- */
private SpecimenOrObservationBase<?> findEarliestOriginal(DerivedUnit du) throws Exception {
- SpecimenOrObservationBase original = du;
+ SpecimenOrObservationBase<?> original = du;
while(du != null && du.getDerivedFrom() != null && !du.getDerivedFrom().getOriginals().isEmpty()) {
+ @SuppressWarnings("rawtypes")
Iterator<SpecimenOrObservationBase> it = du.getDerivedFrom().getOriginals().iterator();
- SpecimenOrObservationBase nextOriginal = it.next();
+ SpecimenOrObservationBase<?> nextOriginal = it.next();
if(nextOriginal == null){
break;
}
return addCandidates;
}
- /**
- * {@inheritDoc}
- */
@Override
@Transactional(readOnly=false)
public void delete(SpecimenTypeDesignationSetDTO bean, boolean deleteFieldUnit) {
@SuppressWarnings("unchecked")
List<SpecimenTypeDesignationDTO> specimenTypeDesignationDTOs = bean.getSpecimenTypeDesignationDTOs();
for(SpecimenTypeDesignationDTO stdDTO : specimenTypeDesignationDTOs){
- SpecimenTypeDesignation std = stdDTO.asSpecimenTypeDesignation();
- deleteSpecimenTypeDesignation(bean, std);
- if(bean.getOwner() instanceof Registration){
- ((Registration)bean.getOwner()).getTypeDesignations().remove(std);
- }
+ SpecimenTypeDesignation std = stdDTO.asSpecimenTypeDesignation();
+ deleteSpecimenTypeDesignation(bean, std);
+ if(bean.getOwner() instanceof Registration){
+ ((Registration)bean.getOwner()).getTypeDesignations().remove(std);
+ }
}
if(deleteFieldUnit){
String msg = result.toString();
}
}
-
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Jun 7, 2017
- *
*/
-public class TaxonNameStringFilterablePagingProvider implements FilterableStringRepresentationPagingProvider<UUID>, FilterableCountProvider {
+public class TaxonNameStringFilterablePagingProvider implements IFilterableStringRepresentationPagingProvider<UUID>, FilterableCountProvider {
private static final Logger logger = LogManager.getLogger();
private List<OrderHint> orderHints = OrderHint.ORDER_BY_TITLE_CACHE.asList();
- List<String> initStrategy = DEFAULT_INIT_STRATEGY;
+ private List<String> initStrategy = DEFAULT_INIT_STRATEGY;
private TaxonNamePartsFilter namePartsFilter = new TaxonNamePartsFilter();
registerNullSave(infraSpecificEpithetField, e -> namePartsFilter.setGenusOrUninomial(infraSpecificEpithetField.getValue()));
}
- /**
- *
- */
public void unlistenAllFields() {
for(AbstractField<String> f : registeredToFields.keySet()){
f.removeValueChangeListener(registeredToFields.get(f));
}
}
- /**
- * @param genusOrUninomialField
- */
protected void registerNullSave(AbstractField<String> field, ValueChangeListener listener) {
if(field != null){
registeredToFields.put(field, listener);
}
}
- /**
- * @return the matchMode
- */
protected MatchMode getMatchMode() {
return matchMode;
}
-
- /**
- * @param matchMode the matchMode to set
- */
protected void setMatchMode(MatchMode matchMode) {
this.matchMode = matchMode;
}
- /**
- * @return the orderHints
- */
protected List<OrderHint> getOrderHints() {
return orderHints;
}
-
- /**
- * @param orderHints the orderHints to set
- */
protected void setOrderHints(List<OrderHint> orderHints) {
this.orderHints = orderHints;
}
public TaxonNamePartsFilter getFilter(){
return namePartsFilter;
}
-
- /**
- * {@inheritDoc}
- */
@Override
public List<String> findEntities(int firstRow, String filter) {
return lastPagedEntityUUIDs;
}
-
public class UnknownFieldException extends Exception {
-
private static final long serialVersionUID = 1L;
}
- /**
- * {@inheritDoc}
- */
@Override
public UUID idFor(String stringRepresentation) {
if(stringRepresentation == null){
return lastPagedEntityUUIDs.get(stringRepresentation);
}
- /**
- * {@inheritDoc}
- */
@Override
public void clearIdCache() {
lastPagedEntityUUIDs = null;
}
- /**
- * @param asList
- * @return
- */
public void excludeNames(TaxonName ... excludedTaxonNames) {
namePartsFilter.getExludedNamesUuids();
for(TaxonName n : excludedTaxonNames){
namePartsFilter.getExludedNamesUuids().add(n.getUuid());
}
}
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since May 23, 2017
- *
*/
@SpringComponent
public class UserHelperAccess {
/**
* Static accessor method to obtain the UserHelper bean
- *
- * @return
*/
public static UserHelper userHelper() {
return userHelper;
}
-
-
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since Mar 10, 2017
- *
*/
@Deprecated // FIXME delete also all css styles if any
public class WorkflowSteps extends WorkflowStepsDesign {
+++ /dev/null
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.cdm.vaadin.container;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
-
-/**
- * @author cmathew
- * @since 9 Mar 2015
- *
- * @deprecated unused! should be deleted
- */
-@Deprecated
-public class CdmSpringConnectionPool implements JDBCConnectionPool {
-
- private final Connection conn;
-
- public CdmSpringConnectionPool(Connection conn) {
- this.conn = conn;
- }
-
- @Override
- public void destroy() {
- }
-
- @Override
- public void releaseConnection(Connection conn) {
- }
-
- @Override
- public Connection reserveConnection() throws SQLException {
- return conn;
- }
-}
this.name = name;
}
- /**
- * @return the id
- */
public Object getId() {
return id;
}
- /**
- * @return the uuid
- */
public UUID getUuid() {
return uuid;
}
- /**
- * @return the name
- */
public String getName() {
return name;
}
throw new InvalidValueException(Objects.toString(inReference.getType(), "[NULL]") + " is not a suitable in-reference type for " + Objects.toString(type, "[NULL]") );
}
}
-
}
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Mar 27, 2019
- *
*/
public class NomenclaturalReferenceExistsValidator implements Validator {
-
private static final long serialVersionUID = -7750232876262922982L;
private String userHint = "";
this.userHint = userHint;
}
- /**
- * {@inheritDoc}
- */
@Override
public void validate(Object value) throws InvalidValueException {
if(value != null){
validateName(nameRelDto.getOtherName());
}
}
-
}
- /**
- * @param name
- */
public void validateName(TaxonName name) {
if(name.getNomenclaturalReference() == null) {
throw new InvalidValueException("The taxon name must have a nomenclatural reference. " + userHint);
}
}
-
-}
+}
\ No newline at end of file
}
}
}
-}
+}
\ No newline at end of file
private static final long serialVersionUID = -9048318480638222817L;
- PasswordField firstField;
- PasswordField secondField;
+ private PasswordField firstField;
+ private PasswordField secondField;
- /**
- * @param errorMessage
- */
public PasswordsMatchValidator(String errorMessage, PasswordField firstField, PasswordField secondField) {
super(errorMessage);
this.firstField = firstField;
protected boolean isValidValue(String value) {
return firstField.getValue().equals(secondField.getValue());
}
-
-}
+}
\ No newline at end of file
}
}
}
-
-
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since Mar 27, 2019
- *
*/
public class TimePeriodCompletenesValidator implements Validator {
}
}
}
-}
+}
\ No newline at end of file
private static final long serialVersionUID = 1008554008146041297L;
- Object[] propertyId;
- boolean[] ascending;
+ private Object[] propertyId;
+ private boolean[] ascending;
- /**
- * {@inheritDoc}
- */
@Override
public void setSortProperties(Sortable container, Object[] propertyId, boolean[] ascending) {
this.propertyId = propertyId;
}
- /**
- * {@inheritDoc}
- */
@Override
public int compare(Object itemId1, Object itemId2) {
if(! (itemId1 instanceof CdmEntityInfo && itemId2 instanceof CdmEntityInfo) ){
CdmEntityInfo infoItem2 = (CdmEntityInfo)itemId2;
return infoItem1.getField().getName().compareToIgnoreCase(infoItem2.getField().getName());
-
}
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since May 10, 2017
- *
*/
-public abstract class AbstractEntityEvent<T extends Enum> {
-
- private UUID entityUuid = null;
+public abstract class AbstractEntityEvent<T extends Enum<?>> {
protected T type;
- private AbstractView sourceView = null;
+ private UUID entityUuid = null;
- public AbstractEntityEvent(T type, UUID entityUuid, AbstractView sourceView) {
+ private AbstractView<?> sourceView = null;
+
+ public AbstractEntityEvent(T type, UUID entityUuid, AbstractView<?> sourceView) {
this.entityUuid = entityUuid;
this.type = type;
this.sourceView = sourceView;
}
}
- /**
- * @return the entityId
- */
public UUID getEntityUuid() {
return entityUuid;
}
return type;
}
- /**
- * @return the sourceView
- */
- public AbstractView getSourceView() {
+ public AbstractView<?> getSourceView() {
return sourceView;
}
-
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Apr 25, 2017
- *
*/
public class AuthenticationAttemptEvent implements AuthenticationEvent{
- ClickEvent e;
- String userName;
+ private ClickEvent e;
+ private String userName;
- /**
- * @param e
- * @param userName
- */
public AuthenticationAttemptEvent(ClickEvent e, String userName) {
this.e = e;
this.userName = userName;
}
- /**
- * @return the e
- */
public ClickEvent getE() {
return e;
}
- /**
- * @return the userName
- */
public String getUserName() {
return userName;
}
-
-
-
-}
+}
\ No newline at end of file
* These terms are specific to the phycobank project but are temporarily necessary in
* cdmlib-services for {@link SpecimenTypeDesignationDTO}
*
- *
* @author a.kohlbecker
* @since Jun 20, 2017
- *
*/
public class KindOfUnitTerms {
this.representation = representation;
}
- /**
- * @return the representation
- */
public String getRepresentation() {
return representation;
}
- /**
- * @return the stepIndex
- */
public int getStepIndex() {
return stepIndex;
}
}
}
}
-}
+}
\ No newline at end of file
logger.debug("allowing view by fall through, no check performed");
return true;
}
-}
+}
\ No newline at end of file
* @author a.kohlbecker
* @since Apr 24, 2017
*
- *
* (FIMXE 1. consider renaming this class and its interface, since it is no longer annotation based!!!!)
*
* FIMXE 2. this class should implement ViewAccessControl. The view class and annotations can be accessed
/**
* @author a.kohlbecker
* @since Apr 24, 2017
- *
*/
@Configuration
public class AnnotationBasedAccessControlConfiguration {
*
* @author a.kohlbecker
* @since Apr 20, 2018
- *
*/
public class CdmEditDeletePermissionTester implements EditPermissionTester {
@Override
*
* @author a.kohlbecker
* @since Oct 11, 2017
- *
*/
@SpringComponent
@Profile("debug")
button.addClickListener(e -> UserHelperAccess.userHelper().createAuthorityFor(UserHelperAccess.userHelper().userName(), cdmType, entitiyUuid, crud, property));
button.addStyleName(ValoTheme.BUTTON_DANGER);
return button;
-
}
-
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since 25.10.2017
- *
*/
public interface ReleasableResourcesView {
/**
* @author a.kohlbecker
* @since Apr 28, 2017
- *
*/
public class PartialFormatter {
private DateTimeFormat format;
- private static final DateTimeFormatter dmyDotDayMonthYear = org.joda.time.format.DateTimeFormat.forPattern("dd.MM.y");
+ private static final DateTimeFormatter dmyDotDayMonthYear = org.joda.time.format.DateTimeFormat.forPattern("dd.MM.y");
- private static final DateTimeFormatter dmyDotMonthYear = org.joda.time.format.DateTimeFormat.forPattern("MM.y");
+ private static final DateTimeFormatter dmyDotMonthYear = org.joda.time.format.DateTimeFormat.forPattern("MM.y");
- private static final DateTimeFormatter dmyDotYear = org.joda.time.format.DateTimeFormat.forPattern("y");
+ private static final DateTimeFormatter dmyDotYear = org.joda.time.format.DateTimeFormat.forPattern("y");
public PartialFormatter(DateTimeFormat format) {
this.format = format;
}
}
- /**
- * @param partial
- * @return
- */
private DateTimeFormatter determine_ISO860_Formatter(Partial partial) {
if (partial.isSupported(TimePeriod.DAY_TYPE)) {
return ISODateTimeFormat.yearMonthDay();
return ISODateTimeFormat.yearMonth();
}
return ISODateTimeFormat.year();
-
}
- /**
- * @param partial
- * @return
- */
private DateTimeFormatter determine_DMY_DOT_Formatter(Partial partial) {
if (partial.isSupported(TimePeriod.DAY_TYPE)) {
return dmyDotDayMonthYear;
return dmyDotMonthYear;
}
return dmyDotYear;
-
}
-
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Apr 26, 2017
- *
*/
public class TimePeriodFormatter {
return sb.toString();
}
}
-
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Mar 20, 2017
- *
*/
-public abstract class AbstractPageView<P extends AbstractPresenter> extends AbstractView<P> {
+public abstract class AbstractPageView<P extends AbstractPresenter<?>> extends AbstractView<P> {
+
+ private static final long serialVersionUID = -8669483572788112285L;
private VerticalLayout layout;
private Label header;
-
- /**
- *
- */
public AbstractPageView() {
layout = new VerticalLayout();
layout.setSizeFull();
this.setSizeFull();
}
- /**
- *
- */
public void updateHeader() {
header.setValue("<div id=\"header\">" + getHeaderText() + "</div><div id=\"subheader\">" + getSubHeaderText() + "</div>");
}
for(Component c : contentComponents){
layout.removeComponent(c);
}
-
}
protected void addContentComponent(Component component, Float expandRatio){
}
}
-
-
/**
* Provides the sub header text
- *
- * @return
*/
protected abstract String getHeaderText();
/**
* Provides the header text
- *
- * @return
*/
protected abstract String getSubHeaderText();
-
-
-}
+}
\ No newline at end of file
protected EventBus.UIEventBus uiEventBus;
- AccountCreationRequest accountCreationRequest = null;
+ private AccountCreationRequest accountCreationRequest = null;
@Autowired
protected void setUIEventBus(EventBus.UIEventBus uiEventBus){
/**
* @author a.kohlbecker
* @since Jun 25, 2018
- *
*/
public interface AnnotationsEditor {
/**
- *
* @return the EDITABLE_ANOTATION_TYPES
*/
public AnnotationType[] getEditableAnotationTypes();
*/
public void setEditableAnotationTypes(AnnotationType... editableAnotationTypes);
- /**
- * @return
- */
public FilterableAnnotationsField getAnnotationsField();
}
\ No newline at end of file
public static final String NAME = "error";
@Autowired
- NavigationManager navigationManager;
+ private NavigationManager navigationManager;
private static final long serialVersionUID = -8763747518841365925L;
setComponentAlignment(header, Alignment.MIDDLE_CENTER);
}
- /**
- * {@inheritDoc}
- */
@Override
public void enter(ViewChangeEvent event) {
-
}
-
-}
+}
\ No newline at end of file
}
}
- private void requestPasswordReset() throws MalformedURLException, ExecutionException {
+ private void requestPasswordReset() throws MalformedURLException {
String userNameOrEmail = getView().getLoginDialog().getUserNameOrEmail().getValue();
URL servletBaseUrl = VaadinServletUtilities.getServletBaseUrl();
logger.debug("UserAccountAction.REQUEST_PASSWORD_RESET for " + servletBaseUrl + ", userNameOrEmail:" + userNameOrEmail);
}
}
- private void requestAccountCreation() throws MalformedURLException, MailException, AddressException, AccountSelfManagementException, ExecutionException {
+ private void requestAccountCreation() throws MalformedURLException, MailException, AddressException, AccountSelfManagementException {
String emailAddress = getView().getLoginDialog().getEmail().getValue();
URL servletBaseUrl = VaadinServletUtilities.getServletBaseUrl();
- logger.debug("UserAccountAction.REGISTER_ACCOUNT for " + servletBaseUrl + ", emailAddress:" + emailAddress);
+ if (logger.isDebugEnabled()) {logger.debug("UserAccountAction.REGISTER_ACCOUNT for " + servletBaseUrl + ", emailAddress:" + emailAddress);}
CountDownLatch finshedSignal = new CountDownLatch(1);
List<Throwable> asyncExceptions = new ArrayList<>(1);
}
}
}
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.vaadin.view;
-import com.vaadin.ui.themes.ValoTheme;
-
import eu.etaxonomy.cdm.vaadin.component.LoginDialog;
import eu.etaxonomy.vaadin.mvp.ApplicationView;
/**
* @author a.kohlbecker
* @since Apr 25, 2017
- *
*/
public interface LoginView extends ApplicationView<LoginPresenter> {
- LoginDialog getLoginDialog();
-
- void clearMessage();
+ public LoginDialog getLoginDialog();
- void showErrorMessage(String text);
+ public void clearMessage();
-}
+ public void showErrorMessage(String text);
+}
\ No newline at end of file
* @since Apr 25, 2017
*/
@SpringView(name=LoginViewBean.NAME)
-public class LoginViewBean extends AbstractView<LoginPresenter> implements LoginView, View {
+public class LoginViewBean
+ extends AbstractView<LoginPresenter>
+ implements LoginView, View {
private static final long serialVersionUID = 8527714663738364972L;
protected EventBus.UIEventBus uiEventBus;
- PasswordResetRequest resetRequest = null;
+ private PasswordResetRequest resetRequest = null;
@Autowired
protected void setUIEventBus(EventBus.UIEventBus uiEventBus){
getView().showErrorMessage("A timeout has occured, please try again.");
}
}
-
}
}
-}
+}
\ No newline at end of file
public void showErrorMessage(String text);
- void setUserName(String userName);
+ public void setUserName(String userName);
- PasswordField getPassword1Field();
-
-
-}
+ public PasswordField getPassword1Field();
+}
\ No newline at end of file
public PasswordField getPassword1Field() {
return password1Field;
}
-
-
-
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since 20.10.2017
- *
*/
public interface PerEntityAuthorityGrantingEditor {
*/
public void grantToCurrentUser(EnumSet<CRUD> crud);
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Jul 13, 2017
- *
*/
@SpringComponent
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class RedirectToLoginView extends VerticalLayout implements View {
-
private static final long serialVersionUID = -8763747518841365925L;
@Autowired
- NavigationManager navigationManager;
+ private NavigationManager navigationManager;
@Autowired
protected EventBus.UIEventBus uiEventBus;
setComponentAlignment(header, Alignment.MIDDLE_CENTER);
}
- /**
- * {@inheritDoc}
- */
@Override
public void enter(ViewChangeEvent event) {
uiEventBus.publish(this, new NavigationEvent(LoginViewBean.NAME, currentState));
}
}
-
-}
+}
\ No newline at end of file
return bean;
}
- /**
- * {@inheritDoc}
- */
@Override
protected void guaranteePerEntityCRUDPermissions(UUID identifier) {
if(crud != null){
newAuthorityCreated = UserHelperAccess.userHelper().createAuthorityForCurrentUser(Collection.class, identifier, crud, null);
}
-
}
- /**
- * {@inheritDoc}
- */
@Override
protected void guaranteePerEntityCRUDPermissions(Institution bean) {
if(crud != null){
newAuthorityCreated = UserHelperAccess.userHelper().createAuthorityForCurrentUser(bean, crud, null);
}
-
}
- /**
- * {@inheritDoc}
- */
@Override
protected IService<Institution> getService() {
// TODO Auto-generated method stub
return null;
}
- /**
- * {@inheritDoc}
- */
@Override
public void handleViewEntered() {
super.handleViewEntered();
getView().getPartOfCombobox().reload();
}
}
-
}
}
}
- /**
- * {@inheritDoc}
- */
@Override
protected InstitutionDTO createDTODecorator(Institution cdmEntitiy) {
return new InstitutionDTO(cdmEntitiy);
}
- /**
- * {@inheritDoc}
- */
@Override
protected BeanInstantiator<Institution> defaultCdmEntityInstantiator() {
- return new BeanInstantiator<Institution>(){
+ return new BeanInstantiator<Institution>(){
@Override
public Institution createNewBean() {
return Institution.NewInstance();
}
-
};
}
-
-
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since Dec 21, 2017
- *
*/
@SpringComponent
@Scope("prototype")
private static final int GRID_ROWS = 3;
- TextField codeField;
- TextField codeStandardField;
- TextField townOrLocationField;
- ToOneRelatedEntityCombobox<Institution> partOfCombobox;
+ private TextField codeField;
+ private TextField codeStandardField;
+ private TextField townOrLocationField;
+ private ToOneRelatedEntityCombobox<Institution> partOfCombobox;
-
- /**
- * @param layout
- * @param dtoType
- */
public InstitutionPopupEditor() {
super(new GridLayout(GRID_COLS, GRID_ROWS), InstitutionDTO.class);
}
- /**
- * {@inheritDoc}
- */
@Override
public String getWindowCaption() {
return "Institution editor";
}
- /**
- * {@inheritDoc}
- */
@Override
public int getWindowWidth() {
return 500;
}
- /**
- * {@inheritDoc}
- */
@Override
public void focusFirst() {
codeField.focus();
}
- /**
- * {@inheritDoc}
- */
@Override
protected String getDefaultComponentStyles() {
return "tiny";
}
- /**
- * {@inheritDoc}
- */
@Override
protected void initContent() {
row++;
- partOfCombobox = new ToOneRelatedEntityCombobox<Institution>("Part of", Institution.class);
+ partOfCombobox = new ToOneRelatedEntityCombobox<>("Part of", Institution.class);
partOfCombobox.setWidth(300, Unit.PIXELS);
);
}
});
-
}
/* ------------------ View Interface methods -------------------- */
public ToOneRelatedEntityCombobox<Institution> getPartOfCombobox(){
return partOfCombobox;
}
-}
+}
\ No newline at end of file
EntityChangeEvent<?> changeEvent = new EntityChangeEvent<>(bean, Type.REMOVED, (AbstractView<?>) getView());
viewEventBus.publish(this, changeEvent);
} else {
- CdmStore.handleDeleteresultInError(deletResult);
+ CdmStore.handleDeleteResultInError(deletResult);
}
}
specimenTypeDesignationSetService.save(dto);
}
- /**
- * {@inheritDoc}
- */
@Override
protected void deleteBean(SpecimenTypeDesignationSetDTO bean) {
specimenTypeDesignationSetService.delete(bean, true);
}
- /**
- * @param element
- * @return
- */
private void addTypeDesignation(SpecimenTypeDesignationDTO element) {
getView().updateAllowDeleteTypeDesignation();
}
* The actual deletion of the SpecimenTypeDesignation and DerivedUnit will take place in {@link #saveBean(SpecimenTypeDesignationSetDTO)}
*
* TODO once https://dev.e-taxonomy.eu/redmine/issues/7077 is fixed dissociating from the Registration could be removed here
- *
- * @param e
- * @return
*/
private void deleteTypeDesignation(SpecimenTypeDesignationDTO element) {
getView().updateAllowDeleteTypeDesignation();
}
- /**
- * @param crud
- */
public void setGrantsForCurrentUser(EnumSet<CRUD> crud) {
this.crud = crud;
}
- /**
- * {@inheritDoc}
- */
@Override
public ICdmEntityUuidCacher getCache() {
return cache;
@EventBusListenerMethod(filter = EntityChangeEventFilter.OccurrenceCollectionFilter.class)
- public void onCollectionEvent(EntityChangeEvent event){
+ public void onCollectionEvent(EntityChangeEvent<?> event){
if(event.getSourceView() instanceof AbstractPopupEditor) {
# Vaadin UI and Spring based MVP Framework
-* `./ui` *A VaadinSpring bases MVP framework with popup views and editors with easy data binding.*
+* `./ui` *A VaadinSpring based MVP framework with popup views and editors with easy data binding.*
* `./mvp` *A spring based UI framework for Vaadin which brings a responsive menu layout and support for the mvp popup views.*
-These framework is based on ideas of Peter Letho from Vaadin:
-* ["Supporting mobile, desktop and tablet by building impressive layout systems"](https://www.youtube.com/watch?v=zKJ7tkLS8XE). The according source code is here https://github.com/peterl1084/devday2016" a the Vaadin DevDay 2016. The original framework was using Java Web Beans (CDI) which has been ported to Spring DI for this project.
-* **devday-spring** a VaadinSpring based example project with MVP integration - the according soure code is here https://github.com/peterl1084/devday-spring
+This framework is based on ideas of Peter Letho from Vaadin:
+* ["Supporting mobile, desktop and tablet by building impressive layout systems"](https://www.youtube.com/watch?v=zKJ7tkLS8XE). The according source code is here https://github.com/peterl1084/devday2016" at the Vaadin DevDay 2016. The original framework was using Java Web Beans (CDI) which has been ported to Spring DI for this project.
+* **devday-spring** a VaadinSpring based example project with MVP integration - the according source code is here https://github.com/peterl1084/devday-spring
* @since May 12, 2017
*
* IMPORTANT see also {@link CompositeStyledComponent} which has almost the same functionality.
- *
*/
@SuppressWarnings("serial")
public abstract class CompositeCustomField<T> extends CustomField<T> implements NestedFieldGroup {
* @since May 22, 2017
*
* IMPORTANT see also {@link CompositeCustomField} which has almost the same functionality.
- *
*/
@SuppressWarnings("serial")
public abstract class CompositeStyledComponent extends CssLayout {
/**
* Implementations preferably call this method in the constructor
- *
- * @param component
- * @return
*/
- protected boolean addStyledComponents(Component ... component){
- List<Component> componentList = Arrays.asList(component);
+ protected boolean addStyledComponents(Component ... components){
+ List<Component> componentList = Arrays.asList(components);
componentList.forEach(c -> applyCurrentStyleNames(c));
return styledComponents.addAll(componentList);
}
* to prevent these styles from being overwritten when setStyleName() id called on the composite field.
*/
protected abstract void addDefaultStyles();
- //--------
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since Dec 11, 2017
- *
*/
public abstract class EntityFieldInstantiator<F> {
*/
package eu.etaxonomy.vaadin.component;
+import com.vaadin.data.Property.ValueChangeListener;
+
/**
* Interface to ship around equality problems of entities which have modified data.
*
*
* @param bean
*/
- void replaceEntityValue(V bean);
+ public void replaceEntityValue(V bean);
}
\ No newline at end of file
import eu.etaxonomy.cdm.vaadin.model.name.NameRelationshipDTO;
import eu.etaxonomy.cdm.vaadin.util.ReferenceEllypsisCaptionGenerator;
-
/**
* @author a.kohlbecker
* @since May 3, 2018
- *
*/
public class NameRelationField extends CompositeCustomField<NameRelationshipDTO> {
- /**
- *
- */
public static final String PRIMARY_STYLE = "v-name-relation-field";
private static final long serialVersionUID = -7080885013120044655L;
private BeanFieldGroup<NameRelationshipDTO> fieldGroup = new BeanFieldGroup<>(NameRelationshipDTO.class);
- ToOneRelatedEntityCombobox<TaxonName> relatedNameComboBox;
+ private ToOneRelatedEntityCombobox<TaxonName> relatedNameComboBox;
- ToOneRelatedEntityCombobox<Reference> citatonComboBox;
+ private ToOneRelatedEntityCombobox<Reference> citatonComboBox;
- TextFieldNFix citationMicroReferenceField = new TextFieldNFix();
+ private TextFieldNFix citationMicroReferenceField = new TextFieldNFix();
- TextFieldNFix ruleConsideredField = new TextFieldNFix();
+ private TextFieldNFix ruleConsideredField = new TextFieldNFix();
- NativeSelect codeEditionSelect = new NativeSelect();
+ private NativeSelect codeEditionSelect = new NativeSelect();
private Direction direction;
private String nameFieldCaption;
- /**
- * @param string
- */
public NameRelationField(String caption, String nameFieldCaption, Direction direction, NameRelationshipType type) {
this.direction = direction;
this.type = type;
return compositeWrapper;
}
- /**
- * {@inheritDoc}
- */
@Override
public Class<NameRelationshipDTO> getType() {
return NameRelationshipDTO.class;
}
- /**
- * {@inheritDoc}
- */
@Override
protected void setInternalValue(NameRelationshipDTO newValue) {
}
-
private void updateToolBarButtonStates(){
boolean hasValue = getValue() != null;
removeButton.setVisible(hasValue);
newButton.setVisible(!hasValue);
}
- /**
- * @return the relatedNameComboBox
- */
public ToOneRelatedEntityCombobox<TaxonName> getRelatedNameComboBox() {
return relatedNameComboBox;
}
- /**
- * @return the citatonComboBox
- */
public ToOneRelatedEntityCombobox<Reference> getCitatonComboBox() {
return citatonComboBox;
}
return codeEditionSelect;
}
- /**
- * {@inheritDoc}
- */
@Override
public void setReadOnly(boolean readOnly) {
super.setReadOnly(readOnly);
setDeepReadOnly(readOnly, grid, null);
setDeepReadOnly(readOnly, toolBar, null);
}
-
-
-}
+}
\ No newline at end of file
private ReloadableLazyComboBoxInstantiator<Reference> referenceSelectInstantiator;
- /**
- * @param itemType
- * @param caption
- */
public NameRelationsListEditor(String caption) {
super(NameRelationshipDTO.class, null, caption);
this.fieldType = NameRelationField.class;
referenceSelectInstantiator = new ReloadableLazyComboBoxInstantiator<Reference>(Reference.class);
}
- /**
- * {@inheritDoc}
- */
// @Override
// protected NameRelationField newFieldInstance(NameRelationshipDTO val) throws InstantiationException, IllegalAccessException {
//
setInternalValue(null);
}
- /**
- * @param cdmTitleCacheCaptionGenerator
- */
public void setTaxonNameCaptionGenerator(CaptionGenerator<TaxonName> captionGenerator) {
nameSelectInstantiator.setCaptionGenerator(captionGenerator);
}
setInternalValue(null);
}
- /**
- * @param cdmTitleCacheCaptionGenerator
- */
public void setReferenceCaptionGenerator(CaptionGenerator<Reference> captionGenerator) {
referenceSelectInstantiator.setCaptionGenerator(captionGenerator);
}
-
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since May 12, 2017
- *
*/
public interface NestedFieldGroup {
public abstract void registerParentFieldGroup(FieldGroup parent);
- /**
- * @param parent
- */
public abstract void unregisterParentFieldGroup(FieldGroup parent);
}
*/
public void reload();
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since May 11, 2017
- *
*/
public class SwitchButton extends Switch {
super();
}
- /**
- * {@inheritDoc}
- */
@Override
protected void setInternalValue(Boolean newValue) {
super.setInternalValue(newValue);
public void setValueSetLister(ValueChangeListener valueSetListener){
this.valueSetListener = valueSetListener;
}
-
}
\ No newline at end of file
*
* @author a.kohlbecker
* @since Jun 7, 2017
- *
*/
public class ToManyRelatedEntitiesComboboxSelect<V extends Object> extends ToManyRelatedEntitiesListSelect<V, ReloadableLazyComboBox<V>> {
private ReloadableLazyComboBoxInstantiator<V> fieldInstantiator;
- /**
- * @param itemType
- * @param fieldType
- * @param caption
- */
public ToManyRelatedEntitiesComboboxSelect(Class<V> itemType, String caption) {
super(itemType, null, caption);
// TODO this.fieldTyp = LazyComboBox.class does not work
this.fieldType = (Class<ReloadableLazyComboBox<V>>) field.getClass();
// addEmptyRowOnInitContent is false in this class since adding row is only possible after setting the PagingProviders
addEmptyRowOnInitContent = false;
- fieldInstantiator = new ReloadableLazyComboBoxInstantiator<V>(itemType);
+ fieldInstantiator = new ReloadableLazyComboBoxInstantiator<>(itemType);
}
- /**
- * {@inheritDoc}
- */
@Override
protected ReloadableLazyComboBox<V> newFieldInstance(V val) throws InstantiationException, IllegalAccessException {
setInternalValue(null);
}
- /**
- * @param cdmTitleCacheCaptionGenerator
- */
public void setCaptionGenerator(CaptionGenerator<V> captionGenerator) {
fieldInstantiator.setCaptionGenerator(captionGenerator);
}
-
-}
+}
\ No newline at end of file
*
* @author a.kohlbecker
* @since May 11, 2017
- *
*/
public class ToManyRelatedEntitiesListSelect<V extends Object, F extends AbstractField<V>> extends CompositeCustomField<List<V>> {
}
/**
- *
* @return an unmodifiable List of the data Fields
*/
protected List<F> fields() {
- Integer row = null;
List<F> fields = new ArrayList<>();
for(int r = 0; r < grid.getRows(); r++){
fields.add((F) grid.getComponent(GRID_X_FIELD, r));
return fields;
}
- /**
- * @param field
- * @return
- */
private void addRowAfter(F field) {
List<V> nestedValues = getValueFromNestedFields();
}
- /**
- * @param field
- * @return
- */
private void removeRow(F field) {
Integer row = findRow(field);
class ButtonGroup extends CssLayout{
+ private static final long serialVersionUID = 8156121271630852750L;
private Button editOrCreate;
ButtonGroup (F field){
}
- /**
- * @param e
- * @return
- */
private void editOrCreate(F field) {
if(editActionListener == null){
}
}
- /**
- * @param isWritable
- * @param field
- * @return
- */
public boolean isWritableField(F field) {
boolean isWritable = !getState().readOnly;
return isWritable && (field.getValue() == null
|| field.getValue() != null && testEditButtonPermission(field.getValue()));
}
- /**
- * @param field
- * @return
- */
protected boolean testEditButtonPermission(Object rowValue) {
if(editPermissionTester != null) {
return editPermissionTester.userHasEditPermission(rowValue);
}
}
-
protected List<F> getNestedFields(){
List<F> nestedFields = new ArrayList<>(grid.getRows());
for(int r = 0; r < grid.getRows(); r++){
+ @SuppressWarnings("unchecked")
F f = (F) grid.getComponent(GRID_X_FIELD, r);
if(f == null){
logger.debug(String.format("NULL field at %d,%d", GRID_X_FIELD, r));
return Collections.unmodifiableList(nestedFields);
}
- /**
- *
- * @param val
- * @return
- * @throws InstantiationException
- * @throws IllegalAccessException
- */
protected F newFieldInstance(V val) throws InstantiationException, IllegalAccessException {
F field;
parentFieldGroup = parent;
}
- /**
- * {@inheritDoc}
- */
@Override
public void commit() throws SourceException, InvalidValueException {
// }
}
- /**
- * {@inheritDoc}
- */
@Override
public void setWidth(String width) {
super.setWidth(width);
}
}
- /**
- * {@inheritDoc}
- */
@Override
protected void addDefaultStyles() {
// no default styles
}
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean hasNullContent() {
- for(Field f : getNestedFields()){
+ for(Field<?> f : getNestedFields()){
if(f instanceof CompositeCustomField){
- if(!((CompositeCustomField)f).hasNullContent()){
+ if(!((CompositeCustomField<?>)f).hasNullContent()){
return false;
}
}
return true;
}
- /**
- * @return the enityFieldInstantiator
- */
public EntityFieldInstantiator<F> getEntityFieldInstantiator() {
return entityFieldInstantiator;
}
-
- /**
- * @param enityFieldInstantiator the enityFieldInstantiator to set
- */
public void setEntityFieldInstantiator(EntityFieldInstantiator<F> entityFieldInstantiator) {
this.entityFieldInstantiator = entityFieldInstantiator;
}
- /**
- * {@inheritDoc}
- */
@Override
public void setReadOnly(boolean readOnly) {
super.setReadOnly(readOnly);
updateComponentStates();
}
-
- /**
- * @return the editPermissionTester
- */
public EditPermissionTester getEditPermissionTester() {
return editPermissionTester;
}
-
- /**
- * @param editPermissionTester the editPermissionTester to set
- */
public void setEditPermissionTester(EditPermissionTester editPermissionTester) {
this.editPermissionTester = editPermissionTester;
}
- /**
- * @return the editActionListener
- */
public EntityEditorActionListener getEditActionListener() {
return editActionListener;
}
-
- /**
- * @param editActionListener the editActionListener to set
- */
public void setEditActionListener(EntityEditorActionListener editActionListener) {
this.editActionListener = editActionListener;
}
-
-}
+}
\ No newline at end of file
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.permission.CRUD;
-import eu.etaxonomy.cdm.service.FilterableStringRepresentationPagingProvider;
+import eu.etaxonomy.cdm.service.IFilterableStringRepresentationPagingProvider;
import eu.etaxonomy.cdm.service.UserHelperAccess;
import eu.etaxonomy.cdm.vaadin.component.ButtonFactory;
import eu.etaxonomy.cdm.vaadin.event.NestedButtonStateUpdater;
private WeaklyRelatedEntityButtonUpdater buttonUpdater;
- private FilterableStringRepresentationPagingProvider<UUID> filterablePagingProvider;
+ private IFilterableStringRepresentationPagingProvider<UUID> filterablePagingProvider;
public WeaklyRelatedEntityCombobox(String caption, Class<V> type){
this.type = type;
*/
public void loadFrom(FilterablePagingProvider<String> filterablePagingProvider, FilterableCountProvider filterableCountProvider, int pageLength) {
- this.filterablePagingProvider = (FilterableStringRepresentationPagingProvider<UUID>) filterablePagingProvider;
+ this.filterablePagingProvider = (IFilterableStringRepresentationPagingProvider<UUID>) filterablePagingProvider;
lazySelect.loadFrom(filterablePagingProvider, filterableCountProvider, pageLength);
buttonUpdater.updateButtons(getValue());
}
* user to perform the <code>action</code> transported with this event.
*
* @author a.kohlbecker
- *
*/
public class EntityEditorActionEvent<T> {
private AbstractField<T> field;
private T bean;
- /**
- * @param type
- * @param entityId
- * @param field
- */
public EntityEditorActionEvent(EditorActionType action, Class<T> beanType, AbstractField<T> field) {
this.action = action;
this.beanType = beanType;
this.field = field;
}
- /**
- *
- * @param type
- * @param entityId
- * @param field
- */
public EntityEditorActionEvent(EditorActionType action, Class<T> beanType, T bean, AbstractField<T> field) {
this.action = action;
this.beanType = beanType;
this.field = field;
}
- /**
- * @return the beanType
- */
public Class<?> getBeanType() {
return beanType;
}
- /**
- * @return the action
- */
public EditorActionType getAction() {
return action;
}
return field;
}
- /**
- * @return the bean
- */
public T getBean() {
return bean;
}
-
-}
+}
\ No newline at end of file
* @param <V>
* type of the view this presenter governs
*/
-public abstract class AbstractPresenter<V extends ApplicationView> implements Serializable, DisposableBean {
-
- private static final Logger logger = LogManager.getLogger();
+public abstract class AbstractPresenter<V extends ApplicationView<?>>
+ implements Serializable, DisposableBean {
private static final long serialVersionUID = 5260910510283481832L;
+ private static final Logger logger = LogManager.getLogger();
+
private V view;
protected V getView() {
return viewEventBus;
}
- @Override
+ @Override
public void releaseResourcesOnAccessDenied() {
getPresenter().onViewExit();
}
* An interface to be implemented by the specific view interface definitions.
* See https://dev.e-taxonomy.eu/redmine/projects/edit/wiki/VaadinNotes#Model-View-Presenter-MVP-Pattern
*/
-public interface ApplicationView<P extends AbstractPresenter> {
+public interface ApplicationView<P extends AbstractPresenter<?>> {
}
*
* @author a.kohlbecker
* @since May 30, 2017
- *
*/
public class ApplicationListenerPojoMethodAdapter extends ApplicationListenerMethodAdapter {
- PojoEventListenerManager eventListenerManager = null;
-
private Object o;
- /**
- * @param beanName
- * @param targetClass
- * @param method
- */
public ApplicationListenerPojoMethodAdapter(String beanName, Class<?> targetClass, Method method, Object o) {
super(beanName, targetClass, method);
this.o = o;
}
- /**
- * {@inheritDoc}
- */
@Override
protected Object getTargetBean() {
return o;
}
-
-
-
-}
+}
\ No newline at end of file
listenerMap.get(o).add(applicationListener);
}
- /**
- * {@inheritDoc}
- */
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
-
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since May 29, 2017
- *
*/
public interface PojoEventListenerManager {
- void removeEventListeners(Object o);
+ public void removeEventListeners(Object o);
- void addEventListeners(Object o);
-
-}
+ public void addEventListeners(Object o);
+}
\ No newline at end of file