Tools__CheckinInfoDialog.st
author Claus Gittinger <cg@exept.de>
Thu, 22 Jun 2006 12:52:35 +0200
changeset 6799 587271967bde
child 6979 048fb7930a28
permissions -rw-r--r--
initial checkin

"
 COPYRIGHT (c) 2005 eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

SimpleDialog subclass:#CheckinInfoDialog
	instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder'
	classVariableNames:'LastSourceLogMessage'
	poolDictionaries:''
	category:'System-SourceCodeManagement'
!

!CheckinInfoDialog class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2005 eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    checkin-dialog.
    used to be private in SourceCodeManagerUtilites.
    moved to libtool because libbasic3 should not contain code inheriting from GUI classes.

    [author:]

    [see also:]

    [instance variables:]

    [class variables:]
"
! !

!CheckinInfoDialog 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:SourceCodeManagerUtilities::CheckinInfoDialog andSelector:#windowSpec
     SourceCodeManagerUtilities::CheckinInfoDialog new openInterface:#windowSpec
     SourceCodeManagerUtilities::CheckinInfoDialog open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'Enter Log Message'
          name: 'Enter Log Message'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 563 290)
        )
        component: 
       (SpecCollection
          collection: (
           (HorizontalPanelViewSpec
              name: 'HorizontalPanel2'
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
              horizontalLayout: left
              verticalLayout: center
              horizontalSpace: 3
              verticalSpace: 3
              component: 
             (SpecCollection
                collection: (
                 (LabelSpec
                    label: 'Enter log message for: '
                    name: 'Label1'
                    translateLabel: true
                    resizeForLabel: true
                    useDefaultExtent: true
                  )
                 (LabelSpec
                    name: 'Label2'
                    translateLabel: true
                    labelChannel: descriptionHolder
                    useDefaultExtent: true
                  )
                 )
               
              )
            )
           (TextEditorSpec
              name: 'TextEditor1'
              layout: (LayoutFrame 2 0.0 38 0 -2 1 -76 1)
              model: logMessageHolder
              hasHorizontalScrollBar: true
              hasVerticalScrollBar: true
            )
           (CheckBoxSpec
              label: 'Mark as stable'
              name: 'CheckBox1'
              layout: (AlignmentOrigin 3 0 -65 1 0 0)
              model: isStableHolder
              translateLabel: true
            )
           (HorizontalPanelViewSpec
              name: 'HorizontalPanel1'
              layout: (LayoutFrame 0 0.0 -42 1 0 1.0 0 1.0)
              horizontalLayout: fitSpace
              verticalLayout: center
              horizontalSpace: 3
              verticalSpace: 3
              component: 
             (SpecCollection
                collection: (
                 (ActionButtonSpec
                    label: 'OK'
                    name: 'Button1'
                    translateLabel: true
                    model: doAccept
                    extent: (Point 277 22)
                  )
                 (ActionButtonSpec
                    label: 'Cancel'
                    name: 'Button2'
                    translateLabel: true
                    model: doCancel
                    extent: (Point 277 22)
                  )
                 )
               
              )
            )
           )
         
        )
      )
! !

!CheckinInfoDialog class methodsFor:'opening'!

getCheckinInfoFor:aString initialAnswer:initialAnswer
    |dialog|

    dialog := self new.
    dialog description:aString; logMessage:initialAnswer.

    dialog open.
    dialog accepted ifFalse:[
        ^ nil.
    ].

    ^ dialog    


    "
         self getCheckinInfoFor:'hello' initialAnswer:'bla'
    "
! !

!CheckinInfoDialog methodsFor:'accessing'!

description
    ^ self descriptionHolder value
!

description:aString
    self descriptionHolder value:aString
!

isStable
    ^ self isStableHolder value
!

isStable:aBoolean
    self isStableHolder value:aBoolean
!

logMessage
    ^ self logMessageHolder value
!

logMessage:aString
    self logMessageHolder value:aString
! !

!CheckinInfoDialog methodsFor:'aspects'!

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

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

isStableHolder
    isStableHolder isNil ifTrue:[
        isStableHolder := false asValue.
    ].
    ^ isStableHolder.
!

logMessageHolder
    logMessageHolder isNil ifTrue:[
        logMessageHolder := LastSourceLogMessage asValue.
    ].
    ^ logMessageHolder.
! !

!CheckinInfoDialog class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CheckinInfoDialog.st,v 1.1 2006-06-22 10:52:35 cg Exp $'
! !