当前位置: 首页>>代码示例>>Java>>正文


Java InputElement.isChecked方法代码示例

本文整理汇总了Java中com.google.gwt.dom.client.InputElement.isChecked方法的典型用法代码示例。如果您正苦于以下问题:Java InputElement.isChecked方法的具体用法?Java InputElement.isChecked怎么用?Java InputElement.isChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.dom.client.InputElement的用法示例。


在下文中一共展示了InputElement.isChecked方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addToSelections

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
public void addToSelections(String id) {
	Element elem = DOM.getElementById("cb_" + id);
	if (elem instanceof InputElement) {
		InputElement in = (InputElement) elem;
		if (in.isChecked() && !selections.contains(Integer.parseInt(id))) {
			selections.add(Integer.parseInt(id));
		} else if (selections.contains(Integer.parseInt(id))) {
			selections.remove(new Integer(Integer.parseInt(id)));
		}
	}
}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:12,代码来源:MyFavoritesView.java

示例2: addToCompareListingList

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
public void addToCompareListingList(String id) {
	Element elem = DOM.getElementById("cb_" + id);
	if (elem instanceof InputElement) {
		InputElement in = (InputElement) elem;
		if (in.isChecked() && !compareListing.contains(Integer.parseInt(id))) {
			compareListing.add(Integer.parseInt(id));
		} else if (compareListing.contains(Integer.parseInt(id))) {
			compareListing.remove(new Integer(Integer.parseInt(id)));
		}
	}

}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:13,代码来源:ResultWithoutMapView.java

