"new class category"
menu
function in the class category list).
"new class"
in the class list
This will show a class definition template in the codeview.
"accept"
(use the "accept"
menu function in the codeview)
documentation
category.
To do so:
"add documentation stubs"
.
"accept"
them
"new category"
menu function in the method category list)
"new method"
menu function in the method lists popup menu. Alternatively, copy&paste some
code from any other textView, and modify it as appropriate.
"accept"
"accept"
"remove"
function from the method lists popup menu
'instanceVariableNames'
or 'classVariableNames'
-string
as required.
"accept"
Notice:
existing instances of the class will not be affected by this change.
Instead, the original class will get its category
changed to "obsolete"
and a new class is installed under the
original name.
This means, that existing instances still have a valid class definition around,
but methods can no longer be added/removed or changed to the old class.
In case of a changed class definition (which affects the instance layout),
the system will recompile all methods that require recompilation.
Have a look at the Transcript, to see what is going on.
"senders"
function in the method menu
If you are only interrested in sends within the current class and
subclasses (i.e. usually in YOUR classes), you can also use the
"local senders"
menu function.
"implementors
function in the method menu
If you are only interrested in implementations in the current class
and subclasses (i.e. usually in YOUR classes), you also can use the
"local implementors"
menu function.
"find method"
function in the method menu
"variable search"
submenu functions in the
class list popup menu.
"instvar refs/mods"
, "classvar refs/mods"
)
and
entries which descent down and also search in subclasses
("all instvar refs/mods"
, "all classvar refs/mods"
).
Since searching involves parsing the source code, these functions may take a while to show the result.
"globals"
menu functions in the method list
Notice:
since classes are (almost) always referenced by globals,
this will also find explicit uses of classes.
(for example: try searching for "Array"
)
The outcome of the search will be presented in a browser, which has its search-pattern preset to the globals name. Thus a search-next (i.e. CMD-F) will place the cursor to the next occurence of the string.
"classRefs"
function from the class list.
"string search"
function from the method list.
senders
function is
probably better.
local string search
, which limits the search
to some classes and is therefore faster too.
apropos
function, which allows
searching for a keyword in method selectors and method comments.
Notice, that this function too may take some time, since all source code has
to be processed. If you know some top-class, you should limit the search
(and thereby speedup the query) by using the local apropos
function.
In the above example, it seems obvious that concatenation is an operation
on collections - therefore you could select the Collection
class
and do a local apropos
there.
For example, a browser on all methods with 3 arguments can be opened with:
if you are interrested in methods with more than 10 arguments, try:
SystemBrowser browseAllSelect:[:cls :method :sel |
sel numArgs == 3
]
or, to find all method which have 'at:' in their name:
SystemBrowser browseAllSelect:[:cls :method :sel |
sel numArgs > 10
]
Beside
SystemBrowser browseAllSelect:[:cls :method :sel |
'*[aA]t:*' match:sel
]
browseAllSelect:
,
there are other special startup messages to be found in
SystemBrowsers
class protocol. Have a look at them - you may find some of these
useful when searching for methods.
"fileOut-all"
function in the method category list).
Starting with version 2.10.4, methods and classes include a package field.
This makes it very easy, to identify classes and methods which belong to a
package for fileOut. Set the current projects packageName to some unique name and
use the ProjectViews "save project files"
function to have
them saved in your project directory.
"fileout-each"
function instead of "fileOut"
in the class category list.
stc
-compiler (currently) cannot compile multiple
classes, but requires one class per sourcefile.
Be very careful when editing existing sourcefiles with the fileBrowser or
another (non-ST/X) editor. Since methods do not keep the source
as a string, but instead the filename and filePosition, editing a sourcefile
makes this sourceinfo invalid (you will see funny code in the systemBrowser).
If you "fileOut"
these methods,
the resulting output file will be useless.