SVN__CredentialsDialog.st
author fm
Mon, 19 Oct 2009 14:24:04 +0200
changeset 457 dc4b15db07c9
parent 315 5867d4d8734b
child 754 6ee705edb816
permissions -rw-r--r--
*** empty log message ***

"{ Package: 'stx:libsvn' }"

"{ NameSpace: SVN }"

Dialog subclass:#CredentialsDialog
	instanceVariableNames:'savePasswordHolder'
	classVariableNames:''
	poolDictionaries:''
	category:'SVN-UI-Dialogs'
!


!CredentialsDialog class methodsFor:'interface specs'!

contentSpec
    "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::CredentialsDialog andSelector:#dialogSpec
     SVN::CredentialsDialog new openInterface:#dialogSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: dialogSpec
        window: 
       (WindowSpec
          label: 'Dialog'
          name: 'Dialog'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 424 345)
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'Username:'
              name: 'UsernameLabel'
              layout: (LayoutFrame 0 0 -34 0.5 100 0 -14 0.5)
              translateLabel: true
              adjust: right
            )
           (InputFieldSpec
              name: 'Username'
              layout: (LayoutFrame 110 0 -40 0.5 -5 1 -15 0.5)
              model: usernameAspect
              immediateAccept: true
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (LabelSpec
              label: 'Password:'
              name: 'PasswordLabel'
              layout: (LayoutFrame 0 0 0 0.5 100 0 25 0.5)
              translateLabel: true
              adjust: right
            )
           (InputFieldSpec
              name: 'Password'
              layout: (LayoutFrame 110 0 -5 0.5 -5 1 20 0.5)
              model: passwordAspect
              type: password
              immediateAccept: true
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (CheckBoxSpec
              label: 'Save password'
              name: 'SavePassword'
              layout: (LayoutFrame 110 0 25 0.5 -5 1 55 0.5)
              model: savePasswordHolder
              translateLabel: true
            )
           )
         
        )
      )

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

!CredentialsDialog methodsFor:'accessing'!

answerValueSelector

    ^#model

    "Modified: / 03-10-2008 / 14:55:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

savePassword
    "return the value in 'savePasswordHolder'"

    ^ self savePasswordHolder value

    "Created: / 03-10-2008 / 14:39:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

savePassword: newValue
    "set the value in 'savePasswordHolder'"

    self savePasswordHolder value: newValue

    "Created: / 03-10-2008 / 14:39:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CredentialsDialog methodsFor:'accessing - defaults'!

defaultModel
    "Superclass SVN::Dialog says that I am responsible to implement this method"
    
    ^Credentials new

    "Created: / 03-10-2008 / 14:58:09 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

defaultTitle
    "Superclass SVN::Dialog says that I am responsible to implement this method"
    
    ^'Credentials'

    "Created: / 03-10-2008 / 13:58:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CredentialsDialog methodsFor:'aspects'!

passwordAspect

    ^(AspectAdaptor forAspect: #password)
        subjectChannel: self modelHolder

    "Created: / 03-10-2008 / 14:56:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

savePasswordHolder
    "return/create the valueHolder 'savePasswordHolder'"

    savePasswordHolder isNil ifTrue:[
        savePasswordHolder := ValueHolder with:true "defaultValue here".
    ].
    ^ savePasswordHolder

    "Created: / 03-10-2008 / 14:39:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

usernameAspect

    ^(AspectAdaptor forAspect: #username)
        subjectChannel: self modelHolder;
        onChangeSend: #usernameChanged to: self;
        yourself

    "Created: / 03-10-2008 / 14:56:31 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CredentialsDialog methodsFor:'change & update'!

usernameChanged

    self canDoAccept:
        (self usernameAspect value isNilOrEmptyCollection not)

    "Created: / 03-10-2008 / 14:32:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CredentialsDialog methodsFor:'hooks'!

commonPostOpen

    self usernameChanged

    "Created: / 03-10-2008 / 17:57:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CredentialsDialog class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
!

version_SVN
    ^'§Id: SVN__CredentialsDialog.st 107 2009-08-16 17:21:27Z vranyj1 §'
! !