Tools__ChangeSetDiffTool.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 17 Mar 2012 10:21:50 +0000
branchjv
changeset 12192 15f47901fb64
parent 12179 47f98e7d6de1
child 12198 414e7b69ecda
permissions -rw-r--r--
Fixes in Diff2/Diff3 text views

"
 Copyright (c) 2007-2010 Jan Vrany
 Copyright (c) 2009-2010 eXept Software AG

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the 'Software'), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
"
"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

ApplicationModel subclass:#ChangeSetDiffTool
	instanceVariableNames:'listHolder singleSelectionHolder diffsetHolder titleHolder
		firstColSelectionHolder navigatorPanelSpecHolder diffMenuHolder
		diffsetHolderPrivate selectionHolder versionATextHolder
		versionBTextHolder versionBaseTextHolder textDiffToolHolder
		textDiffToolWindowSpecHolder'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Diff'
!

SimpleDialog subclass:#OpenDialog
	instanceVariableNames:'doAcceptEnabled changesetSpecAHolder changesetSpecBHolder
		changesetSpecBaseHolder'
	classVariableNames:'LastDirectory'
	poolDictionaries:''
	privateIn:ChangeSetDiffTool
!

!ChangeSetDiffTool class methodsFor:'documentation'!

copyright
"
 Copyright (c) 2007-2010 Jan Vrany
 Copyright (c) 2009-2010 eXept Software AG

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the 'Software'), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.

"
!

documentation
"
    Tool for viewing/merging differences between two change sets

    [author:]
        Jan Vrany <jan.vrany@fit.cvut.cz>

    [instance variables:]

    [class variables:]

    [see also:]

"
!

examples
"
  Starting the application:
                                                                [exBegin]
    Tools::ChangeSetDiffTool open

                                                                [exEnd]

  Show differences between CVS HEAD and SVN jv-branch 
  NewSystemBrowser:
                                                                [exBegin]
    | cvsCs svnCs |

    cvsCs := ChangeSet fromFile:'/home/jv/Private/Projects/SmalltalkX/sources/branches/exept@HEAD/stx/libtool/Tools__NewSystemBrowser.st'.
    svnCs := ChangeSet fromFile:'/home/jv/Private/Projects/SmalltalkX/sources/branches/jv2/build/stx/libtool/Tools__NewSystemBrowser.st'.

    Tools::ChangeSetDiffTool new
        open;
        fileMenuOpenOnDiffBetween: cvsCs and: svnCs.

                                                                [exEnd]

  Show differences between CVS HEAD and SVN jv-branch and
  base version of NewSystemBrowser:

                                                                [exBegin]
    | cvsBaseCs cvsCs svnCs |

    cvsBaseCs := ChangeSet fromFile:'/home/jv/Private/Projects/SmalltalkX/sources/branches/exept@2012-01-01/stx/libtool/Tools__NewSystemBrowser.st'.
    cvsCs := ChangeSet fromFile:'/home/jv/Private/Projects/SmalltalkX/sources/branches/exept@HEAD/stx/libtool/Tools__NewSystemBrowser.st'.
    svnCs := ChangeSet fromFile:'/home/jv/Private/Projects/SmalltalkX/sources/branches/jv2/build/stx/libtool/Tools__NewSystemBrowser.st'.

    Tools::ChangeSetDiffTool new
        open;
        fileMenuOpenOnDiffBetween: cvsCs and: svnCs base: cvsBaseCs

                                                                [exEnd]



"
! !

!ChangeSetDiffTool class methodsFor:'accessing - defaults'!

versionAColor

    ^Color green lightened lightened

    "Created: / 01-11-2009 / 10:14:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBColor

    ^Color blue lightened lightened

    "Created: / 01-11-2009 / 10:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBaseColor

    ^Color yellow lightened lightened

    "Created: / 01-11-2009 / 10:14:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionNotPresentText
    ^ 'Not present' asText allItalic colorizeAllWith:Color gray lighter
! !

!ChangeSetDiffTool class methodsFor:'image specs'!

versionA24x24

    ^ToolbarIconLibrary versionA24x24

    "Created: / 24-03-2010 / 20:49:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionB24x24

    ^ToolbarIconLibrary versionB24x24

    "Created: / 24-03-2010 / 20:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool class methodsFor:'interface specs'!

labelSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:SVN::DiffBrowser andSelector:#labelSpec
     SVN::DiffBrowser new openInterface:#labelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: labelSpec
        window: 
       (WindowSpec
          label: 'Label'
          name: 'Label'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 600 48)
        )
        component: 
       (SpecCollection
          collection: (
           (UISubSpecification
              name: 'LabelA'
              layout: (LayoutFrame 0 0 0 0 0 1 0 0.5)
              minorKey: versionALabelSpec
            )
           (UISubSpecification
              name: 'LabelB'
              layout: (LayoutFrame 0 0 0 0.5 0 1 0 1)
              minorKey: versionBLabelSpec
            )
           )
         
        )
      )
