-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1eeff7
commit 2bd5136
Showing
4 changed files
with
184 additions
and
184 deletions.
There are no files selected for viewing
184 changes: 92 additions & 92 deletions
184
repository/OpenPonk-ClassEditor/OPTUmlBaseController.trait.st
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 |
---|---|---|
@@ -1,92 +1,92 @@ | ||
Trait { | ||
#name : #OPTUmlBaseController, | ||
#category : #'OpenPonk-ClassEditor-Controllers' | ||
} | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> buildNameEditorForm: aForm [ | ||
(aForm addTextInput: 'Name') | ||
text: self model name; | ||
whenTextIsAccepted: [ :newValue | | ||
self model name: newValue. | ||
self refreshFigure ] | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionAccessor: aSymbol [ | ||
^ MAPluggableAccessor | ||
read: [ :me | me model perform: aSymbol ] | ||
write: [ :me :newValue | | ||
me model perform: (aSymbol , ':') asSymbol with: newValue. | ||
self reactToAttributeWrite ] | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionComment [ | ||
<magritteDescription> | ||
^ MAMemoDescription new | ||
required: false; | ||
accessor: | ||
(MAPluggableAccessor | ||
read: [ :me | | ||
me model ownedComments | ||
ifEmpty: [ '' ] | ||
ifNotEmpty: [ :oc | oc first body asString ] ] | ||
write: [ :me :newValue | | ||
me model ownedComments | ||
ifEmpty: [ me model ownedComments add: OPUMLComment new ]. | ||
me model ownedComments first body: newValue asString. | ||
self reactToAttributeWrite ]); | ||
label: 'Comment'; | ||
priority: 100; | ||
yourself | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionModelInfo [ | ||
<magritteDescription> | ||
^ MAStringDescription new | ||
beReadonly; | ||
accessor: (MAPluggableAccessor read: [ :me | '' ] write: [ :me :newValue | ]); | ||
label: self nameOfType; | ||
priority: 0; | ||
yourself | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionName [ | ||
<magritteDescription> | ||
^ MAStringDescription new | ||
accessor: (self descriptionAccessor: #name); | ||
label: 'Name'; | ||
priority: 1; | ||
yourself | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionVisibility [ | ||
<magritteDescription> | ||
^ MASingleOptionDescription new | ||
optionsAndLabels: | ||
{nil -> ''. | ||
OPUMLVisibilityKind public -> 'public'. | ||
OPUMLVisibilityKind protected -> 'protected'. | ||
OPUMLVisibilityKind private -> 'private'. | ||
OPUMLVisibilityKind new package -> 'package'}; | ||
reference: MAStringDescription new; | ||
accessor: | ||
(MAPluggableAccessor | ||
read: [ :me | me model visibility ] | ||
write: [ :me :newValue | | ||
me model visibility: newValue. | ||
self refreshFigure ]); | ||
label: 'Visibility'; | ||
priority: 8; | ||
beSorted; | ||
yourself | ||
] | ||
|
||
{ #category : #hooks } | ||
OPTUmlBaseController >> reactToAttributeWrite [ | ||
self subclassResponsibility | ||
] | ||
Trait { | ||
#name : #OPTUmlBaseController, | ||
#category : #'OpenPonk-ClassEditor-Controllers' | ||
} | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> buildNameEditorForm: aForm [ | ||
(aForm addTextInput: 'Name') | ||
text: self model name; | ||
whenTextIsAccepted: [ :newValue | | ||
self model name: newValue. | ||
self refreshFigure ] | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionAccessor: aSymbol [ | ||
^ MAPluggableAccessor | ||
read: [ :me | me model perform: aSymbol ] | ||
write: [ :me :newValue | | ||
me model perform: (aSymbol , ':') asSymbol with: newValue. | ||
self reactToAttributeWrite ] | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionComment [ | ||
<magritteDescription> | ||
^ MAMemoDescription new | ||
required: false; | ||
accessor: | ||
(MAPluggableAccessor | ||
read: [ :me | | ||
me model ownedComments | ||
ifEmpty: [ '' ] | ||
ifNotEmpty: [ :oc | oc first body asString ] ] | ||
write: [ :me :newValue | | ||
me model ownedComments | ||
ifEmpty: [ me model ownedComments add: OPUMLComment new ]. | ||
me model ownedComments first body: newValue asString. | ||
self reactToAttributeWrite ]); | ||
label: 'Comment'; | ||
priority: 100; | ||
yourself | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionModelInfo [ | ||
<magritteDescription> | ||
^ MAStringDescription new | ||
beReadonly; | ||
accessor: (MAPluggableAccessor read: [ :me | '' ] write: [ :me :newValue | ]); | ||
label: self nameOfType; | ||
priority: 0; | ||
yourself | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionName [ | ||
<magritteDescription> | ||
^ MAStringDescription new | ||
accessor: (self descriptionAccessor: #name); | ||
label: 'Name'; | ||
priority: 1; | ||
yourself | ||
] | ||
|
||
{ #category : #forms } | ||
OPTUmlBaseController >> descriptionVisibility [ | ||
<magritteDescription> | ||
^ MASingleOptionDescription new | ||
optionsAndLabels: | ||
{nil -> ''. | ||
OPUMLVisibilityKind public -> 'public'. | ||
OPUMLVisibilityKind protected -> 'protected'. | ||
OPUMLVisibilityKind private -> 'private'. | ||
OPUMLVisibilityKind new package -> 'package'}; | ||
reference: MAStringDescription new; | ||
accessor: | ||
(MAPluggableAccessor | ||
read: [ :me | me model visibility ] | ||
write: [ :me :newValue | | ||
me model visibility: newValue. | ||
self refreshFigure ]); | ||
label: 'Visibility'; | ||
priority: 8; | ||
beSorted; | ||
yourself | ||
] | ||
|
||
{ #category : #hooks } | ||
OPTUmlBaseController >> reactToAttributeWrite [ | ||
self subclassResponsibility | ||
] |
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
Oops, something went wrong.