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


Java Text.setToolTipText方法代碼示例

本文整理匯總了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 () );
        }
    } );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:25,代碼來源:ConfigurationFormToolkit.java

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

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

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

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

示例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;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:57,代碼來源:LaunchConfigurationMainTab.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.setToolTipText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。