} catch (WebSocketException e) {
logger.warn(e.getMessage(), e);
}
if (getView() != null) {
ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
ExtensionHookView hookView = extensionHook.getHookView();
ExtensionHookMenu hookMenu = extensionHook.getHookMenu();
// setup WebSocket tab
WebSocketPanel wsPanel = getWebSocketPanel();
wsPanel.setDisplayPanel(getView().getRequestPanel(), getView().getResponsePanel());
extensionHook.addSessionListener(wsPanel.getSessionListener());
addAllChannelObserver(wsPanel);
ExtensionHelp.enableHelpKey(wsPanel, "websocket.tab");
hookView.addStatusPanel(getWebSocketPanel());
// setup Options Panel
hookView.addOptionPanel(getOptionsPanel());
// add 'Exclude from WebSockets' menu item to WebSocket tab context menu
hookMenu.addPopupMenuItem(new ExcludeFromWebSocketsMenuItem(this, storage.getTable()));
// setup Session Properties
sessionExcludePanel = new SessionExcludeFromWebSocket(this);
getView().getSessionDialog().addParamPanel(new String[]{}, sessionExcludePanel, false);
// setup Breakpoints
ExtensionBreak extBreak = (ExtensionBreak) extLoader.getExtension(ExtensionBreak.NAME);
if (extBreak != null) {
// setup custom breakpoint handler
BreakpointMessageHandler wsBrkMessageHandler = new WebSocketBreakpointMessageHandler(extBreak.getBreakPanel(), config);
wsBrkMessageHandler.setEnabledBreakpoints(extBreak.getBreakpointsEnabledList());
// listen on new messages such that breakpoints can apply
addAllChannelObserver(new WebSocketProxyListenerBreak(this, wsBrkMessageHandler));
// pop up to add the breakpoint
hookMenu.addPopupMenuItem(new PopupMenuAddBreakWebSocket(extBreak));
extBreak.addBreakpointsUiManager(getBrkManager());
}
// setup replace payload filter
wsFilterListener = new WebSocketFilterListener();
addAllChannelObserver(wsFilterListener);
payloadFilter = new FilterWebSocketPayload(this, wsPanel.getChannelsModel());
addWebSocketFilter(payloadFilter);
// setup fuzzable extension
ExtensionFuzz extFuzz = (ExtensionFuzz) extLoader.getExtension(ExtensionFuzz.NAME);
if (extFuzz != null) {
hookMenu.addPopupMenuItem(new ShowFuzzMessageInWebSocketsTabMenuItem(getWebSocketPanel()));
fuzzHandler = new WebSocketFuzzerHandler(storage.getTable());
extFuzz.addFuzzerHandler(WebSocketMessageDTO.class, fuzzHandler);
addAllChannelObserver(fuzzHandler);
}
// add exclude/include scope
hookMenu.addPopupMenuItem(new PopupIncludeWebSocketContextMenu());
hookMenu.addPopupMenuItem(new PopupExcludeWebSocketContextMenu());
// setup workpanel (window containing Request, Response & Break tab)
initializeWebSocketsForWorkPanel();
// setup manualrequest extension
ExtensionManualRequestEditor extManReqEdit = (ExtensionManualRequestEditor) extLoader
.getExtension(ExtensionManualRequestEditor.NAME);
if (extManReqEdit != null) {
WebSocketPanelSender sender = new WebSocketPanelSender();
addAllChannelObserver(sender);