diff --git a/src/MooseIDE-NewTools/FamixTFileAnchor.extension.st b/src/MooseIDE-NewTools/FamixTFileAnchor.extension.st new file mode 100644 index 000000000..a9602825e --- /dev/null +++ b/src/MooseIDE-NewTools/FamixTFileAnchor.extension.st @@ -0,0 +1,15 @@ +Extension { #name : #FamixTFileAnchor } + +{ #category : #'*MooseIDE-NewTools' } +FamixTFileAnchor >> miFullSourceInspectorExtension [ + + + ^ SpCodePresenter new + withoutSyntaxHighlight; + withLineNumbers; + text: self completeText; + addTextSegmentDecoration: (SpTextPresenterDecorator forHighlight + interval: (self startPos to: self endPos + 1); + yourself); + beNotEditable +] diff --git a/src/MooseIDE-NewTools/FamixTSourceAnchor.extension.st b/src/MooseIDE-NewTools/FamixTSourceAnchor.extension.st new file mode 100644 index 000000000..8c1f9e75d --- /dev/null +++ b/src/MooseIDE-NewTools/FamixTSourceAnchor.extension.st @@ -0,0 +1,12 @@ +Extension { #name : #FamixTSourceAnchor } + +{ #category : #'*MooseIDE-NewTools' } +FamixTSourceAnchor >> miSourceInspectorExtension [ + + + ^ SpCodePresenter new + withoutSyntaxHighlight; + withLineNumbers; + text: self sourceText; + beNotEditable +] diff --git a/src/MooseIDE-NewTools/FamixTSourceEntity.extension.st b/src/MooseIDE-NewTools/FamixTSourceEntity.extension.st index 7bff83fe1..429a7cc61 100644 --- a/src/MooseIDE-NewTools/FamixTSourceEntity.extension.st +++ b/src/MooseIDE-NewTools/FamixTSourceEntity.extension.st @@ -4,5 +4,9 @@ Extension { #name : #FamixTSourceEntity } FamixTSourceEntity >> miSourceInspectorExtension [ - ^ MiSourceExtension on: self + ^ SpCodePresenter new + withoutSyntaxHighlight; + withLineNumbers; + text: self sourceText; + beNotEditable ] diff --git a/src/MooseIDE-NewTools/MiFameExtension.class.st b/src/MooseIDE-NewTools/MiFameExtension.class.st deleted file mode 100644 index eca481437..000000000 --- a/src/MooseIDE-NewTools/MiFameExtension.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -Please comment me using the following template inspired by Class Responsibility Collaborator (CRC) design: - -For the Class part: State a one line summary. For example, ""I represent a paragraph of text"". - -For the Responsibility part: Three sentences about my main responsibilities - what I do, what I know. - -For the Collaborators Part: State my main collaborators and one line about how I interact with them. - -Public API and Key Messages - -- message one -- message two -- (for bonus points) how to create instances. - - One simple example is simply gorgeous. - -Internal Representation and Key Implementation Points. - - Instance Variables - model: - properties: - - - Implementation Points -" -Class { - #name : #MiFameExtension, - #superclass : #SpPresenter, - #instVars : [ - 'model', - 'fameDescription' - ], - #category : #'MooseIDE-NewTools-Inspector tabs' -} - -{ #category : #specs } -MiFameExtension class >> defaultLayout [ - - ^ SpBoxLayout newVertical - add: #fameDescription; - yourself -] - -{ #category : #initialization } -MiFameExtension >> initializePresenters [ - fameDescription := self newTable. - fameDescription - items: (self model mooseDescription allComplexProperties sorted: #name ascending); - addColumn: (SpStringTableColumn title: 'Name' evaluated: [ :item | item name ]) yourself; - addColumn: (SpStringTableColumn title: 'Type' evaluated: [ :item | item type name ]) yourself; - addColumn: (SpStringTableColumn title: 'Opposite' evaluated: [ :item | item opposite ifNil: [ '' ] ifNotNil: [ :opposite | opposite name ] ]) yourself; - addColumn: (SpStringTableColumn title: 'Derived?' evaluated: [ :item | item isDerived ]) yourself; - addColumn: (SpStringTableColumn title: 'Container?' evaluated: [ :item | item isContainer ]) yourself; - addColumn: (SpStringTableColumn title: 'IsTarget?' evaluated: [ :item | item isTarget ]) yourself; - addColumn: (SpStringTableColumn title: 'IsSource?' evaluated: [ :item | item isSource ]) yourself; - beResizable -] - -{ #category : #accessing } -MiFameExtension >> model [ - ^ model -] - -{ #category : #accessing } -MiFameExtension >> model: anObject [ - model := anObject. - fameDescription ifNotNil: [ :fd | fd items: model mooseDescription allComplexProperties ] -] - -{ #category : #'accessing - model' } -MiFameExtension >> setModelBeforeInitialization: aModel [ - self model: aModel -] diff --git a/src/MooseIDE-NewTools/MiSourceExtension.class.st b/src/MooseIDE-NewTools/MiSourceExtension.class.st deleted file mode 100644 index 0010205f1..000000000 --- a/src/MooseIDE-NewTools/MiSourceExtension.class.st +++ /dev/null @@ -1,44 +0,0 @@ -Class { - #name : #MiSourceExtension, - #superclass : #SpPresenter, - #instVars : [ - 'properties', - 'model', - 'sourceText' - ], - #category : #'MooseIDE-NewTools-Inspector tabs' -} - -{ #category : #layout } -MiSourceExtension class >> defaultLayout [ - - ^ SpBoxLayout newVertical - add: #sourceText; - yourself -] - -{ #category : #initialization } -MiSourceExtension >> initializePresenters [ - - sourceText := self newCode - withoutSyntaxHighlight; - withLineNumbers; - text: model sourceText; - beNotEditable -] - -{ #category : #initialization } -MiSourceExtension >> model [ - ^ model -] - -{ #category : #initialization } -MiSourceExtension >> model: anObject [ - model := anObject. - sourceText ifNotNil: [sourceText text: model sourceText] -] - -{ #category : #initialization } -MiSourceExtension >> setModelBeforeInitialization: aModel [ - self model: aModel -] diff --git a/src/MooseIDE-NewTools/MooseObject.extension.st b/src/MooseIDE-NewTools/MooseObject.extension.st index 91c2caf52..b701d92f8 100644 --- a/src/MooseIDE-NewTools/MooseObject.extension.st +++ b/src/MooseIDE-NewTools/MooseObject.extension.st @@ -15,7 +15,19 @@ MooseObject class >> inspectorToString [ MooseObject >> miFameInspectorExtension [ - ^ MiFameExtension on: self + ^ SpTablePresenter new + items: (self mooseDescription allComplexProperties sorted: #name ascending); + addColumn: (SpStringTableColumn title: 'Name' evaluated: [ :item | item name ]) yourself; + addColumn: (SpStringTableColumn title: 'Type' evaluated: [ :item | item type name ]) yourself; + addColumn: (SpStringTableColumn title: 'Opposite' evaluated: [ :item | + item opposite + ifNil: [ '' ] + ifNotNil: [ :opposite | opposite name ] ]) yourself; + addColumn: (SpStringTableColumn title: 'Derived?' evaluated: [ :item | item isDerived ]) yourself; + addColumn: (SpStringTableColumn title: 'Container?' evaluated: [ :item | item isContainer ]) yourself; + addColumn: (SpStringTableColumn title: 'IsTarget?' evaluated: [ :item | item isTarget ]) yourself; + addColumn: (SpStringTableColumn title: 'IsSource?' evaluated: [ :item | item isSource ]) yourself; + beResizable ] { #category : #'*MooseIDE-NewTools' }