Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (21 sloc) 1.78 KB

Ember - Kotlin extensions for Substance APIs

Maven Central radiance-ember for build instructions of the latest stable release.

In your Java app, this is how you would mark a BreadcrumbBarSelector to use the HEADER decoration area type:

BreadcrumbFileSelector bar = new BreadcrumbFileSelector();
SubstanceCortex.ComponentOrParentChainScope.setDecorationType(bar,
        SubstanceSlices.DecorationAreaType.HEADER);

And here is how the same code would look like in Kotlin using Ember-provided extension on the JComponent class:

val bar = BreadcrumbFileSelector()
bar.setDecorationType(SubstanceSlices.DecorationAreaType.HEADER)

Ember scopes

Ember scopes mirror scopes defined in SubstanceCortex:

  • EmberWindowScope - configuring and querying state at the level of the application Windows.
  • EmberRootPaneScope - configuring and querying state at the level of the application JRootPanes.
  • EmberComponentScope - configuring and querying state at the level of the application Components.
  • EmberComponentOrParentScope - configuring and querying state at the level of individual application Components or all immediate child components of a container.
  • EmberComponentOrParentChainScope - configuring and querying state at the level of individual application Components or all nested child components of a container.

Note that these are Kotlin annotations marking the extension functions on the relevant Swing classes. There is no global scope annotation as none of the SubstanceCortex.GlobalScope APIs are exposed via Ember (yet).

You can’t perform that action at this time.