Class Language
- All Implemented Interfaces:
Proxy
A GtkSourceLanguage represents a programming or markup language, affecting
syntax highlighting and context classes.
Use LanguageManager to obtain a GtkSourceLanguage instance, and
Buffer.setLanguage(org.gnome.gtksourceview.Language) to apply it to a Buffer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classLanguage.Builder<B extends Language.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionLanguage()Creates a new Language.Language(MemorySegment address) Create a Language proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected LanguageasParent()Returns this instance as if it were its parent type.static Language.Builder<? extends Language.Builder> builder()ALanguage.Builderobject constructs aLanguagewith the specified properties.@Nullable String @Nullable []getGlobs()Returns the globs associated to this language.booleanReturns whether the language should be hidden from the user.getId()Returns the ID of the language.@Nullable StringgetMetadata(String name) @Nullable String @Nullable []Returns the mime types associated to this language.getName()Returns the localized name of the language.Returns the localized section of the language.@Nullable StringgetStyleFallback(String styleId) Returns the ID of the style to use if the specifiedstyleIdis not present in the current style scheme.@Nullable String @Nullable []Returns the ids of the styles defined by thislanguage.@Nullable StringgetStyleName(String styleId) Returns the name of the style with IDstyleIddefined by thislanguage.static @Nullable TypegetType()Get the GType of the Language classMethods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Language
Create a Language proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Language
public Language()Creates a new Language.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getGlobs
Returns the globs associated to this language.This is just an utility wrapper around
getMetadata(java.lang.String)to retrieve the "globs" metadata property and split it into an array.- Returns:
- a newly-allocated
nullterminated array containing the globs ornullif no globs are found. The returned array must be freed with g_strfreev().
-
getHidden
public boolean getHidden()Returns whether the language should be hidden from the user.- Returns:
trueif the language should be hidden,falseotherwise.
-
getId
Returns the ID of the language.The ID is not locale-dependent.The returned string is owned by this Language and should not be freed or modified.
- Returns:
- the ID of
language.
-
getMetadata
-
getMimeTypes
Returns the mime types associated to this language.This is just an utility wrapper around
getMetadata(java.lang.String)to retrieve the "mimetypes" metadata property and split it into an array.- Returns:
- a newly-allocated
nullterminated array containing the mime types ornullif no mime types are found. The returned array must be freed with g_strfreev().
-
getName
Returns the localized name of the language.The returned string is owned by this Language and should not be freed or modified.
- Returns:
- the name of
language.
-
getSection
Returns the localized section of the language.Each language belong to a section (ex. HTML belongs to the Markup section). The returned string is owned by this Language and should not be freed or modified.
- Returns:
- the section of
language.
-
getStyleFallback
Returns the ID of the style to use if the specifiedstyleIdis not present in the current style scheme.- Parameters:
styleId- a style ID.- Returns:
- the ID of the style to use if the
specified
styleIdis not present in the current style scheme ornullif the style has no fallback defined. The returned string is owned by the this Language and must not be modified.
-
getStyleIds
Returns the ids of the styles defined by thislanguage.- Returns:
- a newly-allocated
nullterminated array containing ids of the styles defined by this this Language ornullif no style is defined. The returned array must be freed with g_strfreev().
-
getStyleName
Returns the name of the style with IDstyleIddefined by thislanguage.- Parameters:
styleId- a style ID.- Returns:
- the name of the style with ID
styleIddefined by this this Language ornullif the style has no name or there is no style with IDstyleIddefined by thislanguage.The returned string is owned by the this Language and must not be modified.
-
builder
ALanguage.Builderobject constructs aLanguagewith the specified properties. Use the variousset...()methods to set properties, and finish construction withLanguage.Builder.build().- Returns:
- the builder object
-