use of com.intellij.diff.contents.EmptyContent in project intellij-community by JetBrains.
the class SvnDiffViewer method getProperties.
@NotNull
private static Map<String, PropertyValue> getProperties(@NotNull DiffContent content) {
if (content instanceof EmptyContent)
return Collections.emptyMap();
List<PropertyData> properties = ((SvnPropertiesDiffRequest.PropertyContent) content).getProperties();
Map<String, PropertyValue> map = new HashMap<>();
for (PropertyData data : properties) {
if (map.containsKey(data.getName()))
LOG.warn("Duplicated property: " + data.getName());
map.put(data.getName(), data.getValue());
}
return map;
}
use of com.intellij.diff.contents.EmptyContent in project intellij-community by JetBrains.
the class OnesideDiffViewer method canShowRequest.
public static <T extends EditorHolder> boolean canShowRequest(@NotNull DiffContext context, @NotNull DiffRequest request, @NotNull EditorHolderFactory<T> factory) {
if (!(request instanceof ContentDiffRequest))
return false;
List<DiffContent> contents = ((ContentDiffRequest) request).getContents();
if (contents.size() != 2)
return false;
DiffContent content1 = contents.get(0);
DiffContent content2 = contents.get(1);
if (content1 instanceof EmptyContent) {
return factory.canShowContent(content2, context) && factory.wantShowContent(content2, context);
}
if (content2 instanceof EmptyContent) {
return factory.canShowContent(content1, context) && factory.wantShowContent(content1, context);
}
return false;
}
use of com.intellij.diff.contents.EmptyContent in project intellij-community by JetBrains.
the class DiffUtil method createTitle.
@Nullable
private static JComponent createTitle(@NotNull String title, @NotNull DiffContent content, boolean equalCharsets, boolean equalSeparators, @Nullable Editor editor) {
if (content instanceof EmptyContent)
return null;
DocumentContent documentContent = (DocumentContent) content;
Charset charset = equalCharsets ? null : documentContent.getCharset();
Boolean bom = equalCharsets ? null : documentContent.hasBom();
LineSeparator separator = equalSeparators ? null : documentContent.getLineSeparator();
boolean isReadOnly = editor == null || editor.isViewer() || !canMakeWritable(editor.getDocument());
return createTitle(title, separator, charset, bom, isReadOnly);
}
Aggregations