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 239028

Summary: Default name of new Gruntfile should be Gruntfile
Product: platform Reporter: Vladimir Riha <vriha>
Component: Data SystemsAssignee: Jaroslav Havlin <jhavlin>
Status: VERIFIED FIXED    
Severity: normal CC: apireviews, jbecicka, kganfield, mentlicher, mkleint, tmysik
Priority: P3 Keywords: API_REVIEW_FAST
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed Patch - Data Systems - API change
Proposed Patch - Project UI
Proposed Patch - Web Client Project
Suggested patch for openide.loaders and projectui
Fix for html5 project is would be really easy
Proposed Patch - Data Systems - API change

Description Vladimir Riha 2013-12-01 20:11:47 UTC
Since "Gruntfile.js" is recognized as Important file, the New File wizard for Gruntfile should have this name prefilled (now it is newGruntfile, should be just Gruntfile) so if user finishes wizard with default values, this new file is placed into Important files.


Product Version: NetBeans IDE Dev (Build 201312010002)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Jan Becicka 2013-12-02 08:44:41 UTC
unfortunately I have no idea how to force the wizard to use name "gruntfile.js"
Comment 2 Jan Becicka 2013-12-03 12:58:18 UTC
Reassigning for evaluation:
I need to create gruntfile.js from template. Default name must be "Gruntfile.js", but the wizard adds prefix "new" to default name. How can I force the wizard not to add "new" prefix to the name?
Comment 3 Vladimir Riha 2013-12-03 13:04:34 UTC
New file wizard for Karma has "custom" new file name, have a look at [1] maybe something similar could be done for Grunt?

[1] /javascript.karma/src/org/netbeans/modules/javascript/karma/ui/wizard/NewKarmaConfWizardIterator.java
Comment 4 Jan Becicka 2013-12-03 13:13:07 UTC
(In reply to Vladimir Riha from comment #3)
> New file wizard for Karma has "custom" new file name, have a look at [1]
> maybe something similar could be done for Grunt?
> 
> [1]
> /javascript.karma/src/org/netbeans/modules/javascript/karma/ui/wizard/
> NewKarmaConfWizardIterator.java

I really don't want to create full wizarditerator just to change default name...
Comment 5 Martin Entlicher 2014-01-17 13:26:43 UTC
The new prefix is added by projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java in initValues() method.

org.openide.loaders.TemplateWizard has a targetName property, but it it's used as a container, without any initialization. Perhaps, in TemplateWizard.setTemplateImpl(), the targetName property could be initialized according to some obj's primary file attribute? E.g. "targetName".

Moving to openide.loaders for evaluation/implementation.

If it's fixed, this patch is necessary in SimpleTargetChooserPanelGUI to respect the documentName:
http://hg.netbeans.org/core-main/rev/47665cd22e40
Comment 6 Quality Engineering 2014-01-18 04:51:14 UTC
Integrated into 'main-silver', will be available in build *201401180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/47665cd22e40
User: mentlicher@netbeans.org
Log: #239028: Respect the original documentName, if provided.
Comment 7 Jaroslav Havlin 2014-01-21 12:31:04 UTC
Created attachment 144197 [details]
Proposed Patch - Data Systems - API change
Comment 8 Jaroslav Havlin 2014-01-21 12:31:38 UTC
Created attachment 144198 [details]
Proposed Patch - Project UI
Comment 9 Jaroslav Havlin 2014-01-21 12:32:23 UTC
Created attachment 144199 [details]
Proposed Patch - Web Client Project
Comment 10 Jaroslav Havlin 2014-01-21 12:50:45 UTC
Please review this API change in module Datasystems API (openide.loaders) (attachment 144197 [details]):

New attribute "targetName" in annotation o.n.api.templates.TemplateRegistration.


Miloš, please check proposed changes in module projectui (attachment 144198 [details]).
Tomáš, please review the patch for module web.clientproject (attachment 144199 [details]).

Thank you.
Comment 11 Jan Becicka 2014-01-21 12:54:03 UTC
Created attachment 144201 [details]
Suggested patch for openide.loaders and projectui
Comment 12 Jan Becicka 2014-01-21 12:55:36 UTC
Created attachment 144202 [details]
Fix for html5 project is would be really easy
Comment 13 Jan Becicka 2014-01-21 13:07:16 UTC
Jardo - we did the same patch independently of each other :)
Please ignore my 2 patches.
Comment 14 Tomas Mysik 2014-01-21 13:37:10 UTC
The patch seems fine to me. Thanks a lot for it!
Comment 15 Jaroslav Havlin 2014-01-21 14:09:11 UTC
Created attachment 144207 [details]
Proposed Patch - Data Systems - API change

> Jardo - we did the same patch independently of each other :)
Good timing :-)
Thank you very much for the patches.
Martin has noticed that you use bundleValue for the new attribute in TemplateProcessor in your patch, which can be quite useful. So I'm borrowing this idea.
Comment 16 Jaroslav Havlin 2014-01-28 07:27:59 UTC
If there are no objections, I'll integrate the patch tomorrow.
Thank you for reviewing.
Comment 17 Jaroslav Havlin 2014-01-29 15:27:21 UTC
Integrated as http://hg.netbeans.org/core-main/rev/ca43ab0ff568
Thank you for reporting and help.
Comment 18 Quality Engineering 2014-01-31 02:40:04 UTC
Integrated into 'main-silver', will be available in build *201401310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ca43ab0ff568
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #239028: Default name of new Gruntfile should be Gruntfile
Comment 19 Vladimir Riha 2014-01-31 08:12:04 UTC
Thank you, verified

Product Version: NetBeans IDE Dev (Build 201401310001)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b66
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b125
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)