This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 52179 - Set title of TitleBorder via ResourceBundle
Summary: Set title of TitleBorder via ResourceBundle
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 4.x
Hardware: PC All
: P4 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
: 55086 56575 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-08 08:30 UTC by webhsw
Modified: 2009-11-02 10:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
SWF video (759.57 KB, application/octet-stream)
2004-12-08 11:19 UTC, webhsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description webhsw 2004-12-08 08:30:47 UTC
It is not possible do set the Title of a
TitleBorder  via the ResourceBundle support in the
property inspector.
Comment 1 Jan Stola 2004-12-08 09:17:38 UTC
Please, specify exactly what doesn't work.
The title of TitleBorder can be specified using ResourceBundle support:
1. Select the component that has this border assigned.
2. Go to Properties window and press the '...' button next to the border
   property -> border property editor is shown.
3. In the Properties section of the property editor press the '...'
   button next to the title property -> string property editor is shown.
4. Select 'Resource Bundle' in the Select Mode combobox and specify
   the information about the location of the resource bundle, key etc.
Comment 2 webhsw 2004-12-08 11:19:30 UTC
Created attachment 19201 [details]
SWF video
Comment 3 webhsw 2004-12-08 11:22:44 UTC
Hi Jan,
take a look at the attached video to see how it works (not).
Heiko Wenzel
Comment 4 Jan Stola 2004-12-14 15:46:53 UTC
Great video! Thank you. Finally I was able to reproduce this issue.
The problem seems to be in the property sheet - it calls
propertyEditor.setValue() when the property sheet is repainted:

at PropUtils:924
at PropUtils:866
at ReusablePropertyModel:64
at RendererFactory:196
at RendererFactory:115
at SheetCellRenderer:111

"TitledBorder" dialog in the attached example hides the property
sheet. When this dialog is closed then the property sheet is
repainted and incorrect (old) value is set to border property
editor => no border is set when "jPanel2 [JPanel] - border" dialog
is closed.

Reassigning to property sheet.

Note that this problem occurs for all custom editors, for example:
1. Open properties of java method.
2. Open modifiers custom editor.
3. (Un)check some checkboxes in the modifiers dialog.
4. Force repaint of the property sheet (e.g. move the modifiers
   dialog over the property sheet and back).
5. Note that the changes in the modifiers dialog has been reseted.
Comment 5 Martin Krauskopf 2004-12-14 17:19:48 UTC
Thanks for nice analysis and straightforward steps to reprodue.
Lowering priority to P2. It is IMO happening only in very rare cases -
on specifically positioned PS and mainly on low screensize resolutions
(this is probably reason why it hasn't been discovered until now. As a
workaround you can make PS narrower in a way that property editor and
following dialog(s) don't overlap the underlaying property sheet (the
base one - under the explorer on your video).
Comment 6 Martin Krauskopf 2005-01-17 08:38:13 UTC
Fixed in trunk

Checking in
openide/src/org/openide/explorer/propertysheet/CustomEditorAction.java;
/cvs/openide/src/org/openide/explorer/propertysheet/CustomEditorAction.java,v
 <--  CustomEditorAction.java
new revision: 1.13; previous revision: 1.12
done
Checking in openide/src/org/openide/explorer/propertysheet/PropUtils.java;
/cvs/openide/src/org/openide/explorer/propertysheet/PropUtils.java,v 
<--  PropUtils.java
new revision: 1.46; previous revision: 1.45
done
Comment 7 Jan Stola 2005-03-10 16:58:20 UTC
*** Issue 55086 has been marked as a duplicate of this issue. ***
Comment 8 Jan Stola 2005-03-17 09:28:20 UTC
*** Issue 56575 has been marked as a duplicate of this issue. ***
Comment 9 jwiles 2005-03-17 17:29:46 UTC
jwiles from DUPLICATE issue 56575. Maybe this should be listed as a new issue
because this occured under NB 4.1 beta this time (JRE 1.4.2_07)?  I tried to add
a JPanel to a JSplitPane and edit the properties of the JPanel with the
following results:

Attempt #1
1. click on "..." button of "border" property on the property sheet -> get the
Border Editor property sheet.
2. select "TitledBorder" in the Border Editor -> properties for TitledBorder
show in lower half of sheet, however "Border" property still indicates (No
Border); should probably indicate TitledBorder.
3. click on "..." button of the "Border" property Border Editor -> get another
Border Editor property sheet with "Border" property still indicating "(No
Border)" -> weird
4. close latest Border Editor property sheet to see original Border Editor with
correct Border property -> weirder.
5. add a string to the "Title" property -> "Title" property is bolded
6. click on "..." button of the "Font" property and select Arial 11 Bold ->
"Font" property is bolded
7. click on "OK" button at the bottom of the Border Editor -> JPanel reverts
back to default settings with (No Border) and Tahoma 11 Plain font -> lame

