Search in sources :

Example 1 with INetworkLink

use of org.geometerplus.fbreader.network.INetworkLink in project FBReaderJ by geometer.

the class TopupAction method getContextLabel.

@Override
public String getContextLabel(NetworkTree tree) {
    final INetworkLink link = tree.getLink();
    Money account = null;
    if (link != null) {
        final NetworkAuthenticationManager mgr = link.authenticationManager();
        if (mgr != null && mgr.mayBeAuthorised(false)) {
            account = mgr.currentAccount();
        }
    }
    return super.getContextLabel(tree).replace("%s", account != null ? account.toString() : "");
}
Also used : NetworkAuthenticationManager(org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager) Money(org.geometerplus.zlibrary.core.money.Money) INetworkLink(org.geometerplus.fbreader.network.INetworkLink)

Aggregations

INetworkLink (org.geometerplus.fbreader.network.INetworkLink)1 NetworkAuthenticationManager (org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager)1 Money (org.geometerplus.zlibrary.core.money.Money)1