Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 36 additions & 11 deletions src/Gt4CSS/GtCSSCoderModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ GtCSSCoderModel >> addEvaluateAddonsTo: anAst to: coderAddOns [
<gtCoderContextMenuAddOns>
]

{ #category : #'add-ons - header' }
GtCSSCoderModel >> addHeaderCopyMethodSelector: aSelector to: coderAddOns [
<sys_ext>
<gtCoderHeaderContextMenuAddOns>
(coderAddOns
addContextMenuItem: (self createLabel: 'Copy method name'
description: aSelector)
group: BrMenuItemGroupConfiguration editing
action: [:aCoderViewModel | self copyMethodNameToClipboard]
id: nil) ifNotNil: [:anAction | anAction priority: 250]
]

{ #category : #'add-ons - header' }
GtCSSCoderModel >> addHeaderFormatMethodSelector: aSelector to: coderAddOns [
<gtCoderHeaderContextMenuAddOns>
Expand Down Expand Up @@ -194,6 +206,12 @@ GtCSSCoderModel >> computeAst: aString [
^ CSSParser parseWithErrors: aString
]

{ #category : #'as yet unclassified' }
GtCSSCoderModel >> copyMethodNameToClipboard [
self compiledMethod
ifNotNil: [:aCompiledMethod | Clipboard clipboardText: aCompiledMethod printString]
]

{ #category : #accessing }
GtCSSCoderModel >> currentSelector [
^ self currentSelectorPromise wait
Expand Down Expand Up @@ -299,32 +317,39 @@ GtCSSCoderModel >> initializeAddOns: addOns [
{ #category : #initialization }
GtCSSCoderModel >> initializeAddOns: addOns viewModel: aGtPharoMethodCoderViewModel [
super initializeAddOns: addOns viewModel: aGtPharoMethodCoderViewModel.

addOns
addMainAction: 'Save' translated
icon: BrGlamorousVectorIcons accept
action: [ :aCoderUIModel :anElement | aCoderUIModel save ]
action: [:aCoderUIModel :anElement | aCoderUIModel save]
id: GtMethodCoderSaveActionId.
addOns
addDropDownWithPreviewAction: 'Remove' translated
icon: BrGlamorousVectorIcons bin
action: [ :aButtonElement :aButtonModel :anEvent | self remove ]
stencil: [ :element |
GtPharoRemoveMethodPreviewStencil new
action: [:aButtonElement :aButtonModel :anEvent | self remove]
stencil:
[:element |
(GtPharoRemoveMethodPreviewStencil new)
selectorToRemove: self selector;
isEmptyMethod: self isNewMethod;
anElement: element;
create ]
create]
id: GtMethodCoderRemoveActionId.
addOns
addMainAction: 'Inspect Method' translated
icon: BrGlamorousVectorIcons inspect
action: [ :aCoderUIModel :anElement |
self
notifyObjectSpawn: (aCoderUIModel behavior >> aCoderUIModel selector) methodReference
requesterObject: aCoderUIModel ]
action:
[:aCoderUIModel :anElement |
self notifyObjectSpawn: (aCoderUIModel behavior >> aCoderUIModel selector)
methodReference
requesterObject: aCoderUIModel]
id: GtMethodCoderInspectActionId.
self initializeSearchTextAddOns: addOns viewModel: aGtPharoMethodCoderViewModel
addOns
addMainAction: 'Copy method name' translated
icon: BrGlamorousVectorIcons clipboard
action: [:aCoderUIModel :anElement | self copyMethodNameToClipboard]
id: GtMethodCoderCopyActionId.
self initializeSearchTextAddOns: addOns
viewModel: aGtPharoMethodCoderViewModel
]

{ #category : #initialization }
Expand Down