From d4c8dc223d566c93024f4fced54bf8f56d029d83 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Wed, 20 Jul 2016 00:06:26 +0300 Subject: [PATCH] [file-history] move status text inside comments pane --- .../vcs/history/FileHistoryPanelImpl.java | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index 634750de3a97..7292629cf3d0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -99,7 +99,6 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme private static final String VCS_HISTORY_ACTIONS_GROUP = "VcsHistoryActionsGroup"; @NotNull private final Project myProject; private final MyCommentsPane myComments; - private final StatusText myCommentsStatus; private final DefaultActionGroup myPopupActions; private final AbstractVcs myVcs; private final VcsHistoryProvider myProvider; @@ -162,21 +161,7 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme myDiffHandler = customDiffHandler == null ? new StandardDiffFromHistoryHandler() : customDiffHandler; final DualViewColumnInfo[] columns = createColumnList(myVcs.getProject(), provider, session); - myCommentsStatus = new StatusText() { - @Override - protected boolean isStatusVisible() { - return myComments.isEmpty(); - } - }; - myCommentsStatus.setText("Commit message"); - myComments = new MyCommentsPane() { - @Override - protected void paintComponent(Graphics g) { - super.paintComponent(g); - myCommentsStatus.paint(this, g); - } - }; - myCommentsStatus.attachTo(myComments); + myComments = new MyCommentsPane(); myRevisionsOrder = new HashMap<>(); refreshRevisionsOrder(); @@ -1682,12 +1667,28 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme } private class MyCommentsPane extends HtmlPanel implements DataProvider, CopyProvider { + @NotNull private final StatusText myStatusText; @NotNull private String myText = ""; public MyCommentsPane() { + myStatusText = new StatusText() { + @Override + protected boolean isStatusVisible() { + return StringUtil.isEmpty(myText); + } + }; + myStatusText.setText("Commit message"); + myStatusText.attachTo(this); + setPreferredSize(new Dimension(150, 100)); } + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + myStatusText.paint(this, g); + } + public void update(@NotNull List selection) { if (selection.isEmpty()) { setText(""); @@ -1722,10 +1723,6 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme } } - public boolean isEmpty() { - return StringUtil.isEmpty(myText); - } - @Override public Color getBackground() { return UIUtil.getEditorPaneBackground();