org.eclipse.core.runtime.Preferences#getString ( )源码实例Demo

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

源代码1 项目: http4e   文件: BaseUtils.java
public static byte[] readFromPrefs( String prefName){
   try {
      Plugin pl = (Plugin) CoreContext.getContext().getObject("p");
      Preferences prefs = pl.getPluginPreferences();
      String str64 = prefs.getString(prefName);
      byte[] data = Base64.decodeBase64(str64.getBytes("UTF8"));
      return data;

   } catch (UnsupportedEncodingException e) {
      ExceptionHandler.handle(e);
   } catch (Exception ignore) {
      ExceptionHandler.handle(ignore);
   }
   return null;
}
 
源代码2 项目: textuml   文件: TextUMLPreferencePage.java
private Object[] findCheckedElements() {
    Preferences preferences = TextUMLUIPlugin.getDefault().getPluginPreferences();
    String rawString = preferences.getString(TextUMLUIPlugin.OPTIONS);
    List a = new ArrayList();
    if (isNotEmpty(rawString)) {
        String[] selected = rawString.split(",");
        for (String optId : selected) {
            a.add(options.get(optId));
        }
    }
    return a.toArray();
}
 
源代码3 项目: birt   文件: PreferenceWrapper.java
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 );
}
 
源代码4 项目: uima-uimaj   文件: MultiPageEditorContributor.java
/**
 * Gets the uima pref string.
 *
 * @param key the key
 * @param defaultValue the default value
 * @return the uima pref string
 */
private static String getUimaPrefString(String key, String defaultValue) {
  TAEConfiguratorPlugin plugin = TAEConfiguratorPlugin.getDefault();
  Preferences prefs = plugin.getPluginPreferences();
  boolean isDefault = prefs.isDefault(key);
  if (isDefault)
    prefs.setDefault(key, defaultValue);
  return prefs.getString(key);
}
 
/**
 * returns the value of given key as a string.
 */
public static String getString(String key) {
  Preferences prefs = getPreferences();
  return prefs.getString(key);
}
 
源代码6 项目: birt   文件: ReportLauncherUtils.java
public static IPath getEclipseHome( )
{
	Preferences preferences = PDECore.getDefault( ).getPluginPreferences( );
	return new Path( preferences.getString( ICoreConstants.PLATFORM_PATH ) );
}
 
/**
 * Loads a history from an XML encoded preference value.
 *
 * @param preferences the preferences to retrieve the history from
 * @param key the key under which the history is stored
 * @return the deserialized history, or <code>null</code> if there is nothing stored under the
 *         given key
 * @throws CoreException if deserialization fails
 * @see #store(ContentAssistHistory, Preferences, String) on how to store a history such that it
 *      can be read by this method
 */
public static ContentAssistHistory load(Preferences preferences, String key) throws CoreException {
	String value= preferences.getString(key);
	if (value != null && value.length() > 0) {
		return new ReaderWriter().load(new InputSource(new StringReader(value)));
	}
	return null;
}