本文整理汇总了Java中com.google.gwt.user.client.Timer.schedule方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.schedule方法的具体用法?Java Timer.schedule怎么用?Java Timer.schedule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Timer
的用法示例。
在下文中一共展示了Timer.schedule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerEvent
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Override
public void onPlayerEvent(PlayerEvent event) {
if (testMode) {
return;
}
if (event.getType() == PAGE_LOADED) {
Timer timer = new Timer() {
@Override
public void run() {
setEnabled(!isEnd());
setStyleName();
}
};
timer.schedule(300);
} else if (event.getType() == BEFORE_FLOW) {
setEnabled(false);
setStyleName();
}
}
示例2: VideoControlHideTimer
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Inject
public VideoControlHideTimer(@Assisted VideoFullScreenView view, EventsBus eventsBus) {
this.view = view;
this.eventsBus = eventsBus;
view.getContainer().addDomHandler(this, TouchEndEvent.getType());
view.getContainer().addDomHandler(this, ClickEvent.getType());
view.getContainer().addDomHandler(this, MouseMoveEvent.getType());
controlsHideTimer = new Timer() {
@Override
public void run() {
hideCotrols();
}
};
controlsHideTimer.schedule(CONTROLS_SHOW_TIME);
}
示例3: addNotification
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
protected void addNotification(final Notification notification) {
for (Iterator<Notification> i = iNotifications.iterator(); i.hasNext(); ) {
Notification n = i.next();
if (n.getText().equals(notification.getText())) {
i.remove();
}
}
iNotifications.add(notification);
populate("slideup");
Timer timer = new Timer() {
@Override
public void run() {
iNotifications.remove(notification);
populate(null);
}
};
timer.schedule(10000);
}
示例4: UniTimePageHeader
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private UniTimePageHeader() {
iHeader = new PageHeader();
getLeft().setCallback(new Callback() {
@Override
public void execute(Callback callback) {
reloadSolverInfo(true, callback);
}
});
reloadSessionInfo();
reloadUserInfo();
iTimer = new Timer() {
@Override
public void run() {
reloadSolverInfo(getLeft().isPopupShowing(), null);
}
};
iTimer.schedule(1000);
}
示例5: executeCommandPause
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
private void executeCommandPause(final PromptlyPanel panel) {
panel.setBlockingHyperlinks(true);
panel.append("Pausing for 3 seconds (all input ignored) ....");
panel.setCommandLineMode(false /* is command line mode */, false /* is collect key events */, false /* is collect mouse events */);
Timer t = new Timer() {
@Override
public void run() {
panel.append("... and we are back !");
panel.setBlockingHyperlinks(false);
panel.setCommandLineMode(true /* is command line mode */, true /* is collect key events */, true /* is collect mouse events */);
}
};
t.schedule(3000);
}
示例6: testNoEvents
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/** Verify that no events are issued via newItem if there were not reqeuested. */
public void testNoEvents() {
delayTestFinish(5000);
addHistoryListenerImpl(event -> fail("onHistoryChanged should not have been called"));
History.newItem("testNoEvents", false);
timer =
new Timer() {
@Override
public void run() {
finishTest();
}
};
timer.schedule(500);
}
示例7: testNoDoubleTokenUnEscaping
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* Test to make sure that there is no double unescaping of hash values. See
* https://bugzilla.mozilla.org/show_bug.cgi?id=483304
*/
@DoNotRunWith(Platform.HtmlUnitUnknown)
public void testNoDoubleTokenUnEscaping() {
final String shouldBeEncoded = "abc%20abc";
delayTestFinish(5000);
History.newItem(shouldBeEncoded);
History.newItem("someOtherToken");
History.back();
// allow browser to update the url
timer =
new Timer() {
@Override
public void run() {
// make sure that value in url actually matches the original token
assertEquals(shouldBeEncoded, History.getToken());
finishTest();
}
};
timer.schedule(200);
}
示例8: it
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
public static void it(String html) {
try {
buildFrame(html);
if (USE_TIMER) {
Timer timer = new Timer() {
public void run() {
printFrame();
}
};
timer.schedule(TIMER_DELAY * 1000);
} else {
DeferredCommand.addCommand(new Command() {
public void execute() {
printFrame();
}
});
}
} catch (Throwable exc) {
Window.alert(exc.getMessage());
}
}
示例9: GoogleDriveView
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Inject
GoogleDriveView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
splash.show();
Timer t = new Timer() {
@Override
public void run() {
splash.hide();
}
};
t.schedule(5000);
search.addCloseHandler(event -> {
appNav.setVisible(true);
searchNav.setVisible(false);
});
search.addKeyUpHandler(event -> {
List<DriveDTO> filteredFiles = DataHelper.getAllDrives().stream().filter(dto -> dto.getFileName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList());
populateFiles(filteredFiles);
});
populateFiles(DataHelper.getAllDrives());
}
示例10: GoogleContactsView
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Inject
GoogleContactsView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
splash.show();
Timer t = new Timer() {
@Override
public void run() {
splash.hide();
}
};
t.schedule(5000);
search.addCloseHandler(event -> {
appNav.setVisible(true);
searchNav.setVisible(false);
});
search.addKeyUpHandler(event -> {
List<UserDTO> filteredUser = DataHelper.getAllUsers().stream().filter(dto -> dto.getName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList());
populateUsers(filteredUser);
});
populateUsers(DataHelper.getAllUsers());
}
示例11: onChange
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Override
public void onChange(FolderEventConstant event) {
if (event.equals(HasFolderEvent.FOLDER_CHANGED)) {
Workflow.get().setTabFolderSelected();
workflowManager.findProcessInstancesByNode(Workflow.get().getUuid());
} else if (event.equals(HasFolderEvent.TAB_CHANGED)) {
if (TabFolderComunicator.isWidgetExtensionVisible(this)) {
Timer timer = new Timer() {
@Override
public void run() {
workflowManager.fillWidth();
}
};
timer.schedule(100);
}
}
}
示例12: onChange
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Override
public void onChange(DocumentEventConstant event) {
if (event.equals(HasDocumentEvent.DOCUMENT_CHANGED)) {
Workflow.get().setTabDocumentSelected();
workflowManager.findProcessInstancesByNode(Workflow.get().getUuid());
} else if (event.equals(HasDocumentEvent.TAB_CHANGED)) {
if (TabDocumentComunicator.isWidgetExtensionVisible(this)) {
Timer timer = new Timer() {
@Override
public void run() {
workflowManager.fillWidth();
}
};
timer.schedule(100);
}
}
}
示例13: onChange
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
@Override
public void onChange(MailEventConstant event) {
if (event.equals(HasMailEvent.MAIL_CHANGED)) {
Workflow.get().setTabMailSelected();
workflowManager.findProcessInstancesByNode(Workflow.get().getUuid());
} else if (event.equals(HasMailEvent.TAB_CHANGED)) {
if (TabMailComunicator.isWidgetExtensionVisible(this)) {
Timer timer = new Timer() {
@Override
public void run() {
workflowManager.fillWidth();
}
};
timer.schedule(100);
}
}
}
示例14: logout
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* logout
*/
private void logout(final HTML countDown, final int seconds) {
Timer timer = new Timer() {
@Override
public void run() {
countDown.setHTML(Main.i18n("ui.logout") + " " + secondsToHTML(seconds));
if (seconds > 1) {
logout(countDown, seconds - 1);
} else {
hide();
Main.get().logoutPopup.logout();
}
}
};
timer.schedule(1000);
}
示例15: logoutAfterChat
import com.google.gwt.user.client.Timer; //导入方法依赖的package包/类
/**
* logoutAfterChat();
*/
private void logoutAfterChat() {
Timer timer = new Timer() {
@Override
public void run() {
if (!Main.get().mainPanel.bottomPanel.userInfo.isPendingToClose()) {
authService.logout(callbackLogout);
} else {
logoutAfterChat();
}
}
};
timer.schedule(100); // Each minute seconds refreshing connected users
Log.debug("Logout: void");
}