mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+2
-14
@@ -249,23 +249,11 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
|
||||
ColorAndFontDescription that = (ColorAndFontDescription)o;
|
||||
|
||||
if (!myGroup.equals(that.myGroup)) return false;
|
||||
if (!myType.equals(that.myType)) return false;
|
||||
|
||||
return true;
|
||||
return this == o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = super.hashCode();
|
||||
result = 31 * result + myGroup.hashCode();
|
||||
result = 31 * result + myType.hashCode();
|
||||
return result;
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -183,8 +183,8 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable showOption(String attribute) {
|
||||
final int index = getAttributeIndex(attribute);
|
||||
public Runnable showOption(String attributeDisplayName) {
|
||||
final int index = getAttributeIndex(attributeDisplayName, true);
|
||||
return index < 0 ? null : new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -194,11 +194,11 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
};
|
||||
}
|
||||
|
||||
private int getAttributeIndex(final String option) {
|
||||
private int getAttributeIndex(final String option, final boolean byDisplayNamePlease) {
|
||||
return ContainerUtil.indexOf(myListModel.getItems(), new Condition<EditorSchemeAttributeDescriptor>() {
|
||||
@Override
|
||||
public boolean value(EditorSchemeAttributeDescriptor o) {
|
||||
return StringUtil.naturalCompare(o.toString(), option) == 0;
|
||||
return StringUtil.naturalCompare(byDisplayNamePlease ? o.toString() : o.getType(), option) == 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -212,8 +212,8 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectOption(String attribute) {
|
||||
int index = getAttributeIndex(attribute);
|
||||
public void selectOption(String attributeType) {
|
||||
int index = getAttributeIndex(attributeType, false);
|
||||
if (index < 0) return;
|
||||
ListScrollingUtil.selectItem(myOptionsList, index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user