use of eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityType in project midpoint by Evolveum.
the class AddCapabilityDialog method initLayout.
private void initLayout(WebMarkupContainer container) {
List<IColumn<CapabilityDto<CapabilityType>, String>> columns = initColumns();
TablePanel<CapabilityDto<CapabilityType>> table = new TablePanel<>(ID_TABLE, createProvider(), columns);
table.setOutputMarkupId(true);
table.setShowPaging(false);
container.add(table);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL, createStringResource("addCapabilityDialog.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
cancelPerformed(ajaxRequestTarget);
}
};
container.add(cancelButton);
AjaxButton addButton = new AjaxButton(ID_ADD, createStringResource("addCapabilityDialog.button.Add")) {
@Override
public void onClick(AjaxRequestTarget target) {
addPerformed(target);
}
};
container.add(addButton);
}
use of eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityType in project UVMS-ExchangeModule-APP by UnionVMS.
the class MockData method getCapabilityList.
public static CapabilityListType getCapabilityList() {
CapabilityListType dto = new CapabilityListType();
CapabilityType capability = new CapabilityType();
capability.setType(CapabilityTypeType.POLLABLE);
capability.setValue("TRUE");
dto.getCapability().add(capability);
return dto;
}
use of eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityType in project UVMS-ExchangeModule-APP by UnionVMS.
the class ServiceMapper method toCapabilityModel.
private static CapabilityType toCapabilityModel(ServiceCapability capability) {
CapabilityType model = new CapabilityType();
model.setType(capability.getCapability());
model.setValue(capability.getValue());
return model;
}
use of eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityType in project UVMS-ExchangeModule-APP by UnionVMS.
the class ServiceMapper method toModel.
public static CapabilityType toModel(ServiceCapability entity) {
CapabilityType type = new CapabilityType();
type.setType(entity.getCapability());
type.setValue(entity.getValue());
return type;
}
use of eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityType in project midpoint by Evolveum.
the class AddCapabilityDialog method loadModel.
private List<CapabilityDto<CapabilityType>> loadModel(IModel<CapabilityStepDto> capabilityModel) {
List<Class<? extends CapabilityType>> existingCapabilityClasses = new ArrayList<>();
for (CapabilityDto cap : capabilityModel.getObject().getCapabilities()) {
existingCapabilityClasses.add(cap.getCapability().getClass());
}
List<CapabilityDto<CapabilityType>> rv = new ArrayList<>();
for (Capability supportedCapability : Capability.values()) {
if (!existingCapabilityClasses.contains(supportedCapability.getClazz())) {
// 'among natives' doesn't matter here
rv.add(new CapabilityDto<>(CapabilityStep.fillDefaults(supportedCapability.newInstance()), false));
}
}
return rv;
}
Aggregations