}
private void initializeWebSocketsForWorkPanel() {
// Add "HttpPanel" components and views.
HttpPanelManager manager = HttpPanelManager.getInstance();
// component factory for outgoing and incoming messages with Text view
HttpPanelComponentFactory componentFactory = new WebSocketComponentFactory();
manager.addRequestComponentFactory(componentFactory);
manager.addResponseComponentFactory(componentFactory);
// use same factory for request & response,
// as Hex payloads are accessed the same way
HttpPanelViewFactory viewFactory = new WebSocketHexViewFactory();
manager.addRequestViewFactory(WebSocketComponent.NAME, viewFactory);
manager.addResponseViewFactory(WebSocketComponent.NAME, viewFactory);
// add the default Hex view for binary-opcode messages
HttpPanelDefaultViewSelectorFactory viewSelectorFactory = new HexDefaultViewSelectorFactory();
manager.addRequestDefaultViewSelectorFactory(WebSocketComponent.NAME, viewSelectorFactory);
manager.addResponseDefaultViewSelectorFactory(WebSocketComponent.NAME, viewSelectorFactory);
// replace the normal Text views with the ones that use syntax highlighting
viewFactory = new SyntaxHighlightTextViewFactory();
manager.addRequestViewFactory(WebSocketComponent.NAME, viewFactory);
manager.addResponseViewFactory(WebSocketComponent.NAME, viewFactory);
// support large payloads on incoming and outgoing messages
viewFactory = new WebSocketLargePayloadViewFactory();
manager.addRequestViewFactory(WebSocketComponent.NAME, viewFactory);
manager.addResponseViewFactory(WebSocketComponent.NAME, viewFactory);
viewSelectorFactory = new WebSocketLargePayloadDefaultViewSelectorFactory();
manager.addRequestDefaultViewSelectorFactory(WebSocketComponent.NAME, viewSelectorFactory);
manager.addResponseDefaultViewSelectorFactory(WebSocketComponent.NAME, viewSelectorFactory);
}