use of com.google.gwt.dom.client.NativeEvent in project rstudio by rstudio.
the class ModalDialogBase method onEscapeKeyDown.
protected void onEscapeKeyDown(Event.NativePreviewEvent event) {
NativeEvent nativeEvent = event.getNativeEvent();
if (cancelButton_ == null) {
if ((okButton_ != null) && okButton_.isEnabled()) {
nativeEvent.preventDefault();
nativeEvent.stopPropagation();
event.cancel();
okButton_.click();
}
} else if (cancelButton_.isEnabled()) {
nativeEvent.preventDefault();
nativeEvent.stopPropagation();
event.cancel();
cancelButton_.click();
}
}
use of com.google.gwt.dom.client.NativeEvent in project rstudio by rstudio.
the class InlineToolbarButton method click.
public void click() {
NativeEvent clickEvent = Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false);
DomEvent.fireNativeEvent(clickEvent, hasHandlers_);
}
use of com.google.gwt.dom.client.NativeEvent in project rstudio by rstudio.
the class ManipulatorPopupPanel method onPreviewNativeEvent.
@Override
public void onPreviewNativeEvent(Event.NativePreviewEvent event) {
if (event.getTypeInt() == Event.ONKEYDOWN) {
NativeEvent nativeEvent = event.getNativeEvent();
switch(nativeEvent.getKeyCode()) {
case KeyCodes.KEY_ESCAPE:
nativeEvent.preventDefault();
nativeEvent.stopPropagation();
event.cancel();
hideMiniDialog();
break;
}
}
}
use of com.google.gwt.dom.client.NativeEvent in project rstudio by rstudio.
the class WindowEx method fireFocusHandlers.
private static void fireFocusHandlers() {
NativeEvent nativeEvent = Document.get().createFocusEvent();
FocusEvent.fireNativeEvent(nativeEvent, new HasHandlers() {
public void fireEvent(GwtEvent<?> event) {
handlers_.fireEvent(event);
}
});
}
use of com.google.gwt.dom.client.NativeEvent in project rstudio by rstudio.
the class AceEditorBackgroundLinkHighlighter method onAceClick.
@Override
public void onAceClick(AceClickEvent clickEvent) {
NativeEvent event = clickEvent.getNativeEvent();
if (!isRequiredClickModifier(event))
return;
MarkerRegistration marker = getTargetedMarker(event);
if (marker == null)
return;
clickEvent.stopPropagation();
clickEvent.preventDefault();
// will be opened in the background
if (BrowseCap.isMacintosh() && !BrowseCap.isMacintoshDesktop()) {
endDetectClickTarget();
String url = editor_.getTextForRange(marker.getRange());
navigateToUrl(url);
}
}
Aggregations