本文整理匯總了Java中org.eclipse.swt.widgets.TreeColumn.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeColumn.setText方法的具體用法?Java TreeColumn.setText怎麽用?Java TreeColumn.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.TreeColumn
的用法示例。
在下文中一共展示了TreeColumn.setText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createViewer
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的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: createColumns
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
protected void createColumns ( final Tree tree )
{
final TreeColumn typeFilterColumn = new TreeColumn ( tree, SWT.NONE );
typeFilterColumn.setText ( getString ( "_UI_TypeFilterColumn_label" ) ); //$NON-NLS-1$
typeFilterColumn.setResizable ( true );
typeFilterColumn.setWidth ( 200 );
final TreeColumn idFilterColumn = new TreeColumn ( tree, SWT.NONE );
idFilterColumn.setText ( getString ( "_UI_IdFilterColumn_label" ) ); //$NON-NLS-1$
idFilterColumn.setResizable ( true );
idFilterColumn.setWidth ( 200 );
final TreeColumn actionFilterColumn = new TreeColumn ( tree, SWT.NONE );
actionFilterColumn.setText ( getString ( "_UI_ActionFilterColumn_label" ) ); //$NON-NLS-1$
actionFilterColumn.setResizable ( true );
actionFilterColumn.setWidth ( 200 );
}
示例3: SystemTree
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* Create a new tree listing Solr system information.
*
* @param composite
* Parent composite.
*/
public SystemTree(Composite composite) throws SophieException {
// Instantiate Tree.
tree = new Tree(composite, SWT.BORDER);
tree.setHeaderVisible(true);
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
// Create name/value columns.
columnName = new TreeColumn(tree, SWT.LEFT);
columnName.setText("Name");
columnValue = new TreeColumn(tree, SWT.LEFT);
columnValue.setText("Value");
// Populate tree with data from Solr.
populate();
// Pack columns.
columnName.pack();
columnValue.pack();
}
示例4: defineColumn_Date
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的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)));
}
示例5: createPluginColumns
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的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);
}
示例6: update
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* Prepare view depending on the current config setting E.g. displaying
* and hiding columns, Setting column labels etc.
*/
public void update(){
if(viewer != null){
// Set the model to display
viewer.setInput(getModel());
viewer.refresh(true);
if(expandCItem != null){
// sync set the viewmode button
expandCItem.enable(viewMode == ViewMode.Group);
}
TreeColumn col = colFactory.getColumn(ColumnDesc.GroupRepository);
if(col == null){
return;
}
if(viewMode == ViewMode.Repository){
// Showing repositories only (no groups)
col.setText("Repository");
col.setToolTipText("Name of the repository");
}
else{
// Showing groups
col.setText("Group / Repository");
col.setToolTipText("Name of the group and its repositories");
}
}
}
示例7: getListControl
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* Returns this field editor's list control.
*
* @param parent the parent control
* @return the list control
*/
public Tree getListControl(Composite parent) {
if (treeWithInterpreters == null) {
treeWithInterpreters = new Tree(parent, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
treeWithInterpreters.setHeaderVisible(true);
TreeColumn column1 = new TreeColumn(treeWithInterpreters, SWT.LEFT);
column1.setText("Name");
column1.setWidth(200);
TreeColumn column2 = new TreeColumn(treeWithInterpreters, SWT.LEFT);
column2.setText("Location");
column2.setWidth(200);
treeWithInterpreters.setFont(parent.getFont());
treeWithInterpreters.addSelectionListener(getSelectionListener());
treeWithInterpreters.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
treeWithInterpreters = null;
}
});
} else {
checkParent(treeWithInterpreters, parent);
}
return treeWithInterpreters;
}
示例8: createGroupAvailableIndicatorGroupss
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* This method initializes groupCurrentLink
*
*/
private void createGroupAvailableIndicatorGroupss() {
groupAvailableIndicatorGroups = new Group(shell, SWT.NONE);
groupAvailableIndicatorGroups.setText(Messages.getString("IndicatorGroupDialog.groupAvailableIndicatorGroups")); //$NON-NLS-1$
groupAvailableIndicatorGroups.setBounds(new Rectangle(5, 86, 267, 271));
treeAvailableIndicatorGroups = new Tree(groupAvailableIndicatorGroups, SWT.BORDER | SWT.CHECK);
treeAvailableIndicatorGroups.setToolTipText(Messages.getString("IndicatorGroupDialog.groupAvailableIndicatorGroups.tiptext")); //$NON-NLS-1$
treeAvailableIndicatorGroups.setBounds(new Rectangle(6, 51, 253, 212));
TreeColumn nameCol = new TreeColumn(treeAvailableIndicatorGroups, SWT.LEFT);
nameCol.setText(Messages.getString("IndicatorGroupDialog.Name")); //$NON-NLS-1$
nameCol.pack();
TreeColumn idCol = new TreeColumn(treeAvailableIndicatorGroups, SWT.LEFT);
idCol.setText("ID"); //$NON-NLS-1$
idCol.pack();
}
示例9: createGroupAssignedIndicatorGroups
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* This method initializes groupAddLink
*
*/
private void createGroupAssignedIndicatorGroups() {
groupAssignedIndicatorGroups = new Group(shell, SWT.NONE);
groupAssignedIndicatorGroups.setText(Messages.getString("IndicatorGroupDialog.groupAssignedIndicatorGroups")); //$NON-NLS-1$
groupAssignedIndicatorGroups.setBounds(new Rectangle(324, 86, 267, 271));
treeAssignedIndicatorGroups = new Tree(groupAssignedIndicatorGroups, SWT.BORDER | SWT.CHECK);
treeAssignedIndicatorGroups.setToolTipText(Messages.getString("IndicatorGroupDialog.groupAssignedIndicatorGroups.tiptext")); //$NON-NLS-1$
treeAssignedIndicatorGroups.setBounds(new Rectangle(6, 22, 253, 241));
TreeColumn nameCol = new TreeColumn(treeAssignedIndicatorGroups, SWT.LEFT);
nameCol.setText(Messages.getString("IndicatorGroupDialog.Name")); //$NON-NLS-1$
nameCol.pack();
TreeColumn idCol = new TreeColumn(treeAssignedIndicatorGroups, SWT.LEFT);
idCol.setText("ID"); //$NON-NLS-1$
idCol.pack();
}
示例10: createComponents
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void createComponents(Composite parent)
{
this.viewer = new TreeViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
viewer.getTree().setHeaderVisible(true);
TreeColumn nameColumn = new TreeColumn(viewer.getTree(), SWT.LEFT);
nameColumn.setAlignment(SWT.LEFT);
nameColumn.setText("Name");
nameColumn.setWidth(160);
TreeColumn argsColumn = new TreeColumn(viewer.getTree(), SWT.RIGHT);
argsColumn.setAlignment(SWT.LEFT);
argsColumn.setText("Argumente");
argsColumn.setWidth(100);
viewer.setContentProvider(new FunctionContentProvider());
viewer.setLabelProvider(new FunctionLabelProvider());
viewer.setInput(library);
EventHandler handler = new EventHandler();
viewer.addDoubleClickListener(handler);
}
示例11: installDesigns
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
protected void installDesigns()
{
TreeColumn designColumn = new TreeColumn(tree, SWT.LEFT);
designColumn.setToolTipText(selectAllHelp);
// TODO: Bonnie wants some indicator for which columns are designs
// Such as changing "Tasks" here to "Tasks \\ Designs"
designColumn.setText(L10N.get("PM.Tasks", "Tasks"));
designColumn.setResizable(true);
designColumn.setWidth(400);
if (columnHook != null) {
columnHook.onColumnCreation(designColumn);
}
Iterator<Design> designs = project.getDesigns().iterator();
while (designs.hasNext()) {
Design nextDesign = designs.next();
addTreeColumn(nextDesign);
}
}
示例12: recolorTree
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void recolorTree(int designColumn,
TreeItem cellTask,
boolean nowSelected)
{
// Set or remove selection marker in name
TreeColumn col = tree.getColumn(designColumn);
if (nowSelected && (cellTask == null)) {
col.setText(L10N.get("PM.DesignMark", "\u2022 ") + col.getText());
}
else {
col.setText(((Design) col.getData()).getName());
}
recolorItems(tree.getItems(),
designColumn,
nowSelected && (cellTask == null));
if (cellTask != null) {
cellTask.setBackground(designColumn, ProjectUIModel.SELECTED_CELL_COLOR);
}
}
示例13: addTreeColumn
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void addTreeColumn(final int column, final String headerText, final String preferenceKey) {
final TreeColumn treeColumn = new TreeColumn(tree, SWT.LEFT);
treeColumn.setText(Messages.getString(headerText));
treeColumn.setWidth(100);
WidgetPreferences.tuneTreeColumn(treeColumn, getClass(), preferenceKey);
// treeColumn.addSelectionListener(new
// TreeColumnSelectionAdaptor(treeViewer, column));
}
示例14: setTableHeader
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* テーブルヘッダーをセットする
*/
private void setTableHeader() {
for (int i = 0; i < this.header.length; i++) {
TreeColumn col = new TreeColumn(this.tree, SWT.LEFT);
col.setText(this.header[i]);
}
this.packTableHeader();
}
示例15: createComposite
import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
* 뷰어가 담길 컴포지트 생성
*
* @param parent
* @return Composite
*/
public Composite createComposite(final Composite parent) {
Tree tree = new Tree(parent, SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
String[] strHeadings = { UMLMessage.LABEL_PROPERTY, UMLMessage.LABEL_VALUE };
TreeColumn propertyTreeColumn = new TreeColumn(tree, SWT.NONE);
propertyTreeColumn.setWidth(240);
propertyTreeColumn.setText(strHeadings[0]);
propertyTreeColumn.setAlignment(SWT.LEFT);
propertyTreeColumn.setResizable(true);
TreeColumn valueTreeColumn = new TreeColumn(tree, SWT.NONE);
valueTreeColumn.setWidth(300);
valueTreeColumn.setText(strHeadings[1]);
valueTreeColumn.setAlignment(SWT.LEFT);
valueTreeColumn.setResizable(true);
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.heightHint = 150;
gridData.horizontalSpan = 2;
tree.setLayoutData(gridData);
viewer = new TreeViewer(tree);
tree.setItemCount(20);
viewer.setContentProvider(new StereotypePropertyTreeContentProvider());
viewer.setLabelProvider(new StereotypePropertyTableColumnLabelProvider(this));
// viewer.setInput(input);
viewer.addSelectionChangedListener(new StereotypePropertySelectionChangedListener(parent, this));
return parent;
}