Bug 216401 - [LinkedResources] Can't make multiple choose on linked file
Summary: [LinkedResources] Can't make multiple choose on linked file
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-01-24 04:12 EST by Tambi CLA
Modified: 2019-09-06 16:10 EDT (History)
1 user (show)

See Also:


Attachments
The tree in Eclipse (44.99 KB, image/jpeg)
2008-02-11 08:21 EST, Szymon Brandys CLA
no flags Details
Multiple source folders (24.11 KB, image/jpeg)
2008-02-11 08:49 EST, Szymon Brandys CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tambi CLA 2008-01-24 04:12:31 EST
if you try in eclipse to make a linked folder from two different places but with the same folder name then you get "'folder name' already exists" ,instead, to put all files on the same folder... 

so i tried to link to one of the folders and bring all files from the other folder as linked files this time...

but you need to do this one by one ! because you cant make multiple file choose option and you choose only one file at a time... very annoying if you have 10+ files...

if all files were in the same folder we could do this adding the hole folder as linked folder and bring all files inside with it, but... as i mentioned befor... when you have no choice and you need to bring multiple files then it's a problem.
Comment 1 Paul Webster CLA 2008-01-24 08:27:47 EST
i.e. you want to create a linked folder in eclipse, X, that contains the files from 2 separate file system directories?

links don't work that way ... i.e. linked files/folders are modeled on the file system mechanism ... like unix "ln -s".  You can link many files into one directory, or link a directory into another directory.

You could probably solve this if you wrote your own filesystem plugin to the EFS specification.

PW


Comment 2 Szymon Brandys CLA 2008-01-24 09:17:07 EST
Paul is right about how linked resources work in Eclipse.

I assume that Tambi is trying to find a workaround for the issue described in bug 216259. 

This is how I understand the issue. So far we can create one linked resource at the time. However it would be nice to create couple of them with "one click". For instance, select couple locations in the filesystem and then create a linked resource for each at once.

And this would be a nice UI enhancement.
Comment 3 Tambi CLA 2008-01-25 05:20:21 EST
OK, if we combine bug 216259 (the one that started all this) with this one it's creating some issues...

if i bring one folder as linked folder to the project then you can see in the project the linked folder with linked folder icon on it, and all files inside as regular files icon on them, 

