org.eclipse.swt.widgets.Text#getShell ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Text#getShell ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: birt   文件: RotatedTextBuilder.java
private void openExpression( Text textControl )
{
	String oldValue = textControl.getText( );

	ExpressionBuilder eb = new ExpressionBuilder( textControl.getShell( ),
			oldValue );
	eb.setExpressionProvier( new ExpressionProvider( textItem.getModelHandle( ) ) );

	String result = oldValue;

	if ( eb.open( ) == Window.OK )
	{
		result = eb.getResult( );
	}

	if ( !oldValue.equals( result ) )
	{
		textControl.setText( result );
	}
}
 
protected void handleFileBrowseButtonPressed(Text text, String[] extensions, String title) {
	FileDialog dialog= new FileDialog(text.getShell());
	dialog.setText(title);
	dialog.setFilterExtensions(extensions);
	String dirName= text.getText();
	if (!dirName.equals("")) { //$NON-NLS-1$
		File path= new File(dirName);
		if (path.exists())
			dialog.setFilterPath(dirName);

	}
	String selectedDirectory= dialog.open();
	if (selectedDirectory != null)
		text.setText(selectedDirectory);
}
 
源代码3 项目: birt   文件: RotatedTextGeneralPage.java
private void openExpression( Text textControl )
{
	RotatedTextItem item = getItem( );

	if ( item != null )
	{
		String oldValue = textControl.getText( );

		ExpressionBuilder eb = new ExpressionBuilder( textControl.getShell( ),
				oldValue );
		eb.setExpressionProvier( new ExpressionProvider( item.getModelHandle( ) ) );

		String result = oldValue;

		if ( eb.open( ) == Window.OK )
		{
			result = eb.getResult( );
		}

		if ( !oldValue.equals( result ) )
		{
			textControl.setText( result );

			updateModel( RotatedTextItem.TEXT_PROP );
		}
	}
}
 
源代码4 项目: goclipse   文件: ControlUtils.java
public static void openStringVariableSelectionDialog_ForText(Text text) {
	Shell shell = text.getShell();
	try {
		String variable = openStringVariableSelectionDialog(shell);
		text.insert(variable);
	} catch(OperationCancellation e) {
		return;
	}
}
 
public RelativeFileFieldSetter(Text fileField, IPath basePath, String[] filterExtensions) {
  this(fileField, basePath, filterExtensions, new FileDialog(fileField.getShell(), SWT.SHEET));
}
 
源代码6 项目: google-cloud-eclipse   文件: FileFieldSetter.java
public FileFieldSetter(Text fileField, String[] filterExtensions) {
  this(fileField, filterExtensions, new FileDialog(fileField.getShell(), SWT.SHEET));
}