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


Java PlatformColors.BLUE属性代码示例

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


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

示例1: addAction

public void addAction(final Action action) {
  action.addPropertyChangeListener(this);
  final LinkLabel label = new LinkLabel(null, null, new LinkListener() {
    @Override
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      action.actionPerformed(new ActionEvent(Banner.this, ActionEvent.ACTION_PERFORMED, Action.ACTION_COMMAND_KEY));
    }
  }) {
    @Override
    protected Color getTextColor() {
      return PlatformColors.BLUE;
    }
  };
  label.setFont(label.getFont().deriveFont(Font.BOLD));
  myActions.put(action, label);
  myActionsPanel.add(label);
  updateAction(action);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:Banner.java

示例2: addAction

public void addAction(final Action action) {
  action.addPropertyChangeListener(this);
  final LinkLabel label = new LinkLabel(null, null, new LinkListener() {
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      action.actionPerformed(new ActionEvent(Banner.this, ActionEvent.ACTION_PERFORMED, Action.ACTION_COMMAND_KEY));
    }
  }) {
    @Override
    protected Color getTextColor() {
      return PlatformColors.BLUE;
    }
  };
  label.setFont(label.getFont().deriveFont(Font.BOLD));
  myActions.put(action, label);
  myActionsPanel.add(label);
  updateAction(action);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:Banner.java

示例3: HyperlinkLabel

public HyperlinkLabel(String text) {
  this(text,
       PlatformColors.BLUE,
       new JBColor(new NotNullProducer<Color>() {
         @NotNull
         @Override
         public Color produce() {
           return UIUtil.getLabelBackground();
         }
       }),
       PlatformColors.BLUE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:HyperlinkLabel.java

示例4: createActionLabel

public HyperlinkLabel createActionLabel(final String text, final Runnable action) {
  HyperlinkLabel label = new HyperlinkLabel(text, PlatformColors.BLUE, getBackground(), PlatformColors.BLUE);
  label.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      action.run();
    }
  });
  myLinksPanel.add(label);
  return label;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:EditorNotificationPanel.java

示例5: createActionLabel

public HyperlinkLabel createActionLabel(final String text, final Runnable action) {
  HyperlinkLabel label = new HyperlinkLabel(text, PlatformColors.BLUE, getBackground(), PlatformColors.BLUE);
  label.addHyperlinkListener(new HyperlinkListener() {
    public void hyperlinkUpdate(final HyperlinkEvent e) {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        action.run();
      }
    }
  });
  myLinksPanel.add(label);
  return label;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:EditorNotificationPanel.java

示例6: customizeRenderer

/**
 * Renders checkbox tree cell filled with @{link TemplateTreeNode} data.
 *
 * @param tree     current working tree
 * @param value    template data
 * @param selected node is selected
 * @param expanded node is expanded
 * @param leaf     node is a leaf
 * @param row      node is a row
 * @param hasFocus node has focus
 */
public void customizeRenderer(final JTree tree, final Object value, final boolean selected, final boolean expanded,
                              final boolean leaf, final int row, final boolean hasFocus) {
    if (!(value instanceof TemplateTreeNode)) {
        return;
    }
    TemplateTreeNode node = (TemplateTreeNode) value;

    final Color background = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();
    UIUtil.changeBackGround(this, background);
    Color foreground = selected ? UIUtil.getTreeSelectionForeground() : node.getTemplate() == null ?
            PlatformColors.BLUE : UIUtil.getTreeTextForeground();
    int style = SimpleTextAttributes.STYLE_PLAIN;

    String text = "", hint = "";
    if (node.getTemplate() != null) { // template leaf
        text = node.getTemplate().getName();
    } else if (node.getContainer() != null) { // container group
        hint = IgnoreBundle.message("template.container." + node.getContainer().toString().toLowerCase());
        getCheckbox().setVisible(false);
    }

    SearchUtil.appendFragments(getFilter(), text, style, foreground, background, getTextRenderer());
    getTextRenderer().append(hint, selected ? new SimpleTextAttributes(Font.PLAIN, foreground) :
            SimpleTextAttributes.GRAYED_ATTRIBUTES);
    setForeground(foreground);
}
 
开发者ID:hsz,项目名称:idea-gitignore,代码行数:37,代码来源:TemplateTreeRenderer.java

示例7: HoverHyperlinkLabel

