Package org.itsnat.comp

Examples of org.itsnat.comp.ItsNatComponentManager


    public void initInputText(ItsNatServletRequest request)
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("textFieldId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputText input = (ItsNatHTMLInputText)componentMgr.findItsNatComponent(inputElem);
        PlainDocument dataModel = new PlainDocument();
        input.setDocument(dataModel);

        input.setText("Initial Text");
View Full Code Here


    }

    public void startExamplePanel()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.buttonComp1 = (ItsNatFreeRadioButton)compMgr.createItsNatComponentById("buttonId1","freeRadioButton",null);
        buttonComp1.addEventListener("click",this);

        this.buttonComp2 = (ItsNatFreeRadioButton)compMgr.createItsNatComponentById("buttonId2","freeRadioButton",null);
        buttonComp2.addEventListener("click",this);

        ButtonGroup group = new ButtonGroup();
        ItsNatButtonGroup compGroup = compMgr.getItsNatButtonGroup(group);
        compGroup.addButton(buttonComp1);
        compGroup.addButton(buttonComp2);


        ToggleButtonModel dataModel1 = buttonComp1.getToggleButtonModel();
View Full Code Here

    }


    public ItsNatComponent getLabelEditorComponent(ItsNatLabel label, Object value, Element labelElem)
    {
        ItsNatComponentManager compMgr = label.getItsNatComponentManager();
        ItsNatDocument itsNatDoc = compMgr.getItsNatDocument();
        Document doc = itsNatDoc.getDocument();

        ItsNatServlet servlet = itsNatDoc.getItsNatDocumentTemplate().getItsNatServlet();
        ItsNatDocFragmentTemplate docFragTemplate = servlet.getItsNatDocFragmentTemplate("feashow.comp.shared.personEditor");
        DocumentFragment editorFrag = docFragTemplate.loadDocumentFragment(itsNatDoc);
View Full Code Here

    public void load()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLButtonElement buttonElm = (HTMLButtonElement)doc.getElementById("componentGCTestId");

        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.button = (ItsNatHTMLButton)componentMgr.findItsNatComponent(buttonElm);

        button.addEventListener("click",this);
    }
View Full Code Here

    public void initInputFile()
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("fileInputId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputFile input = (ItsNatHTMLInputFile)componentMgr.findItsNatComponent(inputElem);
        PlainDocument dataModel = new PlainDocument();
        input.setDocument(dataModel);

        input.setText("Initial Value");
        // Esto lo hacemos para ver si falla algun navegador (BlackBerry sobre todo) pero no deber�a hacerse
View Full Code Here

        ItsNatDOMUtil.setTextContent(titleElem,cd.getTitle());
        Element artistElem = ItsNatTreeWalker.getNextSiblingElement(titleElem);
        ItsNatDOMUtil.setTextContent(artistElem,cd.getArtist());
        Element songsElem = ItsNatTreeWalker.getNextSiblingElement(artistElem);

        ItsNatComponentManager compMgr = list.getItsNatComponentManager();
        ItsNatFreeListMultSel comp = (ItsNatFreeListMultSel)compMgr.createItsNatComponent(songsElem,"freeListMultSel",null);
        comp.setItsNatListCellRenderer(SongListRenderer.SINGLETON);
        DefaultListModel model = (DefaultListModel)comp.getListModel();
        for(int i = 0; i < cd.getSongCount(); i++)
            model.addElement(cd.getSong(i));
    }
