Change the Package-Chooser-Dialog when using "Move to package..."?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Change the Package-Chooser-Dialog when using "Move to package..."?

MartinW
Hi,
i always find the Package-Chooser-Dialog (See Screenshot) when using "Move to package..." (e.g. from Nautilus) very strange to use.
Why not replacing it with "SearchFacade rPackageSearch" (See second Screenshot)?

I tried by changing AbstractTool >> moveInNewPackage:

from:
moveInNewPackage: aCollection

        | labels reject lines oldIndex newName item aPackage |
        aCollection ifEmpty: [^ nil ].
        aPackage := aCollection first package.
        labels := self model packages collect: [:each | each name].
        lines := {0}.
               
        newName := UIManager default chooseOrRequestFrom: labels lines: lines title: ('Change Package (current: ', aPackage name,')').
        newName ifNil: [ ^ nil ].
        newName := newName asSymbol.

        item := self browsedEnvironment packageOrganizer packageNamed: newName.
        aCollection do: [:aClass |
                aPackage removeClass: aClass.
                item addClassDefinition: aClass.
                aClass category: item name ].
        ^ item

to:
moveInNewPackage: aCollection

        | originalPackage newPackage |
        aCollection ifEmpty: [^ nil ].
        originalPackage := aCollection first package.

        newPackage := SearchFacade rPackageSearch chooseFromOwner: self window.
        newPackage ifNil: [ ^ nil ].
       
        aCollection do: [:aClass |
                originalPackage removeClass: aClass.
                newPackage addClassDefinition: aClass.
                aClass category: newPackage name ].
        ^ newPackage

Old Package Chooser Dialog
Package Search
Reply | Threaded
Open this post in threaded view
|

Re: Change the Package-Chooser-Dialog when using "Move to package..."?

Stéphane Ducasse
+ 1

;)

Stef

On Jul 23, 2013, at 3:02 PM, MartinW <[hidden email]> wrote:

> Hi,
> i always find the Package-Chooser-Dialog (See Screenshot) when using "Move
> to package..." (e.g. from Nautilus) very strange to use.
> Why not replacing it with "SearchFacade rPackageSearch" (See second
> Screenshot)?
>
> I tried by changing AbstractTool >> moveInNewPackage:
>
> from:
> moveInNewPackage: aCollection
>
> | labels reject lines oldIndex newName item aPackage |
> aCollection ifEmpty: [^ nil ].
> aPackage := aCollection first package.
> labels := self model packages collect: [:each | each name].
> lines := {0}.
>
> newName := UIManager default chooseOrRequestFrom: labels lines: lines
> title: ('Change Package (current: ', aPackage name,')').
> newName ifNil: [ ^ nil ].
> newName := newName asSymbol.
>
> item := self browsedEnvironment packageOrganizer packageNamed: newName.
> aCollection do: [:aClass |
> aPackage removeClass: aClass.
> item addClassDefinition: aClass.
> aClass category: item name ].
> ^ item
>
> to:
> moveInNewPackage: aCollection
>
> | originalPackage newPackage |
> aCollection ifEmpty: [^ nil ].
> originalPackage := aCollection first package.
>
> newPackage := SearchFacade rPackageSearch chooseFromOwner: self window.
> newPackage ifNil: [ ^ nil ].
>
> aCollection do: [:aClass |
> originalPackage removeClass: aClass.
> newPackage addClassDefinition: aClass.
> aClass category: newPackage name ].
> ^ newPackage
>
> <http://forum.world.st/file/n4700280/Old_Change_Package_Dialog.png>
> <http://forum.world.st/file/n4700280/Package_search.png>
>
>
>
> --
> View this message in context: http://forum.world.st/Change-the-Package-Chooser-Dialog-when-using-Move-to-package-tp4700280.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Change the Package-Chooser-Dialog when using "Move to package..."?

Benjamin Van Ryseghem (Pharo)
+ 1 000 000

Ben

On Jul 23, 2013, at 5:31 PM, Stéphane Ducasse <[hidden email]> wrote:

+ 1

;)

Stef

On Jul 23, 2013, at 3:02 PM, MartinW <[hidden email]> wrote:

Hi,
i always find the Package-Chooser-Dialog (See Screenshot) when using "Move
to package..." (e.g. from Nautilus) very strange to use.
Why not replacing it with "SearchFacade rPackageSearch" (See second
Screenshot)?

I tried by changing AbstractTool >> moveInNewPackage:

from:
moveInNewPackage: aCollection

| labels reject lines oldIndex newName item aPackage |
aCollection ifEmpty: [^ nil ].
aPackage := aCollection first package.
labels := self model packages collect: [:each | each name].
lines := {0}.

newName := UIManager default chooseOrRequestFrom: labels lines: lines
title: ('Change Package (current: ', aPackage name,')').
newName ifNil: [ ^ nil ].
newName := newName asSymbol.

item := self browsedEnvironment packageOrganizer packageNamed: newName.
aCollection do: [:aClass |
aPackage removeClass: aClass.
item addClassDefinition: aClass.
aClass category: item name ].
^ item

to:
moveInNewPackage: aCollection

| originalPackage newPackage |
aCollection ifEmpty: [^ nil ].
originalPackage := aCollection first package.

newPackage := SearchFacade rPackageSearch chooseFromOwner: self window.
newPackage ifNil: [ ^ nil ].

aCollection do: [:aClass |
originalPackage removeClass: aClass.
newPackage addClassDefinition: aClass.
aClass category: newPackage name ].
^ newPackage

<http://forum.world.st/file/n4700280/Old_Change_Package_Dialog.png>
<http://forum.world.st/file/n4700280/Package_search.png>



--
View this message in context: http://forum.world.st/Change-the-Package-Chooser-Dialog-when-using-Move-to-package-tp4700280.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.