Java Code Examples for org.eclipse.core.runtime.Preferences#contains()

The following examples show how to use org.eclipse.core.runtime.Preferences#contains() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResultSetPreviewPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
private int getMaxRowPreference( )
{
	int maxRow;
	Preferences preferences = ReportPlugin.getDefault( )
			.getPluginPreferences( );
	if ( preferences.contains( DateSetPreferencePage.USER_MAXROW ) )
	{
		maxRow = preferences.getInt( DateSetPreferencePage.USER_MAXROW );
	}
	else
	{
		maxRow = DateSetPreferencePage.DEFAULT_MAX_ROW;
		preferences.setValue( DateSetPreferencePage.USER_MAXROW, maxRow );
	}
	return maxRow;
}
 
Example 2
Source File: SQLDataSetEditorPage.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void setDefaultPereferencesIfNeed( )
{
	Preferences preferences = JdbcPlugin.getDefault( )
			.getPluginPreferences( );
	if ( !preferences.contains( DateSetPreferencePage.SCHEMAS_PREFETCH_CONFIG ) )
	{
		preferences.setValue( DateSetPreferencePage.SCHEMAS_PREFETCH_CONFIG,
				DateSetPreferencePage.ENABLED );
	}
	if ( !preferences.contains( DateSetPreferencePage.ENABLE_CODE_ASSIST ) )
	{
		preferences.setValue( DateSetPreferencePage.ENABLE_CODE_ASSIST,
				DateSetPreferencePage.ENABLED );
	}
	if ( !preferences.contains( DateSetPreferencePage.USER_MAX_NUM_OF_SCHEMA ) )
	{
		preferences.setValue( DateSetPreferencePage.USER_MAX_NUM_OF_SCHEMA,
				String.valueOf( DateSetPreferencePage.DEFAULT_MAX_NUM_OF_SCHEMA ) );
	}
	if ( !preferences.contains( DateSetPreferencePage.USER_MAX_NUM_OF_TABLE_EACH_SCHEMA ) )
	{
		preferences.setValue( DateSetPreferencePage.USER_MAX_NUM_OF_TABLE_EACH_SCHEMA,
				String.valueOf( DateSetPreferencePage.DEFAULT_MAX_NUM_OF_TABLE_EACH_SCHEMA ) );
	}
	if ( !preferences.contains( DateSetPreferencePage.USER_TIMEOUT_LIMIT ) )
	{
		preferences.setValue( DateSetPreferencePage.USER_TIMEOUT_LIMIT,
				String.valueOf( DateSetPreferencePage.DEFAULT_TIMEOUT_LIMIT ) );
	}
}
 
Example 3
Source File: PreferenceWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public boolean getBoolean( String name )
{
	if ( this.preferenceType == SPECIAL_TYPE && project != null )
	{
		Preferences preference = prefs.getReportPreference( project );
		if ( preference != null && preference.contains( name ) )
			return preference.getBoolean( name );
	}
	return prefsStore.getBoolean( name );
}
 
Example 4
Source File: PreferenceWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public double getDouble( String name )
{
	if ( this.preferenceType == SPECIAL_TYPE && project != null )
	{
		Preferences preference = prefs.getReportPreference( project );
		if ( preference != null && preference.contains( name ) )
			return preference.getDouble( name );
	}
	return prefsStore.getDouble( name );
}
 
Example 5
Source File: PreferenceWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public float getFloat( String name )
{
	if ( this.preferenceType == SPECIAL_TYPE && project != null )
	{
		Preferences preference = prefs.getReportPreference( project );
		if ( preference != null && preference.contains( name ) )
			return preference.getFloat( name );
	}
	return prefsStore.getFloat( name );
}
 
Example 6
Source File: PreferenceWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public int getInt( String name )
{
	if ( this.preferenceType == SPECIAL_TYPE && project != null )
	{
		Preferences preference = prefs.getReportPreference( project );
		if ( preference != null && preference.contains( name ) )
			return preference.getInt( name );
	}
	return prefsStore.getInt( name );
}
 
Example 7
Source File: PreferenceWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public long getLong( String name )
{
	if ( this.preferenceType == SPECIAL_TYPE && project != null )
	{
		Preferences preference = prefs.getReportPreference( project );
		if ( preference != null && preference.contains( name ) )
			return preference.getLong( name );
	}
	return prefsStore.getLong( name );
}
 
Example 8
Source File: PreferenceWrapper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public String getString( String name )
{
	if ( this.preferenceType == SPECIAL_TYPE && project != null )
	{
		Preferences preference = prefs.getReportPreference( project );
		if ( preference != null && preference.contains( name ) )
			return preference.getString( name );
	}
	return prefsStore.getString( name );
}
 
Example 9
Source File: OldMechanicPreferences.java    From workspacemechanic with Eclipse Public License 1.0 4 votes vote down vote up
public static boolean contains(String key) {
  Preferences prefs = getPreferences();
  return prefs.contains(key);
}