示例3: onBrowserEvent

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent( final Context context,
                            final Element parent,
                            final Boolean value,
                            final NativeEvent event,
                            final ValueUpdater<Boolean> valueUpdater ) {
    String type = event.getType();

    boolean enterPressed = BrowserEvents.KEYDOWN.equals( type )
            && event.getKeyCode() == KeyCodes.KEY_ENTER;
    if ( BrowserEvents.CHANGE.equals( type ) || enterPressed ) {
        InputElement input = parent.getFirstChild().cast();
        Boolean isChecked = input.isChecked();

        // Toggle the value if the enter key was pressed and the cell handles
        // selection or doesn't depend on selection. If the cell depends on
        // selection but doesn't handle selection, then ignore the enter key and
        // let the SelectionEventManager determine which keys will trigger a
        // change.
        if ( enterPressed && ( handlesSelection() || !dependsOnSelection() ) ) {
            isChecked = !isChecked;
            input.setChecked( isChecked );
        }

        // Save the new value. However, if the cell depends on the selection, then
        // do not save the value because we can get into an inconsistent state.
        if ( value != isChecked && !dependsOnSelection() ) {
            setViewData( context.getKey(), isChecked );
        } else {
            clearViewData( context.getKey() );
        }

        if ( valueUpdater != null ) {
            valueUpdater.update( isChecked );
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:38,代码来源:CheckboxCell.java

示例4: onBrowserEvent

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element elem, NativeEvent event) {
    InputElement input = elem.getFirstChild().cast();
    checkedState = input.isChecked();
    headerUpdated(checkedState);
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:7,代码来源:TableNamesTable.java

示例5: onBrowserEvent

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onBrowserEvent(Context context, Element parent, Boolean value,
        NativeEvent event, ValueUpdater<Boolean> valueUpdater) {
    String type = event.getType();

    boolean enterPressed = "keydown".equals(type)
            && event.getKeyCode() == KeyCodes.KEY_ENTER;
    if ("change".equals(type) || enterPressed) {
        InputElement input = parent.getFirstChild().cast();
        Boolean isChecked = input.isChecked();

        Object key = context.getKey();
        if ( isEnabledPredicate != null && !isEnabledPredicate.isEnabled((T) key)) {
            // disabled checkbox -- no changes!
            return;
        }
        /*
         * Toggle the value if the enter key was pressed; this brings
         * the key-press event path in line with a mouse-click event path.
         */
        if (enterPressed) {
            isChecked = !isChecked;
            input.setChecked(isChecked);
        }

        /*
         * See if this is a valid action for this checkbox.
         */
        boolean changed = true;
        if ( validationPredicate != null && !validationPredicate.isValid(isChecked, (T) key)) {
            isChecked = !isChecked;
            changed = false;
        }
        
        /*
         * Save the new value.
         */
        if (value != isChecked) {
            setViewData(context.getKey(), isChecked);
        } else {
            clearViewData(context.getKey());
        }
        
        // redraw our parent with the value we ended up with...
        SafeHtmlBuilder sb = new SafeHtmlBuilder();
        render(context, isChecked, sb);
        parent.setInnerHTML(sb.toSafeHtml().asString());
        // apparently the element never gains focus...

        if ( changed ) {
            // do value-change action...
            if (valueUpdater != null) {
                valueUpdater.update(isChecked);
            }
        }
    }
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:59,代码来源:UIEnabledValidatingCheckboxCell.java

示例6: getData

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public Boolean getData(final InputElement input, String attribute) {
    return input.isChecked();
}
 
开发者ID:liraz,项目名称:gwt-backbone,代码行数:5,代码来源:InputElementBooleanAdapter.java

示例7: onBrowserEvent

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context,
                           Element parent,
                           Boolean value,
                           NativeEvent event,
                           ValueUpdater<Boolean> valueUpdater) {

    //If read-only ignore editing events
    if (isReadOnly) {
        return;
    }

    String type = event.getType();

    boolean enterPressed = "keydown".equals(type) && event.getKeyCode() == KeyCodes.KEY_ENTER;
    if ("click".equals(type) || enterPressed) {
        InputElement input = parent.getFirstChild().cast();
        Boolean isChecked = input.isChecked();

        /*
         * Toggle the value if the enter key was pressed and the cell
         * handles selection or doesn't depend on selection. If the cell
         * depends on selection but doesn't handle selection, then ignore
         * the enter key and let the SelectionEventManager determine which
         * keys will trigger a change.
         */
        if (enterPressed) {
            isChecked = !isChecked;
            input.setChecked(isChecked);
        }

        /*
         * Save the new value. However, if the cell depends on the
         * selection, then do not save the value because we can get into an
         * inconsistent state.
         */
        if (value != isChecked) {
            setViewData(context.getKey(),
                        isChecked);
        }

        if (valueUpdater != null) {
            valueUpdater.update(isChecked);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:47,代码来源:CheckboxCellImpl.java

示例8: onBrowserEvent

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, Object value, NativeEvent event, ValueUpdater<Object> valueUpdater) {
	String type = event.getType();

	boolean enterPressed = (BrowserEvents.KEYDOWN.equals(type) && event.getKeyCode() == KeyCodes.KEY_ENTER);
	/* 
	 * Crazy browsers fire click and change events in different order.
	 * FireFox issues a click event first and then change event.
	 * Than we have an issue with selection re-rendering and 'change' event never fired,
	 * because of mark-up replacement while grid rendering.
	 */ 
	if (BrowserEvents.CLICK.equals(type) || BrowserEvents.CHANGE.equals(type) || enterPressed) {
		InputElement input = parent.<XElement>cast().firstChildByTagName("input").cast();
		Boolean isChecked = input.isChecked();

		/*
		 * Toggle the value if the enter key was pressed and the cell
		 * handles selection or doesn't depend on selection. If the cell
		 * depends on selection but doesn't handle selection, then ignore
		 * the enter key and let the SelectionEventManager determine which
		 * keys will trigger a change.
		 */
		if (enterPressed && (handlesSelection() || !dependsOnSelection())) {
			isChecked = !isChecked;
			input.setChecked(isChecked);
		}

		/*
		 * Save the new value. However, if the cell depends on the
		 * selection, then do not save the value because we can get into an
		 * inconsistent state.
		 */
		if (value != isChecked && !dependsOnSelection()) {
			setViewData(context.getKey(), isChecked);
		} else {
			clearViewData(context.getKey());
		}

		if (valueUpdater != null) {
			valueUpdater.update(isChecked);
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:44,代码来源:CheckBoxCell.java

示例9: onBrowserEvent

import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(
    Context context,
    Element parent,
    CheckedAndDisabled value,
    NativeEvent event,
    ValueUpdater<CheckedAndDisabled> valueUpdater) {
    String type = event.getType();

    boolean enterPressed = BrowserEvents.KEYDOWN.equals(type)
        && event.getKeyCode() == KeyCodes.KEY_ENTER;
    if (BrowserEvents.CHANGE.equals(type) || enterPressed) {
        InputElement input = parent.getFirstChild().cast();
        Boolean isChecked = input.isChecked();

        /*
         * Toggle the value if the enter key was pressed and the cell
         * handles selection or doesn't depend on selection. If the cell
         * depends on selection but doesn't handle selection, then ignore
         * the enter key and let the SelectionEventManager determine which
         * keys will trigger a change.
         */
        if (enterPressed && (handlesSelection() || !dependsOnSelection())) {
            isChecked = !isChecked;
            input.setChecked(isChecked);
        }

        /*
         * Save the new value. However, if the cell depends on the
         * selection, then do not save the value because we can get into an
         * inconsistent state.
         */
        if (value.getChecked() != isChecked && !dependsOnSelection()) {
            value.setChecked(isChecked);
            setViewData(context.getKey(), value);
        } else {
            clearViewData(context.getKey());
        }

        if (valueUpdater != null) {
            valueUpdater.update(value);
        }
    }
}
 
开发者ID:inepex,项目名称:ineform,代码行数:45,代码来源:DisableAbleCheckboxCell.java


注:本文中的com.google.gwt.dom.client.InputElement.isChecked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。