Tools__CheckinInfoDialog.st
author Claus Gittinger <cg@exept.de>
Tue, 22 Sep 2009 19:17:39 +0200
changeset 8766 f9af1c29b401
parent 7592 f9204291e800
child 9161 e4761f8c188d
permissions -rw-r--r--
comment/format in: #getCheckinInfoFor:initialAnswer:withQuickOption:

"
 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 tagHolder
		quickCheckInHolder quickCheckInVisibleHolder'
	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:Tools::CheckinInfoDialog andSelector:#windowSpec
     Tools::CheckinInfoDialog new openInterface:#windowSpec
     Tools::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 327)
        )
        component: 
       (SpecCollection
          collection: (
           (HorizontalPanelViewSpec
              name: 'HorizontalPanel2'
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
              horizontalLayout: left
              verticalLayout: center
              horizontalSpace: 0
              verticalSpace: 3
              component: 
             (SpecCollection
                collection: (
                 (LabelSpec
                    label: 'Enter checkIn 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 -101 1)
              model: logMessageHolder
              hasHorizontalScrollBar: true
              hasVerticalScrollBar: true
            )
           (CheckBoxSpec
              label: 'Quick Checkin (Only Classes in ChangeSet)'
              name: 'CheckInChangedOnlyCheckbox'
              layout: (LayoutFrame 3 0 -95 1 -3 1 -73 1)
              visibilityChannel: quickCheckInVisibleHolder
              model: quickCheckInHolder
              translateLabel: true
            )
           (CheckBoxSpec
              label: 'Mark as Stable'
              name: 'MarkStableCheckBox'
              layout: (LayoutFrame 3 0 -68 1 -3 1 -46 1)
              model: isStableHolder
              translateLabel: true
            )
           (InputFieldSpec
              name: 'TagEntryField'
              layout: (LayoutFrame 0 0.5 -68 1 -3 1 -46 1)
              enableChannel: tagItInHolder
              model: tagHolder
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (HorizontalPanelViewSpec
              name: 'HorizontalPanel1'
              layout: (LayoutFrame 0 0.0 -40 1 0 1.0 0 1.0)
              horizontalLayout: fitSpace
              verticalLayout: center
              horizontalSpace: 3
              verticalSpace: 2
              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)
                  )
                 )
               
              )
            )
           (LabelSpec
              label: 'Tag:'
              name: 'Label3'
              layout: (LayoutFrame -40 0.5 -67 1 0 0.5 -45 1)
              translateLabel: true
              adjust: right
            )
           )
         
        )
      )
! !

!CheckinInfoDialog class methodsFor:'opening'!

getCheckinInfoFor:aString initialAnswer:initialAnswer
    ^ self getCheckinInfoFor:aString initialAnswer:initialAnswer withQuickOption:false

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

getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer withQuickOption:withQuickOption
    |dialog|

    dialog := self new.
    dialog 
        description:aClassNameOrPackageNameString; 
        logMessage:initialAnswer;
        withQuickOption:withQuickOption.

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

    ^ dialog    


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

    "Modified: / 12-09-2006 / 14:07:43 / cg"
! !

!CheckinInfoDialog methodsFor:'accessing'!

description
    ^ self descriptionHolder value
!

description:aString
    self descriptionHolder value:aString allBold
!

isStable
    ^ self isStableHolder value
!

isStable:aBoolean
    self isStableHolder value:aBoolean
!

logMessage
    ^ self logMessageHolder value
!

logMessage:aString
    self logMessageHolder value:aString
!

quickCheckIn
    ^ self quickCheckInHolder value
!

quickCheckIn:aBoolean
    self quickCheckInHolder value:aBoolean
!

tag
    ^ self tagHolder value withoutSeparators
!

tag:aStringOrNil
    self tagHolder value:aStringOrNil

    "Modified: / 12-09-2006 / 12:03:50 / cg"
!

tagIt
    ^ self tag notEmptyOrNil

    "Created: / 12-09-2006 / 13:06:49 / cg"
!

withQuickOption:aBoolean
    ^ self quickCheckInVisibleHolder value:aBoolean
! !

!CheckinInfoDialog methodsFor:'aspects'!

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

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

    "Modified: / 16-01-2007 / 16:00:26 / cg"
!

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

quickCheckInHolder
    quickCheckInHolder isNil ifTrue:[
        quickCheckInHolder := true asValue.
    ].
    ^ quickCheckInHolder
!

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

tagHolder
    tagHolder isNil ifTrue:[
        tagHolder := '' asValue.
    ].
    ^ tagHolder
! !

!CheckinInfoDialog class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CheckinInfoDialog.st,v 1.9 2009-09-22 17:17:39 cg Exp $'
! !