Browse Source

REPORT-48965 使用批量添加 减少容器复制次数

feature/big-screen
hades 4 years ago
parent
commit
6daaa9f4f9
  1. 9
      designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

9
designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

@ -13,6 +13,7 @@ import javax.swing.KeyStroke;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -257,14 +258,14 @@ public class ActionFactory {
*/ */
public static void registerCellInsertActionClass(Class<?>[] cls) { public static void registerCellInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
Collections.addAll(actionClasses, cls); actionClasses.addAll(Arrays.asList(cls));
} }
} }
public static void referCellInsertActionClass(Class<?>[] cls) { public static void referCellInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
actionClasses.clear(); actionClasses.clear();
Collections.addAll(actionClasses, cls); actionClasses.addAll(Arrays.asList(cls));
} }
} }
@ -322,14 +323,14 @@ public class ActionFactory {
*/ */
public static void registerFloatInsertActionClass(Class<?>[] cls) { public static void registerFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
Collections.addAll(floatActionClasses, cls); floatActionClasses.addAll(Arrays.asList(cls));
} }
} }
public static void referFloatInsertActionClass(Class<?>[] cls) { public static void referFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
floatActionClasses.clear(); floatActionClasses.clear();
Collections.addAll(floatActionClasses, cls); floatActionClasses.addAll(Arrays.asList(cls));
} }
} }

Loading…
Cancel
Save