package frontend;

import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;

import javafx.embed.swing.SwingNode;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import text_handler.FontManager;



public class Editor extends SwingNode {
	
	private JTextPane	textPane;
	private JScrollPane	scrollPane;
	
	
	
	public Editor() {
		
		createSwingContent();
		
	}
	
	
	
	private void createSwingContent() {
		
		SwingUtilities.invokeLater(() -> {
			
			textPane = new JTextPane();
			
			scrollPane = new JScrollPane(textPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
			scrollPane.getHorizontalScrollBar().setVisible(true);
			scrollPane.setSize(400, 400);
			
			// Set default Font
			this.setFont(FontManager.FONT_DEFAULT, FontWeight.NORMAL);
			this.setContent(textPane);
		});
		
	}
	
	
	
	public void setEditable(boolean editable) {
		
		textPane.setEditable(editable);
	}
	
	
	
	public boolean getEditable() {
		
		return textPane.isEditable();
	}
	
	
	
	public void setFont(Font font, FontWeight weight) {
		
		textPane.setFont(FontManager.getAWTFont(font, weight));
	}
	
	
	
	public Font getFont() {
		
		return FontManager.getFxFont(textPane.getFont());
	}
	
}

@@ -12,16 +12,81 @@
 ntend;%0A%0A
+import java.util.regex.Pattern;%0Aimport java.util.regex.Matcher;%0A%0A
 import j
@@ -105,24 +105,24 @@
 ScrollPane;%0A
-
 import javax
@@ -215,16 +215,17 @@
 ities;%0A%0A
+%0A
 import j
@@ -460,24 +460,70 @@
 ollPane;%0A%09%0A%09
+public static enum Direction %7B%0A%09%09UP, DOWN;%0A%09%7D;
 %0A%09%0A%09public E
@@ -1423,15 +1423,593 @@
 ont());%0A
-
 %09%7D%0A%09%0A
+%09%0A%09%0A%09/** Create a compiled pattern based on the arguments **/%0A%09//TODO implement%0A%09private Pattern createCompiledPattern(String exp, boolean matchCase, boolean wholeWord)%7B%0A%09%0A%09%09return null;%0A%09%7D%0A%09%0A%09%0A%09/**%0A%09 *  Selects the next word in the given direction **/%0A%09//TODO implement%0A%09public void find(String what, Direction direction, boolean matchCase, boolean wholeWord)%7B%0A%09%09%0A%09%0A%09%7D%0A%09%0A%09%0A%09//TODO implement%0A%09public void replace(String what, String with, boolean matchCase)%7B%0A%09%09%0A%09%7D%0A%09%0A%09// TODO implement%0A%09public void replaceAll(String what, String with, boolean matchCase)%7B%0A%09%09%0A%09%7D%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09%0A
 %7D%0A

Add empty method body of find and replace