-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheckLockStatus.jy
60 lines (51 loc) · 1.68 KB
/
checkLockStatus.jy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# title: Check the locks that block certain operations
# label: Locks Status
from javax.imageio import ImageIO
from javax.swing import JButton
from javax.swing import ImageIcon
from javax.swing import JPanel, JTextArea
from javax.swing import SwingUtilities
from javax.swing import SwingConstants
from java.lang import Thread
from java.util import LinkedHashMap
from java.awt import BorderLayout
from java.lang import Runnable
from javax.swing import BorderFactory
busy= ImageIcon( URL( 'http://sarahandjeremy.net:8080/hudson/static/66ffcbeb/images/16x16/grey_anime.gif' ) )
free= ImageIcon( URL( 'http://sarahandjeremy.net:8080/hudson/static/66ffcbeb/images/16x16/blue.gif' ) )
class UpdateUI( Runnable ):
def run(self):
global chstr
if ( len(chstr)==0 ):
freeUI.setIcon( free )
pendingTF.setText( "" )
else:
freeUI.setIcon( busy )
pendingTF.setText( chstr )
updateUI= UpdateUI()
def run(evt):
global chstr
changes= LinkedHashMap()
dom.controller.pendingChanges(changes)
chstr= ''
for ch in changes:
client= changes.get(ch).toString()
ist= client.find('(')
ien= client.rfind(')')
if ( ist!=-1 ):
client= client[0:ist]+client[(ien+1):]
if ( chstr=='' ):
chstr= '* ' + ch + ' (' + client + ')'
else:
chstr= chstr + '\n' + '* ' + ch + ' (' + client + ')'
SwingUtilities.invokeLater( updateUI )
if ( evt==0 ):
Thread.sleep(100)
invokeLater( run, 0 )
panel= JPanel(BorderLayout())
freeUI= JButton('status',actionPerformed=run)
pendingTF= JTextArea(10,60)
panel.add( freeUI, BorderLayout.NORTH )
panel.add( pendingTF, BorderLayout.CENTER )
addTab('status',panel)
invokeLater( run, 0 )