}
final Icon valueIcon = valueDescriptor.getValueIcon();
if (nodeIcon != null && valueIcon != null) {
- final RowIcon composite = new RowIcon(2);
- composite.setIcon(nodeIcon, 0);
- composite.setIcon(valueIcon, 1);
- nodeIcon = composite;
+ nodeIcon = new RowIcon(nodeIcon, valueIcon);
}
return nodeIcon;
}
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
final PsiMethod baseMethod,
PsiClass baseClass, PsiSubstitutor substitutor) {
- RowIcon icon = new RowIcon(2);
- icon.setIcon(baseMethod.getIcon(0), 0);
- icon.setIcon(implemented ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod, 1);
-
+ RowIcon icon = new RowIcon(baseMethod.getIcon(0), implemented ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod);
return createGenerateMethodElement(baseMethod, substitutor, icon, baseClass.getName(), new InsertHandler<LookupElement>() {
@Override
public void handleInsert(InsertionContext context, LookupElement item) {
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
if (myStateIcon != null) {
- final RowIcon icon = new RowIcon(2);
- icon.setIcon(myStateIcon, 0);
- icon.setIcon(newIcon, 1);
- newIcon = icon;
+ newIcon = new RowIcon(myStateIcon, newIcon);
}
setIcon(newIcon);
setForeground(JBColor.RED);
}
- RowIcon icon = new RowIcon(2);
- icon.setIcon(methodIcon, 0);
- icon.setIcon(overrideIcon, 1);
+ RowIcon icon = new RowIcon(methodIcon, overrideIcon);
setIcon(icon);
setDisabledIcon(icon);
break;
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
protected Icon getAdjustedBaseIcon(Icon icon, @Iconable.IconFlags int flags) {
- Icon result = icon;
if ((flags & ICON_FLAG_VISIBILITY) > 0) {
- RowIcon rowIcon = new RowIcon(2);
- rowIcon.setIcon(icon, 0);
- rowIcon.setIcon(VISIBILITY_ICON_PLACEHOLDER.getValue(), 1);
- result = rowIcon;
+ return new RowIcon(icon, VISIBILITY_ICON_PLACEHOLDER.getValue());
}
-
- return result;
+ return icon;
}
protected boolean isVisibilitySupported() {
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
//myOrientation = orientation;
}
+ public RowIcon(Icon... icons) {
+ this(icons.length);
+ System.arraycopy(icons, 0, myIcons, 0, icons.length);
+ recalculateSize();
+ }
+
public int hashCode() {
return myIcons.length > 0 ? myIcons[0].hashCode() : 0;
}
Icon smartTagIcon = showRefactoringsBulb ? AllIcons.Actions.RefactoringBulb : showFix ? AllIcons.Actions.QuickfixBulb : AllIcons.Actions.IntentionBulb;
- myHighlightedIcon = new RowIcon(2);
- myHighlightedIcon.setIcon(smartTagIcon, 0);
- myHighlightedIcon.setIcon(AllIcons.General.ArrowDown, 1);
-
- myInactiveIcon = new RowIcon(2);
- myInactiveIcon.setIcon(smartTagIcon, 0);
- myInactiveIcon.setIcon(ourInactiveArrowIcon, 1);
+ myHighlightedIcon = new RowIcon(smartTagIcon, AllIcons.General.ArrowDown);
+ myInactiveIcon = new RowIcon(smartTagIcon, ourInactiveArrowIcon);
myIconLabel = new JLabel(myInactiveIcon);
myIconLabel.setOpaque(false);