use of org.jetbrains.idea.svn.properties.PropertyData in project intellij-community by JetBrains.
the class ShowPropertiesDiffAction method createHandler.
@NotNull
private static PropertyConsumer createHandler(SVNRevision revision, @NotNull final List<PropertyData> lines) {
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.checkCanceled();
indicator.setText(SvnBundle.message("show.properties.diff.progress.text.revision.information", revision.toString()));
}
return new PropertyConsumer() {
public void handleProperty(final File path, final PropertyData property) throws SVNException {
registerProperty(property);
}
public void handleProperty(final SVNURL url, final PropertyData property) throws SVNException {
registerProperty(property);
}
public void handleProperty(final long revision, final PropertyData property) throws SVNException {
// revision properties here
}
private void registerProperty(@NotNull PropertyData property) {
if (indicator != null) {
indicator.checkCanceled();
indicator.setText2(SvnBundle.message("show.properties.diff.progress.text2.property.information", property.getName()));
}
lines.add(property);
}
};
}
use of org.jetbrains.idea.svn.properties.PropertyData 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 org.jetbrains.idea.svn.properties.PropertyData in project intellij-community by JetBrains.
the class SetPropertyDialog method fillPropertyNames.
private void fillPropertyNames(File[] files) {
final Collection<String> names = new TreeSet<>();
if (files.length == 1) {
File file = files[0];
try {
PropertyConsumer handler = new PropertyConsumer() {
public void handleProperty(File path, PropertyData property) {
String name = property.getName();
if (name != null) {
names.add(name);
}
}
public void handleProperty(SVNURL url, PropertyData property) {
}
public void handleProperty(long revision, PropertyData property) {
}
};
PropertyClient client = myVCS.getFactory(file).createPropertyClient();
client.list(SvnTarget.fromFile(file, SVNRevision.WORKING), SVNRevision.WORKING, Depth.EMPTY, handler);
} catch (VcsException e) {
LOG.info(e);
}
}
fillProperties(names);
for (final String name : names) {
myPropertyNameBox.addItem(name);
}
}
use of org.jetbrains.idea.svn.properties.PropertyData in project intellij-community by JetBrains.
the class ShowPropertiesDiffAction method getPropertyList.
@NotNull
private static List<PropertyData> getPropertyList(@NotNull SvnVcs vcs, @NotNull SvnTarget target, @Nullable SVNRevision revision) throws VcsException {
final List<PropertyData> lines = new ArrayList<>();
final PropertyConsumer propertyHandler = createHandler(revision, lines);
vcs.getFactory(target).createPropertyClient().list(target, revision, Depth.EMPTY, propertyHandler);
return lines;
}
use of org.jetbrains.idea.svn.properties.PropertyData in project intellij-community by JetBrains.
the class ShowPropertiesDiffAction method toSortedStringPresentation.
@NotNull
public static String toSortedStringPresentation(@NotNull List<PropertyData> lines) {
StringBuilder sb = new StringBuilder();
Collections.sort(lines, Comparator.comparing(PropertyData::getName));
for (PropertyData line : lines) {
addPropertyPresentation(line, sb);
}
return sb.toString();
}
Aggregations