Skip to content

Commit

Permalink
A set of extra gtViews for (internal) Iceberg classes
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Oct 21, 2024
1 parent f368568 commit 667acb2
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/GToolkit4Git/IceBasicProject.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Extension { #name : #IceBasicProject }

{ #category : #'*GToolkit4Git' }
IceBasicProject >> gtViewDetailsIn: composite [
<gtView>
^ composite columnedList
title: 'Details';
priority: 20;
items: [ {
{ 'project name' . self projectName }.
{ 'repository' . self repository }.
{ 'commitish' . self commitish }.
{ 'project file path' . self projectFilePath }.
{ 'source directory' . self sourceDirectory }.
{ 'tags' . $, join: self tags. self tags }.
{ 'dirty' . self isDirty }.
} ];
column: 'Key' text: #first;
column: 'Value' text: #second weight: 3;
send: #last;
actionUpdateButton
]

{ #category : #'*GToolkit4Git' }
IceBasicProject >> gtViewPropertiesIn: aView [
<gtView>
^ aView forward
title: 'Properties';
priority: 30;
object: [ self properties ];
view: #gtItemsFor:
]
10 changes: 10 additions & 0 deletions src/GToolkit4Git/IceGitCliIndex.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ IceGitCliIndex >> addLepiterDatabase: aDatabaseDefinition [
self addPath: (RelativePath
withAll: aDatabaseDefinition localRootRelativePath)
]

{ #category : #'*GToolkit4Git' }
IceGitCliIndex >> gtViewPathsIn: composite [
<gtView>
^ composite list
title: 'Paths';
priority: 20;
items: [ modifiedFilePaths asArray ];
itemText: #yourself
]
31 changes: 31 additions & 0 deletions src/GToolkit4Git/IceRepository.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,37 @@ IceRepository >> gtToolActionFor: composite [
spawnObject: (GtGitRepository fromIcebergRepository: self) ]
]

{ #category : #'*GToolkit4Git' }
IceRepository >> gtViewDetailsIn: composite [
<gtView>
^ composite columnedList
title: 'Details';
priority: 10;
items: [ {
{ 'name' . self name }.
{ 'origin' . [ self originUrl ] on: Error do: [ '' ] }.
{ 'branch' . [ self branchName ] on: Error do: [ '' ] }.
{ 'code directory'
. [ self codeDirectory ] on: Error do: [ '' ]
. [ self codeDirectory asFileReference ] on: Error do: [ '' ]}.
{ 'head' . self head }.
{ 'head commit' . self headCommit }.
{ 'working copy' . self workingCopy }.
{ 'index' . self index }.
{ 'implementation'
. self isGitCliRepository
ifTrue: [ 'Libgit-CLI' ]
ifFalse: [ 'Libgit2 FFI' ] }.
{ 'missing' . self isMissing }.
{ 'modified' . [ self isModified ] on: Error do: [ '' ] }.
{ 'dirty' . [ self isDirty ] on: Error do: [ '' ] }.
} ];
column: 'Key' text: #first;
column: 'Value' text: #second weight: 3;
send: #last;
actionUpdateButton
]

{ #category : #'*GToolkit4Git' }
IceRepository >> gtViewDiffToReferenceCommitFor: aView [
"<gtView>"
Expand Down
32 changes: 32 additions & 0 deletions src/GToolkit4Git/IceRepositoryProperties.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Extension { #name : #IceRepositoryProperties }

{ #category : #'*GToolkit4Git' }
IceRepositoryProperties >> gtViewDetailsIn: composite [
<gtView>
^ composite columnedList
title: 'Details';
priority: 20;
items: [ {
{ 'repository' . self repository }.
{ 'commitish' . self commitish }.
{ 'file format' . self fileFormat id }.
{ 'reader class' . self readerClass }.
{ 'writer class' . self writerClass }.
{ 'dirty' . self isDirty }.
{ 'unborn' . self isUnborn }.
} ];
column: 'Key' text: #first;
column: 'Value' text: #second weight: 3;
send: #last;
actionUpdateButton
]

{ #category : #'*GToolkit4Git' }
IceRepositoryProperties >> gtViewPropertiesIn: aView [
<gtView>
^ aView forward
title: 'Properties';
priority: 30;
object: [ self properties ];
view: #gtItemsFor:
]
21 changes: 21 additions & 0 deletions src/GToolkit4Git/IceWorkingCopy.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@ IceWorkingCopy >> gtPackagesFor: aView [
tooltip: 'Add Package'
]

{ #category : #'*GToolkit4Git' }
IceWorkingCopy >> gtViewDetailsIn: composite [
<gtView>
^ composite columnedList
title: 'Details';
priority: 10;
items: [ {
{ 'repository' . self repository }.
{ 'reference commit' . self referenceCommit }.
{ 'project' . self project }.
{ 'properties' . self properties }.
{ 'modified' . self isModified }.
{ 'detached' . self isDetached }.
{ 'in merge' . self isInMerge }.
} ];
column: 'Key' text: #first;
column: 'Value' text: #second weight: 3;
send: #last;
actionUpdateButton
]

{ #category : #'*GToolkit4Git' }
IceWorkingCopy >> gtViewDiffToReferenceCommitFor: aView [
<gtView>
Expand Down

0 comments on commit 667acb2

Please sign in to comment.