protected String getColumnText(IVariable variable, IValue value, IPresentationContext context, String columnId) throws CoreException { if (JavaVariableColumnPresentation.COLUMN_INSTANCE_ID.equals(columnId)) { if (value instanceof JDIObjectValue) { long uniqueId = ((JDIObjectValue)value).getUniqueId(); if (uniqueId >= 0) { StringBuffer buffer = new StringBuffer(); buffer.append(uniqueId); return buffer.toString(); } } return ""; //$NON-NLS-1$ } return super.getColumnText(variable, value, context, columnId); }
/** * Returns text for a specific columns for the variable/value. * * @param variable variable to retrieve text for * @param value the value associated with the variable * @param context presentation context specifying how to display the text * @param columnId the column to get the text for * @return the label text * @throws CoreException Error while retrieving data from model. */ protected String getColumnText(IVariable variable, IValue value, IPresentationContext context, String columnId) throws CoreException { if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(columnId)) { return getVariableName(variable, context); } else if (IDebugUIConstants.COLUMN_ID_VARIABLE_TYPE.equals(columnId)) { return getVariableTypeName(variable, context); } else if (IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE.equals(columnId)) { return getValueText(variable, value, context); } else if (IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE_TYPE.equals(columnId)) { return getValueTypeName(variable, value, context); } return null; }
/** * Returns the label for the given value to display in <code>COLUMN_VALUE_TYPE</code> * * @param variable Variable to get the value for. * @param value Variable value to get value label for. * @param context View context. * @return value label * @throws CoreException Error while retrieving data from model. */ protected String getValueText(IVariable variable, IValue value, IPresentationContext context) throws CoreException { return escapeSpecialChars(value.getValueString()); }
protected String getValueText(IVariable variable, IValue value, IPresentationContext context) throws CoreException { if (value instanceof IJavaValue) { return escapeSpecialChars(fLabelProvider.getFormattedValueText((IJavaValue) value)); } return super.getValueText(variable, value, context); }
/** * Sets qualified name setting before building label */ protected void retrieveLabel(ILabelUpdate update) throws CoreException { Boolean showQ = isShowQualfiiedNames(update.getPresentationContext()); fQualifiedNames = showQ.booleanValue(); fLabelProvider.setAttribute(JDIModelPresentation.DISPLAY_QUALIFIED_NAMES, showQ); super.retrieveLabel(update); }
@Override protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException { Object element = elementPath.getLastSegment(); if (element instanceof IErrorReportingExpression) { IErrorReportingExpression expression = (IErrorReportingExpression) element; if (expression.hasErrors()) { if (columnId == null || columnId.equals(IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE)) { return new RGB(255, 0, 0); } } } return super.getForeground(elementPath, presentationContext, columnId); }
@Override protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException { if (columnId == null) { return super.getLabel(elementPath, context, columnId); } else { IExpression expression = (IExpression) elementPath.getLastSegment(); IValue value = expression.getValue(); return getColumnText(expression, value, context, columnId); } }
@Override protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException { if (columnId == null) { return super.getLabel(elementPath, context, columnId); } else { IVariable variable = (IVariable) elementPath.getLastSegment(); IValue value = variable.getValue(); return getColumnText(variable, value, context, columnId); } }