ProjectBrowser.st
changeset 1043 8414736f8846
parent 1038 41da0e38af84
child 1052 2b65eda2938e
equal deleted inserted replaced
1042:10adcd590f2a 1043:8414736f8846
   195                     #name: 'HTMLBrowser1'
   195                     #name: 'HTMLBrowser1'
   196                     #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   196                     #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   197                     #model: #htmlDocumentURLHolder
   197                     #model: #htmlDocumentURLHolder
   198                     #hasHorizontalScrollBar: true
   198                     #hasHorizontalScrollBar: true
   199                     #hasVerticalScrollBar: true
   199                     #hasVerticalScrollBar: true
       
   200                 )
       
   201               )
       
   202           )
       
   203       )
       
   204 !
       
   205 
       
   206 rightCanvasSpecForPatchesList
       
   207     "This resource specification was automatically generated
       
   208      by the UIPainter of ST/X."
       
   209 
       
   210     "Do not manually edit this!! If it is corrupted,
       
   211      the UIPainter may not be able to read the specification."
       
   212 
       
   213     "
       
   214      UIPainter new openOnClass:ProjectBrowser andSelector:#rightCanvasSpecForPatchesList
       
   215      ProjectBrowser new openInterface:#rightCanvasSpecForPatchesList
       
   216     "
       
   217 
       
   218     <resource: #canvas>
       
   219 
       
   220     ^
       
   221      
       
   222        #(#FullSpec
       
   223           #window: 
       
   224            #(#WindowSpec
       
   225               #name: 'NewApplication'
       
   226               #layout: #(#LayoutFrame 216 0 173 0 515 0 472 0)
       
   227               #level: 0
       
   228               #label: 'NewApplication'
       
   229               #min: #(#Point 10 10)
       
   230               #max: #(#Point 1280 1024)
       
   231               #bounds: #(#Rectangle 216 173 516 473)
       
   232               #usePreferredExtent: false
       
   233           )
       
   234           #component: 
       
   235            #(#SpecCollection
       
   236               #collection: 
       
   237                #(
       
   238                  #(#DataSetSpec
       
   239                     #name: 'patchesTable'
       
   240                     #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   241                     #hasHorizontalScrollBar: true
       
   242                     #hasVerticalScrollBar: true
       
   243                     #dataList: #patchesList
       
   244                     #has3Dsepartors: false
       
   245                     #columnHolder: #patchesTableColumns
       
   246                     #columnAdaptor: #classTableAdaptor
   200                 )
   247                 )
   201               )
   248               )
   202           )
   249           )
   203       )
   250       )
   204 !
   251 !
   593            #labelAlignment: #left
   640            #labelAlignment: #left
   594            #minWidth: 200
   641            #minWidth: 200
   595            #model: #classFilenameFromClassInfo:
   642            #model: #classFilenameFromClassInfo:
   596        )
   643        )
   597      )
   644      )
       
   645 !
       
   646 
       
   647 patchesTableColumns
       
   648     "This resource specification was automatically generated
       
   649      by the DataSetBuilder of ST/X."
       
   650 
       
   651     "Do not manually edit this!! If it is corrupted,
       
   652      the DataSetBuilder may not be able to read the specification."
       
   653 
       
   654     "
       
   655      DataSetBuilder new openOnClass:ProjectBrowser andSelector:#patchesTableColumns
       
   656     "
       
   657 
       
   658     <resource: #tableColumns>
       
   659 
       
   660 
       
   661     ^ #(
       
   662         #(#DataSetColumnSpec
       
   663            #label: 'Class'
       
   664            #id: 'classColumn'
       
   665            #labelAlignment: #left
       
   666            #model: #classNameFromPatchesInfo:
       
   667        )
       
   668         #(#DataSetColumnSpec
       
   669            #label: 'Selector'
       
   670            #id: 'selectorColumn'
       
   671            #labelAlignment: #left
       
   672            #model: #selectorFromPatchesInfo:
       
   673        )
       
   674      )
   598 ! !
   675 ! !
   599 
   676 
   600 !ProjectBrowser methodsFor:'aspects'!
   677 !ProjectBrowser methodsFor:'aspects'!
   601 
   678 
   602 classList
   679 classList
   658 
   735 
   659     |holder|
   736     |holder|
   660 
   737 
   661     (holder := builder bindingAt:#htmlDocumentURLHolder) isNil ifTrue:[
   738     (holder := builder bindingAt:#htmlDocumentURLHolder) isNil ifTrue:[
   662         builder aspectAt:#htmlDocumentURLHolder put:(holder :=  ValueHolder new).
   739         builder aspectAt:#htmlDocumentURLHolder put:(holder :=  ValueHolder new).
       
   740     ].
       
   741     ^ holder.
       
   742 !
       
   743 
       
   744 patchesList
       
   745     "automatically generated by UIPainter ..."
       
   746 
       
   747     "*** the code below creates a default model when invoked."
       
   748     "*** (which may not be the one you wanted)"
       
   749     "*** Please change as required and accept in the browser."
       
   750 
       
   751     |holder|
       
   752 
       
   753     (holder := builder bindingAt:#patchesList) isNil ifTrue:[
       
   754         builder aspectAt:#patchesList put:(holder :=  List new).
   663     ].
   755     ].
   664     ^ holder.
   756     ^ holder.
   665 !
   757 !
   666 
   758 
   667 projectTreeHolder
   759 projectTreeHolder
   767 
   859 
   768 nodeFor:aProject
   860 nodeFor:aProject
   769     "generate and return a treeNode for some project"
   861     "generate and return a treeNode for some project"
   770 
   862 
   771     |projectName pNode 
   863     |projectName pNode 
   772      propertiesNode docNode classesNode subprojectsNode filesNode
   864      propertiesNode docNode classesNode patchesNode subprojectsNode filesNode
   773      commentNode prerequisitesNode|
   865      commentNode prerequisitesNode analysisNode designNode codeNode
       
   866      userDocNode userOverViewNode userGuideNode userRefManNode|
   774 
   867 
   775     projectName := aProject name.
   868     projectName := aProject name.
   776     pNode := ProjectNode name:projectName.
   869     pNode := ProjectNode name:projectName.
   777     pNode contents:aProject.
   870     pNode contents:aProject.
   778 
   871 
   779     pNode add:(commentNode := ProjectTreeItem name:'Comment').
   872     pNode add:(commentNode := ProjectTreeItem name:'Comment').
   780     pNode add:(docNode := ProjectTreeItem name:'Documentation').
   873     pNode add:(docNode := ProjectTreeItem name:'Documentation').
   781     pNode add:(propertiesNode := ProjectTreeItem name:'Properties').
   874     pNode add:(propertiesNode := ProjectTreeItem name:'Properties').
   782     pNode add:(classesNode := ProjectTreeItem name:'Classes').
       
   783     pNode add:(prerequisitesNode := ProjectTreeItem name:'Prerequisites').
   875     pNode add:(prerequisitesNode := ProjectTreeItem name:'Prerequisites').
   784     pNode add:(subprojectsNode := ProjectTreeItem name:'SubProjects').
   876     pNode add:(subprojectsNode := ProjectTreeItem name:'SubProjects').
       
   877     pNode add:(classesNode := ProjectTreeItem name:'Classes').
       
   878     pNode add:(patchesNode := ProjectTreeItem name:'Patches').
   785     pNode add:(filesNode := ProjectTreeItem name:'Files').
   879     pNode add:(filesNode := ProjectTreeItem name:'Files').
   786 
   880 
   787     aProject subProjects do:[:aSubProject |
   881     aProject subProjects do:[:aSubProject |
   788         subprojectsNode add:(self nodeFor:aSubProject)
   882         subprojectsNode add:(self nodeFor:aSubProject)
   789     ].
   883     ].
   792     commentNode contents:#comment.
   886     commentNode contents:#comment.
   793 
   887 
   794     docNode contents:#documentation.
   888     docNode contents:#documentation.
   795     docNode action:[:item | self showDocumentationFor:item].
   889     docNode action:[:item | self showDocumentationFor:item].
   796 
   890 
       
   891     docNode add:(analysisNode := ProjectTreeItem name:'Analysis').
       
   892     docNode add:(designNode := ProjectTreeItem name:'Design').
       
   893     docNode add:(codeNode := ProjectTreeItem name:'Code').
       
   894     docNode add:(userDocNode := ProjectTreeItem name:'User Documentation').
       
   895     userDocNode add:(userOverViewNode := ProjectTreeItem name:'Overview').
       
   896     userDocNode add:(userGuideNode := ProjectTreeItem name:'Guide').
       
   897     userDocNode add:(userRefManNode := ProjectTreeItem name:'Reference').
       
   898     docNode add:(userDocNode := ProjectTreeItem name:'Error Reports').
       
   899     docNode add:(userDocNode := ProjectTreeItem name:'Other').
       
   900 
       
   901     prerequisitesNode contents:#prerequisites.
       
   902 
   797     classesNode contents:#classes.
   903     classesNode contents:#classes.
       
   904     ((aProject classes ? #()) copy sort:[:a :b | a name < b name]) 
       
   905     do:[:aClass |
       
   906         |cNode|
       
   907 
       
   908         cNode := ProjectTreeItem name:aClass name.
       
   909         classesNode add:cNode.
       
   910     ].
   798 
   911 
   799     propertiesNode contents:#properties.
   912     propertiesNode contents:#properties.
   800 
   913 
   801     prerequisitesNode contents:#prerequisites.
       
   802 
       
   803     subprojectsNode contents:#subprojects.
   914     subprojectsNode contents:#subprojects.
   804 
   915 
   805     filesNode contents:#files.
   916     filesNode contents:#files.
       
   917 
       
   918     patchesNode contents:#patches.
   806 
   919 
   807     ^ pNode
   920     ^ pNode
   808 
   921 
   809 !
   922 !
   810 
   923 
   840 
   953 
   841     selectedNode contents == #classes ifTrue:[
   954     selectedNode contents == #classes ifTrue:[
   842         self showClassListOf:selectedNode.
   955         self showClassListOf:selectedNode.
   843         ^ self.
   956         ^ self.
   844     ].
   957     ].
       
   958     selectedNode contents == #patches ifTrue:[
       
   959         self showPatchesListOf:selectedNode.
       
   960         ^ self.
       
   961     ].
       
   962 
   845 
   963 
   846     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
   964     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
   847     self rightCanvasTextHolder value:''.
   965     self rightCanvasTextHolder value:''.
   848 
   966 
   849 ! !
   967 ! !
   858     ^ cInfo conditionForInclusion
   976     ^ cInfo conditionForInclusion
   859 !
   977 !
   860 
   978 
   861 classNameFromClassInfo:cInfo
   979 classNameFromClassInfo:cInfo
   862     ^ cInfo className
   980     ^ cInfo className
       
   981 !
       
   982 
       
   983 classNameFromPatchesInfo:pInfo
       
   984     ^ pInfo methodClass name
       
   985 !
       
   986 
       
   987 selectorFromPatchesInfo:pInfo
       
   988     ^ pInfo methodSelector
   863 ! !
   989 ! !
   864 
   990 
   865 !ProjectBrowser methodsFor:'user actions'!
   991 !ProjectBrowser methodsFor:'user actions'!
   866 
   992 
   867 itemSelected:index
   993 itemSelected:index
  1020 
  1146 
  1021     self currentCanvasHolder value:(self class rightCanvasSpecForHTMLText).
  1147     self currentCanvasHolder value:(self class rightCanvasSpecForHTMLText).
  1022     self htmlDocumentURLHolder value:project documentationURL.
  1148     self htmlDocumentURLHolder value:project documentationURL.
  1023 !
  1149 !
  1024 
  1150 
       
  1151 showPatchesListOf:anItem
       
  1152     |projectItem project patches l|
       
  1153 
       
  1154     projectItem := anItem parent.
       
  1155     project := projectItem contents.
       
  1156 
       
  1157     patches := project individualMethods.
       
  1158     patches := patches collect:[:m | m who].
       
  1159     patches := patches sort:[:w1 :w2 |
       
  1160                         w1 methodClass name < w2 methodClass name ifTrue:[
       
  1161                             true
       
  1162                         ] ifFalse:[
       
  1163                             w1 methodClass name = w2 methodClass name ifFalse:[
       
  1164                                 false
       
  1165                             ] ifTrue:[
       
  1166                                 w1 methodSelector < w2 methodSelector
       
  1167                             ]
       
  1168                         ]
       
  1169                        ].
       
  1170 
       
  1171     l := self patchesList.
       
  1172     l removeAll.
       
  1173     l addAll:patches.
       
  1174 
       
  1175     self currentCanvasHolder value:(self class rightCanvasSpecForPatchesList).
       
  1176 !
       
  1177 
  1025 showReadOnlyText:someText
  1178 showReadOnlyText:someText
  1026     self currentCanvasHolder value:(self class rightCanvasSpecForReadOnlyText).
  1179     self currentCanvasHolder value:(self class rightCanvasSpecForReadOnlyText).
  1027     self rightCanvasTextHolder value:someText.
  1180     self rightCanvasTextHolder value:someText.
  1028 
  1181 
  1029 !
  1182 !