本文整理汇总了Java中com.kotcrab.vis.ui.widget.file.FileChooser.FileIconProvider类的典型用法代码示例。如果您正苦于以下问题:Java FileIconProvider类的具体用法?Java FileIconProvider怎么用?Java FileIconProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileIconProvider类属于com.kotcrab.vis.ui.widget.file.FileChooser包,在下文中一共展示了FileIconProvider类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.kotcrab.vis.ui.widget.file.FileChooser.FileIconProvider; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final FileChooser actor,
final String rawAttributeData) {
@SuppressWarnings("unchecked") final ActorConsumer<Drawable, FileHandle> provider = (ActorConsumer<Drawable, FileHandle>) parser
.parseAction(rawAttributeData, MockUpFileHandle.INSTANCE);
if (provider == null) {
parser.throwErrorIfStrict(
"Icon provider attribute expects a method that consumes a FileHandle and returns Drawable. Method not found for ID: "
+ rawAttributeData);
return;
}
actor.setIconProvider(new FileIconProvider() {
@Override
public Drawable provideIcon(final FileHandle file) {
return provider.consume(file);
}
});
}
示例2: process
import com.kotcrab.vis.ui.widget.file.FileChooser.FileIconProvider; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final FileChooser actor,
final String rawAttributeData) {
@SuppressWarnings("unchecked") final ActorConsumer<FileIconProvider, FileChooser> provider = (ActorConsumer<FileIconProvider, FileChooser>) parser
.parseAction(rawAttributeData, actor);
if (provider == null) {
parser.throwError(
"Icon provider requires an action ID of method returning FileIconProvider. No action found for data: "
+ rawAttributeData);
}
actor.setIconProvider(provider.consume(actor));
}