}
}
@Override
public boolean performFinish() {
GbeanRef gbeanRef;
if (element.getText().equals(elementTypes[GBEAN_REF])) {
if (isEmpty(textList.get(0).getText())) {
return false;
}
gbeanRef = (GbeanRef)eObject;
if (gbeanRef == null) {
gbeanRef = (GbeanRef)getEFactory().create(GbeanRef.class);
JAXBElement plan = section.getPlan();
// if we have a WebApp, add the JAXBElement of the GBeanRef, not the GBeanRef
if (WebApp.class.isInstance(plan.getValue())) {
ObjectFactory objectFactory = new ObjectFactory();
JAXBModelUtils.getGbeanRefs(plan).add(objectFactory.createGbeanRef(gbeanRef));
section.getObjectContainer().add(objectFactory.createGbeanRef(gbeanRef));
}
else {
JAXBModelUtils.getGbeanRefs(plan).add(gbeanRef);
section.getObjectContainer().add(gbeanRef);
}
}
gbeanRef.setRefName(textList.get(0).getText());
}
else if (element.getText().equals(elementTypes[GBEAN_TYPE])) {
if (isEmpty(textList.get(0).getText())) {
return false;
}
String type = (String)eObject;
gbeanRef = (GbeanRef)section.getSelectedObject();
if (type == null) {
gbeanRef.getRefType().add(textList.get(0).getText());
}
else {
gbeanRef.getRefType().set(gbeanRef.getRefType().indexOf(type), textList.get(0).getText());
}
}
else if (element.getText().equals(elementTypes[PATTERN])) {
if (isEmpty(textList.get(0).getText())) {
return false;
}
Pattern pattern = (Pattern)eObject;
if (pattern == null) {
pattern = (Pattern)getEFactory().create(Pattern.class);
gbeanRef = (GbeanRef)section.getSelectedObject();
gbeanRef.getPattern().add(pattern);
}
pattern.setName(textList.get(0).getText());
pattern.setGroupId(textList.get(1).getText());
pattern.setArtifactId(textList.get(2).getText());
pattern.setVersion(textList.get(3).getText());