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 208432 - Several NB New File dialogs get distorted and show no useful error message when file name is long and multi-line
Summary: Several NB New File dialogs get distorted and show no useful error message wh...
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-15 03:42 UTC by Masaki Katakai
Modified: 2012-02-15 18:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Distorted dialog contents (56.17 KB, image/png)
2012-02-15 17:33 UTC, Petr Somol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2012-02-15 03:42:25 UTC
Please take a look at the screenshot. This was reported from
a community people in Japna.

http://twitter.com/kuwasa/status/169428732895965184/photo/1/large

The layout of new file dialog for JavaScript file is broken.
It was caused by:

1. Try to create a JavaScript file
2. Tried to type new file name but pasted contents of
   JavaScript file to File Name field

This was caused by operation mistake however I think
NetBeans should handle it properly. In this case,

- UI layout should not be broken
- should display possible error and warnings

Please evaluate.
Comment 1 Petr Somol 2012-02-15 09:28:41 UTC
I have checked that the problem appears in many different New File dialogs. When a long multi-line text is entered as new file name, the faulty dialogs try to display a warning message that includes the faulty file name - potentially resulting in dialog contents messed up. The correct behavior is to just show a warning message not containing the file name, as is the case with most of the common dialogs like New Java Class etc.

So far I confirm the problem in the following New File dialogs:

in Persistence Category
- Database Schema

in Hibernate Category
- Hibernate Configuration Wizard
- Hibernate Mapping Wizard
- Hibernate Reverse Engineering Wizard

in XML Category
- all file types except JAXB Binding

in Other Category
- all file types

Because of the wider proliferation of the bug I also renamed this bugzilla issue.

Question to QA: should we split this to as many separate issues as are the modules affected ?
Comment 2 Jesse Glick 2012-02-15 16:59:28 UTC
I tried to reproduce in the case of the JavaScript wizard and could not. The error message "The filename ....." appeared on one line and the wizard layout was fine. JDK 7u2, Ubuntu, Ocean L&F. Text was several lines copied out of a license header. Same for other wizards. When copying an entire Java source file and using as the name for an XML file, the error displayed across four lines in the wizard but the result was still otherwise laid out normally. It seems that the only way to reproduce is to paste in HTML text - apparently this is not being escaped properly.
Comment 3 Jesse Glick 2012-02-15 17:13:15 UTC
core-main #9aca774343e2
Comment 4 Petr Somol 2012-02-15 17:33:41 UTC
Created attachment 115777 [details]
Distorted dialog contents

Adding the illustration that I forgot to attach to Comment 1. This resulted from inserting the contents of build-impl.xml as the new file name. JDK 7u1, Win7.
Comment 5 Jesse Glick 2012-02-15 18:01:04 UTC
That kind of thing should be fixed.