/* (non-Javadoc) * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object) */ @Override public String getText(Object element) { StandardFieldColumn column = (StandardFieldColumn) element; IARESProject project = com.hundsun.ares.studio.core.util.ResourcesUtil.getARESProject(bundle); IMetadataService service = DataServiceManager.getInstance().getService(project, IMetadataService.class); if (service != null) { IStandardField filed = service.getStandardField(column.getStandardField()); if (filed != null) { switch (type) { case ChineseName: return StringUtils.defaultString(filed.getChineseName()); case Desciption: StringBuffer text = new StringBuffer(); IDictionaryType dictType = filed.getDictionaryType(); if (dictType instanceof DeDictionaryType) { for (DeDictionaryItem item : ((DeDictionaryType) dictType).getItems()) { String value = StringUtils.defaultString(item.getValue()); String chineseName = StringUtils.defaultString(item.getChineseName()); text.append(value); text.append(":"); text.append(chineseName); text.append(" "); } } return StringUtils.defaultString( StringUtils.defaultIfBlank(text.toString(), filed.getDescription())); case Type: return StringUtils.defaultString(filed.getDataTypeId()); } } } return StringUtils.EMPTY; }
@Override public String getChineseName() { return proxy.getChineseName(); }