本文整理汇总了Java中org.eclipse.swt.widgets.Text.setMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Text.setMessage方法的具体用法?Java Text.setMessage怎么用?Java Text.setMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.setMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFilterControls
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected void createFilterControls(Composite con) {
Label filterLabel = new Label(con,SWT.NONE);
filterLabel.setText("Filter:");
GridDataFactory.swtDefaults().applyTo(filterLabel);
Text filterText = new Text(con, SWT.BORDER);
filterText.setMessage("(" + PreferenceFilter.MIN_FILTER_CHARS + " chars at least)");
filterText.addModifyListener(event -> {
filterChanged(filterText.getText());
});
GridDataFactory.fillDefaults().grab(true,false).applyTo(filterText);
Button clearBtn = new Button(con, SWT.PUSH);
clearBtn.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(PrefEditorPlugin.PLUGIN_ID,"icons/clear.gif").createImage());
GridDataFactory.swtDefaults().applyTo(clearBtn);
clearBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
filterText.setText("");
filterChanged("");
}
});
}
示例2: 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 () );
}
} );
}
示例3: createAttributeText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Text createAttributeText ( final String attribute )
{
final Text t = new Text ( this, SWT.BORDER );
final Fields field = Fields.byField ( attribute );
if ( field == null )
{
t.setEditable ( true );
t.setMessage ( Messages.custom_field );
}
else
{
t.setEditable ( false );
t.setText ( field.getName () );
}
t.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
};
} );
final RowData rowData = new RowData ();
rowData.width = 132;
t.setLayoutData ( rowData );
return t;
}
示例4: createValueText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Text createValueText ()
{
final Text t = new Text ( this, SWT.BORDER );
t.setMessage ( Messages.argument );
t.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
}
} );
final RowData rowData = new RowData ();
rowData.width = 132;
t.setLayoutData ( rowData );
return t;
}
示例5: createControl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite comp = new Group(parent, SWT.BORDER);
setControl(comp);
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(comp);
Label label = new Label(comp, SWT.NONE);
label.setText("Console Text:");
GridDataFactory.swtDefaults().applyTo(label);
text = new Text(comp, SWT.BORDER);
text.setMessage("Console Text");
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
}
示例6: 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 );
}
}
示例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;
}