JDeveloper supports the integration of other layout managers with its Java Visual Editor. Users will be able to work with the layout manager using both the Java Visual Editor and the Property Inspector when you:
oracle.jdevimpl.uieditor.LayoutAssistant
implementation to be associated with the LayoutManager
java.beans.PropertyEditor
with
the IDE to handle any special constraints type
To Create a Custom Layout Manager Assistant
Each LayoutManager
must be associated with a
LayoutAssistant implementation. The class
oracle.jdevimpl.uieditor.assistant.BasicLayoutAssistant
provides
a minimal implementation of the interface
oracle.jdevimpl.uieditor.LayoutAssistant
and will be used for any
LayoutManager for which no explicit registration has been made. There
are several required methods in the interface, but it is beyond the
scope of this topic to describe them. Integrators may wish to subclass
their LayoutAssistant implementations from this minimal implementation.
Refer to the javadoc for the LayoutAssistant interface for details.
To Register the Layout Assistant
To register the new layout assistant, you need to add a key-value
definition to oracle.jdevimpl.uieditor.UIEditorAddin
section in the JDeveloper\lib\addins.xml
file as follows:
<property>
<key>PREFIX.LAYOUT_MANAGER_CLASS_NAME</key>
<value>LAYOUT_ASSISTANT_CLASS_NAME</value>
</property>
where:
PREFIX
is jdeveloper.uiassistant
LAYOUT_MANAGER_CLASS_NAME
is the fully-qualified
classname of the layout manager for which an assistant is being
registered
LAYOUT_ASSISTANT_CLASS_NAME
is the fully-qualified
classname of the layout manager assistant to register
For example; if you were to register a LayoutAssistant implementation
oracle.jdevimpl.uieditor.assistant.GridBagLayoutAssistant
for the
java.awt.GridBagLayout
layout manager, the property to add would
look like:
<property>
<key>jdeveloper.uiassistant.java.awt.GridBagLayout</key>
<value>oracle.jdevimpl.uieditor.assistant.GridBagLayoutAssistant</value>
</property>
Note that in order for the layout assistant to be available from within
the IDE, so that it will appear in the Property Inspector's layout
property list, the layout assistant must be added to the IDEClasspath as a
directive in JDeveloper\bin\jdev.conf
file. For example:
AddJavaLibFile <myAssistant.jar>
where, myAssistant.jar
contains the compiled class file for
your LayoutAssistant implementation.
To Register a Constraints PropertyEditor For the Layout Manager
If your custom layout manager uses a constraint class, you may want to
register a class implementing java.beans.PropertyEditor
for
editing the constraints. You register the property editor class under
Inspector.PropertyEditor
in the ide.properties
file, where:
Inspector.PropertyEditor.count=#
provides the total
number of property editors that are registered in ide.properties
. You must increment the count for each new property editor you wish to add.
<#>
is the zero-based index, in the list of
registered editors, corresponding to the editor you are registering.
<fully qualified type>
is the fully-qualified type
of the constraints for which a PropertyEditor is being registered.
<Fully qualified class>
is the fully-qualified
classname of the java.beans.PropertyEditor
implementation
being registered for editing instances of the given constraints type.
For example, if you were to register the property editor for the
GridBagLayout layout manager's GridBagConstraints, your entry in the
ide.properties
file would look like:
Inspector.PropertyEditor.count=1
Inspector.PropertyEditor.editor1.type=java.awt.GridBagConstraints
Inspector.PropertyEditor.editor1.editor=oracle.jdevimpl.uieditor.assistant.GridBagConstraintsEditor
Note: Your property editor class also needs to be in the IDEClasspath as described above for the layout manager assistant.
Defining Property Accessors
Creating a Property Editor
Copyright © 1997, 2004, Oracle. All rights reserved.