Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for Java 11 #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<main.class>com.rohitawate.everest.Main</main.class>
</properties>
<build>
Expand Down Expand Up @@ -65,11 +65,26 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.jfoenix/jfoenix -->
<dependency>
<groupId>com.jfoenix</groupId>
<artifactId>jfoenix</artifactId>
<version>1.4.0</version>
<version>9.0.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-client -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXProgressBar;
import com.jfoenix.controls.JFXSnackbar;
import com.jfoenix.controls.JFXSnackbarLayout;
import com.rohitawate.everest.controllers.auth.AuthTabController;
import com.rohitawate.everest.controllers.codearea.EverestCodeArea;
import com.rohitawate.everest.controllers.codearea.highlighters.HighlighterFactory;
Expand Down Expand Up @@ -68,6 +69,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.ResourceBundle;
import javafx.util.Duration;

public class DashboardController implements Initializable {
@FXML
Expand Down Expand Up @@ -184,7 +186,8 @@ public void initialize(URL url, ResourceBundle rb) {
responseArea.selectAll();
responseArea.copy();
responseArea.deselect();
snackbar.show("Response body copied to clipboard.", 5000);
snackbar.enqueue(new JFXSnackbar.SnackbarEvent(new Label("Response body copied to clipboard."),
Duration.seconds(5), null));
});

responseTypeBox.getItems().addAll(
Expand Down Expand Up @@ -232,7 +235,8 @@ void sendRequest() {

if (address.equals("")) {
showLayer(ResponseLayer.PROMPT);
snackbar.show("Please enter an address.", 3000);
snackbar.enqueue(new JFXSnackbar.SnackbarEvent(new Label("Please enter an address."),
Duration.seconds(3), null));
return;
}

Expand Down Expand Up @@ -306,7 +310,8 @@ void sendRequest() {
syncManager.saveState(getState().composer);
} catch (MalformedURLException MURLE) {
showLayer(ResponseLayer.PROMPT);
snackbar.show("Invalid address. Please verify and try again.", 3000);
snackbar.enqueue(new JFXSnackbar.SnackbarEvent(new Label("Invalid address. Please verify and try again."),
Duration.seconds(3), null));
} catch (Exception E) {
LoggingService.logSevere("Request execution failed.", E, LocalDateTime.now());
errorTitle.setText("Oops... That's embarrassing!");
Expand All @@ -332,7 +337,8 @@ private void onFailed(Event event) {
} else if (throwable.getClass() == RedirectException.class) {
RedirectException redirect = (RedirectException) throwable;
addressField.setText(redirect.getNewLocation());
snackbar.show("Resource moved permanently. Redirecting...", 3000);
snackbar.enqueue(new JFXSnackbar.SnackbarEvent(new Label("Resource moved permanently. Redirecting..."),
Duration.seconds(3), null));
requestManager = null;
sendRequest();
return;
Expand Down Expand Up @@ -461,16 +467,17 @@ private void prettifyResponseBody(String body, String contentType) {
case "text/html":
simplifiedContentType = HTTPConstants.HTML;
if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
snackbar.show("Open link in browser?", "YES", 5000, e -> {
snackbar.close();
new Thread(() -> {
try {
Desktop.getDesktop().browse(new URI(addressField.getText()));
} catch (Exception ex) {
LoggingService.logWarning("Invalid URL encountered while opening in browser.", ex, LocalDateTime.now());
}
}).start();
});
snackbar.enqueue(new JFXSnackbar.SnackbarEvent(new JFXSnackbarLayout("Open link in browser?", "YES",
e -> {
snackbar.close();
new Thread(() -> {
try {
Desktop.getDesktop().browse(new URI(addressField.getText()));
} catch (Exception ex) {
LoggingService.logWarning("Invalid URL encountered while opening in browser.", ex, LocalDateTime.now());
}
}).start();
}), Duration.seconds(5), null));
}
break;
default:
Expand All @@ -490,7 +497,8 @@ private void prettifyResponseBody(String body, String contentType) {
responseTypeBox.setValue(simplifiedContentType);
} catch (Exception e) {
String errorMessage = "Response could not be parsed.";
snackbar.show(errorMessage, 5000);
snackbar.enqueue(new JFXSnackbar.SnackbarEvent(new Label(errorMessage),
Duration.seconds(5), null));
LoggingService.logSevere(errorMessage, e, LocalDateTime.now());
errorTitle.setText("Parsing Error");
errorDetails.setText(errorMessage);
Expand Down