/** * @see * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) */ @Override public void update(ViewerCell cell) { // Interlace if (isInterlaceRow) { // Font cell.setText("BOLD"); cell.setFont(SwtFonts.TEXT_BOLD.font()); // Image cell.setImage(SwtImagesSilk.DELETE.image()); // Color cell.setBackground(SwtColors.color(ColorType.RED)); } else { // Font cell.setText("Normal"); cell.setFont(SwtFonts.TEXT.font()); // Image cell.setImage(SwtImagesSilk.ADD.image()); // Color cell.setBackground(SwtColors.color(ColorType.GREEN)); } isInterlaceRow = !isInterlaceRow; super.update(cell); }
@Override public void update(ViewerCell cell) { CeylonHierarchyNode n = (CeylonHierarchyNode) cell.getElement(); if (n.isMultiple()) { cell.setText("multiple supertypes" + getViewInterfacesShortcut()); cell.setStyleRanges(new StyleRange[0]); cell.setImage(MULTIPLE_TYPES_IMAGE); } else { StyledString styledText = getStyledText(n); cell.setText(styledText.toString()); cell.setStyleRanges(styledText.getStyleRanges()); cell.setImage(getImageForDeclaration(getDisplayedDeclaration(n), n.isFocus())); } super.update(cell); }
@Override public void update(ViewerCell cell) { LogicalTask logicalTask = (LogicalTask) cell.getElement(); int columnIndex = cell.getColumnIndex(); if (columnIndex == 0) { cell.setImage(severityImages[logicalTask.getSeverityType()]); cell.setText(logicalTask.getSummary()); cell.setFont(logicalTask.getSeverityType() > 1 ? bold : null); cell.setForeground(logicalTask.isAllFixed() ? gray : null); } else { Version version = taskModel.getVersions()[columnIndex - 1]; VersionTask versionTask = logicalTask.getVersionTask(version); if (versionTask != null) { cell.setText(versionTask.getStatus()); cell.setFont(!"enhancement".equalsIgnoreCase(versionTask.getSeverity()) ? bold : null); cell.setForeground("FIXED".equalsIgnoreCase(versionTask.getResolution()) ? gray : null); cell.setBackground(logicalTask.getVersionTaskCount(version) > 1 ? red : null); } else { cell.setText(""); cell.setFont(null); cell.setForeground(null); cell.setBackground(null); } } }
@Override public void update(ViewerCell cell) { EObject o = (EObject) cell.getElement(); String label = ""; // $NON-NLS-1$ Image img = null; AbstractComponentEditor elementEditor = getEditor().getEditor(o.eClass()); if (elementEditor != null) { label = elementEditor.getDetailLabel(o); label = label == null ? elementEditor.getLabel(o) : label; img = elementEditor.getImage(o, composite.getDisplay()); } List<String> parentPath = new ArrayList<String>(); while (o.eContainer() != null) { o = o.eContainer(); elementEditor = getEditor().getEditor(o.eClass()); if (elementEditor != null) { parentPath.add(0, elementEditor.getLabel(o)); } } String parentString = ""; // $NON-NLS-1$ for (String p : parentPath) { parentString += "/" + p; // $NON-NLS-1$ } StyledString s = new StyledString(label); s.append(" - " + parentString, StyledString.DECORATIONS_STYLER); // $NON-NLS-1$ cell.setStyleRanges(s.getStyleRanges()); cell.setText(s.getString()); cell.setImage(img); }
@Override public void update(ViewerCell cell) { Object element = cell.getElement(); cell.setText(getText(element)); Image image = getImage(element); cell.setImage(image); }
@Override public void update(ViewerCell cell) { Object element = cell.getElement(); StyledString styledText = getStyledText(element); cell.setText(styledText.toString()); cell.setStyleRanges(styledText.getStyleRanges()); cell.setImage(getImage(element)); super.update(cell); }
public void update(ViewerCell cell) { SliceProfileRow element = (SliceProfileRow) cell.getElement(); int index = cell.getColumnIndex(); String columnText = getColumnText(element, index); cell.setText(columnText); cell.setImage(getColumnImage(element, index)); if (sliceProfileIntersectionIndices.contains(element.getStatementID() - 1)) { cell.setBackground(highlightColor); } else cell.setBackground(null); super.update(cell); }
@Override public void update(ViewerCell cell) { super.update(cell); ISellOrder t = (ISellOrder) cell.getElement(); Object[] data = {null, null, null, null}; getCellData(t, SellOrderTable.getColumns()[cell.getColumnIndex()], data); if (data[TEXT] != null) cell.setText((String) data[TEXT]); if (data[IMAGE] != null) cell.setImage((Image) data[IMAGE]); if (data[FONT] != null) cell.setFont((Font) data[FONT]); if (data[FOREGROUND] != null) cell.setForeground((Color) data[FOREGROUND]); }
@Override public void update(ViewerCell cell) { ExtractedEntry entry = (ExtractedEntry) cell.getElement(); String text = getText(entry); if (text == null) text = ""; // $NON-NLS-1$ boolean strikeout = !entry.isImported(); StyledString styledString = new StyledString(text, strikeout ? strikeoutStyler : null); cell.setText(styledString.toString()); cell.setStyleRanges(styledString.getStyleRanges()); cell.setImage(getImage(entry)); super.update(cell); }
@Override public void update(ViewerCell cell) { super.update(cell); SourceFilesViewer.TranslationUnitInfo tuInfo = null; Object element = cell.getElement(); if (element instanceof ITranslationUnit) { tuInfo = SourceFilesViewer.fetchTranslationUnitInfo((Executable) viewer.getInput(), element); } int orgColumnIndex = cell.getColumnIndex(); if (orgColumnIndex == 0) { if (element instanceof String) { cell.setText((String) element); Font italicFont = resourceManager.createFont( FontDescriptor.createFrom(viewer.getTree().getFont()).setStyle(SWT.ITALIC)); cell.setFont(italicFont); } else { cell.setFont(viewer.getTree().getFont()); } } else if (orgColumnIndex == 1) { cell.setText(null); if (tuInfo != null) { if (tuInfo.location != null) { cell.setText(tuInfo.location.toOSString()); if (tuInfo.exists) cell.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); else cell.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY)); } } cell.setImage(null); } else if (orgColumnIndex == 2) { cell.setText(null); if (tuInfo != null && tuInfo.originalLocation != null) { cell.setText(tuInfo.originalLocation.toOSString()); if (tuInfo.originalExists) cell.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); else cell.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY)); } cell.setImage(null); } else if (orgColumnIndex == 3) { cell.setText(null); if (tuInfo != null) { if (tuInfo.exists) { cell.setText(Long.toString(tuInfo.fileLength)); } } cell.setImage(null); } else if (orgColumnIndex == 4) { cell.setText(null); if (tuInfo != null) { if (tuInfo.exists) { String dateTimeString = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT) .format(new Date(tuInfo.lastModified)); cell.setText(dateTimeString); } } cell.setImage(null); } else if (orgColumnIndex == 5) { cell.setText(null); if (tuInfo != null) { if (tuInfo.location != null) { String fileExtension = tuInfo.location.getFileExtension(); if (fileExtension != null) cell.setText(fileExtension.toLowerCase()); } } cell.setImage(null); } }
@Override public void update(ViewerCell cell) { cell.setText(labelProvider.getText(cell.getElement())); cell.setImage(labelProvider.getImage(cell.getElement())); }