initial checkin
authorClaus Gittinger <cg@exept.de>
Fri, 01 Jul 2011 15:31:46 +0200
changeset 10002 f56cd065ae3c
parent 10001 f6cf395b6933
child 10003 ed8572afe3f2
initial checkin
Tools__LintRuleSelectionDialog.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools__LintRuleSelectionDialog.st	Fri Jul 01 15:31:46 2011 +0200
@@ -0,0 +1,312 @@
+"
+ COPYRIGHT (c) 2006 by 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:#LintRuleSelectionDialog
+	instanceVariableNames:'selectedRulesHolder selectionHolder variablePanel relativeCorners
+		detailsShown listSelection'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Lint'
+!
+
+!LintRuleSelectionDialog class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by 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
+"
+    documentation to be added.
+
+    [author:]
+        Jan Vrany (jv@neso)
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+!
+
+examples
+"
+  Starting the application:
+                                                                [exBegin]
+    Tools::LintRuleSelectionDialog open
+
+                                                                [exEnd]
+
+  more examples to be added:
+                                                                [exBegin]
+    ... add code fragment for 
+    ... executable example here ...
+                                                                [exEnd]
+"
+! !
+
+!LintRuleSelectionDialog 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::LintRuleSelectionDialog andSelector:#windowSpec
+     Tools::LintRuleSelectionDialog new openInterface:#windowSpec
+     Tools::LintRuleSelectionDialog open
+    "
+
+    <resource: #canvas>
+
+    ^ 
+     #(FullSpec
+        name: windowSpec
+        window: 
+       (WindowSpec
+          label: 'Select Lint Rules'
+          name: 'Select Lint Rules'
+          min: (Point 10 10)
+          bounds: (Rectangle 0 0 600 400)
+        )
+        component: 
+       (SpecCollection
+          collection: (
+           (VariableHorizontalPanelSpec
+              name: 'RulesAndDescriptions'
+              layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
+              showHandle: true
+              snapMode: both
+              handlePosition: right
+              component: 
+             (SpecCollection
+                collection: (
+                 (SubCanvasSpec
+                    name: 'RuleList'
+                    hasHorizontalScrollBar: false
+                    hasVerticalScrollBar: false
+                    majorKey: #'Tools::HierarchicalLintRuleList'
+                    subAspectHolders: 
+                   (Array
+                      
+                     (SubChannelInfoSpec
+                        subAspect: inGeneratorHolder
+                        aspect: allRulesHolder
+                      ) 
+                     (SubChannelInfoSpec
+                        subAspect: listSelection
+                        aspect: listSelection
+                      )
+                      
+                     (SubChannelInfoSpec
+                        subAspect: modeHolder
+                        aspect: modeHolder
+                      ) 
+                     (SubChannelInfoSpec
+                        subAspect: outGeneratorHolder
+                        aspect: selectedRulesHolder
+                      )
+                      
+                     (SubChannelInfoSpec
+                        subAspect: selectionHolder
+                        aspect: selectionHolder
+                      )
+                    )
+                    createNewApplication: true
+                    createNewBuilder: true
+                  )
+                 (SubCanvasSpec
+                    name: 'RuleDesc'
+                    hasHorizontalScrollBar: false
+                    hasVerticalScrollBar: false
+                    majorKey: #'Tools::LintRuleDetail'
+                    subAspectHolders: 
+                   (Array
+                      
+                     (SubChannelInfoSpec
+                        subAspect: ruleHolder
+                        aspect: selectedRuleHolder
+                      )
+                    )
+                    createNewApplication: true
+                    createNewBuilder: true
+                  )
+                 )
+               
+              )
+              handles: (Any 0.99 1.0)
+              postBuildCallback: postBuildVariablePanel:
+            )
+           (HorizontalPanelViewSpec
+              name: 'BottonPanel'
+              layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
+              horizontalLayout: fitSpace
+              verticalLayout: center
+              horizontalSpace: 3
+              verticalSpace: 3
+              reverseOrderIfOKAtLeft: true
+              component: 
+             (SpecCollection
+                collection: (
+                 (ActionButtonSpec
+                    label: 'Cancel'
+                    name: 'CancelButton'
+                    translateLabel: true
+                    model: doCancel
+                    extent: (Point 295 22)
+                  )
+                 (ActionButtonSpec
+                    label: 'OK'
+                    name: 'OKButton'
+                    translateLabel: true
+                    model: doAccept
+                    extent: (Point 296 22)
+                  )
+                 )
+               
+              )
+            )
+           )
+         
+        )
+      )
+! !
+
+!LintRuleSelectionDialog methodsFor:'accessing'!
+
+selection
+
+    ^self selectionHolder value
+
+    "Created: / 25-08-2010 / 14:10:03 / Jan Vrany <enter your email here>"
+!
+
+selection: anObject
+
+    self selectionHolder value: anObject
+
+    "Created: / 25-08-2010 / 14:09:40 / Jan Vrany <enter your email here>"
+!
+
+selectionAsRule
+
+    ^RBCompositeLintRule rules: self selection name: 'Selected rules'
+
+    "Created: / 25-08-2010 / 14:10:58 / Jan Vrany <enter your email here>"
+! !
+
+!LintRuleSelectionDialog methodsFor:'actions'!
+
+hideResultView
+
+    detailsShown == true ifFalse:[^self].
+
+    variablePanel shown ifFalse:[^self].
+
+    relativeCorners := variablePanel relativeCorners.
+
+    variablePanel
+        relativeCorners:#( 0.99 1.0 );
+        resizeSubviews.
+    detailsShown := false.
+
+    "Created: / 10-02-2007 / 11:39:10 / janfrog"
+    "Modified: / 24-07-2010 / 15:30:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+showResultView
+    detailsShown == true ifTrue:[^self].
+    variablePanel
+        relativeCorners:relativeCorners ? #(0.5 1.0);
+        resizeSubviews.
+    detailsShown := true.
+
+    "Created: / 10-02-2007 / 11:38:26 / janfrog"
+    "Modified: / 24-07-2010 / 15:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!LintRuleSelectionDialog methodsFor:'aspects'!
+
+allRulesHolder
+
+    ^[(RBCompositeLintRule allRules) rules]
+
+    "Created: / 15-04-2010 / 20:09:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+listSelection
+    "return/create the 'listSelection' value holder (automatically generated)"
+
+    listSelection isNil ifTrue:[
+        listSelection := ValueHolder new.
+    ].
+    ^ listSelection
+!
+
+listSelection:something
+    "set the 'listSelection' value holder (automatically generated)"
+
+    listSelection := something.
+!
+
+modeHolder
+
+    ^[#select]
+
+    "Created: / 15-04-2010 / 20:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectionHolder
+    "return/create the 'selectionHolder' value holder (automatically generated)"
+
+    selectionHolder isNil ifTrue:[
+        selectionHolder := ValueHolder new.
+    ].
+    ^ selectionHolder
+! !
+
+!LintRuleSelectionDialog methodsFor:'callbacks - post build'!
+
+postBuildVariablePanel: aPanel
+
+    variablePanel := aPanel.
+
+    "Created: / 24-07-2010 / 15:05:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!LintRuleSelectionDialog class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleSelectionDialog.st,v 1.1 2011-07-01 13:31:46 cg Exp $'
+!
+
+version_SVN
+    ^ '§Id: Tools__LintRuleSelectionDialog.st 7617 2010-08-25 12:56:19Z vranyj1 §'
+! !