|
|
|
@ -27,11 +27,7 @@ public abstract class ClipboardFilter {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static <T> T cut(T selection) { |
|
|
|
|
|
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
providers.addAll(clipboardHandlerProviders); |
|
|
|
|
for (ClipboardHandlerProvider provider : providers) { |
|
|
|
|
for (ClipboardHandlerProvider provider : getClipboardHandlerProviders()) { |
|
|
|
|
if (provider.support(selection)) { |
|
|
|
|
selection = ((ClipboardHandlerProvider<T>) provider).cut(selection); |
|
|
|
|
} |
|
|
|
@ -40,10 +36,7 @@ public abstract class ClipboardFilter {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static <T> T copy(T selection) { |
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
providers.addAll(clipboardHandlerProviders); |
|
|
|
|
for (ClipboardHandlerProvider provider : providers) { |
|
|
|
|
for (ClipboardHandlerProvider provider : getClipboardHandlerProviders()) { |
|
|
|
|
if (provider.support(selection)) { |
|
|
|
|
selection = ((ClipboardHandlerProvider<T>) provider).copy(selection); |
|
|
|
|
} |
|
|
|
@ -52,15 +45,27 @@ public abstract class ClipboardFilter {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static <T> T paste(T selection) { |
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
providers.addAll(clipboardHandlerProviders); |
|
|
|
|
|
|
|
|
|
for (ClipboardHandlerProvider provider : providers) { |
|
|
|
|
for (ClipboardHandlerProvider provider : getClipboardHandlerProviders()) { |
|
|
|
|
if (provider.support(selection)) { |
|
|
|
|
selection = ((ClipboardHandlerProvider<T>) provider).paste(selection); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return selection; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static Set<ClipboardHandlerProvider> getClipboardHandlerProviders() { |
|
|
|
|
Set<ClipboardHandlerProvider> providers = new HashSet<>(); |
|
|
|
|
|
|
|
|
|
for (ClipboardHandlerProvider clipboardHandlerProvider : clipboardHandlerProviders) { |
|
|
|
|
providers.add(clipboardHandlerProvider); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> pluginProviders = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
for (ClipboardHandlerProvider clipboardHandlerProvider : pluginProviders) { |
|
|
|
|
providers.add(clipboardHandlerProvider); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return providers; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|