forked from nus-cs2103-AY1718S1/addressbook-level4-old
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from blaqkrow/v1.2-Implementing-Google-maps-+-…
…extra-UI-elements V1.2 Implementing Google maps + extra UI elements
- Loading branch information
Showing
22 changed files
with
295 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package seedu.address.ui; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.Logger; | ||
|
||
import com.google.common.eventbus.Subscribe; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.layout.Region; | ||
import seedu.address.commons.core.LogsCenter; | ||
import seedu.address.commons.events.ui.PersonPanelSelectionChangedEvent; | ||
import seedu.address.logic.commands.exceptions.CommandException; | ||
import seedu.address.logic.parser.exceptions.ParseException; | ||
|
||
/** | ||
* The UI component that is responsible for emailing the selected person. | ||
*/ | ||
public class EmailButton extends UiPart<Region> { | ||
|
||
public static final String ERROR_STYLE_CLASS = "error"; | ||
private static final String FXML = "EmailButton.fxml"; | ||
|
||
private final Logger logger = LogsCenter.getLogger(CommandBox.class); | ||
private String selectedEmail = ""; | ||
|
||
@FXML | ||
private Button emailButton; | ||
public EmailButton() { | ||
super(FXML); | ||
registerAsAnEventHandler(this); | ||
} | ||
|
||
/** | ||
* Handles the Email button pressed event. | ||
*/ | ||
@FXML | ||
private void handleEmailButtonPressed() throws CommandException, ParseException, IOException { | ||
OpenEmailClient emailClient = new OpenEmailClient(this.selectedEmail); | ||
emailClient.sendMail(); | ||
} | ||
|
||
@Subscribe | ||
private void handlePersonPanelSelectionChangedEvent(PersonPanelSelectionChangedEvent event) { | ||
this.selectedEmail = event.getNewSelection().person.emailProperty().getValue().toString(); | ||
logger.info(LogsCenter.getEventHandlingLogMessage(event)); | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package seedu.address.ui; | ||
|
||
import java.awt.Desktop; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
|
||
|
||
/** | ||
* Handles the opening of email client | ||
*/ | ||
public class OpenEmailClient { | ||
private Desktop desktop = Desktop.getDesktop(); | ||
private String mailTo; | ||
|
||
/** | ||
* Handles the opening of email client | ||
*/ | ||
public OpenEmailClient(String mailTo) { | ||
this.mailTo = mailTo.trim(); | ||
} | ||
|
||
public void setMail (String m) { | ||
mailTo = m; | ||
} | ||
/** | ||
* Handles the sending mail | ||
*/ | ||
public void sendMail () throws IOException { | ||
|
||
URI uri = URI.create("mailto:" + this.mailTo); | ||
desktop.mail(uri); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Button?> | ||
|
||
|
||
<Button fx:id="emailButton" mnemonicParsing="false" onAction="#handleEmailButtonPressed" text="Email" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.