private void updateInput() { if (this.infoText == null || !this.inputChanged) { return; } if (this.labelProvider == null) { this.labelProvider = new RLabelProvider( RLabelProvider.LONG | RLabelProvider.HEADER | RLabelProvider.NAMESPACE); } if (this.input != null) { final Image image = this.labelProvider.getImage(this.input.getElement()); this.titleImage.setImage( (image != null) ? image : SharedUIResources.getImages().get(SharedUIResources.PLACEHOLDER_IMAGE_ID)); final StyledString styleString = this.labelProvider.getStyledText( this.input.getElement(), this.input.getElementName(), this.input.getElementAttr()); if (this.input.isElementOfActiveBinding()) { styleString.append(" (active binding)", StyledString.QUALIFIER_STYLER); } this.titleText.setText(styleString.getString()); this.titleText.setStyleRanges(styleString.getStyleRanges()); if (this.input.hasDetail()) { this.infoText.setText( this.input.getDetailTitle() + '\n' + ((this.input.getDetailInfo() != null) ? this.input.getDetailInfo() : "")); //$NON-NLS-1$ final StyleRange title = new StyleRange(0, this.input.getDetailTitle().length(), null, null); title.underline = true; this.infoText.setStyleRange(title); } else { this.infoText.setText(""); // $NON-NLS-1$ } } else { this.titleImage.setImage( SharedUIResources.getImages().get(SharedUIResources.PLACEHOLDER_IMAGE_ID)); this.titleText.setText(""); // $NON-NLS-1$ this.infoText.setText(""); // $NON-NLS-1$ } if ((this.mode & MODE_FOCUS) != 0) { getToolBarManager().update(true); } else { setStatusText( (this.input.getControl() != null && this.input.getControl().isFocusControl()) ? InformationDispatchHandler.getTooltipAffordanceString() : ""); //$NON-NLS-1$ } this.inputChanged = false; }
private void updateInput() { if (fInfoText == null || !fInputChanged) { return; } if (fLabelProvider == null) { fLabelProvider = new RLabelProvider( RLabelProvider.LONG | RLabelProvider.HEADER | RLabelProvider.NAMESPACE); } if (fInput != null) { final Image image = fLabelProvider.getImage(fInput.element); fTitleImage.setImage( (image != null) ? image : SharedUIResources.getImages().get(SharedUIResources.PLACEHOLDER_IMAGE_ID)); final StyledString styleString = fLabelProvider.getStyledText( fInput.element, fInput.element.getElementName(), fInput.elementAttr); fTitleText.setText(styleString.getString()); fTitleText.setStyleRanges(styleString.getStyleRanges()); if (fInput.detailTitle != null) { fInfoText.setText( fInput.detailTitle + '\n' + ((fInput.detailInfo != null) ? fInput.detailInfo : "")); // $NON-NLS-1$ final StyleRange title = new StyleRange(0, fInput.detailTitle.length(), null, null); title.underline = true; fInfoText.setStyleRange(title); } else { fInfoText.setText(""); // $NON-NLS-1$ } } else { fTitleImage.setImage( SharedUIResources.getImages().get(SharedUIResources.PLACEHOLDER_IMAGE_ID)); fTitleText.setText(""); // $NON-NLS-1$ fInfoText.setText(""); // $NON-NLS-1$ } if (fMode == MODE_SIMPLE) { setStatusText( (fInput.control != null && fInput.control.isFocusControl()) ? InformationDispatchHandler.getTooltipAffordanceString() : ""); //$NON-NLS-1$ } fInputChanged = false; }