use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class DependenciesPresenter method setup.
@Override
public Promise<Void> setup(final ProjectScreenModel model) {
this.model = model;
view.init(this);
dependencySelectorPopup.addSelectionHandler(gav -> {
final Dependency dependency = new Dependency(gav);
dependency.setScope("compile");
add(dependency);
});
return promises.create((resolve, reject) -> {
enhancedDependenciesManager.init(model.getPOM(), dependencies -> {
updateHashCode(dependencies);
view.setItems(buildDependencyViews(model, dependencies));
resolve.onInvoke(promises.resolve());
fireChangeEvent();
});
enhancedDependenciesManager.update();
});
}
use of org.guvnor.common.services.project.model.Dependency 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);
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class NewDependencyPopup method show.
public void show(final Callback<Dependency> callback) {
this.callback = callback;
dependency = new Dependency();
validator = new DependencyValidator(dependency);
view.clean();
view.show();
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesManagerResetTest method init.
private Callback init(final POM pom) {
final Callback callback = mock(Callback.class);
manager.init(pom, callback);
final EnhancedDependencies enhancedDependencies = new EnhancedDependencies();
for (Dependency dependency : pom.getDependencies()) {
enhancedDependencies.add(new NormalEnhancedDependency(dependency, new HashSet<String>()));
}
manager.onEnhancedDependenciesUpdated(enhancedDependencies);
return callback;
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesManager_onEchancedDependenciesLoadedTest method testAdd.
@Test
public void testAdd() throws Exception {
final Dependency dependency = makeDependency("artifactId", "groupId", "1.0");
enhancedDependenciesManager.addNew(dependency);
final EnhancedDependencies loadedEnhancedDependencies = new EnhancedDependencies();
loadedEnhancedDependencies.add(new NormalEnhancedDependency(dependency, new HashSet<String>()));
enhancedDependenciesManager.onEnhancedDependenciesUpdated(loadedEnhancedDependencies);
assertEquals(3, originalSetOfDependencies.size());
assertTrue(originalSetOfDependencies.contains(dependency));
assertEquals(1, shownDependencies.size());
assertTrue(shownDependencies.asList().get(0).getDependency().isGAVEqual(dependency));
}
Aggregations