当前位置: 首页>>代码示例>>Java>>正文


Java ColoredTextContainer.setIcon方法代码示例

本文整理汇总了Java中com.intellij.ui.ColoredTextContainer.setIcon方法的典型用法代码示例。如果您正苦于以下问题:Java ColoredTextContainer.setIcon方法的具体用法?Java ColoredTextContainer.setIcon怎么用?Java ColoredTextContainer.setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.ColoredTextContainer的用法示例。


在下文中一共展示了ColoredTextContainer.setIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
  if (myPosition == null) {
    component.append("<frame not available>", SimpleTextAttributes.GRAY_ATTRIBUTES);
    return;
  }
  final VirtualFile file = myPosition.getFile();
  String frameName = myFrameInfo.getName();
  component.setIcon(MODULE.equals(frameName) ? PythonPsiApiIcons.PythonFile : PythonEducationalIcons.Field);
  if (MODULE.equals(frameName)) {
    component.append(GLOBAL_FRAME, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(" (" + file.getName() + ")", getGrayAttributes(SimpleTextAttributes.REGULAR_ATTRIBUTES));
  }
  else {
    component.append(frameName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PyEduStackFrame.java

示例2: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
  component.setIcon(AllIcons.Debugger.StackFrame);
  String functionName = frame.getFunction();
  String className = "";
  String packageName = "";

  int lastDot = frame.getFunction().lastIndexOf('.');
  if (lastDot > 0 && lastDot < functionName.length() - 1) {
    functionName = functionName.substring(lastDot + 1);
    className = frame.getFunction().substring(0, lastDot);
    int classNameDot = className.lastIndexOf('.');
    if (classNameDot > 0 && classNameDot < className.length() - 1) {
      className = className.substring(classNameDot + 1);
      packageName = frame.getFunction().substring(0, classNameDot);
    }
  }
  component.append(
      functionName + "():" + frame.getLocation().getLine().toString() + ", " + className,
      sourcePosition != null
          ? SimpleTextAttributes.REGULAR_ATTRIBUTES
          : SimpleTextAttributes.GRAYED_ATTRIBUTES);
  component.append(" (" + packageName + ")", SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:25,代码来源:CloudStackFrame.java

示例3: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(ColoredTextContainer component)
{
	TextStreamPosition statementStartPosition = myCallFrame.getStatementStartPosition();

	XSourcePosition position = getSourcePosition();
	if(position != null)
	{
		component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
	}
	else
	{
		component.append(myCallFrame.getScript().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
	}

	component.append(":" + (statementStartPosition.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
	component.setIcon(AllIcons.Debugger.StackFrame);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:19,代码来源:V8StackFrame.java

示例4: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component)
{
	StackFrameDescriptorImpl selectedDescriptor = null;
	DebuggerSession session = myDebugProcess.getSession();
	if(session != null)
	{
		XDebugSession xSession = session.getXDebugSession();
		if(xSession != null)
		{
			XStackFrame frame = xSession.getCurrentStackFrame();
			if(frame instanceof JavaStackFrame)
			{
				selectedDescriptor = ((JavaStackFrame) frame).getDescriptor();
			}
		}
	}
	FRAME_RENDERER.customizePresentation(myDescriptor, component, selectedDescriptor);
	if(myInsertCapturePoint != null)
	{
		component.setIcon(XDebuggerUIConstants.INFORMATION_MESSAGE_ICON);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:24,代码来源:JavaStackFrame.java

示例5: renderDeviceName

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
static void renderDeviceName(@NotNull IDevice d, @NotNull ColoredTextContainer component) {
    component.setIcon(d.isEmulator() ? AndroidIcons.Ddms.Emulator2 : AndroidIcons.Ddms.RealDevice);
    String name;
    if (d.isEmulator()) {
        String avdName = d.getAvdName();
        if (avdName == null) {
            avdName = "unknown";
        }

        name = String.format(" %1$s %2$s ", "Emulator", avdName);
    } else {
        name = String.format(" %1$s ", DevicePropertyUtil.getModel(d, ""));
    }

    component.append(d.getSerialNumber(), SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
    component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);

    IDevice.DeviceState deviceState = d.getState();
    if (deviceState != IDevice.DeviceState.ONLINE) {
        String state = String.format("[%1$s] ", d.getState());
        component.append(state, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
    }


    if (deviceState != IDevice.DeviceState.DISCONNECTED && deviceState != IDevice.DeviceState.OFFLINE) {
        component.append(DevicePropertyUtil.getBuild(d), SimpleTextAttributes.GRAY_ATTRIBUTES);
    }

}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:30,代码来源:LogSourcePanel.java

示例6: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
public void customizePresentation(@NotNull ColoredTextContainer component) {
    if (mySourcePosition != null) {
        super.customizePresentation(component);

        if (contextName != null){
            component.append(String.format(" (%s)", contextName), SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
        }
    } else {
        component.append("<internal C>", SimpleTextAttributes.GRAYED_ATTRIBUTES);
        component.setIcon(AllIcons.Debugger.StackFrame);
    }
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:13,代码来源:LuaStackFrame.java

示例7: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
/**
 * Customize presentation of the stack frame in frames list
 * @param component component
 */
public void customizePresentation(@NotNull ColoredTextContainer component) {
  XSourcePosition position = getSourcePosition();
  if (position != null) {
    component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(":" + (position.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.setIcon(AllIcons.Debugger.StackFrame);
  }
  else {
    component.append(XDebuggerBundle.message("invalid.frame"), SimpleTextAttributes.ERROR_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:XStackFrame.java

示例8: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
  component.setIcon(AllIcons.Debugger.StackFrame);

  if (myPosition == null) {
    component.append("<frame not available>", SimpleTextAttributes.GRAY_ATTRIBUTES);
    return;
  }

  boolean isExternal = true;
  final VirtualFile file = myPosition.getFile();
  AccessToken lock = ApplicationManager.getApplication().acquireReadActionLock();
  try {
    final Document document = FileDocumentManager.getInstance().getDocument(file);
    if (document != null) {
      isExternal = !ProjectRootManager.getInstance(myProject).getFileIndex().isInContent(file);
    }
  }
  finally {
    lock.finish();
  }

  component.append(myFrameInfo.getName(), gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
  component.append(", ", gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
  component.append(myPosition.getFile().getName(), gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
  component.append(":", gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
  component.append(Integer.toString(myPosition.getLine() + 1), gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:PyStackFrame.java

示例9: renderDeviceName

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
static void renderDeviceName(IDevice d, ColoredTextContainer component, AvdManager avdManager) {
  component.setIcon(d.isEmulator() ? AndroidIcons.Ddms.Emulator2 : AndroidIcons.Ddms.RealDevice);

  String name;
  if (d.isEmulator()) {
    String avdName = d.getAvdName();
    if (avdManager != null) {
      AvdInfo info = avdManager.getAvd(avdName, true);
      if (info != null) {
        avdName = info.getProperties().get(AvdManagerConnection.AVD_INI_DISPLAY_NAME);
      }
    }
    if (avdName == null) {
      avdName = "unknown";
    }
    name = String.format("%1$s %2$s ", AndroidBundle.message("android.emulator"), avdName);
  }
  else {
    name = String.format("%1$s %2$s ", DevicePropertyUtil.getManufacturer(d, ""), DevicePropertyUtil.getModel(d, ""));
  }

  component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (d.getState() != IDevice.DeviceState.ONLINE) {
    String state = String.format("%1$s [%2$s] ", d.getSerialNumber(), d.getState());
    component.append(state, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
  }

  component.append(DevicePropertyUtil.getBuild(d), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:DeviceRenderer.java

示例10: renderCloudDeviceName

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
private static void renderCloudDeviceName(IDevice device, ColoredTextContainer component,
                                          @NotNull CloudConfigurationProvider cloudConfigurationProvider) {
  component.setIcon(cloudConfigurationProvider.getCloudDeviceIcon());
  String cloudDeviceConfiguration = cloudConfigurationProvider.getCloudDeviceConfiguration(device);
  if (device.getState() == IDevice.DeviceState.OFFLINE) {
    component.append("Launching " + cloudDeviceConfiguration, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
  }
  else {
    component.append(cloudDeviceConfiguration, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DeviceRenderer.java

示例11: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  if (myPosition == null || myFrame.getLocation().getFunctionName().equals(MAIN_FUNCTION_NAME)) {
    super.customizePresentation(component);
  }
  else {
    component.append(getPresentationText(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.setIcon(AllIcons.Debugger.StackFrame);
  }
}
 
开发者ID:ktisha,项目名称:TheRPlugin,代码行数:11,代码来源:TheRXStackFrame.java

示例12: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
/**
 * Customize presentation of the stack frame in frames list
 * @param component component
 */
public void customizePresentation(ColoredTextContainer component) {
  XSourcePosition position = getSourcePosition();
  if (position != null) {
    component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(":" + (position.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.setIcon(AllIcons.Debugger.StackFrame);
  }
  else {
    component.append(XDebuggerBundle.message("invalid.frame"), SimpleTextAttributes.ERROR_ATTRIBUTES);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:XStackFrame.java

示例13:

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
public void customizePresentation
  (@NotNull ColoredTextContainer component) {
  SimpleTextAttributes attr = (mSourcePosition == null) ?
                              SimpleTextAttributes.GRAYED_ATTRIBUTES :
                              SimpleTextAttributes.REGULAR_ATTRIBUTES;

  component.append(mClassAndFunctionName + "  [" + mFileName +
                   ":" + mLineNumber + "]", attr);
  component.setIcon(AllIcons.Debugger.StackFrame);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:11,代码来源:HaxeDebugRunner.java

示例14: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
    XSourcePosition position = this.getSourcePosition();
    if(position != null) {
        component.append(where != null && !"".equals(where) ? where + "()" : "<main>()", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        component.append(":" + (lineNumber) +", ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
        component.append("(" + position.getFile().getPath() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
        component.setIcon(AllIcons.Debugger.StackFrame);
    } else {
        component.append(XDebuggerBundle.message("invalid.frame", new Object[0]), SimpleTextAttributes.ERROR_ATTRIBUTES);
    }

}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:15,代码来源:XQueryStackFrame.java

示例15: customizePresentation

import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component)
{
	component.setIcon(JBUI.scale(EmptyIcon.create(6)));
	component.append(String.format("%s:%d, %s", myMethodName, myLineNumber, StringUtil.getShortName(myPath)), getAttributes());
	String packageName = StringUtil.getPackageName(myPath);
	if(!packageName.trim().isEmpty())
	{
		component.append(String.format(" (%s)", packageName), SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:StackFrameItem.java


注:本文中的com.intellij.ui.ColoredTextContainer.setIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。