package editor;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.text.*;

public class EditorUI
  extends javax.swing.plaf.basic.BasicTextAreaUI
  {
  static final String uiClassID = "editor.EditorUIClassID";
  static final String uiClass = "editor.EditorUI";
//------------------------------------------------------------------------------
  public static ComponentUI createUI(JComponent ta)
    {
    return(new EditorUI());
    }
//------------------------------------------------------------------------------
  public static void putUIClassID()
    {
    UIManager.put(uiClassID,uiClass);
    }
//------------------------------------------------------------------------------
  public EditorUI()
    {
    super();
    }
////////////////////////////////////////////////////////////////////////////////
  public View create(Element elem)
    {
    Document doc = elem.getDocument();
    Object i18nFlag = doc.getProperty("i18n"/*AbstractDocument.I18NProperty*/);
    if((i18nFlag != null) && i18nFlag.equals(Boolean.TRUE))
      {
      // build a view that support bidi
      return super.create(elem);
      }
    else
      {
      JTextComponent c = getComponent();
      if(c instanceof Editor)
        {
        View v = new editor.PlainView(elem);
        return v;
        }
      }
      return null;
  }
//------------------------------------------------------------------------------
}
