/* (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; }
public IDictEntryScriptWrap getDictInfo() { IDictionaryType dt = proxy.getDictionaryType(); if (dt instanceof DeMetadataItem) { MetadataItem item = ((DeMetadataItem) dt).getProxyItem(); if (item != null) { return new DictScriptWrapImpl((DictionaryType) item, resource); } } return null; }
@Override public IBizDataTypeItemScriptWrap getBizDataType() { IBusinessDataType ibusType = proxy.getDataType(); if (ibusType instanceof DeBusinessDataType) { BusinessDataType busType = ((DeBusinessDataType) ibusType).getProxyItem(); if (busType != null) { return new BusDataTypeItemScriptWrapImpl(busType, resource); } } return null; }
@Override public int getPrecision() { int precision = 0; IBusinessDataType bdt = proxy.getDataType(); if (StringUtils.isNotBlank(bdt.getPrecision())) { try { precision = Integer.parseInt(bdt.getPrecision()); } catch (Exception e) { } } return precision; }
@Override public int getLength() { int length = 0; IBusinessDataType bdt = proxy.getDataType(); if (StringUtils.isNotBlank(bdt.getLength())) { try { length = Integer.parseInt(bdt.getLength()); } catch (Exception e) { } } return length; }
@Override public String getChineseName() { return proxy.getChineseName(); }
@Override public String getName() { return proxy.getName(); }
@Override public String getRealType(String type) { return proxy.getDataType().getRealType(type); }
/* (non-Javadoc) * @see com.hundsun.ares.studio.jres.script.api.metadata.IStandardFieldScriptWrap#getStrDictInfo() */ @Override public String getStrDictInfo() { return proxy.getDictionaryTypeId(); }
/* (non-Javadoc) * @see com.hundsun.ares.studio.jres.script.api.metadata.IStandardFieldScriptWrap#getStrBizDataType() */ @Override public String getStrBizDataType() { return proxy.getDataTypeId(); }
public String getDescription() { return proxy.getDescription(); }