Package-level declarations

Entry point of the plugin. Contains main classes, shared classes, and helper classes.

Types

Link copied to clipboard
data class Box<T : Any>(val generator: () -> T, var value: T? = null)

A lazily-instantiated reference to an object of type T.

Link copied to clipboard
object Bundle

Simple accessor for working with internationalized strings.

Link copied to clipboard
enum CapitalizationMode(val transform: (String, Random) -> String) : Enum<CapitalizationMode>

A mode in which a word should be capitalized.

Link copied to clipboard
class DataGenerationException(message: String? = null, cause: Throwable? = null) : Exception

Thrown if a random datum could not be generated.

Link copied to clipboard
abstract class DecoratorScheme : Scheme

Transparently extends or alters the functionality of a Scheme with a decorating function.

Link copied to clipboard
internal class ErrorReporter : ErrorReportSubmitter

Reports exceptions on GitHub.

Link copied to clipboard
private class GitHubReporter

Knows how to report IssueData to GitHub.

Link copied to clipboard
private object GitHubScrambler

A GitHub authentication token that is slightly scrambled (and NOT SECURE).

Link copied to clipboard
interface IconDescriptor

Describes an Icon, and can instantiate an icon, but is not itself an icon.

Link copied to clipboard
object Icons

Basic Randomness icons.

Link copied to clipboard
abstract class InsertAction(val repeat: Boolean = false, val text: String, description: String? = null, icon: Icon? = null) : AnAction

Inserts strings in the editor.

Link copied to clipboard
private class IssueData(val events: List<IdeaLoggingEvent>, val additionalInfo: String?, val pluginDescriptor: PluginDescriptor)

Contains a variety of metadata on an issue to report, and knows how to format the issue in a textual form.

Link copied to clipboard
data class OverlayedIcon(val base: TypeIcon, val overlays: List<OverlayIcon> = emptyList()) : IconDescriptor

An overlayed icon, which is a base icon with various overlays placed on top.

Link copied to clipboard
data class OverlayIcon(val base: Icon, val fill: Icon = base) : IconDescriptor

An overlay icon, which can be displayed on top of other icons.

Link copied to clipboard
internal class PersistentSettings : PersistentStateComponent<Element>

The persistent Settings instance, stored as an Element to allow custom conversion for backwards compatibility.

Link copied to clipboard
class PopupAction : AnAction

Shows a popup for all available Randomness actions.

Link copied to clipboard
class RadialColorReplacementFilter(val colors: List<Color>, val center: Pair<Int, Int>? = null) : RGBImageFilter

Replaces all colors with one of colors depending on the angle relative to center.

Link copied to clipboard
abstract class Scheme : State

A scheme is a State that is also a configurable random number generator.

Link copied to clipboard
abstract class SchemeEditor<S : Scheme>(val scheme: S) : Disposable

An editor for a Scheme.

Link copied to clipboard
data class Settings(var version: String = CURRENT_VERSION, val templateList: TemplateList = TemplateList()) : State

Contains references to various State objects.

Link copied to clipboard
class SettingsException(message: String? = null, cause: Throwable? = null) : IllegalArgumentException, ExceptionWithAttachments

Indicates that settings could not be parsed correctly.

Link copied to clipboard
private class SimpleAbstractAction(val myActionPerformed: (ActionEvent?) -> Unit) : AbstractAction

An AbstractAction that uses myActionPerformed as the implementation of its actionPerformed method.

Link copied to clipboard
internal class StartupNotifier : ProjectActivity

Displays notifications when a project is opened.

Link copied to clipboard
abstract class State

A state holds variables that can be configured, validated, copied, and loaded.

Link copied to clipboard
class SubtractionFilter(icon: Icon) : RGBImageFilter

Interprets the given icon as a mask in which non-empty pixels indicate which pixels should be removed.

Link copied to clipboard
object Timely

Functions relating to time-limited behavior.

Link copied to clipboard
class Timestamp(value: String = "1970-01-01 00:00:00.000") : State

A textual representation of a moment in time, with additional support handling invalid user inputs and for the special timestamp NOW. Allowing invalid user inputs to be stored in a Timestamp ensures that com.fwdekker.randomness.ui.JDateTimeField does not reset the input field after an invalid input has been written.

