Package com.jidesoft.utils
Class SecurityUtils
- java.lang.Object
-
- com.jidesoft.utils.SecurityUtils
-
public class SecurityUtils extends java.lang.Object
A class that keeps all the security stuff so that an application can safely run in applet or webstart environment. Please refer to JIDE_Developer_Guide_for_Webstart_Applet.pdf in doc folder for more information.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BOLD
static java.lang.String
BOLD_ITALIC
static java.lang.String
ITALIC
-
Constructor Summary
Constructors Constructor Description SecurityUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Font
createFont(java.lang.String name, int style, int size)
Creates font.static javax.swing.plaf.FontUIResource
createFontUIResource(java.lang.String name, int style, int size)
static java.lang.String
getProperty(java.lang.String key, java.lang.String defaultValue)
Gets the system property.static boolean
isAWTEventListenerDisabled()
Checks if AWTEventListener is disabled.static boolean
isTranslucentWindowFeatureDisabled()
Checks if the translucent window feature is disabled.static void
setAWTEventListenerDisabled(boolean AWTEventListenerDisabled)
Enables or disables the usage of AWTEventListener.static void
setTranslucentWindowFeatureDisabled(boolean translucentWindowFeatureDisabled)
Disables or enables the usage of the translucent window feature available since JDK6u10.
-
-
-
Field Detail
-
BOLD
public static final java.lang.String BOLD
- See Also:
- Constant Field Values
-
ITALIC
public static final java.lang.String ITALIC
- See Also:
- Constant Field Values
-
BOLD_ITALIC
public static final java.lang.String BOLD_ITALIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
createFontUIResource
public static javax.swing.plaf.FontUIResource createFontUIResource(java.lang.String name, int style, int size)
-
createFont
public static java.awt.Font createFont(java.lang.String name, int style, int size)
Creates font. If there is no permission to access font file, it will try to create the font directly from font file that is bundled as part of jar.- Parameters:
name
- the font name.style
- the font style.size
- the font size.- Returns:
- the font.
-
getProperty
public static java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
Gets the system property.- Parameters:
key
- the property keydefaultValue
- the default value for the property.- Returns:
- the system property.
-
isAWTEventListenerDisabled
public static boolean isAWTEventListenerDisabled()
Checks if AWTEventListener is disabled. This flag can be set by user. If false, JIDE code will read the value and not use AWTEventListener. The reason we need this flag is because AWTEventListener needs a special security permission. If applet, it will throw security if the user policy doesn't have the correct permission.- Returns:
- true if AWTEventListener is disabled.
-
setAWTEventListenerDisabled
public static void setAWTEventListenerDisabled(boolean AWTEventListenerDisabled)
Enables or disables the usage of AWTEventListener. If you want to change it, you should change the value at the beginning of your main method.- Parameters:
AWTEventListenerDisabled
- true or false.
-
isTranslucentWindowFeatureDisabled
public static boolean isTranslucentWindowFeatureDisabled()
Checks if the translucent window feature is disabled. It is disabled by default if the JDK version is less than JDK6 u10 or theOS is not Windows.- Returns:
- true or false.
-
setTranslucentWindowFeatureDisabled
public static void setTranslucentWindowFeatureDisabled(boolean translucentWindowFeatureDisabled)
Disables or enables the usage of the translucent window feature available since JDK6u10. This feature is used in Alert for fading animation.- Parameters:
translucentWindowFeatureDisabled
- true or false.
-
-