equal
deleted
inserted
replaced
1866 modified := false |
1866 modified := false |
1867 ! |
1867 ! |
1868 |
1868 |
1869 doNew |
1869 doNew |
1870 |
1870 |
1871 self buildFrom: nil andSelector: self treeView selectorName |
1871 self askForModification |
|
1872 ifTrue: |
|
1873 [ |
|
1874 self buildFrom: nil andSelector: self treeView selectorName |
|
1875 ] |
1872 ! |
1876 ! |
1873 |
1877 |
1874 doPickAMenu |
1878 doPickAMenu |
1875 |
1879 |
1876 |view| |
1880 |view| |
2471 super initialize. |
2475 super initialize. |
2472 |
2476 |
2473 self multipleSelectOk:true. |
2477 self multipleSelectOk:true. |
2474 self showDirectoryIndicator: true. |
2478 self showDirectoryIndicator: true. |
2475 self showDirectoryIndicatorForRoot: false. |
2479 self showDirectoryIndicatorForRoot: false. |
2476 self selectConditionBlock: [:i|self application checkMenuItemModified]. |
2480 self selectConditionBlock: [:i|self application askForItemModification]. |
2477 self validateDoubleClickBlock: [:node| node ~~ listOfNodes first]. |
2481 self validateDoubleClickBlock: [:node| node ~~ listOfNodes first]. |
2478 |
2482 |
2479 self model iconAction: [:aNode| aNode contents iconFor: aNode]. |
2483 self model iconAction: [:aNode| aNode contents iconFor: aNode]. |
2480 self model labelAction: [:aNode| aNode contents treeViewLabel] |
2484 self model labelAction: [:aNode| aNode contents treeViewLabel] |
2481 ! ! |
2485 ! ! |
2522 self addElement:(self nodeLabel:nil) |
2526 self addElement:(self nodeLabel:nil) |
2523 ! |
2527 ! |
2524 |
2528 |
2525 doCut |
2529 doCut |
2526 |
2530 |
2527 self checkMenuItemModified |
2531 self askForItemModification |
2528 ifTrue: |
2532 ifTrue: |
2529 [ |
2533 [ |
2530 |selectedNodes| |
2534 |selectedNodes| |
2531 self doCopy. |
2535 self doCopy. |
2532 selectedNodes := self selection asSortedCollection. |
2536 selectedNodes := self selection asSortedCollection. |
2547 !MenuEditor::TreeView methodsFor:'private'! |
2551 !MenuEditor::TreeView methodsFor:'private'! |
2548 |
2552 |
2549 addElement: aNode |
2553 addElement: aNode |
2550 "add something after selection" |
2554 "add something after selection" |
2551 |
2555 |
2552 self checkMenuItemModified |
2556 self askForItemModification |
2553 ifTrue: |
2557 ifTrue: |
2554 [ |
2558 [ |
2555 self selectedNodeAdd: aNode. |
2559 self selectedNodeAdd: aNode. |
2556 (aNode isCollection not and: [aNode name = 'Item']) |
2560 (aNode isCollection not and: [aNode name = 'Item']) |
2557 ifTrue: |
2561 ifTrue: |
2579 aNode isCollection ifFalse: [self selectNode: aNode] ifTrue: [self selection: (aNode collect: [:node| self indexOfNode: node])]. |
2583 aNode isCollection ifFalse: [self selectNode: aNode] ifTrue: [self selection: (aNode collect: [:node| self indexOfNode: node])]. |
2580 self setModified. |
2584 self setModified. |
2581 ] |
2585 ] |
2582 ! |
2586 ! |
2583 |
2587 |
2584 checkMenuItemModified |
2588 askForItemModification |
2585 |
2589 |
2586 ^self topView application checkItemModified |
2590 ^self topView application askForItemModification |
2587 ! |
2591 ! |
2588 |
2592 |
2589 nodeLabel:aLabel |
2593 nodeLabel:aLabel |
2590 |
2594 |
2591 ^TreeItem new contents: (MenuEditor::Item new label:aLabel) |
2595 ^TreeItem new contents: (MenuEditor::Item new label:aLabel) |