use of org.uberfire.workbench.type.ResourceTypeDefinition in project kie-wb-common by kiegroup.
the class NewAssetHandlerCardWidget method initialize.
public void initialize(NewResourceHandler resourceHandler) {
ResourceTypeDefinition resourceType = resourceHandler.getResourceType();
this.view.init(this);
this.view.setTitle(resourceHandler.getDescription());
if (resourceType.getCategory() != null) {
this.view.setDescription(ts.getTranslation(resourceType.getCategory().getName()));
}
if (resourceHandler.getIcon() != null) {
this.view.setIcon(elemental2DomUtil.asHTMLElement(resourceHandler.getIcon().asWidget().getElement()));
}
this.view.setCommand(resourceHandler.getCommand(newResourcePresenter));
}
use of org.uberfire.workbench.type.ResourceTypeDefinition in project kie-wb-common by kiegroup.
the class ShowAssetUsagesDisplayer method getAssetType.
@Override
public String getAssetType(Path path) {
String extension = "";
String fileName = path.getFileName();
if (fileName.contains(".")) {
extension = fileName.substring(fileName.lastIndexOf(".") + 1);
}
ResourceTypeDefinition typeDefinition = existingResourceTypes.get(extension);
if (typeDefinition != null) {
return typeDefinition.getShortName();
}
return UNKNOWN_ASSET_TYPE;
}
Aggregations