SVN__RepositoryConfigurationDialog.st
changeset 23 b8d96a7577e8
child 180 7673e8111c72
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SVN__RepositoryConfigurationDialog.st	Wed Sep 23 18:44:51 2009 +0200
@@ -0,0 +1,249 @@
+"{ Package: 'cvut:stx/goodies/libsvn' }"
+
+"{ NameSpace: SVN }"
+
+Dialog subclass:#RepositoryConfigurationDialog
+	instanceVariableNames:'packageHolder urlHolder'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SVN-UI-Dialogs'
+!
+
+!RepositoryConfigurationDialog class methodsFor:'documentation'!
+
+version_SVN
+    ^'$Id$'
+! !
+
+!RepositoryConfigurationDialog class methodsFor:'help specs'!
+
+helpSpec
+    "This resource specification was automatically generated
+     by the UIHelpTool of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIHelpTool may not be able to read the specification."
+
+    "
+     UIHelpTool openOnClass:SVN::RepositoryConfigurationDialog    
+    "
+
+    <resource: #help>
+
+    ^ super helpSpec addPairsFrom:#(
+
+#Package
+'Package name may contain wild cards: \ * matches any text\ # matches any character\ [...] matches set of characters'
+
+#URL
+'Repository url. Following variables are expanded\ %p - full package name (ex: ''stx/goodies/libsvn'')'
+
+)
+! !
+
+!RepositoryConfigurationDialog 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::RepositoryConfigurationDialog andSelector:#contentSpec
+     SVN::RepositoryConfigurationDialog new openInterface:#contentSpec
+    "
+
+    <resource: #canvas>
+
+    ^ 
+     #(FullSpec
+        name: contentSpec
+        window: 
+       (WindowSpec
+          label: 'Repository configuration'
+          name: 'Repository configuration'
+          min: (Point 10 10)
+          bounds: (Rectangle 0 0 647 345)
+        )
+        component: 
+       (SpecCollection
+          collection: (
+           (TransparentBoxSpec
+              name: 'Content'
+              layout: (LayoutFrame 0 0 -30 0.5 0 1 30 0.5)
+              component: 
+             (SpecCollection
+                collection: (
+                 (LabelSpec
+                    label: 'Package:'
+                    name: 'PackageLabel'
+                    layout: (LayoutFrame 0 0 15 0 120 0 35 0)
+                    translateLabel: true
+                    adjust: right
+                  )
+                 (InputFieldSpec
+                    name: 'Package'
+                    layout: (LayoutFrame 122 0 5 0 -2 1 30 0)
+                    activeHelpKey: Package
+                    enableChannel: svnEnabledAspect
+                    model: packageHolder
+                    immediateAccept: false
+                    acceptOnReturn: true
+                    acceptOnTab: true
+                    acceptOnLostFocus: true
+                    modifiedChannel: modifiedChannel
+                    acceptOnPointerLeave: true
+                    valueChangeCallBackSelector: validate
+                  )
+                 (LabelSpec
+                    label: 'Repository URL:'
+                    name: 'URLLabel'
+                    layout: (LayoutFrame 0 0 47 0 120 0 62 0)
+                    translateLabel: true
+                    adjust: right
+                  )
+                 (InputFieldSpec
+                    name: 'URL'
+                    layout: (LayoutFrame 122 0 37 0 0 1 62 0)
+                    activeHelpKey: URL
+                    enableChannel: svnEnabledAspect
+                    model: urlHolder
+                    immediateAccept: false
+                    acceptOnReturn: true
+                    acceptOnTab: true
+                    acceptOnLostFocus: true
+                    modifiedChannel: modifiedChannel
+                    acceptOnPointerLeave: true
+                    valueChangeCallBackSelector: validate
+                  )
+                 )
+               
+              )
+            )
+           )
+         
+        )
+      )
+! !
+
+!RepositoryConfigurationDialog methodsFor:'accessing'!
+
+answerValueSelector 
+
+    ^#model
+
+    "Modified: / 16-08-2009 / 11:54:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+package
+
+    ^self packageHolder value
+
+    "Created: / 16-08-2009 / 17:19:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+url
+
+    ^self urlHolder value
+
+    "Created: / 16-08-2009 / 17:02:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
+!RepositoryConfigurationDialog methodsFor:'accessing - defaults'!
+
+defaultModel
+
+    ^RepositoryConfiguration new
+
+    "Created: / 16-08-2009 / 16:02:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+defaultTitle
+
+    ^'Repository configuration'
+
+    "Created: / 03-10-2008 / 13:58:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 16-08-2009 / 16:12:12 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
+!RepositoryConfigurationDialog methodsFor:'actions'!
+
+doAccept
+
+    self canDoAccept ifFalse:[^self].
+    self model 
+        package: self package;
+        url: self url.
+    super doAccept.
+
+    "Created: / 16-08-2009 / 17:02:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
+!RepositoryConfigurationDialog methodsFor:'aspects'!
+
+packageHolder
+    <resource: #uiAspect>
+
+    "automatically generated by UIPainter ..."
+
+    "*** the code below creates a default model when invoked."
+    "*** (which may not be the one you wanted)"
+    "*** Please change as required and accept it in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    packageHolder isNil ifTrue:[
+        packageHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/       packageHolder addDependent:self.
+"/       packageHolder onChangeSend:#packageHolderChanged to:self.
+    ].
+    ^ packageHolder.
+!
+
+urlHolder
+    <resource: #uiAspect>
+
+    "automatically generated by UIPainter ..."
+
+    "*** the code below creates a default model when invoked."
+    "*** (which may not be the one you wanted)"
+    "*** Please change as required and accept it in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    urlHolder isNil ifTrue:[
+        urlHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/       urlHolder addDependent:self.
+"/       urlHolder onChangeSend:#urlHolderChanged to:self.
+    ].
+    ^ urlHolder.
+! !
+
+!RepositoryConfigurationDialog methodsFor:'validation'!
+
+validate
+    | url |
+
+    [url := self url.
+    url 
+        ifNil:
+            [^self canDoAccept: false]
+        ifNotNil:
+            [url := url asURL.
+            url isValidSvnRepositoryUrl 
+                ifFalse:[^self canDoAccept: false]
+                ifTrue:[self urlHolder setValue: url printString]].
+    self canDoAccept: true.                    
+    ] on: Error do:
+        [self canDoAccept: false].
+
+    "Created: / 16-08-2009 / 16:25:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
+!RepositoryConfigurationDialog class methodsFor:'documentation'!
+
+version
+    ^ '$Header$'
+! !