本文整理匯總了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);
}