Attempt #2
1. click on "..." button of "border" property on the property sheet -> get the
Border Editor property sheet.
2. select "TitledBorder" in the Border Editor -> properties for TitledBorder
show in lower half of sheet, however "Border" still indicates (No Border)
3. ignore the incorrect "Border" setting and add a string to the "Title"
property -> "Title" property is bolded
4. click on "..." button of the "Font" property and select Arial 11 Bold ->
"Font" property is bolded
5. click on "OK" button at the bottom of the Border Editor -> JPanel is properly
formatted!

While I finally got the JPanel I wanted, it wasn't the most intuitive path. 
First, the Border property of the Border Editor should have had the setting that
the that I originally selected, "TitledBorder".  Second, maybe don't have the
"..." button next to the Border property in the Border Editor, because clicking
on this brings up yet another Border Editor, and nothing can go right from
there.  I imagine that among the multiple Border Editor instances, the settings
get lost along the way, which is why my first attempt didn't work.  Perhaps have
the Border property depend on the selection in the upper portion of the Border
Editor and update the fields as necessary?  By the way, I opened up the Border
Editor on a JPanel that has already been formatted and the only setting that did
not match was the Border property (listed as No Border).
Comment 10 jwiles 2005-03-17 19:39:47 UTC
work-around for 4.0: I found that if I changed the font first and added the
title string last (selecting <enter> after the string was set), the TitledBorder
settings took.  -> Some weird focus stuff going on?
Comment 11 Martin Krauskopf 2005-03-18 10:10:06 UTC
Really strange bug. Anyway thanks for detailed steps for reproduction.

> 2. select "TitledBorder" in the Border Editor -> properties for
> TitledBorder show in lower half of sheet, however "Border" property
> still indicates (No Border); should probably indicate TitledBorder.

This is bug in repainting mechanism of PropertySheet. When you move
(border) property editor over the main property sheet and back the
value gets correctly repainted. There is similar issue already filled.

It seems it is all entangled together. The original property sheet
probably didn't take into account such a theoretically endless
overlapping of property sheets.

> 7. click on "OK" button at the bottom of the Border Editor -> JPanel
> reverts back to default settings with (No Border) and Tahoma 11
> Plain font -> lame

However I'm able to reproduce this *only* if I force to repaint, at
least once, the main property sheet (which is swiching between
NetBeans and other applications or by moving border property editor
over the main property sheet), which is not so common. Is the same
apply to you? (latest dev build however)

....started....
Comment 12 Martin Krauskopf 2005-03-23 13:11:22 UTC
I've just tried it with the latest build on the Windows as well as Linux. The
main problem gone and the steps you described works correctly. At least the last
(main) step sets border as it shall. The better behaviour is due to some fixes
since beta.
However the repainting problem still remains and in an extreme situation the
problem can still be reproduced. So lowering to P3. Maybe this issue should be
divided into two smaller issue....

Current steps to reproduce:
To reproduce you *must* move the second property sheet (first title border
editor) which probably nobody does. Moreover only if you recursively popup
second *title*border editor (third property sheet) and close/cancel it. I know
where the problem approximately is but still don't have reasonable fix.
Comment 13 _ tboudreau 2005-03-28 13:23:56 UTC
Possibly find the Node.Property in question and make sure it does *not* cache its property editor?  Or 
make sure it does?

What I suspect is happening here is:  One property sheet has a modified value being edited.  The other 
property sheet shows the same value.  So, when the second property sheet repaints, it's calling 
property.getPropertyEditor().setValue(property.getValue()) - clobbering the edit in progress.

Anyway, this is a real corner case, probably P4
Comment 14 Martin Krauskopf 2005-04-04 03:41:38 UTC
Not for 4.1. TM > future
Comment 15 Martin Krauskopf 2005-04-05 13:03:37 UTC
HR started. TM > 4.2
However main problems of this issue are fixed in 4.1 and even reproducing of the
issue is not so easy now > P4
Comment 16 Stanislav Aubrecht 2008-11-21 09:17:29 UTC
a lot of changes in property editors/sheet needed for this fix
Comment 17 Quality Engineering 2009-11-02 10:58:07 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX