public enum ClipboardMonitor extends Enum<ClipboardMonitor> implements ClipboardOwner, Runnable, Closeable
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_DELAY
默认重试等待:100
|
static int |
DEFAULT_TRY_COUNT
默认重试此时:10
|
Modifier and Type | Method and Description |
---|---|
ClipboardMonitor |
addListener(ClipboardListener listener)
设置 监听事件处理
|
ClipboardMonitor |
clearListener()
清空监听
|
void |
close()
关闭(停止)监听
|
void |
listen(boolean sync)
开始监听
|
void |
lostOwnership(Clipboard clipboard,
Transferable contents) |
ClipboardMonitor |
removeListener(ClipboardListener listener)
去除指定监听
|
void |
run() |
ClipboardMonitor |
setDelay(long delay)
设置重试等待
|
ClipboardMonitor |
setTryCount(int tryCount)
设置重试次数
|
static ClipboardMonitor |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClipboardMonitor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClipboardMonitor INSTANCE
public static final int DEFAULT_TRY_COUNT
public static final long DEFAULT_DELAY
public static ClipboardMonitor[] values()
for (ClipboardMonitor c : ClipboardMonitor.values()) System.out.println(c);
public static ClipboardMonitor valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic ClipboardMonitor setTryCount(int tryCount)
tryCount
- 重试次数public ClipboardMonitor setDelay(long delay)
delay
- 重试等待public ClipboardMonitor addListener(ClipboardListener listener)
listener
- 监听事件处理public ClipboardMonitor removeListener(ClipboardListener listener)
listener
- 监听public ClipboardMonitor clearListener()
public void lostOwnership(Clipboard clipboard, Transferable contents)
lostOwnership
in interface ClipboardOwner
public void listen(boolean sync)
sync
- 是否阻塞public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2024. All rights reserved.