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 - Cannot return null as a popup menu presenter (NewFile)
Summary: Cannot return null as a popup menu presenter (NewFile)
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords:
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-05-14 13:57 UTC by Jaroslav Tulach
Modified: 2004-08-13 12:11 UTC (History)
1 user (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 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
projects/projectui/src/org/netbeans/modules/project/ui/actions/NewFile.java,v
 <--  NewFile.java
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.

Agreed?
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.