Package javax.swing.JToggleButton

Examples of javax.swing.JToggleButton.ToggleButtonModel


  }

  @Override
  public IAdapter getParent() {
    JRadioButton jb=(JRadioButton)getWidget();
    ToggleButtonModel dbm=(ToggleButtonModel) jb.getModel();
    ButtonGroup bg=dbm.getGroup();
    if (bg != null) {
      for (InvisibleAdapter invisible : getRootAdapter().getInvisibles()) {
        if (invisible instanceof ButtonGroupAdapter) {
          if (bg == ((ButtonGroupAdapter) invisible).getButtonGroup())
            return invisible;
View Full Code Here


    return JToggleButton.class;
  }
  @Override
  public IAdapter getParent() {
    JToggleButton jb=(JToggleButton)getWidget();
    ToggleButtonModel dbm=(ToggleButtonModel) jb.getModel();
    ButtonGroup bg=dbm.getGroup();
    if (bg != null) {
      for (InvisibleAdapter invisible : getRootAdapter().getInvisibles()) {
        if (invisible instanceof ButtonGroupAdapter) {
          if (bg == ((ButtonGroupAdapter) invisible).getButtonGroup())
            return invisible;
View Full Code Here

  }

  @Override
  public IAdapter getParent() {
    JCheckBox jb=(JCheckBox)getWidget();
    ToggleButtonModel dbm=(ToggleButtonModel) jb.getModel();
    ButtonGroup bg=dbm.getGroup();
    if (bg != null) {
      for (InvisibleAdapter invisible : getRootAdapter().getInvisibles()) {
        if (invisible instanceof ButtonGroupAdapter) {
          if (bg == ((ButtonGroupAdapter) invisible).getButtonGroup())
            return invisible;
View Full Code Here

            return button;
        }

        public static Component createInputCheckBoxComponent(final Object model,
                                                     final AttributeSet attrs) {
            ToggleButtonModel checkBoxModel = (ToggleButtonModel) model;
            final JCheckBox checkBox = new JCheckBox();

            // Model
            if (checkBoxModel == null) {
                checkBoxModel = new FormToggleButtonModel(new Form(SimpleAttributeSet.EMPTY),
View Full Code Here

            return passwordField;
        }

        public static Component createInputRadioComponent(final Object model,
                                                    final AttributeSet attrs) {
            ToggleButtonModel radioButtonModel;
            final JRadioButton radioButton = new JRadioButton();

            // NAME
            String attribute = (String) attrs.getAttribute(HTML.Attribute.NAME);
            if (!Utilities.isEmptyString(attribute)) {
                radioButtonModel = (ToggleButtonModel) model;
            } else {
                radioButtonModel = new ToggleButtonModel() {
                    public void setGroup(final ButtonGroup group) {
                        //Do nothing
                    };
                };
            }
View Full Code Here

            return button;
        }

        public static Component createInputCheckBoxComponent(final Object model,
                                                     final AttributeSet attrs) {
            ToggleButtonModel checkBoxModel = (ToggleButtonModel) model;
            final JCheckBox checkBox = new JCheckBox();

            // Model
            if (checkBoxModel == null) {
                checkBoxModel = new FormToggleButtonModel(new Form(SimpleAttributeSet.EMPTY),
View Full Code Here

            return passwordField;
        }

        public static Component createInputRadioComponent(final Object model,
                                                    final AttributeSet attrs) {
            ToggleButtonModel radioButtonModel;
            final JRadioButton radioButton = new JRadioButton();

            // NAME
            String attribute = (String) attrs.getAttribute(HTML.Attribute.NAME);
            if (!Utilities.isEmptyString(attribute)) {
                radioButtonModel = (ToggleButtonModel) model;
            } else {
                radioButtonModel = new ToggleButtonModel() {
                    public void setGroup(final ButtonGroup group) {
                        //Do nothing
                    };
                };
            }
View Full Code Here

        this.radioComp2 = (ItsNatFreeRadioButton)componentMgr.findItsNatComponent(elem2);

        HTMLElement elem3 = (HTMLElement)doc.getElementById(id + "3");
        this.radioComp3 = (ItsNatFreeRadioButton)componentMgr.findItsNatComponent(elem3);

        ToggleButtonModel dataModel1 = new ToggleButtonModel();
        radioComp1.setButtonModel(dataModel1);
        ToggleButtonModel dataModel2 = new ToggleButtonModel();
        radioComp2.setButtonModel(dataModel2);
        ToggleButtonModel dataModel3 = new ToggleButtonModel();
        radioComp3.setButtonModel(dataModel3);

        ButtonGroup group = new ButtonGroup();
        ItsNatButtonGroup htmlGroup = componentMgr.getItsNatButtonGroup(group);
        htmlGroup.addButton(radioComp1);
        htmlGroup.addButton(radioComp2);
        htmlGroup.addButton(radioComp3);

        TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(group));
        TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(htmlGroup.getName()));

        TestUtil.checkError(radioComp1.getItsNatButtonGroup().getButtonCount() == 3);

        TestFreeRadio listener1 = new TestFreeRadio("1",elem1,itsNatDoc);
        radioComp1.addEventListener("click",listener1);
        dataModel1.addChangeListener(listener1);

        TestFreeRadio listener2 = new TestFreeRadio("2",elem2,itsNatDoc);
        radioComp2.addEventListener("click",listener2);
        dataModel2.addChangeListener(listener2);

        TestFreeRadio listener3 = new TestFreeRadio("3",elem3,itsNatDoc);
        radioComp3.addEventListener("click",listener3);
        dataModel3.addChangeListener(listener3);
    }
View Full Code Here

        TestUtil.checkError(input1.getToggleButtonModel().getGroup() == group);
        TestUtil.checkError(input2.getToggleButtonModel().getGroup() == group);
        TestUtil.checkError(input3.getToggleButtonModel().getGroup() == group);

        ToggleButtonModel dataModel1 = new ToggleButtonModel();
        input1.setButtonModel(dataModel1);
        ToggleButtonModel dataModel2 = new ToggleButtonModel();
        input2.setButtonModel(dataModel2);
        ToggleButtonModel dataModel3 = new ToggleButtonModel();
        input3.setButtonModel(dataModel3);

        group = new ButtonGroup();
        ItsNatButtonGroup htmlGroup = componentMgr.getItsNatButtonGroup(group);
        htmlGroup.addButton(input1);
        htmlGroup.addButton(input2);
        htmlGroup.addButton(input3);

        TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(group));
        TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(htmlGroup.getName()));

        TestUtil.checkError(input1.getItsNatButtonGroup().getButtonCount() == 3);

        TestHTMLInputRadio listener1 = new TestHTMLInputRadio("1",itsNatDoc);
        input1.addEventListener("click",listener1);
        dataModel1.addChangeListener(listener1);

        TestHTMLInputRadio listener2 = new TestHTMLInputRadio("2",itsNatDoc);
        input2.addEventListener("click",listener2);
        dataModel2.addChangeListener(listener2);

        TestHTMLInputRadio listener3 = new TestHTMLInputRadio("3",itsNatDoc);
        input3.addEventListener("click",listener3);
        dataModel3.addChangeListener(listener3);
    }
View Full Code Here

        Document doc = itsNatDoc.getDocument();
        HTMLElement elem = (HTMLElement)doc.getElementById(id);
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.button = (ItsNatFreeCheckBox)componentMgr.findItsNatComponent(elem);

        ToggleButtonModel dataModel = new ToggleButtonModel();
        button.setButtonModel(dataModel);

        button.addEventListener("click",this);

        dataModel.addChangeListener(this);

        this.elemStyle = (ElementCSSInlineStyle)elem;
    }
View Full Code Here

TOP

Related Classes of javax.swing.JToggleButton.ToggleButtonModel

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.