private void applyValue(String property, String value) throws CoreException { if (fCurrentCategoryDefinition == null) return; if (property.equals(PROPERTY_NAME)) { String oldName = fCurrentCategoryDefinition.getName(); fCurrentCategoryDefinition.setName(value); bringFeatures(oldName); } else if (property.equals(PROPERTY_TYPE)) fCurrentCategoryDefinition.setLabel(value); else if (property.equals(PROPERTY_DESC)) { if (value == null || value.length() == 0) { fCurrentCategoryDefinition.setDescription(null); } else { ISiteDescription siteDesc = fCurrentCategoryDefinition.getDescription(); if (siteDesc == null) { siteDesc = fCurrentCategoryDefinition .getModel() .getFactory() .createDescription(fCurrentCategoryDefinition); siteDesc.setText(value); fCurrentCategoryDefinition.setDescription(siteDesc); } else { siteDesc.setText(value); } } } }
private void setValue(String property) { if (fCurrentCategoryDefinition == null) { clearField(property); } else { if (property.equals(PROPERTY_NAME)) fNameText.setValue(fCurrentCategoryDefinition.getName(), true); else if (property.equals(PROPERTY_TYPE)) fLabelText.setValue(fCurrentCategoryDefinition.getLabel(), true); else if (property.equals(PROPERTY_DESC)) { ISiteDescription siteDesc = fCurrentCategoryDefinition.getDescription(); if (siteDesc == null) { clearField(property); } else { fDescriptionText.setValue(siteDesc.getText(), true); } } } }