User Tools

Site Tools


pdf:extending

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pdf:extending [2016/03/24 11:38] – [Add attributes] christianpdf:extending [2016/03/30 09:00] (current) – [Add a new Smalltalk class] christian
Line 42: Line 42:
 === Choose a class name === === Choose a class name ===
  
-As name for this example, I use ''BorderStyle''. Ideally the name should be the same as used in the PDF specification.+As name for this example, I use ''BorderStyle''. Ideally the name should be the same as used in the PDF specification. If the name does not match the name in the specification, be it because the name is already defined or for estetic reasons, the class method ''type'' (or ''subtype'', depending on the type inference mechanism) needs to be implemented.
  
 === Choose the superclass === === Choose the superclass ===
Line 188: Line 188:
 ===== Customize an object type ===== ===== Customize an object type =====
  
-docs, icon, string, attributes (docstypeorderversion, required)+Nowthe PDF type is sufficiently defined to be usefully displayed in the PDFExplorer. But more can be done by defining some of the following methods. 
 + 
 +==== Optional customization methods ==== 
 + 
 +=== Display name === 
 + 
 +The method ''listText'' returns a short Text used in the treeview of the PDFExplorer. The method ''titleText'' is used for the display of the selected object on the right side. 
 + 
 +=== Icon === 
 + 
 +The method ''toolListIcon'' can be defined on the class side to get an icon for the class in the Smalltalk browser. A PDF type class has the method ''listIcon'' on the instance side whichby defaultis the ''toolListIcon'' of the class. Therefore it is possible to select an icon depending on the object's state. 
 + 
 +=== Excluding attributes === 
 + 
 +Some attributes clutter the treeview on the left side of the PDFExplorer. For exampleevery ''TypedDictionary'' has the attribute ''/Type'' which is usually used as the name of the object itself. 
 + 
 +By defining the method ''displayKeysToOmit''such attributes can be excluded from the children of the object in the treeview. For the class ''TypedDictionary'' the method looks like this: 
 + 
 +<code smalltalk> 
 +displayKeysToOmit 
 + ^super displayKeysToOmit #(#Type) 
 +</code> 
/var/www/virtual/code4hl/html/dokuwiki/data/attic/pdf/extending.1458815899.txt.gz · Last modified: 2016/03/24 11:38 by christian