*/
public String getText(Object element) {
if (element == COMMENT_NODE || element == CODE_NODE) {
return (String) element;
}
TemplatePersistenceData data = (TemplatePersistenceData) element;
String id = data.getId();
if (CodeTemplateContextType.CATCHBLOCK_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_catchblock_label;
} else if (CodeTemplateContextType.METHODSTUB_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_methodstub_label;
} else if (CodeTemplateContextType.CONSTRUCTORSTUB_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_constructorstub_label;
} else if (CodeTemplateContextType.GETTERSTUB_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_getterstub_label;
} else if (CodeTemplateContextType.SETTERSTUB_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_setterstub_label;
} else if (CodeTemplateContextType.NEWTYPE_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_newtype_label;
} else if (CodeTemplateContextType.CLASSBODY_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_classbody_label;
} else if (CodeTemplateContextType.INTERFACEBODY_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_interfacebody_label;
} else if (CodeTemplateContextType.ENUMBODY_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_enumbody_label;
} else if (CodeTemplateContextType.ANNOTATIONBODY_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_annotationbody_label;
} else if (CodeTemplateContextType.FILECOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_filecomment_label;
} else if (CodeTemplateContextType.TYPECOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_typecomment_label;
} else if (CodeTemplateContextType.FIELDCOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_fieldcomment_label;
} else if (CodeTemplateContextType.METHODCOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_methodcomment_label;
} else if (CodeTemplateContextType.OVERRIDECOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_overridecomment_label;
} else if (CodeTemplateContextType.DELEGATECOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_delegatecomment_label;
} else if (CodeTemplateContextType.CONSTRUCTORCOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_constructorcomment_label;
} else if (CodeTemplateContextType.GETTERCOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_gettercomment_label;
} else if (CodeTemplateContextType.SETTERCOMMENT_ID.equals(id)) {
return PreferencesMessages.CodeTemplateBlock_settercomment_label;
}
return data.getTemplate().getDescription();
}