!

oneColumnNavigatorSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffBrowser andSelector:#oneColumnNavigatorSpec
     Tools::ChangeSetDiffBrowser new openInterface:#oneColumnNavigatorSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: oneColumnNavigatorSpec
        window: 
       (WindowSpec
          label: 'One Column Navigator'
          name: 'One Column Navigator'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 300)
        )
        component: 
       (SpecCollection
          collection: (
           (SubCanvasSpec
              name: 'DiffList'
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
              hasHorizontalScrollBar: false
              hasVerticalScrollBar: false
              majorKey: #'Tools::ChangeSetDiffList'
              subAspectHolders: 
             (Array
                
               (SubChannelInfoSpec
                  subAspect: inGeneratorHolder
                  aspect: diffsetHolderPrivate
                ) 
               (SubChannelInfoSpec
                  subAspect: listEntryLabelGenerator
                  aspect: diffListEntryLabelGeneratorAspect
                )
                
               (SubChannelInfoSpec
                  subAspect: menuHolder
                  aspect: listMenuHolder
                ) 
               (SubChannelInfoSpec
                  subAspect: outGeneratorHolder
                  aspect: selectionHolder
                )
              )
              createNewApplication: true
              createNewBuilder: false
            )
           )
         
        )
      )
!

twoColumnNavigatorSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffBrowser andSelector:#twoColumnNavigatorSpec
     Tools::ChangeSetDiffBrowser new openInterface:#twoColumnNavigatorSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: twoColumnNavigatorSpec
        window: 
       (WindowSpec
          label: 'Two Column Navigator'
          name: 'Two Column Navigator'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 300)
        )
        component: 
       (SpecCollection
          collection: (
           (VariableHorizontalPanelSpec
              name: 'Columns'
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
              component: 
             (SpecCollection
                collection: (
                 (SubCanvasSpec
                    name: 'FirstColumn'
                    hasHorizontalScrollBar: false
                    hasVerticalScrollBar: false
                    majorKey: #'Tools::ChangeSetDiffList'
                    subAspectHolders: 
                   (Array
                      
                     (SubChannelInfoSpec
                        subAspect: inGeneratorHolder
                        aspect: diffsetHolderPrivate
                      ) 
                     (SubChannelInfoSpec
                        subAspect: listEntryLabelGenerator
                        aspect: diffListEntryLabelGeneratorAspect
                      )
                      
                     (SubChannelInfoSpec
                        subAspect: menuHolder
                        aspect: listMenuHolder
                      ) 
                     (SubChannelInfoSpec
                        subAspect: outGeneratorHolder
                        aspect: firstColSelectionHolder
                      )
                    )
                    createNewApplication: true
                    createNewBuilder: true
                  )
                 (SubCanvasSpec
                    name: 'SecondColumn'
                    hasHorizontalScrollBar: false
                    hasVerticalScrollBar: false
                    majorKey: #'Tools::ChangeSetDiffList'
                    subAspectHolders: 
                   (Array
                      
                     (SubChannelInfoSpec
                        subAspect: inGeneratorHolder
                        aspect: firstColSelectionHolder
                      ) 
                     (SubChannelInfoSpec
                        subAspect: listEntryLabelGenerator
                        aspect: diffListEntryLabelGeneratorAspect
                      )
                      
                     (SubChannelInfoSpec
                        subAspect: menuHolder
                        aspect: listMenuHolder
                      ) 
                     (SubChannelInfoSpec
                        subAspect: outGeneratorHolder
                        aspect: selectionHolder
                      )
                    )
                    createNewApplication: true
                    createNewBuilder: true
                  )
                 )
               
              )
              handles: (Any 0.5 1.0)
            )
           )
         
        )
      )
!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffTool andSelector:#windowSpec
     Tools::ChangeSetDiffTool new openInterface:#windowSpec
     Tools::ChangeSetDiffTool open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'Diff Browser'
          name: 'Diff Browser'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 1024 768)
          menu: mainMenu
        )
        component: 
       (SpecCollection
          collection: (
           (UISubSpecification
              name: 'Label'
              layout: (LayoutFrame 0 0 0 0 0 1 56 0)
              minorKey: labelSpec
            )
           (VariableVerticalPanelSpec
              name: 'Panel'
              layout: (LayoutFrame 0 0 56 0 0 1 0 1)
              showHandle: true
              component: 
             (SpecCollection
                collection: (
                 (SubCanvasSpec
                    name: 'NavigatorPanel'
                    hasHorizontalScrollBar: false
                    hasVerticalScrollBar: false
                    specHolder: navigatorPanelSpecHolder
                    createNewBuilder: false
                  )
                 (SubCanvasSpec
                    name: 'TextDiff'
                    majorKey: #'Tools::TextDiffTool'
                    minorKey: windowSpecForEmbedding
                    specHolder: textDiffToolWindowSpecHolder
                    clientHolder: textDiffToolHolder
                    createNewBuilder: false
                  )
                 )
               
              )
              handles: (Any 0.5 1.0)
            )
           )
         
        )
      )
