public final class License extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
License.PluginLicense
Represents the properties of a license which is used to activate a "pay-for" plugin or feature.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addLicenseTypeChangeListener(SimpleListener listener)
Adds a listener to be notified when the license changes.
|
static void |
addWeakLicenseTypeChangeListener(SimpleListener listener)
This method is identical to
addLicenseTypeChangeListener(org.virion.jam.util.SimpleListener)
except that only a WeakReference is
stored to the listener so that it can be garbage collected when nothing else besides this class refers to it. |
static String |
freeVersionName()
Deprecated.
the "free" version of Geneious no longer has a name, features are simply restricted when no license is active. Deprecated in API 4.600 (Geneious 6.0.0)
|
static String |
freeVersionSuffix()
Deprecated.
the "free" version of Geneious no longer has a name, features are simply restricted when no license is active. Deprecated in API 4.600 (Geneious 6.0.0)
|
static boolean |
isCommercialUser()
Checks if the currently active license is for a commercial user of the software.
|
static boolean |
isPluginLicenseActive(GeneiousPlugin plugin,
License.PluginLicense pluginLicense,
boolean promptUser)
Check if a trial or purchased license is active for the given plugin license.
|
static boolean |
isProVersion()
Checks whether Geneious currently has an active license, eg.
|
static String |
premiumVersionName()
Deprecated.
there never was and there will never be a premium version of Geneious. Deprecated in API 4.600 (Geneious 6.0.0)
|
static String |
premiumVersionPrefix()
Deprecated.
there never was and there will never be a premium version of Geneious. Deprecated in API 4.600 (Geneious 6.0.0)
|
static String |
proOnlyButtonName(String name)
Useful for renaming a feature when there is no license active.
|
static String |
proOnlyName(String name)
Useful for renaming a feature when there is no license active.
|
static String |
proVersionName()
Deprecated.
there is no "Pro" version anymore, Geneious is Geneious. Consider using
Geneious.getName() instead. Deprecated in API 4.600 (Geneious 6.0.0) |
static String |
proVersionSuffix()
Deprecated.
there is no "Pro" version anymore, Geneious is Geneious. Consider using
restrictedName(boolean) instead. Deprecated in API 4.600 (Geneious 6.0.0) |
static void |
removeLicenseTypeChangeListener(SimpleListener listener)
Removes a listener added using addLicenseTypeChangeListener()
|
static void |
removeWeakLicenseTypeChangeListener(SimpleListener listener)
Removes a listener added using
addWeakLicenseTypeChangeListener(org.virion.jam.util.SimpleListener) |
static String |
restrictedName(boolean upperCaseR)
The word used to describe Geneious when it doesn't have an active license.
|
public static boolean isProVersion()
addLicenseTypeChangeListener.public static boolean isCommercialUser()
public static boolean isPluginLicenseActive(GeneiousPlugin plugin, License.PluginLicense pluginLicense, boolean promptUser)
GeneiousPlugin.getPluginLicenses()
For example: To make your plugin prompt about requiring a license when it is first installed, add the following code
to your plugins initialize method.plugin - the plugin that is checking. must not be nullpluginLicense - provides details of the license and trial to check. must not be nullpromptUser - if true then the user will be shown a dialog when either no license is presence or only
an expired trial/license is present. No dialog is shown if this is false or a license is active.public static String restrictedName(boolean upperCaseR)
upperCaseR - true if restricted should start with a upper case R, false for lower casepublic static String proVersionSuffix()
restrictedName(boolean) instead. Deprecated in API 4.600 (Geneious 6.0.0)Geneious.getName()
(separated by a space) in order to obtain the name that distinctively identifies
the Pro version of Geneious.public static String freeVersionSuffix()
restrictedName(boolean)public static String freeVersionName()
restrictedName(boolean)public static String proVersionName()
Geneious.getName() instead. Deprecated in API 4.600 (Geneious 6.0.0)public static String premiumVersionPrefix()
public static String premiumVersionName()
public static String proOnlyName(String name)
name - the normal name of the feature, eg. "Cloning"public static String proOnlyButtonName(String name)
proOnlyName(String)name - the normal name of the feature, eg. "Cloning"public static void addLicenseTypeChangeListener(SimpleListener listener)
isProVersion() has changed, so you will still need to query
isProVersion when you are notified that a change has happened.
WARNING: This method should almost never be used as it will likely cause memory leaks. Use addWeakLicenseTypeChangeListener insteadlistener - the listener to be notified when the license type changesremoveLicenseTypeChangeListener(org.virion.jam.util.SimpleListener),
addWeakLicenseTypeChangeListener(org.virion.jam.util.SimpleListener)public static void removeLicenseTypeChangeListener(SimpleListener listener)
listener - listener to removepublic static void removeWeakLicenseTypeChangeListener(SimpleListener listener)
addWeakLicenseTypeChangeListener(org.virion.jam.util.SimpleListener)listener - the listener to be removedpublic static void addWeakLicenseTypeChangeListener(SimpleListener listener)
addLicenseTypeChangeListener(org.virion.jam.util.SimpleListener)
except that only a WeakReference is
stored to the listener so that it can be garbage collected when nothing else besides this class refers to it.listener - listener to add