Rename fileListMonitored to filesMonitored

MYC-Refactor
Hammy 3 years ago
parent 79763cd19a
commit 791377538b

@ -11,7 +11,7 @@ abstract class ClipboardListener {
private EventManager eventManager = new EventManager(); private EventManager eventManager = new EventManager();
private boolean imageMonitored = true; private boolean imageMonitored = true;
private boolean textMonitored = true; private boolean textMonitored = true;
private boolean fileListMonitored = true; private boolean fileMonitored = true;
/** /**
* Main entry point of execution for both {@link MacClipboardListener} and {@link WindowsOrUnixClipboardListener} * Main entry point of execution for both {@link MacClipboardListener} and {@link WindowsOrUnixClipboardListener}
@ -45,6 +45,10 @@ abstract class ClipboardListener {
this.imageMonitored = !imageMonitored; this.imageMonitored = !imageMonitored;
} }
void toggleFileMonitored() {
this.fileMonitored = !fileMonitored;
}
boolean isImageMonitored() { boolean isImageMonitored() {
return imageMonitored; return imageMonitored;
} }
@ -57,16 +61,16 @@ abstract class ClipboardListener {
return textMonitored; return textMonitored;
} }
public boolean isFileListMonitored() { void setTextMonitored(boolean textMonitored) {
return fileListMonitored; this.textMonitored = textMonitored;
} }
public void setFileListMonitored(boolean fileListMonitored) { boolean isFileMonitored() {
this.fileListMonitored = fileListMonitored; return fileMonitored;
} }
void setTextMonitored(boolean textMonitored) { void setFileMonitored(boolean fileMonitored) {
this.textMonitored = textMonitored; this.fileMonitored = fileMonitored;
} }
EventManager getEventManager() { EventManager getEventManager() {

@ -76,7 +76,7 @@ class MacClipboardListener extends ClipboardListener {
* @param myClipboardContents {@link MyClipboardContent[]} of Unknown {@link Class} containing previous contents * @param myClipboardContents {@link MyClipboardContent[]} of Unknown {@link Class} containing previous contents
*/ */
void checkFiles(Transferable newClipboardContents, MyClipboardContent<?>[] myClipboardContents) { void checkFiles(Transferable newClipboardContents, MyClipboardContent<?>[] myClipboardContents) {
if (isFileListMonitored()) { if (isFileMonitored()) {
if (FILELIST.isAvailable(clipboard)) { if (FILELIST.isAvailable(clipboard)) {
List<File> fileListContent = getFileContent(newClipboardContents); List<File> fileListContent = getFileContent(newClipboardContents);
if (fileListContent == null) return; if (fileListContent == null) return;

@ -106,6 +106,10 @@ public class MyClipboard {
clipboardListener.toggleImagesMonitored(); clipboardListener.toggleImagesMonitored();
} }
public void toggleFilesMonitored() {
clipboardListener.toggleFileMonitored();
}
public boolean isImageMonitored() { public boolean isImageMonitored() {
return clipboardListener.isImageMonitored(); return clipboardListener.isImageMonitored();
} }
@ -122,6 +126,14 @@ public class MyClipboard {
clipboardListener.setTextMonitored(textMonitored); clipboardListener.setTextMonitored(textMonitored);
} }
public boolean isFileMonitored() {
return clipboardListener.isFileMonitored();
}
public void setFileMonitored(boolean fileMonitored) {
clipboardListener.setFileMonitored(fileMonitored);
}
private static boolean isMac() { private static boolean isMac() {
return SystemUtils.IS_OS_MAC; return SystemUtils.IS_OS_MAC;
} }

@ -64,7 +64,7 @@ class WindowsOrUnixClipboardListener extends ClipboardListener implements Runnab
} }
} }
if (isFileListMonitored()) { if (isFileMonitored()) {
if (FILELIST.isAvailable(oldClipboard)) { if (FILELIST.isAvailable(oldClipboard)) {
List<File> fileList = getFileContent(newClipboardContents); List<File> fileList = getFileContent(newClipboardContents);
getEventManager().notifyFilesEvent(oldClipboardContent, fileList); getEventManager().notifyFilesEvent(oldClipboardContent, fileList);

Loading…
Cancel
Save