Bug 370607 - How to add contents to packages in class diagram?
Summary: How to add contents to packages in class diagram?
Status: CONFIRMED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.18.3 (KDE Applications 15.12.3)
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-12 21:40 UTC by Robert Hairgrove
Modified: 2016-10-13 11:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hairgrove 2016-10-12 21:40:24 UTC
Using Umbrello version 2.18.3 on Ubuntu 16.04.x LTS.

After adding a package in a C++ class diagram (with or without a stereotype <<namespace>>), I cannot populate its "Contents" with classes or other types (datatypes, interfaces, etc.) There is no button "Add...", and right-clicking in the empty "Contents" box gives me no such option. It remains empty. The documentation offers no help whatsoever here.

What good is a namespace if it has no classes?
Comment 1 Robert Hairgrove 2016-10-12 22:15:28 UTC
In the meanwhile, I discovered that I can add classes to a package (AKA namespace), but I cannot add an ordinary datatype to a package.

What I would like to do is to build a package for the STL types I am using ... there anren't very many of those, so I wouldn't have to have the entire STL imported into my project. But it would be useful for types such as std::vector, std::string, std::map, and perhaps a few more.

Or is there a better way to do this?
Comment 2 Robert Hairgrove 2016-10-12 22:18:03 UTC
(In reply to Robert Hairgrove from comment #1)
> In the meanwhile, I discovered that I can add classes to a package (AKA
> namespace), but I cannot add an ordinary datatype to a package.

Forgot to mention that I did this by dragging the class in the Tree View to the package. Doesn't seem to work that way in the class diagram itself.
Comment 3 Ralf Habacker 2016-10-13 08:08:19 UTC
(In reply to Robert Hairgrove from comment #1)
> Or is there a better way to do this?
In the tree view you can add objects through the context menu right clicking on the related package.
Comment 4 Ralf Habacker 2016-10-13 08:18:28 UTC
(In reply to Robert Hairgrove from comment #2)
> Forgot to mention that I did this by dragging the class in the Tree View to
> the package. Doesn't seem to work that way in the class diagram itself.
I can confirm this behavior. Please file an additional bug for this if you want.
Comment 5 Ralf Habacker 2016-10-13 08:23:51 UTC
(In reply to Robert Hairgrove from comment #1)
> In the meanwhile, I discovered that I can add classes to a package (AKA
> namespace), but I cannot add an ordinary datatype to a package.

If you refering to adding a datatype through the tree view by right clicking on the package and selecting 'new datatype': The created datatype is created in the datatypes folder and not in the package, which looks like a missing feature. Please file an additional bug for this and add those bug number in the 'depends on' field of this bug.
A workaround for this issue is to move the created datatype into the package through the tree view.
Comment 6 Robert Hairgrove 2016-10-13 11:55:02 UTC
Thank you, Ralf, for responding so quickly!

Another thing: once I have a package, I can add a new class to it by setting the "Package path" property in the properties dialog of the new class. So ... it's not so difficult after all. :) However, it would be more intuitive if i could add existing classes to a package in the properties dialog of the package (at least to me).