Skip to content

Commit 5743975

Browse files
author
nicolaiparlog
committed
Created interface 'ListenerHandle' (still undocumented).
1 parent 7d7c9b2 commit 5743975

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.codefx.libfx.listener;
2+
3+
// TODO what should the contract be for created handles? Always attached?
4+
// Answer: Up to the returning method to specify!
5+
6+
public interface ListenerHandle {
7+
8+
void attach();
9+
10+
void detach();
11+
12+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.codefx.libfx.listener;
2+
3+
/**
4+
* Indicates how to create the {@link ListenerHandle}. If the handle is created by a builder, the corresponding method
5+
* should be called (in order to test it) instead of attaching/detaching the listener after its creation.
6+
*/
7+
public enum CreateListenerHandle {
8+
9+
/**
10+
* The listener must be initially attached.
11+
*/
12+
ATTACHED,
13+
14+
/**
15+
* The listener must be initially detached.
16+
*/
17+
DETACHED;
18+
}

0 commit comments

Comments
 (0)