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 43274

Summary: Cannot return null as a popup menu presenter (NewFile)
Product: projects Reporter: Jaroslav Tulach <jtulach>
Component: Generic Projects UIAssignee: Petr Hrebejk <phrebejk>
Severity: blocker CC: jglick
Priority: P2    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535    

Description Jaroslav Tulach 2004-05-14 13:57:14 UTC
I am not able to create popup menu in
contrib/favourites module for any folder that is
not part of any project. This is caused by NewFile
returning null as getPopupPresenter(). 

I'm going to put there hotfix, but still this
should be fixed soon.
Comment 1 Jaroslav Tulach 2004-05-14 13:58:02 UTC
new revision: 1.8
Comment 2 Jesse Glick 2004-05-14 21:03:37 UTC
Hele Petr, Hacks.hackFolderActions should not exist. We should not be
touching the FolderNode context menu. Wherever in Projects and Files
tabs we are displaying folder nodes, we can add whatever actions we
want using filter nodes. Then this kind of issue would not appear.

On the other hand, o.o.a.NewTemplateAction *should* be deleted from
FolderNode's context menu and replaced by o.o.a.NewAction, with two
NewType's: one to make a new subfolder, one to make a new empty file
with explicit extension. Then we can hide NewAction from the Projects
& Files tabs when we add our special action, but anyone using a plain
folder view (like Favorites) will have this action still.

Comment 3 Jaroslav Tulach 2004-05-17 09:20:05 UTC
First paragraph ok, I am not sure about the second one. It is true
that it would simplify our life in all files tab and favourites tab,
but I am concerned about its possible (negative) effect on platform -
people would not find the templates stuff. That would be imho bad.

Would not it be simpler to hide all "project only" templates from
default NewFromTemplate? 

Another solution to this would be to make the standard NewFromTemplate
"callback action": Each view could register its own callback in
getActionMap() and that callback could do anything.
Comment 4 Jesse Glick 2004-05-17 17:04:51 UTC
Not really concerned about that. Templates are not really appropriate
for the platform anyway, just there historically since that was where
we put the impl. Just having new file/folder would be fine for
platform usage. Anyway we want to kill the old template wizard sooner
or later since the UI is no longer appropriate to anything.
Comment 5 Petr Hrebejk 2004-05-24 09:28:26 UTC
Implemented in the NewFile action in projects. Feel free to move it
into projects if you like it.