forked from magritte-metamodel/magritte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request magritte-metamodel#279 from seandenigris/feature_r…
…elation-spotter [Feature]: Bloc ToOne Relations Spotter Support
- Loading branch information
Showing
3 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
Class { | ||
#name : #MATokenCollectorElement, | ||
#superclass : #BrHorizontalPane, | ||
#instVars : [ | ||
'relationDescription', | ||
'spotterAction', | ||
'tokenClickAction', | ||
'valueLabel' | ||
], | ||
#category : #'Magritte-GToolkit-Widgets' | ||
} | ||
|
||
{ #category : #initialization } | ||
MATokenCollectorElement >> initialize [ | ||
|
||
| searchButton | | ||
super initialize. | ||
|
||
self | ||
hMatchParent; | ||
padding: (BlInsets top: 4 bottom: 4); | ||
alignCenterLeft; | ||
cellSpacing: 5; | ||
vFitContent. | ||
|
||
valueLabel := BrLabel new | ||
aptitude: BrGlamorousLabelAptitude; | ||
beSmallSize; | ||
addEventHandlerOn: BlClickEvent | ||
do: [ :evt | self tokenClickAction cull: evt ]; | ||
yourself. | ||
|
||
searchButton := GtSpotterDropdownButtonStencil new | ||
valuable: [ self relationDescription gtSearchSource value ]; | ||
icon: BrGlamorousVectorIcons search; | ||
spotterModelDo: [ :sm | | ||
sm announcer | ||
when: GtSpotterActOn | ||
do: [ :evt | | ||
self spotterAction cull: evt cull: self. | ||
evt actedUpon: true ] ]; | ||
create. | ||
|
||
self | ||
addChild: valueLabel; | ||
addChild: searchButton. | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> relationDescription [ | ||
|
||
^ relationDescription | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> relationDescription: anObject [ | ||
|
||
relationDescription := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> spotterAction [ | ||
|
||
^ spotterAction | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> spotterAction: anObject [ | ||
|
||
spotterAction := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> tokenClickAction [ | ||
|
||
^ tokenClickAction | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> tokenClickAction: anObject [ | ||
|
||
tokenClickAction := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> valueLabel [ | ||
|
||
^ valueLabel | ||
] | ||
|
||
{ #category : #accessing } | ||
MATokenCollectorElement >> valueLabel: anObject [ | ||
|
||
valueLabel := anObject | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters