-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INTERNAL][I] Move xmpp error callback into lambda
- Loading branch information
Showing
1 changed file
with
5 additions
and
11 deletions.
There are no files selected for viewing
16 changes: 5 additions & 11 deletions
16
intellij/src/saros/intellij/ui/eventhandler/ConnectingFailureHandler.java
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 |
---|---|---|
@@ -1,23 +1,17 @@ | ||
package saros.intellij.ui.eventhandler; | ||
|
||
import saros.account.XMPPAccount; | ||
import saros.communication.connection.ConnectionHandler; | ||
import saros.communication.connection.IConnectingFailureCallback; | ||
import saros.intellij.ui.util.NotificationPanel; | ||
import saros.ui.CoreMessages; | ||
|
||
/** Callback handler informing the user of a failed XMPP connection attempt. */ | ||
public class ConnectingFailureHandler { | ||
|
||
@SuppressWarnings("FieldCanBeLocal") | ||
private final IConnectingFailureCallback connectingFailureCallback = this::handleConnectionFailed; | ||
|
||
public ConnectingFailureHandler(ConnectionHandler connectionHandler) { | ||
connectionHandler.setCallback(connectingFailureCallback); | ||
} | ||
|
||
public void handleConnectionFailed(XMPPAccount account, String errorMessage) { | ||
// TODO offer user possibility of adjusting settings and re-connect | ||
NotificationPanel.showError(errorMessage, CoreMessages.ConnectingFailureHandler_title); | ||
connectionHandler.setCallback( | ||
(account, errorMessage) -> { | ||
// TODO offer user possibility of adjusting settings and re-connect | ||
NotificationPanel.showError(errorMessage, CoreMessages.ConnectingFailureHandler_title); | ||
}); | ||
} | ||
} |