/* $Id: WysiwygPanel.java 125 2011-03-09 09:49:51Z 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.getGSHTMLEditorTextPane().setEditable(true);
		this.textPane.getGSHTMLEditorTextPane().updateText();
		parent.setEditorToolBar(this.getToolbar());
	}
	@Override
	public JToolBar getToolbar() {
		return new EditorToolBar(this.textPane);
	}
	@Override
	public EditorMouseListener getMouseListener() {
		return new WysiwygMouseListener(this.textPane);
	}
}
