way to avoid initialization in constructor

This commit is contained in:
Nikolay Matveev
2010-11-10 15:30:34 +03:00
parent 47018d757f
commit 916b45b0cf
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2010 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,6 +55,15 @@ public abstract class NamedItemsListEditor<T> extends MasterDetailsComponent {
Cloner<T> cloner,
Equality<T> comparer,
List<T> items) {
this(namer, factory, cloner, comparer, items, true);
}
protected NamedItemsListEditor(Namer<T> namer,
Factory<T> factory,
Cloner<T> cloner,
Equality<T> comparer,
List<T> items,
boolean initInConstructor) {
myNamer = namer;
myFactory = factory;
myCloner = cloner;
@@ -62,9 +71,10 @@ public abstract class NamedItemsListEditor<T> extends MasterDetailsComponent {
myOriginalItems = items;
myResultItems = items;
reset();
initTree();
if (initInConstructor) {
reset();
initTree();
}
}
public void reset() {