- java.lang.Object
-
- java.util.EventObject
-
- javafx.event.Event
-
- com.flexganttfx.model.repository.RepositoryEvent
-
- All Implemented Interfaces:
Serializable
,Cloneable
public final class RepositoryEvent extends Event
An event class used by activity repositories to inform event handlers about changes.
-
-
Field Summary
Fields Modifier and Type Field Description static EventType<RepositoryEvent>
ACTIVITY_ADDED
An event type that indicates that an activity has been added to the repository.static EventType<RepositoryEvent>
ACTIVITY_REMOVED
An event type that indicates that an activity has been removed from the repository.static EventType<RepositoryEvent>
REPOSITORY_CHANGED
An event type that indicates that "something" inside the repository has changed.-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description RepositoryEvent(ActivityRepository<?> repository)
Constructs a new repository event, the event type will be set to #REPOSITORY_CHANGED.RepositoryEvent(EventType<RepositoryEvent> eventType, ActivityRepository<?> repository, ActivityRef<?> activityRef)
Constructs a new repository event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActivityRef<?>
getActivityRef()
Returns the affected activity (ref).ActivityRepository<?>
getRepository()
Returns the affected repository.-
Methods inherited from class javafx.event.Event
clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Field Detail
-
REPOSITORY_CHANGED
public static final EventType<RepositoryEvent> REPOSITORY_CHANGED
An event type that indicates that "something" inside the repository has changed.- Since:
- 1.0
-
ACTIVITY_ADDED
public static final EventType<RepositoryEvent> ACTIVITY_ADDED
An event type that indicates that an activity has been added to the repository.- Since:
- 1.0
-
ACTIVITY_REMOVED
public static final EventType<RepositoryEvent> ACTIVITY_REMOVED
An event type that indicates that an activity has been removed from the repository.- Since:
- 1.0
-
-
Constructor Detail
-
RepositoryEvent
public RepositoryEvent(EventType<RepositoryEvent> eventType, ActivityRepository<?> repository, ActivityRef<?> activityRef)
Constructs a new repository event.- Parameters:
eventType
- the type of the event, e.g. #ACTIVITY_ADDEDrepository
- the repository where the event occurredactivityRef
- the affected activity (ref)- Since:
- 1.0
-
RepositoryEvent
public RepositoryEvent(ActivityRepository<?> repository)
Constructs a new repository event, the event type will be set to #REPOSITORY_CHANGED.- Parameters:
repository
- the repository where the event occurred- Since:
- 1.0
-
-
Method Detail
-
getActivityRef
public final ActivityRef<?> getActivityRef()
Returns the affected activity (ref).- Returns:
- the activity
- Since:
- 1.0
-
getRepository
public final ActivityRepository<?> getRepository()
Returns the affected repository.- Returns:
- the repository
- Since:
- 1.0
-
-