mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LicenseInfoProvider -> LicensingFacade; refactoring
This commit is contained in:
@@ -31,7 +31,7 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.ui.LicenseeInfoProvider;
|
||||
import com.intellij.ui.LicensingFacade;
|
||||
import com.intellij.util.ImageLoader;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -195,13 +195,11 @@ public class AboutAction extends AnAction implements DumbAware {
|
||||
buildDate += DateFormat.getDateInstance(DateFormat.LONG).format(cal.getTime());
|
||||
myLines.add(new AboutBoxLine(IdeBundle.message("aboutbox.build.date", buildDate)));
|
||||
myLines.add(new AboutBoxLine(""));
|
||||
LicenseeInfoProvider provider = LicenseeInfoProvider.getInstance();
|
||||
LicensingFacade provider = LicensingFacade.getInstance();
|
||||
if (provider != null) {
|
||||
myLines.add(new AboutBoxLine(provider.getLicensedToMessage(), true, false));
|
||||
myLines.add(new AboutBoxLine(provider.getLicenseRestrictionsMessage()));
|
||||
final Date mdd = provider.getMaintenanceDueDate();
|
||||
if (mdd != null) {
|
||||
myLines.add(new AboutBoxLine(IdeBundle.message("aboutbox.maintenance.due", mdd)));
|
||||
for (String message : provider.getLicenseRestrictionsMessages()) {
|
||||
myLines.add(new AboutBoxLine(message));
|
||||
}
|
||||
}
|
||||
myLines.add(new AboutBoxLine(""));
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.ex.ApplicationInfoEx;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.ui.LicenseeInfoProvider;
|
||||
import com.intellij.ui.LicensingFacade;
|
||||
|
||||
public class SendFeedbackAction extends AnAction implements DumbAware {
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
@@ -45,7 +45,7 @@ public class SendFeedbackAction extends AnAction implements DumbAware {
|
||||
}
|
||||
|
||||
private static boolean isEvaluationLicense() {
|
||||
final LicenseeInfoProvider provider = LicenseeInfoProvider.getInstance();
|
||||
final LicensingFacade provider = LicensingFacade.getInstance();
|
||||
return provider != null && provider.isEvaluationLicense();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-10
@@ -17,25 +17,20 @@ package com.intellij.ui;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public abstract class LicenseeInfoProvider {
|
||||
public static LicenseeInfoProvider ourInstance;
|
||||
public abstract class LicensingFacade {
|
||||
public static LicensingFacade ourInstance;
|
||||
|
||||
@Nullable
|
||||
public static LicenseeInfoProvider getInstance() {
|
||||
public static LicensingFacade getInstance() {
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
public abstract String getLicensedToMessage();
|
||||
public abstract String getLicenseRestrictionsMessage();
|
||||
public abstract List<String> getLicenseRestrictionsMessages();
|
||||
public abstract boolean isEvaluationLicense();
|
||||
|
||||
@Nullable
|
||||
public Date getMaintenanceDueDate(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -17,11 +17,11 @@ package com.intellij.ui;
|
||||
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.wm.impl.content.GraphicsConfig;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class Splash extends JDialog {
|
||||
private final Icon myImage;
|
||||
@@ -56,12 +56,14 @@ public class Splash extends JDialog {
|
||||
UIUtil.applyRenderingHints(g);
|
||||
g.setFont(new Font(UIUtil.ARIAL_FONT_NAME, Font.BOLD, 11));
|
||||
g.setColor(textColor);
|
||||
LicenseeInfoProvider provider = LicenseeInfoProvider.getInstance();
|
||||
LicensingFacade provider = LicensingFacade.getInstance();
|
||||
if (provider != null) {
|
||||
final String licensedToMessage = provider.getLicensedToMessage();
|
||||
final String licenseRestrictionsMessage = provider.getLicenseRestrictionsMessage();
|
||||
final List<String> licenseRestrictionsMessages = provider.getLicenseRestrictionsMessages();
|
||||
g.drawString(licensedToMessage, x + 21, y + height - 49);
|
||||
g.drawString(licenseRestrictionsMessage, x + 21, y + height - 33);
|
||||
if (licenseRestrictionsMessages.size() > 0) {
|
||||
g.drawString(licenseRestrictionsMessages.get(0), x + 21, y + height - 33);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user