Package com.luna.common.swing
Enum Class ClipboardMonitor
- All Implemented Interfaces:
ClipboardOwner
,Closeable
,Serializable
,AutoCloseable
,Comparable<ClipboardMonitor>
,java.lang.constant.Constable
,Runnable
public enum ClipboardMonitor
extends Enum<ClipboardMonitor>
implements ClipboardOwner, Runnable, Closeable
剪贴板监听
- Since:
- 4.5.6
- Author:
- looly
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
默认重试等待:100static final int
默认重试此时:10 -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(ClipboardListener listener) 设置 监听事件处理清空监听void
close()
关闭(停止)监听void
listen
(boolean sync) 开始监听void
lostOwnership
(Clipboard clipboard, Transferable contents) removeListener
(ClipboardListener listener) 去除指定监听void
run()
setDelay
(long delay) 设置重试等待setTryCount
(int tryCount) 设置重试次数static ClipboardMonitor
Returns the enum constant of this class with the specified name.static ClipboardMonitor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
DEFAULT_TRY_COUNT
public static final int DEFAULT_TRY_COUNT默认重试此时:10- See Also:
-
DEFAULT_DELAY
public static final long DEFAULT_DELAY默认重试等待:100- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
setTryCount
设置重试次数- Parameters:
tryCount
- 重试次数- Returns:
- this
-
setDelay
设置重试等待- Parameters:
delay
- 重试等待- Returns:
- this
-
addListener
设置 监听事件处理- Parameters:
listener
- 监听事件处理- Returns:
- this
-
removeListener
去除指定监听- Parameters:
listener
- 监听- Returns:
- this
-
clearListener
清空监听- Returns:
- this
-
lostOwnership
- Specified by:
lostOwnership
in interfaceClipboardOwner
-
run
public void run() -
listen
public void listen(boolean sync) 开始监听- Parameters:
sync
- 是否阻塞
-
close
public void close()关闭(停止)监听- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-