當前位置: 首頁>>代碼示例>>Java>>正文


Java Text.setMessage方法代碼示例

本文整理匯總了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("");
		}
		
	});
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:24,代碼來源:ViewerPage.java

示例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 () );
        }
    } );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:25,代碼來源:ConfigurationFormToolkit.java

示例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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:27,代碼來源:FilterAdvancedComposite.java

示例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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:FilterAdvancedComposite.java

示例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);
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:17,代碼來源:LaunchConfigurationTab.java

示例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 );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:32,代碼來源:ConfigurationFormToolkit.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:59,代碼來源:ELTVerifyComponentNameListener.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:7,代碼來源:CustomPaletteViewer.java


注:本文中的org.eclipse.swt.widgets.Text.setMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。