|
Oxygen XML Editor 14.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@API(type=EXTENDABLE, src=PUBLIC) public interface InplaceRenderer
An author in-place renderer. Subclasses contain implementation based on real SWT or Swing components like combo boxes, text fields, check boxes, buttons etc.
A renderer is associated with an oxy_editor CSS function and it's the instance
that handles the painting of the value that the InplaceEditor
will edit.
It is recommended to extend the adapter class InplaceEditorRendererAdapter
or InplaceRendererAdapter
in order to be protected from future API additions.
A renderer of a certain type will be reused to render in different contexts so the
renderer must initialize itself for the given AuthorInplaceContext
on
each of its called methods.
Example: For the following CSS, the same combo renderer (same instance) will be used for both
attributes. So for each callback it must prepare itself for the current context.
code { content: "Attr1: " oxy_editor(type, combo, edit, '@attr1') "Attr2: " oxy_editor(type, combo, edit, '@attr2') }
For a custom implementation property InplaceEditorCSSConstants.PROPERTY_RENDERER_CLASS_NAME
must be used. The same implementation will be used in Standalone or Eclipse plugin
environment:
myElement { content: oxy_editor( rendererClassName, "com.custom.editors.CustomRenderer", swingEditorClassName, "com.custom.editors.SwingCustomEditor", swtEditorClassName, "com.custom.editors.SwtCustomEditor", edit, "@my_attr" customProperty1, "customValue1", customProperty2, "customValue2" ) }In the previous example, the renderer class com.custom.editors.CustomRenderer must be added in the Classpath of the document type associated with the edited document.
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
SimpleURLChooserEditor
Method Summary | |
---|---|
CursorType |
getCursorType(AuthorInplaceContext context,
int x,
int y)
Get a cursor to be used when the user hovers with the mouse over this renderer. |
CursorType |
getCursorType(int x,
int y)
Get a cursor to be used when the user hovers with the mouse over this renderer. |
java.lang.Object |
getRendererComponent(AuthorInplaceContext context)
Initialize the renderer with the given context and returns the component. |
RendererLayoutInfo |
getRenderingInfo(AuthorInplaceContext context)
Returns the rendering layout info. |
java.lang.String |
getTooltipText(AuthorInplaceContext context,
int x,
int y)
Gets a tooltip text to be presented when the cursor is over this renderer. |
Methods inherited from interface ro.sync.ecss.extensions.api.Extension |
---|
getDescription |
Method Detail |
---|
java.lang.Object getRendererComponent(AuthorInplaceContext context)
context
- The editing context.
CursorType getCursorType(AuthorInplaceContext context, int x, int y)
context
- The editing context. Useful if the renderer is a more complex one,
like a text field with an associated button and wants to provide different
cursors when the cursor is over the textfield or over the button. In this case
the renderer will have to initialize itself with this context in order to
decide what the cursor is hovering.x
- The x coordinate relative to the renderer bounds.y
- The y coordinate relative to the renderer bounds.
null
to let the viewport decide.CursorType getCursorType(int x, int y)
getCursorType(AuthorInplaceContext, int, int)
as
you can use the provided context to get additional information.
x
- The x coordinate relative to the renderer bounds.y
- The y coordinate relative to the renderer bounds.
null
to let the viewport decide.java.lang.String getTooltipText(AuthorInplaceContext context, int x, int y)
context
- The editing context.x
- The x coordinate relative to the renderer bounds.y
- The y coordinate relative to the renderer bounds.
null
if no tooltip.RendererLayoutInfo getRenderingInfo(AuthorInplaceContext context)
context
- The editing context.
|
Oxygen XML Editor 14.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |