Skip to content

Commit

Permalink
30593
Browse files Browse the repository at this point in the history
- Issue 12232 More enhancement in MorphTreeMorph
	https://pharo.fogbugz.com/f/cases/12232/More-enhancement-in-MorphTreeMorph
	
- Issue 12179 Nautilus - Add package filter input box
	https://pharo.fogbugz.com/f/cases/12179

http://files.pharo.org/image/30/30593.zip
  • Loading branch information
Jenkins Build Server authored and ci committed Nov 24, 2013
1 parent 956cac7 commit 0132a14
Show file tree
Hide file tree
Showing 22 changed files with 348 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ addMorphsAfter: parentMorph fromCollection: aCollection
prior: priorMorph
forList: self
indentLevel: parentMorph indentLevel + 1.
morphList add: priorMorph.
item selected ifTrue: [ priorMorph selected: true ] ].
morphList add: priorMorph ].

"Set new child morphs index"
1 to: morphList size do: [:i | | m | (m := morphList at: i) index: i + parentMorph index].
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
isExpanded

^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
isExpanded: aBoolean
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
isExpanded: aBoolean

isExpanded := aBoolean
isExpanded := aBoolean.
self complexContents isExpanded: aBoolean
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
setSelectedSilently: aBoolean

selected := aBoolean.
self complexContents selected: aBoolean
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ initWithContents: anObject prior: priorMorph forList: hostList indentLevel: newL
self cellInset: (container resizerWidth @ 0).
complexContents := anObject.
anObject addDependent: self.
isExpanded := false.
isExpanded := anObject isExpanded.
nextSibling := firstChild := nil.
priorMorph ifNotNil: [priorMorph nextSibling: self].
indentLevel := newLevel.
self setBalloonText: anObject helpText.
self initRow
self initRow.
anObject selected ifTrue: [ self selectedWithoutNotifyingComplexContents: true ]

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
selectedWithoutNotifyingComplexContents: aBoolean
selected = aBoolean
ifTrue: [^ self].
aBoolean
ifTrue: [container selectedMorphList add: self]
ifFalse: [selected
ifNotNil: [container selectedMorphList remove: self]].
selected := aBoolean.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ toggleExpandedState

| toDelete |

isExpanded := isExpanded not.
self isExpanded: self isExpanded not.
toDelete := OrderedCollection new.
firstChild ifNotNil: [
firstChild withSiblingsDo: [ :aNode | aNode recursiveAddTo: toDelete].
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageMatchPattern: aRPackage

^ self model packageMatchPattern: aRPackage
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
packagesAsNodes
^ (self model packages
collect: [ :each | PackageTreePackageNodeModel with: each model: self ])
sorted: [ :a :b | a name < b name ]
^ ((self model packages
select: [ :each | self packageMatchPattern: each ]
thenCollect: [ :each | PackageTreePackageNodeModel with: each model: self ])
sorted: [ :a :b | a name < b name ])
2 changes: 1 addition & 1 deletion Nautilus.package/PackageTreeNautilusUI.class/definition.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NautilusUI subclass: #PackageTreeNautilusUI
instanceVariableNames: ''
instanceVariableNames: 'packagePattern'
classVariableNames: ''
poolDictionaries: ''
category: 'Nautilus-Tree'
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ buildFirstColumn: aWindow
vResizing: #rigid;
height: 25.

^PanelMorph new
^ firstColumn := PanelMorph new
changeProportionalLayout;
addMorph: self buildPackageSearch
fullFrame: ((0@0 corner: 1@0.1) "bottomOffset: -25");
addMorph: self buildList
fullFrame: ( LayoutFrame identity bottomOffset: -25);
fullFrame: ((0@0.1 corner: 1@1) asLayoutFrame bottomOffset: -25);
addMorph: buttons
fullFrame: ((0@1 corner: 1@1) asLayoutFrame topOffset: -25);
hResizing: #spaceFill;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
buildPackageSearch
"It is an search dialog which filters package list"
^ SearchMorph new
model: self;
updateSelector: #packageSearchUpdate:;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ensureSafePackagePattern: aPattern
^ [ aPattern asRegexIgnoringCase ]
on: RegexSyntaxError
do: [ :ex | self fixPackagePattern: aPattern ex: ex ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fixPackagePattern: aPattern ex: anException
| fixedPattern |
fixedPattern := aPattern copyReplaceAll: '*' with: '.*' .

^ [ fixedPattern asRegexIgnoringCase ]
on: RegexSyntaxError
do: [ :ex | '.*' asRegexIgnoringCase ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packageMatchPattern: aRPackage

^ self packagePattern search: aRPackage name
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packagePattern
^ packagePattern ifNil: [ '.*' asRegexIgnoringCase ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packageSearchUpdate: aPattern
packagePattern := (aPattern isNil or: [ aPattern trimBoth isEmpty ])
ifTrue: [ '.*' asRegexIgnoringCase ]
ifFalse: [ self ensureSafePackagePattern: aPattern ].
self updatePackages
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
updatePackages

list buildContents
Loading

0 comments on commit 0132a14

Please sign in to comment.