use of org.phoenicis.repository.dto.ApplicationDTO 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.ApplicationDTO in project POL-POM-5 by PlayOnLinux.
the class ContainersFeaturePanelSkin method updateEngineTools.
/**
* Applies the engine tools belonging to the currently selected container to the given
* {@link ContainerInformationPanel}
*
* @param containerInformationPanel The information panel showing the details for the currently selected container
*/
private void updateEngineTools(final ContainerInformationPanel containerInformationPanel) {
final ObservableMap<String, ApplicationDTO> engineTools = getControl().getEngineTools();
final ContainerDTO container = containerInformationPanel.getContainer();
if (container != null && engineTools.containsKey(container.getEngine().toLowerCase())) {
containerInformationPanel.setEngineTools(engineTools.get(container.getEngine().toLowerCase()));
} else {
containerInformationPanel.setEngineTools(null);
}
}
use of org.phoenicis.repository.dto.ApplicationDTO 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);
}
use of org.phoenicis.repository.dto.ApplicationDTO in project POL-POM-5 by PlayOnLinux.
the class VerbsManager method fetchAvailableVerbs.
/**
* Fetches the available Verbs
*
* @param repositoryDTO
* @param callback
*/
public void fetchAvailableVerbs(RepositoryDTO repositoryDTO, Consumer<Map<String, ApplicationDTO>> callback) {
Map<String, ApplicationDTO> verbs = 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(engine.getId() + ".verbs")) {
verbs.put(engine.getId().replaceAll("^.*\\.", ""), applicationDTO);
}
}
}
callback.accept(verbs);
}
Aggregations