本文整理汇总了Java中org.eclipse.jface.viewers.TreeViewerColumn.getColumn方法的典型用法代码示例。如果您正苦于以下问题:Java TreeViewerColumn.getColumn方法的具体用法?Java TreeViewerColumn.getColumn怎么用?Java TreeViewerColumn.getColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.TreeViewerColumn
的用法示例。
在下文中一共展示了TreeViewerColumn.getColumn方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
@Override
protected TreeViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout,
final int style) {
final TreeViewer viewer = new TreeViewer(parent, virual ? (style | VIRTUAL) : style);
final Tree tree = viewer.getTree();
tree.setLinesVisible(linesVisible);
tree.setHeaderVisible(headerVisible);
int columnIndex = 0;
for (final String columnLabel : columnLabels) {
final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, NONE);
final TreeColumn column = viewerColumn.getColumn();
columnLayout.setColumnData(column, createColumnLayoutData(columnIndex));
column.setText(columnLabel);
column.setMoveable(moveable);
columnIndex++;
}
return viewer;
}
示例2: createTreeViewerColumn
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private TreeViewerColumn createTreeViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
final TreeColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
columnLayout.setColumnData(column, new ColumnPixelData(width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TreeLabelSorter sorter = (TreeLabelSorter) viewer.getComparator();
TreeColumn selectedColumn = (TreeColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例3: defineColumn_Date
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private void defineColumn_Date(final TreeColumnLayout treeLayout) {
final TreeViewerColumn tvc = new TreeViewerColumn(_tourViewer, SWT.LEAD);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVIWizardCompareYear) {
cell.setText(((TVIWizardCompareYear) element).treeColumn);
} else if (element instanceof TVIWizardCompareMonth) {
cell.setText(((TVIWizardCompareMonth) element).treeColumn);
} else if (element instanceof TVIWizardCompareTour) {
cell.setText(((TVIWizardCompareTour) element).treeColumn);
} else {
cell.setText(UI.EMPTY_STRING);
}
}
});
final TreeColumn tc = tvc.getColumn();
tc.setText(Messages.tourCatalog_wizard_Column_tour);
treeLayout.setColumnData(tc, new ColumnPixelData(convertWidthInCharsToPixels(20)));
}
示例4: createPluginColumns
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private void createPluginColumns(IPluginModelBase pm)
{
// Add columns in the tree one column per selected plugin.
// Create the first column for the key
TreeViewerColumn col = new TreeViewerColumn(tv, SWT.NONE);
TreeColumn swtCol = col.getColumn();
swtCol.setText(getColumnName(pm));
swtCol.setAlignment(SWT.CENTER);
PluginDataProvider labelProvider = new PluginDataProvider();
labelProvider.setPlugin(pm);
col.setLabelProvider(labelProvider);
swtCol.setToolTipText(pm.getBundleDescription().getName());
swtCol.pack();
columnsCache.put(pm, col);
}
示例5: createTreeViewerColumn
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private TreeViewerColumn createTreeViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
final TreeColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
columnLayout.setColumnData(column, new ColumnPixelData(width, resizable));
return viewerColumn;
}
示例6: defineColumn_AltitudeUp
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private void defineColumn_AltitudeUp(final TreeColumnLayout treeLayout) {
final TreeViewerColumn tvc = new TreeViewerColumn(_tourViewer, SWT.TRAIL);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVIWizardCompareTour) {
final TVIWizardCompareTour tourItem = (TVIWizardCompareTour) element;
final long value = (long) (tourItem.colAltitudeUp / net.tourbook.ui.UI.UNIT_VALUE_ALTITUDE);
cell.setText(Long.toString(value));
} else {
cell.setText(UI.EMPTY_STRING);
}
}
});
final TreeColumn tc = tvc.getColumn();
tc.setText(UI.UNIT_LABEL_ALTITUDE);
tc.setToolTipText(Messages.tourCatalog_wizard_Column_altitude_up_tooltip);
treeLayout.setColumnData(tc, new ColumnWeightData(10));
}
示例7: defineColumn_Distance
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private void defineColumn_Distance(final TreeColumnLayout treeLayout) {
final TreeViewerColumn tvc = new TreeViewerColumn(_tourViewer, SWT.TRAIL);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVIWizardCompareTour) {
final TVIWizardCompareTour tourItem = (TVIWizardCompareTour) element;
final float distance = (tourItem.colDistance) / (1000 * net.tourbook.ui.UI.UNIT_VALUE_DISTANCE);
cell.setText(_nf1.format(distance));
} else {
cell.setText(UI.EMPTY_STRING);
}
}
});
final TreeColumn tc = tvc.getColumn();
tc.setText(UI.UNIT_LABEL_DISTANCE);
tc.setToolTipText(Messages.tourCatalog_wizard_Column_distance_tooltip);
treeLayout.setColumnData(tc, new ColumnWeightData(10));
}
示例8: defineColumn_RecordingTime
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private void defineColumn_RecordingTime(final TreeColumnLayout treeLayout) {
final TreeViewerColumn tvc = new TreeViewerColumn(_tourViewer, SWT.TRAIL);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVIWizardCompareTour) {
final TVIWizardCompareTour tourItem = (TVIWizardCompareTour) element;
final long recordingTime = tourItem.colRecordingTime;
cell.setText(String.format(//
Messages.Format_hhmm,
(recordingTime / 3600),
((recordingTime % 3600) / 60)));
} else {
cell.setText(UI.EMPTY_STRING);
}
}
});
final TreeColumn tc = tvc.getColumn();
tc.setText(Messages.tourCatalog_wizard_Column_h);
tc.setToolTipText(Messages.tourCatalog_wizard_Column_h_tooltip);
treeLayout.setColumnData(tc, new ColumnWeightData(10));
}
示例9: createTableViewerColumn
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private TreeViewerColumn createTableViewerColumn(String title, int width, final int colNumber) {
final TreeViewerColumn viewerColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(width);
column.setResizable(true);
column.setMoveable(false);
return viewerColumn;
}
示例10: createFrameValueColumn
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private ValueColumn createFrameValueColumn(final TreeViewer treeViewer, final VariableContentProvider contentProvider) {
final ValueCellLabelProvider valueLabelProvider = new ValueCellLabelProvider(contentProvider);
final TreeViewerColumn valueColumn = new TreeViewerColumn(treeViewer, SWT.NONE, treeViewer.getTree().getColumnCount());
valueColumn.getColumn().setWidth(100);
valueColumn.getColumn().setText("Step ####");
valueColumn.getColumn().setResizable(false);
valueColumn.setLabelProvider(valueLabelProvider);
valueColumn.getColumn().addControlListener(resizeListener);
valueColumn.getColumn().addSelectionListener(valueColumnSelectedListener);
return new ValueColumn(valueColumn.getColumn(), valueLabelProvider);
}
示例11: build
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
/**
* Builds the column and returns the TreeViewerColumn
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public TreeViewerColumn build() {
// create column
TreeViewerColumn viewerColumn = new TreeViewerColumn(builder.getViewer(), style);
TreeColumn column = viewerColumn.getColumn();
if (headerText != null) {
column.setText(headerText);
}
column.setMoveable(moveable);
column.setResizable(resizable);
// set label provider
if (cellLabelProvider != null) {
viewerColumn.setLabelProvider(cellLabelProvider);
}
else {
if (propertyName == null) {
viewerColumn.setLabelProvider(new ColumnLabelProvider());
}
else {
PropertyDescriptor descriptor = builder.getPropertyDescriptor(propertyName);
viewerColumn.setLabelProvider(new PropertyCellLabelProvider(descriptor, valueFormatter));
}
}
// set editing support
if (editingSupport != null) {
viewerColumn.setEditingSupport(editingSupport);
}
return viewerColumn;
}
示例12: createPartControl
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent){
parent.setLayout(new GridLayout(1, false));
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
TreeColumnLayout tcl_composite = new TreeColumnLayout();
composite.setLayout(tcl_composite);
treeViewer = new TreeViewer(composite, SWT.BORDER);
Tree tree = treeViewer.getTree();
TreeViewerColumn treeViewerColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
TreeColumn trclmnNewColumn = treeViewerColumn.getColumn();
tcl_composite.setColumnData(trclmnNewColumn, new ColumnWeightData(100));
trclmnNewColumn.setText("New Column");
treeViewer.setLabelProvider(new KonsultationenTreeLabelProvider());
treeViewer.setContentProvider(new KonsultationenTreeContentProvider(treeViewer));
treeViewer.setInput("0");
treeViewer.addDoubleClickListener(new KonsultationsbelegAnzeigen());
MenuManager menuManager = new MenuManager();
menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
tree.setMenu(menuManager.createContextMenu(tree));
getSite().registerContextMenu(menuManager, treeViewer);
getSite().setSelectionProvider(treeViewer);
Composite composite_1 = new Composite(parent, SWT.NONE);
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
composite_1.setLayout(new GridLayout(4, false));
Label lblOfflineNachsignaturen = new Label(composite_1, SWT.NONE);
lblOfflineNachsignaturen.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
lblOfflineNachsignaturen.setText("Gespeicherte Offline-Nachsignaturen: ");
lblOFFLINENACHSIGNATUREN = new Label(composite_1, SWT.NONE);
GridData gd_lblOFFLINENACHSIGNATUREN = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_lblOFFLINENACHSIGNATUREN.widthHint = 25;
lblOFFLINENACHSIGNATUREN.setLayoutData(gd_lblOFFLINENACHSIGNATUREN);
lblOFFLINENACHSIGNATUREN.setText("n/a");
Label lblGespeicherteOfflineKonsultationen = new Label(composite_1, SWT.NONE);
lblGespeicherteOfflineKonsultationen.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
lblGespeicherteOfflineKonsultationen.setText("Gespeicherte Offline Konsultationen:");
lblGESPEICHERTEKONSULTATIONEN = new Label(composite_1, SWT.NONE);
GridData gd_lblGESPEICHERTEKONSULTATIONEN = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_lblGESPEICHERTEKONSULTATIONEN.widthHint = 25;
lblGESPEICHERTEKONSULTATIONEN.setLayoutData(gd_lblGESPEICHERTEKONSULTATIONEN);
lblGESPEICHERTEKONSULTATIONEN.setText("n/a");
m_bindingContext = initDataBindings();
}
示例13: defineColumn_Opacity
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
/**
* column: marker
*/
private void defineColumn_Opacity(final TreeColumnLayout treeLayout) {
final TreeViewerColumn tvc = new TreeViewerColumn(_layerViewer, SWT.CENTER);
final TreeColumn tc = tvc.getColumn();
tc.setText(Messages.Map3Layer_Viewer_Column_Opacity);
tc.setToolTipText(Messages.Map3Layer_Viewer_Column_Opacity_Tooltip);
_opacityEditingSupport = new OpacityEditingSupport(_layerViewer);
tvc.setEditingSupport(_opacityEditingSupport);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final Object element = cell.getElement();
if (element instanceof TVIMap3Layer) {
final TVIMap3Layer layerItem = (TVIMap3Layer) element;
final float opacity = layerItem.getOpacity();
final String opacityText;
if (layerItem.canSetOpacity()) {
if (layerItem.isLayerVisible) {
if (opacity == 1.0) {
opacityText = UI.SYMBOL_FULL_BLOCK;
} else {
opacityText = _nf2.format(opacity);
}
} else {
// layer is hidden
opacityText = UI.EMPTY_STRING;
}
} else {
// opacity cannot be set
opacityText = OPACITY_CAN_NOT_BE_SET;
}
cell.setText(opacityText);
}
}
});
treeLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(8), false));
}
示例14: createColumns
import org.eclipse.jface.viewers.TreeViewerColumn; //导入方法依赖的package包/类
private void createColumns() {
GC gc = new GC(getTree().getParent());
List<Integer> widths = new ArrayList<Integer>();
for (final IGenericTableColumn c : table.getColumns()) {
TreeViewerColumn viewerColumn = new TreeViewerColumn(this, SWT.NONE);
viewerColumn.setLabelProvider(new GenericLabelProvider(c
.getDataProvider()));
if (c.getEditable()) {
viewerColumn.setEditingSupport(c.getEditingSupport(this));
}
TreeColumn column = viewerColumn.getColumn();
if (c.getSortable() && comparator != null) {
column.addSelectionListener(getSelectionAdapter(column, c));
}
column.setText(c.getLabel());
column.setAlignment(c.getAlignMent());
int width;
if (c.getWidth() != -1) {
width = c.getWidth();
}
else if (c.getTextExtent() != null
&& c.getLabel().length() < c.getTextExtent().length()) {
width = gc.textExtent(c.getTextExtent()).x + 2;
}
else {
width = gc.textExtent(c.getLabel()).x + 2;
}
widths.add(width);
column.setWidth(width);
column.setResizable(c.getResizable());
}
gc.dispose();
// /* All columns have their prefered width set now calculate percentages */
// TreeColumnLayout layout = new TreeColumnLayout();
// for (int i = 0; i < widths.size(); i++) {
// layout.setColumnData(getTree().getColumns()[i], new ColumnWeightData(
// widths.get(i), widths.get(i), true));
// }
// getTree().getParent().setLayout(layout);
}