当前位置: 首页>>代码示例>>Java>>正文


Java Timer类代码示例

本文整理汇总了Java中com.google.gwt.user.client.Timer的典型用法代码示例。如果您正苦于以下问题:Java Timer类的具体用法?Java Timer怎么用?Java Timer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Timer类属于com.google.gwt.user.client包,在下文中一共展示了Timer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HorizontalPanelWithHint

import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public HorizontalPanelWithHint(Widget hint) {
	super();
	iHint = new PopupPanel();
	iHint.setWidget(hint);
	iHint.setStyleName("unitime-PopupHint");
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONMOUSEMOVE);
	iShowHint = new Timer() {
		@Override
		public void run() {
			iHint.show();
		}
	};
	iHideHint = new Timer() {
		@Override
		public void run() {
			iHint.hide();
		}
	};
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:HorizontalPanelWithHint.java

示例2: 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();
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:21,代码来源:NavigationButtonModule.java

示例3: 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);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:VideoControlHideTimer.java

示例4: MyFlexTable

import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public MyFlexTable() {
	super();
	setCellPadding(2);
	setCellSpacing(0);
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONCLICK);
	sinkEvents(Event.ONKEYDOWN);
	setStylePrimaryName("unitime-MainTable");
	iTimer = new Timer() {
		@Override
		public void run() {
			saveOrder();
		}
	};
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:CurriculumProjectionRulesPage.java

示例5: CourseRelatedObjectsTable

import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public CourseRelatedObjectsTable(AcademicSessionProvider session) {
	iSession = session;
	setStyleName("unitime-EventOwners");
	
	List<Widget> header = new ArrayList<Widget>();
	header.add(new UniTimeTableHeader(MESSAGES.colSubject()));
	header.add(new UniTimeTableHeader(MESSAGES.colCourseNumber()));
	header.add(new UniTimeTableHeader(MESSAGES.colConfigOrSubpart()));
	header.add(new UniTimeTableHeader(MESSAGES.colClassNumber()));
	header.add(new UniTimeTableHeader("&nbsp;"));
	
	addRow(null, header);
	
	iChangeTimer = new Timer() {
		@Override
		public void run() {
			List<RelatedObjectInterface> value = getValue();
			if (iLastChange != null && iLastChange.equals(value)) return;
			iLastChange = value;
			ValueChangeEvent.fire(CourseRelatedObjectsTable.this, value);
		}
	};
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:EventAdd.java

示例6: 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);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:MobileNotifications.java

示例7: 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);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:UniTimePageHeader.java

示例8: Calendar

import com.google.gwt.user.client.Timer; //导入依赖的package包/类
private Calendar(Integer tenantId, Fetchable<Collection<I>> dataProvider, Fetchable<List<G>> groupProvider,
        DataProvider<G,
                I> instanceCreator, SyncBeanManager beanManager) {
    this.beanManager = beanManager;
    this.tenantId = tenantId;

    shifts = new HashMap<>();
    didTenantChange = true;

    setInstanceCreator(instanceCreator);
    setGroupProvider(groupProvider);
    setDataProvider(dataProvider);

    timer = new Timer() {

        @Override
        public void run() {
            forceUpdate();
        }
    };

    refresh();

}
 
开发者ID:kiegroup,项目名称:optashift-employee-rostering,代码行数:25,代码来源:Calendar.java

示例9: EditorManager

import com.google.gwt.user.client.Timer; //导入依赖的package包/类
/**
 * Creates the editor manager.
 */
public EditorManager() {
  openProjectEditors = Maps.newHashMap();

  dirtyProjectSettings = new HashSet<ProjectSettings>();
  dirtyFileEditors = new HashSet<FileEditor>();

  autoSaveTimer = new Timer() {
    @Override
    public void run() {
      // When the timer goes off, save all dirtyProjectSettings and
      // dirtyFileEditors.
      Ode.getInstance().lockScreens(true); // Lock out changes
      saveDirtyEditors(new Command() {
          @Override
          public void execute() {
            Ode.getInstance().lockScreens(false); // I/O finished, unlock
          }
        });
    }
  };
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:25,代码来源:EditorManager.java

示例10: 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);
}
 
开发者ID:ainslec,项目名称:gwt-promptly,代码行数:18,代码来源:DemoUI.java

示例11: 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);
}
 
开发者ID:tbroyer,项目名称:gwt-history,代码行数:18,代码来源:HistoryTest.java

示例12: 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);
}
 
开发者ID:tbroyer,项目名称:gwt-history,代码行数:26,代码来源:HistoryTest.java

示例13: 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());
}
   }
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:24,代码来源:Print.java

示例14: 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());
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-patterns,代码行数:22,代码来源:GoogleDriveView.java

示例15: 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());
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-patterns,代码行数:22,代码来源:GoogleContactsView.java


注:本文中的com.google.gwt.user.client.Timer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。