Record Class ThemeDefinition
java.lang.Object
java.lang.Record
org.eclipse.e4.ui.css.swt.theme.ThemeDefinition
- Record Components:
id- the id the theme is registered with, including the OS version if the theme declares onelabel- the labelosVersion- the OS version the theme declares, or the empty stringdark- whether the theme is darkstylesheet- thebasestylesheeturias declaredcontributor- the name of the contributing bundle
- All Implemented Interfaces:
ITheme
public record ThemeDefinition(String id, String label, String osVersion, boolean dark, String stylesheet, String contributor)
extends Record
implements ITheme
A theme as declared by a
theme element of the
org.eclipse.e4.ui.css.swt.theme extension point, resolved for
the current platform. This is what the theme engine registers, and it can
also be read when there is no theme engine.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontributorrecord component.booleandark()Returns the value of thedarkrecord component.final booleanIndicates whether some other object is "equal to" this one.getId()getLabel()static IConfigurationElement[]getPlatformMatches(IConfigurationElement[] elements) Get all elements that have os/ws attributes that best match the current platform.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanisDark()Whether this theme is meant to be used with a dark appearance, as declared by theisDarkThemeattribute of the theme extension.label()Returns the value of thelabelrecord component.Returns the value of theosVersionrecord component.static List<ThemeDefinition> readAll()Reads the themes contributed for the current platform, in the order of the extension registry.Returns the value of thestylesheetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ThemeDefinition
public ThemeDefinition(String id, String label, String osVersion, boolean dark, String stylesheet, String contributor) Creates an instance of aThemeDefinitionrecord class.- Parameters:
id- the value for theidrecord componentlabel- the value for thelabelrecord componentosVersion- the value for theosVersionrecord componentdark- the value for thedarkrecord componentstylesheet- the value for thestylesheetrecord componentcontributor- the value for thecontributorrecord component
-
-
Method Details
-
getId
-
getLabel
-
isDark
public boolean isDark()Description copied from interface:IThemeWhether this theme is meant to be used with a dark appearance, as declared by theisDarkThemeattribute of the theme extension. Implementations that do not override this keep the id based classification the platform used before the attribute existed. -
readAll
Reads the themes contributed for the current platform, in the order of the extension registry. A theme id contributed more than once is returned more than once.- Returns:
- the themes
-
getPlatformMatches
Get all elements that have os/ws attributes that best match the current platform.- Parameters:
elements- the elements to check- Returns:
- the best matches, if any
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
label
-
osVersion
-
dark
-
stylesheet
Returns the value of thestylesheetrecord component.- Returns:
- the value of the
stylesheetrecord component
-
contributor
Returns the value of thecontributorrecord component.- Returns:
- the value of the
contributorrecord component
-