本文整理汇总了Java中com.intellij.openapi.ide.CopyPasteManager.CUT_COLOR属性的典型用法代码示例。如果您正苦于以下问题:Java CopyPasteManager.CUT_COLOR属性的具体用法?Java CopyPasteManager.CUT_COLOR怎么用?Java CopyPasteManager.CUT_COLOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.ide.CopyPasteManager
的用法示例。
在下文中一共展示了CopyPasteManager.CUT_COLOR属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setForcedForeground
protected void setForcedForeground(@NotNull PresentationData presentation) {
final FileStatus status = getFileStatus();
Color fgColor = getFileStatusColor(status);
fgColor = fgColor == null ? status.getColor() : fgColor;
if (valueIsCut()) {
fgColor = CopyPasteManager.CUT_COLOR;
}
if (presentation.getForcedTextForeground() == null) {
presentation.setForcedTextForeground(fgColor);
}
}
示例2: updateImpl
@Override
protected void updateImpl(PresentationData data) {
super.updateImpl(data);
int fileCount = getFileCount(getValue());
if (getValue() == null || !getValue().isValid() || fileCount == 0) {
setValue(null);
return;
}
VirtualFile directory = getValue().getVirtualFile();
boolean isProjectRoot = !ProjectRootManager.getInstance(getProject()).getFileIndex().isInContent(directory);
String newName = isProjectRoot || getStructure().getIsFlattenPackages() ? getValue().getVirtualFile().getPresentableUrl() : getValue().getName();
int nameEndOffset = newName.length();
int todoItemCount = getTodoItemCount(getValue());
newName = IdeBundle.message("node.todo.group", newName, todoItemCount, fileCount);
myHighlightedRegions.clear();
TextAttributes textAttributes = new TextAttributes();
Color newColor = FileStatusManager.getInstance(getProject()).getStatus(getValue().getVirtualFile()).getColor();
if (CopyPasteManager.getInstance().isCutElement(getValue())) {
newColor = CopyPasteManager.CUT_COLOR;
}
textAttributes.setForegroundColor(newColor);
myHighlightedRegions.add(new HighlightedRegion(0, nameEndOffset, textAttributes));
EditorColorsScheme colorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
myHighlightedRegions.add(
new HighlightedRegion(nameEndOffset, newName.length(), colorsScheme.getAttributes(UsageTreeColors.NUMBER_OF_USAGES)));
data.setPresentableText(newName);
}
示例3: update
@Override
public boolean update() {
PsiElement element = mySmartPointer.getElement();
if (element == null) return true;
int flags = Iconable.ICON_FLAG_VISIBILITY;
if (isMarkReadOnly()){
flags |= Iconable.ICON_FLAG_READ_STATUS;
}
Icon icon = null;
try {
icon = element.getIcon(flags);
}
catch (IndexNotReadyException ignored) {
}
Color color = null;
if (isMarkModified() ){
VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
if (virtualFile != null) {
color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
}
}
if (CopyPasteManager.getInstance().isCutElement(element)) {
color = CopyPasteManager.CUT_COLOR;
}
boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
setIcon(icon);
myColor = color;
return changes;
}
示例4: setForcedForeground
protected void setForcedForeground(PresentationData presentation) {
final FileStatus status = getFileStatus();
Color fgColor = getFileStatusColor(status);
fgColor = fgColor == null ? status.getColor() : fgColor;
if (valueIsCut()) {
fgColor = CopyPasteManager.CUT_COLOR;
}
if (presentation.getForcedTextForeground() == null) {
presentation.setForcedTextForeground(fgColor);
}
}
示例5: update
@Override
public boolean update() {
myElement = mySmartPointer.getElement();
if (myElement == null) return true;
int flags = Iconable.ICON_FLAG_VISIBILITY;
if (isMarkReadOnly()){
flags |= Iconable.ICON_FLAG_READ_STATUS;
}
Icon icon = null;
try {
icon = myElement.getIcon(flags);
}
catch (IndexNotReadyException e) {
}
Color color = null;
if (isMarkModified() ){
VirtualFile virtualFile = PsiUtilBase.getVirtualFile(myElement);
if (virtualFile != null) {
color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
}
}
if (CopyPasteManager.getInstance().isCutElement(myElement)) {
color = CopyPasteManager.CUT_COLOR;
}
boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
setIcon(icon);
myColor = color;
return changes;
}
示例6: update
@RequiredDispatchThread
@Override
public boolean update() {
PsiElement element = mySmartPointer.getElement();
if (element == null) return true;
int flags = Iconable.ICON_FLAG_VISIBILITY;
if (isMarkReadOnly()){
flags |= Iconable.ICON_FLAG_READ_STATUS;
}
Icon icon = null;
try {
icon = IconDescriptorUpdaters.getIcon(element, flags);
}
catch (IndexNotReadyException ignored) {
}
Color color = null;
if (isMarkModified() ){
VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
if (virtualFile != null) {
color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
}
}
if (CopyPasteManager.getInstance().isCutElement(element)) {
color = CopyPasteManager.CUT_COLOR;
}
boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
setIcon(icon);
myColor = color;
return changes;
}
示例7: update
@Override
protected void update(PresentationData data) {
super.update(data);
final PackageElement packageElement = getValue();
try {
if (packageElement == null || !packageElement.getPackage().isValid()) {
setValue(null);
return;
}
int fileCount = getFileCount(packageElement);
if (fileCount == 0){
setValue(null);
return;
}
PsiPackage aPackage = packageElement.getPackage();
String newName;
if (getStructure().areFlattenPackages()) {
newName = aPackage.getQualifiedName();
}
else {
newName = myPresentationName != null ? myPresentationName : "";
}
int nameEndOffset = newName.length();
int todoItemCount = getTodoItemCount(packageElement);
newName = IdeBundle.message("node.todo.group", newName, todoItemCount, fileCount);
myHighlightedRegions.clear();
TextAttributes textAttributes = new TextAttributes();
Color newColor = null;
if (CopyPasteManager.getInstance().isCutElement(packageElement)) {
newColor = CopyPasteManager.CUT_COLOR;
}
textAttributes.setForegroundColor(newColor);
myHighlightedRegions.add(new HighlightedRegion(0, nameEndOffset, textAttributes));
EditorColorsScheme colorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
myHighlightedRegions.add(
new HighlightedRegion(nameEndOffset, newName.length(), colorsScheme.getAttributes(UsageTreeColors.NUMBER_OF_USAGES)));
data.setPresentableText(newName);
}
catch (IndexNotReadyException e) {
LOG.info(e);
data.setPresentableText("N/A");
}
}
示例8: update
@Override
protected void update(PresentationData data) {
super.update(data);
final PackageElement packageElement = getValue();
try {
if (packageElement == null || !packageElement.getPackage().isValid()) {
setValue(null);
return;
}
int fileCount = getFileCount(packageElement);
if (fileCount == 0){
setValue(null);
return;
}
PsiPackage aPackage = packageElement.getPackage();
String newName;
if (getStructure().areFlattenPackages()) {
newName = aPackage.getQualifiedName();
}
else {
newName = myPresentationName != null ? myPresentationName : "";
}
int nameEndOffset = newName.length();
int todoItemCount = getTodoItemCount(packageElement);
newName = IdeBundle.message("node.todo.group", newName, todoItemCount, fileCount);
myHighlightedRegions.clear();
TextAttributes textAttributes = new TextAttributes();
Color newColor = null;
if (CopyPasteManager.getInstance().isCutElement(packageElement)) {
newColor = CopyPasteManager.CUT_COLOR;
}
textAttributes.setForegroundColor(newColor);
myHighlightedRegions.add(new HighlightedRegion(0, nameEndOffset, textAttributes));
EditorColorsScheme colorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
myHighlightedRegions.add(
new HighlightedRegion(nameEndOffset, newName.length(), colorsScheme.getAttributes(UsageTreeColors.NUMBER_OF_USAGES)));
data.setPresentableText(newName);
}
catch (IndexNotReadyException e) {
ProjectViewNode.LOG.info(e);
data.setPresentableText("N/A");
}
}