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


Java NativePreviewEvent.getNativeEvent方法代码示例

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


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

示例1: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
	if (this.resizable) {
		// We need to preventDefault() on mouseDown events (outside of the
		// DialogBox content) to keep text from being selected when it
		// is dragged.
		NativeEvent nativeEvent = event.getNativeEvent();

		if (!event.isCanceled()
				&& (event.getTypeInt() == Event.ONMOUSEDOWN)
				&& calcDragMode(nativeEvent.getClientX(),nativeEvent.getClientY()) >= 0) {
			nativeEvent.preventDefault();
		}
	}
	
	super.onPreviewNativeEvent(event);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:18,代码来源:WindowBox.java

示例2: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();

	if (evt.getCtrlKey()) {
		switch (evt.getKeyCode()) {
			case 'a':
			case 'A':
				evt.preventDefault();
				okButton.click();
			case 'z':
			case 'Z':
				evt.preventDefault();
				closeButton.click();
				break;
		}
	}

}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:22,代码来源:ExternalAppDialogBox.java

示例3: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();
	if (evt.getType().equals("keydown")) {
		// Use the popup's key preview hooks to close the dialog when either
		// enter or escape is pressed.
		switch (evt.getKeyCode()) {
		case KeyCodes.KEY_ENTER:
		case KeyCodes.KEY_ESCAPE:
			hide();
			break;
		default:
			break;
		}
	}
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:19,代码来源:AboutDialog.java

示例4: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();

	if (evt.getCtrlKey()) {
		switch (evt.getKeyCode()) {
			case 'a':
			case 'A':
				evt.preventDefault();
				okButton.click();
			case 'z':
			case 'Z':
				evt.preventDefault();
				closeButton.click();
				break;
			default:
			break;
		}
	}

}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:24,代码来源:ExternalAppDialogBox.java

示例5: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( p_event == null || p_event.getNativeEvent() == null
      || p_event.getNativeEvent().getEventTarget() == null )
  {
    return;
  }
  com.google.gwt.dom.client.Element elmt = com.google.gwt.dom.client.Element.as( p_event
      .getNativeEvent().getEventTarget() );
  if( elmt instanceof InputElement )
  {
    String type = ((InputElement)elmt).getType();
    if( type != null
        && (type.equals( "text" ) || type.equals( "password" ) || type.equals( "textarea" )) )
    {
      return;
    }
  }

  // don't preview event if user is editing someting in an input form
  m_previewListenerCollection.fireEventPreview( p_event );
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:24,代码来源:AppRoot.java

示例6: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType()
         .equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
 
开发者ID:mvp4g,项目名称:mvp4g-examples,代码行数:18,代码来源:AboutDialog.java

示例7: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();
	if (evt.getType().equals("keydown")) {
		// Use the popup's key preview hooks to close the dialog when either
		// enter or escape is pressed.
		switch (evt.getKeyCode()) {
		case KeyCodes.KEY_ENTER:
		case KeyCodes.KEY_ESCAPE:
			hide();
			break;
		}
	}
}
 
开发者ID:jlSites,项目名称:funWithGwt,代码行数:17,代码来源:InforDialog.java

示例8: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType().equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
 
开发者ID:jlSites,项目名称:funWithGwt,代码行数:17,代码来源:InforDialog.java

示例9: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent event) {
    final NativeEvent natEvent = event.getNativeEvent();
    final Element element = natEvent.getEventTarget().cast();
    final String eventType = natEvent.getType();
    if (!(element == left || element == right)) {
        if ("mousedown".equals(eventType)) {
            //No need to do anything, the event will be passed on to the column sort handler
        } else if (!dragging && "mouseover".equals(eventType)) {
            cleanUp();
        }
        return;
    }
    final NativeEvent nativeEvent = getEventAndPreventPropagation(event);
    if ("mousedown".equals(eventType)) {
        if (element == right) {
            left.removeFromParent();
            new ColumnResizeHelper(this, source, right, nativeEvent);
        } else
            new ColumnMoverHelper(this, source, nativeEvent);
        dragging = true;
    }
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:24,代码来源:ResizableHeader.java

示例10: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	// Use the popup's key preview hooks to close the dialog when either
	// enter or escape is pressed.
	NativeEvent evt = preview.getNativeEvent();
	if (evt.getType().equals(KEYDOWN) && evt.getKeyCode() == KeyCodes.KEY_ESCAPE && performCancelOnEscape && listener != null
			&& cancelButton.isVisible()) {
		listener.onCancelClick();
		hide();
	}

}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:15,代码来源:ConfirmationDialog.java