View Full Code Here

    public void initInputText() throws PropertyVetoException
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("textFormattedWithFactoryFieldId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputTextFormatted inputComp = (ItsNatHTMLInputTextFormatted)componentMgr.findItsNatComponent(inputElem);

        ItsNatFormatterFactoryDefault factory = (ItsNatFormatterFactoryDefault)inputComp.createDefaultItsNatFormatterFactory();

        ItsNatFormatter dispFormatter = inputComp.createItsNatFormatter(DateFormat.getDateInstance(DateFormat.LONG ,Locale.US));
        factory.setDisplayFormatter(dispFormatter);
View Full Code Here

    public void initListMultiple()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement parentElem = (HTMLElement)doc.getElementById("freeListMultipleId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.comp = (ItsNatFreeListMultSel)componentMgr.findItsNatComponent(parentElem);

        super.initListMultiple();

        comp.addEventListener("click",this);

        // comp.setSelectionModel(null);

        ListSelectionModel selModel = comp.getListSelectionModel();
        int size = comp.getListModel().getSize();
        for(int i = 0; i < size; i++)
        {
            decorateSelection(i,selModel.isSelectedIndex(i));
        }

        this.addButton = (ItsNatHTMLButton)componentMgr.findItsNatComponentById("addItemFreeListId");
        addButton.addEventListener("click",this);

        this.removeButton = (ItsNatHTMLButton)componentMgr.findItsNatComponentById("removeItemFreeListId");
        removeButton.addEventListener("click",this);

        this.joystickModeCheck = (ItsNatHTMLInputCheckBox)componentMgr.findItsNatComponentById("joystickModeFreeListId");
        joystickModeCheck.addEventListener("click",this);
        joystickModeCheck.setSelected(itsNatDoc.isJoystickMode());
    }
View Full Code Here

    public void processRequest(ItsNatServletRequest request, ItsNatServletResponse response)
    {
        ItsNatDocument itsNatDoc = request.getItsNatDocument();
        Document doc = itsNatDoc.getDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        Element titleElem = ItsNatTreeWalker.getFirstChildElement(doc.getDocumentElement());
        Element cdListElem = ItsNatTreeWalker.getNextSiblingElement(titleElem);

        ItsNatFreeListMultSel comp = (ItsNatFreeListMultSel)compMgr.createItsNatComponent(cdListElem,"freeListMultSel",null);
        comp.setItsNatListCellRenderer(CDListRenderer.SINGLETON);
        DefaultListModel model = (DefaultListModel)comp.getListModel();

        List<CompactDisc> cdList = new ArrayList<CompactDisc>();
View Full Code Here

    }

    public void startExample()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.tableComp = (ItsNatFreeTable)compMgr.createItsNatComponentById("compId","freeTable",null);

        tableComp.setItsNatTableCellRenderer(new CircleTableCellRenderer());

        DefaultTableModel dataModel = (DefaultTableModel)tableComp.getTableModel();
        dataModel.addColumn("Column 1");
        dataModel.addColumn("Column 2");
        dataModel.addColumn("Column 3");
        dataModel.addColumn("Column 4");
        dataModel.addRow(new Circle[] {new Circle(20),new Circle(25),new Circle(30),new Circle(35)});
        dataModel.addRow(new Circle[] {new Circle(20),new Circle(25),new Circle(30),new Circle(35)});
        dataModel.addRow(new Circle[] {new Circle(20),new Circle(25),new Circle(30),new Circle(35)});

        ListSelectionModel rowSelModel = tableComp.getRowSelectionModel();
        //ListSelectionModel columnSelModel = tableComp.getColumnSelectionModel();

        rowSelModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        // columnSelModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

        tableComp.setRowSelectionAllowed(true);
        tableComp.setColumnSelectionAllowed(false);

        rowSelModel.addListSelectionListener(new SVGCircleTableRowSelectionDecoration(tableComp));

        rowSelModel.setSelectionInterval(1,1);

        dataModel.addTableModelListener(this);
        rowSelModel.addListSelectionListener(this);

        this.removeButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("removeId");
        removeButton.addEventListener("click",this);

        this.itemComp = new ItsNatHTMLInputText[dataModel.getColumnCount()];
        for(int i = 0; i < itemComp.length; i++)
        {
            this.itemComp[i] = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("itemId" + i);
            Circle circle = (Circle)dataModel.getValueAt(rowSelModel.getMinSelectionIndex(), i);
            itemComp[i].setText(circle.toString());
        }

        this.posComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("posId");
        posComp.setText(Integer.toString(rowSelModel.getMinSelectionIndex()));

        this.updateButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("updateId");
        updateButton.addEventListener("click",this);

        this.insertButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("insertId");
        insertButton.addEventListener("click",this);
    }
View Full Code Here

TOP

Related Classes of org.itsnat.comp.ItsNatComponentManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.