本文整理汇总了Java中org.eclipse.swt.widgets.Text.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java Text.setToolTipText方法的具体用法?Java Text.setToolTipText怎么用?Java Text.setToolTipText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.setToolTipText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStandardLinkText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public void createStandardLinkText ( final Composite parent, final String linkFactory, final String attributeName, final String label, final String textMessage, final ConfigurationEditorInput input, final Object valueType )
{
this.toolkit.createLabel ( parent, label + ":" );
final Text text = this.toolkit.createText ( parent, "" );
text.setMessage ( textMessage );
text.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, true ) );
text.setToolTipText ( textMessage );
final IObservableValue value = Observables.observeMapEntry ( input.getDataMap (), attributeName, valueType );
this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );
final Hyperlink link = this.toolkit.createHyperlink ( parent, "link", SWT.NONE );
link.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, false, false ) );
link.addHyperlinkListener ( new HyperlinkAdapter () {
@Override
public void linkActivated ( final HyperlinkEvent e )
{
EditorHelper.handleOpen ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), input.getConnectionUri (), linkFactory, text.getText () );
}
} );
}
示例2: getParamFilePath
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
*
* get the file Path according to the Parameter value
* @param extSchemaPath
* @param paramValue
* @param extSchemaPathText
* @return the file Path according to the Parameter value
*/
public String getParamFilePath(String extSchemaPath, String paramValue, Text extSchemaPathText){
String remainingString = "";
if( checkParameterValue(extSchemaPath)){
if(StringUtils.isNotEmpty(paramValue)){
extSchemaPathText.setToolTipText(paramValue+remainingString);
}else{
extSchemaPathText.setToolTipText(PARAMETER_NOT_FOUND);
}
}else if(StringUtils.contains(paramValue, PARAMETER_NOT_FOUND)){
extSchemaPathText.setToolTipText(remainingString);
}else{
remainingString = extSchemaPath.substring(extSchemaPath.indexOf("}")+1, extSchemaPath.length());
extSchemaPathText.setToolTipText(paramValue+remainingString);
}
return paramValue+remainingString;
}
示例3: createStandardText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public void createStandardText ( final Composite parent, final String attributeName, final int style, final String label, final String textMessage, final IObservableMap data, final Object valueType )
{
final Label labelControl = this.toolkit.createLabel ( parent, label + ":" );
final boolean multi = ( style & SWT.MULTI ) > 0;
if ( multi )
{
labelControl.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, false ) );
}
final Text text = this.toolkit.createText ( parent, "", style );
text.setMessage ( textMessage );
final GridData gd = new GridData ( GridData.FILL, multi ? GridData.FILL : GridData.BEGINNING, true, true );
gd.horizontalSpan = 2;
text.setLayoutData ( gd );
text.setToolTipText ( textMessage );
final IObservableValue value = Observables.observeMapEntry ( data, attributeName, String.class );
if ( valueType != null && valueType != String.class )
{
final WritableValue conversionValue = new WritableValue ( null, valueType );
this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), conversionValue );
this.dbc.bindValue ( conversionValue, value );
}
else
{
this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );
}
}
示例4: attachToPropertySubGroup
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void attachToPropertySubGroup(AbstractELTContainerWidget subGroup) {
eltSubgroupComposite = new ELTDefaultSubgroupComposite(subGroup.getContainerControl());
eltSubgroupComposite.createContainerWidget();
Utils.INSTANCE.loadProperties();
this.cursor = subGroup.getContainerControl().getDisplay().getSystemCursor(SWT.CURSOR_HAND);
AbstractELTWidget label = new ELTDefaultLable(Messages.LABEL_WORKSHEET_NAME + " ");
eltSubgroupComposite.attachWidget(label);
setPropertyHelpWidget((Control) label.getSWTWidgetControl());
AbstractELTWidget textBoxWidget = new ELTDefaultTextBox();
eltSubgroupComposite.attachWidget(textBoxWidget);
textBox = (Text) textBoxWidget.getSWTWidgetControl();
txtDecorator = WidgetUtility.addDecorator(textBox, Messages.bind(Messages.EMPTY_FIELD, ((Label) label.getSWTWidgetControl()).getText()));
txtDecorator.setMarginWidth(3);
txtDecorator.show();
textBox.setToolTipText("Worksheet Name can be static or FieldName or a Parameter");
GridData gridData = (GridData) textBox.getLayoutData();
if (OSValidator.isMac()) {
gridData.widthHint = 106;
} else {
gridData.widthHint = 80;
}
attachListeners(textBox);
isFieldCheckBox = new Button(eltSubgroupComposite.getContainerControl(), SWT.CHECK);
isFieldCheckBox.setEnabled(false);
isFieldCheckBox.setText(Constants.IS_FIELD);
attachSelectionListener(isFieldCheckBox);
populateWidget();
}
示例5: showToolTip
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void showToolTip(Text text1, String selectedValue) {
if (StringUtils.equalsIgnoreCase(selectedValue, FilterConstants.IN)
|| StringUtils.equalsIgnoreCase(selectedValue, FilterConstants.NOT_IN)) {
text1.setToolTipText(Messages.COMMA_SEPERATED_VALUE);
} else {
text1.setToolTipText("");
}
}
示例6: createModelLayout
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/***
* Create the Fields where user enters model to execute
*
* @param parent container composite
* @param font used font
* @return the created composite containing the fields
*/
public Composite createModelLayout(Composite parent, Font font) {
createTextLabelLayout(parent, "Model to execute");
// Model location text
_modelLocationText = new Text(parent, SWT.SINGLE | SWT.BORDER);
_modelLocationText.setLayoutData(createStandardLayout());
_modelLocationText.setFont(font);
_modelLocationText.addModifyListener(fBasicModifyListener);
Button modelLocationButton = createPushButton(parent, "Browse", null);
modelLocationButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
// handleModelLocationButtonSelected();
// TODO launch the appropriate selector
SelectAnyIFileDialog dialog = new SelectAnyIFileDialog();
if (dialog.open() == Dialog.OK) {
String modelPath = ((IResource) dialog.getResult()[0])
.getFullPath().toPortableString();
_modelLocationText.setText(modelPath);
updateLaunchConfigurationDialog();
_modelProject = ((IResource) dialog.getResult()[0]).getProject();
}
}
});
createTextLabelLayout(parent, "Model initialization method");
_modelInitializationMethodText = new Text(parent, SWT.SINGLE | SWT.BORDER);
_modelInitializationMethodText.setLayoutData(createStandardLayout());
_modelInitializationMethodText.setFont(font);
_modelInitializationMethodText.setEditable(false);
createTextLabelLayout(parent, "");
createTextLabelLayout(parent, "Model initialization arguments");
_modelInitializationArgumentsText = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
_modelInitializationArgumentsText.setToolTipText("one argument per line");
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.heightHint = 40;
_modelInitializationArgumentsText.setLayoutData(gridData);
//_modelInitializationArgumentsText.setLayoutData(createStandardLayout());
_modelInitializationArgumentsText.setFont(font);
_modelInitializationArgumentsText.setEditable(true);
_modelInitializationArgumentsText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
updateLaunchConfigurationDialog();
}
});
createTextLabelLayout(parent, "");
return parent;
}
示例7: getListener
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers, Widget... widgets) {
Widget[] widgetList = widgets;
final Text text = (Text) widgetList[0];
if(helpers != null){
if (helpers != null) {
currentComponent=(Component) helpers.get(HelperType.CURRENT_COMPONENT);
txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
txtDecorator.hide();
}
}
Listener listener = new Listener() {
@Override
public void handleEvent(Event e) {
if (e.type == SWT.Verify) {
logger.debug("<<<<<<<<<<"+e.text.toString()+">>>>>>>>>>>");
String currentText = ((Text) e.widget).getText();
String newName = (currentText.substring(0, e.start) + e.text + currentText.substring(e.end)).trim();
Matcher matchName = Pattern.compile("[\\w+]*").matcher(newName.replaceAll("[\\W&&[\\ \\.\\-]]*", ""));
logger.debug("new text: {}", newName);
if (newName == null || newName.equals("")) {
// e.doit=false;
text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
text.setToolTipText(Messages.FIELD_LABEL_ERROR);
propertyDialogButtonBar.enableOKButton(false);
propertyDialogButtonBar.enableApplyButton(false);
txtDecorator.setDescriptionText(Messages.FIELD_LABEL_ERROR);
txtDecorator.show();
}else if(!matchName.matches()){
text.setToolTipText(Messages.INVALID_CHARACTERS);
txtDecorator.setDescriptionText(Messages.INVALID_CHARACTERS);
txtDecorator.show();
e.doit=false;
} else if(!newName.equalsIgnoreCase(oldName) && !isUniqueCompName(newName)) {
text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry(255,255,204));
text.setToolTipText(Messages.FIELD_LABEL_ERROR);
propertyDialogButtonBar.enableOKButton(false);
propertyDialogButtonBar.enableApplyButton(false);
txtDecorator.setDescriptionText(Messages.FIELD_LABEL_ERROR);
txtDecorator.show();
}
else{
text.setBackground(null);
text.setToolTipText("");
text.setMessage("");
propertyDialogButtonBar.enableOKButton(true);
propertyDialogButtonBar.enableApplyButton(true);
txtDecorator.hide();
}
}
}
};
return listener;
}
示例8: createSearchTextBox
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Text createSearchTextBox(Composite container,int border) {
Text text = new Text(container, border);
text.setToolTipText("Enter component name");
text.setMessage("Search component");
return text;
}