public HoverHyperlinkLabel(String text) {
  this(text, PlatformColors.BLUE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:HoverHyperlinkLabel.java

示例8: HyperlinkLabel

public HyperlinkLabel(String text) {
  this(text,
       PlatformColors.BLUE,
       UIUtil.getLabelBackground(),
       PlatformColors.BLUE);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:HyperlinkLabel.java

示例9: getTreeCellRendererComponent

@Override
public Component getTreeCellRendererComponent(JTree tree,
                                              Object value,
                                              boolean selected,
                                              boolean expanded,
                                              boolean leaf,
                                              int row,
                                              boolean hasFocus) {
  Color foreground = selected ? UIUtil.getTreeSelectionForeground() : UIUtil.getTreeForeground();
  Color background = selected ? UIUtil.getTreeSelectionBackground() : null; 
  if (value instanceof HierarchyTree.ComponentNode) {
    HierarchyTree.ComponentNode componentNode = (HierarchyTree.ComponentNode)value;
    Component component = componentNode.getOwnComponent();
    String name = component.getName();
    if (StringUtil.isEmpty(name)) {
      name = component.getClass().getSimpleName();
      if (name.isEmpty()) {
        name = component.getClass().getSuperclass().getSimpleName();
      }
    }
    
    if (!selected) {
      if (!component.isVisible()) {
        foreground = Color.GRAY;
      } else if (component.getWidth() == 0 || component.getHeight() == 0) {
        foreground = new Color(128, 10, 0);
      } else if (component.getPreferredSize() != null &&
                 (component.getSize().width < component.getPreferredSize().width
                  || component.getSize().height < component.getPreferredSize().height)) {
        foreground = PlatformColors.BLUE;
      }
      
      if (componentNode.getToSelect() == componentNode.getOwnComponent()) {
        background = new Color(31, 128, 8, 58);
      }
    }
    setText(name);
  }
  
  setForeground(foreground);
  setBackground(background);
  
  return this;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:44,代码来源:UiInspectorAction.java

示例10: customizeRenderer

@Override
public void customizeRenderer(final JTree tree,
                                  final Object value,
                                  final boolean selected,
                                  final boolean expanded,
                                  final boolean leaf,
                                  final int row,
                                  final boolean hasFocus) {
  if (!(value instanceof InspectionConfigTreeNode)) return;
  InspectionConfigTreeNode node = (InspectionConfigTreeNode)value;

  Object object = node.getUserObject();

  final Color background = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();
  UIUtil.changeBackGround(this, background);
  Color foreground =
    selected ? UIUtil.getTreeSelectionForeground() : node.isProperSetting() ? PlatformColors.BLUE : UIUtil.getTreeTextForeground();

  @NonNls String text;
  int style = SimpleTextAttributes.STYLE_PLAIN;
  String hint = null;
  if (object instanceof String) {
    text = (String)object;
    style = SimpleTextAttributes.STYLE_BOLD;
  }
  else {
    final Descriptor descriptor = node.getDescriptor();
    final String scopeName = node.getScopeName();
    if (scopeName != null) {
      if (node.isByDefault()) {
        text = "Everywhere else";
      }
      else {
        text = "In scope \'" + scopeName + "\'";
        if (node.getScope(myProject) == null) {
          foreground = JBColor.RED;
        }
      }
    } else {
      text = descriptor.getText();
    }
    hint = getHint(descriptor);
  }

  if (text != null) {
    SearchUtil.appendFragments(getFilter(), text, style, foreground, background,
                               getTextRenderer());
  }
  if (hint != null) {
    getTextRenderer()
      .append(" " + hint, selected ? new SimpleTextAttributes(Font.PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES);
  }
  setForeground(foreground);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:54,代码来源:InspectionsConfigTreeRenderer.java

示例11: customizeCellRenderer

public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  final boolean showIcons = UISettings.getInstance().SHOW_ICONS_IN_MENUS;
  Keymap originalKeymap = myKeymap != null ? myKeymap.getParent() : null;
  Icon icon = null;
  String text;
  boolean bound = false;

  if (value instanceof DefaultMutableTreeNode) {
    Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
    boolean changed;
    if (userObject instanceof Group) {
      Group group = (Group)userObject;
      text = group.getName();

      changed = originalKeymap != null && isGroupChanged(group, originalKeymap, myKeymap);
      icon = group.getIcon();
      if (icon == null){
        icon = CLOSE_ICON;
      }
    }
    else if (userObject instanceof String) {
      String actionId = (String)userObject;
      bound = myShowBoundActions && ((KeymapImpl)myKeymap).isActionBound(actionId);
      AnAction action = ActionManager.getInstance().getActionOrStub(actionId);
      if (action != null) {
        text = action.getTemplatePresentation().getText();
        if (text == null || text.length() == 0) { //fill dynamic presentation gaps
          text = actionId;
        }
        Icon actionIcon = action.getTemplatePresentation().getIcon();
        if (actionIcon != null) {
          icon = actionIcon;
        }
      }
      else {
        text = actionId;
      }
      changed = originalKeymap != null && isActionChanged(actionId, originalKeymap, myKeymap);
    }
    else if (userObject instanceof QuickList) {
      QuickList list = (QuickList)userObject;
      icon = AllIcons.Actions.QuickList;
      text = list.getDisplayName();

      changed = originalKeymap != null && isActionChanged(list.getActionId(), originalKeymap, myKeymap);
    }
    else if (userObject instanceof AnSeparator) {
      // TODO[vova,anton]: beautify
      changed = false;
      text = "-------------";
    }
    else {
      throw new IllegalArgumentException("unknown userObject: " + userObject);
    }

    if (showIcons) {
      setIcon(ActionsTree.getEvenIcon(icon));
    }

    Color foreground;
    if (selected) {
      foreground = UIUtil.getTreeSelectionForeground();
    }
    else {
      if (changed) {
        foreground = PlatformColors.BLUE;
      }
      else {
        foreground = UIUtil.getTreeForeground();
      }

      if (bound) {
        foreground = JBColor.MAGENTA;
      }
    }
    SearchUtil.appendFragments(myFilter, text, Font.PLAIN, foreground,
                               selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground(), this);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:79,代码来源:ActionsTree.java

示例12: customizeCellRenderer

public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  final boolean showIcons = UISettings.getInstance().SHOW_ICONS_IN_MENUS;
  Keymap originalKeymap = myKeymap != null ? myKeymap.getParent() : null;
  Icon icon = null;
  String text;
  boolean bound = false;

  if (value instanceof DefaultMutableTreeNode) {
    Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
    boolean changed;
    if (userObject instanceof Group) {
      Group group = (Group)userObject;
      text = group.getName();

      changed = originalKeymap != null && isGroupChanged(group, originalKeymap, myKeymap);
      icon = group.getIcon();
      if (icon == null){
        icon = CLOSE_ICON;
      }
    }
    else if (userObject instanceof String) {
      String actionId = (String)userObject;
      bound = myShowBoundActions && ((KeymapImpl)myKeymap).isActionBound(actionId);
      AnAction action = ActionManager.getInstance().getActionOrStub(actionId);
      if (action != null) {
        text = action.getTemplatePresentation().getText();
        if (text == null || text.length() == 0) { //fill dynamic presentation gaps
          text = actionId;
        }
        Icon actionIcon = action.getTemplatePresentation().getIcon();
        if (actionIcon != null) {
          icon = actionIcon;
        }
      }
      else {
        text = actionId;
      }
      changed = originalKeymap != null && isActionChanged(actionId, originalKeymap, myKeymap);
    }
    else if (userObject instanceof QuickList) {
      QuickList list = (QuickList)userObject;
      icon = AllIcons.Actions.QuickList;
      text = list.getDisplayName();

      changed = originalKeymap != null && isActionChanged(list.getActionId(), originalKeymap, myKeymap);
    }
    else if (userObject instanceof Separator) {
      // TODO[vova,anton]: beautify
      changed = false;
      text = "-------------";
    }
    else {
      throw new IllegalArgumentException("unknown userObject: " + userObject);
    }

    if (showIcons) {
      setIcon(ActionsTree.getEvenIcon(icon));
    }

    Color foreground;
    if (selected) {
      foreground = UIUtil.getTreeSelectionForeground();
    }
    else {
      if (changed) {
        foreground = PlatformColors.BLUE;
      }
      else {
        foreground = UIUtil.getTreeForeground();
      }

      if (bound) {
        foreground = JBColor.MAGENTA;
      }
    }
    SearchUtil.appendFragments(myFilter, text, Font.PLAIN, foreground,
                               selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground(), this);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:79,代码来源:ActionsTree.java


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