{  final String[] lines = new String[]{ "select", "from" }; StyledText styledText = viewer.getTextWidget( ); String content = styledText.getText( ); if ( content == null || content.trim().length( ) == 0 ) { String defaultContent = ""; for ( int i = 0; i < lines.length; i++ ) { if ( i > 0 ) defaultContent += "\n"; defaultContent += lines[i] + " "; } styledText.setText( defaultContent ); if ( lines.length > 0 ) styledText.setSelection( lines[0].length( ) + 1 , lines[0].length( ) + 1 );
{ String queryText = ((OdaDataSetHandle) getContainer().getModel()).getQueryText(); StyledText styledText = viewer.getTextWidget(); if (queryText == null || queryText.trim().length() == 0) { String[] lines = getQueryPresetText(); if (lines != null && lines.length > 0) styledText.setSelection(lines[0].length() + 1, lines[0].length() + 1);
	private void prepareUI()	{		// TODO: to be externalized		final String[] lines = new String[]{				"select", "from"		};				StyledText styledText = viewer.getTextWidget( );		String content = styledText.getText( );		if ( content == null || content.trim().length( ) == 0 )		{			String defaultContent = "";			for ( int i = 0; i < lines.length; i++ )			{				if ( i > 0 )					defaultContent += "\n";				defaultContent += lines[i] + " ";			}			styledText.setText( defaultContent );			if ( lines.length > 0 )				styledText.setSelection( lines[0].length( ) + 1 ,						lines[0].length( ) + 1 );		}				styledText.setFocus( );	}