private Button toButtonWithoutForm( Element element ) { return new Button( _response, (HTMLControl) element ); }
/** * the onClickSequence for this button * @return true if the even was handled */ protected boolean doOnClickSequence(int x,int y) throws IOException, SAXException { verifyButtonEnabled(); boolean result=doOnClickEvent(); if (result) { doButtonAction(x,y); } this.rememberEnableState(); return result; }
/** * Performs the action associated with clicking this button after running any 'onClick' script. * For a submit button this typically submits the form. */ public void click() throws IOException, SAXException { doOnClickSequence(0,0); }
/** * verifyButtonEnabled */ protected void verifyButtonEnabled() { rememberEnableState(); if (isDisabled()) throwDisabledException(); }
/** * the onClickSequence for this button * @return true if the even was handled */ protected boolean doOnClickSequence(int x,int y) throws IOException, SAXException { verifyButtonEnabled(); boolean result=doOnClickEvent(); if (result) { doButtonAction(x,y); } this.rememberEnableState(); return result; }
public boolean matchesCriteria( Object button, Object label ) { return ((Button) button).getValue().equals( label ); } };
/** * Returns the current value(s) associated with this control. These values will be transmitted to the server * if the control is 'successful'. **/ protected String[] getValues() { return (isDisabled() || !_pressed) ? NO_VALUE : toArray( getValue() ); }
/** * Perform the normal action of this button. * delegate to the x-y version * @throws IOException * @throws SAXException */ protected void doButtonAction() throws IOException, SAXException { doButtonAction(0,0); }
/** * Returns the value associated with this button. **/ public String getValue() { return emptyIfNull( getNode() instanceof HTMLInputElementImpl ? ((HTMLInputElementImpl) getNode()).getValue() : ((HTMLButtonElementImpl) getNode()).getValue() ); }
/** * remember wether the button was enabled */ public void rememberEnableState() { _wasEnabled=!isDisabled(); }
/** * get the Vector of submit buttons - will always contain at least * one button - if the original vector has none a faked submit button will be added * @return a Vector with the submit buttons */ private Vector getSubmitButtonVector() { if (_buttonVector == null) { _buttonVector = new Vector(); FormControl[] controls = getFormControls(); for (int i = 0; i < controls.length; i++) { FormControl control = controls[ i ]; if (control instanceof SubmitButton) { SubmitButton sb=(SubmitButton)control; sb.rememberEnableState(); _buttonVector.add( sb ); } } /** * make sure that there is always at least one submit button * if none is in the Vector add a faked one */ if (_buttonVector.isEmpty()) _buttonVector.addElement( SubmitButton.createFakeSubmitButton( this ) ); } return _buttonVector; }
/** * verifyButtonEnabled */ protected void verifyButtonEnabled() { rememberEnableState(); if (isDisabled()) throwDisabledException(); }
public boolean matchesCriteria( Object button, Object label ) { return ((Button) button).getValue().equals( label ); } };
/** * addValues if not disabled and pressed * @param processor - the ParameterProcessor used * @param characterSet - the active character set * @throws IOException if addValues fails */ protected void addValues( ParameterProcessor processor, String characterSet ) throws IOException { if (_pressed && !isDisabled()) { String buttonName = getName(); if (buttonName != null && buttonName.length() > 0 && getValue().length() > 0) { processor.addParameter( getName(), getValue(), characterSet ); } if (isValidImageButton()) { processor.addParameter( positionParameterName("x"), Integer.toString( _x ), characterSet ); processor.addParameter( positionParameterName("y"), Integer.toString( _y ), characterSet ); } } // if }
/** * Perform the normal action of this button. * delegate to the x-y version * @throws IOException * @throws SAXException */ protected void doButtonAction() throws IOException, SAXException { doButtonAction(0,0); }
/** * Returns the value associated with this button. **/ public String getValue() { return emptyIfNull( getNode() instanceof HTMLInputElementImpl ? ((HTMLInputElementImpl) getNode()).getValue() : ((HTMLButtonElementImpl) getNode()).getValue() ); }
/** * remember wether the button was enabled */ public void rememberEnableState() { _wasEnabled=!isDisabled(); }
/** * verifyButtonEnabled */ protected void verifyButtonEnabled() { rememberEnableState(); if (isDisabled()) throwDisabledException(); }