本文整理匯總了Java中com.google.gwt.dom.client.InputElement.is方法的典型用法代碼示例。如果您正苦於以下問題:Java InputElement.is方法的具體用法?Java InputElement.is怎麽用?Java InputElement.is使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.dom.client.InputElement
的用法示例。
在下文中一共展示了InputElement.is方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAccessKey
import com.google.gwt.dom.client.InputElement; //導入方法依賴的package包/類
@Override
public void setAccessKey(final char key) {
final Element element = uiObject.getElement();
final String accessKey = Character.toString(key);
if (AnchorElement.is(element)) {
AnchorElement.as(element).setAccessKey(accessKey);
} else if (ButtonElement.is(element)) {
ButtonElement.as(element).setAccessKey(accessKey);
} else if (InputElement.is(element)) {
InputElement.as(element).setAccessKey(accessKey);
}
}
示例2: isEventAssociatedWithItemExpander
import com.google.gwt.dom.client.InputElement; //導入方法依賴的package包/類
public static boolean isEventAssociatedWithItemExpander(final Element eventTarget) {
boolean outIsExpander = false;
if (InputElement.is(eventTarget)) {
InputElement inputEl = eventTarget.cast();
if (inputEl.getType().equalsIgnoreCase("checkbox")
&& inputEl.getClassName().equalsIgnoreCase(EXPANDER_CLASS_NAME)) {
outIsExpander = true;
}
}
return outIsExpander;
}
示例3: isEventAssociatedWithItemChecker
import com.google.gwt.dom.client.InputElement; //導入方法依賴的package包/類
public static boolean isEventAssociatedWithItemChecker(final Element eventTarget) {
boolean outIsChecker = false;
if (InputElement.is(eventTarget)) {
InputElement inputEl = eventTarget.cast();
if (inputEl.getType().equalsIgnoreCase("checkbox")
&& inputEl.getClassName().equalsIgnoreCase(CHECKER_CLASS_NAME)) {
outIsChecker = true;
}
}
return outIsChecker;
}
示例4: KeyBindingManager
import com.google.gwt.dom.client.InputElement; //導入方法依賴的package包/類
@Inject
public KeyBindingManager(ActionManager actionManager) {
this.actionManager = actionManager;
addScheme(new SchemeImpl(SCHEME_GLOBAL_ID, "Global"));
addScheme(new SchemeImpl(SCHEME_ECLIPSE_ID, "Eclipse Scheme"));
// TODO check user settings
activeScheme = SCHEME_GLOBAL_ID;
presentationFactory = new PresentationFactory();
// Attach the listeners.
final Element documentElement = Elements.getDocument().getDocumentElement();
EventListener downListener =
new EventListener() {
@Override
public void handleEvent(Event event) {
SignalEvent signalEvent = SignalEventUtils.create(event, false);
if (signalEvent == null) {
return;
}
/*
Temporary solution to prevent calling actions if focus is in input element.
The problem in that, some actions, may be bound to Ctrl+C/X/V/Z or Delete so
We should allow browser to process event natively instead of calling actions.
Need to be reworked in nearest future. */
final JavaScriptObject jso = (JavaScriptObject) event.getTarget();
if (InputElement.is(jso) || AreaElement.is(jso)) {
return;
}
// handle event in active scheme
int digest = CharCodeWithModifiers.computeKeyDigest(signalEvent);
preventDefaultBrowserAction((KeyboardEvent) event, digest);
List<String> actionIds = getActive().getActionIds(digest);
if (!actionIds.isEmpty()) {
runActions(actionIds, event);
}
// else handle event in global scheme
else if (!(actionIds = getGlobal().getActionIds(digest)).isEmpty()) {
runActions(actionIds, event);
}
// default, lets this event handle other part of the IDE
}
};
if (UserAgent.isFirefox()) {
// firefox fires keypress events
documentElement.addEventListener(Event.KEYPRESS, downListener, true);
} else {
// webkit fires keydown events
documentElement.addEventListener(Event.KEYDOWN, downListener, true);
}
}