Link copied to clipboard
class TimestampConverter : Converter<Timestamp>

Serializes Timestamps to and from Strings.

Link copied to clipboard
data class TypeIcon(val base: Icon, val text: String, val colors: List<Color>) : IconDescriptor

Describes a colored icon with some text in it.

Functions

Link copied to clipboard
fun Element.addProperty(name: String, value: String? = null)

Adds a property with given name and value.

Link copied to clipboard
fun String.camelPlus(other: String): String

Appends other, ensuring the resulting string is in camel case as long as this and other are also in camel case.

Link copied to clipboard
private fun filterIcon(base: Icon, filter: RGBImageFilter): FilteredIcon

Applies the given filter to the given base.

Link copied to clipboard
fun Element.getDecorators(): List<Element>

Assuming this is the Element representation of a Settings instance, returns the list of Elements of the contained com.fwdekker.randomness.DecoratorSchemes. Searches recursively, so also returns decorators of decorators, and so on.

Link copied to clipboard
fun <E> List<E>.getMod(index: Int): E

Returns the indexth element of this, wrapping around circularly so that index -1 is equivalent to this.size - 1.

Link copied to clipboard
fun Element.getMultiProperty(name: String): List<Element>

Returns all children with attribute name="[name]".

Link copied to clipboard
fun Element.getMultiPropertyValue(name: String): List<String>

Returns the values of all properties with the given name.

Link copied to clipboard
fun Element.getProperty(name: String): Element?

Returns the single child with attribute name="[name]", or null if there is not exactly one such child.

Link copied to clipboard
fun Element.getPropertyByPath(vararg names: String?): Element?

Traverses a path of Elements based on their names by monadically either calling getProperty (if the name is not null) or taking the single child (if the name is null).

Link copied to clipboard
fun Element.getPropertyValue(name: String): String?

Returns the value of the value attribute of property name, or null if the property does not exist, the property has no value, or there are multiple properties with the given name.

Link copied to clipboard
fun Element.getSchemes(): List<Element>

Assuming this is the Element representation of a Settings instance, returns the list of Elements of the contained com.fwdekker.randomness.Schemes.

Link copied to clipboard
fun Element.getTemplateList(): Element?

Assuming this is the Element representation of a Settings instance, returns the Element of the contained com.fwdekker.randomness.template.TemplateList, or null if no such Element could be found.

Link copied to clipboard
fun Element.getTemplates(): List<Element>

Assuming this is the Element representation of a Settings instance, returns the list of Elements of the contained com.fwdekker.randomness.template.Templates.

Link copied to clipboard
fun String.lowerCaseFirst(): String

Turns the first character lowercase while all other characters remain unchanged.

Link copied to clipboard
fun String.matchesFormat(format: String, vararg args: String): Boolean

Returns true if format is a format string for this string, optionally after inserting args into format.

Link copied to clipboard
fun Random.nextTimestampInclusive(min: Timestamp, max: Timestamp): LocalDateTime

Returns a random LocalDateTime between min (inclusive) and max (inclusive).

Link copied to clipboard
fun ListPopupImpl.registerModifierActions(captionModifier: (ActionEvent?) -> String)

Registers actions such that actions can be selected while holding (combinations of) modifier keys.

Link copied to clipboard
fun Element.removeProperty(name: String)

Removes the property with attribute name="[name]".

Link copied to clipboard
fun Element.renameProperty(oldName: String, newName: String)

Renames the property from oldName to newName.

Link copied to clipboard
fun <E> MutableCollection<E>.setAll(collection: Collection<E>)

Removes all elements from this collection and adds all elements from collection.

Link copied to clipboard
fun Element.setPropertyValue(name: String, value: String?)

Sets the value of the value attribute of property name, or adds the property if it does not exist.

Link copied to clipboard
private operator fun <E> List<List<E>>.times(other: List<List<E>>): List<List<E>>

Returns the cartesian product of this and other.

Link copied to clipboard
private fun Char.toRandomCase(random: Random): Char
Link copied to clipboard
private fun String.toSentenceCase(): String
Link copied to clipboard
fun String.upperCaseFirst(): String

Turns the first character uppercase while all other characters remain unchanged.