/** * The tree viewer implementation of this <code>Viewer</code> framework * method ensures that the given label provider is an instance of either * <code>ITableLabelProvider</code> or <code>ILabelProvider</code>. If * it is an <code>ITableLabelProvider</code>, then it provides a separate * label text and image for each column. If it is an * <code>ILabelProvider</code>, then it provides only the label text and * image for the first column, and any remaining columns are blank. */ public IBaseLabelProvider getLabelProvider() { return super.getLabelProvider(); }
/** * The tree viewer implementation of this <code>Viewer</code> framework * method ensures that the given label provider is an instance of either * <code>ITableLabelProvider</code> or <code>ILabelProvider</code>. If * it is an <code>ITableLabelProvider</code>, then it provides a separate * label text and image for each column. If it is an * <code>ILabelProvider</code>, then it provides only the label text and * image for the first column, and any remaining columns are blank. */ @Override public IBaseLabelProvider getLabelProvider() { return super.getLabelProvider(); }
/** * The tree viewer implementation of this <code>Viewer</code> framework * method ensures that the given label provider is an instance of either * <code>ITableLabelProvider</code> or <code>ILabelProvider</code>. If * it is an <code>ITableLabelProvider</code>, then it provides a separate * label text and image for each column. If it is an * <code>ILabelProvider</code>, then it provides only the label text and * image for the first column, and any remaining columns are blank. */ @Override public IBaseLabelProvider getLabelProvider() { return super.getLabelProvider(); }
/** * The table tree viewer implementation of this <code>Viewer</code> * framework method returns the label provider, which in the case of table * tree viewers will be an instance of either * <code>ITableLabelProvider</code> or <code>ILabelProvider</code>. If * it is an <code>ITableLabelProvider</code>, then it provides a separate * label text and image for each column. If it is an * <code>ILabelProvider</code>, then it provides only the label text and * image for the first column, and any remaining columns are blank. */ @Override @Deprecated public IBaseLabelProvider getLabelProvider() { return super.getLabelProvider(); }
/** * 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); }
/** * Constructs a frame for the specified tree viewer. * The frame's input element is set to the specified input element. * The frame's name and tool tip text are set to the text for the input * element, as provided by the viewer's label provider. * * @param viewer the tree viewer * @param input the input element */ public TreeFrame(AbstractTreeViewer viewer, Object input) { this(viewer); setInput(input); ILabelProvider provider = (ILabelProvider) viewer.getLabelProvider(); String name = provider.getText(input); if(name == null) { name = "";//$NON-NLS-1$ } setName(name); setToolTipText(name); }