1 " |
1 " |
2 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
2 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
3 All Rights Reserved |
3 All Rights Reserved |
4 |
4 |
5 Permission is hereby granted, free of charge, to any person |
5 Permission is hereby granted, free of charge, to any person |
6 obtaining a copy of this software and associated documentation |
6 obtaining a copy of this software and associated documentation |
7 files (the 'Software'), to deal in the Software without |
7 files (the 'Software'), to deal in the Software without |
8 restriction, including without limitation the rights to use, |
8 restriction, including without limitation the rights to use, |
46 !ChangeList class methodsFor:'documentation'! |
46 !ChangeList class methodsFor:'documentation'! |
47 |
47 |
48 copyright |
48 copyright |
49 " |
49 " |
50 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
50 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
51 All Rights Reserved |
51 All Rights Reserved |
52 |
52 |
53 Permission is hereby granted, free of charge, to any person |
53 Permission is hereby granted, free of charge, to any person |
54 obtaining a copy of this software and associated documentation |
54 obtaining a copy of this software and associated documentation |
55 files (the 'Software'), to deal in the Software without |
55 files (the 'Software'), to deal in the Software without |
56 restriction, including without limitation the rights to use, |
56 restriction, including without limitation the rights to use, |
201 |
207 |
202 <resource: #tableColumns> |
208 <resource: #tableColumns> |
203 |
209 |
204 ^#( |
210 ^#( |
205 (DataSetColumnSpec |
211 (DataSetColumnSpec |
206 label: 'Removed' |
212 label: 'Removed' |
207 id: 'removed' |
213 id: 'removed' |
208 labelButtonType: Button |
214 labelButtonType: Button |
209 width: 20 |
215 width: 20 |
210 minWidth: 20 |
216 minWidth: 20 |
211 editorType: CheckToggle |
217 height: heightOfFirstRow |
212 rendererType: CheckToggle |
218 editorType: CheckToggle |
213 model: notRemoved |
219 rendererType: CheckToggle |
214 menuFromApplication: false |
220 model: notRemoved |
215 printSelector: notRemoved |
221 menuFromApplication: false |
216 isResizeable: false |
222 printSelector: notRemoved |
217 showRowSeparator: false |
223 isResizeable: false |
218 showSelectionHighLighted: false |
224 showRowSeparator: false |
219 showColSeparator: false |
225 showColSeparator: false |
220 ) |
226 ) |
221 (DataSetColumnSpec |
227 (DataSetColumnSpec |
222 label: 'Delta' |
228 label: 'Delta' |
223 id: 'delta' |
229 id: 'delta' |
224 labelButtonType: Button |
230 labelButtonType: Button |
225 width: 20 |
231 width: 20 |
226 minWidth: 20 |
232 minWidth: 20 |
227 menuFromApplication: false |
233 height: heightOfFirstRow |
228 printSelector: iconDelta |
234 menuFromApplication: false |
229 canSelect: false |
235 printSelector: iconDelta |
230 isResizeable: false |
236 canSelect: false |
231 showRowSeparator: false |
237 isResizeable: false |
232 showSelectionHighLighted: false |
238 showRowSeparator: false |
233 showColSeparator: false |
239 showColSeparator: false |
234 ) |
240 ) |
235 (DataSetColumnSpec |
241 (DataSetColumnSpec |
236 label: 'Change' |
242 label: 'Change' |
237 id: change |
243 id: change |
238 labelAlignment: left |
244 labelAlignment: left |
239 labelButtonType: Button |
245 labelButtonType: Button |
240 menuFromApplication: false |
246 height: heightOfFirstRow |
241 printSelector: label |
247 menuFromApplication: false |
242 canSelect: false |
248 printSelector: label |
243 showRowSeparator: false |
249 canSelect: false |
244 showColSeparator: false |
250 showRowSeparator: false |
|
251 showColSeparator: false |
245 ) |
252 ) |
246 (DataSetColumnSpec |
253 (DataSetColumnSpec |
247 label: 'Class' |
254 label: 'Class' |
248 id: 'className' |
255 id: 'className' |
249 labelAlignment: left |
256 labelAlignment: left |
250 activeHelpKey: '' |
257 activeHelpKey: '' |
251 activeHelpKeyForLabel: '' |
258 activeHelpKeyForLabel: '' |
252 labelButtonType: Button |
259 labelButtonType: Button |
253 usePreferredWidth: true |
260 usePreferredWidth: true |
254 model: className |
261 height: heightOfFirstRow |
255 menuFromApplication: false |
262 model: className |
256 canSelect: false |
263 menuFromApplication: false |
257 showRowSeparator: false |
264 canSelect: false |
258 showColSeparator: false |
265 showRowSeparator: false |
|
266 showColSeparator: false |
259 ) |
267 ) |
260 (DataSetColumnSpec |
268 (DataSetColumnSpec |
261 label: 'Selector' |
269 label: 'Selector' |
262 id: 'selector' |
270 id: 'selector' |
263 labelAlignment: left |
271 labelAlignment: left |
264 activeHelpKey: '' |
272 activeHelpKey: '' |
265 activeHelpKeyForLabel: '' |
273 activeHelpKeyForLabel: '' |
266 labelButtonType: Button |
274 labelButtonType: Button |
267 usePreferredWidth: true |
275 usePreferredWidth: true |
268 model: selector |
276 height: heightOfFirstRow |
269 menuFromApplication: false |
277 model: selector |
270 canSelect: false |
278 menuFromApplication: false |
271 showRowSeparator: false |
279 canSelect: false |
272 showColSeparator: false |
280 showRowSeparator: false |
|
281 showColSeparator: false |
273 ) |
282 ) |
274 (DataSetColumnSpec |
283 (DataSetColumnSpec |
275 label: 'Category' |
284 label: 'Category' |
276 id: category |
285 id: category |
277 labelAlignment: left |
286 labelAlignment: left |
278 labelButtonType: Button |
287 labelButtonType: Button |
279 usePreferredWidth: true |
288 usePreferredWidth: true |
280 model: category |
289 height: heightOfFirstRow |
281 menuFromApplication: false |
290 model: category |
282 canSelect: false |
291 menuFromApplication: false |
283 showRowSeparator: false |
292 canSelect: false |
284 showColSeparator: false |
293 showRowSeparator: false |
|
294 showColSeparator: false |
285 ) |
295 ) |
286 (DataSetColumnSpec |
296 (DataSetColumnSpec |
287 label: 'Time Stamp' |
297 label: 'Time Stamp' |
288 id: timeStamp |
298 id: timeStamp |
289 labelAlignment: left |
299 labelAlignment: left |
290 labelButtonType: Button |
300 labelButtonType: Button |
291 usePreferredWidth: true |
301 usePreferredWidth: true |
292 model: timeStamp |
302 height: heightOfFirstRow |
293 menuFromApplication: false |
303 model: timeStamp |
294 canSelect: false |
304 menuFromApplication: false |
295 showRowSeparator: false |
305 canSelect: false |
296 showColSeparator: false |
306 showRowSeparator: false |
|
307 showColSeparator: false |
297 ) |
308 ) |
298 ) |
309 ) |
299 |
310 |
300 ! ! |
311 ! ! |
301 |
312 |
302 !ChangeList class methodsFor:'menu specs'! |
313 !ChangeList class methodsFor:'menu specs'! |
303 |
314 |
304 listMenu |
315 listMenu |
570 allowAcceptHolder := something. |
584 allowAcceptHolder := something. |
571 ! |
585 ! |
572 |
586 |
573 allowRemoveHolder |
587 allowRemoveHolder |
574 "return/create the 'allowRemoveHolder' value holder (automatically generated)" |
588 "return/create the 'allowRemoveHolder' value holder (automatically generated)" |
575 |
589 |
576 allowRemoveHolder isNil ifTrue:[ |
590 allowRemoveHolder isNil ifTrue:[ |
577 allowRemoveHolder := ValueHolder with:true. |
591 allowRemoveHolder := ValueHolder with:true. |
578 allowRemoveHolder addDependent:self. |
592 allowRemoveHolder addDependent:self. |
579 ]. |
593 ]. |
580 ^ allowRemoveHolder |
594 ^ allowRemoveHolder |
581 |
595 |
582 "Modified (comment): / 24-01-2012 / 19:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
596 "Modified (comment): / 24-01-2012 / 19:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
583 ! |
597 ! |
584 |
598 |
585 allowRemoveHolder:something |
599 allowRemoveHolder:something |
586 "set the 'showRemovedHolder' value holder (automatically generated)" |
600 "set the 'showRemovedHolder' value holder (automatically generated)" |
587 |
601 |
588 |oldValue newValue| |
602 |oldValue newValue| |
589 |
603 |
590 allowRemoveHolder notNil ifTrue:[ |
604 allowRemoveHolder notNil ifTrue:[ |
591 oldValue := allowRemoveHolder value. |
605 oldValue := allowRemoveHolder value. |
592 allowRemoveHolder removeDependent:self. |
606 allowRemoveHolder removeDependent:self. |
593 ]. |
607 ]. |
594 allowRemoveHolder := something. |
608 allowRemoveHolder := something. |
595 allowRemoveHolder notNil ifTrue:[ |
609 allowRemoveHolder notNil ifTrue:[ |
596 allowRemoveHolder addDependent:self. |
610 allowRemoveHolder addDependent:self. |
597 ]. |
611 ]. |
598 newValue := allowRemoveHolder value. |
612 newValue := allowRemoveHolder value. |
599 oldValue ~~ newValue ifTrue:[ |
613 oldValue ~~ newValue ifTrue:[ |
600 self |
614 self |
601 update:#value |
615 update:#value |
602 with:newValue |
616 with:newValue |
603 from:allowRemoveHolder. |
617 from:allowRemoveHolder. |
604 ]. |
618 ]. |
605 ! |
619 ! |
606 |
620 |
607 listColumns |
621 listColumns |
608 |
622 |
617 "Created: / 26-07-2012 / 18:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
631 "Created: / 26-07-2012 / 18:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
618 ! |
632 ! |
619 |
633 |
620 listHolder |
634 listHolder |
621 listHolder isNil ifTrue:[ |
635 listHolder isNil ifTrue:[ |
622 listHolder := ValueHolder new. |
636 listHolder := ValueHolder new. |
623 ]. |
637 ]. |
624 ^ listHolder |
638 ^ listHolder |
625 ! |
639 ! |
626 |
640 |
627 showConflictsOnlyHolder |
641 showConflictsOnlyHolder |
628 "return/create the 'showConflictsOnlyHolder' value holder (automatically generated)" |
642 "return/create the 'showConflictsOnlyHolder' value holder (automatically generated)" |
629 |
643 |
630 showConflictsOnlyHolder isNil ifTrue:[ |
644 showConflictsOnlyHolder isNil ifTrue:[ |
631 showConflictsOnlyHolder := ValueHolder with: true. |
645 showConflictsOnlyHolder := ValueHolder with: false. |
632 showConflictsOnlyHolder addDependent: self. |
646 showConflictsOnlyHolder addDependent: self. |
633 ]. |
647 ]. |
634 ^ showConflictsOnlyHolder |
648 ^ showConflictsOnlyHolder |
|
649 |
|
650 "Modified: / 05-09-2014 / 00:54:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
635 ! |
651 ! |
636 |
652 |
637 showConflictsOnlyHolder:something |
653 showConflictsOnlyHolder:something |
638 "set the 'showConflictsOnlyHolder' value holder (automatically generated)" |
654 "set the 'showConflictsOnlyHolder' value holder (automatically generated)" |
639 |
655 |
651 oldValue ~~ newValue ifTrue:[ |
667 oldValue ~~ newValue ifTrue:[ |
652 self update:#value with:newValue from:showConflictsOnlyHolder. |
668 self update:#value with:newValue from:showConflictsOnlyHolder. |
653 ]. |
669 ]. |
654 ! |
670 ! |
655 |
671 |
|
672 showDefinitionsOnlyHolder |
|
673 "return/create the 'showDefinitionsOnlyHolder' value holder (automatically generated)" |
|
674 |
|
675 showDefinitionsOnlyHolder isNil ifTrue:[ |
|
676 showDefinitionsOnlyHolder := ValueHolder with: false. |
|
677 showDefinitionsOnlyHolder addDependent: self. |
|
678 ]. |
|
679 ^ showDefinitionsOnlyHolder |
|
680 |
|
681 "Modified: / 05-09-2014 / 00:52:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
682 ! |
|
683 |
|
684 showDefinitionsOnlyHolder:something |
|
685 "set the 'showDefinitionsOnlyHolder' value holder (automatically generated)" |
|
686 |
|
687 |oldValue newValue| |
|
688 |
|
689 showDefinitionsOnlyHolder notNil ifTrue:[ |
|
690 oldValue := showDefinitionsOnlyHolder value. |
|
691 showDefinitionsOnlyHolder removeDependent:self. |
|
692 ]. |
|
693 showDefinitionsOnlyHolder := something. |
|
694 showDefinitionsOnlyHolder notNil ifTrue:[ |
|
695 showDefinitionsOnlyHolder addDependent:self. |
|
696 ]. |
|
697 newValue := showDefinitionsOnlyHolder value. |
|
698 oldValue ~~ newValue ifTrue:[ |
|
699 self update:#value with:newValue from:showDefinitionsOnlyHolder. |
|
700 ]. |
|
701 ! |
|
702 |
656 showRemovedHolder |
703 showRemovedHolder |
657 "return/create the 'showRemovedHolder' value holder (automatically generated)" |
704 "return/create the 'showRemovedHolder' value holder (automatically generated)" |
658 |
705 |
659 showRemovedHolder isNil ifTrue:[ |
706 showRemovedHolder isNil ifTrue:[ |
660 showRemovedHolder := ValueHolder with: true. |
707 showRemovedHolder := ValueHolder with: true. |
661 showRemovedHolder addDependent: self. |
708 showRemovedHolder addDependent: self. |
662 ]. |
709 ]. |
663 ^ showRemovedHolder |
710 ^ showRemovedHolder |
664 ! |
711 ! |
665 |
712 |
666 showRemovedHolder:something |
713 showRemovedHolder:something |
667 "set the 'showRemovedHolder' value holder (automatically generated)" |
714 "set the 'showRemovedHolder' value holder (automatically generated)" |
668 |
715 |
669 |oldValue newValue| |
716 |oldValue newValue| |
670 |
717 |
671 showRemovedHolder notNil ifTrue:[ |
718 showRemovedHolder notNil ifTrue:[ |
672 oldValue := showRemovedHolder value. |
719 oldValue := showRemovedHolder value. |
673 showRemovedHolder removeDependent:self. |
720 showRemovedHolder removeDependent:self. |
674 ]. |
721 ]. |
675 showRemovedHolder := something. |
722 showRemovedHolder := something. |
676 showRemovedHolder notNil ifTrue:[ |
723 showRemovedHolder notNil ifTrue:[ |
677 showRemovedHolder addDependent:self. |
724 showRemovedHolder addDependent:self. |
678 ]. |
725 ]. |
679 newValue := showRemovedHolder value. |
726 newValue := showRemovedHolder value. |
680 oldValue ~~ newValue ifTrue:[ |
727 oldValue ~~ newValue ifTrue:[ |
681 self update:#value with:newValue from:showRemovedHolder. |
728 self update:#value with:newValue from:showRemovedHolder. |
682 ]. |
729 ]. |
683 ! |
730 ! |
684 |
731 |
685 showSameHolder |
732 showSameHolder |
686 "return/create the 'showSameHolder' value holder (automatically generated)" |
733 "return/create the 'showSameHolder' value holder (automatically generated)" |
687 |
734 |
688 showSameHolder isNil ifTrue:[ |
735 showSameHolder isNil ifTrue:[ |
689 showSameHolder := ValueHolder with: true. |
736 showSameHolder := ValueHolder with: true. |
690 showSameHolder addDependent:self. |
737 showSameHolder addDependent:self. |
691 ]. |
738 ]. |
692 ^ showSameHolder |
739 ^ showSameHolder |
693 |
740 |
694 "Modified: / 04-08-2011 / 18:39:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
741 "Modified: / 04-08-2011 / 18:39:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
695 ! |
742 ! |
698 "set the 'showSameHolder' value holder (automatically generated)" |
745 "set the 'showSameHolder' value holder (automatically generated)" |
699 |
746 |
700 |oldValue newValue| |
747 |oldValue newValue| |
701 |
748 |
702 showSameHolder notNil ifTrue:[ |
749 showSameHolder notNil ifTrue:[ |
703 oldValue := showSameHolder value. |
750 oldValue := showSameHolder value. |
704 showSameHolder removeDependent:self. |
751 showSameHolder removeDependent:self. |
705 ]. |
752 ]. |
706 showSameHolder := something. |
753 showSameHolder := something. |
707 showSameHolder notNil ifTrue:[ |
754 showSameHolder notNil ifTrue:[ |
708 showSameHolder addDependent:self. |
755 showSameHolder addDependent:self. |
709 ]. |
756 ]. |
710 newValue := showSameHolder value. |
757 newValue := showSameHolder value. |
711 oldValue ~~ newValue ifTrue:[ |
758 oldValue ~~ newValue ifTrue:[ |
712 self update:#value with:newValue from:showSameHolder. |
759 self update:#value with:newValue from:showSameHolder. |
713 ]. |
760 ]. |
714 ! |
761 ! |
715 |
762 |
716 showTimestampHolder |
763 showTimestampHolder |
717 "return/create the 'showTimestampHolder' value holder (automatically generated)" |
764 "return/create the 'showTimestampHolder' value holder (automatically generated)" |
817 !ChangeList methodsFor:'event processing'! |
867 !ChangeList methodsFor:'event processing'! |
818 |
868 |
819 handlesKeyPress:key inView:aView |
869 handlesKeyPress:key inView:aView |
820 <resource: #keyboard (#Accept #Ctrls)> |
870 <resource: #keyboard (#Accept #Ctrls)> |
821 |
871 |
822 ^(key == #Accept or:[ key == #Ctrls]) |
872 (super handlesKeyPress:key inView:aView) |
823 and:[ listView scrolledView == aView ] |
873 or:[(key == #Accept or:[ key == #Ctrls]) |
|
874 and:[ listView scrolledView == aView ]] |
824 |
875 |
825 "Created: / 08-02-2012 / 14:43:11 / cg" |
876 "Created: / 08-02-2012 / 14:43:11 / cg" |
|
877 "Modified: / 10-04-2014 / 11:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
826 ! |
878 ! |
827 |
879 |
828 keyPress:key x:x y:y view:aView |
880 keyPress:key x:x y:y view:aView |
829 (key == #Accept or:[ key == #Ctrls]) ifTrue:[ |
881 (key == #Accept or:[ key == #Ctrls]) ifTrue:[ |
830 self listMenuApply. |
882 self listMenuApply. |
831 ^ self |
883 ^ self |
832 ]. |
884 ]. |
|
885 |
|
886 super keyPress:key x:x y:y view:aView |
833 |
887 |
834 "Created: / 08-02-2012 / 14:42:18 / cg" |
888 "Created: / 08-02-2012 / 14:42:18 / cg" |
|
889 "Modified: / 10-04-2014 / 11:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
835 ! ! |
890 ! ! |
836 |
891 |
837 !ChangeList methodsFor:'generators'! |
892 !ChangeList methodsFor:'generators'! |
838 |
893 |
839 makeGenerator |
894 makeGenerator |
840 "Superclass Tools::BrowserList says that I am responsible to implement this method" |
895 "Superclass Tools::BrowserList says that I am responsible to implement this method" |
841 |
896 |
842 ^Iterator on: |
897 ^Iterator on: |
843 [:whatToDo| |
898 [:whatToDo| |
844 |
899 |
845 selectionHolder value do: |
900 (selectionHolder value ? #()) do: |
846 [:changeListItem| | change | |
901 [:changeListItem| | change | |
847 change := changeListItem change. |
902 change := changeListItem change. |
848 change isCompositeChange ifTrue: |
903 change isCompositeChange ifTrue: |
849 [change changes do: whatToDo]]]. |
904 [change changes do: whatToDo]]]. |
850 |
905 |
902 listMenuApplyAll |
958 listMenuApplyAll |
903 |
959 |
904 self acceptEnabled ifFalse:[^self]. |
960 self acceptEnabled ifFalse:[^self]. |
905 |
961 |
906 self selection value do: |
962 self selection value do: |
907 [:e|e removed ifFalse:[applyAction value:e change]]. |
963 [:e|e removed ifFalse:[applyAction value:e change]]. |
908 |
964 |
909 "Created: / 05-12-2009 / 14:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
965 "Created: / 05-12-2009 / 14:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
910 "Modified: / 10-09-2012 / 13:57:58 / cg" |
966 "Modified: / 10-09-2012 / 13:57:58 / cg" |
911 ! |
967 ! |
912 |
968 |
913 listMenuBrowse |
969 listMenuBrowse |
914 |
970 |
915 self listMenuBrowseChanges: |
971 self listMenuBrowseChanges: |
916 ((self selectionHolder value ? #()) collect:[:e|e change]) |
972 ((self selectionHolder value ? #()) collect:[:e|e change]) |
917 |
973 |
918 "Modified: / 24-01-2012 / 22:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
974 "Modified: / 24-01-2012 / 22:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
919 ! |
975 ! |
920 |
976 |
921 listMenuBrowseChanges: changes |
977 listMenuBrowseChanges: changes |
922 | classes methods methodsOnly browserClass| |
978 | collectChanges classes methods methodsOnly browserClass| |
923 |
979 |
924 classes := Set new. |
980 classes := Set new. |
925 methods := Set new. |
981 methods := Set new. |
926 methodsOnly := true. |
982 methodsOnly := true. |
927 changes do: [:each | |
983 |
928 each isClassChange ifTrue:[ |
984 collectChanges := |
929 each changeClass ifNotNil:[ |
985 [:each | |
|
986 (each isClassChange and:[each changeClass notNil]) ifTrue:[ |
930 classes add: each changeClass. |
987 classes add: each changeClass. |
931 each isMethodCodeChange |
988 each isMethodCodeChange ifTrue:[ |
932 ifTrue: |
989 each changeMethod notNil ifTrue: [methods add:each changeMethod] |
933 [each changeMethod ifNotNil: |
990 ] ifFalse:[ |
934 [methods add:each changeMethod]] |
991 methodsOnly := false |
935 ifFalse: |
992 ] |
936 [methodsOnly := false] |
993 ] ifFalse:[ |
|
994 each isCompositeChange ifTrue:[ |
|
995 each changes do:collectChanges |
|
996 ] |
937 ] |
997 ] |
938 ] |
998 ]. |
939 ]. |
999 changes do: collectChanges. |
940 |
1000 |
941 browserClass := environment browserClass. |
1001 browserClass := environment browserClass. |
942 methodsOnly |
1002 methodsOnly |
943 ifTrue: |
1003 ifTrue: |
944 [methods size = 1 |
1004 [methods size = 1 |
1013 '[:change| |
1073 '[:change| |
1014 "/ Define condition for selection below: |
1074 "/ Define condition for selection below: |
1015 "/ change is an instance of Change |
1075 "/ change is an instance of Change |
1016 "/ change will be selected if and only if block returns true |
1076 "/ change will be selected if and only if block returns true |
1017 |
1077 |
1018 |
1078 |
1019 true"/always select the change |
1079 true"/always select the change |
1020 ] |
1080 ] |
1021 '. |
1081 '. |
1022 |
1082 |
1023 LastSelectionConditionString isNil ifTrue:[ |
1083 LastSelectionConditionString isNil ifTrue:[ |
1024 LastSelectionConditionString := template. |
1084 LastSelectionConditionString := template. |
1025 ]. |
1085 ]. |
1026 |
1086 |
1027 |
1087 |
1028 textHolder := ValueHolder new. |
1088 textHolder := ValueHolder new. |
1029 dialog := Dialog |
1089 dialog := Dialog |
1030 forRequestText:(resources string:'Enter condition for selection') |
1090 forRequestText:(resources string:'Enter condition for selection') |
1031 lines:20 |
1091 lines:20 |
1032 columns:70 |
1092 columns:70 |
1033 initialAnswer:LastSelectionConditionString |
1093 initialAnswer:LastSelectionConditionString |
1034 model:textHolder. |
1094 model:textHolder. |
1035 dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
1095 dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
1036 dialog open. |
1096 dialog open. |
1037 dialog accepted ifFalse:[^ self]. |
1097 dialog accepted ifFalse:[^ self]. |
1038 |
1098 |
1039 conditionBlockString := textHolder value. |
1099 conditionBlockString := textHolder value. |
1040 LastSelectionConditionString := conditionBlockString. |
1100 LastSelectionConditionString := conditionBlockString. |
1041 |
1101 |
1042 conditionBlock := Parser evaluate:conditionBlockString. |
1102 conditionBlock := Parser evaluate:conditionBlockString. |
1043 conditionBlock isBlock ifFalse:[ |
1103 conditionBlock isBlock ifFalse:[ |
1044 self error:'Bad selection block (syntax error?)'. |
1104 self error:'Bad selection block (syntax error?)'. |
1045 ^ self |
1105 ^ self |
1046 ]. |
1106 ]. |
1047 |
1107 |
1048 self listMenuSelectAllSuchThat: conditionBlock |
1108 self listMenuSelectAllSuchThat: conditionBlock |
1049 ! |
1109 ! |
1050 |
1110 |
1051 listMenuUndeleteSelection |
1111 listMenuUndeleteSelection |
1052 |
1112 |
1053 self selectionHolder value do: |
1113 self selectionHolder value do: |
1054 [:each|each removed: false]. |
1114 [:each|each removed: false]. |
1055 self updateList |
1115 self updateList |
1056 ! ! |
1116 ! ! |
1057 |
1117 |
1058 !ChangeList methodsFor:'private'! |
1118 !ChangeList methodsFor:'private'! |
1059 |
1119 |
1165 |
1225 |
1166 "Created: / 05-12-2009 / 14:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1226 "Created: / 05-12-2009 / 14:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1167 ! |
1227 ! |
1168 |
1228 |
1169 updateList |
1229 updateList |
1170 |inGenerator changeset firstLineShown oldSel newList newSel | |
1230 |inGenerator changeset firstLineShown oldSel newList newSel| |
|
1231 |
1171 self withWaitCursorDo:[ |
1232 self withWaitCursorDo:[ |
1172 inGenerator := self inGeneratorHolder value. |
1233 inGenerator := self inGeneratorHolder value. |
1173 listView notNil ifTrue:[ |
1234 listView notNil ifTrue:[ |
1174 ((listView isKindOf: ScrollableView) not or:[listView scrolledView notNil]) ifTrue:[ |
1235 ((listView isKindOf: ScrollableView) not or:[listView scrolledView notNil]) ifTrue:[ |
1175 firstLineShown := listView firstLineShown |
1236 firstLineShown := listView firstLineShown |
1176 ]. |
1237 ]. |
1177 ]. |
1238 ]. |
1178 oldSel := self selection. |
1239 oldSel := self selection. |
1179 |
1240 |
1180 changeset := inGenerator isNil ifTrue:[ #() ] ifFalse:[ inGenerator ]. |
1241 changeset := inGenerator isNil ifTrue:[ #() ] ifFalse:[ inGenerator ]. |
1181 newList := changeset |
1242 self showDefinitionsOnlyHolder value ifTrue:[ |
1182 select: |
1243 newList := changeset select: [:chg | chg isOrContainsClassDefinitionChange ]. |
1183 [:chg | |
1244 ] ifFalse:[ |
1184 (self showRemovedHolder value or:[ chg removed not ]) |
1245 self showConflictsOnlyHolder value ifTrue:[ |
1185 and:[self showSameHolder value or:[chg delta ~~ #=]] |
1246 newList := changeset select: [:chg | chg isConflict ]. |
1186 ]. |
1247 ] ifFalse:[ |
|
1248 | showRemoved showSame | |
|
1249 |
|
1250 showRemoved := self showRemovedHolder value. |
|
1251 showSame := self showSameHolder value. |
|
1252 |
|
1253 newList := changeset select: [:chg | |
|
1254 (showRemoved or:[ chg removed not ]) |
|
1255 and:[showSame or:[chg delta ~~ #=]] |
|
1256 ]. |
|
1257 ]. |
|
1258 ]. |
|
1259 "/ OLD CODE |
|
1260 "/ newList := changeset |
|
1261 "/ select: |
|
1262 "/ [:chg | |
|
1263 "/ (self showRemovedHolder value or:[ chg removed not ]) |
|
1264 "/ and:[self showSameHolder value or:[chg delta ~~ #=]] |
|
1265 "/ ]. |
1187 newList := self filterList: newList. |
1266 newList := self filterList: newList. |
1188 newList := newList collect:[:chg | self listEntryFor:chg ]. |
1267 newList := newList collect:[:chg | self listEntryFor:chg ]. |
1189 self listHolder value ~= newList ifTrue:[ |
1268 self listHolder value ~= newList ifTrue:[ |
1190 self listHolder value: newList. |
1269 self listHolder value: newList. |
1191 ((newList size ~~ 0) and:[scrollToBottom]) ifTrue:[ |
1270 ((newList size ~~ 0) and:[scrollToBottom]) ifTrue:[ |
1317 "Modified (comment): / 25-07-2012 / 17:39:39 / cg" |
1397 "Modified (comment): / 25-07-2012 / 17:39:39 / cg" |
1318 "Modified: / 14-11-2013 / 14:55:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1398 "Modified: / 14-11-2013 / 14:55:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1319 ! |
1399 ! |
1320 |
1400 |
1321 children |
1401 children |
|
1402 |app addIf showRemoved showSame| |
1322 |
1403 |
1323 children isNil ifTrue:[ |
1404 children isNil ifTrue:[ |
1324 change isCompositeChange ifTrue:[ |
1405 change isCompositeChange ifTrue:[ |
|
1406 app := self application. |
|
1407 |
1325 children := OrderedCollection new: change changes size. |
1408 children := OrderedCollection new: change changes size. |
1326 self application showConflictsOnlyHolder value ifTrue:[ |
1409 app showDefinitionsOnlyHolder value ifTrue:[ |
1327 change changes do:[:chg| |
1410 addIf := [:chg | chg isOrContainsClassDefinitionChange]. |
1328 (chg isConflict) ifTrue:[ |
|
1329 children add: ((self application listEntryFor: chg) parent: self) |
|
1330 ] |
|
1331 ]. |
|
1332 ] ifFalse:[ |
1411 ] ifFalse:[ |
1333 |showRemoved showSame| |
1412 app showConflictsOnlyHolder value ifTrue:[ |
1334 |
1413 addIf := [:chg | chg isConflict]. |
1335 showRemoved := self application showRemovedHolder value. |
1414 ] ifFalse:[ |
1336 showSame := self application showSameHolder value. |
1415 showRemoved := app showRemovedHolder value. |
1337 |
1416 showSame := app showSameHolder value. |
1338 change changes do:[:chg| |
1417 |
1339 ((showRemoved or:[ chg removed not ]) |
1418 addIf := [:chg | |
1340 and:[showSame or:[chg delta ~~ #=]]) |
1419 ((showRemoved or:[ chg removed not ]) |
1341 ifTrue:[ |
1420 and:[showSame or:[chg delta ~~ #=]]) |
1342 children add: ((self application listEntryFor: chg) parent: self) |
1421 ]. |
1343 ] |
1422 ] |
1344 ]. |
1423 ]. |
1345 ] |
1424 change changes do:[:chg| |
|
1425 (addIf value:chg) ifTrue:[ |
|
1426 children add: ((app listEntryFor: chg) parent: self) |
|
1427 ] |
|
1428 ]. |
1346 ] ifFalse:[ |
1429 ] ifFalse:[ |
1347 children := #() |
1430 children := #() |
1348 ] |
1431 ] |
1349 ]. |
1432 ]. |
1350 ^children |
1433 ^children |
1367 |
1450 |
1368 ^change deltaDetail |
1451 ^change deltaDetail |
1369 |
1452 |
1370 "Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1453 "Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1371 "Created: / 31-08-2011 / 10:29:21 / cg" |
1454 "Created: / 31-08-2011 / 10:29:21 / cg" |
1372 ! |
|
1373 |
|
1374 iconDelta |
|
1375 | iconSelector | |
|
1376 |
|
1377 iconSelector := self iconSelector. |
|
1378 iconSelector isNil ifTrue:[^nil]. |
|
1379 self removed ifTrue:[iconSelector := iconSelector , #Grayed]. |
|
1380 ^self application class perform: iconSelector asSymbol. |
|
1381 |
|
1382 "Created: / 05-12-2009 / 14:11:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1383 "Modified: / 18-11-2011 / 14:56:33 / cg" |
|
1384 ! |
|
1385 |
|
1386 iconRemoved |
|
1387 |appClass| |
|
1388 |
|
1389 appClass := self application class. |
|
1390 ^self removed |
|
1391 ifTrue: [appClass uncheckedIcon ] |
|
1392 ifFalse:[appClass checkedIcon ] |
|
1393 |
|
1394 "Created: / 05-12-2009 / 14:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1395 ! |
1455 ! |
1396 |
1456 |
1397 imageSource |
1457 imageSource |
1398 "return the source for the in-image version of the change" |
1458 "return the source for the in-image version of the change" |
1399 |
1459 |
1477 ! ! |
1537 ! ! |
1478 |
1538 |
1479 !ChangeList::ListEntry methodsFor:'displaying'! |
1539 !ChangeList::ListEntry methodsFor:'displaying'! |
1480 |
1540 |
1481 displayLabel:aLabel h:lH on:aGC x:newX y:y h:h |
1541 displayLabel:aLabel h:lH on:aGC x:newX y:y h:h |
1482 |
1542 | list cx icon | |
1483 | list cx icon colW colS | |
1543 |
1484 list := self application. |
1544 list := self application. |
1485 cx := x := newX. |
1545 cx := x := newX. |
1486 (list allowRemoveHolder value and:[list showRemovedHolder value]) ifTrue: [ |
1546 (list allowRemoveHolder value and:[list showRemovedHolder value]) ifTrue: [ |
1487 (icon := self iconRemoved) notNil ifTrue:[ |
1547 (icon := self iconRemoved) notNil ifTrue:[ |
1488 icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
1548 icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
1489 ]. |
1549 ]. |
1490 cx := cx + 22."experimental value - this looks good" |
1550 cx := cx + 22."experimental value - this looks good" |
1491 ]. |
1551 ]. |
1492 (icon := self iconDelta) notNil ifTrue:[ |
1552 (icon := self iconDelta) notNil ifTrue:[ |
1493 icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
1553 icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
1494 ]. |
1554 ]. |
1495 cx := cx + 16."12 + 2px gap" |
1555 cx := cx + 16."12 + 2px gap" |
1496 |
1556 |
1497 super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h. |
1557 super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h. |
1498 |
1558 |
1508 "/ ]. |
1568 "/ ]. |
1509 "/ super displayLabel:colS h:lH on:aGC x: (aGC width - 5 - colW) y:y h:h. |
1569 "/ super displayLabel:colS h:lH on:aGC x: (aGC width - 5 - colW) y:y h:h. |
1510 "/ ]. |
1570 "/ ]. |
1511 |
1571 |
1512 "Modified: / 27-07-2012 / 17:13:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1572 "Modified: / 27-07-2012 / 17:13:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1513 ! ! |
1573 ! |
1514 |
1574 |
1515 !ChangeList::ListEntry methodsFor:'private'! |
1575 displayLabel:aLabel h:lH on:aGC x:newX y:y h:h isHighlightedAsSelected:isHighlightedAsSelected |
|
1576 | list cx icon | |
|
1577 |
|
1578 list := self application. |
|
1579 cx := x := newX. |
|
1580 (list allowRemoveHolder value and:[list showRemovedHolder value]) ifTrue: [ |
|
1581 (icon := self iconRemoved) notNil ifTrue:[ |
|
1582 icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
|
1583 ]. |
|
1584 cx := cx + 22."experimental value - this looks good" |
|
1585 ]. |
|
1586 (icon := self iconDelta) notNil ifTrue:[ |
|
1587 icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
|
1588 ]. |
|
1589 cx := cx + 16."12 + 2px gap" |
|
1590 |
|
1591 super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h isHighlightedAsSelected:isHighlightedAsSelected. |
|
1592 |
|
1593 "/ "Now, display additional columns..." |
|
1594 "/ (list showColumn: #timestamp) ifTrue:[ |
|
1595 "/ cx := cx + (aLabel widthOn: aGC) + 5."px - padding" |
|
1596 "/ colS := change timeOfChangeIfKnown notNil |
|
1597 "/ ifTrue:[change timeOfChangeIfKnown printString] |
|
1598 "/ ifFalse:['???']. |
|
1599 "/ [ (colW := colS widthOn: aGC) > (aGC width - cx - 5) ] whileTrue:[ |
|
1600 "/ colS = '...' ifTrue:[ ^ self ]. |
|
1601 "/ colS := '...' , (colS copyFrom: 6). |
|
1602 "/ ]. |
|
1603 "/ super displayLabel:colS h:lH on:aGC x: (aGC width - 5 - colW) y:y h:h. |
|
1604 "/ ]. |
|
1605 |
|
1606 "Modified: / 27-07-2012 / 17:13:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1607 ! |
|
1608 |
|
1609 iconDelta |
|
1610 | iconSelector | |
|
1611 |
|
1612 iconSelector := self iconSelector. |
|
1613 iconSelector isNil ifTrue:[^nil]. |
|
1614 self removed ifTrue:[iconSelector := iconSelector , #Grayed]. |
|
1615 ^self application class perform: iconSelector asSymbol. |
|
1616 |
|
1617 "Created: / 05-12-2009 / 14:11:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1618 "Modified: / 18-11-2011 / 14:56:33 / cg" |
|
1619 ! |
|
1620 |
|
1621 iconRemoved |
|
1622 |appClass| |
|
1623 |
|
1624 appClass := self application class. |
|
1625 ^self removed |
|
1626 ifTrue: [appClass uncheckedIcon ] |
|
1627 ifFalse:[appClass checkedIcon ] |
|
1628 |
|
1629 "Created: / 05-12-2009 / 14:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1630 ! |
1516 |
1631 |
1517 iconSelector |
1632 iconSelector |
1518 ^ application iconSelectorForChange:change |
1633 ^ application iconSelectorForChange:change |
1519 ! ! |
1634 ! ! |
1520 |
1635 |