Bug 559680 - Creating a package should select the default package name
Summary: Creating a package should select the default package name
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.15   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-29 23:46 EST by Vikas Chandra CLA
Modified: 2024-01-29 13:33 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vikas Chandra CLA 2020-01-29 23:46:06 EST
1) Create java project
2) Create a package.


Expectation is the the default package name is selected by default so that I can just type my package name.
Comment 1 Eclipse Genie CLA 2020-01-29 23:47:27 EST
New Gerrit change created: https://git.eclipse.org/r/156846
Comment 2 Stephan Herrmann CLA 2020-01-30 05:54:43 EST
Sorry, Vikas. I don't agree to your intention.

If I select package p in the package explorer and choose New Package, then I expect the caret *after* p so I can directly type ".q" to create package p.q.

If I want to create package x.z (while package x doesn't yet exist) then I select the source folder so the pre-set package name is empty and I can directly type "x.z" to create package x.z.

This is the status in HEAD. The first part is broken with your proposed change.

Note, that package layout flat-vs-hierarchical has impact on how this issue spells out in real life, because in the flat layout not every "parent" package is selectable.

(BTW, in the bug title "default package" is slightly misleading, since normally we use that term to refer to the unnamed package :) ).
Comment 3 Vikas Chandra CLA 2020-01-30 06:44:28 EST
>> I don't agree to your intention.

My intention was good since I had to press backspace every single time ( almost everyday) and few times, my package name turned out to be "project-name"+ "my-intended-package-name".

For this be to more user friendly, the package name suggested during 1st package creation should either be empty ( and not project name) or be selected ( if the origin of the name is from project name). This will resurrect the broken cases in the last comment.
Comment 4 Stephan Herrmann CLA 2020-01-30 09:42:38 EST
(In reply to Vikas Chandra from comment #3)
> >> I don't agree to your intention.
> 
> My intention was good since I had to press backspace every single time (
> almost everyday) and few times, my package name turned out to be
> "project-name"+ "my-intended-package-name".

We often have different paths towards a feature, and what's good for one path needn't be good for other paths :)

> For this be to more user friendly, the package name suggested during 1st
> package creation should either be empty ( and not project name) or be
> selected ( if the origin of the name is from project name). This will
> resurrect the broken cases in the last comment.

If the wizard knows how the pre-set package name was derived, then yes, selecting the name if it was derived from the project name is OK, as long as the current behavior is kept for the name of a selected package.
Comment 5 Vikas Chandra CLA 2020-01-30 22:47:20 EST
>If the wizard knows how the pre-set package name was derived, then yes, >selecting the name if it was derived from the project name is OK, as long as >the current behavior is kept for the name of a selected package.

I will look at it when I have some spare time. I opened the bug because I was getting hit by this(comment#0) almost everyday.
Comment 6 Eclipse Genie CLA 2022-02-07 12:25:50 EST
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.

--
The automated Eclipse Genie.
Comment 7 Eclipse Genie CLA 2024-01-29 13:33:41 EST
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.

--
The automated Eclipse Genie.