Tools__ToDoListBrowser.st
changeset 7986 ecee84d41552
parent 7933 cc2c54e4043b
child 7996 7074ccb92b99
equal deleted inserted replaced
7985:96270f424059 7986:ecee84d41552
   133 
   133 
   134     "Do not manually edit this!! If it is corrupted,
   134     "Do not manually edit this!! If it is corrupted,
   135      the MenuEditor may not be able to read the specification."
   135      the MenuEditor may not be able to read the specification."
   136 
   136 
   137     "
   137     "
   138      MenuEditor new openOnClass:ToDoListBrowser andSelector:#itemMenu
   138      MenuEditor new openOnClass:Tools::ToDoListBrowser andSelector:#itemMenu
   139      (Menu new fromLiteralArrayEncoding:(ToDoListBrowser itemMenu)) startUp
   139      (Menu new fromLiteralArrayEncoding:(Tools::ToDoListBrowser itemMenu)) startUp
   140     "
   140     "
   141 
   141 
   142     <resource: #menu>
   142     <resource: #menu>
   143 
   143 
   144     ^ 
   144     ^ 
   153             label: '-'
   153             label: '-'
   154           )
   154           )
   155          (MenuItem
   155          (MenuItem
   156             label: 'Remove'
   156             label: 'Remove'
   157             itemValue: removeItem
   157             itemValue: removeItem
       
   158             translateLabel: true
       
   159           )
       
   160          (MenuItem
       
   161             label: 'Remove all Items for this Class'
       
   162             itemValue: removeItemsForClass
       
   163             translateLabel: true
       
   164           )
       
   165          (MenuItem
       
   166             label: 'Remove all Items for this Class and its Private Classes'
       
   167             itemValue: removeItemsForClassOrPrivateClass
   158             translateLabel: true
   168             translateLabel: true
   159           )
   169           )
   160          )
   170          )
   161         nil
   171         nil
   162         nil
   172         nil
   317 
   327 
   318     "Created: / 21-10-2006 / 15:38:08 / cg"
   328     "Created: / 21-10-2006 / 15:38:08 / cg"
   319     "Modified: / 21-10-2006 / 21:14:31 / cg"
   329     "Modified: / 21-10-2006 / 21:14:31 / cg"
   320 !
   330 !
   321 
   331 
       
   332 selectedTodoListEntry
       
   333     ^ self todoListEntryAtIndex:(self selectionIndex).
       
   334 !
       
   335 
       
   336 selectionIndex
       
   337     ^ self selectionIndexHolder value
       
   338 !
       
   339 
   322 selectionIndexHolder
   340 selectionIndexHolder
   323     selectionIndexHolder isNil ifTrue:[
   341     selectionIndexHolder isNil ifTrue:[
   324         selectionIndexHolder := nil asValue.
   342         selectionIndexHolder := nil asValue.
   325     ].
   343     ].
   326     ^ selectionIndexHolder
   344     ^ selectionIndexHolder
   342         toDoList := ToDoList theOneAndOnlyToDoList.
   360         toDoList := ToDoList theOneAndOnlyToDoList.
   343     ].
   361     ].
   344     ^ toDoList
   362     ^ toDoList
   345 
   363 
   346     "Created: / 21-10-2006 / 20:57:18 / cg"
   364     "Created: / 21-10-2006 / 20:57:18 / cg"
       
   365 !
       
   366 
       
   367 todoListEntryAtIndex:idx
       
   368     ^ shownCopyOfToDoList at:idx
   347 ! !
   369 ! !
   348 
   370 
   349 !ToDoListBrowser methodsFor:'change & update'!
   371 !ToDoListBrowser methodsFor:'change & update'!
   350 
   372 
   351 update:something with:aParameter from:changedObject
   373 update:something with:aParameter from:changedObject
   446     toDoList removeAll
   468     toDoList removeAll
   447 
   469 
   448     "Created: / 22-10-2006 / 00:02:15 / cg"
   470     "Created: / 22-10-2006 / 00:02:15 / cg"
   449 !
   471 !
   450 
   472 
   451 menuSave
       
   452     "This method was generated by the Browser.
       
   453      It will be invoked when the menu-item 'save' is selected."
       
   454 
       
   455     "/ change below and add any actions as required here ...
       
   456     self warn:'no action for ''save'' defined.'.
       
   457 !
       
   458 
       
   459 menuSaveAs
       
   460     "This method was generated by the Browser.
       
   461      It will be invoked when the menu-item 'saveAs' is selected."
       
   462 
       
   463     "/ change below and add any actions as required here ...
       
   464     self warn:'no action for ''saveAs'' defined.'.
       
   465 !
       
   466 
       
   467 openAboutThisApplication
   473 openAboutThisApplication
   468     "This method was generated by the Browser.
       
   469      It will be invoked when the menu-item 'help-about' is selected."
       
   470 
       
   471     "/ could open a customized aboutBox here ...
       
   472     super openAboutThisApplication
   474     super openAboutThisApplication
   473 !
   475 !
   474 
   476 
   475 openDocumentation
   477 openDocumentation
   476     "This method was generated by the Browser.
       
   477      It will be invoked when the menu-item 'help-documentation' is selected."
       
   478 
       
   479     "/ change below as required ...
       
   480 
       
   481     "/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
       
   482     HTMLDocumentView openFullOnDocumentationFile:'tools\misc\TOP.html#TODOLIST'.
   478     HTMLDocumentView openFullOnDocumentationFile:'tools\misc\TOP.html#TODOLIST'.
   483 
   479 
   484     "/ add application-specific help files under the 'doc/online/<language>/help/appName'
   480     "/ add application-specific help files under the 'doc/online/<language>/help/appName'
   485     "/ directory, and open a viewer with:
   481     "/ directory, and open a viewer with:
   486     "/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
   482     "/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
   487 ! !
   483 ! !
   488 
   484 
   489 !ToDoListBrowser methodsFor:'menu actions-item'!
   485 !ToDoListBrowser methodsFor:'menu actions-item'!
   490 
   486 
   491 browseItem
   487 browseItem
   492     (shownCopyOfToDoList at:self selectionIndexHolder value) browse
   488     (self todoListEntryAtIndex:self selectionIndexHolder value) browse
   493 
   489 
   494     "Created: / 22-10-2006 / 02:00:20 / cg"
   490     "Created: / 22-10-2006 / 02:00:20 / cg"
   495     "Modified: / 18-02-2007 / 12:56:49 / cg"
   491     "Modified: / 18-02-2007 / 12:56:49 / cg"
   496 !
   492 !
   497 
   493 
   498 removeItem
   494 removeItem
   499     toDoList remove:(shownCopyOfToDoList at:self selectionIndexHolder value)
   495     toDoList remove:(self selectedTodoListEntry)
   500 
   496 
   501     "Created: / 22-10-2006 / 10:45:52 / cg"
   497     "Created: / 22-10-2006 / 10:45:52 / cg"
   502     "Modified: / 18-02-2007 / 12:57:58 / cg"
   498     "Modified: / 18-02-2007 / 12:57:58 / cg"
       
   499 !
       
   500 
       
   501 removeItems:entriesToRemove
       
   502     entriesToRemove do:[:entryToRemove |
       
   503         toDoList remove:entryToRemove
       
   504     ].
       
   505 !
       
   506 
       
   507 removeItemsForClass
       
   508     |cls entriesToRemove|
       
   509 
       
   510     cls := self selectedTodoListEntry problemClass.
       
   511     entriesToRemove := toDoList select:[:entry | entry problemClass == cls].
       
   512     self removeItems:entriesToRemove
       
   513 !
       
   514 
       
   515 removeItemsForClassOrPrivateClass
       
   516     |cls entriesToRemove|
       
   517 
       
   518     cls := self selectedTodoListEntry problemClass.
       
   519     entriesToRemove := toDoList select:[:entry | entry problemClass == cls
       
   520                                                  or:[ entry problemClass topOwningClass == cls]].
       
   521     self removeItems:entriesToRemove
   503 ! !
   522 ! !
   504 
   523 
   505 !ToDoListBrowser methodsFor:'user actions'!
   524 !ToDoListBrowser methodsFor:'user actions'!
   506 
   525 
   507 itemDoubleClicked:itemIndex
   526 itemDoubleClicked:itemIndex
   508     (shownCopyOfToDoList at:itemIndex) browse
   527     (self selectedTodoListEntry) browse
   509 
   528 
   510     "Created: / 22-10-2006 / 01:49:13 / cg"
   529     "Created: / 22-10-2006 / 01:49:13 / cg"
   511     "Modified: / 18-02-2007 / 12:56:30 / cg"
   530     "Modified: / 18-02-2007 / 12:56:30 / cg"
   512 !
   531 !
   513 
   532 
   565 ! !
   584 ! !
   566 
   585 
   567 !ToDoListBrowser class methodsFor:'documentation'!
   586 !ToDoListBrowser class methodsFor:'documentation'!
   568 
   587 
   569 version
   588 version
   570     ^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListBrowser.st,v 1.10 2008-01-24 18:29:27 cg Exp $'
   589     ^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListBrowser.st,v 1.11 2008-02-27 16:13:10 cg Exp $'
   571 ! !
   590 ! !