Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
extending [2016/03/24 11:23] christian [Add attributes] |
extending [2016/09/24 08:13] dokuadmin ↷ Links adapted because of a move operation |
||
---|---|---|---|
Line 42: | Line 42: | ||
=== Choose a class name === | === Choose a class name === | ||
- | As name for this example, I use '' | + | As name for this example, I use '' |
=== Choose the superclass === | === Choose the superclass === | ||
Line 145: | Line 145: | ||
An attribute method consists of a number of describing pragmas and the code for access. | An attribute method consists of a number of describing pragmas and the code for access. | ||
- | === The '' | + | === The type: pragma === |
- | Mandatory is the ''< | + | Mandatory is the ''< |
=== The documentation pragma === | === The documentation pragma === | ||
Line 158: | Line 158: | ||
Also references to other parts of the specification are removed (which is not the case in the example). | Also references to other parts of the specification are removed (which is not the case in the example). | ||
+ | |||
+ | === The version: pragma === | ||
+ | |||
+ | Often, new attributes were added with later PDF versions. The version of an attribute, if it is higher than the version of the type, can be noted with the ''< | ||
=== The access code === | === The access code === | ||
Line 172: | Line 176: | ||
for a required attribute. This will raise an error if the attribute is not present in the object. | for a required attribute. This will raise an error if the attribute is not present in the object. | ||
+ | |||
+ | The method will return the object of the value of the attribute. The object is either stored directly in the attribute or a reference to it. In any case, the object is returned. To access the value (object or reference), the following methods can be used: | ||
+ | <code smalltalk> | ||
+ | ^self at: #Type ifAbsent: [#Border asPDF] | ||
+ | </ | ||
+ | <code smalltalk> | ||
+ | ^self at: #Type | ||
+ | </ | ||
===== Customize an object type ===== | ===== Customize an object type ===== | ||
- | docs, icon, string, attributes | + | Now, the 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 '' | ||
+ | |||
+ | === Icon === | ||
+ | |||
+ | The method '' | ||
+ | |||
+ | === Excluding | ||
+ | |||
+ | Some attributes clutter the treeview on the left side of the PDFExplorer. For example, every '' | ||
+ | |||
+ | By defining the method '' | ||
+ | |||
+ | <code smalltalk> | ||
+ | displayKeysToOmit | ||
+ | ^super displayKeysToOmit | ||
+ | </ |