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"); } } }
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); }
private boolean isDiscountTargetGroup() { LicensingFacade licensingFacade = LicensingFacade.getInstance(); return licensingFacade == null || licensingFacade.isEvaluationLicense() || PlatformUtils.isIdeaCommunity(); }
@Nullable protected String getRegisteredTo() { final LicensingFacade instance = LicensingFacade.getInstance(); return null == instance ? null : instance.getLicensedToMessage(); }
private static boolean isEvaluationLicense() { final LicensingFacade provider = LicensingFacade.getInstance(); return provider != null && provider.isEvaluationLicense(); }