Get DataObject icon

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Get DataObject icon

abdielcs
We can register a new File Type for a new file extension or xml namespace, so in that way we can define a new mimeType and iconBase for our file. Now I need to select that file, and get it's registered icon(for example as a property of other file type):


Code:
File file = fileChooser.getSelectedFile();
DataObject dataObject = DataObject.find(FileUtil.toFileObject(file));



How I can get the registered icon for this DataObject, asuming that it exist?
There is any way of only select files inside my projects and not in the entire file system?

Thanks




Reply | Threaded
Open this post in threaded view
|

Re: Get DataObject icon

Enrico Scantamburlo
About the icon:
try dataObject.getNodeDelegate().getIcon(0)
See the JavaDoc

About the fileChooser
Try to implement a FileFilter and set it inside the file chooser
See the JavaDoc


On Mon, Dec 4, 2017 at 6:47 PM, abdielcs <[hidden email]> wrote:
We can register a new File Type for a new file extension or xml namespace, so in that way we can define a new mimeType and iconBase for our file. Now I need to select that file, and get it's registered icon(for example as a property of other file type):


Code:
File file = fileChooser.getSelectedFile();
DataObject dataObject = DataObject.find(FileUtil.toFileObject(file));



How I can get the registered icon for this DataObject, asuming that it exist?
There is any way of only select files inside my projects and not in the entire file system?

Thanks