1823 !UIPainter methodsFor:'building editors'! |
1823 !UIPainter methodsFor:'building editors'! |
1824 |
1824 |
1825 openDataSetColumnEditor |
1825 openDataSetColumnEditor |
1826 "opens a Table Column Editor on current widget" |
1826 "opens a Table Column Editor on current widget" |
1827 |
1827 |
1828 |cls editor| |
1828 |cls loadedFromClass loadedFromSpec editor tableColumnsOrSelector| |
1829 |
1829 |
1830 (cls := self resolveName:specClass) isNil ifTrue:[ |
1830 (cls := self resolveName:specClass) isNil ifTrue:[ |
1831 self askForSaving ifFalse: [^self] |
1831 self askForSaving ifFalse: [^self] |
1832 ]. |
1832 ]. |
1833 |
1833 |
|
1834 loadedFromSpec := loadedFromClass := false. |
1834 editor := DataSetBuilder new. |
1835 editor := DataSetBuilder new. |
1835 editor masterApplication:self. |
1836 editor masterApplication:self. |
1836 editor specClass: cls. |
1837 editor specClass: cls. |
1837 "/ editor columns:self specTool specification columns. |
|
1838 editor rowClassName:(self specTool specification rowClassName). |
1838 editor rowClassName:(self specTool specification rowClassName). |
1839 editor openModalOnResourceSpec:(self specTool specification columns). |
1839 ((tableColumnsOrSelector := self specTool specification columnHolder) notNil and: |
1840 "/ editor openModal. |
1840 [cls class implements: tableColumnsOrSelector]) ifTrue: [ |
1841 |
1841 editor openModalOnClass: cls andSelector: tableColumnsOrSelector. |
1842 editor hasSaved ifFalse:[ |
1842 loadedFromClass := true. |
|
1843 ] ifFalse: [ |
|
1844 (tableColumnsOrSelector := self specTool specification columns) isNil ifTrue: [ |
|
1845 editor openModal |
|
1846 ] ifFalse: [ |
|
1847 editor openModalOnResourceSpec:tableColumnsOrSelector. |
|
1848 loadedFromSpec := true |
|
1849 ]. |
|
1850 ]. |
|
1851 |
|
1852 loadedFromClass ifTrue: [ |
|
1853 self specTool specification columns:nil. |
|
1854 self specTool specification rowClassName:nil. |
|
1855 self modifiedChannel value:true. |
|
1856 self accept. |
|
1857 ]. |
|
1858 |
|
1859 (loadedFromSpec not and: [editor hasSaved and:[editor specSelector ~= tableColumnsOrSelector]]) ifTrue:[ |
|
1860 self specTool specification columnHolder:editor specSelector. |
|
1861 self modifiedChannel value:true. |
|
1862 self accept. |
|
1863 ^self |
|
1864 ]. |
|
1865 loadedFromClass ifFalse: [ |
1843 self specTool specification columns:(editor columns). |
1866 self specTool specification columns:(editor columns). |
1844 self specTool specification rowClassName:(editor rowClassName). |
1867 self specTool specification rowClassName:(editor rowClassName). |
1845 ] ifTrue: [ |
1868 self modifiedChannel value: editor modified. |
1846 self specTool specification columns:nil. |
1869 ]. |
1847 self specTool specification rowClassName:nil. |
1870 |
1848 ]. |
|
1849 self modifiedChannel value: editor modified. |
|
1850 |
1871 |
1851 ! |
1872 ! |
1852 |
1873 |
1853 openEditMenu |
1874 openEditMenu |
1854 "opens a Menu Editor on current widget" |
1875 "opens a Menu Editor on current widget" |