当前位置: 首页>>代码示例>>Java>>正文


Java CCombo.setToolTipText方法代码示例

本文整理汇总了Java中org.eclipse.swt.custom.CCombo.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java CCombo.setToolTipText方法的具体用法?Java CCombo.setToolTipText怎么用?Java CCombo.setToolTipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.custom.CCombo的用法示例。


在下文中一共展示了CCombo.setToolTipText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCompressionTooltips

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public static void setCompressionTooltips(CCombo wCompression, Class dialogClass)
{
    switch (ConnectionCompression.fromString(wCompression.getText())) {
        case NONE:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionNone.TipText"));
            break;
        case SNAPPY:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionSnappy.TipText"));
            break;
        case PIEDPIPER:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionPiedPiper.TipText"));
            break;
        default:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionNotAvailable.TipText"));
    }
}
 
开发者ID:bcolas,项目名称:pentaho-cassandra-plugin,代码行数:17,代码来源:CommonDialog.java

示例2: handleAddExceptionForControl

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void handleAddExceptionForControl(final Control control, final ValidationException e) {

    if (control instanceof Text) {
      Text text = (Text) control;
      text.setBackground(new Color(control.getDisplay(), ERROR_COLOR));
      text.setToolTipText(e.getMessage());
    } else if (control instanceof CCombo) {
      CCombo combo = (CCombo) control;
      combo.setBackground(new Color(control.getDisplay(), ERROR_COLOR));
      combo.setToolTipText(e.getMessage());
    } else if (control instanceof Composite) {
      Composite composite = (Composite) control;
      composite.setBackground(new Color(control.getDisplay(), ERROR_COLOR));
      for (final Control childControl : composite.getChildren()) {
        childControl.setBackground(new Color(control.getDisplay(), ERROR_COLOR));
      }
      composite.setToolTipText(e.getMessage());
    }
  }
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:AbstractCustomPropertyField.java

