How to get an icon of an object in Windchill

public static String getIcon(WTObject wtobject) throws Exception {
    IconDelegate icondelegate = IconDelegateFactory.getInstance().getIconDelegate(wtobject);
    IconSelector iconselector;
    for(iconselector = icondelegate.getStandardIconSelector(); !iconselector.isResourceKey(); iconselector = icondelegate.getStandardIconSelector()){
        icondelegate = icondelegate.resolveSelector(iconselector);
    }
    URLFactory urlfactory = new URLFactory();
    return urlfactory.getHREF(iconselector.getIconKey());    
}

你可能感兴趣的:(How to get an icon of an object in Windchill)