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 27135 - Doubleclick on a template brings up New from Template Wizard
Summary: Doubleclick on a template brings up New from Template Wizard
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2002-09-09 16:31 UTC by Svata Dedic
Modified: 2008-12-23 11:26 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2002-09-09 16:31:01 UTC
Double click on the template file done from the
Tools | Options | Source Creation and Management
should _open_ the template rather than trying to
create a new file based on that template.
Comment 1 Svata Dedic 2002-09-09 16:31:45 UTC
Actually, all templates behave like this, so it is probably a core
issue rather than java-specific one.
Comment 2 Marian Mirilovic 2002-09-09 16:43:56 UTC
Dafe, I am not sure you are responsible, feel free to reassigne.

This behaviour is there long time (3.3, ... ). Each template has
action Open - that open template file in Source Editor, but default
action for these nodes is "Create new".
Comment 3 Marian Mirilovic 2002-10-11 14:29:08 UTC
OS/Platform independent issue.
Comment 4 Marian Mirilovic 2003-01-06 11:03:00 UTC
I have changed version from 4.0 dev to S1S 4.2 (Nevada).
Comment 5 Jesse Glick 2003-01-08 15:41:45 UTC
The current behavior is intentional; see DataNode.getDefaultAction.
TBD whether it is *desirable* of course. I also tend to find it annoying.
Comment 6 David Strupl 2003-02-23 22:13:46 UTC
Jesse, should the default action be changed? If found 
annoying ...
Comment 7 Jesse Glick 2003-02-23 23:27:40 UTC
Well, it has been the way it is since long ago, as far as I know.
Personally I don't like it. May be good to ask the opinion of someone
from HIE.
Comment 8 David Konecny 2003-02-24 11:06:55 UTC
Jano, could you look at it please and let us know what should be the
default (if any)? I'm going to help David S with this issue.
Comment 9 jrojcek 2003-02-25 14:02:06 UTC
No action should be the default on a template node.

By the way what is the name of the current default action which
invokes the wizard. I can't find the action in the contextual menu of
a template.
Comment 10 David Konecny 2003-02-25 14:38:15 UTC
Thanx. The default action is o.o.a.InstantiateAction and it is not
shown in the popup menu. I'm going to remove it.
Comment 11 Jesse Glick 2003-02-25 15:07:22 UTC
Could probably @deprecate InstantiateAction.java, too. The action
situation re. NewAction, NewTemplateAction (&
NewTemplateCallableAction?), and InstantiateAction is confusing enough
for someone reading the API docs that it may be helpful to deprecate
some just to reduce the number of choices of what to look at! :-)
Comment 12 David Konecny 2003-02-25 15:59:36 UTC
The issue can be easily fixed by modifing DataNode.getDefaultAction to
return null in case the DO is template. But JavaDoc for this methods
says that *it will* return InstanceAction when DO is template, so from
this point of view it is API contract which I will break? Or UI API
contract? :-)

I agree with Jesse. I will deprecate the InstantiateAction action. I
grepped the sources and it is not used anywhere (it is in
html/HtmlDataNode and in properties/FileEntryNode, but it is
copy&paste from DataNode). The behaviour of DataNode will be
incompatibly changed and documented.

What should I recommend as replacement (just for the sake of properly
documented deprecation)?
1.) write your own action which calls TemplateWizard.instantiate(yourDO)
2.) use NewTemplateAction (it is not 100% replacement, but something
very similar to InstantiateAction)

OK?
Comment 13 Jesse Glick 2003-02-25 16:26:31 UTC
IMHO - (1) I guess it is an API change, but not one to worry about;
Javadoc should have said e.g. "In the current implementation..." but
it did not, that is probably my mistake long ago. :-) (2) No need for
any suggested replacement in the @deprecated message I think - just
say that it should be avoided.
Comment 14 David Konecny 2003-02-27 14:34:24 UTC
Implemented in files:

Checking in openide/openide-spec-vers.properties;
new revision: 1.107; previous revision: 1.106
Checking in openide/api/doc/changes/apichanges.xml;
new revision: 1.144; previous revision: 1.143
Checking in openide/src/org/openide/actions/InstantiateAction.java;
new revision: 1.30; previous revision: 1.29
Checking in openide/src/org/openide/loaders/DataNode.java;
new revision: 1.78; previous revision: 1.77
Checking in html/src/org/netbeans/modules/html/HtmlDataNode.java;
new revision: 1.6; previous revision: 1.5
Checking in
properties/src/org/netbeans/modules/properties/FileEntryNode.java
new revision: 1.16; previous revision: 1.15
Comment 15 pzajac 2003-03-26 08:16:09 UTC
verifed in 20030325350