Class JListUtils
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.client.controlpanel.desktopintegrationeditor.JListUtils
-
public class JListUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJListUtils.CustomRendererJListstatic classJListUtils.CustomRendererWithIconJListstatic classJListUtils.CustomValidatingRendererJListprivate static classJListUtils.FileCellRendererstatic classJListUtils.FileListBasedJListModelprivate static classJListUtils.IconisedCellRendererstatic classJListUtils.InfrastructureFileDescriptorListingBasedJListModelprivate static classJListUtils.ValidatingFileCellRenderer
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.io.File,javax.swing.Icon>iconCacheprivate static java.util.Map<java.io.File,java.lang.Long>stampsprivate static java.util.Map<java.io.File,java.lang.String>textFilesCache
-
Constructor Summary
Constructors Constructor Description JListUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static javax.swing.ImageIconcreateImageIcon(java.io.File f, java.lang.String description)Load BufferedImage form file, scale it and converts to icon.private static javax.swing.IconprocessIconCache(java.io.File f)This method looks to cache whether file F was already read as image.private static java.lang.StringprocessTextFilesCache(java.io.File f)This method looks to cache whether file F was already read as text file.private static javax.swing.IconupdateIconCache(java.io.File f, javax.swing.Icon i)This method load Icon from file.private static java.lang.StringupdateTextCache(java.io.File f, java.lang.String s)This method load Text from file.
-
-
-
Method Detail
-
processIconCache
private static javax.swing.Icon processIconCache(java.io.File f)
This method looks to cache whether file F was already read as image. If not, file is loaded, put to cache and returned If so, it also check whether it was modified. If so, it is reloaded, replaced in cache and returned.- Parameters:
f-- Returns:
-
updateIconCache
private static javax.swing.Icon updateIconCache(java.io.File f, javax.swing.Icon i)This method load Icon from file. Once file is loaded, it is stored also to cache Also the time stamp of last modification is stored to cache to allow reloading when changed.- Parameters:
f- file to load, and to provide timestamp of last modification- Returns:
- loaded icon or null
-
processTextFilesCache
private static java.lang.String processTextFilesCache(java.io.File f)
This method looks to cache whether file F was already read as text file. If not, file is loaded, and its content is put to cache and returned as String If so, it also check whether it was modified. If so, it is reloaded, replaced in cache and returned.- Parameters:
f-- Returns:
-
updateTextCache
private static java.lang.String updateTextCache(java.io.File f, java.lang.String s)This method load Text from file. Once file is loaded, it is stored also to cache Also the time stamp of last modification is stored to cache to allow reloading when changed.- Parameters:
f- file to load, and to provide timestamp of last modification- Returns:
- loaded Text, error message or null
-
createImageIcon
private static javax.swing.ImageIcon createImageIcon(java.io.File f, java.lang.String description)Load BufferedImage form file, scale it and converts to icon.- Parameters:
f- file to be loadeddescription- description to be provided- Returns:
- icon from file or null if something went wrong
-
-