Java Code Examples for com.intellij.openapi.util.IconLoader#getDisabledIcon()

The following examples show how to use com.intellij.openapi.util.IconLoader#getDisabledIcon() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FindTextToggleButton.java    From netbeans-mmd-plugin with Apache License 2.0 6 votes vote down vote up
public FindTextToggleButton(final Icon icon, final String tooltipText, final ActionListener actionListener) {
  super();
  this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  this.setToolTipText(tooltipText);
  this.selectedIcon = icon;
  this.normalIcon = IconLoader.getDisabledIcon(icon);
  this.setSelected(true);
  this.listener = actionListener;
  this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));

  this.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      if (!e.isPopupTrigger()) {
        setSelected(!selected);
      }
    }
  });
}
 
Example 2
Source File: TextPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void paintComponent(@Nonnull final Graphics g) {
  super.paintComponent(g);
  Icon icon = myIcon == null || isEnabled() ? myIcon : IconLoader.getDisabledIcon(myIcon);
  if (icon != null) {
    icon.paintIcon(this, g, getIconX(g), getHeight() / 2 - icon.getIconHeight() / 2);
  }
}
 
Example 3
Source File: ActionButton.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void updateIcon() {
  myIcon = myPresentation.getIcon();
  if (myPresentation.getDisabledIcon() != null) { // set disabled icon if it is specified
    myDisabledIcon = myPresentation.getDisabledIcon();
  }
  else {
    myDisabledIcon = IconLoader.getDisabledIcon(myIcon);
  }
}
 
Example 4
Source File: AnimatedIcon.java    From consulo with Apache License 2.0 4 votes vote down vote up
public Blinking(int delay, @Nonnull Icon icon) {
  super(delay, icon, IconLoader.getDisabledIcon(icon));
}
 
Example 5
Source File: DesktopDisabledImageImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
private DesktopDisabledImageImpl(Image original) {
  myIcon = IconLoader.getDisabledIcon(TargetAWT.to(original));
}