當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewerCell.setText方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.ViewerCell.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewerCell.setText方法的具體用法?Java ViewerCell.setText怎麽用?Java ViewerCell.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.ViewerCell的用法示例。


在下文中一共展示了ViewerCell.setText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
  public void update(ViewerCell cell) {

      AvroNode node = nodeConverter.convertToAvroNode(cell.getElement());
      
String text = labelProvider.getText(node);
      Image image = labelProvider.getImage(node);
      StyleRange[] styleRanges = labelProvider.getStyleRanges(node);

      cell.setText(text);
cell.setImage(image);
      cell.setStyleRanges(styleRanges);

      Color backgroundColor = labelProvider.getBackgroundColor(node);
      if (backgroundColor != null) {
      	cell.setBackground(backgroundColor);
      }
      
      super.update(cell);
  }
 
開發者ID:Talend,項目名稱:avro-schema-editor,代碼行數:21,代碼來源:SchemaViewerStyledCellLabelProvider.java

示例2: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@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 ) );
    }

}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:25,代碼來源:VariantLabelProvider.java

示例3: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@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 () );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:FlagsDetailsPart.java

示例4: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update ( final ViewerCell cell )
{
    final ConfigurationDescriptor cfg = (ConfigurationDescriptor)cell.getElement ();
    switch ( cell.getColumnIndex () )
    {
    case 0:
        cell.setText ( cfg.getConfigurationInformation ().getId () );
        break;
    case 1:
        cell.setText ( "" + cfg.getConfigurationInformation ().getState () );
        break;
    }

    if ( cfg.getConfigurationInformation ().getErrorInformation () != null )
    {
        cell.setBackground ( Display.getCurrent ().getSystemColor ( SWT.COLOR_RED ) );
    }
    else
    {
        cell.setBackground ( null );
    }

    super.update ( cell );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:FactoryCellLabelProvider.java

示例5: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update ( final ViewerCell cell )
{
    final Entry entry = (Entry)cell.getElement ();
    switch ( cell.getColumnIndex () )
    {
    case 0:
        cell.setText ( entry.getHandlerName () );
        break;
    case 1:
        cell.setText ( entry.getState ().toString () );
        break;
    case 2:
        final String errorText = makeError ( entry.getError () );
        // only update when we have an error to prevent
        // the error from disapearing
        if ( errorText != null )
        {
            cell.setText ( errorText );
        }
        break;
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:ConnectionAnalyzer.java

示例6: updateAttributePair

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:ItemCellLabelProvider.java

示例7: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update ( final ViewerCell cell )
{
    final Object element = cell.getElement ();
    if ( element instanceof TreeNode )
    {
        final TreeNode node = (TreeNode)element;
        cell.setText ( node.getName () );

        final CurrentStyle style = node.getStyle ();
        cell.setImage ( style.image );
        cell.setFont ( style.font );
        cell.setForeground ( style.foreground );
        cell.setBackground ( style.background );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:NameLabelProviderImpl.java

示例8: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update(final ViewerCell cell) {
    final Object element = cell.getElement();

    if (element instanceof ImportEclipseProject) {
        final ImportEclipseProject project = (ImportEclipseProject) element;

        if (project.isDamaged()) {
            cell.setText(Messages.getString("GitImportWizardSelectProjectsPage.ProjectDamaged")); //$NON-NLS-1$
            setCellFontStyle(cell, SWT.ITALIC);
        } else {
            cell.setText(project.getProjectName());
        }

        if (!canImport(project)) {
            setCellForeground(cell, SWT.COLOR_GRAY);
        }
    }
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:20,代碼來源:GitImportWizardSelectProjectsPage.java

示例9: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
public void update(ViewerCell cell) {
	Object element = cell.getElement();

	if (!(element instanceof ItemsListSeparator)
			&& provider instanceof IStyledLabelProvider) {
		IStyledLabelProvider styledLabelProvider = (IStyledLabelProvider) provider;
		StyledString styledString = getStyledText(element,
				styledLabelProvider);

		cell.setText(styledString.getString());
		cell.setStyleRanges(styledString.getStyleRanges());
		cell.setImage(styledLabelProvider.getImage(element));
	} else {
		cell.setText(getText(element));
		cell.setImage(getImage(element));
	}
	cell.setFont(getFont(element));
	cell.setForeground(getForeground(element));
	cell.setBackground(getBackground(element));

	super.update(cell);
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:23,代碼來源:FilteredItemsSelectionDialog.java

示例10: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
   public void update(ViewerCell cell) {
	if(!(cell.getElement() instanceof TreeNode)) {
		final String text = String.format(
				"(%s, %s)", 
				cell.getElement(),
				cell.getColumnIndex()
		);
		cell.setText(text);
		super.update(cell);
		return;
	}

	final TreeNode node = (TreeNode)cell.getElement();
	final int columnIndex = cell.getColumnIndex();
    final StyledString styledText = getStyledText(node, columnIndex);
    
    if(columnIndex == Column.CAPTION.ordinal()) {
           cell.setImage(getImage(node));
       }
    
	cell.setText(styledText.toString());
	cell.setStyleRanges(styledText.getStyleRanges());
	super.update(cell);
}
 
開發者ID:insweat,項目名稱:hssd,代碼行數:26,代碼來源:ValueTreeLP.java

示例11: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
/**
 * @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
 */
@Override
public void update(final ViewerCell cell) {
	final CSVRow element = (CSVRow) cell.getElement();
	final int index = cell.getColumnIndex();
	final String columnText = getColumnText(element, index);
	cell.setText(columnText);
	cell.setImage(null);
	if (searchText != null && searchText.length() > 0) {
		final int intRangesCorrectSize[] = SearchResultStyle.getSearchTermOccurrences(searchText, columnText);
		final List<StyleRange> styleRange = new ArrayList<StyleRange>();
		for (int i = 0; i < intRangesCorrectSize.length / 2; i++) {
			final StyleRange myStyleRange = new StyleRange(0, 0, null, searchColor);
			myStyleRange.start = intRangesCorrectSize[i];
			myStyleRange.length = intRangesCorrectSize[++i];
			styleRange.add(myStyleRange);
		}
		cell.setStyleRanges(styleRange.toArray(new StyleRange[styleRange.size()]));
	} else {
		cell.setStyleRanges(null);
	}

	super.update(cell);
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:27,代碼來源:CSVLabelProvider.java

示例12: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update(ViewerCell cell) {
	try {
		Object element = cell.getElement();
		StyledString st = getStyledText(element);
		cell.setText(st.getString());
		cell.setStyleRanges(getStyledText(element).getStyleRanges());
		cell.setImage(getImage(element));
		cell.setBackground(getBackground(element));
		cell.setForeground(getForeground(element));
		cell.setFont(getFont(element));
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:17,代碼來源:ReportTreeLabelProvider.java

示例13: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update ( final ViewerCell cell )
{
    final Object element = cell.getElement ();
    final Object value = this.attributeMaps[0].get ( element );
    cell.setText ( value == null ? "" : value.toString () ); //$NON-NLS-1$
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:8,代碼來源:ObservableMapStyledCellLabelProvider.java

示例14: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update ( final ViewerCell cell )
{
    if ( cell.getElement () instanceof ConnectionInformationProvider )
    {
        final ConnectionInformationProvider provider = (ConnectionInformationProvider)cell.getElement ();
        switch ( cell.getColumnIndex () )
        {
            case 0:
                cell.setText ( provider.getLabel () );
                break;
        }
    }
    else if ( cell.getElement () instanceof InformationBean )
    {
        final InformationBean bean = (InformationBean)cell.getElement ();
        switch ( cell.getColumnIndex () )
        {
            case 0:
                cell.setText ( bean.getLabel () );
                break;
            case 1:
                cell.setText ( format ( bean.getValue () ) );
                break;
            case 2:
                cell.setText ( format ( bean.getMin () ) );
                break;
            case 3:
                cell.setText ( format ( bean.getMax () ) );
                break;
        }
    }
    super.update ( cell );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:35,代碼來源:LabelProvider.java

示例15: update

import org.eclipse.jface.viewers.ViewerCell; //導入方法依賴的package包/類
@Override
public void update ( final ViewerCell cell )
{
    final Object o = cell.getElement ();
    if ( o instanceof MonitorStatusBean )
    {
        final MonitorStatusBean info = (MonitorStatusBean)o;
        switch ( cell.getColumnIndex () )
        {
            case 0: // id
                cell.setText ( info.getId () );
                break;
            case 1: // state
                cell.setText ( info.getStatus ().toString () );
                break;
            case 2: // timestamp
                cell.setText ( getTimestamp ( info.getStatusTimestamp () ) );
                break;
            case 3: // priority
                cell.setText ( getAttribute ( info.getAttributes (), "priority", "<none>" ) );
                break;
            case 4: // value
                cell.setText ( getValue ( info.getValue (), "<none>" ) );
                break;
            case 5: // ack user
                cell.setText ( info.getLastAknUser () != null ? info.getLastAknUser () : "<unknown>" );
                break;
            case 6: // ack timestamp
                cell.setText ( getTimestamp ( info.getLastAknTimestamp () ) );
                break;
            case 7: // fail timestamp
                cell.setText ( getTimestamp ( info.getLastFailTimestamp () ) );
                break;
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:37,代碼來源:MonitorsLabelProvider.java


注:本文中的org.eclipse.jface.viewers.ViewerCell.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。