當前位置: 首頁>>代碼示例>>Java>>正文


Java InputElement.is方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material,代碼行數:14,代碼來源:FocusableMixin.java

示例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;
}
 
開發者ID:opendata-euskadi,項目名稱:r01fb,代碼行數:12,代碼來源:TreeViewUtils.java

示例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;
}
 
開發者ID:opendata-euskadi,項目名稱:r01fb,代碼行數:12,代碼來源:TreeViewUtils.java

示例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);
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:59,代碼來源:KeyBindingManager.java


注:本文中的com.google.gwt.dom.client.InputElement.is方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。