use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project cubrid-manager by CUBRID.
the class CubridStatusMonitorInstance method loadSetting.
/**
* Get the info of StatusMonInstanceData relevant to key from preference
*
* @param key the key relevant to saving instance of StatusMonInstanceData
* @return the instance of StatusMonInstanceData
*/
public StatusMonInstanceData loadSetting(String key) {
StatusMonInstanceData data = null;
synchronized (this) {
IEclipsePreferences preference = new InstanceScope().getNode(CubridManagerUIPlugin.PLUGIN_ID);
byte[] bytes = preference.getByteArray(key, BYTE_ARRAY_DEFAULT_DEFAULT);
if (bytes.length > 0) {
try {
ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStream(bytes));
data = (StatusMonInstanceData) inputStream.readObject();
inputStream.close();
} catch (Exception ex) {
LOGGER.error(ex.getMessage());
}
}
}
return data;
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project sling by apache.
the class DisableDebugStatusHandlers method before.
@Override
protected void before() throws Throwable {
IEclipsePreferences debugPrefs = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
debugPrefs.putBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, false);
debugPrefs.flush();
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project sling by apache.
the class ProjectUtil method setPathPersistentProperty.
private static void setPathPersistentProperty(IProject project, IPath path, String propertyName) {
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
if (projectNode != null) {
projectNode.put(propertyName, path.toPortableString());
try {
projectNode.flush();
} catch (BackingStoreException e) {
Activator.getDefault().getPluginLogger().error(e.getMessage(), e);
}
}
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project sling by apache.
the class PreferencesInitializer method initializeDefaultPreferences.
@Override
public void initializeDefaultPreferences() {
IEclipsePreferences node = DefaultScope.INSTANCE.getNode(org.apache.sling.ide.eclipse.core.internal.Activator.PLUGIN_ID);
node.put(Preferences.IGNORED_FILE_NAMES_FOR_SYNC, ".svn;.DS_Store;.gitignore;.vlt;.vltignore");
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project xtext-xtend by eclipse.
the class JavaProjectPreferencesInitializer method addOwnFileExtensionsToJavaBuildResourceCopyFilter.
@SuppressWarnings("restriction")
@Inject
public void addOwnFileExtensionsToJavaBuildResourceCopyFilter(FileExtensionProvider extensionProvider) {
@SuppressWarnings("deprecation") IScopeContext defaultScope = new DefaultScope();
// The class org.eclipse.jdt.internal.launching.LaunchingPreferenceInitializer has this very nasty habit
// of replacing all RESOURCE_COPY_FILTERs with its own filter. Calling getNode(LaunchingPlugin.ID_PLUGIN)
// causes LaunchingPreferenceInitializer to be executed that afterwards we can append our filters safely.
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=395366
defaultScope.getNode(org.eclipse.jdt.internal.launching.LaunchingPlugin.ID_PLUGIN);
IEclipsePreferences dnode = defaultScope.getNode(JavaCore.PLUGIN_ID);
if (dnode == null)
return;
Set<String> filters = Sets.newLinkedHashSet();
for (String filter : dnode.get(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, "").split(",")) {
String trimmed = filter.trim();
if (!"".equals(trimmed))
filters.add(trimmed);
}
for (String ext : extensionProvider.getFileExtensions()) filters.add("*." + ext);
dnode.put(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, Joiner.on(", ").join(filters));
try {
dnode.flush();
} catch (BackingStoreException e) {
log.error("Error saving preferences", e);
}
}
Aggregations