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


Java CopyPasteManager.CUT_COLOR属性代码示例

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:AbstractTreeNode.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:TodoDirNode.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:SmartElementDescriptor.java

示例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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:AbstractTreeNode.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:SmartElementDescriptor.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:SmartElementDescriptor.java

示例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");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:TodoPackageNode.java

示例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");
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:52,代码来源:TodoPackageNode.java


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