! !

!ChangeSetDiffTool class methodsFor:'interface specs - labels'!

versionALabelSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffTool andSelector:#versionALabelSpec
     Tools::ChangeSetDiffTool new openInterface:#versionALabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionALabelSpec
        window: 
       (WindowSpec
          label: 'Version A'
          name: 'Version A'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
          backgroundColor: (Color 79.6078431372549 90.5882352941177 69.4117647058823)
          forceRecursiveBackground: true
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionA24x24'
              name: 'VersionAIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version A'
              name: 'VersionALabel'
              layout: (LayoutFrame 30 0 0 0 0 1 0 1)
              translateLabel: true
              labelChannel: versionALabelHolder
              resizeForLabel: true
              adjust: left
            )
           (LabelSpec
              label: '(A)'
              name: 'ALabel'
              layout: (LayoutFrame -30 1 0 0 0 1 0 1)
              translateLabel: true
            )
           )
         
        )
      )
!

versionBLabelSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffTool andSelector:#versionBLabelSpec
     Tools::ChangeSetDiffTool new openInterface:#versionBLabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionBLabelSpec
        window: 
       (WindowSpec
          label: 'Version B'
          name: 'Version B'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
          backgroundColor: (Color 100.0 90.5882352941177 60.0)
          forceRecursiveBackground: true
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionB24x24'
              name: 'VersionBIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version B'
              name: 'VersionBLabel'
              layout: (LayoutFrame 30 0 0 0 167 0 0 1)
              translateLabel: true
              labelChannel: versionBLabelHolder
              resizeForLabel: true
              adjust: left
              useDynamicPreferredWidth: true
              usePreferredWidth: true
            )
             (LabelSpec
             label: '(B)'
             name: 'BLabel'
             layout: (LayoutFrame -30 1 0 0 0 1 0 1)
             translateLabel: true
            )
           )
         
        )
      )

    "Modified: / 16-12-2011 / 14:17:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool class methodsFor:'menu specs'!

listMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."


    "
     MenuEditor new openOnClass:Tools::ChangeSetDiffTool andSelector:#listMenu
     (Menu new fromLiteralArrayEncoding:(Tools::ChangeSetDiffTool listMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            label: 'Browse'
            itemValue: listMenuBrowse
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            label: 'Load version A'
            itemValue: listMenuLoadVersionA
            nameKey: LoadVersionA
            translateLabel: true
            labelImage: (ResourceRetriever #'SVN::IconLibrary' versionA16x16 'Load version A')
          )
         (MenuItem
            label: 'Load version B'
            itemValue: listMenuLoadVersionB
            nameKey: LoadVersionB
            translateLabel: true
            labelImage: (ResourceRetriever #'SVN::IconLibrary' versionB16x16 'Load version B')
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            label: 'Open in...'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  enabled: hasSelection
                  label: 'Inspector'
                  itemValue: listMenuInspect
                  translateLabel: true
                )
               (MenuItem
                  label: 'kdiff3'
                  itemValue: listMenuOpenInExternal:
                  translateLabel: true
                  argument: 'kdiff3'
                )
               (MenuItem
                  label: 'meld'
                  itemValue: listMenuOpenInExternal:
                  translateLabel: true
                  argument: 'meld'
                )
               )
              nil
              nil
            )
          )
         )
        nil
        nil
      )
!

mainMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."


    "
     MenuEditor new openOnClass:Tools::ChangeSetDiffTool andSelector:#mainMenu
     (Menu new fromLiteralArrayEncoding:(Tools::ChangeSetDiffTool mainMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            label: 'File'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  label: 'Open'
                  itemValue: fileMenuOpen
                  translateLabel: true
                  shortcutKey: Ctrlo
                )
               (MenuItem
                  enabled: false
                  label: 'Save as patch '
                  itemValue: fileMenuSaveAsPatch
                  translateLabel: true
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  label: 'Exit'
                  itemValue: closeRequest
                  translateLabel: true
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            label: 'Changeset'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  label: 'Browse changes (A)'
                  itemValue: changesetMenuBrowseA
                  translateLabel: true
                )
                (MenuItem
                    label: 'Browse changes (B)'
                    itemValue: changesetMenuBrowseB
                    translateLabel: true
                    )

               )
              nil
              nil
            )
          )
         (MenuItem
            label: 'Diff'
            translateLabel: true
            submenuChannel: listMenu
          )
         )
        nil
        nil
      )

    "Modified: / 16-12-2011 / 14:24:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool class methodsFor:'plugIn spec'!

aspectSelectors
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this. If it is corrupted,
     the UIPainter may not be able to read the specification."

    "Return a description of exported aspects;
     these can be connected to aspects of an embedding application
     (if this app is embedded in a subCanvas)."

    ^ #(
        #diffsetHolder
      ).

