dbdiff toolbar cosmetics

This commit is contained in:
Gregory.Shrago
2012-09-05 23:21:20 +04:00
parent a80dda93f6
commit 53a391d723
4 changed files with 14 additions and 17 deletions
@@ -67,7 +67,7 @@ public class DirDiffSettings {
return filterPattern;
}
public static enum CompareMode {
public enum CompareMode {
CONTENT, // the most honest, the slowest. Compares size, if equal compares contents. Ignores timestamps
SIZE, // Compares size only
TIMESTAMP; // Compares size, if equal compares timestamps
@@ -84,16 +84,10 @@ public class DirDiffSettings {
}
}
public <T extends AnAction & DirDiffModelHolder> void addExtraAction(@NotNull T action) {
public <T extends AnAction> void addExtraAction(@NotNull T action) {
extraToolbarActions.add(action);
}
public void setModelToExtraActions(DirDiffModel model) {
for (AnAction action : extraToolbarActions) {
((DirDiffModelHolder)action).setModel(model);
}
}
public List<AnAction> getExtraActions() {
return extraToolbarActions;
}
@@ -323,8 +323,9 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
}
}
private static String addReadOnly(@NotNull String title, @Nullable Editor editor) {
if (editor == null) {
@Nullable
private static String addReadOnly(@Nullable String title, @Nullable Editor editor) {
if (editor == null || title == null) {
return title;
}
boolean readonly = editor.isViewer() || !editor.getDocument().isWritable();
@@ -578,7 +579,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
String title1 = addReadOnly(data.getContentTitles()[0], myLeftSide.getEditor());
String title2 = addReadOnly(data.getContentTitles()[1], myRightSide.getEditor());
if (sep1 != null && sep2 != null && !sep1.equals(sep2)) {
if (title1 != null && title2 != null && sep1 != null && sep2 != null && !sep1.equals(sep2)) {
setTitle1(createComponentForTitle(title1, sep1, true));
setTitle2(createComponentForTitle(title2, sep2, false));
}
@@ -253,10 +253,12 @@ public class DiffSideView {
SyncScrollSupport.scrollEditor(editor, logicalLine);
}
@Nullable
public Editor getEditor() {
return myEditorSource.getEditor();
}
@Nullable
public FragmentSide getSide() {
return myEditorSource.getSide();
}
@@ -91,11 +91,6 @@
<properties/>
<border type="none"/>
<children>
<hspacer id="d0cf4">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="b08b8" binding="myToolBarPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -106,7 +101,7 @@
</grid>
<grid id="97b9b" binding="myFilterPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -121,6 +116,11 @@
</component>
</children>
</grid>
<hspacer id="d0cf4">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>