use of org.guvnor.common.services.project.client.NameChangeHandler in project kie-wb-common by kiegroup.
the class POMWizardPage method addChangeHandlers.
private void addChangeHandlers() {
this.pomEditor.addNameChangeHandler(new NameChangeHandler() {
@Override
public void onChange(String newName) {
validateName(pomEditor.getPom().getName());
if (pomEditor.getPom().getGav().getArtifactId() == null || pomEditor.getPom().getGav().getArtifactId().isEmpty()) {
userModifiedArtifactId = false;
}
// TODO Move to PomBuilder
final String sanitizedProjectName = NewWorkspaceProjectUtils.sanitizeProjectName(pomEditor.getPom().getName());
if (!userModifiedArtifactId) {
pomEditor.setArtifactID(sanitizedProjectName);
validateArtifactId(sanitizedProjectName);
}
final WizardPageStatusChangeEvent event = new WizardPageStatusChangeEvent(POMWizardPage.this);
POMWizardPage.this.wizardPageStatusChangeEvent.fire(event);
}
});
this.pomEditor.addGroupIdChangeHandler(new GroupIdChangeHandler() {
@Override
public void onChange(String newGroupId) {
validateGroupId(pomEditor.getPom().getGav().getGroupId());
final WizardPageStatusChangeEvent event = new WizardPageStatusChangeEvent(POMWizardPage.this);
POMWizardPage.this.wizardPageStatusChangeEvent.fire(event);
}
});
this.pomEditor.addArtifactIdChangeHandler(new ArtifactIdChangeHandler() {
@Override
public void onChange(String newArtifactId) {
userModifiedArtifactId = true;
validateArtifactId(pomEditor.getPom().getGav().getArtifactId());
final WizardPageStatusChangeEvent event = new WizardPageStatusChangeEvent(POMWizardPage.this);
POMWizardPage.this.wizardPageStatusChangeEvent.fire(event);
}
});
this.pomEditor.addVersionChangeHandler(new VersionChangeHandler() {
@Override
public void onChange(String newVersion) {
validateVersion(pomEditor.getPom().getGav().getVersion());
final WizardPageStatusChangeEvent event = new WizardPageStatusChangeEvent(POMWizardPage.this);
POMWizardPage.this.wizardPageStatusChangeEvent.fire(event);
}
});
}
Aggregations