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 44331 - Favorites tab should always permit creation of empty files (was: Empty file should not be defined in any project module)
Summary: Favorites tab should always permit creation of empty files (was: Empty file s...
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Favorites (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: jrojcek
URL:
Keywords:
Depends on:
Blocks: 40703
  Show dependency tree
 
Reported: 2004-06-04 08:24 UTC by Jaroslav Tulach
Modified: 2008-12-22 15:43 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Demo patch (3.32 KB, patch)
2004-06-04 08:29 UTC, Jaroslav Tulach
Details | Diff
Patch that moves the emptyfile from projectui to favorites (please also copy newFile.gif from projectui) (6.69 KB, patch)
2004-06-08 10:47 UTC, Jaroslav Tulach
Details | Diff
Patch for "Templates/Other" localization (1.39 KB, patch)
2004-06-10 10:02 UTC, Miloslav Metelka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2004-06-04 08:24:04 UTC
Associating simple files like empty text file with
projects does not seem to make any sence. They are
project independent, can be used outside of
project and will work with or without modified
project template wizard. 

That is why simple files should be moved into a
module(s) independent on projects.
Comment 1 Jaroslav Tulach 2004-06-04 08:28:45 UTC
I'm going to attach a small demonstration that makes the text template
in text module behave exactly as the project's own "empty file". This
was achieved by renaming the template from text.txt to text and
deleting the special template iterator. 

Btw. I've also disabled the loader and convert actions, just to make
sure that the behaviour is really same as project's empty file even
after creation.
Comment 2 Jaroslav Tulach 2004-06-04 08:29:28 UTC
Created attachment 15468 [details]
Demo patch
Comment 3 _ ttran 2004-06-04 08:53:11 UTC
i have no doubt that it's possible to move some piece of funtionality
from one module to another. Say from projects to text.

But what is the motivation of doing so?
Comment 4 Jaroslav Tulach 2004-06-04 09:49:29 UTC
Except sanity, as it seems logical to have functionality not depending
on some complex IDE concept like project defined independenty of them,
the basic motivation is modularity. 

We are trying hard to give the NetBeans adopters a chance to assemble
their applications. Hardcoding unrelated functionalities together
prevents this to happen. 

The usecase I have in mind is usage of the platform4 cluster with
additional simple format recognizers (html, image, text) modules and
vcs. For that I do not need projects, but I need the templates,
otherwise I am not able to create anything new in all files.
Comment 5 Jesse Glick 2004-06-04 12:42:04 UTC
Empty text file NewType ought to be available from context menu of
folders in Favorites tab. Seems it does not work in current trunk
using platform4 + org-netbeans-modules-favorites.jar; context menu has
just New -> [Files..., Folder], where Files... shows templates with
only Folder template.
Comment 6 Jaroslav Tulach 2004-06-07 13:56:32 UTC
After discussion with phrebejk and jglick we propose following solution:
 - move the definition of Empty file template to core/favorites
 - remove the definition from projects/projectui module

As a result this bug will be fixed and moreover:
 - in current IDE build there will remain the New->(Folder,File) as now
 - in platform build by adding core/favorites one will get a view of fs
 - and also one will get the ability to create new folder, new emptyfile
 - and also register any template into /Templates folder
Comment 7 Jaroslav Tulach 2004-06-08 10:47:10 UTC
Created attachment 15549 [details]
Patch that moves the emptyfile from projectui to favorites (please also copy newFile.gif from projectui)
Comment 8 mslama 2004-06-09 14:17:31 UTC
Fixed in main trunk.

Checking in
projects/projectui/src/org/netbeans/modules/project/ui/Bundle.properties;
new revision: 1.28; previous revision: 1.27
Checking in
projects/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml;
new revision: 1.26; previous revision: 1.25
Removing
projects/projectui/src/org/netbeans/modules/project/ui/resources/templatesFile.html;
new revision: delete; previous revision: 1.1
Checking in
core/favorites/src/org/netbeans/modules/favorites/Bundle.properties;
new revision: 1.6; previous revision: 1.5
Checking in
core/favorites/src/org/netbeans/modules/favorites/resources/layer.xml;
new revision: 1.3; previous revision: 1.2
Checking in
core/favorites/src/org/netbeans/modules/favorites/resources/newFile.gif;
initial revision: 1.1
done
Checking in
core/favorites/src/org/netbeans/modules/favorites/resources/templatesFile.html;
initial revision: 1.1
[
Comment 9 Miloslav Metelka 2004-06-10 10:01:43 UTC
In addition I would like to apply a patch related to removal of the
text module (issue 43725). The patch adds localization of the
Templates/Other folder which was done in the text module originally.
Comment 10 Miloslav Metelka 2004-06-10 10:02:25 UTC
Created attachment 15626 [details]
Patch for "Templates/Other" localization
Comment 11 Miloslav Metelka 2004-06-10 12:25:13 UTC
Fixed in main trunk:

Checking in
core/favorites/src/org/netbeans/modules/favorites/Bundle.properties;
/cvs/core/favorites/src/org/netbeans/modules/favorites/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.7; previous revision: 1.6
done
Checking in
core/favorites/src/org/netbeans/modules/favorites/resources/layer.xml;
/cvs/core/favorites/src/org/netbeans/modules/favorites/resources/layer.xml,v
 <--  layer.xml
new revision: 1.5; previous revision: 1.4
Comment 12 Lukas Hasik 2004-07-15 14:47:04 UTC
have to reopen
the implementation of New file/foled doesnt follow UI spec

http://ui.netbeans.org/nonav/docs/ui/favorites/favorites-ui-spec.html#Contextual_Menu_A_Folder

the context menu should look like
New Empty File...
New Folder...

not New > ...

see Jano's comments in issue 46056
Comment 13 mslama 2004-07-15 15:34:42 UTC
We agreed on current state. Jano please update spec.
Comment 14 jrojcek 2004-07-15 16:53:37 UTC
I misunderstood. I thought it was about something else. The new submenu is fine. I 
updated the Favorites spec.
Comment 15 Tomas Danek 2005-07-07 12:04:34 UTC
verified on 4.2 20050706