! !

!ChangeSetDiffTool methodsFor:'accessing'!

beSingleColumn

    self navigatorPanelSpecHolder value: #oneColumnNavigatorSpec

    "Created: / 20-11-2009 / 20:41:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

beTwoColumn

    self navigatorPanelSpecHolder value: #twoColumnNavigatorSpec

    "Created: / 20-11-2009 / 20:42:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

beTwoColumn: aBoolean

    aBoolean
        ifTrue:[self beTwoColumn]
        ifFalse:[self beSingleColumn]

    "Created: / 20-11-2009 / 20:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

diffset
    
    ^self diffsetHolder value

    "Created: / 05-12-2009 / 11:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

diffset: aDiff3Set

    self diffsetHolder value: aDiff3Set

    "Created: / 01-11-2009 / 09:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

patchset

    | patchset |
    patchset := ChangeSet new.
    self diffset do:
        [:diff|patchset add:diff versionA].
    ^patchset

    "Created: / 05-12-2009 / 11:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

selection

    ^self selectionHolder value

    "Created: / 22-10-2008 / 11:30:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

selection: selection

    ^self selectionHolder value: selection

    "Created: / 22-10-2008 / 11:30:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

title: aString

    self titleHolder value: aString

    "Created: / 19-11-2009 / 15:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool methodsFor:'accessing - selection'!

theSingleSelectedObject

    | sel selSize obj |
    sel := self selection.

    (sel isCollection and:[self isString not])
        ifFalse:[^sel].

    selSize := 0.
    obj := nil.        
    sel do:
        [:each|
        selSize := selSize + 1.
        selSize > 1 ifTrue:[^nil].
        obj := each].
    ^obj

    "Created: / 10-11-2009 / 11:12:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 20-11-2009 / 19:54:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool methodsFor:'accessing - subapps'!

textDiff2Tool

    ^TextDiff2Tool new
        labelAHolder: self versionALabelHolder;
         textAHolder: self versionATextHolder;

        labelBHolder: self versionBLabelHolder;
         textBHolder: self versionBTextHolder;

        yourself

    "Created: / 16-03-2012 / 13:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

textDiff3Tool

    ^TextDiff3Tool new
        labelCHolder: self versionBaseLabelHolder;
         textCHolder: self versionBaseTextHolder;

        labelBHolder: self versionBLabelHolder;
         textBHolder: self versionBTextHolder;


        labelAHolder: self versionALabelHolder;
         textAHolder: self versionATextHolder;



        yourself

    "Created: / 16-03-2012 / 15:16:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool methodsFor:'aspects'!

diffListEntryLabelGeneratorAspect

    ^nil

    "Created: / 24-11-2009 / 10:01:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

diffsetHolder
    "return/create the 'diffsetHolder' value holder (automatically generated)"

    diffsetHolder isNil ifTrue:[
        diffsetHolder := ValueHolder new.
        diffsetHolder addDependent:self.
    ].
    ^ diffsetHolder
!

diffsetHolder:aValueHolder
    "set the 'diffsetHolder' value holder (automatically generated)"

    |oldValue newValue|

    diffsetHolder notNil ifTrue:[
        oldValue := diffsetHolder value.
        diffsetHolder removeDependent:self.
    ].
    diffsetHolder := aValueHolder.
    diffsetHolder notNil ifTrue:[
        diffsetHolder addDependent:self.
    ].
    newValue := diffsetHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:diffsetHolder.
    ].
!

diffsetHolderPrivate
    "return/create the 'diffSetHolderPrivate' value holder (automatically generated)"

    diffsetHolderPrivate isNil ifTrue:[
        diffsetHolderPrivate := ValueHolder with: (self diffsetHolder value).
    ].
    ^ diffsetHolderPrivate

    "Created: / 05-12-2009 / 11:03:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

firstColSelectionHolder
    "return/create the valueHolder 'firstColSelectionHolder'"

    firstColSelectionHolder isNil ifTrue:[
        firstColSelectionHolder := ValueHolder with:nil "defaultValue here".
    ].
    ^ firstColSelectionHolder
!

