本文整理汇总了Java中com.intellij.ide.projectView.PresentationData.setChanged方法的典型用法代码示例。如果您正苦于以下问题:Java PresentationData.setChanged方法的具体用法?Java PresentationData.setChanged怎么用?Java PresentationData.setChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.PresentationData
的用法示例。
在下文中一共展示了PresentationData.setChanged方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
protected void update(PresentationData presentation) {
Object newElement = updateElement();
if (getElement() != newElement) {
presentation.setChanged(true);
}
if (newElement == null) return;
Color oldColor = myColor;
String oldName = myName;
Icon oldIcon = getIcon();
List<ColoredFragment> oldFragments = new ArrayList<ColoredFragment>(presentation.getColoredText());
myColor = UIUtil.getTreeTextForeground();
updateFileStatus();
doUpdate();
myName = getName();
presentation.setPresentableText(myName);
presentation.setChanged(!Comparing.equal(new Object[]{getIcon(), myName, oldFragments, myColor},
new Object[]{oldIcon, oldName, oldFragments, oldColor}));
presentation.setForcedTextForeground(myColor);
presentation.setIcon(getIcon());
}
示例2: doCreateDescriptor
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
@NotNull
public NodeDescriptor doCreateDescriptor(final Object element, final NodeDescriptor parentDescriptor) {
return new PresentableNodeDescriptor(null, parentDescriptor) {
@Override
protected void update(PresentationData presentation) {
onElementAction("update", (NodeElement)element);
presentation.clear();
presentation.addText(new ColoredFragment(getElement().toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES));
if (myChanges.contains(element)) {
myChanges.remove(element);
presentation.setChanged(true);
}
}
@Nullable
@Override
public PresentableNodeDescriptor getChildToHighlightAt(int index) {
return null;
}
@Override
public Object getElement() {
return element;
}
@Override
public String toString() {
List<ColoredFragment> coloredText = getPresentation().getColoredText();
StringBuilder result = new StringBuilder();
for (ColoredFragment each : coloredText) {
result.append(each.getText());
}
return result.toString();
}
};
}
示例3: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
if (presentation != null) {
presentation.setChanged(presentation.isChanged() || changed);
changed = false;
}
}