示例11: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();
	if (evt.getType().equals("keydown") && evt.getKeyCode() == KeyCodes.KEY_ESCAPE) {
		// Use the popup's key preview hooks to close the dialog when either
		// enter or escape is pressed.
		hide();
	}
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:12,代码来源:RadioButtonDialogView.java

示例12: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();
	if (evt.getType().equals("keydown") && evt.getKeyCode() == KeyCodes.KEY_ESCAPE) {
		hide();
	}
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:10,代码来源:DisplayDialogBox.java

示例13: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(final NativePreviewEvent event) {
    final NativeEvent natEvent = event.getNativeEvent();
    final Element element = natEvent.getEventTarget().cast();
    final String eventType = natEvent.getType();
    if (!(element == moveHandle || element == resizeHandle)) {
        if ("mousedown".equals(eventType)) {
            //No need to do anything, the event will be passed on to the column sort handler
        } else if (!dragging && "mouseover".equals(eventType)) {
            cleanUp();
        }
        return;
    }
    final NativeEvent nativeEvent = getEventAndPreventPropagation(event);
    if ("mousedown".equals(eventType)) {
        if (element == resizeHandle) {
            moveHandle.removeFromParent();
            new ColumnResizeHelper(this,
                                   source,
                                   nativeEvent);
        } else {
            new ColumnMoverHelper(this,
                                  source,
                                  nativeEvent);
        }
        dragging = true;
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:29,代码来源:ResizableMovableHeader.java

示例14: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
public void onPreviewNativeEvent(NativePreviewEvent event) {
    NativeEvent nativeEvent = event.getNativeEvent();
    int button = nativeEvent.getButton();
    int x = nativeEvent.getClientX();
    int y = nativeEvent.getClientY();            
    int keyCode = nativeEvent.getKeyCode();
    int mouseWheelVelocity = nativeEvent.getMouseWheelVelocityY();            
    int screenX = nativeEvent.getScreenX();
    int screenY = nativeEvent.getScreenY();
    int keyModifiers =
        ((nativeEvent.getAltKey() ? 8 : 0) |
        (nativeEvent.getCtrlKey() ? 4 : 0) | 
        (nativeEvent.getMetaKey() ? 2 : 0) |
        (nativeEvent.getShiftKey() ? 1 : 0));
    byte[] compressedData;
    long currentTime = System.currentTimeMillis();
    byte timeDiff = (byte) ((currentTime - previousSystemTime) & 0xff);
    byte eventType = (byte) (event.getTypeInt() & 0xff);
    if (keyCode != 0) {
        compressedData = new byte[] {
                timeDiff, eventType,
                (byte) (keyCode & 0xff),
                (byte) keyModifiers };                
    } else {
        compressedData = new byte[] {
                timeDiff,
                eventType,
                (byte) ((screenX - previousScreenX) & 0xff),
                (byte) ((screenY - previousScreenY) & 0xff),
                (byte) (button << 4 | keyModifiers),
                (byte) mouseWheelVelocity };
    }
    previousScreenX = screenX;
    previousScreenY = screenY;
    previousSystemTime = currentTime;
    addEntropy(ENTROPY_ID, ENTROPY_ESTMATE, compressedData);
}
 
开发者ID:ivanceras,项目名称:crypto-gwt,代码行数:38,代码来源:EventEntropySource.java

示例15: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    NativeEvent nativeEvent = event.getNativeEvent();

    if (!event.isCanceled() && (event.getTypeInt() == Event.ONMOUSEDOWN)
            && isCaptionEvent(nativeEvent)) {
        nativeEvent.preventDefault();
    }

    super.onPreviewNativeEvent(event);
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:12,代码来源:FormPopup.java


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