/
NECEntry.class.st
120 lines (102 loc) · 2.3 KB
/
NECEntry.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
"
I represent a completion entry that is management by a ECModel and shown in the ECMenuMorph as a menu entry.
Each of my subclass will represent a specific kind of entity. For example a globalvariable, self...
"
Class {
#name : #NECEntry,
#superclass : #Object,
#instVars : [
'contents',
'type',
'description'
],
#category : #'NECompletion-Model'
}
{ #category : #'instance creation' }
NECEntry class >> contents: aString [
^ self new setContents: aString
]
{ #category : #'instance creation' }
NECEntry class >> contents: aString type: aSymbol [
^ self new setContents: aString type: aSymbol
]
{ #category : #operations }
NECEntry >> <= aECEntry [
^ contents <= aECEntry contents
]
{ #category : #'ui related' }
NECEntry >> browseWith: anECContext [
| guessType |
guessType := self guessTypeWith: anECContext.
guessType ifNil: [^ false].
Smalltalk tools browser openOnClass: guessType.
^ true
]
{ #category : #accessing }
NECEntry >> completion [
^ self contents asSymbol
]
{ #category : #accessing }
NECEntry >> contents [
^contents
]
{ #category : #'detail information' }
NECEntry >> createDescriptionWith: anECContext [
| clazz |
clazz := self guessTypeWith: anECContext.
^ clazz
ifNil: [ NECEntryDescription label: self label ]
ifNotNil:
[ NECEntryDescription
label: self label
title: clazz printString
description: clazz comment ]
]
{ #category : #operations }
NECEntry >> descriptionWith: anECContext [
description ifNotNil: [ ^ description ].
^ description := self createDescriptionWith: anECContext
]
{ #category : #operations }
NECEntry >> guessTypeWith: anECContext [
^ nil
]
{ #category : #testing }
NECEntry >> isInstance [
^ false
]
{ #category : #testing }
NECEntry >> isLocal [
^ false
]
{ #category : #testing }
NECEntry >> isSelector [
^ false
]
{ #category : #accessing }
NECEntry >> label [
^ 'unknown'
]
{ #category : #printing }
NECEntry >> printOn: aStream [
aStream
nextPutAll: self class name;
nextPut: $(;
nextPutAll: contents;
nextPut: $,;
nextPutAll: self type;
nextPut: $)
]
{ #category : #accessing }
NECEntry >> setContents: aString [
contents := aString.
]
{ #category : #accessing }
NECEntry >> setContents: aString type: aSymbol [
contents := aString.
type := aSymbol
]
{ #category : #accessing }
NECEntry >> type [
^type
]