本文整理汇总了Java中org.waveprotocol.wave.model.document.operation.Attributes.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Attributes.isEmpty方法的具体用法?Java Attributes.isEmpty怎么用?Java Attributes.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.waveprotocol.wave.model.document.operation.Attributes
的用法示例。
在下文中一共展示了Attributes.isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toConciseString
import org.waveprotocol.wave.model.document.operation.Attributes; //导入方法依赖的package包/类
public static String toConciseString(Attributes attributes) {
if (attributes.isEmpty()) {
return "{}";
}
StringBuilder b = new StringBuilder();
b.append("{ ");
boolean first = true;
for (Map.Entry<String, String> entry : attributes.entrySet()) {
if (first) {
first = false;
} else {
b.append(", ");
}
b.append(entry.getKey());
b.append("=");
b.append(literalString(entry.getValue()));
}
b.append(" }");
return b.toString();
}
示例2: apply
import org.waveprotocol.wave.model.document.operation.Attributes; //导入方法依赖的package包/类
public <N, E extends N, T extends N> E apply(LocalDocument<N, E, T> localDoc, E parent,
N nodeAfter, Map<String, Object> before, Map<String, Object> after, boolean isEditing) {
if (!isEditing) {
return null;
}
Attributes attributes = Suggestion.maybeCreateSuggestions(before);
if (attributes == null || attributes.isEmpty()) {
return null;
}
E e = localDoc.transparentCreate(SuggestionRenderer.FULL_TAGNAME, attributes, parent,
nodeAfter);
if (e == null) {
return null;
}
ContentElement contentElement = (ContentElement) e;
HasSuggestions suggestion =
contentElement.getProperty(SuggestionRenderer.HAS_SUGGESTIONS_PROP);
contentElement.getSuggestionsManager().registerElement(suggestion);
return e;
}
示例3: lcHandleNewLine
import org.waveprotocol.wave.model.document.operation.Attributes; //导入方法依赖的package包/类
private <N, E extends N, T extends N> void lcHandleNewLine(RichTextTokenizer tokenizer,
Nindo.Builder builder, ReadableDomDocument<N, E, T> doc, N splitContainer,
Attributes attributes) {
// TODO(user): Don't create a new paragraph if the attributes are the same,
// and is first token.
boolean isLastToken = !tokenizer.hasNext();
if ((!isFirstToken && !isLastToken) || !attributes.isEmpty()) {
startElement(builder, LineContainers.LINE_TAGNAME, attributes);
endElement(builder);
}
}