and then bring all other files from another folder (with the same name - Bug No. 2 - you can't bring two linked folder with the same name - so i'm bringing all files separately) as linked files to this folder (bug No. 1 - you can't bring files in bulk) then you see only the linked files with linked icons (bug ? - it would be better to see all linked file with linked file icon on it)

now when i tried to copy the linked folder to onother project (drag & drop) eclipse didn't give me that option (Bug ?)

ok, so i desided to copy all the src folder to the othe project, and it's worked ! but... i noticed that it copied only the linked folder and it's files without all the linked files that i brought one by one to this linked folder (another bug ?)

and after finishing all these... i noticed that i've misspelt the linked folder name... but eclipse didn't alowed me to rename it (bug ?), so i desided to delete the linked folder and start againg from the begining...
but... see what happened to me if you try to delete a linked folder with some subfolder in it in bug No. 216254

 
Comment 4 Szymon Brandys CLA 2008-01-28 08:47:36 EST
(In reply to comment #3)
> if i bring one folder as linked folder to the project then you can see in the
> project the linked folder with linked folder icon on it, and all files inside
> as regular files icon on them, 
> 
> and then bring all other files from another folder (with the same name - Bug
> No. 2 - you can't bring two linked folder with the same name - so i'm bringing
> all files separately) as linked files to this folder (bug No. 1 - you can't
> bring files in bulk) then you see only the linked files with linked icons (bug
> ? - it would be better to see all linked file with linked file icon on it)

these files added one-by-one are linked files because their locations don't come from their parents' locations.

You should rather create a regular folder and then add files as linked files.

> now when i tried to copy the linked folder to onother project (drag & drop)
> eclipse didn't give me that option (Bug ?)

It works for me.

> 
> ok, so i desided to copy all the src folder to the othe project, and it's
> worked ! but... i noticed that it copied only the linked folder and it's files
> without all the linked files that i brought one by one to this linked folder
> (another bug ?)

I can see the same.

> 
> and after finishing all these... i noticed that i've misspelt the linked folder
> name... but eclipse didn't alowed me to rename it (bug ?)

It works for me.

Comment 5 Tambi CLA 2008-01-30 04:13:24 EST
reproduce:

lets say we are creating games for mobile...

we have two games, each game are assembled from couple of builds
those build are eventually the projects for each phone device

for all the games we are using a menu, so the menu module are the same for all games, each game has it's own menu item type and it's own game module


now, lets create our projects in eclipse, some builds for each game:
Game1_Build1 inside Game1
Game1_Build2 inside Game1


the folders structure will be as follows:

Projects
   com
      menuModule.java
   Game1
      com
         menuItem.java
         gameModule.java
      Game1_Build1   ==> created in eclipse
         src
      Game1_Build2   ==> created in eclipse
         src
   Game2
      com
         menuItem.java
         gameModule.java
      Game2_Build1  ==> created in eclipse
         src


now, what i would like to create is a folder called 'com' inside the project and put all my commomn menu files there 
i'm bringing inside Game1_Build1 my main com folder for all agmes
(Bug ? : if you try to bring another folder, you will allways start browsing folders from desktop, very annoying if whant to bring some folders)
(Bug ? : you can't bring folders as a bulk)

now i'm bringing inside the linked folder my other commomn files from com folder in the game1 level (menuItem.java, gameModule.java)
(Bug ? : you can't bring another folder with the same name)

so i'm trying to bring them one by one
(Bug ? : you can't bring files as a bulk)

notice, this time eclipse does remember my last browsed position, unlike the folders browsing

(Bug ? : it would be nice to do these with drag & drop from explorer directly to eclipse, now if you do that it's just copy the file inside the targeted package, it would be nice to drag there files and folder as linked ones if you do this when pressing the Alt key - for example)


by now we have in Game1_Build1 a linked folder 'com' with three files inside it 
(Bug ? : it would be nice to change the icon of the file that brought with the linked folder, it's apearing with an icon as it a regular file, but still not the same icons as the linked files so we can still recognize which came from where, if you rename the files for example, the linked file name in the will changed only in the workspace, but it's original name will remain, but with the file that brought with the linked folder it will change it name)


now we would do the same thing with our second project - Game1_Build2
so to make thing easier i'm trying to drag & drop 'com' from package Game1_Build1 to this project inside 'src' but eclipse dont give you that option (i'm positive with this)
(Bug ? : you can't drag & drop any linked folder neither file to other project, but, you can drop a file that brought along with the linked folder, for example try to drag & drop menuItem.java that we brought as linked file inside 'src' you can't do it, but try it with menuModule.java this onw you can)


i tried a workaround for this, if eclipse don't let as do drag & drop linked folders and files so i'll take the whole 'src' folder
(Bug ? : notice that it did copy (drag drop pressing Ctrl key) but it did copy only menuModule.java, the other two linked files are not)


in this state, come back to Game1_Build1 right click on out linked folder 'com' and try to change it's name (press F2)
(Bug ? : you can't change a folder name - you get the message "this operation is unavailable in linked package and package fregment roots")



and if we had subfolders inside 'com' this is getting worse...
(please see Bug 216254)
Comment 6 Szymon Brandys CLA 2008-01-30 05:04:49 EST
(In reply to comment #5)
> the folders structure will be as follows:
> 
> Projects
>    com
>       menuModule.java
>    Game1
>       com
>          menuItem.java
>          gameModule.java
>       Game1_Build1   ==> created in eclipse
>          src
>       Game1_Build2   ==> created in eclipse
>          src
>    Game2
>       com
>          menuItem.java
>          gameModule.java
>       Game2_Build1  ==> created in eclipse
>          src

I need some clarification. If the tree above is the structure on your disc, could you draw the same for the structure that you want to see in Eclipse?

Very helpful would be to indicate the real location (in braces), if a resource in Eclipse is a linked resource.

> now, what i would like to create is a folder called 'com' inside the project
> and put all my commomn menu files there 
> i'm bringing inside Game1_Build1 my main com folder for all agmes

This is not quite clear for me. Could you indicate your exact steps for each paragraph of the last comment, e.g.

1) Create a linked folder "com" inside of the project "project1" and link it to the location on a disc "/tmp/something"

2) Copy files from the project "project1" to the project "project2"

etc.

Because the expresion "i'm bringing inside Game1_Build1 my main com folder for all games" is not unambiguous. Moreover when you say "create com folder" I'm not sure if you are talking about a folder in the workspace or on a disc.

I will appreciate your help.
Comment 7 Tambi CLA 2008-01-30 09:24:02 EST
you are right... my english is not that good...
thank you for your patient...



this is what i have in my disc:
Projects
  com
     menuModule.java
  Game1
     com
        menuItem.java
        gameModule.java
  Game2
     com
        menuItem.java
        gameModule.java


this is what i have in eclipse:
Game1_Build1
   src
Game1_Build2
   src
Game2_Build1
   src

i created these projects with eclipse (new > java project...), each build in it's game in the same position, so the final folder structure in my disc is:

Projects
   com
      menuModule.java
   Game1
      com
         menuItem.java
         gameModule.java
      Game1_Build1   ==> created with eclipse
         src
      Game1_Build2   ==> created with eclipse
         src
   Game2
      com
         menuItem.java
         gameModule.java
      Game2_Build1  ==> created in eclipse
         src


what i would like to see in eclipse is:
Game1_Build1
   src
      com   (linked folder from 'projects\com')
         menuModule.java   (linked file from 'projects\com')
         menuItem.java     (linked file from 'projects\Game1\com')
         gameModule.java   (linked file from 'projects\Game1\com')

Game1_Build2
   src
      com   (linked folder from 'projects/\com')
         menuModule.java   (linked file from 'projects\com')
         menuItem.java     (linked file from 'projects\Game1\com')
         gameModule.java   (linked file from 'projects\Game1\com')

Game2_Build1
   src
      com   (linked folder from 'projects\com')
         menuModule.java   (linked file from 'projects\com')
         menuItem.java     (linked file from 'projects\Game2\com')
         gameModule.java   (linked file from 'projects\Game2\com')



notice the 'com' folder inside Game1_Build1\src
all files inside it are linked files, the folder 'com' does not apears in the disc inside the project\src (it's a linked folder from 'projects\com')
this is ok, because i realy don't whant these files inside my projects files

what i whanted to do is to create a virtual folder inside Game1_Build1\src in eclipse (not in the disc, just virtually so i can bring linked files there) called 'com' and to bring all the common files there, but i can't do this in eclipse (create a virtual folder), the only whay to do it is by creating a folder in the disc with the name 'com' inside Game1_Build1\src and to drop there all my commomn files as linked files, but this means that i will have an empty folder called 'com' in the disc (Game1_Build1\src\com) with no files in it, only in eclipse you will see that this folder contains linked files (only linked files)

i didn't whant an empty folder in my disk and make use of it only in eclipse,
so i created my "virtual" folder by bringing 'Projects\com' as a linked folder with it's containing files in it, and put there other files from 'Projects\Game1\com' as linked files





eventually you can see in the disc:
Projects\Game1\Game1_Build1\src

and in eclipse:
Game1_Build1
   src
      com   (linked folder from 'projects\com')
         menuModule.java   (linked file from 'projects\com')
         menuItem.java     (linked file from 'projects\Game1\com')
         gameModule.java   (linked file from 'projects\Game1\com')




notice the 'com' folder that has no job, only holding linked files



10x





Comment 8 Szymon Brandys CLA 2008-02-11 08:21:23 EST
Created attachment 89394 [details]
The tree in Eclipse
Comment 9 Szymon Brandys CLA 2008-02-11 08:48:30 EST
I've just created projects in my Eclipse following your instructions. You are right that this takes time. My view is that the UI team should handle this one. If we improved UI for adding linked resources, it would help here too.

On the other side, you can create multiple source folders in your projects. One for resources from Projects>com, second for Projects>Game1>com and third for resources specific for a particular build.

See the next screen shot.
Comment 10 Szymon Brandys CLA 2008-02-11 08:49:46 EST
Created attachment 89397 [details]
Multiple source folders
Comment 11 Tambi CLA 2008-02-17 05:01:05 EST
You are right, it could be done like this, it is more smoother workaround then i tried , i personally tried to change the folders name itself so i won't have the same names so i could bring them at once, somthing like this:

Projects
  comProject  (new name instead of 'com')
     menuModule.java
  Game1
     comGame  (new name instead of 'com')
        menuItem.java
        gameModule.java
  Game2
     comGame  (new name instead of 'com')
        menuItem.java
        gameModule.java


this way i could include them (all com folders) in my build wihtout having the same name (and also i could have them in my main src folder - more orgenized - i think), you did this in a lower level, creating source folders with different names, probebly a better way to do, but still a workaround...


i dont know... i still think that even if the problem of bringing files and folders as a bulk resolved and even if we could bring them as drag & drop so we can do it very fast...  i still think that the project this way (as your attached linkd) looks to fuzzy, insted of havin one folder named 'com' containing all our common files

10x


Comment 12 Szymon Brandys CLA 2008-02-20 05:56:01 EST
(In reply to comment #9)
I'm reassigning it to UI.

(In reply to comment #3)
> you can't bring two linked folder with the same name

Let's say, we have project1>linkedFolder1 ---> c:/temp/linkedFolder1
we want to link a location c:/linkedFolder1

this operation could create linked resources inside of project1>linkedFolder1 for all resources from c:/linkedFolder1 

However this part of the bug report is WONTFIX for me.
Comment 13 Boris Bokowski CLA 2009-11-26 16:23:31 EST
Oleg is now responsible for watching bugs in the [LinkedResources] component area.
Comment 14 Eclipse Webmaster CLA 2019-09-06 16:10:48 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.