|
53 | 53 | import com.pega.gcs.logviewer.model.Log4jLogThreadDumpEntry; |
54 | 54 | import com.pega.gcs.logviewer.model.ThreadDumpThreadInfo; |
55 | 55 | import com.pega.gcs.logviewer.parser.LogThreadDumpParser; |
| 56 | +import com.pega.gcs.logviewer.pegatdp.PegaThreadDumpParser; |
56 | 57 | import com.pega.gcs.logviewer.pegatdp.PegaThreadDumpParserPanel; |
57 | 58 |
|
58 | 59 | public class ThreadDumpPanel extends JPanel { |
@@ -170,30 +171,35 @@ public ThreadDumpPanel(Log4jLogThreadDumpEntry log4jLogThreadDumpEntry, LogTable |
170 | 171 | tabCounter++; |
171 | 172 |
|
172 | 173 | // Pega 7 Thread Dump Parser |
173 | | - tabText = "Thread Dump Report"; |
174 | | - tabLabel = new JLabel(tabText); |
175 | | - tabLabel.setFont(tabFont); |
176 | | - tabLabel.setSize(dim); |
177 | | - tabLabel.setPreferredSize(dim); |
178 | | - tabLabel.setHorizontalAlignment(SwingConstants.CENTER); |
| 174 | + PegaThreadDumpParser pegaThreadDumpParser = PegaThreadDumpParser.getInstance(); |
179 | 175 |
|
180 | | - ThreadDumpTable threadDumpTable = getThreadDumpTable(); |
| 176 | + if (pegaThreadDumpParser.isInitialised()) { |
| 177 | + |
| 178 | + tabText = "Thread Dump Report"; |
| 179 | + tabLabel = new JLabel(tabText); |
| 180 | + tabLabel.setFont(tabFont); |
| 181 | + tabLabel.setSize(dim); |
| 182 | + tabLabel.setPreferredSize(dim); |
| 183 | + tabLabel.setHorizontalAlignment(SwingConstants.CENTER); |
181 | 184 |
|
182 | | - boolean v7ThreadDump = threadDumpTableModel.isV7ThreadDump(); |
| 185 | + ThreadDumpTable threadDumpTable = getThreadDumpTable(); |
183 | 186 |
|
184 | | - List<Integer> threadColumnList = new ArrayList<>(); |
185 | | - threadColumnList.add(0); |
| 187 | + boolean v7ThreadDump = threadDumpTableModel.isV7ThreadDump(); |
186 | 188 |
|
187 | | - ThreadDumpRequestorLockTableMouseListener threadDumpRequestorLockTableMouseListener; |
188 | | - threadDumpRequestorLockTableMouseListener = new ThreadDumpRequestorLockTableMouseListener(threadDumpTable, |
189 | | - threadDumpTabbedPane, threadColumnList); |
| 189 | + List<Integer> threadColumnList = new ArrayList<>(); |
| 190 | + threadColumnList.add(0); |
190 | 191 |
|
191 | | - JPanel pegaThreadDumpParserPanel = new PegaThreadDumpParserPanel(logEntryText, log4jLogThreadDumpEntry, |
192 | | - v7ThreadDump, logTableModel, threadDumpRequestorLockTableMouseListener); |
| 192 | + ThreadDumpRequestorLockTableMouseListener threadDumpRequestorLockTableMouseListener; |
| 193 | + threadDumpRequestorLockTableMouseListener = new ThreadDumpRequestorLockTableMouseListener(threadDumpTable, |
| 194 | + threadDumpTabbedPane, threadColumnList); |
193 | 195 |
|
194 | | - threadDumpTabbedPane.addTab(tabText, pegaThreadDumpParserPanel); |
195 | | - threadDumpTabbedPane.setTabComponentAt(tabCounter, tabLabel); |
196 | | - tabCounter++; |
| 196 | + JPanel pegaThreadDumpParserPanel = new PegaThreadDumpParserPanel(logEntryText, log4jLogThreadDumpEntry, |
| 197 | + v7ThreadDump, logTableModel, threadDumpRequestorLockTableMouseListener); |
| 198 | + |
| 199 | + threadDumpTabbedPane.addTab(tabText, pegaThreadDumpParserPanel); |
| 200 | + threadDumpTabbedPane.setTabComponentAt(tabCounter, tabLabel); |
| 201 | + tabCounter++; |
| 202 | + } |
197 | 203 |
|
198 | 204 | int defaultSelectedTab = threadDumpSelectedTab.get(); |
199 | 205 | int tabCount = threadDumpTabbedPane.getTabCount(); |
|
0 commit comments