Package org.fife.ui.rtextarea
Class IconGroup
- java.lang.Object
-
- org.fife.ui.rtextarea.IconGroup
-
public class IconGroup extends Object
This class encapsulates the location, properties, etc. of an icon set used for an instance ofRTextArea
. If the location of the icon group is invalid in any way, any attempt to retrieve icons from an icon group will returnnull
.
-
-
Constructor Summary
Constructors Constructor Description IconGroup(String name, String path)
Creates an icon set without "large versions" of the icons.IconGroup(String name, String path, String largeIconSubDir)
Constructor.IconGroup(String name, String path, String largeIconSubDir, String extension)
Constructor.IconGroup(String name, String path, String largeIconSubDir, String extension, String jar)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o2)
Returns whether two icon groups are equal.Icon
getIcon(String name)
Returns the icon from this icon group with the specified name.Icon
getLargeIcon(String name)
Returns the large icon from this icon group with the specified name.String
getName()
Returns the name of this icon group.int
hashCode()
Overridden since we also overrideequals(Object)
, to honor the invariant that equal objects must have equal hashcodes.boolean
hasSeparateLargeIcons()
Returns whether a separate directory for the large icons exists.
-
-
-
Constructor Detail
-
IconGroup
public IconGroup(String name, String path)
Creates an icon set without "large versions" of the icons.- Parameters:
name
- The name of the icon group.path
- The directory containing the icon group.
-
IconGroup
public IconGroup(String name, String path, String largeIconSubDir)
Constructor.- Parameters:
name
- The name of the icon group.path
- The directory containing the icon group.largeIconSubDir
- The subdirectory containing "large versions" of the icons. If no subdirectory exists, pass innull
.
-
IconGroup
public IconGroup(String name, String path, String largeIconSubDir, String extension)
Constructor.- Parameters:
name
- The name of the icon group.path
- The directory containing the icon group.largeIconSubDir
- The subdirectory containing "large versions" of the icons. If no subdirectory exists, pass innull
.extension
- The extension of the icons (one ofgif
,jpg
, orpng
).
-
IconGroup
public IconGroup(String name, String path, String largeIconSubDir, String extension, String jar)
Constructor.- Parameters:
name
- The name of the icon group.path
- The directory containing the icon group.largeIconSubDir
- The subdirectory containing "large versions" of the icons. If no subdirectory exists, pass innull
.extension
- The extension of the icons (one ofgif
,jpg
, orpng
).jar
- The Jar file containing the icons, ornull
if the icons are on the local file system. If a Jar is specified, the value ofpath
must be a path in the Jar file. If this is not a valid Jar file, then no Jar file will be used, meaning all icons returned from this icon group will benull
.
-
-
Method Detail
-
equals
public boolean equals(Object o2)
Returns whether two icon groups are equal.
-
getIcon
public Icon getIcon(String name)
Returns the icon from this icon group with the specified name.- Parameters:
name
- The name of the icon. For example, if you want the icon specified innew.gif
, this value should benew
.- Returns:
- The icon, or
null
if it could not be found or loaded. - See Also:
getLargeIcon(java.lang.String)
-
getLargeIcon
public Icon getLargeIcon(String name)
Returns the large icon from this icon group with the specified name. If this icon group does not have large icons,null
is returned.- Parameters:
name
- The name of the icon. For example, if you want the icon specified innew.gif
, this value should benew
.- Returns:
- The icon, or
null
if it could not be found or loaded. - See Also:
getLargeIcon(java.lang.String)
-
getName
public String getName()
Returns the name of this icon group.- Returns:
- This icon group's name.
-
hasSeparateLargeIcons
public boolean hasSeparateLargeIcons()
Returns whether a separate directory for the large icons exists.- Returns:
- Whether a directory containing "large versions" ov the icons exists.
- See Also:
getLargeIcon(String)
-
hashCode
public int hashCode()
Overridden since we also overrideequals(Object)
, to honor the invariant that equal objects must have equal hashcodes. This also keeps FindBugs happy.
-
-