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 164996 - Kenai integration offers to get source code when I already have it
Summary: Kenai integration offers to get source code when I already have it
Status: RESOLVED FIXED
Alias: None
Product: connecteddeveloper
Classification: Unclassified
Component: Team Framework (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmichalsky
URL:
Keywords: API, API_REVIEW_FAST, PLAN
Depends on:
Blocks:
 
Reported: 2009-05-12 19:31 UTC by _ tboudreau
Modified: 2009-11-10 03:34 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
screen shot (19.11 KB, image/png)
2009-05-12 19:31 UTC, _ tboudreau
Details
AI change (27.22 KB, patch)
2009-06-23 13:12 UTC, rmichalsky
Details | Diff
API change (27.22 KB, patch)
2009-06-23 13:12 UTC, rmichalsky
Details | Diff
API change (fixed) (27.22 KB, patch)
2009-06-23 15:04 UTC, rmichalsky
Details | Diff
API change v.2 (29.23 KB, patch)
2009-06-24 12:56 UTC, rmichalsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2009-05-12 19:31:04 UTC
See attached screen shot.  I already have checked out the first two projects, Diff and SimpleValidation.  

Yet the UI does not show any link to the checked-out projects.  It does offer to get me another copy (not necessarily
bad that it can work, but not the first option the user should see).

Strangely, Simple Validation has a button "other..." which mysteriously opens a file chooser (for opening projects, I
guess?).

I'd expect the IDE to remember where I've got one or more existing copies of the project, and show those, giving them
priority in the UI over getting another copy of the repository.  And the Other button is quite mysterious.
Comment 1 _ tboudreau 2009-05-12 19:31:26 UTC
Created attachment 82001 [details]
screen shot
Comment 2 Milan Kubec 2009-05-13 08:09:17 UTC
First of all 'Other ...' button was renamed to 'Open Local Project ...' so it's probably understandable now.

But there is really usability problem: After user get sources from Kenai and didn't open any project there is no
indication that sources are already locally checked out. Moreover the button 'Open Local Project ...' shows up only
after opening a project.

Honzo, please evaluate.
Comment 3 _ tboudreau 2009-05-13 18:44:19 UTC
If the IDE checks out the sources, it probably wouldn't be that hard for the UI to remember (in NbPreferences or
similar) the location and display that if it still exists.  It probably should have multiple entries as there could be
multiple projects checked out, and, for example, I've currently got two checkouts of one project on different branches.

At any rate, just opening a random Open Project dialog do anything a user is likely to expect - since the IDE knows
where it checked things out last, it should remember that.
Comment 4 Jan Becicka 2009-05-21 15:21:07 UTC
after b8c8c795a79e
if you do checkout, there will be link to Open local project, which will open project dialog with your local versioning
root.

It is too late for some deeper changes. We are thinking about link to Favorites or something like that.
Comment 5 Quality Engineering 2009-05-22 07:14:13 UTC
Integrated into 'main-golden', will be available in build *200905220201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b8c8c795a79e
User: Jan Becicka <jbecicka@netbeans.org>
Log: #164996: Kenai integration offers to get source code when I already have it
Comment 6 Jan Becicka 2009-06-11 11:32:34 UTC
When the source is already checked out, the (get) link should be changed to (browse...) or something like that and
clicking on it should go to Favorites tab.
Comment 7 Tomas Pavek 2009-06-11 16:35:38 UTC
I think 'get' should always be there, you may want another checkout, or re-checkout the existing sources.
After sources are checked-out, two new options should appear (perhaps on new line):
* one for showing the versioned root in Favorites (browse?)
* one for opening project chooser on the root (open local project)

Then individual projects appear listed as you opened them (just like it is already now)...
Comment 8 Jan Becicka 2009-06-12 10:59:24 UTC
Milane, please help. Please add some API for adding items into favorites tab and selecting in favorites tab. Thanks
Comment 9 Antonin Nebuzelsky 2009-06-16 12:47:27 UTC
Reassigning to Richard, the new owner of Platform/Favorites.
Comment 10 rmichalsky 2009-06-23 13:12:40 UTC
Created attachment 83929 [details]
AI change
Comment 11 rmichalsky 2009-06-23 13:12:50 UTC
Created attachment 83930 [details]
API change
Comment 12 rmichalsky 2009-06-23 13:13:53 UTC
Attaching proposed API change, Honzo, Milane, please review if it suits your needs. Especially files must exist if they
are to be added/removed, much more would have to change to support non-existent files, I don't know if it limits you.
Tests, apichanges.xml and arch.xml will follow.