示例3: handleRemoveExceptionForControl

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void handleRemoveExceptionForControl(final Control control) {
  if (control instanceof Text) {
    Text text = (Text) control;
    text.setBackground(null);
    text.setToolTipText(null);
  } else if (control instanceof CCombo) {
    CCombo combo = (CCombo) control;
    combo.setBackground(null);
    combo.setToolTipText(null);
  } else if (control instanceof Composite) {
    Composite composite = (Composite) control;
    composite.setBackground(null);
    for (final Control childControl : composite.getChildren()) {
      childControl.setBackground(null);
    }
    composite.setToolTipText(null);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:AbstractCustomPropertyField.java

示例4: getModifyListenerTooltipText

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private ModifyListener getModifyListenerTooltipText(final CCombo comboField) {
	return new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			String tip = comboField.getText();
			if (!Const.isEmpty(tip) && !Const.isEmpty(toolTipText)) {
				tip += Const.CR + Const.CR + toolTipText;
			}

			if (Const.isEmpty(tip)) {
				tip = toolTipText;
			}
			comboField.setToolTipText(variables.environmentSubstitute(tip));
		}
	};
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:16,代码来源:ComboVar.java

示例5: editCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void editCombo(TableItem row, int rownr, int colnr)
{
	before_edit = getItemText(row);
	field_changed = false;
	ColumnInfo colinfo = columns[colnr-1];

       if (columns[colnr-1].isReadOnly() && columns[colnr-1].getSelectionAdapter()!=null) 
       {
           return;
       }
       
	combo   = new CCombo(table, colinfo.isReadOnly()?SWT.READ_ONLY:SWT.NONE );
       props.setLook(combo, Props.WIDGET_STYLE_TABLE);
	combo.addTraverseListener(lsTraverse);
	combo.addModifyListener(lsModCombo);
	combo.addFocusListener(lsFocusCombo);
	String opt[] = colinfo.getComboValues();
	if (colinfo.getComboValuesSelectionListener()!=null) {
		opt = colinfo.getComboValuesSelectionListener().getComboValues(row, rownr, colnr);
	}
	
	for (int i=0;i<opt.length;i++) combo.add(opt[i]);
	combo.setText(row.getText(colnr));
	if (lsMod!=null) combo.addModifyListener(lsMod);	
	combo.addModifyListener(lsUndo);
	String tooltip = colinfo.getToolTip();
	if (tooltip!=null) combo.setToolTipText(tooltip); else combo.setToolTipText("");			
	combo.setVisible(true);		
	combo.addKeyListener(lsKeyCombo);
       
       if (columns[colnr-1].getSelectionAdapter()!=null)
       {
           combo.addSelectionListener(columns[colnr-1].getSelectionAdapter());
       }

	editor.horizontalAlignment = SWT.LEFT;
	editor.layout();
       
	// Open the text editor in the correct column of the selected row.
	editor.setEditor (combo, row, colnr);
	combo.setFocus();

       combo.layout();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:45,代码来源:TableView.java

示例6: LabelTimeComposite

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public LabelTimeComposite(Composite composite, String labelText, String toolTipText) {
  super(composite, SWT.NONE);
  props.setLook(this);

  int middle = props.getMiddlePct();
  int threeQuarters = (middle + 100) / 2;
  int margin = Const.MARGIN;

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;

  this.setLayout(formLayout);

  wText = new Text(this, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
  FormData fdText = new FormData();
  fdText.left = new FormAttachment(middle, margin);
  fdText.right = new FormAttachment(threeQuarters, 0);
  wText.setLayoutData(fdText);
  wText.setToolTipText(toolTipText);

  wTimeUnit = new CCombo(this, SWT.SINGLE | SWT.DROP_DOWN | SWT.BORDER | SWT.LEFT);
  FormData fdCombo = new FormData();
  fdCombo.left = new FormAttachment(threeQuarters, margin);
  fdCombo.right = new FormAttachment(100, 0);
  wTimeUnit.setEditable(false);
  wTimeUnit.setLayoutData(fdCombo);
  wTimeUnit.setItems(getTimeUnits());
  wTimeUnit.setToolTipText(toolTipText);

  wLabel = new Label(this, SWT.RIGHT);
  props.setLook(wLabel);
  wLabel.setText(labelText);
  FormData fdLabel = new FormData();
  fdLabel.left = new FormAttachment(0, 0);
  fdLabel.right = new FormAttachment(middle, 0);
  fdLabel.top = new FormAttachment(wText, 0, SWT.CENTER);
  wLabel.setLayoutData(fdLabel);
  wLabel.setToolTipText(toolTipText);

  wText.addModifyListener(new ModifyListener() {
    public void modifyText(ModifyEvent e) {
      if (!StringUtils.isNumeric(wText.getText())) {
        wText.setText(lastValidValue);
      } else lastValidValue = wText.getText();
    }
  });
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:51,代码来源:LabelTimeComposite.java

示例7: editCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void editCombo(TableItem row, int rownr, int colnr)
{
	before_edit = getItemText(row);
	field_changed = false;
	ColumnInfo colinfo = columns[colnr-1];

       if (colinfo.isReadOnly() && colinfo.getSelectionAdapter()!=null) 
       {
           return;
       }
       
       if (colinfo.getDisabledListener()!=null) {
       	boolean disabled = colinfo.getDisabledListener().isFieldDisabled(rownr);
       	if (disabled) return;
       }
       
	combo   = new CCombo(table, colinfo.isReadOnly()?SWT.READ_ONLY:SWT.NONE );
       props.setLook(combo, Props.WIDGET_STYLE_TABLE);
	combo.addTraverseListener(lsTraverse);
	combo.addModifyListener(lsModCombo);
	combo.addFocusListener(lsFocusCombo);
	
	String opt[] = getComboValues(row, colinfo);
	
	if (colinfo.getComboValuesSelectionListener()!=null) {
		opt = colinfo.getComboValuesSelectionListener().getComboValues(row, rownr, colnr);
	}
	
	for (int i=0;i<opt.length;i++) combo.add(opt[i]);
	combo.setText(row.getText(colnr));
	if (lsMod!=null) combo.addModifyListener(lsMod);	
	combo.addModifyListener(lsUndo);
	String tooltip = colinfo.getToolTip();
	if (tooltip!=null) combo.setToolTipText(tooltip); else combo.setToolTipText("");			
	combo.setVisible(true);		
	combo.addKeyListener(lsKeyCombo);
	
       if (colinfo.getSelectionAdapter()!=null)
       {
           combo.addSelectionListener(columns[colnr-1].getSelectionAdapter());
       }

	editor.horizontalAlignment = SWT.LEFT;
	editor.layout();
       
	// Open the text editor in the correct column of the selected row.
	editor.setEditor (combo, row, colnr);
	combo.setFocus();

       combo.layout();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:52,代码来源:TableView.java


注:本文中的org.eclipse.swt.custom.CCombo.setToolTipText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。