use of org.phoenicis.repository.dto.TypeDTO in project phoenicis by PhoenicisOrg.
the class EnginesController method populateView.
private void populateView(RepositoryDTO repositoryDTO) {
Platform.runLater(() -> {
List<CategoryDTO> categoryDTOS = new ArrayList<>();
for (TypeDTO typeDTO : repositoryDTO.getTypes()) {
if (typeDTO.getId().equals("Engines")) {
categoryDTOS = typeDTO.getCategories();
}
}
setDefaultEngineIcons(categoryDTOS);
enginesSource.fetchAvailableEngines(categoryDTOS, versions -> Platform.runLater(() -> this.enginesView.populate(versions)));
});
}
use of org.phoenicis.repository.dto.TypeDTO in project POL-POM-5 by PhoenicisOrg.
the class EnginesController method populateView.
private void populateView(RepositoryDTO repositoryDTO) {
Platform.runLater(() -> {
List<CategoryDTO> categoryDTOS = new ArrayList<>();
for (TypeDTO typeDTO : repositoryDTO.getTypes()) {
if (typeDTO.getId().equals("Engines")) {
categoryDTOS = typeDTO.getCategories();
}
}
setDefaultEngineIcons(categoryDTOS);
enginesSource.fetchAvailableEngines(categoryDTOS, versions -> Platform.runLater(() -> this.enginesView.populate(versions)));
});
}
use of org.phoenicis.repository.dto.TypeDTO in project POL-POM-5 by PhoenicisOrg.
the class EngineToolsManager method fetchAvailableEngineTools.
/**
* fetches the available engine tools
* @param repositoryDTO
* @param callback
*/
public void fetchAvailableEngineTools(RepositoryDTO repositoryDTO, Consumer<Map<String, ApplicationDTO>> callback) {
Map<String, ApplicationDTO> tools = new HashMap<>();
// get engine CategoryDTOs
List<CategoryDTO> categoryDTOS = new ArrayList<>();
for (TypeDTO typeDTO : repositoryDTO.getTypes()) {
if (typeDTO.getId().equals("Engines")) {
categoryDTOS = typeDTO.getCategories();
}
}
for (CategoryDTO engine : categoryDTOS) {
for (ApplicationDTO applicationDTO : engine.getApplications()) {
if (applicationDTO.getId().equals("Tools")) {
tools.put(engine.getId(), applicationDTO);
}
}
}
callback.accept(tools);
}
use of org.phoenicis.repository.dto.TypeDTO in project phoenicis by PhoenicisOrg.
the class EngineToolsManager method fetchAvailableEngineTools.
/**
* fetches the available engine tools
* @param repositoryDTO
* @param callback
*/
public void fetchAvailableEngineTools(RepositoryDTO repositoryDTO, Consumer<Map<String, ApplicationDTO>> callback) {
Map<String, ApplicationDTO> tools = new HashMap<>();
// get engine CategoryDTOs
List<CategoryDTO> categoryDTOS = new ArrayList<>();
for (TypeDTO typeDTO : repositoryDTO.getTypes()) {
if (typeDTO.getId().equals("Engines")) {
categoryDTOS = typeDTO.getCategories();
}
}
for (CategoryDTO engine : categoryDTOS) {
for (ApplicationDTO applicationDTO : engine.getApplications()) {
if (applicationDTO.getId().equals("Tools")) {
tools.put(engine.getId(), applicationDTO);
}
}
}
callback.accept(tools);
}
use of org.phoenicis.repository.dto.TypeDTO in project POL-POM-5 by PlayOnLinux.
the class EngineToolsManager method fetchAvailableEngineTools.
/**
* Fetches the available engine tools
*
* @param repositoryDTO The repository containing the engine tools
* @param callback The callback taking the fetched engine tools
*/
public void fetchAvailableEngineTools(RepositoryDTO repositoryDTO, Consumer<Map<String, ApplicationDTO>> callback) {
// get engine CategoryDTOs
List<CategoryDTO> categoryDTOS = new ArrayList<>();
for (TypeDTO typeDTO : repositoryDTO.getTypes()) {
if (typeDTO.getId().equals("engines")) {
categoryDTOS = typeDTO.getCategories();
}
}
Map<String, ApplicationDTO> tools = new HashMap<>();
for (CategoryDTO engine : categoryDTOS) {
for (ApplicationDTO applicationDTO : engine.getApplications()) {
if (applicationDTO.getId().equals(engine.getId() + ".tools")) {
tools.put(engine.getId().replaceAll("^.*\\.", ""), applicationDTO);
}
}
}
callback.accept(tools);
}
Aggregations