mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
no Notification.toString is needed
This commit is contained in:
@@ -58,9 +58,6 @@ public abstract class GenericNotifierImpl<T, Key> {
|
||||
@NotNull
|
||||
protected abstract String getNotificationContent(final T obj);
|
||||
|
||||
@NotNull
|
||||
protected abstract String getToString(final T obj);
|
||||
|
||||
protected Collection<Key> getAllCurrentKeys() {
|
||||
synchronized (myLock) {
|
||||
return new ArrayList<Key>(myState.keySet());
|
||||
@@ -109,7 +106,7 @@ public abstract class GenericNotifierImpl<T, Key> {
|
||||
if (myState.containsKey(key)) {
|
||||
return false;
|
||||
}
|
||||
notification = new MyNotification<T>(myGroupId, myTitle, getNotificationContent(obj), myType, myListener, obj, getToString(obj));
|
||||
notification = new MyNotification<T>(myGroupId, myTitle, getNotificationContent(obj), myType, myListener, obj);
|
||||
myState.put(key, notification);
|
||||
}
|
||||
final boolean state = onFirstNotification(obj);
|
||||
@@ -180,24 +177,21 @@ public abstract class GenericNotifierImpl<T, Key> {
|
||||
|
||||
protected static class MyNotification<T> extends Notification {
|
||||
private final T myObj;
|
||||
private final String myStringPresentation;
|
||||
|
||||
protected MyNotification(@NotNull String groupId, @NotNull String title, @NotNull String content, @NotNull NotificationType type, @Nullable NotificationListener listener,
|
||||
@NotNull final T obj,
|
||||
final String stringPresentation) {
|
||||
protected MyNotification(@NotNull String groupId,
|
||||
@NotNull String title,
|
||||
@NotNull String content,
|
||||
@NotNull NotificationType type,
|
||||
@Nullable NotificationListener listener,
|
||||
@NotNull final T obj) {
|
||||
super(groupId, title, content, type, listener);
|
||||
myObj = obj;
|
||||
myStringPresentation = stringPresentation;
|
||||
}
|
||||
|
||||
public T getObj() {
|
||||
return myObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return myStringPresentation;
|
||||
}
|
||||
}
|
||||
|
||||
private static void log(final String s) {
|
||||
|
||||
@@ -233,12 +233,6 @@ public class SvnAuthenticationNotifier extends GenericNotifierImpl<SvnAuthentica
|
||||
return "<a href=\"\">Click to fix.</a> Not logged In to Subversion '" + obj.getRealm() + "' (" + obj.getUrl().toDecodedString() + ")";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getToString(AuthenticationRequest obj) {
|
||||
return "Click to fix. Not logged In to Subversion '" + obj.getRealm() + "' (" + obj.getUrl().toDecodedString() + ")";
|
||||
}
|
||||
|
||||
public static class AuthenticationRequest {
|
||||
private final Project myProject;
|
||||
private final String myKind;
|
||||
|
||||
@@ -43,10 +43,4 @@ public class SvnProxyAuthenticationNotifier extends GenericNotifierImpl<String,
|
||||
protected String getNotificationContent(String obj) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getToString(String obj) {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user