本文整理汇总了Java中com.google.gwt.core.client.GWT.log方法的典型用法代码示例。如果您正苦于以下问题:Java GWT.log方法的具体用法?Java GWT.log怎么用?Java GWT.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.core.client.GWT
的用法示例。
在下文中一共展示了GWT.log方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUncaughtException
import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
@UncaughtExceptionHandler
private void onUncaughtException(Throwable caught) {
try {
if (caught instanceof JSONException
&& caught.getMessage().contains("unexpected character at line 1 column 1 of the JSON data")) {
// Not sure how best to deal with this when using MessageBus
logger.info("JsonParseException usually as a result of failed redirect to login from message bus");
Window.Location.assign("/");
} else {
throw caught;
}
} catch (Throwable t) {
Window.alert(t.getMessage());
GWT.log("An unexpected error has occurred", t);
}
}
示例2: safeObjectAppend
import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
private static void safeObjectAppend(StringBuilder sbuf, Object o) {
try {
sbuf.append(o.toString());
} catch (Throwable t) {
GWT.log("SLF4J: Failed toString() invocation on an object of type ["
+ o.getClass().getName() + "]", t);
/*
System.err
.println("SLF4J: Failed toString() invocation on an object of type ["
+ o.getClass().getName() + "]");
t.printStackTrace();
*/
sbuf.append("[FAILED toString()]");
}
}
示例3: onMouseDown
import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
@Override
public void onMouseDown(MouseDownEvent event) {
startX = event.getClientX();
startY = event.getClientY();
if (isDisabled() || event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
return;
}
clickTarget = Element.as(event.getNativeEvent().getEventTarget());
mouseMoveCanceled = false;
if ((weekGrid.getCalendar().isItemMoveAllowed() && getCalendarItem().isMoveable())
|| (clickTargetsResize() && getCalendarItem().isResizeable())) {
moveRegistration = addMouseMoveHandler(this);
setFocus(true);
try {
startYrelative = (int) ((double) event.getRelativeY(caption) % slotHeight);
startXrelative = (event.getRelativeX(weekGrid.getElement())
- weekGrid.timebar.getOffsetWidth())
% getDateCellWidth();
} catch (Exception e) {
GWT.log("Exception calculating relative start position", e);
}
mouseMoveStarted = false;
Style s = getElement().getStyle();
s.setZIndex(1000);
startDatetimeFrom = (Date) calendarItem.getStartTime().clone();
startDatetimeTo = (Date) calendarItem.getEndTime().clone();
Event.setCapture(getElement());
}
// make sure the right cursor is always displayed
if (clickTargetsResize() && getCalendarItem().isResizeable()) {
addGlobalResizeStyle();
}
/*
* We need to stop the event propagation or else the WeekGrid range
* select will kick in
*/
event.stopPropagation();
event.preventDefault();
}
示例4: onMouseUp
import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent event) {
if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
return;
}
if (moveRegistration != null) {
Event.releaseCapture(getElement());
moveRegistration.removeHandler();
moveRegistration = null;
keyDownHandler.removeHandler();
keyDownHandler = null;
}
Widget w = (Widget) event.getSource();
if (w == bottomspacer && monthEventMouseDown) {
GWT.log("Mouse up over bottomspacer");
} else if (clickedWidget instanceof MonthItemLabel && monthEventMouseDown) {
MonthItemLabel mel = (MonthItemLabel) clickedWidget;
int endX = event.getClientX();
int endY = event.getClientY();
int xDiff = 0, yDiff = 0;
if (startX != -1 && startY != -1) {
xDiff = startX - endX;
yDiff = startY - endY;
}
startX = -1;
startY = -1;
prevDayDiff = 0;
prevWeekDiff = 0;
if (xDiff < -3 || xDiff > 3 || yDiff < -3 || yDiff > 3) {
itemMoved(movingItem);
} else if (calendar.getItemClickListener() != null) {
CalendarItem e = getItemByWidget(mel);
if(e.isClickable())
calendar.getItemClickListener().itemClick(e);
}
movingItem = null;
} else if (w == this) {
getMonthGrid().setSelectionReady();
} else if (w instanceof Label && labelMouseDown) {
if (calendar.getDateClickListener() != null) {
calendar.getDateClickListener().dateClick(DateConstants.toRPCDate(date));
}
}
monthEventMouseDown = false;
labelMouseDown = false;
clickedWidget = null;
}
示例5: startCalendarItemDrag
import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
public void startCalendarItemDrag(MouseDownEvent event, final MonthItemLabel label) {
moveRegistration = addMouseMoveHandler(this);
startX = event.getClientX();
startY = event.getClientY();
startYrelative = event.getRelativeY(label.getParent().getElement())
% getHeigth();
startXrelative = event.getRelativeX(label.getParent().getElement())
% getWidth();
CalendarItem e = getItemByWidget(label);
dndSourceDateFrom = (Date) e.getStart().clone();
dndSourceDateTo = (Date) e.getEnd().clone();
dndSourceStartDateTime = (Date) e.getStartTime().clone();
dndSourceEndDateTime = (Date) e.getEndTime().clone();
Event.setCapture(getElement());
keyDownHandler = addKeyDownHandler(keyDownHandler -> {
if (keyDownHandler.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
cancelItemDrag(label);
}
});
focus();
GWT.log("Start drag");
}
示例6: onUncaughtException
import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void onUncaughtException(Throwable e) {
GWT.log(e.getMessage(), e);
}