Search in sources :

Example 6 with EnhancedDependency

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.

the class EnhancedDependenciesManager method updateWithOriginalDependency.

private void updateWithOriginalDependency(final NormalEnhancedDependency enhancedDependency) {
    final Dependency originalDependency = originalSetOfDependencies.get(enhancedDependency.getDependency());
    enhancedDependency.setDependency(originalDependency);
}
Also used : NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) Dependency(org.guvnor.common.services.project.model.Dependency) EnhancedDependency(org.kie.workbench.common.services.shared.dependencies.EnhancedDependency)

Example 7 with EnhancedDependency

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.

the class EnhancedDependenciesManager method onEnhancedDependenciesUpdated.

void onEnhancedDependenciesUpdated(final EnhancedDependencies loadedEnhancedDependencies) {
    for (final EnhancedDependency enhancedDependency : loadedEnhancedDependencies) {
        updateOriginal(enhancedDependency);
        updateEnhanced(enhancedDependency);
    }
    callback.callback(this.enhancedDependencies);
}
Also used : NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) EnhancedDependency(org.kie.workbench.common.services.shared.dependencies.EnhancedDependency)

Example 8 with EnhancedDependency

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.

the class EnhancedDependenciesManager_onEchancedDependenciesLoadedTest method testEditingEnhancedUpdatesOriginal.

@Test
public void testEditingEnhancedUpdatesOriginal() throws Exception {
    final EnhancedDependencies loadedEnhancedDependencies = new EnhancedDependencies();
    loadedEnhancedDependencies.add(new NormalEnhancedDependency(makeDependency("org.junit", "junit", "1.0"), new HashSet<String>()));
    enhancedDependenciesManager.onEnhancedDependenciesUpdated(loadedEnhancedDependencies);
    final EnhancedDependency enhancedDependency = shownDependencies.asList().get(0);
    enhancedDependency.getDependency().setArtifactId("newId");
    assertEquals("newId", junit.getArtifactId());
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) EnhancedDependency(org.kie.workbench.common.services.shared.dependencies.EnhancedDependency) NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

EnhancedDependency (org.kie.workbench.common.services.shared.dependencies.EnhancedDependency)8 NormalEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency)6 Dependency (org.guvnor.common.services.project.model.Dependency)5 Test (org.junit.Test)5 TransitiveEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.TransitiveEnhancedDependency)4 HashSet (java.util.HashSet)3 EnhancedDependencies (org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies)1