/* $Id: WysiwygPanel.java 783 2013-10-22 13:07:54Z ohura $ */
package sml_editor.swingui.wysiwyg;

import java.awt.event.ComponentEvent;

import javax.swing.JToolBar;
import javax.swing.event.DocumentListener;

import sml_editor.swingui.AbstractEditorPanel;
import sml_editor.swingui.EditorFrame;
import sml_editor.swingui.EditorMouseListener;
import sml_editor.swingui.EditorTextPane;
import sml_editor.swingui.toolbar.EditorToolBar;



@SuppressWarnings("serial")
public class WysiwygPanel extends AbstractEditorPanel{
	
	public WysiwygPanel(EditorFrame parent,EditorTextPane textPane){
		super(parent,textPane);
	}
	@Override
	public DocumentListener getDocumentListener() {
		return new WysiwygDocumentListener(this.textPane);
	}
	@Override
	public void componentHidden(ComponentEvent e) {
		super.componentHidden(e);
	
	}
	@Override
	public void componentShown(ComponentEvent e) {
		super.componentShown(e);
		this.textPane.getSGSHTMLEditorTextPane().setEditable(true);
		this.textPane.getSGSHTMLEditorTextPane().updateText();
		parent.setEditorToolBar(this.getToolbar());
	}
	@Override
	public JToolBar getToolbar() {
		return new EditorToolBar(this.textPane);
	}
	@Override
	public EditorMouseListener getMouseListener() {
		return new WysiwygMouseListener(this.textPane);
	}
}
