package edu.chl.proton.model;

/**
 * @author Ludvig Ekman
 * Created by ludvig on 2017-05-01.
 */
public class DocumentFactory {
    //use getShape method to get object of type shape
    private File file; //fileName maybe is more tydlig?


    public DocumentFactory(){
        // kolla om file redan finns, annars typ new file
    }

    //TODO: Checker for existing document file, if exist -> send file to documentClass (oklart om vi verkligen ska ha detta)
    private void checkExistingFile(){

    }

    public Document createDocument(DocumentType documentType){
        return Document(documentType);

        /*if(documentType == null){
            return null;
        }
        //TODO: Create classes Plain and so on
        if(documentType==DocumentType.PLAIN){
            //return new PlainDocument(file); // Start with nothing

        } if(documentType==DocumentType.MARKDOWN){
            //return new Markdown(file); // Cursor cursor, File file, List<Parts> parts, List<String> lines
            //return Document(DocumentType.MARKDOWN);

        } else if(documentType==DocumentType.SLIDE){
            //return new SlideDocument(file); // Mode where you can do some notes on each slide (MAIN POINT, DETAILS, PICTURE)

        } else if(documentType==DocumentType.ASSIGNMENT){
            //return new AssignmentDocument(file); // Template for assaignments, i.e. front page and subsections for each assignment.
        }
        return null;*/
    }

    // if no document exists, create one. then send it
    public Document getDocument(String filePath){
        return createDocument(DocumentType.MARKDOWN);
    }

}

@@ -576,50 +576,8 @@
     
-return Document(documentType);%0A%0A        /*
 if(d
@@ -598,16 +598,16 @@
  null)%7B%0A
+
         
@@ -862,103 +862,51 @@
     
-//return new Markdown(file); // Cursor cursor, File file, List%3CParts%3E parts, List%3CString%3E lines
+DocTypeInterface markdown = new Markdown();
 %0A   
@@ -914,25 +914,27 @@
         
-//
 return 
+new 
 Document
@@ -938,33 +938,19 @@
 ent(
-DocumentType.MARKDOWN
+markdown
 );%0A
-%0A
     
@@ -1348,18 +1348,18 @@
 rn null;
-*/
+ ;
 %0A    %7D%0A%0A
@@ -1413,16 +1413,16 @@
 send it%0A
-
     publ
@@ -1463,16 +1463,66 @@
 ePath)%7B%0A
+        //check filepath, if md, create markdown%0A%0A
         

add correct use of methods in DocFactory