本文整理汇总了Java中com.intellij.uiDesigner.ImageFileFilter类的典型用法代码示例。如果您正苦于以下问题:Java ImageFileFilter类的具体用法?Java ImageFileFilter怎么用?Java ImageFileFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImageFileFilter类属于com.intellij.uiDesigner包,在下文中一共展示了ImageFileFilter类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IconEditor
import com.intellij.uiDesigner.ImageFileFilter; //导入依赖的package包/类
public IconEditor() {
myTextField.getTextField().setBorder(null);
myTextField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final TreeClassChooserFactory factory = TreeClassChooserFactory.getInstance(getModule().getProject());
PsiFile iconFile = null;
if (myValue != null) {
VirtualFile iconVFile = ResourceFileUtil.findResourceFileInScope(myValue.getIconPath(), getModule().getProject(),
getModule()
.getModuleWithDependenciesAndLibrariesScope(true));
if (iconVFile != null) {
iconFile = PsiManager.getInstance(getModule().getProject()).findFile(iconVFile);
}
}
TreeFileChooser fileChooser = factory.createFileChooser(UIDesignerBundle.message("title.choose.icon.file"), iconFile,
null, new ImageFileFilter(getModule()), false, true);
fileChooser.showDialog();
PsiFile file = fileChooser.getSelectedFile();
if (file != null) {
String resourceName = FormEditingUtil.buildResourceName(file);
if (resourceName != null) {
IconDescriptor descriptor = new IconDescriptor(resourceName);
IntroIconProperty.loadIconFromFile(file.getVirtualFile(), descriptor);
myValue = descriptor;
myTextField.setText(descriptor.getIconPath());
}
}
}
});
}