[Commits] (jed) Added preliminary AttributeRenderers to display
ContactNames, ContentItems, EmailAddresses, and Contacts.
commits at osafoundation.org
commits at osafoundation.org
Mon Aug 23 18:48:54 PDT 2004
Commit by: jed
Modified files:
chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py 1.3 1.4
chandler/parcels/osaf/framework/attributeEditors/parcel.xml 1.2 1.3
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.103 1.104
Log message:
Added preliminary AttributeRenderers to display ContactNames, ContentItems, EmailAddresses, and Contacts.
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/attributeEditors/parcel.xml.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.103&r2=text&tr2=1.104
Index: chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py
diff -u chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py:1.3 chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py:1.4
--- chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py:1.3 Mon Aug 23 16:52:53 2004
+++ chandler/parcels/osaf/framework/attributeEditors/AttributeEditors.py Mon Aug 23 18:48:52 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.3 $"
-__date__ = "$Date: 2004/08/23 23:52:53 $"
+__version__ = "$Revision: 1.4 $"
+__date__ = "$Date: 2004/08/24 01:48:52 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -88,15 +88,15 @@
try:
value = item.getAttributeValue (attributeName)
except AttributeError:
- value = "Unnamed"
+ value = "<Empty>"
else:
if item.getAttributeAspect (attributeName, "cardinality") == "list":
compoundValue = value
- value = ""
+ value = ''
for part in compoundValue:
if value:
- value = value + ", "
- value = value + part.getItemDisplayName()
+ value += ', '
+ value += part.getItemDisplayName()
return value
@@ -118,6 +118,17 @@
return value
+class ContactNameAttributeEditor (StringAttributeEditor):
+ def GetAttributeValue (self, item, attributeName):
+ try:
+ contactName = item.getAttributeValue (attributeName)
+ except AttributeError:
+ value = "<Empty>"
+ else:
+ value = contactName.firstName + ' ' + contactName.lastName
+ return value
+
+
class DefaultAttributeEditor (StringAttributeEditor):
def GetAttributeValue (self, item, attributeName):
return "%s doesn't have a renderer" % item.getAttributeAspect (attributeName, 'type').itsName
Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.103 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.104
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.103 Mon Aug 23 16:52:53 2004
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py Mon Aug 23 18:48:53 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.103 $"
-__date__ = "$Date: 2004/08/23 23:52:53 $"
+__version__ = "$Revision: 1.104 $"
+__date__ = "$Date: 2004/08/24 01:48:53 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -408,6 +408,18 @@
self.RegisterDataType ("DateTime",
GridCellAttributeRenderer("DateTime"),
GridCellAttributeEditor("DateTime"))
+ self.RegisterDataType ("EmailAddress",
+ GridCellAttributeRenderer("String"),
+ GridCellAttributeEditor("String"))
+ self.RegisterDataType ("ContentItem",
+ GridCellAttributeRenderer("String"),
+ GridCellAttributeEditor("String"))
+ self.RegisterDataType ("Contact",
+ GridCellAttributeRenderer("String"),
+ GridCellAttributeEditor("String"))
+ self.RegisterDataType ("ContactName",
+ GridCellAttributeRenderer("ContactName"),
+ GridCellAttributeEditor("ContactName"))
self.Bind(wx.EVT_SIZE, self.OnSize)
self.Bind(wx.grid.EVT_GRID_COL_SIZE, self.OnColumnDrag)
self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnWXSelectionChanged)
Index: chandler/parcels/osaf/framework/attributeEditors/parcel.xml
diff -u chandler/parcels/osaf/framework/attributeEditors/parcel.xml:1.2 chandler/parcels/osaf/framework/attributeEditors/parcel.xml:1.3
--- chandler/parcels/osaf/framework/attributeEditors/parcel.xml:1.2 Mon Aug 23 16:52:53 2004
+++ chandler/parcels/osaf/framework/attributeEditors/parcel.xml Mon Aug 23 18:48:52 2004
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
-<!-- $Date: 2004/08/23 23:52:53 $ -->
+<!-- $Revision: 1.3 $ -->
+<!-- $Date: 2004/08/24 01:48:52 $ -->
<!-- Copyright (c) 2003 Open Source Applications Foundation -->
<!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
@@ -26,6 +26,10 @@
<doc:AttributeEditorsKind itsName="AttributeEditors">
<editorString key="String" value="osaf.framework.attributeEditors.AttributeEditors.StringAttributeEditor"/>
<editorString key="DateTime" value="osaf.framework.attributeEditors.AttributeEditors.DateTimeAttributeEditor"/>
+ <editorString key="ContentItem" value="osaf.framework.attributeEditors.AttributeEditors.StringAttributeEditor"/>
+ <editorString key="EmailAddress" value="osaf.framework.attributeEditors.AttributeEditors.StringAttributeEditor"/>
+ <editorString key="ContactName" value="osaf.framework.attributeEditors.AttributeEditors.ContactNameAttributeEditor"/>
+ <editorString key="Contact" value="osaf.framework.attributeEditors.AttributeEditors.StringAttributeEditor"/>
<editorString key="_default" value="osaf.framework.attributeEditors.AttributeEditors.DefaultAttributeEditor"/>
</doc:AttributeEditorsKind>
More information about the Commits
mailing list