hasSelectionHolder

    |holder|

    (holder := builder bindingAt:#hasSelectionHolder) isNil ifTrue:[
        holder := (AspectAdaptor forAspect: #notEmptyOrNil)
            subjectChannel: self selectionHolder.
        builder aspectAt:#hasSelectionHolder put: holder
    ].
    ^ holder.

    "Created: / 22-10-2008 / 11:34:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 22-10-2008 / 12:38:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

listHolder
    "return/create the 'listHolder' value holder (automatically generated)"

    listHolder isNil ifTrue:[
        listHolder := ValueHolder new.
    ].
    ^ listHolder

    "Modified: / 01-11-2009 / 16:57:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

listMenuHolder
    diffMenuHolder isNil ifTrue:[ 
        diffMenuHolder := ValueHolder with:(Menu decodeFromLiteralArray: self class listMenu) 
    ].
    ^ diffMenuHolder

    "Created: / 21-11-2009 / 18:52:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 09-12-2009 / 23:34:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 18-11-2011 / 14:57:47 / cg"
!

nameAspect

    ^(AspectAdaptor forAspect: #name)
        subjectChannel: self diffsetHolder

    "Created: / 01-11-2009 / 11:14:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

navigatorPanelSpecHolder
    <resource: #uiAspect>

    navigatorPanelSpecHolder isNil ifTrue:[
        navigatorPanelSpecHolder := ValueHolder with: #twoColumnNavigatorSpec.
    ].
    ^ navigatorPanelSpecHolder.

    "Modified: / 20-11-2009 / 20:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

selectionHolder
    "return/create the 'selectionHolder' value holder (automatically generated)"

    selectionHolder isNil ifTrue:[

        selectionHolder := ValueHolder new.
        selectionHolder addDependent:self.
    ].
    ^ selectionHolder

    "Modified (format): / 06-07-2011 / 12:25:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

singleSelectionHolder
    "return/create the 'singleSelectionHolder' value holder (automatically generated)"

    singleSelectionHolder isNil ifTrue:[
        singleSelectionHolder := ValueHolder new.
    ].
    ^ singleSelectionHolder

    "Modified: / 10-11-2009 / 11:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

textDiffToolHolder
    "return/create the 'textDiffToolHolder' value holder (automatically generated)"

    textDiffToolHolder isNil ifTrue:[
        textDiffToolHolder := ValueHolder with: self textDiff2Tool.
    ].
    ^ textDiffToolHolder

    "Modified: / 16-03-2012 / 13:57:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

textDiffToolHolder:something
    "set the 'textDiffToolHolder' value holder (automatically generated)"

    textDiffToolHolder := something.
!

textDiffToolWindowSpecHolder
    "return/create the 'textDiffToolWindowSpecHolder' value holder (automatically generated)"

    textDiffToolWindowSpecHolder isNil ifTrue:[
        textDiffToolWindowSpecHolder := #windowSpecForEmbedding asValue.
    ].
    ^ textDiffToolWindowSpecHolder

    "Modified: / 16-03-2012 / 13:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

textDiffToolWindowSpecHolder:something
    "set the 'textDiffToolWindowSpecHolder' value holder (automatically generated)"

    textDiffToolWindowSpecHolder := something.
!

titleHolder
    "return/create the 'titleHolder' value holder (automatically generated)"

    titleHolder isNil ifTrue:[
        titleHolder := ValueHolder with: 'Diff Browser'.
    ].
    ^ titleHolder

    "Modified: / 01-11-2009 / 14:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionALabelHolder

    ^(AspectAdaptor forAspect: #versionALabel)
        subjectChannel: self diffsetHolder

    "Created: / 09-04-2011 / 23:30:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionATextHolder

    versionATextHolder isNil ifTrue:[
        versionATextHolder := ValueHolder new
    ].
    ^versionATextHolder

    "Created: / 06-07-2011 / 12:05:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 18-11-2011 / 14:57:56 / cg"
!

versionBLabelHolder

    ^(AspectAdaptor forAspect: #versionBLabel)
        subjectChannel: self diffsetHolder

    "Created: / 09-04-2011 / 23:30:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBTextHolder

    versionBTextHolder isNil ifTrue:[
        versionBTextHolder := ValueHolder new
    ].
    ^versionBTextHolder

    "Created: / 06-07-2011 / 12:05:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 18-11-2011 / 14:57:59 / cg"
!

versionBaseLabelHolder

    ^(AspectAdaptor forAspect: #versionBaseLabel)
        subjectChannel: self diffsetHolder

    "Created: / 16-03-2012 / 15:18:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBaseTextHolder

    versionBaseTextHolder isNil ifTrue:[
        versionBaseTextHolder := ValueHolder new
    ].
    ^versionBaseTextHolder

    "Modified: / 18-11-2011 / 14:57:59 / cg"
    "Created: / 16-03-2012 / 15:19:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool methodsFor:'change & update'!

diffsetChanged

    | ds |

    ds := self diffsetHolder value.

    self diffsetHolderPrivate value: 
        (self isOneColumnBrowser 
            ifTrue:[ds flattened]
            ifFalse:[ds value]).

    self versionALabelHolder value: ds versionALabel.
    self versionBLabelHolder value: ds versionBLabel.
    self versionBaseLabelHolder value: ds versionBaseLabel.

    "Created: / 05-12-2009 / 11:03:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 29-06-2011 / 08:24:18 / Jan Vrany <enter your email here>"
    "Modified: / 16-03-2012 / 15:42:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

selectionChanged

    | diffItem |

    diffItem := self theSingleSelectedObject.
    self singleSelectionHolder value: diffItem.
    diffItem isNil ifTrue:[^self].

    self versionATextHolder setValue: diffItem versionAText.
    self versionBTextHolder setValue: diffItem versionBText.
    self versionBaseTextHolder setValue: diffItem versionBaseText.

    self versionATextHolder changed: #value.
    self versionBTextHolder changed: #value.
    self versionBaseTextHolder changed: #value

    "Created: / 22-10-2008 / 11:29:24 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 16-03-2012 / 15:19:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

update: aspect with: param from: sender

    sender == selectionHolder ifTrue:[
        self selectionChanged.
        ^self.
    ].

    sender == diffsetHolder ifTrue:[
        self diffsetChanged.
        ^self.
    ].

    ^super update: aspect with: param from: sender

    "Created: / 05-12-2009 / 11:02:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

updateListMenu
    |menu diffs loadA loadB|

    menu := self listMenuHolder value.
    diffs := self selection ? #().
    loadA := menu atNameKey:#LoadVersionA.
    loadA disable.
    loadB := menu atNameKey:#LoadVersionB.
    loadB disable.
    (diffs select:[:e | true ]) do:[:diff | 
        diff versionA 
            ifNotNil:[
                loadA enable.
                loadA label:'Load version ' , diff versionALabel
            ].
        diff versionB 
            ifNotNil:[
                loadB
                    label:'Load version ' , diff versionBLabel;
                    enable
            ].
    ].
! !

!ChangeSetDiffTool methodsFor:'initialization'!

initialize

    super initialize.
    self createBuilder

    "Created: / 22-10-2008 / 12:37:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!ChangeSetDiffTool methodsFor:'menu actions'!

changesetMenuBrowse: changeset

    Tools::ChangeSetBrowser2 openOn: changeset

    "Created: / 16-12-2011 / 14:31:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

changesetMenuBrowseA

    self changesetMenuBrowse: self diffsetHolder value changesetA

    "Created: / 16-12-2011 / 14:23:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

changesetMenuBrowseB

    self changesetMenuBrowse: self diffsetHolder value changesetB

    "Created: / 16-12-2011 / 14:27:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

fileMenuOpen

    | dlg a b base|
    dlg := OpenDialog new.
    dlg open ifFalse:[^self].
    a := dlg changeSetA.
    b := dlg changeSetB.
    base := dlg changeSetBase.
    ^self fileMenuOpenOnDiffBetween: a and: b base: base.

    "Modified: / 16-03-2012 / 13:51:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

fileMenuOpenOnDiffBetween: a and: b

    ^self fileMenuOpenOnDiffBetween: a and: b base: nil.

    "Modified: / 29-06-2011 / 08:10:17 / Jan Vrany <enter your email here>"
    "Modified: / 06-07-2011 / 12:56:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 16-03-2012 / 14:07:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

fileMenuOpenOnDiffBetween: a and: b base: base

    self diffset: (ChangeSetDiff versionA: a versionB: b versionBase: base).
    base notNil ifTrue:[
        textDiffToolHolder value isDiff3 ifFalse:[
            textDiffToolHolder value: self textDiff3Tool.
        ].
    ] ifFalse:[
        textDiffToolHolder value isDiff2 ifFalse:[
            textDiffToolHolder value: self textDiff2Tool.
        ].
    ]

    "Modified: / 29-06-2011 / 08:10:17 / Jan Vrany <enter your email here>"
    "Created: / 16-03-2012 / 13:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

fileMenuSaveAsPatch

    | filename |
    filename := Smalltalk::Dialog requestFileName: 'Enter filename' default:'patch.chg' ifFail:[^self].
    self patchset fileOutAs: filename.

    "Modified: / 05-12-2009 / 12:37:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

listMenuBrowse

    | items |
    items := self selection collect:[:e|e]. "/must do collect as selection is an iterator..."
    items size == 1 ifTrue:[
        | item cls sel |
        item:= items anElement.
        cls := item changeClass.
        sel := item changeSelector.
        cls notNil ifTrue:[
            sel notNil ifTrue:[
                UserPreferences current systemBrowserClass
                    openInClass:cls selector:sel

            ] ifFalse:[
                UserPreferences current systemBrowserClass
                    browseClass: cls
            ]
        ] ifFalse:[
            Dialog warn: (self class resources at: 'Oops, class is gone')
        ]
    ] ifFalse:[
        Dialog error: 'Not yet implemented (Tools::ChangeSetDiffTool>>listMenuBrowse)'.                        
    ]

    "Created: / 30-11-2011 / 11:30:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

listMenuInspect

    (self selection collect:[:e|e]) inspect

    "Modified: / 24-11-2009 / 12:51:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

listMenuLoadVersionA

    self selection do:
        [:diff|diff versionA apply]

    "Modified: / 09-12-2009 / 23:09:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

listMenuLoadVersionB

    self selection do:
        [:diff|diff versionB apply]

    "Modified: / 09-12-2009 / 23:10:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

listMenuOpenInExternal: command

    (OperatingSystem canExecuteCommand: command) ifFalse:[
        Dialog warn: 'Sorry. ', command , ' is not installed or not in PATH'
    ].

    self selection do:[:item|
        | base a b cmd |
        item versionBase notNil ifTrue:[
            base := Filename newTemporary.
            base writingFileDo:[:s|s nextPutAll: item versionBase source].
        ].
        a := Filename newTemporary.
        a writingFileDo:[:s|s nextPutAll: item versionA source].
        b := Filename newTemporary.
        b writingFileDo:[:s|s nextPutAll: item versionB source].

        base isNil ifTrue:[
            cmd := '%1 %2 %3' bindWith: command with: a pathName with: b pathName
        ] ifFalse:[
            cmd := '%1 %4 %2 %3 ' bindWith: command with: a pathName with: b pathName with: base pathName.
        ].
        [ OperatingSystem executeCommand: cmd.
        a remove.
        b remove.
        base notNil ifTrue:[base remove]. ] fork
    ]

    "Modified: / 17-03-2012 / 08:55:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool methodsFor:'queries'!

canBrowse

    ^true

    "^[self selection notNil 
        and:[self selection versionA notNil]]"

    "Created: / 02-11-2009 / 18:32:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-11-2009 / 18:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

hasSelection

    ^[self selection notNil]

    "Created: / 03-11-2009 / 10:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

isOneColumnBrowser

    ^self navigatorPanelSpecHolder value = #oneColumnNavigatorSpec

    "Created: / 05-12-2009 / 11:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool::OpenDialog class methodsFor:'image specs'!

versionA24x24

    ^ToolbarIconLibrary versionA24x24

    "Created: / 24-03-2010 / 20:49:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionB24x24

    ^ToolbarIconLibrary versionB24x24

    "Created: / 24-03-2010 / 20:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool::OpenDialog class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffBrowser::OpenDialog andSelector:#windowSpec
     Tools::ChangeSetDiffBrowser::OpenDialog new openInterface:#windowSpec
     Tools::ChangeSetDiffBrowser::OpenDialog open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'Open...'
          name: 'Open...'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 640 130)
        )
        component: 
       (SpecCollection
          collection: (
           (VariableHorizontalPanelSpec
              name: 'ChangeSetsSpecPanel'
              layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
              barWidth: 3
              showHandle: true
              component: 
             (SpecCollection
                collection: (
                 (ViewSpec
                    name: 'A'
                    component: 
                   (SpecCollection
                      collection: (
                       (UISubSpecification
                          name: 'SubSpecification1'
                          layout: (LayoutFrame 0 0 0 0 0 1 30 0)
                          minorKey: versionALabelSpec
                        )
                       (SubCanvasSpec
                          name: 'ChangesetASpec'
                          layout: (LayoutFrame 0 0 30 0 0 1 0 1)
                          hasHorizontalScrollBar: false
                          hasVerticalScrollBar: false
                          majorKey: #'Tools::ChangeSetSelectionDialog'
                          minorKey: windowSpecForEmbedding
                          subAspectHolders: 
                         (Array
                            
                           (SubChannelInfoSpec
                              subAspect: specHolder
                              aspect: changesetSpecAHolder
                            )
                          )
                          createNewApplication: true
                          createNewBuilder: true
                        )
                       )
                     
                    )
                  )
                 (ViewSpec
                    name: 'B'
                    component: 
                   (SpecCollection
                      collection: (
                       (UISubSpecification
                          name: 'SubSpecification2'
                          layout: (LayoutFrame 0 0 0 0 0 1 30 0)
                          minorKey: versionBLabelSpec
                        )
                       (SubCanvasSpec
                          name: 'SubCanvas1'
                          layout: (LayoutFrame 0 0 30 0 0 1 0 1)
                          hasHorizontalScrollBar: false
                          hasVerticalScrollBar: false
                          majorKey: #'Tools::ChangeSetSelectionDialog'
                          minorKey: windowSpecForEmbedding
                          subAspectHolders: 
                         (Array
                            
                           (SubChannelInfoSpec
                              subAspect: specHolder
                              aspect: changesetSpecBHolder
                            )
                          )
                          createNewApplication: true
                          createNewBuilder: true
                        )
                       )
                     
                    )
                  )
                 )
               
              )
              handles: (Any 0.5 1.0)
            )
           (HorizontalPanelViewSpec
              name: 'ButtonPanel'
              layout: (LayoutFrame 3 0 -30 1 -3 1 0 1)
              horizontalLayout: right
              verticalLayout: center
              horizontalSpace: 3
              verticalSpace: 3
              reverseOrderIfOKAtLeft: true
              component: 
             (SpecCollection
                collection: (
                 (ActionButtonSpec
                    label: 'OK'
                    name: 'Button1'
                    translateLabel: true
                    model: doAccept
                    enableChannel: doAcceptEnabled
                    extent: (Point 125 22)
                  )
                 (ActionButtonSpec
                    label: 'Cancel'
                    name: 'Button2'
                    translateLabel: true
                    model: doCancel
                    extent: (Point 125 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )

    "Modified: / 06-07-2011 / 11:32:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool::OpenDialog class methodsFor:'interface specs - labels'!

versionALabelSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffBrowser::OpenDialog andSelector:#versionALabelSpec
     Tools::ChangeSetDiffBrowser::OpenDialog new openInterface:#versionALabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionALabelSpec
        window: 
       (WindowSpec
          label: 'Version A'
          name: 'Changeset A'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
          backgroundColor: (Color 79.6078431372549 90.5882352941177 69.4117647058823)
          forceRecursiveBackground: true
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionA24x24'
              name: 'VersionAIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version A'
              name: 'VersionALabel'
              layout: (LayoutFrame 30 0 5 0 0 1 0 1)
              translateLabel: true
              resizeForLabel: true
              adjust: left
            )
           )
         
        )
      )

    "Modified: / 06-07-2011 / 11:24:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBLabelSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:Tools::ChangeSetDiffBrowser::OpenDialog andSelector:#versionBLabelSpec
     Tools::ChangeSetDiffBrowser::OpenDialog new openInterface:#versionBLabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionBLabelSpec
        window: 
       (WindowSpec
          label: 'Version B'
          name: 'Changeset B'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
          backgroundColor: (Color 100.0 90.5882352941177 60.0)
          forceRecursiveBackground: true
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionB24x24'
              name: 'VersionBIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version B'
              name: 'VersionBLabel'
              layout: (LayoutFrame 30 0 5 0 97 0 0 1)
              translateLabel: true
              resizeForLabel: true
              adjust: left
              useDynamicPreferredWidth: true
              usePreferredWidth: true
            )
           )
         
        )
      )

    "Modified: / 06-07-2011 / 11:24:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool::OpenDialog methodsFor:'accessing'!

changeSetA

    | specA |

    specA := self changesetSpecAHolder value.
    ^specA ifNil:[nil] ifNotNil:[specA changeSet]

    "Created: / 06-07-2011 / 11:36:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

changeSetB

    | specB |

    specB := self changesetSpecBHolder value.
    ^specB ifNil:[nil] ifNotNil:[specB changeSet]

    "Created: / 06-07-2011 / 11:36:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

changeSetBase

    | specBase |

    specBase := self changesetSpecBaseHolder value.
    ^specBase ifNil:[nil] ifNotNil:[specBase changeSet]

    "Created: / 16-03-2012 / 13:48:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool::OpenDialog methodsFor:'aspects'!

changesetSpecAHolder
    "return/create the 'changesetSpecAHolder' value holder (automatically generated)"

    changesetSpecAHolder isNil ifTrue:[
        changesetSpecAHolder := ValueHolder new.
    ].
    ^ changesetSpecAHolder
!

changesetSpecAHolder:something
    "set the 'changesetSpecAHolder' value holder (automatically generated)"

    changesetSpecAHolder := something.
!

changesetSpecBHolder
    "return/create the 'changesetSpecBHolder' value holder (automatically generated)"

    changesetSpecBHolder isNil ifTrue:[
        changesetSpecBHolder := ValueHolder new.
    ].
    ^ changesetSpecBHolder
!

changesetSpecBHolder:something
    "set the 'changesetSpecBHolder' value holder (automatically generated)"

    changesetSpecBHolder := something.
!

changesetSpecBaseHolder
    "return/create the 'changesetSpecBHolder' value holder (automatically generated)"

    changesetSpecBaseHolder isNil ifTrue:[
        changesetSpecBaseHolder := ValueHolder new.
    ].
    ^ changesetSpecBaseHolder

    "Created: / 16-03-2012 / 13:48:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

changesetSpecBaseHolder:something
    "set the 'changesetSpecBHolder' value holder (automatically generated)"

    changesetSpecBaseHolder := something.

    "Created: / 16-03-2012 / 13:49:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

doAcceptEnabled
    <resource: #uiAspect>

    ^BlockValue 
        with:[:a :b|a value notNil and:[b value notNil]]
        argument:self changesetSpecAHolder
        argument:self changesetSpecAHolder.

    "Modified: / 06-07-2011 / 11:26:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool::OpenDialog methodsFor:'events'!

closeAccept

    ^super closeAccept

    "Created: / 06-07-2011 / 12:09:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ChangeSetDiffTool class methodsFor:'documentation'!

version_CVS
    ^ '§Header: /cvs/stx/stx/libtool/Tools__ChangeSetDiffTool.st,v 1.5 2011/12/19 08:39:53 vrany Exp §'
!

version_SVN
    ^ '$Id: Tools__ChangeSetDiffTool.st 7938 2012-03-17 10:21:50Z vranyj1 $'
! !