Search in sources :

Example 1 with ResourceTypeDefinition

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));
}
Also used : ResourceTypeDefinition(org.uberfire.workbench.type.ResourceTypeDefinition)

Example 2 with ResourceTypeDefinition

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;
}
Also used : ResourceTypeDefinition(org.uberfire.workbench.type.ResourceTypeDefinition)

Aggregations

ResourceTypeDefinition (org.uberfire.workbench.type.ResourceTypeDefinition)2