@API(type=EXTENDABLE, src=PUBLIC) public interface InplaceRenderer extends Extension
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.
SimpleURLChooserEditor
Modifier and Type | Method and Description |
---|---|
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.
|
getDescription
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.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.