/** * This implementation of buildLabel handles tree paths as well as elements. * * @param updateLabel * the ViewerLabel to collect the result in * @param elementOrPath * the element or tree path for which a label should be built * * @see org.eclipse.jface.viewers.StructuredViewer#buildLabel(org.eclipse.jface.viewers.ViewerLabel, * java.lang.Object) */ protected void buildLabel(ViewerLabel updateLabel, Object elementOrPath) { Object element; if (elementOrPath instanceof TreePath) { TreePath path = (TreePath) elementOrPath; IBaseLabelProvider provider = getLabelProvider(); if (provider instanceof ITreePathLabelProvider) { ITreePathLabelProvider pprov = (ITreePathLabelProvider) provider; buildLabel(updateLabel, path, pprov); return; } element = path.getLastSegment(); } else { element = elementOrPath; } super.buildLabel(updateLabel, element); }
/** * This implementation of buildLabel handles tree paths as well as elements. * * @param updateLabel * the ViewerLabel to collect the result in * @param elementOrPath * the element or tree path for which a label should be built * * @see org.eclipse.jface.viewers.StructuredViewer#buildLabel(org.eclipse.jface.viewers.ViewerLabel, * java.lang.Object) */ @Override protected void buildLabel(ViewerLabel updateLabel, Object elementOrPath) { Object element; if (elementOrPath instanceof TreePath) { TreePath path = (TreePath) elementOrPath; IBaseLabelProvider provider = getLabelProvider(); if (provider instanceof ITreePathLabelProvider) { ITreePathLabelProvider pprov = (ITreePathLabelProvider) provider; buildLabel(updateLabel, path, pprov); return; } element = path.getLastSegment(); } else { element = elementOrPath; } super.buildLabel(updateLabel, element); }
/** * This implementation of buildLabel handles tree paths as well as elements. * * @param updateLabel * the ViewerLabel to collect the result in * @param elementOrPath * the element or tree path for which a label should be built * * @see org.eclipse.jface.viewers.StructuredViewer#buildLabel(org.eclipse.jface.viewers.ViewerLabel, * java.lang.Object) */ @Override protected void buildLabel(ViewerLabel updateLabel, Object elementOrPath) { Object element; if (elementOrPath instanceof TreePath) { TreePath path = (TreePath) elementOrPath; IBaseLabelProvider provider = getLabelProvider(); if (provider instanceof ITreePathLabelProvider) { ITreePathLabelProvider pprov = (ITreePathLabelProvider) provider; buildLabel(updateLabel, path, pprov); return; } element = path.getLastSegment(); } else { element = elementOrPath; } super.buildLabel(updateLabel, element); }