diff src/org/tmatesoft/hg/internal/AdapterPlug.java @ 582:90df078d6418

Delegate cancel to original support, do not implement CancelSupport ourselves
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 22 Apr 2013 19:17:29 +0200
parents 1ee452f31187
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/AdapterPlug.java	Mon Apr 22 16:02:17 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/AdapterPlug.java	Mon Apr 22 19:17:29 2013 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 TMate Software Ltd
+ * Copyright (c) 2012-2013 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,6 +37,11 @@
 	public <T> void attachAdapter(Class<T> adapterClass, T instance) {
 		adapters.put(adapterClass, instance);
 	}
+	
+	@SuppressWarnings("unchecked")
+	public <T> T detachAdapter(Class<T> adapterClass) {
+		return (T) adapters.remove(adapterClass);
+	}
 
 	public <T> T getAdapter(Class<T> adapterClass) {
 		Object instance = adapters.get(adapterClass);