当前位置: 首页>>代码示例>>Java>>正文


Java ViewerCell.getColumnIndex方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.ViewerCell.getColumnIndex方法的典型用法代码示例。如果您正苦于以下问题:Java ViewerCell.getColumnIndex方法的具体用法?Java ViewerCell.getColumnIndex怎么用?Java ViewerCell.getColumnIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.ViewerCell的用法示例。


在下文中一共展示了ViewerCell.getColumnIndex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: getFocusCellIndex

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
public static final Point getFocusCellIndex(final TableViewer viewer) {
    try {
        if (viewer.getColumnViewerEditor() != null) {
            final ViewerCell focusCell = viewer.getColumnViewerEditor().getFocusCell();

            if (focusCell != null) {
                final int x = focusCell.getColumnIndex();
                final int y = viewer.getTable().indexOf((TableItem) focusCell.getItem());

                return new Point(x, y);
            }
        }
    } catch (final Exception e) {
        log.warn("Could not determine cell index", e); //$NON-NLS-1$
    }

    return new Point(-1, -1);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:19,代码来源:CellEditorAccessibility.java

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@Override
public void update ( final ViewerCell cell )
{
    final Object o = cell.getElement ();
    if ( o instanceof Event )
    {
        final Event info = (Event)o;

        switch ( cell.getColumnIndex () )
        {
            case 0:
                cell.setText ( this.dateFormat.format ( info.getSourceTimestamp () ) );
                break;
            case 1:
                cell.setText ( this.dateFormat.format ( info.getEntryTimestamp () ) );
                break;
            case 2:
                cell.setText ( getAttributes ( info, Event.Fields.SOURCE.getName () ).asString ( "" ) );
                break;
            case 3:
                cell.setText ( getAttributes ( info, Event.Fields.MONITOR_TYPE.getName () ).asString ( "" ) );
                break;
            case 4:
                cell.setText ( getAttributes ( info, Event.Fields.EVENT_TYPE.getName () ).asString ( "" ) );
                break;
            case 5:
                cell.setText ( getAttributes ( info, Event.Fields.ACTOR_NAME.getName () ).asString ( "" ) );
                break;
            case 6:
                cell.setText ( getAttributes ( info, Event.Fields.VALUE.getName () ).asString ( "" ) );
                break;
            case 7:
                cell.setText ( getAttributes ( info, Event.Fields.MESSAGE.getName () ).asString ( "" ) );
                break;
        }
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:38,代码来源:EventsLabelProvider.java

示例10: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@Override
public void update ( final ViewerCell cell )
{
    final Map.Entry<?, ?> cfg = (Map.Entry<?, ?>)cell.getElement ();
    switch ( cell.getColumnIndex () )
    {
    case 0:
        cell.setText ( "" + cfg.getKey () );
        break;
    case 1:
        cell.setText ( "" + cfg.getValue () );
        break;
    }
    super.update ( cell );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:ConfigurationCellLabelProvider.java

示例11: getCellId

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
private Point getCellId(Point mouseLocation,TableViewer tableViewer){
	ViewerCell cell = tableViewer.getCell(mouseLocation);
	if(cell==null){
		return null;
	}
	int columnIndex = cell.getColumnIndex();				
	int rowIndex = tableViewer.getTable().indexOf((TableItem)cell.getItem())  ;
	return new Point(rowIndex, columnIndex);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:DebugDataViewer.java

示例12: getDummyColumn

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
private CellLabelProvider getDummyColumn(final TableViewer tableViewer,	final List<Condition> conditionsList, final Integer columnIndex,final TreeMap<Integer, List<List<Integer>>> groupSelectionMap) {
	return new CellLabelProvider() {

		@Override
		public void update(ViewerCell cell) {
			final TableItem item = (TableItem) cell.getItem();
			List<List<Integer>> checkedGrpRowIndices = groupSelectionMap.get(columnIndex);
			if (cell.getColumnIndex() == (columnIndex + 3)) {
				if (null != checkedGrpRowIndices
						&& !checkedGrpRowIndices.isEmpty()) {
					List tempList = new ArrayList();
					for (List<Integer> checkedIndex : checkedGrpRowIndices) {
						tempList.addAll(checkedIndex);
					}
					int indexOf = tableViewer.getTable().indexOf(item);
					if(tempList.contains(indexOf)){
						for (int i = 0; i < checkedGrpRowIndices.size(); i++) {
							if((checkedGrpRowIndices.get(i)).contains(indexOf)){
								cell.setBackground(FilterHelper.INSTANCE.getColor(i));
								break;
							}
						}	
					}
					else{
						cell.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,255,255));
					}
				}
			}
		}
	};
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:FilterConditionsDialog.java

示例13: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@Override
	public void update(ViewerCell cell) {
		ColConfig cf = OldKeywordSpottingComposite.COLUMNS[cell.getColumnIndex()];
		Object element = cell.getViewerRow().getElement();
//		logger.trace("column = "+cf.name);
		 
		String text = KwsTreeLabelProvider.getTextForElement(element, cell.getColumnIndex());
		cell.setText(text);
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:10,代码来源:KwsTreeLabelProvider.java

示例14: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@Override
	public void update(ViewerCell cell) {
		ColConfig cf = StructureTreeWidget.COLUMNS[cell.getColumnIndex()];
		Object element = cell.getViewerRow().getElement();
//		logger.trace("column = "+cf.name);
		 
		String text = StructureTreeLabelProvider.getTextForElement(element, cell.getColumnIndex());
		cell.setText(text);
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:10,代码来源:StructureTreeLabelProvider.java

示例15: handleMouseClicks

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
private void handleMouseClicks(boolean isDoubleClick, Event event) {
		Point pt = new Point(event.x, event.y);
		ViewerCell cell = tableViewer.getCell(pt);
		if (cell == null)
			return;
		
		int row = table.getSelectionIndex();
		int col = cell.getColumnIndex();
		
		if ( (isDoubleClick || row > 0) && !cell.getText().isEmpty() ) {
			System.out.println("Item " + row + "-" + col);
			editIndex = col;
			editedIndices.add(col);
			
			EditType type = EditType.REPLACE;
			
//			String txt = cell.getText();
			List<String> firstRow = (List<String>) tableViewer.getElementAt(0);
			List<String> editRow = (List<String>) cell.getElement();
			
			String newSentence = "";
			String text = "";
			for (int i=0; i<firstRow.size(); ++i) {
				if (col == i) {
					text = editRow.get(i);
					newSentence += text+" ";
					if (firstRow.get(i).isEmpty())
						type = EditType.ADD;
				}
				else {
					newSentence += firstRow.get(i)+" ";
				}
			}
			newSentence = newSentence.trim();
			
			sendEditEvent(col, text, type, isDoubleClick);
		}
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:39,代码来源:WordGraphEditor.java


注:本文中的org.eclipse.jface.viewers.ViewerCell.getColumnIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。