private void setupCentralPanel() { myCentralPanel.removeAll(); if (myUsagePreviewPanel != null) { Disposer.dispose(myUsagePreviewPanel); myUsagePreviewPanel = null; } JScrollPane pane = ScrollPaneFactory.createScrollPane(myTree); if (UsageViewSettings.getInstance().IS_PREVIEW_USAGES) { Splitter splitter = new Splitter(false, UsageViewSettings.getInstance().PREVIEW_USAGES_SPLITTER_PROPORTIONS); pane.putClientProperty(UIUtil.KEEP_BORDER_SIDES, SideBorder.RIGHT); splitter.setFirstComponent(pane); myUsagePreviewPanel = new UsagePreviewPanel(myProject); myUsagePreviewPanel.setBorder(IdeBorderFactory.createBorder(SideBorder.LEFT)); Disposer.register(this, myUsagePreviewPanel); splitter.setSecondComponent(myUsagePreviewPanel); myCentralPanel.add(splitter, BorderLayout.CENTER); } else { myCentralPanel.add(pane, BorderLayout.CENTER); } myCentralPanel.add(myButtonPanel, BorderLayout.SOUTH); myRootPanel.revalidate(); }
@CalledInAwt private void destroyViewer() { Disposer.dispose(myViewer); myMainPanel.putClientProperty(AnAction.ourClientProperty, null); myContentPanel.setContent(null); myToolbarPanel.setContent(null); myToolbarStatusPanel.setContent(null); myCloseHandler = null; myBottomActions = null; }
public MergeRequestProcessor(@Nullable Project project, @NotNull MergeRequest request) { myProject = project; myRequest = request; myContext = new MyDiffContext(); myContext.putUserData(DiffUserDataKeys.PLACE, DiffPlaces.MERGE); myAvailableTools = DiffManagerEx.getInstance().getMergeTools(); myMainPanel = new MyPanel(); myContentPanel = new Wrapper(); myToolbarPanel = new Wrapper(); myToolbarPanel.setFocusable(true); myToolbarStatusPanel = new Wrapper(); myPanel = JBUI.Panels.simplePanel(myMainPanel); JPanel topPanel = JBUI.Panels.simplePanel(myToolbarPanel).addToRight(myToolbarStatusPanel); myMainPanel.add(topPanel, BorderLayout.NORTH); myMainPanel.add(myContentPanel, BorderLayout.CENTER); myMainPanel.setFocusTraversalPolicyProvider(true); myMainPanel.setFocusTraversalPolicy(new MyFocusTraversalPolicy()); MergeTool.MergeViewer viewer; try { viewer = getFittedTool().createComponent(myContext, myRequest); } catch (Throwable e) { LOG.error(e); viewer = ErrorMergeTool.INSTANCE.createComponent(myContext, myRequest); } myViewer = viewer; updateBottomActions(); }