提交 bf6324e2 编写于 作者: S serge-rider

#9837 Disable tooltips for booleans


Former-commit-id: 4191c933
上级 809582c3
......@@ -76,6 +76,7 @@ public abstract class ObjectListControl<OBJECT_TYPE> extends ProgressPageControl
private final static LazyValue DEF_LAZY_VALUE = new LazyValue("..."); //$NON-NLS-1$
private final static int LAZY_LOAD_DELAY = 100;
private final static Object NULL_VALUE = new Object();
private static final String EMPTY_STRING = "";
private boolean isFitWidth;
......@@ -201,7 +202,7 @@ public abstract class ObjectListControl<OBJECT_TYPE> extends ProgressPageControl
String status;
if (selection.isEmpty()) {
status = ""; //$NON-NLS-1$
status = EMPTY_STRING; //$NON-NLS-1$
} else if (selection.size() == 1) {
Object selectedNode = selection.getFirstElement();
status = ObjectViewerRenderer.getCellString(selectedNode, false);
......@@ -1041,35 +1042,42 @@ public abstract class ObjectListControl<OBJECT_TYPE> extends ProgressPageControl
@Override
public String getText(Object element, boolean forUI) {
return getText(element, forUI, false);
}
public String getText(Object element, boolean forUI, boolean forTip) {
Object cellValue = getCellValue(element, objectColumn, forUI);
if (cellValue instanceof LazyValue) {
cellValue = ((LazyValue) cellValue).value;
}
if (forUI && !sampleItems && renderer.isHyperlink(cellValue)) {
return ""; //$NON-NLS-1$
return EMPTY_STRING; //$NON-NLS-1$
}
final Object objectValue = getObjectValue((OBJECT_TYPE) element);
if (objectValue == null) {
// This may happen if list redraw happens during node dispose
return "";
return EMPTY_STRING;
}
final ObjectPropertyDescriptor prop = getPropertyByObject(objectColumn, objectValue);
if (prop != null) {
if (forUI && cellValue instanceof Boolean) {
if (forTip) {
return EMPTY_STRING;
}
return UIUtils.getBooleanString((Boolean) cellValue);
}
if (prop.isPassword() && cellValue instanceof String) {
return CommonUtils.isEmpty((String) cellValue) ? "" : "************";
return CommonUtils.isEmpty((String) cellValue) ? EMPTY_STRING : "************";
}
return ObjectViewerRenderer.getCellString(cellValue, prop.isNameProperty());
} else {
return "";
return EMPTY_STRING;
}
}
@Override
public String getToolTipText(Object element) {
String text = getText(element, true);
String text = getText(element, true, true);
if (CommonUtils.isEmpty(text)) {
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册