Hi,
I forgot to mention in my previous mail how to load refactoring
support (currently
refactoring tool support doesn't load by default):
Gofer it
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfMagritte3';
load.
ConfigurationOfMagritte3 project stableVersion load: 'Magritte-Pharo-Tools'
This will load refactoring support to move Magritte 1 or 2 described
objects to instance-side pragma descriptions.
It also loads deprecated code such as #description with redirects to
#magritteDescription with a deprecation warning.
-----
So that everything is the same place here are the porting guidelines I
posted previously:
1) search for all senders and implementors of #description in your code, if
they are magritte descriptions rename the selector from #description to
#magritteDescription
2) remove #magritteDynamic and remove the block around the method.
3) Use the refactoring support to move class-side descriptions to instance
side descriptions with pragmas - making sure that any accessors to class
side methods are either prefixed with ‘class’ or moved to the instance
side. If you move description help methods to instance side be careful if
they contain: 'context := PRCurrentContext value' as context will shadow an
instance variable of the same name so either replace context with 'self
context' and remove 'context := PRCurrentContext value' or rename context
say theContext and replace 'context := PRCurrentContext value' with
'theContext := self context'.
4) Remove any empty categories on the class side.
5) PRWidget derived classes should either by modified to be derived from
PRWidgetPropertyBase or keep derived from PRWidget but modify the accessors
to store state in instance variable rather than the property dictionary in
PRWidgetPropertyBase. See PRViewsWidget and PRSearchWidget for examples of
both types of port.
6) Modify structure initialisation with PRComponent to use prototype
instance rather than classes. So
(PRComponent named: 'contents')
componentClass: PRContentsWidget;
write: '%c' using: PRContentsWidget descriptionHeading;
yourself
becomes:
(PRComponent named: 'contents')
prototypeInstance: (PRContentsWidget new
heading: '%c';
yourself);
yourself
add setters to allow initial settings to be set on the prototype instances
again see PRViewsWidget and PRSearchWidget for examples.
7) Put a break point in Object>>description and Object class>>description
to trap any cases you’ve missed (the break-point should not be hit) and
check the add-on. Note Object>>#description and Object class>>#description
are only present if you load 'Magritte-Deprecated'
Show replies by date