Class InstanceSupport
java.lang.Object
org.openide.loaders.InstanceSupport
- All Implemented Interfaces:
org.openide.cookies.InstanceCookie
,org.openide.cookies.InstanceCookie.Of
,org.openide.nodes.Node.Cookie
An instance cookie implementation that works with files or entries.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Trivial supporting instance cookie for already-existing objects.Nested classes/interfaces inherited from interface org.openide.cookies.InstanceCookie
org.openide.cookies.InstanceCookie.Of
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ClassLoader
Creates new NbClassLoader with restricted PermissionCollection that contains only: java.io.FilePermission("<<ALL FILES>>", "read") java.util.PropertyPermission("*", "read")static org.openide.util.HelpCtx
findHelp
(org.openide.cookies.InstanceCookie instance) Deprecated.use org.openide.util.HelpCtx.findHelp (Object)Class
<?> boolean
instanceOf
(Class<?> type) org.openide.filesystems.FileObject
Returns the origin of the instance.boolean
isApplet()
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result.boolean
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result.boolean
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result.boolean
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result.toString()
-
Constructor Details
-
InstanceSupport
New support for given entry. The file is taken from the entry and is updated if the entry moves or renames itself.- Parameters:
entry
- entry to create instance from
-
-
Method Details
-
instanceName
- Specified by:
instanceName
in interfaceorg.openide.cookies.InstanceCookie
-
instanceClass
- Specified by:
instanceClass
in interfaceorg.openide.cookies.InstanceCookie
- Throws:
IOException
ClassNotFoundException
-
instanceOf
- Specified by:
instanceOf
in interfaceorg.openide.cookies.InstanceCookie.Of
-
instanceOrigin
public org.openide.filesystems.FileObject instanceOrigin()Returns the origin of the instance.- Returns:
- the origin
-
instanceCreate
- Specified by:
instanceCreate
in interfaceorg.openide.cookies.InstanceCookie
- Throws:
IOException
ClassNotFoundException
-
isApplet
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result. (Notifying them all would be inappropriate as they typically come from user code.) Better to directly parse the bytecode, using e.g. the classfile module, which is immune to this class of errors.Is this an applet?- Returns:
true
if this class is ajava.applet.Applet
-
isExecutable
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result. (Notifying them all would be inappropriate as they typically come from user code.) Better to directly parse the bytecode, using e.g. the classfile module, which is immune to this class of errors.Is this a standalone executable?- Returns:
true
if this class has main method (e.g.,public static void main (String[] arguments)
).
-
isJavaBean
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result. (Notifying them all would be inappropriate as they typically come from user code.) Better to directly parse the bytecode, using e.g. the classfile module, which is immune to this class of errors.Is this a JavaBean?- Returns:
true
if this class represents JavaBean (is public and has a public default constructor).
-
isInterface
Deprecated.This method probably should not be used, as it catches a variety of potentially serious exceptions and errors, and swallows them so as to produce a simple boolean result. (Notifying them all would be inappropriate as they typically come from user code.) Better to directly parse the bytecode, using e.g. the classfile module, which is immune to this class of errors.Is this an interface?- Returns:
true
if the class is an interface
-
toString
-
findHelp
@Deprecated public static org.openide.util.HelpCtx findHelp(org.openide.cookies.InstanceCookie instance) Deprecated.use org.openide.util.HelpCtx.findHelp (Object)Find context help for some instance. Helper method useful in nodes or data objects that provide an instance cookie; they may choose to supply their own help context based on this. All API classes which can provide help contexts will be tested for (includingHelpCtx
instances themselves).JComponent
s are checked for an attached help ID property, as withHelpCtx.findHelp(java.awt.Component)
(but not traversing parents).Also, partial compliance with the JavaHelp section on JavaBeans help is implemented--i.e., if a Bean in its
BeanInfo
provides aBeanDescriptor
which has the attributehelpID
, this will be returned. The value is not defaulted (because it would usually be nonsense and would mask a useful default help for the instance container), nor is the help set specification checked, since someone should have installed the proper help set anyway, and the APIs cannot add a new reference to a help set automatically. Seejavax.help.HelpUtilities.getIDStringFromBean
for details.Special IDs are added, corresponding to the class name, for all standard visual components.
- Parameters:
instance
- the instance to check for help (it is permissible for theInstanceCookie.instanceCreate()
to returnnull
)- Returns:
- the help context found on the instance or inferred from a Bean,
or
null
if none was found (or it wasHelpCtx.DEFAULT_HELP
)
-
createClassLoader
Creates new NbClassLoader with restricted PermissionCollection that contains only: java.io.FilePermission("<<ALL FILES>>", "read") java.util.PropertyPermission("*", "read")- Returns:
- ClassLoader
-