Package org.itsnat.feashow

Examples of org.itsnat.feashow.BrowserAdaptor


    {
        ItsNatDocument itsNatDoc = getItsNatDocument();

        this.parentElem = itsNatDoc.getDocument().getElementById("compGroupId");

        BrowserAdaptor adaptor = getFeatureShowcaseDocument().getBrowserAdaptor();
        if (adaptor != null) adaptor.setModeAuto(true);

        if (itsNatDoc.getArtifact("cityCustomStruc") == null)
        {
            ItsNatListStructure customStruc = new CityListCustomStructure();
            itsNatDoc.registerArtifact("cityCustomStruc",customStruc);
        }

        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        compMgr.buildItsNatComponents(parentElem);

        // Normal Buttons

        ItsNatHTMLInputButton inputButton = (ItsNatHTMLInputButton)compMgr.findItsNatComponentById("inputButtonId");
        check(inputButton);
        inputButton.setLabelValue("Input Button");

        ItsNatHTMLInputImage inputImage = (ItsNatHTMLInputImage)compMgr.findItsNatComponentById("inputImageId");
        check(inputImage);

        ItsNatHTMLInputSubmit inputSubmit = (ItsNatHTMLInputSubmit)compMgr.findItsNatComponentById("inputSubmitId");
        check(inputSubmit);
        inputSubmit.setLabelValue("Input Submit");

        ItsNatHTMLInputReset inputReset = (ItsNatHTMLInputReset)compMgr.findItsNatComponentById("inputResetId");
        check(inputReset);
        inputReset.setLabelValue("Input Reset");

        ItsNatHTMLButton button = (ItsNatHTMLButton)compMgr.findItsNatComponentById("buttonId");
        check(button);

        ItsNatHTMLButtonLabel buttonLabel = (ItsNatHTMLButtonLabel)compMgr.findItsNatComponentById("buttonLabelId");
        check(buttonLabel);
        buttonLabel.setLabelValue("Button With Label");

        ItsNatHTMLAnchor anchor = (ItsNatHTMLAnchor)compMgr.findItsNatComponentById("anchorId");
        check(anchor);

        ItsNatHTMLAnchorLabel anchorLabel = (ItsNatHTMLAnchorLabel)compMgr.findItsNatComponentById("anchorLabelId");
        check(anchorLabel);
        buttonLabel.setLabelValue("Anchor With Label");


        ItsNatFreeButtonNormal freeButtonNormal = (ItsNatFreeButtonNormal)compMgr.findItsNatComponentById("freeButtonNormalId");
        check(freeButtonNormal);

        ItsNatFreeButtonNormalLabel freeButtonNormalLabel = (ItsNatFreeButtonNormalLabel)compMgr.findItsNatComponentById("freeButtonNormalLabelId");
        check(freeButtonNormalLabel);
        freeButtonNormalLabel.setLabelValue("Free Button Normal Label");


        // Toggle Buttons

        ItsNatHTMLInputCheckBox inputCheckBox = (ItsNatHTMLInputCheckBox)compMgr.findItsNatComponentById("inputCheckBoxId");
        check(inputCheckBox);

        ItsNatHTMLInputRadio inputRadio = (ItsNatHTMLInputRadio)compMgr.findItsNatComponentById("inputRadioButtonId");
        check(inputRadio);

        ItsNatFreeCheckBox freeCheckBox = (ItsNatFreeCheckBox)compMgr.findItsNatComponentById("freeCheckBoxId");
        check(freeCheckBox);

        ItsNatFreeCheckBoxLabel freeCheckBoxLabel = (ItsNatFreeCheckBoxLabel)compMgr.findItsNatComponentById("freeCheckBoxLabelId");
        check(freeCheckBoxLabel);
        freeCheckBoxLabel.setLabelValue("Free Check Box Label");


        ItsNatFreeRadioButton freeRadioButton = (ItsNatFreeRadioButton)compMgr.findItsNatComponentById("freeRadioButtonId");
        check(freeRadioButton);

        ItsNatFreeRadioButtonLabel freeRadioButtonLabel = (ItsNatFreeRadioButtonLabel)compMgr.findItsNatComponentById("freeRadioButtonLabelId");
        check(freeRadioButtonLabel);
        freeRadioButtonLabel.setLabelValue("Free Radio Button Label");


        // Text Fields

        ItsNatHTMLInputText inputText = (ItsNatHTMLInputText)compMgr.findItsNatComponentById("inputTextId");
        check(inputText);
        inputText.setText("Input Text");

        ItsNatHTMLInputPassword inputPassword = (ItsNatHTMLInputPassword)compMgr.findItsNatComponentById("inputPasswordId");
        check(inputPassword);
        inputPassword.setText("Input Password");

        ItsNatHTMLInputHidden inputHidden = (ItsNatHTMLInputHidden)compMgr.findItsNatComponentById("inputHiddenId");
        check(inputHidden);

        ItsNatHTMLInputFile inputFile = (ItsNatHTMLInputFile)compMgr.findItsNatComponentById("inputFileId");
        check(inputFile);

        ItsNatHTMLInputTextFormatted inputTextFormat = (ItsNatHTMLInputTextFormatted)compMgr.findItsNatComponentById("inputTextFormattedId");
        check(inputTextFormat);
        try{ inputTextFormat.setValue("Input Text Formatted"); }catch(Exception ex) { }

        // Text Area
        ItsNatHTMLTextArea textArea = (ItsNatHTMLTextArea)compMgr.findItsNatComponentById("textAreaId");
        check(textArea);
        textArea.setText("Text Area");

        // Labels

        ItsNatLabel label = (ItsNatLabel)compMgr.findItsNatComponentById("labelId");
        check(label);
        try{ label.setValue("Label"); }catch(Exception ex) { }

        ItsNatFreeLabel freeLabel = (ItsNatFreeLabel)compMgr.findItsNatComponentById("freeLabelId");
        check(freeLabel);
        try{ freeLabel.setValue("Free Label"); }catch(Exception ex) { }

        // Lists

        ItsNatHTMLSelectComboBox selectCombo = (ItsNatHTMLSelectComboBox)compMgr.findItsNatComponentById("selectComboId");
        check(selectCombo);
        ((MutableComboBoxModel)selectCombo.getComboBoxModel()).addElement("Option 1");
        ((MutableComboBoxModel)selectCombo.getComboBoxModel()).addElement("Option 2");

        ItsNatHTMLSelectMult selectList = (ItsNatHTMLSelectMult)compMgr.findItsNatComponentById("selectListId");
        check(selectList);
        ((DefaultListModel)selectList.getListModel()).addElement("Option 1");
        ((DefaultListModel)selectList.getListModel()).addElement("Option 2");

        ItsNatFreeComboBox freeCombo = (ItsNatFreeComboBox)compMgr.findItsNatComponentById("freeComboBoxId");
        check(freeCombo);
        ((MutableComboBoxModel)freeCombo.getComboBoxModel()).addElement("Option 1");
        ((MutableComboBoxModel)freeCombo.getComboBoxModel()).addElement("Option 2");

        ItsNatFreeListMultSel freeList = (ItsNatFreeListMultSel)compMgr.findItsNatComponentById("freeListId");
        check(freeList);
        ((DefaultListModel)freeList.getListModel()).addElement("Option 1");
        ((DefaultListModel)freeList.getListModel()).addElement("Option 2");

        // Tables

        ItsNatHTMLTable table = (ItsNatHTMLTable)compMgr.findItsNatComponentById("tableId");
        check(table);
        ((DefaultTableModel)table.getTableModel()).addColumn("Col 1");
        ((DefaultTableModel)table.getTableModel()).addColumn("Col 2");
        ((DefaultTableModel)table.getTableModel()).addRow(new String[]{"Item 1,1","Item 1,2"});
        ((DefaultTableModel)table.getTableModel()).addRow(new String[]{"Item 2,1","Item 2,2"});

        ItsNatFreeTable freeTable = (ItsNatFreeTable)compMgr.findItsNatComponentById("freeTableId");
        check(freeTable);
        ((DefaultTableModel)freeTable.getTableModel()).addColumn("Col 1");
        ((DefaultTableModel)freeTable.getTableModel()).addColumn("Col 2");
        ((DefaultTableModel)freeTable.getTableModel()).addRow(new String[]{"Item 1,1","Item 1,2"});
        ((DefaultTableModel)freeTable.getTableModel()).addRow(new String[]{"Item 2,1","Item 2,2"});
        // Trees
        ItsNatFreeTree freeTree = (ItsNatFreeTree)compMgr.findItsNatComponentById("freeTreeId");
        check(freeTree);
        ((DefaultTreeModel)freeTree.getTreeModel()).setRoot(new DefaultMutableTreeNode("Free Tree"));

        ItsNatFreeTree freeTreeRootless = (ItsNatFreeTree)compMgr.findItsNatComponentById("freeTreeRootlessId");
        check(freeTreeRootless);
        DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root (hidden)");
        root.add(new DefaultMutableTreeNode("Free Tree Rootless"));
        ((DefaultTreeModel)freeTreeRootless.getTreeModel()).setRoot(root);

        ItsNatFreeTree freeTreeTable = (ItsNatFreeTree)compMgr.findItsNatComponentById("freeTreeTableId");
        check(freeTreeTable);
        ((DefaultTreeModel)freeTreeTable.getTreeModel()).setRoot(new DefaultMutableTreeNode("Free Tree Table"));

        ItsNatHTMLForm form = (ItsNatHTMLForm)compMgr.findItsNatComponentById("formId");
        check(form);

        ItsNatFreeInclude freeInclude = (ItsNatFreeInclude)compMgr.findItsNatComponentById("freeIncludeId");
        check(freeInclude);

        LoginComponent customComp = (LoginComponent)compMgr.findItsNatComponentById("customCompId");
        check(customComp);

        ItsNatFreeListMultSel listCustomStruc = (ItsNatFreeListMultSel)compMgr.findItsNatComponentById("listCustomStructureId");
        check(listCustomStruc);
        check(listCustomStruc.getItsNatListStructure() instanceof CityListCustomStructure);
        ((DefaultListModel)listCustomStruc.getListModel()).addElement("Madrid");
        ((DefaultListModel)listCustomStruc.getListModel()).addElement("Barcelona");

        compMgr.removeItsNatComponents(parentElem,true);// Disables/destroys all

        if (adaptor != null) adaptor.setModeAuto(false);
    }
View Full Code Here

TOP

Related Classes of org.itsnat.feashow.BrowserAdaptor

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.