I've decided to expose only friend api to o.n.m.kenai.ui for now, since there are 2 possible future changes that may
affect the API considerably in the future:

1) If I understand correctly you need more of project-free file explorer than actual Favorites. This may be later
provided by Files window rather than Favorites, name of the singleton may change in such case.

2) Favorites may support more than files/folders in future, method parameters would then be something more general than
FileObjects.
Comment 13 Jan Becicka 2009-06-23 14:20:23 UTC
I'm sorry, but I'm not able to apply the patch
beci@vajicko:~/source/cdev> hg import ~/downloads/patch2.diff
applying /home/beci/downloads/patch2.diff
abort: bad hunk #1 @@ -257,7 +257,11 @@
 (8 7 11 11)
Comment 14 rmichalsky 2009-06-23 15:04:36 UTC
Created attachment 83939 [details]
API change (fixed)
Comment 15 rmichalsky 2009-06-23 15:05:48 UTC
Sorry, my mistake. Fixed version is now applicable to newest sources.
Comment 16 Jan Becicka 2009-06-23 15:08:46 UTC
thanks, this one is better.
Comment 17 Jan Becicka 2009-06-23 16:25:54 UTC
Richarde, maybe separate add and select methods:
Because now I have add(FileObject[] f, boolean select), which is really what I want, if the FileObject(s) is not in
Favorites.
But if the FileObject already exist in Favorites, there is no easy way, how to select it (add method throws
java.lang.IllegalArgumentException: File /home/beci/NetBeansProjects/anagram-game~anagramgame already in Favorites.)

Of course I can do remove/add(true) - but it is strange.
Thanks




Comment 18 rmichalsky 2009-06-24 12:56:24 UTC
Created attachment 83988 [details]
API change v.2
Comment 19 rmichalsky 2009-06-24 12:57:45 UTC
> maybe separate add and select methods:
I thought so, since you've said selection can be done via Explorer & Nodes API, I didn't care about it in first version.

I can add separate method add and select, but I guess that typical use-case would be:

FileObject fo = ....;
Favorites fav = Favorites.getDefault();
if (! fav.isInFavorites(fo)) {
    fav.add(fo);
}
fav.select(fo);

It might be more convenient to have selectWithAddition(FileObject) method which selects the file if it already is in
Favorites and adds and selects otherwise. Previous use-case would translate into:

FileObject fo = ....;
Favorites.getDefault().selectWithAddition(fo);

See patch v.2. I also separated add(FileObject) and addAll(FileObject[]) and similarily remove and removeAll. Also
add/addAll now ignore already present files instead of throwing IAE.
Comment 20 Jan Becicka 2009-06-25 08:09:15 UTC
selectWithAddition is exactly what I want. Thanks

maybe you can replace add(FileObject) and addAll(FileObject[]) with just add (FileObject... f), the same with
replace/replaceAll. But it is up to you. I'm happy with selectWithAddition.

Comment 21 rmichalsky 2009-06-25 10:28:42 UTC
> maybe you can replace add(FileObject) and addAll(FileObject[]) with just add (FileObject... f)

Will do, thanks for review. 
I'll add tests and if there are no further comments, I'll integrate tomorrow.
Comment 22 rmichalsky 2009-06-29 14:10:24 UTC
core-main #a783964438e8
Comment 23 Quality Engineering 2009-06-30 05:46:55 UTC
Integrated into 'main-golden', will be available in build *200906300200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a783964438e8
User: Richard Michalsky <rmichalsky@netbeans.org>
Log: #164996: Favorites friend API for kenai.ui
Comment 24 Jan Becicka 2009-06-30 09:49:43 UTC
Browse link added. (cdev repository)
Comment 25 Quality Engineering 2009-06-30 17:31:56 UTC
Integrated into 'main-golden', will be available in build *200906301400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6b01df4e9cbf
User: Jan Becicka <jbecicka@netbeans.org>
Log: #164996: Browse link added