brad foster created NETBEANS-6471:
-------------------------------------
Summary: Border Customizer / border properties and auto-generated
code missing
Key: NETBEANS-6471
URL: https://issues.apache.org/jira/browse/NETBEANS-6471
Project: NetBeans
Issue Type: Bug
Components: guibuilder - Code, platform - Property Editors
Affects Versions: 12.6, 11.2
Reporter: brad foster
This might be a combination of several issues, I'm not sure.
Ever since switching from a 'last known working' NB version 5 or 7 to 11.2,
opening, editing and compiling some existing UI projects, there are some weird
effects.
The project setup is 'unconventional'; the UI is created with NB in a different
workspace from the business code (where Eclipse is used) and the compiled
project/JAR's are then imported there. In turn, some UI extension code is
developed and imported from the Eclipse workspace, e. g. a class 'LabelBorder'
(which inherits from class 'TitledBorder', only rendering the upper titled
border as a visual divider) and provided to the NB project as a JAR.
_Don't ask why._
One of the detrimental effects is, that border label's title/name values are
lost from PanelUI components inside a GridBagLayout on a parent JPanel, in the
compiled version from NB.
For some such visual 'LabelBorder' divider sub-components, the '{*}border{*}'
attribute in the properties view is printed bold. For those, the {{Border
Customizer}} via [...] correctly shows a reall {{[?] LabelBorder}} entry for
the imported component and all of its properties.
Here, the auto-generated {{.form}} code from the Parent component using those
PanelUI components also shows generated property code for the LabelBorder
components:
{code:java}
<Properties>
<Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors3.BorderEditor">
<PropertyBean type="my.ui.components.LabelBorder">
<Property name="title" type="java.lang.String" value="Section 3"/>
</PropertyBean>
</Property>
</Properties> {code}
For other, obviously completely similar sub-components it does not. The
{{Border Customizer}} will show {{[?] Unknown Border (Label Border)}} instead
and {{<no properties>}} (also, in the properties view, the 'border' attribute
is not printed bold), even though everything's in the same package hierarchy
level.
I cannot spot any difference in the component's properties, that give me any
clue why this is.
The {{Code Customizer}} will only show generated code entries for the 'good'
examples like this:
{code:java}
my.ui.components.LabelBorder labelBorder1 = new my.ui.components.LabelBorder();
zuzug.setBorder(labelBorder1); {code}
What's obviously missing here, though, is:
{code:java}
labelBorder1.setTitle("Section1"); {code}
This might explain, why the compiled version looses the label texts.
Manually fiddling with {{Customize Code}} and adding correct code for the
borked {{LabelBorder}} components, like above, will not show any different
results, not even with full clean/build.
Also, custom code can only be added '{{{}pre-init{}}}', not as '{{{}default
code{}}}'.
In NB 12.6, another effect shows for the 'borked' {{LabelBorder}} components,
where printed the title font size is a little larger in the {{Preview Design}}
view, than it is for the 'good' examples - there, the default font size from
the super component {{TitledBorder}} is used.
The only workaround to preserve title properties seems to be manually editing:
_properties -> [...] -> border/LabelBorder -> title [...] -> Plain text -> OK_
This step must be done before editing anything else, otherwise, the previous
title value is gone and needs to be manually typed in the 'Plain text' field
again.
Closing and re-opening the editor will require to repeat this procedure.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists