refactoring_custom/SmallSense__CustomDialog.st
author convert-repo
Wed, 11 Dec 2019 04:28:36 +0000
changeset 1116 b51ace366efc
parent 1072 a44c741ee5ef
permissions -rw-r--r--
update tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     1
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     2
A custom code generation and refactoring support for Smalltalk/X
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     3
Copyright (C) 2013-2015 Jakub Nesveda
1072
a44c741ee5ef Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 833
diff changeset
     4
Copyright (C) 2015 Jan Vrany
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     5
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     6
This library is free software; you can redistribute it and/or
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     7
modify it under the terms of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     8
License as published by the Free Software Foundation; either
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
     9
version 2.1 of the License.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    10
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    11
This library is distributed in the hope that it will be useful,
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    14
Lesser General Public License for more details.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    15
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    16
You should have received a copy of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    17
License along with this library; if not, write to the Free Software
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    19
"
833
297eb38e4eee Package jn:refactoring_custom renamed to stx:goodies/smallsense/refactoring_custom
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 830
diff changeset
    20
"{ Package: 'stx:goodies/smallsense/refactoring_custom' }"
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    21
830
1a88f5e65fe2 Classes moved to namespace SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 828
diff changeset
    22
"{ NameSpace: SmallSense }"
803
95cdac772759 Fixed failing tests caused by new STX release
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 762
diff changeset
    23
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    24
Object subclass:#CustomDialog
804
14025d247548 Improved code quality/readibility with help of Smalllint
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 803
diff changeset
    25
	instanceVariableNames:''
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    26
	classVariableNames:''
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    27
	poolDictionaries:''
740
dcc444183c8c move CustomDialog and its implementations to UI category
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 703
diff changeset
    28
	category:'Interface-Refactoring-Custom-UI'
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    29
!
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    30
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    31
!CustomDialog class methodsFor:'documentation'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    32
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    33
copyright
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    34
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    35
A custom code generation and refactoring support for Smalltalk/X
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    36
Copyright (C) 2013-2015 Jakub Nesveda
1072
a44c741ee5ef Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 833
diff changeset
    37
Copyright (C) 2015 Jan Vrany
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    38
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    39
This library is free software; you can redistribute it and/or
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    41
License as published by the Free Software Foundation; either
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    42
version 2.1 of the License.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    43
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    44
This library is distributed in the hope that it will be useful,
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    47
Lesser General Public License for more details.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    48
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    50
License along with this library; if not, write to the Free Software
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    52
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    53
!
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 804
diff changeset
    54
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    55
documentation
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    56
"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    57
    A simple factory for user dialogs.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    58
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    59
    Note: in future, API of this class will be merged into DialogBox and
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    60
    CustomDialog and subclasses will vanish.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    61
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    62
    [author:]
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    63
        Jan Vrany <jan.vrany@fit.cvut.cz>
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    64
        Jakub Nesveda <nesvejak@fit.cvut.cz>
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    65
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    66
    [instance variables:]
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    67
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    68
    [class variables:]
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    69
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    70
    [see also:]
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    71
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    72
"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    73
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    74
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
    75
!CustomDialog class methodsFor:'testing'!
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
    76
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
    77
isAbstract
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
    78
    ^ self == CustomDialog
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
    79
! !
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
    80
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    81
!CustomDialog methodsFor:'common dialogs'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    82
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    83
requestClassName: label initialAnswer:initial
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    84
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    85
    | holder |
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    86
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    87
    holder := ValueHolder with: initial.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    88
    self addClassNameEntryOn: holder labeled: 'Class' validateBy: nil.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    89
    self addAbortAndOkButtons.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    90
    self open ifTrue:[ 
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    91
        ^ holder value
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 743
diff changeset
    92
    ]
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    93
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    94
    "
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    95
    CustomUserDialog new requestClassName: 'Select class' initialAnswer: 'Array'.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    96
    "
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    97
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    98
    "Created: / 10-05-2014 / 15:33:47 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
    99
    "Modified: / 15-09-2014 / 16:26:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 743
diff changeset
   100
    "Modified: / 25-11-2014 / 21:10:49 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   101
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   102
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   103
!CustomDialog methodsFor:'construction-adding'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   104
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   105
addAbortAndOkButtons
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   106
    ^ self subclassResponsibility
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   107
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   108
    "Created: / 15-09-2014 / 16:20:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   109
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   110
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   111
addButtons
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   112
    self addAbortAndOkButtons
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   113
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   114
    "Created: / 15-09-2014 / 18:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   115
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   116
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   117
addCheckBoxOn: aValueModel labeled: aString
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   118
    | checkbox |
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   119
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   120
    checkbox := CheckBox new.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   121
    checkbox model: aValueModel.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   122
    checkbox label: aString.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   123
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   124
    ^ self addComponent: checkbox labeled: nil.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   125
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   126
    "Created: / 15-09-2014 / 18:11:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   127
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   128
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   129
addComponent:aView
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   130
    "Add given component. Component is automatically stretched to occupy windows' width"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   131
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   132
    self subclassResponsibility.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   133
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   134
    "Created: / 15-09-2014 / 18:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   135
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   136
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   137
addComponent:aView labeled:labelString
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   138
    "Add a label and some component side-by-side. Returns the component"
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   139
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   140
    self subclassResponsibility
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   141
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   142
    "Created: / 15-09-2014 / 15:43:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   143
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   144
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   145
addInputFieldOn: aValueModel labeled: aString validatedBy: aBlock
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   146
    | field |
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   147
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   148
    field := EditField new.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   149
    field immediateAccept: true.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   150
    field model: aValueModel.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   151
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   152
    ^ self addComponent: field labeled: aString
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   153
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   154
    "Created: / 15-09-2014 / 15:52:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   155
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   156
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   157
addSeparator
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   158
    "Add horizontal separator (line)"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   159
    ^ self addComponent: Separator new
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   160
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   161
    "Created: / 15-09-2014 / 18:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   162
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   163
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   164
!CustomDialog methodsFor:'construction-utilities'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   165
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   166
addClassCategoryEntryOn: aValueModel labeled: aString validateBy: aBlock
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   167
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   168
    ^ (self addInputFieldOn: aValueModel labeled: aString validatedBy: aBlock)
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   169
        entryCompletionBlock: [:text | DoWhatIMeanSupport classCategoryCompletion: text inEnvironment: Smalltalk ];
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   170
        yourself
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   171
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   172
    "Created: / 16-09-2014 / 10:13:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   173
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   174
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   175
addClassNameEntryOn: aValueModel labeled: aString validateBy: aBlock
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   176
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   177
    ^ (self addInputFieldOn: aValueModel labeled: aString validatedBy: aBlock)
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   178
        entryCompletionBlock: (DoWhatIMeanSupport classNameEntryCompletionBlock);
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   179
        yourself
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   180
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   181
    "Created: / 15-09-2014 / 15:43:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
703
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   182
!
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   183
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   184
addSelectorNameEntryOn: aValueModel labeled: aString validateBy: aBlock
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   185
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   186
    ^ (self addInputFieldOn: aValueModel labeled: aString validatedBy: aBlock)
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   187
        entryCompletionBlock: [:text | DoWhatIMeanSupport selectorCompletion:text inEnvironment:Smalltalk];
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   188
        yourself
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   189
300ac48af954 add CustomDialog >> addSelectorNameEntryOn: labeled: validateBy:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
   190
    "Created: / 15-10-2014 / 08:44:14 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   191
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   192
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   193
!CustomDialog methodsFor:'opening'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   194
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   195
open
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   196
    self subclassResponsibility
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   197
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 557
diff changeset
   198
    "Created: / 15-09-2014 / 16:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
543
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   199
! !
385fd9a2aa38 delegate dialogs to custom class
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   200
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   201
!CustomDialog methodsFor:'user interaction & notifications'!
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   202
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   203
information: aString
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   204
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   205
    self subclassResponsibility
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   206
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   207
    "Created: / 02-06-2014 / 22:01:47 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   208
! !
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 543
diff changeset
   209