本文整理汇总了Java中org.eclipse.jface.viewers.ColumnPixelData类的典型用法代码示例。如果您正苦于以下问题:Java ColumnPixelData类的具体用法?Java ColumnPixelData怎么用?Java ColumnPixelData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColumnPixelData类属于org.eclipse.jface.viewers包,在下文中一共展示了ColumnPixelData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyInitialColWidth
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
protected void applyInitialColWidth ( final TableLayout tableLayout )
{
if ( this.initialColWidth != null && !this.initialColWidth.isEmpty () && this.viewer != null && this.initialColWidth.size () != this.viewer.getTree ().getColumnCount () )
{
for ( final Integer w : this.initialColWidth )
{
tableLayout.addColumnData ( new ColumnPixelData ( w, true ) );
}
}
else
{
tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 100, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 100, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) );
}
}
示例2: addAliasColumn
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
private void addAliasColumn(String namespace) {
TreeViewerColumn aliasColumn = new TreeViewerColumn(commandsTreeTable, SWT.NONE);
aliasColumn.getColumn().setText(namespace);
aliasColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
CommandInfo cmd = (CommandInfo) element;
if (cmd.getAbstract()) {
// show a blank line if the command is abstract
return "";
}
List<NamedObjectId> aliases = cmd.getAliasList();
for (NamedObjectId aliase : aliases) {
if (aliase.getNamespace().equals(namespace))
return aliase.getName();
}
return "";
}
});
tcl.setColumnData(aliasColumn.getColumn(), new ColumnPixelData(COLUMN_WIDTH));
}
示例3: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnPixelData(width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TableLabelSorter sorter = (TableLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例4: createTreeViewerColumn
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的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;
}
示例5: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
protected TableViewerColumn createTableViewerColumn(String title, int width, int alignment, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(true);
tableColumnLayout.setColumnData(column, new ColumnPixelData(width, true));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例6: createListField
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
private void createListField() {
String[] buttons = new String[] {
"Add...", "Add Multiple...", "Edit", null, "Remove", null};
resourcesField =
new ListDialogField<ClientBundleResource>(new SelectionAdapter(), buttons,
new ColumnLabelProvider());
resourcesField.setLabelText(labelText);
String[] columnNames = {"File", "Type", "Method name"};
ColumnLayoutData[] columnLayouts = {
new ColumnPixelData(100), new ColumnPixelData(100),
new ColumnPixelData(100)};
resourcesField.setTableColumns(new ListDialogField.ColumnsDescription(
columnLayouts, columnNames, false));
// Edit and Remove buttons disabled by default
resourcesField.enableButton(IDX_EDIT, false);
resourcesField.enableButton(IDX_REMOVE, false);
}
示例7: defineColumn_Description
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的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));
}
示例8: defineColumn_IsVisible
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
/**
* column: marker
*/
private void defineColumn_IsVisible(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.LEAD);
final TableColumn tc = tvc.getColumn();
tc.setText(TOUR_MARKER_COLUMN_IS_VISIBLE);
tc.setToolTipText(TOUR_MARKER_COLUMN_IS_VISIBLE_TOOLTIP);
tvc.setEditingSupport(new MarkerEditingSupport(_markerViewer));
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
cell.setText(tourMarker.isMarkerVisible()
? Messages.App_Label_BooleanYes
: Messages.App_Label_BooleanNo);
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(8), false));
}
示例9: defineColumn_OffsetX
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
/**
* column: horizontal offset
*/
private void defineColumn_OffsetX(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.TRAIL);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_horizontal_offset);
tc.setToolTipText(Messages.Tour_Marker_Column_horizontal_offset_tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
cell.setText(Integer.toString(tourMarker.getLabelXOffset()));
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(6), false));
}
示例10: defineColumn_OffsetY
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
/**
* column: vertical offset
*/
private void defineColumn_OffsetY(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.TRAIL);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_vertical_offset);
tc.setToolTipText(Messages.Tour_Marker_Column_vertical_offset_tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
cell.setText(Integer.toString(tourMarker.getLabelYOffset()));
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(6), false));
}
示例11: defineColumn_Url
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
/**
* Column: Url
*/
private void defineColumn_Url(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.CENTER);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_Url_ShortCut);
tc.setToolTipText(Messages.Tour_Marker_Column_Url_Tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
final String urlAddress = tourMarker.getUrlAddress();
final String urlText = tourMarker.getUrlText();
cell.setText(urlAddress.length() > 0 || urlText.length() > 0 ? //
UI.SYMBOL_STAR
: UI.EMPTY_STRING);
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(4), false));
}
示例12: createColumn
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
@Override
public TableColumnDefinition createColumn( final ColumnManager columnManager,
final PixelConverter pixelConverter) {
final int pixelWidth = pixelConverter.convertWidthInCharsToPixels(8);
final TableColumnDefinition colDef = new TableColumnDefinition(columnManager, "MARKER_MAP_VISIBLE", //$NON-NLS-1$
SWT.CENTER);
colDef.setColumnCategory(Messages.ColumnFactory_Category_Marker);
colDef.setColumnLabel(Messages.Tour_Marker_Column_IsVisible);
colDef.setColumnHeaderText(Messages.Tour_Marker_Column_IsVisible);
colDef.setColumnHeaderToolTipText(Messages.Tour_Marker_Column_IsVisibleNoEdit_Tooltip);
colDef.setDefaultColumnWidth(pixelWidth);
colDef.setColumnWeightData(new ColumnPixelData(pixelWidth, true));
return colDef;
}
示例13: defineColumn_Date
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的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)));
}
示例14: defineColumn_Unit
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
/**
* Column: Unit
*/
private void defineColumn_Unit(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_columnViewer, SWT.LEAD);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.ColumnModifyDialog_column_unit);
tc.setMoveable(true);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final ColumnDefinition colDef = (ColumnDefinition) cell.getElement();
cell.setText(colDef.getColumnUnit());
setColor(cell, colDef);
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(14), true));
}
示例15: defineColumn_Width
import org.eclipse.jface.viewers.ColumnPixelData; //导入依赖的package包/类
/**
* Column: Width
*/
private void defineColumn_Width(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_columnViewer, SWT.TRAIL);
final TableColumn tc = tvc.getColumn();
tc.setMoveable(true);
tc.setText(Messages.ColumnModifyDialog_column_width);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final ColumnDefinition colDef = (ColumnDefinition) cell.getElement();
cell.setText(Integer.toString(colDef.getColumnWidth()));
setColor(cell, colDef);
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(10), true));
}