本文整理匯總了Java中org.eclipse.jface.viewers.CellLabelProvider類的典型用法代碼示例。如果您正苦於以下問題:Java CellLabelProvider類的具體用法?Java CellLabelProvider怎麽用?Java CellLabelProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CellLabelProvider類屬於org.eclipse.jface.viewers包,在下文中一共展示了CellLabelProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DecoratingColumLabelProvider
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Constructor.
*
* @param labelProvider
* the {@link ILabelProvider} to decorate
* @param labelDecorator
* the {@link ILabelDecorator} adding decoration
*/
public DecoratingColumLabelProvider(ILabelProvider labelProvider, ILabelDecorator labelDecorator) {
this.labelProvider = labelProvider;
if (labelProvider instanceof IFontProvider) {
this.fontProvider = (IFontProvider)labelProvider;
} else {
this.fontProvider = null;
}
if (labelProvider instanceof IColorProvider) {
this.colorProvider = (IColorProvider)labelProvider;
} else {
this.colorProvider = null;
}
this.labelDecorator = labelDecorator;
if (labelDecorator instanceof CellLabelProvider) {
this.cellLabelProvider = (CellLabelProvider)labelDecorator;
} else {
this.cellLabelProvider = null;
}
}
示例2: defineColumn_Powertrain_AvgRightTorqueEffectiveness
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: AvgRightTorqueEffectiveness
*/
private void defineColumn_Powertrain_AvgRightTorqueEffectiveness() {
final TreeColumnDefinition colDef = TreeColumnFactory.POWERTRAIN_AVG_RIGHT_TORQUE_EFFECTIVENESS.createColumn(
_columnManager,
_pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
final double value = ((TVITourBookItem) element).colPower_AvgRightTorqueEffectiveness;
colDef.printDoubleValue(cell, value, element instanceof TVITourBookTour);
setCellColor(cell, element);
}
});
}
示例3: defineColumn_Speed
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: speed
*/
private void defineColumn_Speed() {
final TreeColumnDefinition colDef = TreeColumnFactory.MOTION_AVG_SPEED.createColumn(_columnManager, _pc);
colDef.setIsDefaultColumn();
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVICatalogComparedTour) {
final double value = ((TVICatalogComparedTour) element).tourSpeed / UI.UNIT_VALUE_DISTANCE;
colDef.printDoubleValue(cell, value, element instanceof TVICatalogComparedTour);
}
}
});
}
示例4: defineColumn_Time_TimeZoneDifference
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: Timezone difference
*/
private void defineColumn_Time_TimeZoneDifference() {
_timeZoneOffsetColDef = TableColumnFactory.TIME_TIME_ZONE_DIFFERENCE.createColumn(_columnManager, _pc);
_timeZoneOffsetColDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourData tourData = (TourData) cell.getElement();
final TourDateTime tourDateTime = tourData.getTourDateTime();
cell.setText(tourDateTime.timeZoneOffsetLabel);
}
});
}
示例5: defineColumn_10_Checkbox
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: Show only the checkbox
*/
private void defineColumn_10_Checkbox() {
final TableViewerColumn tvc = new TableViewerColumn(_colorViewer, SWT.LEAD);
final TableColumn tc = tvc.getColumn();
tc.setWidth(_pc.convertWidthInCharsToPixels(COLUMN_WITH_NAME));
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof Map3GradientColorProvider) {
final Map3ColorProfile colorProfile = ((Map3GradientColorProvider) (element)).getMap3ColorProfile();
cell.setText(colorProfile.getProfileName());
}
}
});
}
示例6: defineColumn_Altitude_Up
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: altitude up (m)
*/
private void defineColumn_Altitude_Up() {
final TreeColumnDefinition colDef = TreeColumnFactory.ALTITUDE_UP.createColumn(_columnManager, _pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVITagViewTagCategory) {
return;
}
final long dbAltitudeUp = ((TVITagViewItem) element).colAltitudeUp;
final double value = dbAltitudeUp / UI.UNIT_VALUE_ALTITUDE;
colDef.printValue_0(cell, value);
setCellColor(cell, element);
}
});
}
示例7: defineColumn_30_ColorImage
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: Color image
*/
private void defineColumn_30_ColorImage() {
final TableViewerColumn tvc = new TableViewerColumn(_colorViewer, SWT.LEAD);
final TableColumn tc = tvc.getColumn();
tc.setWidth(_pc.convertWidthInCharsToPixels(COLUMN_WITH_COLOR_IMAGE));
_tcProfileImage = tc;
_columnIndexProfileImage = _colorViewer.getTable().getColumnCount() - 1;
tc.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
onResizeImageColumn();
}
});
tvc.setLabelProvider(new CellLabelProvider() {
// !!! set dummy label provider, otherwise an error occures !!!
@Override
public void update(final ViewerCell cell) {}
});
}
示例8: defineColumn_Motion_Distance
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: distance
*/
private void defineColumn_Motion_Distance() {
final TreeColumnDefinition colDef = TreeColumnFactory.MOTION_DISTANCE.createColumn(_columnManager, _pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVICompareResultComparedTour) {
final TVICompareResultComparedTour compareItem = (TVICompareResultComparedTour) element;
final float value = compareItem.compareDistance / (1000 * net.tourbook.ui.UI.UNIT_VALUE_DISTANCE);
colDef.printDetailValue(cell, value);
setCellColor(cell, element);
}
}
});
}
示例9: defineColumn_Altitude
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: Altitude
*/
private void defineColumn_Altitude() {
final ColumnDefinition colDef = TableColumnFactory.ALTITUDE_ALTITUDE.createColumn(_columnManager, _pc);
// overwrite column id to identify the column when table is sorted
colDef.setColumnId(COLUMN_ALTITUDE);
colDef.setColumnSelectionListener(_columnSortListener);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
String valueText;
final float altitude = ((TourMarkerItem) cell.getElement()).altitude;
if (altitude == TourDatabase.DEFAULT_FLOAT) {
valueText = UI.EMPTY_STRING;
} else {
valueText = _nf1.format(altitude / net.tourbook.ui.UI.UNIT_VALUE_ALTITUDE);
}
cell.setText(valueText);
}
});
}
示例10: defineColumn_Motion_AvgSpeed
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: avg speed km/h - mph
*/
private void defineColumn_Motion_AvgSpeed() {
final TreeColumnDefinition colDef = TreeColumnFactory.MOTION_AVG_SPEED.createColumn(_columnManager, _pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
final double value = ((TVITourBookItem) element).colAvgSpeed / net.tourbook.ui.UI.UNIT_VALUE_DISTANCE;
colDef.printDoubleValue(cell, value, element instanceof TVITourBookTour);
setCellColor(cell, element);
}
});
}
示例11: defineColumn_Power_Max
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: max power
*/
private void defineColumn_Power_Max() {
final TreeColumnDefinition colDef = TreeColumnFactory.POWER_MAX.createColumn(_columnManager, _pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
final int value = ((TVITourBookItem) element).colPower_Max;
colDef.printDoubleValue(cell, value, element instanceof TVITourBookTour);
setCellColor(cell, element);
}
});
}
示例12: defineColumn_Body_Person
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* column: person
*/
private void defineColumn_Body_Person() {
final TreeColumnDefinition colDef = TreeColumnFactory.BODY_PERSON.createColumn(_columnManager, _pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVITourBookTour) {
final long dbPersonId = ((TVITourBookTour) element).colPersonId;
cell.setText(PersonManager.getPersonName(dbPersonId));
}
}
});
}
示例13: defineColumn_Description
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: Description
*/
private void defineColumn_Description(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.CENTER);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_Description_ShortCut);
tc.setToolTipText(Messages.Tour_Marker_Column_Description_Tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
final String description = tourMarker.getDescription();
cell.setText(description.length() == 0 ? UI.EMPTY_STRING : UI.SYMBOL_STAR);
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(4), false));
}
示例14: defineColumn_Powertrain_Gear_RearShiftCount
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: Rear shift count.
*/
private void defineColumn_Powertrain_Gear_RearShiftCount() {
final TreeColumnDefinition colDef = TreeColumnFactory.POWERTRAIN_GEAR_REAR_SHIFT_COUNT.createColumn(
_columnManager,
_pc);
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
final int value = ((TVICollatedTour) element).colRearShiftCount;
colDef.printValue_0(cell, value);
setCellColor(cell, element);
}
});
}
示例15: defineColumn_Waypoint_Description
import org.eclipse.jface.viewers.CellLabelProvider; //導入依賴的package包/類
/**
* Column: Description
*/
private void defineColumn_Waypoint_Description() {
final ColumnDefinition colDef = TableColumnFactory.WAYPOINT_DESCRIPTION.createColumn(_columnManager, _pc);
colDef.setIsDefaultColumn();
colDef.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker marker = (TourMarker) cell.getElement();
cell.setText(marker.getDescription());
}
});
}