Tools__HierarchicalLintRuleList.st
changeset 10001 f6cf395b6933
child 10093 fff6d14a5b19
equal deleted inserted replaced
10000:8ed849da9927 10001:f6cf395b6933
       
     1 "
       
     2  COPYRIGHT (c) 2006 by eXept Software AG
       
     3 	      All Rights Reserved
       
     4 
       
     5  This software is furnished under a license and may be used
       
     6  only in accordance with the terms of that license and with the
       
     7  inclusion of the above copyright notice.   This software may not
       
     8  be provided or otherwise made available to, or used by, any
       
     9  other person.  No title to or ownership of the software is
       
    10  hereby transferred.
       
    11 "
       
    12 "{ Package: 'stx:libtool' }"
       
    13 
       
    14 "{ NameSpace: Tools }"
       
    15 
       
    16 LintRuleList subclass:#HierarchicalLintRuleList
       
    17 	instanceVariableNames:''
       
    18 	classVariableNames:''
       
    19 	poolDictionaries:''
       
    20 	category:'Interface-Lint'
       
    21 !
       
    22 
       
    23 !HierarchicalLintRuleList class methodsFor:'documentation'!
       
    24 
       
    25 copyright
       
    26 "
       
    27  COPYRIGHT (c) 2006 by eXept Software AG
       
    28 	      All Rights Reserved
       
    29 
       
    30  This software is furnished under a license and may be used
       
    31  only in accordance with the terms of that license and with the
       
    32  inclusion of the above copyright notice.   This software may not
       
    33  be provided or otherwise made available to, or used by, any
       
    34  other person.  No title to or ownership of the software is
       
    35  hereby transferred.
       
    36 "
       
    37 ! !
       
    38 
       
    39 !HierarchicalLintRuleList class methodsFor:'interface specs'!
       
    40 
       
    41 windowSpec
       
    42     "This resource specification was automatically generated
       
    43      by the UIPainter of ST/X."
       
    44 
       
    45     "Do not manually edit this!! If it is corrupted,
       
    46      the UIPainter may not be able to read the specification."
       
    47 
       
    48     "
       
    49      UIPainter new openOnClass:Tools::HierarchicalLintRuleList andSelector:#windowSpec
       
    50      Tools::HierarchicalLintRuleList new openInterface:#windowSpec
       
    51      Tools::HierarchicalLintRuleList open
       
    52     "
       
    53 
       
    54     <resource: #canvas>
       
    55 
       
    56     ^ 
       
    57      #(FullSpec
       
    58         name: windowSpec
       
    59         window: 
       
    60        (WindowSpec
       
    61           label: 'SmallLintRuleList'
       
    62           name: 'SmallLintRuleList'
       
    63           min: (Point 10 10)
       
    64           bounds: (Rectangle 0 0 300 300)
       
    65         )
       
    66         component: 
       
    67        (SpecCollection
       
    68           collection: (
       
    69            (HierarchicalListViewSpec
       
    70               name: 'RuleList'
       
    71               layout: (LayoutFrame 0 0 23 0 0 1 0 1)
       
    72               model: listSelection
       
    73               hasHorizontalScrollBar: true
       
    74               hasVerticalScrollBar: true
       
    75               listModel: listHolder
       
    76               useIndex: false
       
    77               highlightMode: line
       
    78               showLines: false
       
    79               useDefaultIcons: false
       
    80               postBuildCallback: postBuildList:
       
    81             )
       
    82            (InputFieldSpec
       
    83               name: 'RuleFilter'
       
    84               layout: (LayoutFrame 0 0 0 0 0 1 22 0)
       
    85               model: filterHolder
       
    86               immediateAccept: true
       
    87               acceptOnReturn: true
       
    88               acceptOnTab: true
       
    89               acceptOnPointerLeave: true
       
    90               emptyFieldReplacementText: 'Rule Search'
       
    91             )
       
    92            )
       
    93          
       
    94         )
       
    95       )
       
    96 ! !
       
    97 
       
    98 !HierarchicalLintRuleList class methodsFor:'plugIn spec'!
       
    99 
       
   100 aspectSelectors
       
   101     "This resource specification was automatically generated
       
   102      by the UIPainter of ST/X."
       
   103 
       
   104     "Do not manually edit this. If it is corrupted,
       
   105      the UIPainter may not be able to read the specification."
       
   106 
       
   107     "Return a description of exported aspects;
       
   108      these can be connected to aspects of an embedding application
       
   109      (if this app is embedded in a subCanvas)."
       
   110 
       
   111     ^ #(
       
   112         #inGeneratorHolder
       
   113         #listSelection
       
   114         #modeHolder
       
   115         #outGeneratorHolder
       
   116         #selectionHolder
       
   117       ).
       
   118 
       
   119 ! !
       
   120 
       
   121 !HierarchicalLintRuleList methodsFor:'aspects'!
       
   122 
       
   123 listHolder
       
   124     listHolder isNil ifTrue:[
       
   125         listHolder := (HierarchicalList new)
       
   126                     showRoot:false;
       
   127                     application:self;
       
   128                     yourself
       
   129     ].
       
   130     ^ listHolder
       
   131 
       
   132     "Created: / 15-04-2010 / 20:32:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   133 ! !
       
   134 
       
   135 !HierarchicalLintRuleList methodsFor:'private'!
       
   136 
       
   137 updateList
       
   138     |inGenerator filterS inRules root|
       
   139 
       
   140     inGenerator := self inGeneratorHolder value.
       
   141     filterS := self filterHolder value.
       
   142     filterS isNilOrEmptyCollection ifFalse:
       
   143         [(filterS startsWith: $*) ifFalse:[filterS := '*' , filterS].
       
   144          (filterS endsWith:   $*) ifFalse:[filterS := filterS , '*']].
       
   145     (inGenerator isNil and: [self mode == #display])
       
   146         ifTrue:[inGenerator := RBCompositeLintRule allRules rules ].
       
   147     inRules := OrderedCollection new.
       
   148     filterS isNilOrEmptyCollection 
       
   149         ifTrue:
       
   150             [inGenerator do:[:rule | inRules add:rule ]]
       
   151         ifFalse:
       
   152             [inGenerator do:
       
   153                 [:rule|
       
   154                 rule flattened do:
       
   155                     [:each|
       
   156                     (filterS isNilOrEmptyCollection 
       
   157                         or:[each name matches: filterS])
       
   158                         ifTrue:
       
   159                             [inRules add: each]]]].
       
   160     root := (self 
       
   161                 listEntryFor:(RBCompositeLintRule rules:inRules name:'Rules'))
       
   162                 parent:self listHolder;
       
   163                 expand;
       
   164                 yourself.
       
   165     root children do:[:e | 
       
   166         e expand
       
   167     ].
       
   168     self listHolder root:root.
       
   169     listValid := true.
       
   170 
       
   171     "Created: / 15-04-2010 / 20:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   172     "Modified: / 16-04-2010 / 09:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   173     "Modified: / 25-08-2010 / 11:56:39 / Jan Vrany <enter your email here>"
       
   174 ! !
       
   175 
       
   176 !HierarchicalLintRuleList class methodsFor:'documentation'!
       
   177 
       
   178 version_CVS
       
   179     ^ '$Header: /cvs/stx/stx/libtool/Tools__HierarchicalLintRuleList.st,v 1.1 2011-07-01 13:31:35 cg Exp $'
       
   180 !
       
   181 
       
   182 version_SVN
       
   183     ^ '§Id: Tools__HierarchicalLintRuleList.st 7617 2010-08-25 12:56:19Z vranyj1 §'
       
   184 ! !