From 4943a52b4753026cb26615f7afe2f8e06ef104d5 Mon Sep 17 00:00:00 2001 From: Derekljh Date: Mon, 29 Apr 2024 19:45:28 +0800 Subject: [PATCH] Add Citations for code adapted from online sources --- src/main/java/seedu/address/logic/commands/MailCommand.java | 1 + src/main/java/seedu/address/logic/commands/PhoneCommand.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/logic/commands/MailCommand.java b/src/main/java/seedu/address/logic/commands/MailCommand.java index 53c4d6c7588..7ee3c34f632 100644 --- a/src/main/java/seedu/address/logic/commands/MailCommand.java +++ b/src/main/java/seedu/address/logic/commands/MailCommand.java @@ -55,6 +55,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command } private void openMailApp(String emailList) throws URISyntaxException, IOException { + // Cited from: https://stackoverflow.com/questions/2357895/java-open-default-mail-application-and-create-new-mail-and-populate-to-and-subj Desktop desktop; if (Desktop.isDesktopSupported() && (desktop = Desktop.getDesktop()).isSupported(Desktop.Action.MAIL)) { diff --git a/src/main/java/seedu/address/logic/commands/PhoneCommand.java b/src/main/java/seedu/address/logic/commands/PhoneCommand.java index 8a9db91197f..4f750ba92e9 100644 --- a/src/main/java/seedu/address/logic/commands/PhoneCommand.java +++ b/src/main/java/seedu/address/logic/commands/PhoneCommand.java @@ -45,7 +45,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command String phoneList = model.getFilteredPersonList().stream() .map(person -> person.getPhone().toString()) .collect(Collectors.joining(",")); - + // Cited from: https://stackoverflow.com/questions/6710350/copying-text-to-the-clipboard-using-java StringSelection stringSelection = new StringSelection(phoneList); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(stringSelection, null);