本文整理汇总了Java中com.intellij.util.StringBuilderSpinAllocator.dispose方法的典型用法代码示例。如果您正苦于以下问题:Java StringBuilderSpinAllocator.dispose方法的具体用法?Java StringBuilderSpinAllocator.dispose怎么用?Java StringBuilderSpinAllocator.dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.StringBuilderSpinAllocator
的用法示例。
在下文中一共展示了StringBuilderSpinAllocator.dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllModifierProperties
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getAllModifierProperties( LightModifierList modifierList )
{
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try
{
for( String modifier : modifierList.getModifiers() )
{
if( !PsiModifier.PACKAGE_LOCAL.equals( modifier ) )
{
builder.append( modifier ).append( ' ' );
}
}
return builder.toString();
}
finally
{
StringBuilderSpinAllocator.dispose( builder );
}
}
示例2: acceptDirectory
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
protected void acceptDirectory(final VirtualFile file, final String fileRoot, final String filePath) {
ProgressManager.checkCanceled();
final VirtualFile[] children = file.getChildren();
for (final VirtualFile child : children) {
final String name = child.getName();
final String _filePath;
final StringBuilder buf = StringBuilderSpinAllocator.alloc();
try {
buf.append(filePath).append("/").append(name);
_filePath = buf.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buf);
}
accept(child, fileRoot, _filePath);
}
}
示例3: getDisplayName
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getDisplayName() {
final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
try {
if(isValid()) {
final String className = getClassName();
final boolean classNameExists = className != null && className.length() > 0;
if (classNameExists) {
buffer.append(className);
}
if(getMethodName() != null) {
if (classNameExists) {
buffer.append(".");
}
buffer.append(getMethodName());
}
}
else {
buffer.append(DebuggerBundle.message("status.breakpoint.invalid"));
}
return buffer.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
}
示例4: AntMessage
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public AntMessage(AntBuildMessageView.MessageType type, int priority, String[] lines, VirtualFile file, int line, int column) {
myType = type;
myPriority = priority;
myFile = file;
myLine = line;
myColumn = column;
myTextLines = lines;
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
for (final String aLine : lines) {
builder.append(aLine);
builder.append('\n');
}
myText = builder.toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
示例5: getPathStringFrom
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@NotNull
public String getPathStringFrom(String separator, @Nullable CompositePackagingElement<?> ancestor) {
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
final List<CompositePackagingElement<?>> parents = getParentsFrom(ancestor);
for (int i = parents.size() - 1; i >= 0; i--) {
builder.append(parents.get(i).getName());
if (i > 0) {
builder.append(separator);
}
}
return builder.toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
示例6: generateDoc
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String generateDoc(PsiElement element, PsiElement originalElement) {
final String mainDoc = getMainDocumentation(originalElement);
final String additionalDoc = getAdditionalDocumentation(originalElement);
if (mainDoc == null && additionalDoc == null) {
return null;
}
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
if (additionalDoc != null) {
builder.append(additionalDoc);
}
if (mainDoc != null) {
builder.append(mainDoc);
}
return builder.toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
示例7: reportProblem
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
private void reportProblem(final String qualifiedName, @Nullable Exception ex) {
String reason = null;
if (ex != null) {
reason = ex.getLocalizedMessage();
}
if (reason == null || reason.length() == 0) {
reason = DebuggerBundle.message("error.io.error");
}
final StringBuilder buf = StringBuilderSpinAllocator.alloc();
try {
buf.append(qualifiedName).append(" : ").append(reason);
myProgress.addMessage(myDebuggerSession, MessageCategory.ERROR, buf.toString());
}
finally {
StringBuilderSpinAllocator.dispose(buf);
}
}
示例8: getActionId
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getActionId() {
final String modelName = myBuildFile.getModel().getName();
if (modelName == null || modelName.length() == 0) {
return null;
}
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
builder.append(AntConfiguration.getActionIdPrefix(myBuildFile.getProject()));
builder.append("_");
builder.append(modelName);
builder.append('_');
builder.append(getName());
return builder.toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
示例9: composeTooltipMessage
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String composeTooltipMessage() {
final StringBuilder buf = StringBuilderSpinAllocator.alloc();
try {
buf.append("<html><body>");
if (myProblemDescriptions != null) {
int problems = 0;
for (ProjectStructureProblemDescription problemDescription : myProblemDescriptions) {
buf.append(XmlStringUtil.escapeString(problemDescription.getMessage(false))).append("<br>");
problems++;
if (problems >= 10 && myProblemDescriptions.size() > 12) {
buf.append(myProblemDescriptions.size() - problems).append(" more problems...<br>");
break;
}
}
}
buf.append("</body></html>");
return buf.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buf);
}
}
示例10: update
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
final Collection<ArtifactProblemDescription> problems = ((ArtifactEditorImpl)myContext.getThisArtifactEditor()).getValidationManager().getProblems(this);
if (problems == null || problems.isEmpty()) {
super.update(presentation);
return;
}
StringBuilder buffer = StringBuilderSpinAllocator.alloc();
final String tooltip;
boolean isError = false;
try {
for (ArtifactProblemDescription problem : problems) {
isError |= problem.getSeverity() == ProjectStructureProblemType.Severity.ERROR;
buffer.append(problem.getMessage(false)).append("<br>");
}
tooltip = XmlStringUtil.wrapInHtml(buffer);
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
getElementPresentation().render(presentation, addErrorHighlighting(isError, SimpleTextAttributes.REGULAR_ATTRIBUTES),
addErrorHighlighting(isError, SimpleTextAttributes.GRAY_ATTRIBUTES));
presentation.setTooltip(tooltip);
}
示例11: getDelegate
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@NotNull
private Reader getDelegate() {
if (myDelegate != null) {
return myDelegate;
}
int maxLength = Registry.intValue("editor.richcopy.max.size.megabytes") * FileUtilRt.MEGABYTE;
final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
try {
try {
build(buffer, maxLength);
}
catch (Exception e) {
LOG.error(e);
}
String s = buffer.toString();
if (LOG.isDebugEnabled()) {
LOG.debug("Resulting text: \n" + s);
}
myDelegate = new StringReader(s);
return myDelegate;
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:AbstractSyntaxAwareReaderTransferableData.java
示例12: rebuildMethodFromString
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
private PsiMethod rebuildMethodFromString() {
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
builder.append(getAllModifierProperties((LightModifierList) getModifierList()));
PsiType returnType = getReturnType();
if (null != returnType) {
builder.append(returnType.getCanonicalText()).append(' ');
}
builder.append(getName());
builder.append('(');
if (getParameterList().getParametersCount() > 0) {
for (PsiParameter parameter : getParameterList().getParameters()) {
builder.append(parameter.getType().getCanonicalText()).append(' ').append(parameter.getName()).append(',');
}
builder.deleteCharAt(builder.length() - 1);
}
builder.append(')');
builder.append('{').append(" ").append('}');
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getManager().getProject()).getElementFactory();
return elementFactory.createMethodFromText(builder.toString(), getContainingClass());
} finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
示例13: getCustomPattern
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@Nullable
private Pattern getCustomPattern() {
String customFilter = getCustomFilter();
if (myCustomPattern == null && customFilter != null) {
final StringBuilder buf = StringBuilderSpinAllocator.alloc();
try {
for (int i = 0; i < customFilter.length(); i++) {
final char c = customFilter.charAt(i);
if (Character.isLetterOrDigit(c)) {
buf.append(Character.toUpperCase(c));
}
else {
buf.append("\\").append(c);
}
}
myCustomPattern = Pattern.compile(".*" + buf + ".*", Pattern.DOTALL);
}
finally {
StringBuilderSpinAllocator.dispose(buf);
}
}
return myCustomPattern;
}
示例14: join
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public static String join(List<String> value, char separator) {
final int size = value.size();
if (size > 1) {
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
builder.append(value.get(0));
for (int idx = 1; idx < size; idx++) {
builder.append(separator).append(value.get(idx));
}
return builder.toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
else if (size == 1){
return value.get(0);
}
return "";
}
示例15: getDisplayName
import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getDisplayName() {
if (!isValid()) {
return DebuggerBundle.message("status.breakpoint.invalid");
}
final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
try {
buffer.append(myClassPattern);
buffer.append(".");
buffer.append(myMethodName);
buffer.append("()");
return buffer.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
}