package com.jaxfront.html.plugins;

import com.jaxfront.html.visualizers.SimpleTypeView;
import com.jaxfront.objectivehtml.htmlwidget.HtmlContainerWidget;
import com.jaxfront.objectivehtml.htmlwidget.HtmlListBox;

/*-- 

Copyright (C) 2001-2007 by xcentric technology & consulting GmbH. All rights reserved.

This software is the confidential and proprietary information of xcentric technology & 
consulting GmbH ("Confidential Information"). You shall not disclose such Confidential 
Information and shall use it only in accordance with the terms of the license agreement
you entered into with xcentric.

www.jaxfront.com

*/
/**
 * Shows how to implement your own plugin for a simple component (leaf) using
 * the internal OHTML library. 
 
 @version 2.3
 */

public class SimpleTypePluginOHTMLExampleView extends SimpleTypeView {

  protected void createEditorComponent(HtmlContainerWidget container) {
    HtmlListBox listBox = new HtmlListBox(container, getXPath());
    listBox.addOption("item 1""item 1 (text 1)");
    listBox.addOption("item 2""item 2 (text 2)");
    listBox.addOption("item 3""item 3 (text 3)");
    listBox.setSize("5");
    _component = listBox;

  }

  public void populateView() {
    super.populateView();
    ((HtmlListBox)getHtmlEditorComponent()).setSelected(getValue()true);

  }

  public void setSize(String size) {
    //do nothing

  }

}