本文整理汇总了Java中com.google.gwt.core.client.Scheduler类的典型用法代码示例。如果您正苦于以下问题:Java Scheduler类的具体用法?Java Scheduler怎么用?Java Scheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Scheduler类属于com.google.gwt.core.client包,在下文中一共展示了Scheduler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: focusInputField
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
void focusInputField(final FormItem focusItem) {
Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand() {
@Override
public void execute() {
// Reset the search field for next time
focusItem.focusInItem();
}
});
// DeferredCommand.addCommand(new Command() {
// public void execute() {
// // Reset the search field for next time
// focusItem.focusInItem();
// }
// });
}
示例2: focusInputField
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
void focusInputField(final FormItem focusItem) {
Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand() {
@Override
public void execute() {
// Reset the search field for next time
focusItem.focusInItem();
}
});
// DeferredCommand.addCommand(new Command() {
// public void execute() {
// // Reset the search field for next time
// focusItem.focusInItem();
// }
// });
}
示例3: openNew
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
public void openNew() {
setText(MESSAGES.dialogNewGroup());
iGrOldName = null;
iGrName.setText(String.valueOf((char)('A' + getGroups().size())));
iGrType.setSelectedIndex(0);
iGrAssign.setVisible(true);
iGrDelete.setVisible(false);
iGrUpdate.setVisible(false);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
iGrName.setFocus(true);
iGrName.selectAll();
}
});
center();
}
示例4: SessionDatesSelector
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
public SessionDatesSelector(AcademicSessionProvider session) {
iAcademicSession = session;
iPanel = new UniTimeWidget<DatesPanel>(new DatesPanel());
initWidget(iPanel);
iAcademicSession.addAcademicSessionChangeHandler(new AcademicSessionChangeHandler() {
@Override
public void onAcademicSessionChange(AcademicSessionChangeEvent event) {
if (event.isChanged()) init(event.getNewAcademicSessionId());
}
});
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
init(iAcademicSession.getAcademicSessionId());
}
});
}
示例5: authenticate
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
public void authenticate() {
if (!CONSTANTS.allowUserLogin()) {
if (isAllowLookup())
doLookup();
else
ToolBox.open(GWT.getHostPageBaseURL() + "login.do?target=" + URL.encodeQueryString(Window.Location.getHref()));
return;
}
AriaStatus.getInstance().setText(ARIA.authenticationDialogOpened());
iError.setVisible(false);
iDialog.center();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
iUserName.selectAll();
iUserName.setFocus(true);
}
});
}
示例6: onModuleLoad
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
public void onModuleLoad() {
// Create Exception alert
GWT.setUncaughtExceptionHandler(new
GWT.UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
Throwable unwrapped = unwrap(e);
LOG.log(Level.SEVERE, "Ex caught!", e);
}
});
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
onModuleLoad2();
}
});
}
示例7: onAttach
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
@Override
protected void onAttach() {
super.onAttach();
/*
* When this window gets reattached, set the tabstop to the previous
* state.
*/
setTabStopEnabled(doTabStop);
// Fix for #14413. Any pseudo elements inside these elements are not
// visible on initial render unless we shake the DOM.
if (BrowserInfo.get().isIE8()) {
closeBox.getStyle().setDisplay(Style.Display.NONE);
Scheduler.get().scheduleFinally(new Command() {
@Override
public void execute() {
closeBox.getStyle().clearDisplay();
}
});
}
}
示例8: applySelectionCommand
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
@Override
protected void applySelectionCommand(final Scheduler.ScheduledCommand command) {
if (!doubleClickMode || doubleClickHandling) {
super.applySelectionCommand(command);
} else {
Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
private long scheduledTimestamp = System.currentTimeMillis();
@Override
public boolean execute() {
if (!doubleClickHandling && lastDoubleClickHandled < scheduledTimestamp) {
command.execute();
}
return false;
}
}, 250);
}
}
示例9: onPreviewNativeEvent
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
@Override
protected void onPreviewNativeEvent(Event.NativePreviewEvent event) {
super.onPreviewNativeEvent(event);
NativeEvent nativeEvent = event.getNativeEvent();
Element target = Element.as(nativeEvent.getEventTarget());
if (Event.ONCLICK == event.getTypeInt()) {
final Widget hoveredButton = WidgetUtil.findWidget(target, null);
if (getElement().isOrHasChild(target)) {
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
hide();
if (BrowserInfo.get().isIE9()) {
if (hoveredButton instanceof CubaButtonWidget) {
hoveredButton.removeStyleName("ie9-hover");
}
}
}
});
}
}
}
示例10: render
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
@Override
public void render(RendererCellReference rendererCellReference, final ComponentConnector componentConnector,
final SimplePanel panel) {
if (componentConnector != null) {
// render chart widgets deferred so measurements are correct. Do not render
// normal component widgets deferred as it causes some flicker when rerendering the grid
if (componentConnector.getClass().getName().equals("com.vaadin.addon.charts.shared.ChartConnector")) {
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
panel.setWidget(componentConnector.getWidget());
}
});
} else {
panel.setWidget(componentConnector.getWidget());
}
} else {
panel.clear();
}
}
示例11: onFocus
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
@Override
public void onFocus(FocusEvent event) {
super.onFocus(event);
if (!this.focused) {
this.focused = true;
if (!isReadOnly() && isEnabled()) {
if (mask != null && nullRepresentation != null && nullRepresentation.equals(super.getText())) {
addStyleName("c-focus-move");
Scheduler.get().scheduleDeferred(() -> {
if (!isReadOnly() && isEnabled() && focused) {
setSelectionRange(getPreviousPos(0), 0);
}
removeStyleName("c-focus-move");
});
}
}
}
}
示例12: showInfo
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
/**
* Populates the info box. Continuously reports which element has browser
* focus, and reports timing information for the stage loading.
*
* @param timeline timeline to report
*/
private static void showInfo(Timeline timeline) {
Element timeBox = Document.get().getElementById("timeline");
timeline.dump(timeBox);
Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
private final Element activeBox = Document.get().getElementById("active");
@Override
public boolean execute() {
Element e = getActiveElement();
String text = (e != null ? e.getTagName() + " id:" + e.getId() : "none");
activeBox.setInnerText(text);
return true;
}
private native Element getActiveElement() /*-{
return $doc.activeElement;
}-*/;
}, 1000);
}
示例13: scrollToLastStackElement
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
/**
* Shows the last stack element in the scroll panel
*/
private void scrollToLastStackElement() {
//Make it into the deferred command because the element might be shown later,
//such as if this method is called before the forum section is selected
if( messageStack.size() > 0 ) {
final MessageStackElement element = messageStack.get( messageStack.size() - 1 );
Scheduler.get().scheduleDeferred( new ScheduledCommand(){
@Override
public void execute() {
//Ensure that the top stack element is visible in the stack
if( element.isAttached() ) {
scrollPanel.ensureVisible( element );
}
}
});
}
}
示例14: onAfterComponentIsAdded
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
@Override
public void onAfterComponentIsAdded() {
//Re-add the panel size, here we have to account for the
//browsers because they do not render the first view correctly
//if the person comes directly to the forum page
BrowserDetect detect = BrowserDetect.getBrowserDetect();
if( isFirstTime && ( detect.isChrome() || detect.isSafari() || detect.isFirefox() ) ) {
//We do the update in the deferred command because only this way
//the browser does it after the rendering of the view is complete
Scheduler.get().scheduleDeferred( new ScheduledCommand(){
@Override
public void execute() {
updateUIElements();
}
});
isFirstTime = false;
}
}
示例15: onFirstLoadComplete
import com.google.gwt.core.client.Scheduler; //导入依赖的package包/类
private void onFirstLoadComplete() {
WebPlotGroup plotGroup = _plot.getPlotGroup();
plotGroup.computeMinMax();
WebPlotGroup.fireReplotEvent(ReplotDetails.Reason.IMAGE_RELOADED, _plot);
if (_pv != null && _pv.contains(_plot)) {
if (_firstLoad) {
_pv.reconfigure();
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
public void execute() {
_pv.smartCenter();
}
});
_firstLoad = false;
} else {
ImageWorkSpacePt pt = _pv.findCurrentCenterPoint();
_pv.reconfigure();
if (!AllPlots.getInstance().isWCSMatch())_pv.centerOnPoint(pt);
}
}
}