~vcs-imports/monouml/trunk

« back to all changes in this revision

Viewing changes to src/Widgets/Tabs/UMLProperties/NamedElementNamespaceViewer.cs

  • Committer: rodolfocampero
  • Date: 2007-07-25 15:20:48 UTC
  • Revision ID: vcs-imports@canonical.com-20070725152048-03z7yvqy4o5o9ata
Refactored UMLPropertiesTab in order to simplify adding new widgets. Now adding new widgets is less error prone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
using UML = NUml.Uml2;
22
22
using MonoUML.I18n;
23
23
 
24
 
namespace MonoUML.Widgets.Tabs.Common
 
24
namespace MonoUML.Widgets.Tabs.UMLProperties
25
25
{
26
 
        public class NamedElementNamespaceViewer : Gtk.HBox
 
26
        public class NamedElementNamespaceViewer : Gtk.HBox, MonoUML.Widgets.Tabs.Common.IPropertyViewer
27
27
        {
28
28
                public NamedElementNamespaceViewer()
29
29
                {
32
32
                        base.PackStart(_namespaceLabel, false, false, 2);
33
33
                }
34
34
 
35
 
                public void ShowPropertyValueFor(UML.NamedElement element)
 
35
                public void ShowPropertyFor(UML.Element element)
36
36
                {
37
 
                        _namespaceLabel.Text = element.Namespace==null ? String.Empty : element.Namespace.QualifiedName;
 
37
                        UML.NamedElement ne = element as UML.NamedElement;
 
38
                        this.Visible = ne != null;
 
39
                        if(ne == null) return;
 
40
                        _namespaceLabel.Text = ne.Namespace==null ? String.Empty : ne.Namespace.QualifiedName;
38
41
                }
39
42
 
40
43
                private Gtk.Label _namespaceLabel;