Browse Source

增加限制,不允许添加同分组名的插件

master
hugh 8 years ago
parent
commit
2a5b9a4e2a
  1. 8
      designer_base/src/com/fr/design/formula/FunctionConstants.java

8
designer_base/src/com/fr/design/formula/FunctionConstants.java

@ -34,10 +34,16 @@ public abstract class FunctionConstants {
* @param listModel * @param listModel
*/ */
public static void addFunctionGroupFromPlugins(DefaultListModel listModel){ public static void addFunctionGroupFromPlugins(DefaultListModel listModel){
//hugh:自定义函数分组 //hugh:自定义函数分组,分组名不允许重复
Set<Mutable> containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); Set<Mutable> containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING);
List<String> nameList = new ArrayList<String>();
if(!containers.isEmpty()){ if(!containers.isEmpty()){
for(Mutable container : containers){ for(Mutable container : containers){
String name = ((FunctionDefContainer)container).getGroupName();
if(nameList.contains(name)){
continue;
}
nameList.add(name);
listModel.addElement(createFunctionGroup((FunctionDefContainer)container)); listModel.addElement(createFunctionGroup((FunctionDefContainer)container));
} }
} }

Loading…
Cancel
Save