2613 openDataSetColumnEditor |
2613 openDataSetColumnEditor |
2614 "opens a Table Column Editor on current widget" |
2614 "opens a Table Column Editor on current widget" |
2615 |
2615 |
2616 |cls editor specTool columnHolder tableSelector columns| |
2616 |cls editor specTool columnHolder tableSelector columns| |
2617 |
2617 |
2618 (cls := self resolveName:specClassName) isNil ifTrue:[ |
2618 self isEditingSpecOnly ifFalse:[ |
2619 self askForSaving ifTrue:[cls := self resolveName:specClassName]. |
2619 (cls := self resolveName:specClassName) isNil ifTrue:[ |
2620 ]. |
2620 self askForSaving ifTrue:[cls := self resolveName:specClassName]. |
2621 cls isNil ifTrue:[^ self]. |
2621 ]. |
|
2622 cls isNil ifTrue:[^ self]. |
|
2623 ]. |
2622 |
2624 |
2623 self acceptOrIgnoreSectionModification. |
2625 self acceptOrIgnoreSectionModification. |
2624 |
2626 |
2625 editor := DataSetBuilder new. |
2627 editor := DataSetBuilder new. |
2626 specTool := self specTool. |
2628 specTool := self specTool. |
2627 |
2629 |
2628 editor masterApplication:self. |
2630 editor masterApplication:self. |
2629 editor specClass: cls. |
2631 self isEditingSpecOnly ifFalse:[ |
2630 editor rowClassName:(specTool specification rowClassName). |
2632 editor specClass: cls. |
2631 |
2633 editor rowClassName:(specTool specification rowClassName). |
|
2634 ]. |
2632 columnHolder := specTool aspectFor:#columnHolder. |
2635 columnHolder := specTool aspectFor:#columnHolder. |
2633 tableSelector := columnHolder value. |
2636 tableSelector := columnHolder value. |
2634 |
2637 |
2635 tableSelector := tableSelector size ~~ 0 ifTrue:[tableSelector asSymbol] |
2638 tableSelector := tableSelector size ~~ 0 ifTrue:[tableSelector asSymbol] |
2636 ifFalse:[nil]. |
2639 ifFalse:[nil]. |
2637 |
2640 |
2638 (tableSelector notNil and:[cls class includesSelector:tableSelector]) ifTrue:[ |
2641 (self isEditingSpecOnly not |
|
2642 and:[tableSelector notNil |
|
2643 and:[cls class includesSelector:tableSelector]]) ifTrue:[ |
2639 editor openModalOnClass:cls andSelector:tableSelector |
2644 editor openModalOnClass:cls andSelector:tableSelector |
2640 ] ifFalse:[ |
2645 ] ifFalse:[ |
2641 columns := specTool specification columns. |
2646 columns := specTool specification columns. |
2642 |
2647 |
2643 columns size ~~ 0 ifTrue:[ |
2648 columns size ~~ 0 ifTrue:[ |
2646 editor openModal |
2651 editor openModal |
2647 ] |
2652 ] |
2648 ]. |
2653 ]. |
2649 |
2654 |
2650 editor hasSaved ifTrue:[ |
2655 editor hasSaved ifTrue:[ |
2651 specTool specification columns:nil. |
2656 specTool specification |
2652 specTool specification rowClassName:(editor rowClassName). |
2657 columns:nil; |
|
2658 rowClassName:(editor rowClassName). |
2653 |
2659 |
2654 tableSelector = editor specSelector ifFalse:[ |
2660 tableSelector = editor specSelector ifFalse:[ |
2655 columnHolder value:(editor specSelector). |
2661 columnHolder value:(editor specSelector). |
2656 self accept. |
2662 self accept. |
2657 ]. |
2663 ]. |
2658 ^ self |
2664 ^ self |
2659 ]. |
2665 ]. |
2660 |
2666 |
2661 (editor modified and:[tableSelector isNil]) ifTrue:[ |
2667 (editor modified and:[tableSelector isNil]) ifTrue:[ |
2662 specTool specification columns:(editor columns). |
2668 specTool specification |
2663 specTool specification rowClassName:(editor rowClassName). |
2669 columns:(editor columns); |
|
2670 rowClassName:(editor rowClassName). |
2664 self modifiedChannel value:true. |
2671 self modifiedChannel value:true. |
2665 ]. |
2672 ]. |
2666 |
2673 |
2667 "Modified: / 12-01-2008 / 10:31:47 / cg" |
2674 "Modified: / 12-01-2008 / 10:31:47 / cg" |
2668 ! |
2675 ! |
4180 |
4187 |
4181 |cls spec aspect code| |
4188 |cls spec aspect code| |
4182 |
4189 |
4183 cls := self specClass. |
4190 cls := self specClass. |
4184 cls isNil ifTrue:[ |
4191 cls isNil ifTrue:[ |
4185 Dialog information:'No Application Class defined.'. |
4192 Dialog information:'No application class defined.'. |
4186 ^ self |
4193 ^ self |
4187 ]. |
4194 ]. |
4188 |
4195 |
4189 spec := painter specForSelection. |
4196 spec := painter specForSelection. |
4190 spec isNil ifTrue:[^ self]. |
4197 spec isNil ifTrue:[^ self]. |
4191 aspect := spec perform:aspectSelector. |
4198 aspect := spec perform:aspectSelector. |
4192 aspect isNil ifTrue:[ |
4199 aspect isNil ifTrue:[ |
4193 Dialog information:(resources |
4200 Dialog information:(resources |
4194 string:'Please enter a Method name for "%1" first.' |
4201 string:'Please enter an action method name for "%1" first.' |
4195 with:(resources string:aspectNameShown) allBold). |
4202 with:(resources string:aspectNameShown) allBold). |
4196 ^ self |
4203 ^ self |
4197 ]. |
4204 ]. |
4198 |
4205 |
4199 (cls implements:aspect asSymbol) ifFalse:[ |
4206 (cls implements:aspect asSymbol) ifFalse:[ |