org.eclipse.swt.widgets.TableColumn.setToolTipText()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(14.9k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.eclipse.swt.widgets.TableColumn.setToolTipText()方法的一些代码示例,展示了TableColumn.setToolTipText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.setToolTipText()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.TableColumn
类名称:TableColumn
方法名:setToolTipText

TableColumn.setToolTipText介绍

[英]Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.

The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
[中]将接收者的工具提示文本设置为参数,该参数可能为空,表示将显示控件的默认工具提示。对于具有默认工具提示的控件,例如Windows上的树控件,将工具提示文本设置为空字符串将替换默认值,从而不会显示工具提示文本。
助记符(字符“&”)不显示在工具提示中。要在工具提示中显示单个“&”,可以通过在字符串中加倍字符“&”进行转义。

代码示例

代码示例来源:origin: BiglySoftware/BiglyBT

public static void
setTT(
  TableColumn            c,
  String                text )
{
  c.setToolTipText( tt_enabled?text:null  );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

@Override
void doSetStringValue(Object source, String value) {
  ((TableColumn) source).setToolTipText(value);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
  super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
  for (int i=0; i<columnCount; i++) {
    TableColumn column = columns [i];
    if (column.toolTipText != null) {
      column.setToolTipText(oldShell, null);
      column.setToolTipText(newShell, column.toolTipText);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
  super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
  for (int i=0; i<columnCount; i++) {
    TableColumn column = columns [i];
    if (column.toolTipText != null) {
      column.setToolTipText(oldShell, null);
      column.setToolTipText(newShell, column.toolTipText);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
  super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
  for (int i=0; i<columnCount; i++) {
    TableColumn column = columns [i];
    if (column.toolTipText != null) {
      column.setToolTipText(oldShell, null);
      column.setToolTipText(newShell, column.toolTipText);
    }
  }
}

代码示例来源:origin: pentaho/pentaho-kettle

tablecolumn[i + 1].setToolTipText( ( columns[i].getToolTip() ) );

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Sets the receiver's tool tip text to the argument, which
 * may be null indicating that the default tool tip for the
 * control will be shown. For a control that has a default
 * tool tip, such as the Tree control on Windows, setting
 * the tool tip text to an empty string replaces the default,
 * causing no tool tip text to be shown.
 * <p>
 * The mnemonic indicator (character '&amp;') is not displayed in a tool tip.
 * To display a single '&amp;' in the tool tip, the character '&amp;' can be
 * escaped by doubling it in the string.
 * </p>
 *
 * @param string the new tool tip text (or null)
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @since 3.2
 */
public void setToolTipText (String string) {
  checkWidget();
  Shell shell = parent._getShell ();
  setToolTipText (shell, string);
  toolTipText = string;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Sets the receiver's tool tip text to the argument, which
 * may be null indicating that the default tool tip for the
 * control will be shown. For a control that has a default
 * tool tip, such as the Tree control on Windows, setting
 * the tool tip text to an empty string replaces the default,
 * causing no tool tip text to be shown.
 * <p>
 * The mnemonic indicator (character '&amp;') is not displayed in a tool tip.
 * To display a single '&amp;' in the tool tip, the character '&amp;' can be
 * escaped by doubling it in the string.
 * </p>
 *
 * @param string the new tool tip text (or null)
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @since 3.2
 */
public void setToolTipText (String string) {
  checkWidget();
  Shell shell = parent._getShell ();
  setToolTipText (shell, string);
  toolTipText = string;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Sets the receiver's tool tip text to the argument, which
 * may be null indicating that the default tool tip for the
 * control will be shown. For a control that has a default
 * tool tip, such as the Tree control on Windows, setting
 * the tool tip text to an empty string replaces the default,
 * causing no tool tip text to be shown.
 * <p>
 * The mnemonic indicator (character '&amp;') is not displayed in a tool tip.
 * To display a single '&amp;' in the tool tip, the character '&amp;' can be
 * escaped by doubling it in the string.
 * </p>
 *
 * @param string the new tool tip text (or null)
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @since 3.2
 */
public void setToolTipText (String string) {
  checkWidget();
  Shell shell = parent._getShell ();
  setToolTipText (shell, string);
  toolTipText = string;
}

代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls

public void createTableColumnInternal(Language language) {
 TableColumn c = new TableColumn(m_table, SWT.LEAD);
 c.setData(LANGUAGE_COLUMN_ID, language);
 if (!language.isLocal()) {
  c.setToolTipText("this language is only in the parent defined!\nCreate a new language for " + language.getLocale().toString() + " to make it locally available.");
  c.setImage(NlsCore.getImage(INlsIcons.WARNING));
 }
 c.setText(language.getDispalyName());
 c.setMoveable(true);
 c.addSelectionListener(new P_SortSelectionAdapter(m_table.indexOf(c)));
 c.setWidth(200);
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates columns for table.
 */
private void createColumns() {
  TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.NONE);
  column.getColumn().setResizable(false);
  column.getColumn().setWidth(400);
  column.getColumn().setText("Rule");
  column.getColumn().setToolTipText("The fully qualified name of the class or set of classes to be excluded. The wildcard * can be used to match any length of characters.");
  column.setLabelProvider(new ColumnLabelProvider() {
    @Override
    public String getText(Object element) {
      return ((ExcludeRule) element).getClassName();
    }
  });
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Column for the table viewer.
 */
private void createColumnsForParametersTable() {
  TableViewerColumn paramColumn = new TableViewerColumn(parametersTableViewer, SWT.NONE);
  paramColumn.getColumn().setResizable(true);
  paramColumn.getColumn().setWidth(100);
  paramColumn.getColumn().setText("Parameter FQN");
  paramColumn.setLabelProvider(new ColumnLabelProvider() {
    @Override
    public String getText(Object element) {
      return (String) element;
    }
  });
  paramColumn.getColumn().setToolTipText("Parameter FQN or primitive type name.");
}

代码示例来源:origin: org.xworker/xworker_swt

String toolTipText = UtilString.getString(self.getString("toolTipText"), actionContext);
if(toolTipText != null)
  column.setToolTipText(toolTipText);
else{
  column.setToolTipText(columnText);

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates columns for table.
 */
private void createColumns() {
  TableViewerColumn sensorNameColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  sensorNameColumn.getColumn().setResizable(true);
  sensorNameColumn.getColumn().setWidth(250);
  sensorNameColumn.getColumn().setText("Sensor");
  sensorNameColumn.setLabelProvider(new ColumnLabelProvider() {
    @Override
    public String getText(Object element) {
      return TextFormatter.getSensorConfigName((ISensorConfig) element);
    }
    @Override
    public Image getImage(Object element) {
      return ImageFormatter.getSensorConfigImage((ISensorConfig) element);
    }
  });
  sensorNameColumn.getColumn().setToolTipText("Sensor type.");
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates table columns.
 */
private void createColumns() {
  String[] columnNames = { "Definition Name", "Business Transaction Name", "Name Extraction", "Description" };
  int[] columnWidths = { 250, 250, 100, 400 };
  String[] toolTips = { "The name of the business transaction definition. This name is also used for the mapped business transactions if dynamic name extraction is not enabled.",
      "The name of the actual mapped business transaction. This name equals to the Definition Name if dynamic name extraction is not enabled, otherwise the name is dynamically extracted according to the specified pattern.",
      "Indicates whether the name of the business transaction will be extracted dynamically.", "Description." };
  for (int i = 0; i < columnNames.length; i++) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(columnNames[i]);
    viewerColumn.getColumn().setWidth(columnWidths[i]);
    viewerColumn.getColumn().setToolTipText(toolTips[i]);
  }
}

代码示例来源:origin: inspectIT/inspectIT

profileNameColumn.getColumn().setWidth(250);
profileNameColumn.getColumn().setText("Profile");
profileNameColumn.getColumn().setToolTipText("Profile name.");
activeColumn.getColumn().setText("Active");
activeColumn.getColumn().setWidth(40);
activeColumn.getColumn().setToolTipText("If profile is active or not, note that deactivated profile will not be considered during the instrumentation even if it's a part of an environment.");
defaultColumn.getColumn().setText("Default");
defaultColumn.getColumn().setWidth(40);
defaultColumn.getColumn().setToolTipText("If profile is default or not, note that default profile will be added to any new created environment.");
typeColumn.getColumn().setText("Type");
typeColumn.getColumn().setWidth(40);
typeColumn.getColumn().setToolTipText("Type of data profile is holding.");
descriptionColumn.getColumn().setText("Description");
descriptionColumn.getColumn().setWidth(250);
descriptionColumn.getColumn().setToolTipText("Profile description.");

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates columns for Table.
 *
 * @param tableViewer
 *            Table viewer to create columns for.
 */
private void createColumns(TableViewer tableViewer) {
  TableViewerColumn classColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  classColumn.getColumn().setResizable(true);
  classColumn.getColumn().setWidth(350);
  classColumn.getColumn().setText("Class");
  classColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_CLASS));
  classColumn.getColumn().setToolTipText("Fully qualified name of the class or interface.");
  TableViewerColumn methodColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  methodColumn.getColumn().setResizable(true);
  methodColumn.getColumn().setWidth(450);
  methodColumn.getColumn().setText("Method");
  methodColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_METHOD_PUBLIC));
  methodColumn.getColumn().setToolTipText("Method name with parameters. Note that constructors are displayed as '<init>' methods.");
  TableViewerColumn optionsColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  optionsColumn.getColumn().setResizable(true);
  optionsColumn.getColumn().setWidth(200);
  optionsColumn.getColumn().setText("Options");
  optionsColumn.getColumn().setToolTipText("Additional options that are defined for the sensor assignment.");
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates columns for the {@link #tableViewer}.
 *
 * @param tableViewer
 *            {@link TableViewer}
 */
private void createColumns(TableViewer tableViewer) {
  TableViewerColumn domainColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  domainColumn.getColumn().setResizable(true);
  domainColumn.getColumn().setWidth(150);
  domainColumn.getColumn().setText("Domain");
  domainColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_PACKAGE));
  domainColumn.getColumn().setToolTipText("Domain that the MBean object name is belonging to.");
  TableViewerColumn objectNameColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  objectNameColumn.getColumn().setResizable(true);
  objectNameColumn.getColumn().setWidth(250);
  objectNameColumn.getColumn().setText("Object Name Properties");
  objectNameColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_BOOK));
  objectNameColumn.getColumn().setToolTipText("Object name properties patterns.");
  TableViewerColumn attributesColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  attributesColumn.getColumn().setResizable(true);
  attributesColumn.getColumn().setWidth(400);
  attributesColumn.getColumn().setText("Attributes");
  attributesColumn.getColumn().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_BLUE_DOCUMENT_TABLE));
  attributesColumn.getColumn().setToolTipText("Attributes to monitor.");
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (Column.EXCLUSIVEAVERAGE.equals(column) || Column.EXCLUSIVESUM.equals(column) || Column.EXCLUSIVEMIN.equals(column) || Column.EXCLUSIVEMAX.equals(column)) {
      // TODO: Remove this tooltip and add it to the cell as soon as the image bug is
      // fixed in Eclipse.
      viewerColumn.getColumn()
          .setToolTipText("Exclusive times can only be calculated correctly if the timer is within an invocation sequence. "
              + "A warning marker is provided if not all timers are run within an invocation sequence. Please be aware that "
              + "avg, sum, min and max calculations are reflecting only the timers inside an invocation sequence.");
    }
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls

@SuppressWarnings("squid:S881")
private void createColumns(Table table) {
 // cleare old columns
 TableColumn[] cols = m_table.getColumns();
 for (TableColumn col : cols) {
  col.dispose();
 }
 // utility columns
 TableColumn colRefs = new TableColumn(table, SWT.LEAD);
 colRefs.setResizable(false);
 colRefs.setMoveable(false);
 colRefs.setWidth(45);
 colRefs.setText("*");
 colRefs.setToolTipText("* if the references are not sync!");
 colRefs.addSelectionListener(new P_SortSelectionAdapter(0));
 int i = NlsTable.INDEX_COLUMN_KEYS;
 // nls java column
 TableColumn jColumn = new TableColumn(table, SWT.LEAD);
 jColumn.setText(Language.LANGUAGE_KEY.getDispalyName());
 jColumn.setData(LANGUAGE_COLUMN_ID, Language.LANGUAGE_KEY);
 jColumn.setMoveable(false);
 jColumn.setWidth(200);
 jColumn.addSelectionListener(new P_SortSelectionAdapter(i++));
 if (m_tableModel.getProjects() != null) {
  for (Language language : m_tableModel.getProjects().getAllLanguages()) {
   createTableColumnInternal(language);
  }
  m_filterComp.columnsChanged();
 }
}

相关文章