package view.editor;


import java.util.ResourceBundle;
import api.ISerializable;
import enums.DefaultStrings;
import javafx.collections.ObservableList;
import view.Utilities;

public class EditorFactory {

	// language -> used in the resource bundle for all editors
	// toEdit -> entity to be edited for editorEntity; entitySystem to be edited for editorEnvironment
	// masterEntityList -> master list with all current entities, observed 
	//							  -> editorEntity will add to upon saving, it the editor is not already contained in the list
	//							  -> editorEnvironment will use this list to populate its layout
	// entitySystemList -> master list with all current entity systems (i.e. environments), observed
	//							  -> editorEntity will receive an empty one of these, should do nothing to 
	//							  -> editorEnvironment will add to this upon saving, if the system is not already contained in the list
	
	public Editor createEditor(Class<?> name,  String language, ISerializable toEdit, ObservableList<ISerializable> masterEntityList, ObservableList<ISerializable> entitySystemList) {
		Editor editor = null;
		try {
			editor = (Editor) name.getConstructor( String.class, ISerializable.class, ObservableList.class, ObservableList.class).newInstance( language, toEdit, masterEntityList, entitySystemList);
		} catch (Exception e) {
			
			Utilities.showError(ResourceBundle.getBundle(language).getString(DefaultStrings.ERROR.getDefault()),
					ResourceBundle.getBundle(language).getString(DefaultStrings.EDITOR_FACTORY_ERROR.getDefault()));
		}
		return editor;
	}
}

@@ -15,17 +15,16 @@
 ditor;%0A%0A
-%0A
 import j
@@ -173,41 +173,218 @@
 s;%0A%0A
-public class EditorFactory %7B%0A%0A%09//
+/**%0A * Generates a specific type of Editor class.%0A *%0A * @author Ben Zhang%0A */%0A%0Apublic class EditorFactory %7B%0A%0A%09/**%0A     * Creates an Editor object from a list of parameters using reflection.%0A     *%0A     * @param
  lan
@@ -388,19 +388,16 @@
 language
- -%3E
  used in
@@ -437,21 +437,28 @@
 ors%0A
-%09//
+     * @param
  toEdit
- -%3E
  ent
@@ -541,18 +541,25 @@
 onment%0A%09
-//
+ * @param
  masterE
@@ -565,25 +565,24 @@
 EntityList -
-%3E
  master list
@@ -618,29 +618,33 @@
 bserved 
-%0A%09//%09
+%3Cbr/%3E%0A%09 *
 %09%09%09%09%09%09  
 -%3E edito
@@ -627,34 +627,34 @@
 br/%3E%0A%09 *%09%09%09%09%09%09  
+ 
 -
-%3E
  editorEntity wi
@@ -726,29 +726,34 @@
 the list
-%0A%09//%09
+ %3Cbr/%3E%0A%09 *
 %09%09%09%09%09%09  
 -%3E edito
@@ -736,34 +736,34 @@
 br/%3E%0A%09 *%09%09%09%09%09%09  
+ 
 -
-%3E
  editorEnvironme
@@ -808,18 +808,25 @@
 layout%0A%09
-//
+ * @param
  entityS
@@ -836,17 +836,16 @@
 emList -
-%3E
  master 
@@ -910,29 +910,34 @@
 observed
-%0A%09//%09
+ %3Cbr/%3E%0A%09 *
 %09%09%09%09%09%09  
 -%3E edito
@@ -920,34 +920,34 @@
 br/%3E%0A%09 *%09%09%09%09%09%09  
+ 
 -
-%3E
  editorEntity wi
@@ -1005,21 +1005,25 @@
  to 
-%0A%09//%09
+%3Cbr/%3E%0A%09 *
 %09%09%09%09%09%09  
 -%3E e
@@ -1022,10 +1022,10 @@
 %09%09  
+ 
 -
-%3E
  edi
@@ -1121,16 +1121,50 @@
 e list%0A%09
+ * @return the created Editor%0A%09 */
 %0A%09public
@@ -1198,17 +1198,16 @@
 ?%3E name,
- 
  String 
@@ -1409,17 +1409,16 @@
 tructor(
- 
 String.c
@@ -1500,17 +1500,16 @@
 nstance(
- 
 language
@@ -1580,19 +1580,16 @@
 ion e) %7B
-%0A%09%09
 %09%0A%09%09%09Uti

Add Javadocs