|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
package com.fr.design.base.clipboard; |
|
|
|
|
|
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
import com.fr.design.fun.ClipboardHandlerProvider; |
|
|
|
|
import com.fr.form.main.ExtraFormClassManager; |
|
|
|
|
import com.fr.plugin.injectable.PluginModule; |
|
|
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
@ -14,11 +14,10 @@ public abstract class ClipboardFilter {
|
|
|
|
|
|
|
|
|
|
public static <T> T cut(T selection) { |
|
|
|
|
|
|
|
|
|
Class<?> clazz = selection.getClass(); |
|
|
|
|
ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); |
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
for (ClipboardHandlerProvider provider : providers) { |
|
|
|
|
if (provider.support(clazz)) { |
|
|
|
|
if (provider.support(selection)) { |
|
|
|
|
selection = ((ClipboardHandlerProvider<T>) provider).cut(selection); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -27,11 +26,10 @@ public abstract class ClipboardFilter {
|
|
|
|
|
|
|
|
|
|
public static <T> T copy(T selection) { |
|
|
|
|
|
|
|
|
|
Class<?> clazz = selection.getClass(); |
|
|
|
|
ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); |
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
for (ClipboardHandlerProvider provider : providers) { |
|
|
|
|
if (provider.support(clazz)) { |
|
|
|
|
if (provider.support(selection)) { |
|
|
|
|
selection = ((ClipboardHandlerProvider<T>) provider).copy(selection); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -40,11 +38,10 @@ public abstract class ClipboardFilter {
|
|
|
|
|
|
|
|
|
|
public static <T> T paste(T selection) { |
|
|
|
|
|
|
|
|
|
Class<?> clazz = selection.getClass(); |
|
|
|
|
ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); |
|
|
|
|
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); |
|
|
|
|
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); |
|
|
|
|
for (ClipboardHandlerProvider provider : providers) { |
|
|
|
|
if (provider.support(clazz)) { |
|
|
|
|
if (provider.support(selection)) { |
|
|
|
|
selection = ((ClipboardHandlerProvider<T>) provider).paste(selection); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|