Oxygen Form Controls Alignment Issues

Oxygen general issues.
asynchronousDev
Posts: 7
Joined: Fri Jul 12, 2013 8:54 pm

Oxygen Form Controls Alignment Issues

Post by asynchronousDev »

There seems to be some inconsistencies with the way Oxygen Editor lays out its form controls.

This is a screenshot of how it is rendered. Here you can see that the baseline location of the text would be "author:". The custom form is significantly above the baseline and the button is below the baseline.

Image


This is the CSS we are using to create the form controls:

Code: Select all

author:before {
margin-left: 2em;
content: "author: "
}

author {
content: oxy_editor(rendererClassName, "com.test.oxygen.plugin.AuthorRenderer",
swingEditorClassName, "com.test.oxygen.plugin.AuthorRenderer",
classpath, "${oxygenHome}/plugins/TestOxygenPlugin/lib/bwater.jar",
columns, 30);
}

author:after {
content: oxy_editor(type, button,
actionID, "choose_author")
}
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Oxygen Form Controls Alignment Issues

Post by alex_jitianu »

Hello,

The first thing to do would be to check if the custom form control reports a baseline. The InplaceRenderer interface has a method getRenderingInfo(). The returned object, RendererLayoutInfo, has a RendererLayoutInfo.getBaseline(). If this method returns an integer less or equal to 0 then the baseline will be considered the entire height of the control (which will explain the layout you get). To compute a baseline inside your renderer you can delegate to javax.swing.JComponent.getBaseline(int, int).

Best regards,
Alex
Post Reply