Java Code Examples for org.eclipse.jface.viewers.ViewerCell#setText()
The following examples show how to use
org.eclipse.jface.viewers.ViewerCell#setText() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemCellLabelProvider.java From neoscada with Eclipse Public License 1.0 | 6 votes |
private void updateAttributePair ( final AttributePair attributePair, final ViewerCell cell ) { switch ( cell.getColumnIndex () ) { case 0: cell.setText ( attributePair.key ); break; case 2: if ( attributePair.value != null ) { cell.setText ( attributePair.value.getType ().name () ); } break; case 3: if ( attributePair.value != null ) { cell.setText ( attributePair.value.asString ( "<null>" ) ); //$NON-NLS-1$ } break; default: break; } }
Example 2
Source File: GenericLabelProvider.java From offspring with MIT License | 6 votes |
@Override public void update(ViewerCell cell) { super.update(cell); data[ICellDataProvider.TEXT] = null; data[ICellDataProvider.IMAGE] = null; data[ICellDataProvider.FONT] = null; data[ICellDataProvider.FOREGROUND] = null; cellDataProvider.getCellData(cell.getElement(), data); if (data[ICellDataProvider.TEXT] != null) { cell.setText((String) data[ICellDataProvider.TEXT]); } if (data[ICellDataProvider.IMAGE] != null) { cell.setImage((Image) data[ICellDataProvider.IMAGE]); } if (data[ICellDataProvider.FONT] != null) { cell.setFont((Font) data[ICellDataProvider.FONT]); } if (data[ICellDataProvider.FOREGROUND] != null) { cell.setForeground((Color) data[ICellDataProvider.FOREGROUND]); } }
Example 3
Source File: ContractInputTypeCellLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public void update(ViewerCell cell) { super.update(cell); final ContractInput element = (ContractInput) cell.getElement(); final String text = getText(element); final StyledString styledString = new StyledString(text, new StyledString.Styler() { @Override public void applyStyles(TextStyle textStyle) { if (element.getType() == ContractInputType.DATE) { textStyle.foreground = Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY); } } }); cell.setText(styledString.getString()); cell.setStyleRanges(styledString.getStyleRanges()); }
Example 4
Source File: TypeLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public void update(ViewerCell cell) { Object element = cell.getElement(); StyledString styledString = getStyledString(element); cell.setText(styledString.getString()); IStatus status = validator.validate(element); if (status.getSeverity() == IStatus.ERROR) { cell.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR)); cell.setForeground(errorColor); } else { cell.setForeground(null); cell.setImage(null); } cell.setStyleRanges(styledString.getStyleRanges()); }
Example 5
Source File: FlagsDetailsPart.java From neoscada with Eclipse Public License 1.0 | 6 votes |
@Override public void update ( final ViewerCell cell ) { final Object ele = cell.getElement (); if ( ele instanceof GroupEntry ) { cell.setText ( String.format ( Messages.FlagsDetailsPart_GroupSumFormat, ( (GroupEntry)ele ).getActiveCount (), ( (GroupEntry)ele ).getCount () ) ); } else if ( ele instanceof AttributeEntry ) { final StyledString str = new StyledString (); if ( ( (AttributeEntry)ele ).isActive () ) { str.append ( Messages.FlagsDetailsPart_ActiveMarker, this.activeStyler ); } else { str.append ( Messages.FlagsDetailsPart_InactiveMarker, this.inactiveStyler ); } cell.setText ( str.getString () ); cell.setStyleRanges ( str.getStyleRanges () ); } }
Example 6
Source File: CloneDiffTooltip.java From JDeodorant with MIT License | 6 votes |
public void update(ViewerCell cell) { Object element = cell.getElement(); if (element instanceof CloneStructureNode){ cell.setText("CloneStructureNode"); } if (element instanceof PreconditionViolation){ PreconditionViolation preconditionViolation = (PreconditionViolation) element; StyledString styledString = preconditionViolation.getStyledViolation(); cell.setText(styledString.getString()); cell.setStyleRanges(styledString.getStyleRanges()); cell.setImage(PRECONDITION_VIOLATION_IMAGE); } if (element instanceof Suggestion){ Suggestion suggestion = (Suggestion) element; cell.setText(suggestion.getSuggestion()); cell.setImage(SUGGESTION_IMAGE); } }
Example 7
Source File: VariantLabelProvider.java From neoscada with Eclipse Public License 1.0 | 6 votes |
@Override public void update ( final ViewerCell cell ) { final DecoratedEvent event = (DecoratedEvent)cell.getElement (); if ( this.decoration != null ) { switch ( this.decoration ) { case ACTOR: this.labelProviderSupport.decorateWithActorType ( event, cell ); break; case MONITOR: this.labelProviderSupport.decorateWithMonitorState ( event, cell ); break; } } if ( this.key != null && !this.key.isEmpty () ) { cell.setText ( this.labelProviderSupport.toLabel ( event, this.key ) ); } }
Example 8
Source File: BusinessObjectDataStyledLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void update(final ViewerCell cell) { super.update(cell); if (cell.getElement() instanceof BusinessObjectData) { final BusinessObjectData data = (BusinessObjectData) cell.getElement(); if (!businessObjectDefinitionExists(data)) { final StyledString styledString = createStrikethroughStyle(cell.getText(), data.getClassName()); cell.setText(styledString.getString()); cell.setStyleRanges(styledString.getStyleRanges()); } } }
Example 9
Source File: DQLabelProvider.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override public void update(ViewerCell cell) { super.update(cell); if (cell == null) return; Object obj = cell.getElement(); int col = cell.getColumnIndex(); cell.setText(getColumnText(obj, col)); cell.setImage(getColumnImage(obj, col)); cell.setForeground(getForeground(obj, col)); cell.setBackground(getBackground(obj, col)); }
Example 10
Source File: EntryTimestampLabelProvider.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override public void update ( final ViewerCell cell ) { final DecoratedEvent event = (DecoratedEvent)cell.getElement (); final String value = this.labelProviderSupport.getDf ().format ( event.getEvent ().getEntryTimestamp () ); cell.setText ( value ); }
Example 11
Source File: JsonTreeLabelProvider.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override public void update(ViewerCell cell) { Object element = cell.getElement(); if (!(element instanceof JsonNode)) return; JsonNode node = (JsonNode) element; StyledString styledString = getStyledText(node); cell.setText(styledString.toString()); cell.setStyleRanges(styledString.getStyleRanges()); cell.setImage(nodeLabelProvider.getImage(node, site)); super.update(cell); }
Example 12
Source File: BuyOrderLabelProvider.java From offspring with MIT License | 5 votes |
@Override public void update(ViewerCell cell) { super.update(cell); IBuyOrder t = (IBuyOrder) cell.getElement(); Object[] data = { null, null, null, null }; getCellData(t, BuyOrderTable.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]); }
Example 13
Source File: SourceTimestampLabelProvider.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override public void update ( final ViewerCell cell ) { final DecoratedEvent event = (DecoratedEvent)cell.getElement (); final String value = this.labelProviderSupport.getDf ().format ( event.getEvent ().getSourceTimestamp () ); cell.setText ( value ); }
Example 14
Source File: ExpressionTypeLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override public void update(final ViewerCell cell) { cell.setText(getText(cell.getElement())); cell.setImage(getImage(cell.getElement())); }
Example 15
Source File: ItemCellLabelProvider.java From neoscada with Eclipse Public License 1.0 | 4 votes |
private void updateListEntry ( final ListEntry listEntry, final ViewerCell cell ) { cell.setFont ( listEntry.getFont () ); cell.setForeground ( listEntry.getForeground () ); cell.setBackground ( listEntry.getBackground () ); switch ( cell.getColumnIndex () ) { case 0: cell.setImage ( listEntry.getImage () ); cell.setText ( listEntry.getDataItem ().getItem ().getId () ); break; case 1: if ( listEntry.getSubscriptionError () != null ) { cell.setText ( String.format ( "%s (%s)", listEntry.getSubscriptionState (), listEntry.getSubscriptionError ().getMessage () ) ); //$NON-NLS-1$ } else { cell.setText ( listEntry.getSubscriptionState ().name () ); } break; case 2: if ( listEntry.getValue () != null ) { cell.setText ( listEntry.getValue ().getType ().name () ); } break; case 3: if ( listEntry.getValue () != null ) { cell.setText ( listEntry.getValue ().asString ( "<null>" ) ); //$NON-NLS-1$ } break; case 4: if ( listEntry.getItemValue () != null ) { final Calendar timestamp = listEntry.getItemValue ().getTimestamp (); if ( timestamp != null ) { cell.setText ( formatTimestamp ( timestamp ) ); } else { cell.setText ( null ); } } break; default: break; } }
Example 16
Source File: ExtractClassWizard.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override public void update(ViewerCell cell) { Field pi= (Field) cell.getElement(); cell.setText(doGetValue(pi)); }
Example 17
Source File: BlockLabelProvider.java From offspring with MIT License | 4 votes |
@Override public void update(ViewerCell cell) { super.update(cell); Block b = (Block) cell.getElement(); switch (BlockTable.getColumns()[cell.getColumnIndex()]) { case BlockTable.COLUMN_HEIGHT: cell.setText(Integer.toString(b.getHeight())); break; case BlockTable.COLUMN_NUMBER_OF_TRANSACTIONS: cell.setText(Integer.toString(b.getTransactions().size())); break; case BlockTable.COLUMN_TOTAL_AMOUNT: cell.setText(Integer.toString(b.getTotalAmount())); break; case BlockTable.COLUMN_TOTAL_FEE: cell.setText(Integer.toString(b.getTotalFee())); break; case BlockTable.COLUMN_PAYLOAD_LENGTH: cell.setText(Formatter.readableFileSize(b.getPayloadLength())); break; case BlockTable.COLUMN_VERSION: cell.setText(Integer.toString(b.getVersion())); break; case BlockTable.COLUMN_BASETARGET: cell.setText(Formatter.formatBaseTarget(b.getBaseTarget()) + " %"); break; case BlockTable.COLUMN_BLOCK: cell.setImage(BLOCK); cell.setText(b.getStringId()); break; case BlockTable.COLUMN_GENERATOR: // cell.setImage(GENERATOR); cell.setText(Long.toString(b.getGeneratorId())); break; case BlockTable.COLUMN_TIMESTAMP: cell.setText(formatTimestamp(b.getTimestamp())); break; default: cell.setText("UNKNOWN " + BlockTable.getColumns()[cell.getColumnIndex()]); } }
Example 18
Source File: JFaceViewerIntegrationExample.java From nebula with Eclipse Public License 2.0 | 4 votes |
@Override public void update(ViewerCell cell) { Person element = (Person) cell.getElement(); cell.setText(element.getGender().toString()); super.update(cell); }
Example 19
Source File: JFaceViewerIntegrationExample.java From nebula with Eclipse Public License 2.0 | 4 votes |
@Override public void update(ViewerCell cell) { Person element = (Person) cell.getElement(); cell.setText(element.getLastName()); super.update(cell); }
Example 20
Source File: ICEMatrixComponentSectionPart.java From ice with Eclipse Public License 1.0 | 2 votes |
/** * <p> * Update is called whenever data is entered into the cell. Current * implementation simply sets the text as what's currently the value on * the Entry * </p> * * @param cell * <p> * The current cell in the TableViewerColumn * </p> * */ @Override public void update(ViewerCell cell) { cell.setText(((RowWrapper) cell.getElement()).getRowWrapper() .get(tableColumn).toString()); }