All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dlsc.preferencesfx.PreferencesFxEvent Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package com.dlsc.preferencesfx;

import javafx.event.Event;
import javafx.event.EventType;

/**
 * Identifies events triggered by {@code PreferencesFx} when the dialog is closed.
 *
 * @author Andres Almiray
 */
public class PreferencesFxEvent extends Event {
  /**
   * When preferences are saved (dialog was closed).
   */
  public static final EventType EVENT_PREFERENCES_SAVED =
      new EventType<>(ANY, "EVENT_PREFERENCES_SAVED");

  /**
   * When preferences are not saved (dialog was cancelled).
   */
  public static final EventType EVENT_PREFERENCES_NOT_SAVED =
      new EventType<>(ANY, "EVENT_PREFERENCES_NOT_SAVED");

  /**
   * Creates a new instance of {@code PreferencesFxEvent} with event type set to {@code
   * EVENT_PREFERENCES_SAVED}.
   *
   * @return the newly created PreferencesFxEvent.
   */
  public static PreferencesFxEvent preferencesSavedEvent() {
    return new PreferencesFxEvent(EVENT_PREFERENCES_SAVED);
  }

  /**
   * Creates a new instance of {@code PreferencesFxEvent} with event type set to {@code
   * EVENT_PREFERENCES_NOT_SAVED}.
   *
   * @return the newly created PreferencesFxEvent.
   */
  public static PreferencesFxEvent preferencesNotSavedEvent() {
    return new PreferencesFxEvent(EVENT_PREFERENCES_NOT_SAVED);
  }

  private PreferencesFxEvent(EventType eventType) {
    super(eventType);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy