Tools__BackgroundSourceProcessingService.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 29 Aug 2013 12:20:29 +0100
branchjv
changeset 13468 444ac2aa4fd6
parent 12678 d6e678a09423
child 15566 184cea584be5
permissions -rw-r--r--
Hack: do not include Java language in language-menu. Java is funny - we don't have an evaluator for Java but we have to define evaluatorClass to return GroovyEvaluator to be able to inspect code in debugger/inspector. Hence this hack. We may need something like evaluatorClassForInspector/Debugger.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     1
"
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     3
              All Rights Reserved
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     4
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     5
 This software is furnished under a license and may be used
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     6
 only in accordance with the terms of that license and with the
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
     9
 other person.  No title to or ownership of the software is
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    10
 hereby transferred.
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    11
"
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    13
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    14
"{ NameSpace: Tools }"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    15
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
    16
CodeViewService subclass:#BackgroundSourceProcessingService
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    17
	instanceVariableNames:'job done modified'
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    18
	classVariableNames:''
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    19
	poolDictionaries:''
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    20
	category:'Interface-CodeView'
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    21
!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    22
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    23
!BackgroundSourceProcessingService class methodsFor:'documentation'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    24
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    25
copyright
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    26
"
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    27
 COPYRIGHT (c) 2006 by eXept Software AG
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    28
              All Rights Reserved
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    29
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    30
 This software is furnished under a license and may be used
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    31
 only in accordance with the terms of that license and with the
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    33
 be provided or otherwise made available to, or used by, any
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    34
 other person.  No title to or ownership of the software is
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    35
 hereby transferred.
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    36
"
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    37
!
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
    38
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    39
documentation
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    40
"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    41
    An abstract base class for all services that process current
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    42
    (displayed) source code. All processing is done in background
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    43
    job, that is restarted whenever a text in the editor is changed.
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    44
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    45
    [author:]
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    46
        Jan Vrany <jan.vrany@fit.cvut.cz>
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    47
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    48
    [instance variables:]
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    49
        job         <BackgroundJob> A background job.
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    50
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    51
    [class variables:]
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    52
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    53
    [see also:]
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    54
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    55
"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    56
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    57
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    58
!BackgroundSourceProcessingService class methodsFor:'testing'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    59
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    60
isAbstract
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    61
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    62
    ^self == Tools::BackgroundSourceProcessingService
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    63
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    64
    "Created: / 24-01-2012 / 12:27:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    65
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    66
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    67
!BackgroundSourceProcessingService methodsFor:'acessing-defaults'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    68
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    69
defaultJobName
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    70
    "Returns a human-readable job name, to ease identification in process browser"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    71
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    72
    ^ 'CodeView2''s source processing job'
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    73
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    74
    "Created: / 24-01-2012 / 12:05:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    75
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    76
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    77
!BackgroundSourceProcessingService methodsFor:'change & update'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    78
12194
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    79
modelChanged
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    80
    "Model has changed (i.e., value holder keeping displayed text"
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    81
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    82
    self sourceChanged: true
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    83
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    84
    "Created: / 17-03-2012 / 15:45:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    85
!
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    86
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    87
sourceChanged:force
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    88
    "Called when codeview's text changes"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    89
12194
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    90
    (force or:[codeView reallyModified]) ifTrue:[
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    91
        self process
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    92
    ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    93
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    94
    "Modified: / 22-08-2011 / 13:51:53 / cg"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    95
    "Modified (format): / 05-09-2011 / 05:06:40 / cg"
12194
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
    96
    "Modified: / 17-03-2012 / 16:04:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    97
!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    98
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
    99
update:aspect with:param from:sender 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   100
    textView notNil ifTrue:[
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   101
        "/sender == textView modifiedChannel ifTrue:[^self codeChanged: false].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   102
        sender == textView model ifTrue:[
12172
047fafb1c37f Avoid reprocessing when test has not changed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   103
            sender value ~= textView contents ifTrue:[
12194
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12172
diff changeset
   104
                self modelChanged.
12172
047fafb1c37f Avoid reprocessing when test has not changed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   105
                ^self.
047fafb1c37f Avoid reprocessing when test has not changed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   106
            ].
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   107
        ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   108
        (sender == textView and:[aspect == #sizeOfContents]) ifTrue:[
12172
047fafb1c37f Avoid reprocessing when test has not changed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   109
            self sourceChanged:true.
047fafb1c37f Avoid reprocessing when test has not changed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   110
            ^self.
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   111
        ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   112
    ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   113
    codeView notNil ifTrue:[
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   114
        sender == codeView languageHolder ifTrue:[
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   115
            self sourceChanged:true.
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   116
            ^self
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   117
        ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   118
        sender == codeView classHolder ifTrue:[
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   119
            self sourceChanged:true.
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   120
            ^self
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   121
        ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   122
    ].
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   123
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   124
    aspect == #codeAspect ifTrue:[
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   125
        self sourceChanged:true.
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   126
        ^self
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   127
    ].
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   128
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   129
    super 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   130
        update:aspect
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   131
        with:param
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   132
        from:sender
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   133
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   134
    "Created: / 06-03-2010 / 19:38:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   135
    "Modified: / 13-09-2011 / 12:00:29 / cg"
12172
047fafb1c37f Avoid reprocessing when test has not changed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   136
    "Modified: / 22-02-2012 / 15:02:16 / jv"
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   137
    "Modified: / 15-04-2013 / 23:00:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   138
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   139
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   140
!BackgroundSourceProcessingService methodsFor:'event handling'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   141
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   142
linesDeletedFrom:start to:end 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   143
    self sourceChanged:true
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   144
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   145
    "Created: / 06-07-2011 / 17:14:36 / jv"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   146
    "Created: / 16-09-2011 / 15:18:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   147
!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   148
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   149
linesInsertedFrom:start to:end 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   150
    self sourceChanged:true
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   151
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   152
    "Created: / 06-07-2011 / 17:14:36 / jv"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   153
    "Created: / 16-09-2011 / 15:18:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   154
!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   155
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   156
linesModifiedFrom:start to:end 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   157
    self sourceChanged:true
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   158
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   159
    "Created: / 06-07-2011 / 17:14:36 / jv"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   160
    "Created: / 16-09-2011 / 15:15:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   161
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   162
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   163
!BackgroundSourceProcessingService methodsFor:'initialization'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   164
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   165
initialize
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   166
    job := (Smalltalk at:#BackgroundJob) 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   167
                named:self defaultJobName
11618
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   168
                on:[
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   169
                    Error handle:[:ex |
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   170
                        (Dialog confirm:('Error while processing source:\\',ex description,'\\Debug ?') withCRs)
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   171
                        ifTrue:[
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   172
                            ex reject.
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   173
                        ]
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   174
                    ] do:[
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   175
                        self process:true
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   176
                    ]
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   177
                ].
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   178
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   179
    "Created: / 29-07-2011 / 10:31:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   180
    "Modified: / 24-01-2012 / 12:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11618
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   181
    "Modified: / 19-07-2012 / 16:17:21 / cg"
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   182
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   184
!BackgroundSourceProcessingService methodsFor:'processing'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   185
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   186
process
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   187
    "(Re)starts the processing job. Should be called whenever a source 
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   188
     must be (re)processed."
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   189
11558
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   190
    | prio browser |
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   191
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   192
    "/ this clobbers the codeViews modified state; therefore, we have to remember
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   193
    "/ this info somewhere ...
11558
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   194
    (browser := codeView browser) notNil ifTrue:[
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   195
        textView modified ifTrue:[
11558
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   196
            browser navigationState realModifiedState: true
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   197
        ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   198
        textView modifiedChannel setValue:false.
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   199
    ].
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   200
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   201
    job scheduled ifTrue:[
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   202
        job running ifFalse:[
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   203
            "/ process already created, but did not get a change to start yet;
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   204
            ^ self
11558
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   205
        ].
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   206
        job stop.
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   207
    ].
11558
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   208
    prio := Processor userBackgroundPriority.
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   209
    job startWithPriority: prio.
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   210
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   211
    "Modified: / 07-07-2011 / 12:26:12 / Jan Vrany <jan.vrant@fit.cvut,cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   212
    "Created: / 24-01-2012 / 12:15:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11558
0e93cd2b9c48 fixed process priorities
Claus Gittinger <cg@exept.de>
parents: 11183
diff changeset
   213
    "Modified: / 05-06-2012 / 23:58:20 / cg"
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   214
!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   215
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   216
process: delayed
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   217
    "Do the real source processing. If delayed is true, actuall data update must
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   218
     be done within the event queue using #pushUserEvent:...
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   219
     "
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   220
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   221
    self subclassResponsibility
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   222
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   223
    "Created: / 24-01-2012 / 12:25:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   224
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   225
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   226
!BackgroundSourceProcessingService methodsFor:'registering'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   227
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   228
registerIn: aCodeView
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   229
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   230
    super registerIn: aCodeView.
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   231
    textView addDependent: self.
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   232
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   233
    "Created: / 27-07-2011 / 13:25:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   234
! !
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   235
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   236
!BackgroundSourceProcessingService class methodsFor:'documentation'!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   237
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   238
version
11618
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   239
    ^ '$Header: /cvs/stx/stx/libtool/Tools__BackgroundSourceProcessingService.st,v 1.3 2012-07-19 15:19:59 cg Exp $'
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   240
!
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   241
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   242
version_CVS
11618
29842c419b87 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 11558
diff changeset
   243
    ^ '$Header: /cvs/stx/stx/libtool/Tools__BackgroundSourceProcessingService.st,v 1.3 2012-07-19 15:19:59 cg Exp $'
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   244
!
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   245
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
   246
version_HG
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
   247
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
   248
    ^ '$Changeset: <not expanded> $'
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
   249
!
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
   250
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   251
version_SVN
12265
f1b3696cf042 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12262
diff changeset
   252
    ^ '$Id: Tools__BackgroundSourceProcessingService.st 8022 2012-07-25 09:51:30Z vranyj1 $'
11183
a0ab27f5679c initial checkin
vrany
parents:
diff changeset
   253
! !
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12265 11618
diff changeset
   254