Java Code Examples for com.google.gwt.event.dom.client.ClickEvent#preventDefault()

The following examples show how to use com.google.gwt.event.dom.client.ClickEvent#preventDefault() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CubaCheckBoxGroupWidget.java    From cuba with Apache License 2.0 6 votes vote down vote up
@Override
public void onClick(ClickEvent event) {
    if (!isEnabled() || isReadonly()) {
        event.preventDefault();

        if (isReadonly()
                && (BrowserInfo.get().isIE() || BrowserInfo.get().isEdge())) {
            // IE and Edge do not focus read-only checkbox on click
            Object checkBox = event.getSource();
            if (checkBox instanceof VCheckBox) {
                ((VCheckBox) checkBox).setFocus(true);
            }
        }

        return;
    }

    super.onClick(event);
}
 
Example 2
Source File: CirSim.java    From circuitjs1 with GNU General Public License v2.0 5 votes vote down vote up
public void onClick(ClickEvent e) {
    	e.preventDefault();
//    	//IES - remove inteaction
////	if ( e.getClickCount() == 2 && !didSwitch )
////	    doEditMenu(e);
//	if (e.getNativeButton() == NativeEvent.BUTTON_LEFT) {
//	    if (mouseMode == MODE_SELECT || mouseMode == MODE_DRAG_SELECTED)
//		clearSelection();
//	}	
    	if ((e.getNativeButton() == NativeEvent.BUTTON_MIDDLE))
    		scrollValues(e.getNativeEvent().getClientX(), e.getNativeEvent().getClientY(), 0);
    }
 
Example 3
Source File: CubaRadioButtonGroupWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(ClickEvent event) {
    if (!isEnabled() || isReadonly()) {
        event.preventDefault();
        return;
    }

    super.onClick(event);
}
 
Example 4
Source File: CubaCheckBoxWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(ClickEvent event) {
    if (!isEnabled() || isReadOnly()) {
        event.preventDefault();

        if (isReadOnly()
                && (BrowserInfo.get().isIE() || BrowserInfo.get().isEdge())) {
            // IE and Edge do not focus read-only checkbox on click
            setFocus(true);
        }
    }
}
 
Example 5
Source File: CubaOptionGroupWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(ClickEvent event) {
    if (!isEnabled() || isReadonly()) {
        event.preventDefault();
        return;
    }

    super.onClick(event);
}