Browse Source

Pull request #7377: REPORT-64920 复制粘贴接口报错处理

Merge in DESIGN/design from ~TOMMY/design:release/10.0 to release/10.0

* commit 'b74c40c8b5192222ba47073f56386cf5d25e4b73':
  REPORT-64920 复制粘贴接口报错处理
zheng-1641779399395
Tommy 3 years ago
parent
commit
456887c7d7
  1. 33
      designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java

33
designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java

@ -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;
}
}

Loading…
Cancel
Save