本文整理汇总了Java中com.intellij.ui.SimpleColoredText类的典型用法代码示例。如果您正苦于以下问题:Java SimpleColoredText类的具体用法?Java SimpleColoredText怎么用?Java SimpleColoredText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleColoredText类属于com.intellij.ui包,在下文中一共展示了SimpleColoredText类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getItemName
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Nullable
@Override
public SimpleColoredText getItemName(final Object element, final DiagramState diagramState) {
return element instanceof ModuleDepDiagramItem
? new SimpleColoredText(((ModuleDepDiagramItem) element).getName(), DEFAULT_TITLE_ATTR)
: null;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:ModuleDepDiagramElementManager.java
示例2: showHint
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
private void showHint(final SimpleColoredText text, final WatchItemDescriptor descriptor) {
DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
@Override
public void run() {
if(!isHintHidden()) {
JComponent component;
if (!isActiveTooltipApplicable(descriptor.getValue())) {
component = HintUtil.createInformationLabel(text);
}
else {
component = createExpandableHintComponent(text, new Runnable() {
@Override
public void run() {
final DebuggerContextImpl debuggerContext = DebuggerManagerEx.getInstanceEx(getProject()).getContext();
final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
debugProcess.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
@Override
public void threadAction() {
descriptor.setRenderer(debugProcess.getAutoRenderer(descriptor));
final String expressionText = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
@Override
public String compute() {
return myCurrentExpression.getText();
}
});
createAndShowTree(expressionText, descriptor);
}
});
}
});
}
if (!showHint(component)) return;
if(getType() == ValueHintType.MOUSE_CLICK_HINT) {
HintUtil.createInformationLabel(text).requestFocusInWindow();
}
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ValueHint.java
示例3: propertyChange
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
final Object newValue = evt.getNewValue();
final Object oldValue = evt.getOldValue();
boolean affectsDebugger = false;
if (newValue instanceof Component && isInsideDebuggerDialog((Component)newValue)) {
affectsDebugger |= true;
}
if (oldValue instanceof Component && isInsideDebuggerDialog((Component)oldValue)) {
affectsDebugger |= true;
}
final SimpleColoredText text = new SimpleColoredText();
text.append(evt.getPropertyName(), maybeGrayOut(new SimpleTextAttributes(SimpleTextAttributes.STYLE_UNDERLINE, null), affectsDebugger));
text.append(" newValue=", maybeGrayOut(SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES, affectsDebugger));
text.append(evt.getNewValue() + "", maybeGrayOut(SimpleTextAttributes.REGULAR_ATTRIBUTES, affectsDebugger));
text.append(" oldValue=" + evt.getOldValue(), maybeGrayOut(SimpleTextAttributes.REGULAR_ATTRIBUTES, affectsDebugger));
myLogModel.addElement(new FocusElement(text, new Throwable()));
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (myLog != null && myLog.isShowing()) {
final int h = myLog.getFixedCellHeight();
myLog.scrollRectToVisible(new Rectangle(0, myLog.getPreferredSize().height - h, myLog.getWidth(), h));
if (myLog.getModel().getSize() > 0) {
myLog.setSelectedIndex(myLog.getModel().getSize() - 1);
}
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:FocusDebugger.java
示例4: customizeCellRenderer
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Override
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
clear();
final FocusElement element = (FocusElement)value;
final SimpleColoredText text = element.getText();
final ArrayList<String> strings = text.getTexts();
final ArrayList<SimpleTextAttributes> attributes = element.getText().getAttributes();
for (int i = 0; i < strings.size(); i++) {
append(strings.get(i), attributes.get(i));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FocusDebugger.java
示例5: testDeviceNameRendering1
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
public void testDeviceNameRendering1() throws Exception {
String serial = "123";
IDevice d = createDevice(false, null, "google", "nexus 4", "4.2", "17", serial, IDevice.DeviceState.ONLINE);
SimpleColoredText target = new SimpleColoredText();
DeviceRenderer.renderDeviceName(d, target);
String name = target.toString();
assertTrue(StringUtil.containsIgnoreCase(name, "Nexus 4 Android 4.2 (API 17)"));
// status should be shown only if !online
assertFalse(StringUtil.containsIgnoreCase(name, IDevice.DeviceState.ONLINE.toString()));
// serial should be shown only if !online
assertFalse(StringUtil.containsIgnoreCase(name, serial));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DeviceRendererTest.java
示例6: testDeviceNameRendering2
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
public void testDeviceNameRendering2() throws Exception {
String serial = "123";
IDevice d = createDevice(true, "Avdname", "google", "nexus 4", "4.2", "17", serial, IDevice.DeviceState.BOOTLOADER);
SimpleColoredText target = new SimpleColoredText();
DeviceRenderer.renderDeviceName(d, target);
String name = target.toString();
assertFalse(StringUtil.containsIgnoreCase(name, "Nexus 4"));
assertTrue(StringUtil.containsIgnoreCase(name, "Avdname"));
assertTrue(StringUtil.containsIgnoreCase(name, IDevice.DeviceState.BOOTLOADER.toString()));
assertTrue(StringUtil.containsIgnoreCase(name, serial));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DeviceRendererTest.java
示例7: setupPresentation
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Override
public void setupPresentation(final BaseInjection injection, final SimpleColoredText presentation, final boolean isSelected) {
final Matcher matcher = ourPresentationPattern.matcher(injection.getDisplayName());
if (matcher.matches()) {
presentation.append(matcher.group(1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
presentation.append(matcher.group(2), isSelected ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.GRAY_ATTRIBUTES);
}
else {
super.setupPresentation(injection, presentation, isSelected);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavaLanguageInjectionSupport.java
示例8: getItemName
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Nullable
@Override
public SimpleColoredText getItemName(Object o, DiagramState diagramState) {
if (o instanceof PsiNamedElement) {
PsiNamedElement namedElement = (PsiNamedElement) o;
final String itemName, itemType;
if (namedElement instanceof SchemaFieldDecl) {
SchemaFieldDecl fieldDecl = (SchemaFieldDecl) namedElement;
itemName = fieldDecl.getQid().getCanonicalName();
SchemaValueTypeRef valueTypeRef = fieldDecl.getValueTypeRef();
itemType = valueTypeRef == null ? null : valueTypeRef.getTypeRef().getText();
} else if (namedElement instanceof SchemaEntityTagDecl) {
SchemaEntityTagDecl tagDecl = (SchemaEntityTagDecl) namedElement;
itemName = tagDecl.getQid().getCanonicalName();
SchemaTypeRef typeRef = tagDecl.getTypeRef();
itemType = typeRef == null ? null : typeRef.getText();
} else {
itemName = namedElement.getName();
if (itemName == null) return null;
itemType = null;
}
SimpleColoredText res = new SimpleColoredText(itemName, DEFAULT_TITLE_ATTR);
if (itemType != null) res.append(" : " + itemType, DEFAULT_TEXT_ATTR);
return res;
}
return null;
}
开发者ID:SumoLogic,项目名称:epigraph,代码行数:38,代码来源:SchemaDiagramElementManager.java
示例9: getItemName
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Nullable
@Override
public SimpleColoredText getItemName(Object o, DiagramState state) {
if (o instanceof PsiElement) {
return new SimpleColoredText(getElementTitle((PsiElement) o), DEFAULT_TEXT_ATTR);
} else {
return null;
}
}
开发者ID:Stefku,项目名称:intellij-reference-diagram,代码行数:10,代码来源:ReferenceDiagramElementManager.java
示例10: showHint
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
private void showHint(final SimpleColoredText text, final WatchItemDescriptor descriptor) {
DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
public void run() {
if(!isHintHidden()) {
JComponent component;
if (!isActiveTooltipApplicable(descriptor.getValue())) {
component = HintUtil.createInformationLabel(text);
}
else {
component = createExpandableHintComponent(text, new Runnable() {
public void run() {
final DebuggerContextImpl debuggerContext = DebuggerManagerEx.getInstanceEx(getProject()).getContext();
final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
debugProcess.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
public void threadAction() {
descriptor.setRenderer(debugProcess.getAutoRenderer(descriptor));
final InspectDebuggerTree tree = getInspectTree(descriptor);
final String expressionText = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
@Override
public String compute() {
return myCurrentExpression.getText();
}
});
showTreePopup(tree, debuggerContext, expressionText,
new ValueHintTreeComponent(ValueHint.this, tree, expressionText));
}
});
}
});
}
if (!showHint(component)) return;
if(getType() == ValueHintType.MOUSE_CLICK_HINT) {
HintUtil.createInformationLabel(text).requestFocusInWindow();
}
}
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:39,代码来源:ValueHint.java
示例11: append
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Override
public void append(String value, SimpleColoredText text, boolean changed) {
SimpleTextAttributes attributes = SimpleTextAttributes.fromTextAttributes(EditorColorsManager.getInstance().getGlobalScheme().getAttributes(DefaultLanguageHighlighterColors.STRING));
text.append("\"", attributes);
doAppend(value, text, attributes);
text.append("\"", attributes);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:StringValuePresenter.java
示例12: doShowHint
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
private void doShowHint(final XValue xValue, final String separator, final String value, String type,
@NotNull XValuePresenter valuePresenter, final boolean hasChildren) {
if (isHintHidden()) return;
SimpleColoredText text = new SimpleColoredText();
text.append(myExpression, XDebuggerUIConstants.VALUE_NAME_ATTRIBUTES);
text.append(separator, SimpleTextAttributes.REGULAR_ATTRIBUTES);
if (type != null) {
text.append("{" + type + "} ", XDebuggerUIConstants.TYPE_ATTRIBUTES);
}
valuePresenter.append(value, text, false);
if (!hasChildren) {
showHint(HintUtil.createInformationLabel(text));
}
else if (getType() == ValueHintType.MOUSE_CLICK_HINT) {
showTree(xValue, myExpression);
}
else {
JComponent component = createExpandableHintComponent(text, new Runnable() {
public void run() {
showTree(xValue, myExpression);
}
});
showHint(component);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:XValueHint.java
示例13: setText
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
public void setText(final SimpleColoredText text) {
myLabel.change(() -> {
myLabel.clear();
if (text != null) {
SimpleColoredText derive = myTabs.useBoldLabels() ? text.derive(SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES, true) : text;
derive.appendToComponent(myLabel);
}
}, false);
invalidateIfNeeded();
}
开发者ID:JetBrains,项目名称:jediterm,代码行数:13,代码来源:TabLabel.java
示例14: createExpandableHintComponent
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
protected JComponent createExpandableHintComponent(final SimpleColoredText text, final Runnable expand) {
final JComponent component = HintUtil.createInformationLabel(text, IconUtil.getAddIcon());
addClickListenerToHierarchy(component, new ClickListener() {
@Override
public boolean onClick(@Nonnull MouseEvent event, int clickCount) {
if (myCurrentHint != null) {
myCurrentHint.hide();
}
expand.run();
return true;
}
});
return component;
}
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:AbstractValueHint.java
示例15: customizeCellRenderer
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Override
public void customizeCellRenderer(@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
{
final DebuggerTreeNodeImpl node = (DebuggerTreeNodeImpl) value;
if(node != null)
{
final SimpleColoredText text = node.getText();
if(text != null)
{
text.appendToComponent(this);
}
setIcon(node.getIcon());
}
}
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:DebuggerTreeRenderer.java
示例16: getItemName
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@Nullable
@Override
public SimpleColoredText getItemName(final Object o, final DiagramState diagramState) {
return null;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:6,代码来源:BpDiagramElementManagerIml.java
示例17: getText
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
public SimpleColoredText getText() {
return myText;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DebuggerTreeNodeImpl.java
示例18: getColoredText
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
public SimpleColoredText getColoredText() {
return myText;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TabInfo.java
示例19: getText
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
@NotNull
public SimpleColoredText getText() {
return myText;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XDebuggerTreeNode.java
示例20: FocusElement
import com.intellij.ui.SimpleColoredText; //导入依赖的package包/类
FocusElement(SimpleColoredText text, Throwable allocation) {
myText = text;
myAllocation = allocation;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FocusDebugger.java
注:本文中的com.intellij.ui.SimpleColoredText类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论