mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-92957
This commit is contained in:
+13
-11
@@ -215,22 +215,24 @@ public class ResizeOperation implements EditOperation {
|
||||
myTextFeedback.dimension("dp");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (staticText.length() > 2) {
|
||||
int index = staticText.length() - 2;
|
||||
String dimension = staticText.substring(index);
|
||||
if (ArrayUtil.indexOf(ResourceRenderer.DIMENSIONS, dimension) != -1) {
|
||||
myTextFeedback.append(staticText.substring(0, index));
|
||||
myTextFeedback.dimension(dimension);
|
||||
}
|
||||
else {
|
||||
myTextFeedback.append(staticText);
|
||||
}
|
||||
else if (staticText.length() > 3 && staticText.endsWith("dip")) {
|
||||
myTextFeedback.append(staticText.substring(0, staticText.length() - 3));
|
||||
myTextFeedback.dimension("dip");
|
||||
}
|
||||
else if (staticText.length() > 2) {
|
||||
int index = staticText.length() - 2;
|
||||
String dimension = staticText.substring(index);
|
||||
if (ArrayUtil.indexOf(ResourceRenderer.DIMENSIONS, dimension) != -1) {
|
||||
myTextFeedback.append(staticText.substring(0, index));
|
||||
myTextFeedback.dimension(dimension);
|
||||
}
|
||||
else {
|
||||
myTextFeedback.append(staticText);
|
||||
}
|
||||
}
|
||||
else {
|
||||
myTextFeedback.append(staticText);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean snapToWidth(Rectangle bounds, Dimension size, int delta) {
|
||||
|
||||
+1
@@ -273,6 +273,7 @@ public class ResourceEditor extends PropertyEditor {
|
||||
}
|
||||
if (myIsDimension &&
|
||||
!value.startsWith("@") &&
|
||||
!value.endsWith("dip") &&
|
||||
!value.equalsIgnoreCase("wrap_content") &&
|
||||
!value.equalsIgnoreCase("fill_parent") &&
|
||||
!value.equalsIgnoreCase("match_parent")) {
|
||||
|
||||
+15
-6
@@ -90,12 +90,21 @@ public class ResourceRenderer extends AbstractResourceRenderer {
|
||||
myColoredComponent.append(value.substring(0, prefix), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
|
||||
myColoredComponent.append(value.substring(prefix), textStyle(component, value, system, colorValue));
|
||||
}
|
||||
else if (myFormats.contains(AttributeFormat.Dimension) && value.length() > 2) {
|
||||
int index = value.length() - 2;
|
||||
String dimension = value.substring(index);
|
||||
if (ArrayUtil.indexOf(DIMENSIONS, dimension) != -1) {
|
||||
myColoredComponent.append(value.substring(0, index));
|
||||
myColoredComponent.append(dimension, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
|
||||
else if (myFormats.contains(AttributeFormat.Dimension)) {
|
||||
if (value.length() > 3 && value.endsWith("dip")) {
|
||||
myColoredComponent.append(value.substring(0, value.length() - 3));
|
||||
myColoredComponent.append("dip", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
|
||||
}
|
||||
else if (value.length() > 2) {
|
||||
int index = value.length() - 2;
|
||||
String dimension = value.substring(index);
|
||||
if (ArrayUtil.indexOf(DIMENSIONS, dimension) != -1) {
|
||||
myColoredComponent.append(value.substring(0, index));
|
||||
myColoredComponent.append(dimension, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
|
||||
}
|
||||
else {
|
||||
myColoredComponent.append(value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
myColoredComponent.append(value);
|
||||
|
||||
Reference in New Issue
Block a user