Java 类com.intellij.util.Time 实例源码

项目:consulo    文件:SendStatisticsProjectComponent.java   
private void runStatisticsService() {
  StatisticsService statisticsService = StatisticsUploadAssistant.getStatisticsService();

  if (System.currentTimeMillis() - Time.DAY > ((FeatureUsageTrackerImpl)FeatureUsageTracker.getInstance()).getFirstRunTime()) {
    return;
  }

  if (StatisticsUploadAssistant.isSendAllowed() && StatisticsUploadAssistant.isTimeToSend()) {
    runWithDelay(statisticsService);
  }
}
项目:intellij-ce-playground    文件:StatisticsUploadAssistant.java   
public static boolean isShouldShowNotification() {
  return UsageStatisticsPersistenceComponent.getInstance().isShowNotification() &&
         (System.currentTimeMillis() - Time.DAY > ((FeatureUsageTrackerImpl)FeatureUsageTracker.getInstance()).getFirstRunTime());
}
项目:intellij-ce-playground    文件:TreeUiTest.java   
public void testClear() throws Exception {
  getBuilder().getUi().setClearOnHideDelay(Time.SECOND);

  buildStructure(myRoot);

  assertTree("+/\n");

  final DefaultMutableTreeNode openApiNode = findNode("openapi", false);
  final DefaultMutableTreeNode ideNode = findNode("ide", false);
  final DefaultMutableTreeNode runnerNode = findNode("runner", false);
  final DefaultMutableTreeNode rcpNode = findNode("rcp", false);

  assertNull(openApiNode);
  assertNull(ideNode);
  assertNull(runnerNode);
  assertNull(rcpNode);

  buildNode(myOpenApi, true);
  buildNode(myIde, true);
  buildNode(myRunner, false);

  hideTree();

  assertNull(findNode("openapi", true));
  assertNull(findNode("ide", true));
  assertNull(findNode("runner", false));
  assertNull(findNode("rcp", false));

  showTree();

  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   [openapi]\n" +
             " -jetbrains\n" +
             "  -fabrique\n" +
             "   [ide]\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");

  getMyBuilder().myWasCleanedUp = false;
  hideTree();
  showTree();

  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   [openapi]\n" +
             " -jetbrains\n" +
             "  -fabrique\n" +
             "   [ide]\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");

  buildNode(myFabrique.myElement, true, false);
  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   openapi\n" +
             " -jetbrains\n" +
             "  -[fabrique]\n" +
             "   ide\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");
}
项目:tools-idea    文件:StatisticsUploadAssistant.java   
public static boolean showNotification() {
    return UsageStatisticsPersistenceComponent.getInstance().isShowNotification() &&
           (System.currentTimeMillis() - Time.DAY > ((FeatureUsageTrackerImpl)FeatureUsageTracker.getInstance()).getFirstRunTime()) ;
}
项目:tools-idea    文件:TreeUiTest.java   
public void testClear() throws Exception {
  getBuilder().getUi().setClearOnHideDelay(Time.SECOND);

  buildStructure(myRoot);

  assertTree("+/\n");

  final DefaultMutableTreeNode openApiNode = findNode("openapi", false);
  final DefaultMutableTreeNode ideNode = findNode("ide", false);
  final DefaultMutableTreeNode runnerNode = findNode("runner", false);
  final DefaultMutableTreeNode rcpNode = findNode("rcp", false);

  assertNull(openApiNode);
  assertNull(ideNode);
  assertNull(runnerNode);
  assertNull(rcpNode);

  buildNode(myOpenApi, true);
  buildNode(myIde, true);
  buildNode(myRunner, false);

  hideTree();

  assertNull(findNode("openapi", true));
  assertNull(findNode("ide", true));
  assertNull(findNode("runner", false));
  assertNull(findNode("rcp", false));

  showTree();

  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   [openapi]\n" +
             " -jetbrains\n" +
             "  -fabrique\n" +
             "   [ide]\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");

  getMyBuilder().myWasCleanedUp = false;
  hideTree();
  showTree();

  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   [openapi]\n" +
             " -jetbrains\n" +
             "  -fabrique\n" +
             "   [ide]\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");

  buildNode(myFabrique.myElement, true, false);
  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   openapi\n" +
             " -jetbrains\n" +
             "  -[fabrique]\n" +
             "   ide\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");
}
项目:consulo    文件:TreeUiTest.java   
public void testClear() throws Exception {
  getBuilder().getUi().setClearOnHideDelay(Time.SECOND);

  buildStructure(myRoot);

  assertTree("+/\n");

  final DefaultMutableTreeNode openApiNode = findNode("openapi", false);
  final DefaultMutableTreeNode ideNode = findNode("ide", false);
  final DefaultMutableTreeNode runnerNode = findNode("runner", false);
  final DefaultMutableTreeNode rcpNode = findNode("rcp", false);

  assertNull(openApiNode);
  assertNull(ideNode);
  assertNull(runnerNode);
  assertNull(rcpNode);

  buildNode(myOpenApi, true);
  buildNode(myIde, true);
  buildNode(myRunner, false);

  hideTree();

  assertNull(findNode("openapi", true));
  assertNull(findNode("ide", true));
  assertNull(findNode("runner", false));
  assertNull(findNode("rcp", false));

  showTree();

  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   [openapi]\n" +
             " -jetbrains\n" +
             "  -fabrique\n" +
             "   [ide]\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");

  getMyBuilder().myWasCleanedUp = false;
  hideTree();
  showTree();

  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   [openapi]\n" +
             " -jetbrains\n" +
             "  -fabrique\n" +
             "   [ide]\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");

  buildNode(myFabrique.myElement, true, false);
  assertTree("-/\n" +
             " -com\n" +
             "  -intellij\n" +
             "   openapi\n" +
             " -jetbrains\n" +
             "  -[fabrique]\n" +
             "   ide\n" +
             " +org\n" +
             " -xUnit\n" +
             "  runner\n");
}