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


Java LightColors类代码示例

本文整理汇总了Java中com.intellij.ui.LightColors的典型用法代码示例。如果您正苦于以下问题:Java LightColors类的具体用法?Java LightColors怎么用?Java LightColors使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: updateFatalErrorsIcon

import com.intellij.ui.LightColors; //导入依赖的package包/类
void updateFatalErrorsIcon() {
  final IdeFatalErrorsIcon.State state = computeState();
  updateState(state);

  if (state == IdeFatalErrorsIcon.State.NoErrors) {
    myNotificationPopupAlreadyShown = false;
  }
  else if (state == IdeFatalErrorsIcon.State.UnreadErrors && !myNotificationPopupAlreadyShown) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        String notificationText = tryGetFromMessages(myMessagePool.getFatalErrors(false, false));
        if (notificationText == null) {
          notificationText = INTERNAL_ERROR_NOTICE;
        }
        final JLabel label = new JLabel(notificationText);
        label.setIcon(AllIcons.Ide.FatalError);
        new NotificationPopup(IdeMessagePanel.this, label, LightColors.RED, false, new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _openFatals(null);
          }
        }, true);
      }
    });
    myNotificationPopupAlreadyShown = true;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:IdeMessagePanel.java

示例2: getRightMargin

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Override
protected int getRightMargin() {
  String text = myRightMarginField.getText();
  int rightMargin;
  myRightMarginField.setBackground(myInitialRightMarginFieldColor);
  try {
    rightMargin = Integer.parseInt(text);
    if (rightMargin < 1 || rightMargin > CodeStyleSettings.MAX_RIGHT_MARGIN) {
      rightMargin = myDefaultRightMargin;
      myRightMarginField.setBackground(LightColors.RED);
    }
  }
  catch (NumberFormatException nfe) {
    myRightMarginField.setBackground(LightColors.RED);
    rightMargin = myDefaultRightMargin;
  }
  return rightMargin;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GeneralCodeStylePanel.java

示例3: customizeCellRenderer

import com.intellij.ui.LightColors; //导入依赖的package包/类
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
  if (value instanceof VirtualFile) {
    VirtualFile virtualFile = (VirtualFile)value;
    String name = virtualFile.getPresentableName();
    setIcon(IconUtil.getIcon(virtualFile, Iconable.ICON_FLAG_READ_STATUS, myProject));

    FileStatus fileStatus = FileStatusManager.getInstance(myProject).getStatus(virtualFile);
    TextAttributes attributes = new TextAttributes(fileStatus.getColor(), null , null, EffectType.LINE_UNDERSCORE,
                                                   Font.PLAIN);
    append(name, SimpleTextAttributes.fromTextAttributes(attributes));

    if (!selected && FileEditorManager.getInstance(myProject).isFileOpen(virtualFile)) {
      setBackground(LightColors.SLIGHTLY_GREEN);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:BaseShowRecentFilesAction.java

示例4: paintIcon

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
  x++;
  g.setColor(new JBColor(LightColors.YELLOW, new Color(103, 81, 51)));
  g.fillRect(x, y, getIconWidth() - 2, getIconHeight());

  g.setColor(JBColor.GRAY);
  g.drawRect(x, y, getIconWidth() - 2, getIconHeight());

  g.setColor(JBColor.foreground());
  final Font oldFont = g.getFont();
  g.setFont(MNEMONIC_FONT);

  g.drawString(Character.toString(myMnemonic), x + 2, y + getIconHeight() - 2);
  g.setFont(oldFont);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:Bookmark.java

示例5: getCaptionColor

import com.intellij.ui.LightColors; //导入依赖的package包/类
private Color getCaptionColor(final int i)
{
	if(mySelectionModel.isSelectedIndex(i))
	{
		return LightColors.BLUE;
	}
	if(mySelectedContainer != null)
	{
		if(i >= 0 && i < mySelectedContainer.getGridCellCount(myIsRow))
		{
			final GridChangeUtil.CellStatus status = GridChangeUtil.canDeleteCell(mySelectedContainer, i, myIsRow);
			if(status == GridChangeUtil.CellStatus.Empty || status == GridChangeUtil.CellStatus.Redundant)
			{
				return Color.PINK;
			}
		}
	}
	return LightColors.GREEN;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:20,代码来源:GridCaptionPanel.java

示例6: createFromBytesImpl

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Nonnull
private static DocumentContent createFromBytesImpl(@javax.annotation.Nullable Project project,
                                                   @Nonnull byte[] content,
                                                   @Nonnull FileType fileType,
                                                   @Nonnull String fileName,
                                                   @javax.annotation.Nullable VirtualFile highlightFile,
                                                   @Nonnull Charset charset) {
  Charset bomCharset = CharsetToolkit.guessFromBOM(content);
  boolean isBOM = bomCharset != null;
  if (isBOM) charset = bomCharset;

  boolean malformedContent = false;
  String text = CharsetToolkit.tryDecodeString(content, charset);

  LineSeparator separator = StringUtil.detectSeparators(text);
  String correctedContent = StringUtil.convertLineSeparators(text);

  DocumentContent documentContent = createImpl(project, correctedContent, fileType, fileName, highlightFile, charset, isBOM, true, true);

  if (malformedContent) {
    String notificationText = "Content was decoded with errors (using " + "'" + charset.name() + "' charset)";
    DiffUtil.addNotification(DiffNotifications.createNotification(notificationText, LightColors.RED), documentContent);
  }

  return documentContent;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:DiffContentFactoryImpl.java

示例7: createWarningPanel

import com.intellij.ui.LightColors; //导入依赖的package包/类
private static JComponent createWarningPanel() {
  VerticalLayoutPanel panel = JBUI.Panels.verticalPanel();
  panel.setBackground(LightColors.RED);
  panel.setBorder(new CompoundBorder(JBUI.Borders.customLine(JBColor.GRAY), JBUI.Borders.empty(5)));

  JBLabel warnLabel = new JBLabel("WARNING", AllIcons.General.BalloonWarning, SwingConstants.LEFT);
  warnLabel.setFont(UIUtil.getFont(UIUtil.FontSize.BIGGER, warnLabel.getFont()).deriveFont(Font.BOLD));
  panel.addComponent(warnLabel);
  JTextArea textArea = new JTextArea(IdeBundle.message("eap.configurable.warning.text"));
  textArea.setLineWrap(true);
  textArea.setFont(JBUI.Fonts.label());
  textArea.setOpaque(false);
  textArea.setEditable(false);
  panel.addComponent(textArea);
  return panel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:EarlyAccessProgramConfigurable.java

示例8: getRendererBackground

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Nullable
@Override
public Color getRendererBackground(PsiFile file) {
  if (file == null) return null;

  if (isEnabled()) {
    final Color fileColor = getFileColor(file);
    if (fileColor != null) return fileColor;
  }

  final VirtualFile vFile = file.getVirtualFile();
  if (vFile == null) return null;

  //todo[kb] slightly_green for darcula
  return FileEditorManager.getInstance(myProject).isFileOpen(vFile) && !UIUtil.isUnderDarcula() ? LightColors.SLIGHTLY_GREEN : null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:FileColorManagerImpl.java

示例9: paintIcon

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
  g.setColor(LightColors.SLIGHTLY_GREEN);
  g.fillRoundRect(x + 4, y + 4, 32 - 8, 32 - 8, 8, 8);
  g.setColor(JBColor.GRAY);
  g.drawRoundRect(x + 4, y + 4, 32 - 8, 32 - 8, 8, 8);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CardActionsPanel.java

示例10: ContentWrapper

import com.intellij.ui.LightColors; //导入依赖的package包/类
private ContentWrapper() {
  setLayout(new BorderLayout());
  myErrorLabel = new JLabel();
  myErrorLabel.setOpaque(true);
  myErrorLabel.setBackground(LightColors.RED);

  myLeft = new JPanel(new BorderLayout());

  mySplitter.addPropertyChangeListener(Splitter.PROP_PROPORTION, new PropertyChangeListener() {
    @Override
    public void propertyChange(final PropertyChangeEvent evt) {
      myLastSplitterProportion = ((Float)evt.getNewValue()).floatValue();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:OptionsEditor.java

示例11: getTableCellRendererComponent

import com.intellij.ui.LightColors; //导入依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  Component orig = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
  final Color bg = orig.getBackground();
  final Color grayedFg = isSelected ? orig.getForeground() : Color.GRAY;
  myLabel.setForeground(grayedFg);
  myLabel.setBackground(bg);
  myLabel.setOpaque(true);

  if (column == COLUMN_DATE) {
    long date = myPluginDescriptor.getDate();
    myLabel.setText(date != 0 && date != Long.MAX_VALUE ? DateFormatUtil.formatDate(date) : "n/a");
    myLabel.setHorizontalAlignment(SwingConstants.RIGHT);
  } else if (column == COLUMN_DOWNLOADS) {
    String downloads = myPluginDescriptor.getDownloads();
    myLabel.setText(!StringUtil.isEmpty(downloads) ? downloads : "n/a");
    myLabel.setHorizontalAlignment(SwingConstants.RIGHT);
  } else if (column == COLUMN_CATEGORY) {
    String category = myPluginDescriptor.getCategory();
    if (StringUtil.isEmpty(category)) {
      category = myPluginDescriptor.getRepositoryName();
    }
    myLabel.setText(!StringUtil.isEmpty(category) ? category : "n/a");
  }
  if (myPluginDescriptor.getStatus() == PluginNode.STATUS_INSTALLED) {
    PluginId pluginId = myPluginDescriptor.getPluginId();
    final boolean hasNewerVersion = ourState.hasNewerVersion(pluginId);
    if (hasNewerVersion) {
      if (!isSelected) myLabel.setBackground(LightColors.BLUE);
    }
  }
  return myLabel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:PluginManagerColumnInfo.java

示例12: getColor

import com.intellij.ui.LightColors; //导入依赖的package包/类
private  Color getColor(HighlightSeverity severity) {
  if (SeverityRegistrar.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.ERROR) >= 0) {
    return LightColors.RED;
  }

  if (SeverityRegistrar.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.WARNING) >= 0) {
    return LightColors.YELLOW;
  }

  return LightColors.GREEN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FileLevelIntentionComponent.java

示例13: getRendererBackground

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Nullable
@Override
public Color getRendererBackground(VirtualFile vFile) {
  if (vFile == null) return null;

  if (isEnabled()) {
    final Color fileColor = getFileColor(vFile);
    if (fileColor != null) return fileColor;
  }

  //todo[kb] slightly_green for darcula
  return FileEditorManager.getInstance(myProject).isFileOpen(vFile) && !UIUtil.isUnderDarcula() ? LightColors.SLIGHTLY_GREEN : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:FileColorManagerImpl.java

示例14: createNotificationPanel

import com.intellij.ui.LightColors; //导入依赖的package包/类
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, @NotNull final FileEditor fileEditor) {
  if (!(fileEditor instanceof TextEditor)) return null;
  final Project project = ((TextEditor)fileEditor).getEditor().getProject();
  final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance(project).getCurrentSettings();
  if (!Utils.isEnabled(settings) || PropertiesComponent.getInstance(project).getBoolean(EDITOR_CONFIG_ACCEPTED)) return null;

  final List<EditorConfig.OutPair> pairs = SettingsProviderComponent.getInstance().getOutPairs(project, Utils.getFilePath(project, file));
  if (!pairs.isEmpty()) {
    final EditorNotificationPanel panel = new EditorNotificationPanel() {
      @Override
      public Color getBackground() {
        return LightColors.GREEN;
      }
    }.text("EditorConfig is overriding Code Style settings for this file").
      icon(EditorconfigIcons.Editorconfig);
    panel.createActionLabel("OK", new Runnable() {
      @Override
      public void run() {
        PropertiesComponent.getInstance(project).setValue(EDITOR_CONFIG_ACCEPTED, true);
        EditorNotifications.getInstance(project).updateAllNotifications();
      }
    });
    panel.createActionLabel("Disable EditorConfig support", new Runnable() {
      @Override
      public void run() {
        settings.getCustomSettings(EditorConfigSettings.class).ENABLED = false;
        EditorNotifications.getInstance(project).updateAllNotifications();
      }
    });
    return panel;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:EditorConfigNotifierProvider.java

示例15: getCaptionColor

import com.intellij.ui.LightColors; //导入依赖的package包/类
private Color getCaptionColor(final int i) {
  if (mySelectionModel.isSelectedIndex(i)) {
    return LightColors.BLUE;
  }
  if (mySelectedContainer != null) {
    if (i >= 0 && i < mySelectedContainer.getGridCellCount(myIsRow)) {
      final GridChangeUtil.CellStatus status = GridChangeUtil.canDeleteCell(mySelectedContainer, i, myIsRow);
      if (status == GridChangeUtil.CellStatus.Empty || status == GridChangeUtil.CellStatus.Redundant) {
        return Color.PINK;
      }
    }
  }
  return LightColors.GREEN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GridCaptionPanel.java


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