Java 类com.intellij.ui.LicensingFacade 实例源码

项目:intellij-ce-playground    文件:AbstractUpdateDialog.java   
protected void initLicensingInfo(@NotNull UpdateChannel channel, @NotNull BuildInfo build) {
  LicensingFacade facade = LicensingFacade.getInstance();
  if (facade != null) {
    mySubscriptionLicense = facade.isSubscriptionLicense();
    if (!channel.getLicensing().equals(UpdateChannel.LICENSING_EAP)) {
      int majorVersion = build.getMajorVersion();
      if (majorVersion < 0) {
        majorVersion = channel.getMajorVersion(); // fallback
      }
      final Boolean paidUpgrade = facade.isPaidUpgrade(majorVersion, build.getReleaseDate());
      if (paidUpgrade == Boolean.TRUE) {
        myPaidUpgrade = true;
        myLicenseInfo = IdeBundle.message("updates.channel.key.needed", channel.getEvalDays());
      }
      else if (paidUpgrade == Boolean.FALSE) {
        myLicenseInfo = IdeBundle.message("updates.channel.existing.key");
      }
    }
    else {
      myLicenseInfo = IdeBundle.message("updates.channel.bundled.key");
    }
  }
}
项目:tools-idea    文件:NewChannelDialog.java   
private void initInfo() {
  StringBuilder builder = new StringBuilder();
  builder.append("<head>").append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())).append("</head><body>");
  builder.append("<b>").append(myChannel.getName()).append("</b><br>");
  builder.append(StringUtil.formatLinks(myChannel.getLatestBuild().getMessage())).append("<br><br>");
  LicensingFacade facade = LicensingFacade.getInstance();
  if (facade != null) {
    if (!myChannel.getLicensing().equals(UpdateChannel.LICENSING_EAP)) {
      Boolean paidUpgrade = facade.isPaidUpgrade(myChannel.getMajorVersion(), myChannel.getLatestBuild().getReleaseDate());
      if (paidUpgrade != null) {
        if (paidUpgrade) {
          builder.append("You can evaluate the new version for ")
            .append(myChannel.getEvalDays())
            .append(" days or buy a license key or an upgrade online.");
          myShowUpgradeButton = true;
        }
        else {
          builder.append("The new version can be used with your existing license key.");
        }
      }
    }
    else {
      builder.append("The new version has an expiration date and does not require a license key.");
    }
  }
  myInformationText = XmlStringUtil.wrapInHtml(builder);
}
项目:hybris-integration-intellij-idea-plugin    文件:HybrisProjectManagerListener.java   
private boolean isDiscountTargetGroup() {
    LicensingFacade licensingFacade = LicensingFacade.getInstance();
    return licensingFacade == null || licensingFacade.isEvaluationLicense() || PlatformUtils.isIdeaCommunity();
}
项目:hybris-integration-intellij-idea-plugin    文件:DefaultStatsCollector.java   
@Nullable
protected String getRegisteredTo() {
    final LicensingFacade instance = LicensingFacade.getInstance();

    return null == instance ? null : instance.getLicensedToMessage();
}
项目:intellij-ce-playground    文件:SendFeedbackAction.java   
private static boolean isEvaluationLicense() {
  final LicensingFacade provider = LicensingFacade.getInstance();
  return provider != null && provider.isEvaluationLicense();
}
项目:tools-idea    文件:SendFeedbackAction.java   
private static boolean isEvaluationLicense() {
  final LicensingFacade provider = LicensingFacade.getInstance();
  return provider != null && provider.isEvaluationLicense();
}