Skip to content

Commit

Permalink
Move the main logic for printing to GtBareProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
chisandrei committed Aug 5, 2024
1 parent ee97460 commit 54bbe64
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 67 deletions.
54 changes: 29 additions & 25 deletions src/GToolkit-GemStone-BareProxy-Pharo/GtBareProxy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ GtBareProxy >> gtActionsInContext: aPhlowContext [
^ collectedActions
]

{ #category : #printing }
GtBareProxy >> gtBasicDisplayOn: aStream [
proxyObject ifNil: [
aStream << '<not configured>'.
^ self ].

proxyObject gtBasicDisplayOn: aStream
]

{ #category : #'gt inspector' }
GtBareProxy >> gtDefaultInspectorTool [
^ GtPhlowCompositeTool new
Expand All @@ -135,19 +144,9 @@ GtBareProxy >> gtDefaultInspectorTool [

{ #category : #printing }
GtBareProxy >> gtDisplayOn: aStream [
proxyObject ifNil: [
aStream << 'Bare Proxy on: <not configured>'.
^ self ].

proxyObject isProxyObjectActive ifFalse: [
aStream << 'Bare Proxy on: <not connected>'.
^ self ].

aStream
<< 'Bare Proxy on: ';
<< ([ proxyObject proxyPerform: #gtDisplayString autoCommit: false]
on: Error
do: [ :e | 'Error printing' ])

aStream << 'Bare Proxy on: '.
self gtBasicDisplayOn: aStream
]

{ #category : #printing }
Expand All @@ -159,17 +158,16 @@ GtBareProxy >> gtDisplayText [
{ #category : #printing }
GtBareProxy >> gtInspectorRemoteSideTitleStringOn: aStream [
proxyObject ifNil: [
aStream << 'a GtBareProxy'.
aStream << 'a GtGsBareProxy'.
^ self ].

proxyObject isProxyObjectActive ifFalse: [
aStream << 'Bare Proxy on: <not connected>'.
^ self ].

aStream
<< ([ proxyObject proxyPerform: #gtDisplayString autoCommit: false]
on: Error
do: [ :e | 'Error printing' ])

proxyObject gtBasicDisplayOn: aStream.

proxyObject gtSession ifNotNil:
[ :gtSession | aStream
<< ' [';
<< gtSession name;
<< ']' ]
]

{ #category : #printing }
Expand All @@ -185,7 +183,13 @@ GtBareProxy >> gtInspectorTitleString [

{ #category : #printing }
GtBareProxy >> gtInspectorTitleStringOn: aStream [
self gtDisplayOn: aStream
self gtDisplayOn: aStream.

proxyObject gtSession ifNotNil:
[ :gtSession | aStream
<< ' [';
<< gtSession name;
<< ']' ]
]

{ #category : #'gt inspector' }
Expand Down Expand Up @@ -288,7 +292,7 @@ GtBareProxy >> gtRemoteInspectorContentFor: aView [
context: GtPhlowContext new;
viewsSelector: #gtViewsForRemoteSideInContext:;
actionsSelector: #gtActionsForRemoteSideInContext:;
titleComputation: [
titleComputation: [
String streamContents: [ :aStream |
self gtInspectorRemoteSideTitleStringOn: aStream] ];
build
Expand Down
42 changes: 0 additions & 42 deletions src/GToolkit-GemStone-BareProxy-Pharo/GtGsBareProxy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -52,48 +52,6 @@ GtGsBareProxy >> asGtpoLocalObject [
^ proxyObject createGtpoLocalObjectLinkedToBareProxy: self.
]

{ #category : #printing }
GtGsBareProxy >> gtBasicDisplayOn: aStream [
proxyObject ifNil: [
aStream << '<not configured>'.
^ self ].

proxyObject gtBasicDisplayOn: aStream
]

{ #category : #printing }
GtGsBareProxy >> gtDisplayOn: aStream [

aStream << 'Bare Proxy on: '.
self gtBasicDisplayOn: aStream
]

{ #category : #printing }
GtGsBareProxy >> gtInspectorRemoteSideTitleStringOn: aStream [
proxyObject ifNil: [
aStream << 'a GtGsBareProxy'.
^ self ].

proxyObject gtBasicDisplayOn: aStream.

proxyObject gtSession ifNotNil:
[ :gtSession | aStream
<< ' [';
<< gtSession name;
<< ']' ]
]

{ #category : #printing }
GtGsBareProxy >> gtInspectorTitleStringOn: aStream [
super gtInspectorTitleStringOn: aStream.

proxyObject gtSession ifNotNil:
[ :gtSession | aStream
<< ' [';
<< gtSession name;
<< ']' ]
]

{ #category : #printing }
GtGsBareProxy >> gtRemoteSideInitialPlaygroundSnippet [
^ LeGemStoneSnippet new
Expand Down

0 comments on commit 54bbe64

Please sign in to comment.