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 194729 - New Action wiz gives error if icon already present in source package
Summary: New Action wiz gives error if icon already present in source package
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 7.0
Hardware: All All
: P4 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 12:00 UTC by rov63rus
Modified: 2012-12-12 08:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example (53.93 KB, image/png)
2011-01-26 12:05 UTC, rov63rus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rov63rus 2011-01-26 12:00:52 UTC
Product Version = NetBeans IDE 7.0 Beta (Build 201011152355)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_23
Runtime = Java HotSpot(TM) Client VM 19.0-b09

I can't add new Action via wizard if a choose icon file that already exists in source code. 
May be we should add smart check if file already exists just use it.
Comment 1 rov63rus 2011-01-26 12:05:08 UTC
Created attachment 105364 [details]
Example
Comment 2 Jesse Glick 2011-01-27 13:29:21 UTC
It could probably check to see if the existing icon exactly matches the proposed new one, and if so silently skip copying it. But there is a simple workaround: do not specify any icon in the wizard, and copy the iconBase attr from the existing action.

Anyway I expect this to be a rare issue, since UI best practices would forbid multiple actions from using the same icon. (If you just copied the icon into the source package first, and then selected it in that location, the wizard already knows to not copy it onto itself. So this situation would only arise if you placed the icon in the source package earlier, perhaps by making an earlier action, and then ran the wizard but selected the icon in its original external location.)
Comment 3 Martin Kozeny 2012-12-11 16:21:44 UTC
NetBeans now checks whether name of file selected by user matches to some file in actual package. If does, then displays warning and after process of wizard completion replaces file in project package by user's selected file.
Comment 4 Quality Engineering 2012-12-12 02:48:35 UTC
Integrated into 'main-golden', will be available in build *201212120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0f2a89c21956
User: Martin Kozeny <mkozeny@netbeans.org>
Log: #194729: NetBeans now checks whether name of file selected by user matches to some file in actual package. If does, then displays warning and after process of wizard completion replaces file in project package by user's selected file.