-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathLePythonSnippetViewModel.class.st
More file actions
51 lines (43 loc) · 1.76 KB
/
Copy pathLePythonSnippetViewModel.class.st
File metadata and controls
51 lines (43 loc) · 1.76 KB
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
Class {
#name : #LePythonSnippetViewModel,
#superclass : #LeCodeSnippetViewModel,
#category : #'Lepiter-Python-Snippet'
}
{ #category : #initialization }
LePythonSnippetViewModel >> initializeCoderAddOns: aCoderViewModel [
"Initialise the keyboard shortcuts in the code editor"
aCoderViewModel
"Create New snippet (after the current snippet)"
addShortcut: (LeSnippetSplitSnippetShortcut new combination: (self keyboardShortcut: #SplitSnippet));
"Delete previous character, or merge with previous snippet"
addShortcut: (LeSnippetDeletePreviousShortcut new combination: (self keyboardShortcut: #DeletePrevious));
"Indent LeSnippet"
addShortcut: (LeSnippetIndentSnippetShortcut new combination: (self keyboardShortcut: #IndentSnippet));
"Unindent LeSnippet"
addShortcut: (LeSnippetUnindentSnippetShortcut new combination: (self keyboardShortcut: #UnindentSnippet));
"Move Snippet up"
addShortcut: (LeSnippetMoveSnippetUpShortcut new combination: (self keyboardShortcut: #MoveSnippetUp));
"Move Snippet down"
addShortcut: (LeSnippetMoveSnippetDownShortcut new combination: (self keyboardShortcut: #MoveSnippetDown))
]
{ #category : #'api - bindings' }
LePythonSnippetViewModel >> onSelfObjectChanged [
coderViewModel selfObject: sharedContext selfObject
]
{ #category : #'filter view' }
LePythonSnippetViewModel >> parserClass [
^ PythonParser
]
{ #category : #'api - bindings' }
LePythonSnippetViewModel >> sharedSnippetContext: aLeSharedSnippetContext [
sharedContext unsubscribe: self.
super sharedSnippetContext: aLeSharedSnippetContext.
self onSelfObjectChanged.
aLeSharedSnippetContext
whenSelfObjectChangedSend: #onSelfObjectChanged
to: self
]
{ #category : #accessing }
LePythonSnippetViewModel >> snippetElementClass [
^ LePythonSnippetElement
]