本文整理汇总了Java中com.intellij.util.StringBuilderSpinAllocator类的典型用法代码示例。如果您正苦于以下问题:Java StringBuilderSpinAllocator类的具体用法?Java StringBuilderSpinAllocator怎么用?Java StringBuilderSpinAllocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringBuilderSpinAllocator类属于com.intellij.util包,在下文中一共展示了StringBuilderSpinAllocator类的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: 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);
}
}
示例3: getText
import com.intellij.util.StringBuilderSpinAllocator; //导入依赖的package包/类
static String getText(XBreakpoint<JavaMethodBreakpointProperties> breakpoint) {
final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
try {
//if(isValid()) {
final String className = breakpoint.getProperties().myClassPattern;
final boolean classNameExists = className != null && className.length() > 0;
if (classNameExists) {
buffer.append(className);
}
if(breakpoint.getProperties().myMethodName != null) {
if (classNameExists) {
buffer.append(".");
}
buffer.append(breakpoint.getProperties().myMethodName);
}
//}
//else {
// buffer.append(DebuggerBundle.message("status.breakpoint.invalid"));
//}
return buffer.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
}
示例4: 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(getClassPattern());
buffer.append(".");
buffer.append(getMethodName());
buffer.append("()");
return buffer.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
}
示例5: getContextKeyForFrame
import com.intellij.util.StringBuilderSpinAllocator; //导入依赖的package包/类
@Nullable
public static String getContextKeyForFrame(final StackFrameProxyImpl frame) {
if (frame == null) {
return null;
}
try {
final Location location = frame.location();
final Method method = location.method();
final ReferenceType referenceType = location.declaringType();
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
return builder.append(referenceType.signature()).append("#").append(method.name()).append(method.signature()).toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
catch (EvaluateException e) {
return null;
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: 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);
}
示例9: 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);
}
}
示例10: 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);
}
}
示例11: 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;
}
示例12: 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
示例13: 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);
}
}
示例14: ExecuteCompositeTargetEvent
import com.intellij.util.StringBuilderSpinAllocator; //导入依赖的package包/类
public ExecuteCompositeTargetEvent(String[] targetNames) {
myTargetNames = targetNames;
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
builder.append("[");
for (int idx = 0; idx < targetNames.length; idx++) {
if (idx > 0) {
builder.append(",");
}
builder.append(targetNames[idx]);
}
builder.append("]");
myCompositeName = builder.toString();
}
finally {
StringBuilderSpinAllocator.dispose(builder);
}
myPresentableName = myCompositeName;
}
示例15: 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);
}
}