1351 |
1351 |
1352 cancel |
1352 cancel |
1353 "cancel all changes done to the specification; reread attributes from the |
1353 "cancel all changes done to the specification; reread attributes from the |
1354 assigned component |
1354 assigned component |
1355 " |
1355 " |
1356 |spec key| |
1356 |spec key view| |
1357 |
1357 |
1358 self isModified ifTrue:[ |
1358 self isModified ifTrue:[ |
1359 (spec := self painter specForSelection) notNil ifTrue:[ |
1359 (spec := self painter specForSelection) notNil ifTrue:[ |
1360 key := spec activeHelpKey. |
1360 key := spec activeHelpKey. |
1361 ]. |
1361 ]. |
1362 self helpTool helpKey:key. |
1362 self helpTool helpKey:key. |
1363 self specTool specification:spec. |
1363 self specTool specification:spec. |
1364 self setViewInLayoutTool:(self layoutTool layoutView). |
1364 view := self layoutTool layoutView. |
|
1365 |
|
1366 self setViewInLayoutTool:view. |
|
1367 spec class == DataSetSpec ifTrue:[ |
|
1368 view columnDescriptors:(spec columns) |
|
1369 ]. |
1365 self modifiedChannel value:false. |
1370 self modifiedChannel value:false. |
1366 ] |
1371 ] |
1367 ! |
1372 ! |
1368 |
1373 |
1369 moveSelectionDown |
1374 moveSelectionDown |
1391 " |
1396 " |
1392 self painter moveSelectionUp |
1397 self painter moveSelectionUp |
1393 |
1398 |
1394 ! |
1399 ! |
1395 |
1400 |
|
1401 openDataSetColumnEditor |
|
1402 "opens a column editor |
|
1403 " |
|
1404 |cls aspect editor columns| |
|
1405 |
|
1406 cls := self resolveName:specClass. |
|
1407 |
|
1408 cls isNil ifTrue:[ |
|
1409 ^ self information:'no application class defined yet' |
|
1410 ]. |
|
1411 aspect := self specTool specification columns. |
|
1412 editor := DataSetBuilder new. |
|
1413 editor columns:aspect fromView:(self layoutTool layoutView). |
|
1414 editor className:(self specTool specification className). |
|
1415 editor openModal. |
|
1416 |
|
1417 editor hasChanged ifTrue:[ |
|
1418 self specTool specification columns:(editor columns). |
|
1419 self specTool specification className:(editor className). |
|
1420 self modifiedChannel value:true. |
|
1421 ]. |
|
1422 ! |
|
1423 |
1396 openEditMenu |
1424 openEditMenu |
1397 "opens a menu editor on current widget |
1425 "opens a menu editor on current widget |
1398 " |
1426 " |
1399 |cls aspect editor| |
1427 |cls aspect editor| |
1400 |
1428 |
1401 specClass isNil ifTrue:[ |
1429 cls := self resolveName:specClass. |
1402 ^ self information:'no application class defined yet'. |
1430 |
1403 ]. |
1431 cls isNil ifTrue:[ |
1404 (cls := specClass) isBehavior ifFalse:[ |
1432 ^ self information:'no application class defined yet' |
1405 cls := Smalltalk at:specClass asSymbol. |
|
1406 cls isNil ifTrue:[ |
|
1407 ^ self information:'no application class defined yet' |
|
1408 ] |
|
1409 ]. |
1433 ]. |
1410 |
1434 |
1411 cls notNil ifTrue:[ |
1435 cls notNil ifTrue:[ |
1412 (aspect := self specTool specification menuSelector) notNil ifTrue:[ |
1436 (aspect := self specTool specification menuSelector) notNil ifTrue:[ |
1413 aspect := aspect asSymbol |
1437 aspect := aspect asSymbol |
1445 openHierarchicalListEditor |
1469 openHierarchicalListEditor |
1446 "opens a hierarchical list editor editor on current widget |
1470 "opens a hierarchical list editor editor on current widget |
1447 " |
1471 " |
1448 |cls aspect editor| |
1472 |cls aspect editor| |
1449 |
1473 |
1450 specClass isNil ifTrue:[ |
1474 cls := self resolveName:specClass. |
1451 ^ self information:'no application class defined yet'. |
1475 |
1452 ]. |
1476 cls isNil ifTrue:[ |
1453 (cls := specClass) isBehavior ifFalse:[ |
1477 ^ self information:'no application class defined yet' |
1454 cls := Smalltalk at:specClass asSymbol. |
1478 ]. |
1455 cls isNil ifTrue:[ |
1479 |
1456 ^ self information:'no application class defined yet' |
1480 (aspect := self specTool specification hierarchicalList) notNil ifTrue:[ |
1457 ] |
1481 aspect := aspect asSymbol |
1458 ]. |
1482 ] ifFalse:[ |
1459 |
1483 "/ cg: q&d hack ... |
1460 cls notNil ifTrue:[ |
1484 |
1461 (aspect := self specTool specification hierarchicalList) notNil ifTrue:[ |
1485 aspect := treeView propertySelected. |
1462 aspect := aspect asSymbol |
1486 aspect notNil ifTrue:[ |
1463 ] ifFalse:[ |
1487 Object errorSignal handle:[:ex | |
1464 "/ cg: q&d hack ... |
1488 aspect := nil. |
1465 |
1489 ] do:[ |
1466 aspect := treeView propertySelected. |
1490 aspect := aspect view asMenu. |
1467 aspect notNil ifTrue:[ |
|
1468 Object errorSignal handle:[:ex | |
|
1469 aspect := nil. |
|
1470 ] do:[ |
|
1471 aspect := aspect view asMenu. |
|
1472 ] |
|
1473 ]. |
|
1474 ]. |
|
1475 |
|
1476 editor := HierarchicalListEditor new. |
|
1477 editor masterApplication:self. |
|
1478 editor openModalOnClass:cls andSelector:aspect. |
|
1479 |
|
1480 editor selectorName ~= aspect ifTrue:[ |
|
1481 editor didInstall ifTrue:[ |
|
1482 self specTool specification hierarchicalList:editor selectorName asSymbol. |
|
1483 self modifiedChannel value:true. |
|
1484 self accept |
|
1485 ] |
1491 ] |
1486 ]. |
1492 ]. |
|
1493 ]. |
|
1494 |
|
1495 editor := HierarchicalListEditor new. |
|
1496 editor masterApplication:self. |
|
1497 editor openModalOnClass:cls andSelector:aspect. |
|
1498 |
|
1499 editor selectorName ~= aspect ifTrue:[ |
|
1500 editor didInstall ifTrue:[ |
|
1501 self specTool specification hierarchicalList:editor selectorName asSymbol. |
|
1502 self modifiedChannel value:true. |
|
1503 self accept |
|
1504 ] |
1487 ] |
1505 ] |
1488 |
|
1489 "Modified: 31.7.1997 / 14:26:13 / cg" |
|
1490 ! ! |
1506 ! ! |
1491 |
1507 |
1492 !UIPainter methodsFor:'aspects'! |
1508 !UIPainter methodsFor:'aspects'! |
1493 |
1509 |
1494 canMoveOrAlignSelection |
1510 canMoveOrAlignSelection |
1875 !UIPainter methodsFor:'queries'! |
1891 !UIPainter methodsFor:'queries'! |
1876 |
1892 |
1877 hasSpecClass |
1893 hasSpecClass |
1878 "checks whether an application class is defined |
1894 "checks whether an application class is defined |
1879 " |
1895 " |
1880 specClass notNil ifTrue:[ |
1896 ^ (self resolveName:specClass) notNil |
1881 ^ (specClass isBehavior or:[(Smalltalk at:specClass asSymbol) notNil]) |
|
1882 ]. |
|
1883 ^ false |
|
1884 ! |
1897 ! |
1885 |
1898 |
1886 hasSpecClassAndSelector |
1899 hasSpecClassAndSelector |
1887 "checks whether an application class and a selector under which |
1900 "checks whether an application class and a selector under which |
1888 the window specification is stored is defined. |
1901 the window specification is stored is defined. |
2063 (specClass notNil ifTrue:[specClass] |
2076 (specClass notNil ifTrue:[specClass] |
2064 ifFalse:['NewApplication']) asValue |
2077 ifFalse:['NewApplication']) asValue |
2065 ). |
2078 ). |
2066 specSuperclass isNil ifTrue:[ |
2079 specSuperclass isNil ifTrue:[ |
2067 specClass notNil ifTrue:[ |
2080 specClass notNil ifTrue:[ |
2068 (cls := Smalltalk at:specClass asSymbol) notNil ifTrue:[ |
2081 (cls := self resolveName:specClass) notNil ifTrue:[ |
2069 specSuperclass := cls superclass name. |
2082 specSuperclass := cls superclass name. |
2070 ] |
2083 ] |
2071 ] |
2084 ] |
2072 ]. |
2085 ]. |
2073 aspects at:#superclassNameChannel put:( |
2086 aspects at:#superclassNameChannel put:( |
2181 |
2194 |
2182 |superclass cls| |
2195 |superclass cls| |
2183 |
2196 |
2184 specClass isNil ifTrue:[^ false]. |
2197 specClass isNil ifTrue:[^ false]. |
2185 |
2198 |
2186 specClass isBehavior ifFalse:[ |
2199 cls := self resolveName:specClass. |
2187 cls := Smalltalk at:specClass asSymbol |
2200 |
2188 ] ifTrue:[ |
|
2189 cls := specClass |
|
2190 ]. |
|
2191 cls isNil ifTrue:[ |
2201 cls isNil ifTrue:[ |
2192 (superclass := Smalltalk at:specSuperclass asSymbol) isNil ifTrue:[ |
2202 superclass := self resolveName:specSuperclass. |
|
2203 |
|
2204 superclass isNil ifTrue:[ |
2193 self warn:'no class named ' , specSuperclass , ' exists.'. |
2205 self warn:'no class named ' , specSuperclass , ' exists.'. |
2194 ^ false. |
2206 ^ false. |
2195 ]. |
2207 ]. |
2196 (self confirm:'create ' , specClass , ' ?') ifTrue:[ |
2208 (self confirm:'create ' , specClass , ' ?') ifTrue:[ |
2197 superclass subclass:(specClass asSymbol) |
2209 superclass subclass:(specClass asSymbol) |
2314 |cls| |
2326 |cls| |
2315 |
2327 |
2316 self painter isModified ifTrue:[ |
2328 self painter isModified ifTrue:[ |
2317 self warn:'the change have not yet been reinstalled.\\The browser will show the old interfaces code.' withCRs. |
2329 self warn:'the change have not yet been reinstalled.\\The browser will show the old interfaces code.' withCRs. |
2318 ]. |
2330 ]. |
2319 |
2331 cls := self resolveName:specClass. |
2320 specClass isNil ifTrue:[ |
2332 |
2321 ^ self information:'no class yet'. |
2333 cls notNil ifTrue:[ |
2322 ]. |
2334 SystemBrowser openInClass:cls |
2323 |
2335 ] ifFalse:[ |
2324 specClass isBehavior ifFalse:[ |
2336 self information:'no class yet'. |
2325 cls := Smalltalk at:specClass asSymbol |
2337 ]. |
2326 ] ifTrue:[ |
2338 |
2327 cls := specClass |
|
2328 ]. |
|
2329 |
|
2330 cls isNil ifTrue:[ |
|
2331 ^ self information:'no class yet'. |
|
2332 ]. |
|
2333 |
|
2334 SystemBrowser openInClass:cls |
|
2335 |
|
2336 "Modified: 28.7.1997 / 18:30:13 / cg" |
|
2337 ! |
2339 ! |
2338 |
2340 |
2339 doFromClass |
2341 doFromClass |
2340 "setup new specification from a class and selector accessed through |
2342 "setup new specification from a class and selector accessed through |
2341 to a dialog |
2343 to a dialog |