本文整理汇总了Java中com.intellij.util.StringBuilderSpinAllocator类的典型用法代码示例。如果您正苦于以下问题:Java StringBuilderSpinAllocator类的具体用法?Java StringBuilderSpinAllocator怎么用?Java StringBuilderSpinAllocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringBuilderSpinAllocator类属于com.intellij.util包,在下文中一共展示了StringBuilderSpinAllocator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 );
}
}
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:20,代码来源:ManLightMethodBuilderImpl.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:MethodBreakpoint.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JavaMethodBreakpointType.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:WildcardMethodBreakpoint.java
示例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;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:NodeManagerImpl.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ReloadClassesWorker.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ProjectStructureProblemsHolderImpl.java
示例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);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PackagingElementNode.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CompilerPathsEx.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PackagingElementPath.java
示例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;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:LogFilterModel.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AntMessage.java
示例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;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ExecuteCompositeTargetEvent.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MetaTarget.java
示例16: 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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AntDomDocumentationProvider.java
示例17: createParameterList
import com.intellij.util.StringBuilderSpinAllocator; //导入依赖的package包/类
@NotNull
@Override
public PsiParameterList createParameterList(@NotNull @NonNls String[] names, @NotNull PsiType[] types) throws IncorrectOperationException {
StringBuilder builder = StringBuilderSpinAllocator.alloc();
builder.append("def foo(");
for (int i = 0; i < names.length; i++) {
String name = names[i];
final PsiType type = types[i];
if (type != null) {
builder.append(type.getCanonicalText());
builder.append(' ');
}
builder.append(name);
builder.append(',');
}
if (names.length > 0) {
builder.delete(builder.length() - 1, builder.length());
}
builder.append("){}");
final GrMethod method = createMethodFromText(builder);
return method.getParameterList();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:GroovyPsiElementFactoryImpl.java
示例18: 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);
}
}
开发者ID:SiimKinks,项目名称:sqlitemagic,代码行数:26,代码来源:SqliteMagicLightMethodBuilder.java
示例19: 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);
}
}
开发者ID:evant,项目名称:holdr,代码行数:25,代码来源:HoldrLightMethodBuilder.java
示例20: 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(myMethodName != null) {
if (classNameExists) {
buffer.append(".");
}
buffer.append(myMethodName);
}
}
else {
buffer.append(DebuggerBundle.message("status.breakpoint.invalid"));
}
return buffer.toString();
}
finally {
StringBuilderSpinAllocator.dispose(buffer);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:MethodBreakpoint.java
注:本文中的com.intellij.util.StringBuilderSpinAllocator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论