~vcs-imports/monouml/trunk

« back to all changes in this revision

Viewing changes to src/Widgets/Tabs/UMLProperties/TypedElementTypeViewer.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:
25
25
 
26
26
namespace MonoUML.Widgets.Tabs.UMLProperties
27
27
{
28
 
        public class TypedElementTypeViewer : SingleObjectViewer
 
28
        public class TypedElementTypeViewer : SingleObjectViewer, IPropertyViewer
29
29
        {
30
30
                public TypedElementTypeViewer(IBroadcaster hub)
31
31
                        : base(hub, GettextCatalog.GetString ("Type:")) {}
55
55
                        } 
56
56
                }
57
57
 
58
 
                public void ShowTypeFor (UML.TypedElement typedElement)
 
58
                public void ShowPropertyFor (UML.Element element)
59
59
                {
60
 
                        _typedElement = typedElement;
61
 
                        base.SetValue (typedElement.Type == null
62
 
                                ? null : typedElement.Type.QualifiedName);
 
60
                        _typedElement = element as UML.TypedElement;
 
61
                        this.Visible = _typedElement != null;
 
62
                        if(_typedElement == null) return;
 
63
                        base.SetValue (_typedElement.Type == null
 
64
                                ? null : _typedElement.Type.QualifiedName);
63
65
                }
64
66
                
65
67
                private UML.TypedElement _typedElement;