Class Feature
- All Implemented Interfaces:
Proxy
The WebKit web engine includes a set of features which may be toggled
programmatically, each one represented by a WebKitFeature that provides
information about it:
- A unique “identifier”:
getIdentifier(). - A “default value”, which indicates whether the option is enabled
automatically:
getDefaultValue(). - Its “status”, which determines whether it should be considered
user-settable and its development stage (see
FeatureStatusfor details):getStatus(). - A category, which may be used to group features together:
getCategory(). - An optional short “name” which can be presented to an user:
getName(). - An optional longer “detailed” description:
getDetails().
The lists of available features can be obtained with
Settings.getAllFeatures(), Settings.getExperimentalFeatures(),
and Settings.getDevelopmentFeatures()). As a rule of thumb,
applications which may want to allow users (i.e. web developers) to test
WebKit features should use the list of experimental features. Additionally,
applications might want to expose development features *when targeting
technically inclined users* for early testing of in-development features
(i.e. in “technology preview” or “canary” builds).
Applications **must not** expose the list of all features to end users because they often lack descriptions and control parts of the web engine which are either intended to be used during development of WebKit itself, or in specific scenarios to tweak how WebKit integrates with the application.
- Since:
- 2.42
-
Constructor Summary
ConstructorsConstructorDescriptionFeature(MemorySegment address) Create a Feature proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionGets the category of the feature.booleanGets whether the feature is enabled by default.@Nullable StringGets a description for thefeature.Gets a string that uniquely identifies thefeature.@Nullable StringgetName()Gets a short name for thefeature.Gets the status of the feature.static @Nullable TypegetType()Get the GType of the Feature classref()Atomically acquires a reference on the givenfeature.voidunref()Atomically releases a reference on the givenfeature.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Feature
Create a Feature proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
-
getCategory
Gets the category of the feature.Applications which include user interface to toggle features may want to use the category to group related features together.
- Returns:
- Feature category.
- Since:
- 2.42
-
getDefaultValue
public boolean getDefaultValue()Gets whether the feature is enabled by default.The default value may be used by applications which include user interface to toggle features to restore its settings to their defaults. Note that whether a feature is actually enabled must be checked with
Settings.getFeatureEnabled(org.webkitgtk.Feature).- Returns:
- Whether the feature is enabled by default.
- Since:
- 2.42
-
getDetails
Gets a description for thefeature.The detailed description should be considered an additional clarification on the purpose of the feature, to be used as complementary aid to be displayed along the feature name returned by
getName(). The returned string is suitable to be displayed to end users, but it should not be relied upon being localized.Note that some *features may not* have a detailed description, and
NULLis returned in this case.- Returns:
- Feature description.
- Since:
- 2.42
-
getIdentifier
Gets a string that uniquely identifies thefeature.- Returns:
- The identifier string for the feature.
- Since:
- 2.42
-
getName
Gets a short name for thefeature.The returned string is suitable to be displayed to end users, but it should not be relied upon being localized.
Note that some *features may not* have a short name, and
NULLis returned in this case.- Returns:
- Short feature name.
- Since:
- 2.42
-
getStatus
Gets the status of the feature.- Returns:
- Feature status.
- Since:
- 2.42
-
ref
Atomically acquires a reference on the givenfeature.This function is MT-safe and may be called from any thread.
- Returns:
- The same this Feature with an additional reference.
- Since:
- 2.42
-
unref
public void unref()Atomically releases a reference on the givenfeature.If the reference was the last, the resources associated to the this Feature are freed. This function is MT-safe and may be called from any thread.
- Since:
- 2.42
-