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