本文整理汇总了Java中org.eclipse.core.runtime.preferences.ConfigurationScope类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationScope类的具体用法?Java ConfigurationScope怎么用?Java ConfigurationScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationScope类属于org.eclipse.core.runtime.preferences包,在下文中一共展示了ConfigurationScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
public void init() {
globalPreferences = ConfigurationScope.INSTANCE.getNode(CodeCheckerNature.NATURE_ID);
defaults=new HashMap<ConfigTypes,String>();
defaults.put(ConfigTypes.COMPILERS,"gcc:g++:clang");
defaults.put(ConfigTypes.ANAL_THREADS,"4");
defaults.put(ConfigTypes.IS_GLOBAL,"true");
configKeys=new HashMap<ConfigTypes,String>();
configKeys.put(ConfigTypes.CHECKER_PATH,"global_server_url");
configKeys.put(ConfigTypes.PYTHON_PATH,"location_prefix");
configKeys.put(ConfigTypes.COMPILERS,"compilers");
configKeys.put(ConfigTypes.ANAL_THREADS,"analthreads");
configKeys.put(ConfigTypes.CHECKER_LIST,"global_checker_command");
configKeys.put(ConfigTypes.IS_GLOBAL,"is_global");
configKeys.put(ConfigTypes.CHECKER_WORKSPACE,"checker_workspace");
}
示例2: initDBHost
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
private void initDBHost()
{
if (remote_db_url == null || remote_db_url.trim().length() == 0)
{
remote_db_url = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.app").get(BTSPluginIDs.PREF_REMOTE_DB_URL, null);
}
if (remote_db_url != null && remote_db_url.trim().length() > 0)
{
try
{
URL url = new URL(remote_db_url);
protocol = url.getProtocol();
host = url.getHost();
port = url.getPort();
} catch (MalformedURLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("CouchDBDao initDBHost " + remote_db_url);
}
示例3: eventReceivedPreferencesChanged
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
@Inject
@Optional
void eventReceivedPreferencesChanged(
@EventTopic("event_preferences_changed/*") final String preferencePath) {
if (preferencePath != null && preferencePath.endsWith(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS)) {
sync.asyncExec(new Runnable() {
@Override
public void run() {
Preferences rootNode = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus");
annotationSettings = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
AnnotationToolbarItemCreator.processAndUpateToolbarItemsAnnotationShortcut(part, annotationSettings);
textAnnotatationEditor.reloadCurrentSentence();
}
});
}
}
示例4: getWritablePreferenceStore
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public IPreferenceStore getWritablePreferenceStore(Object context) {
lazyInitialize();
if (context instanceof IFileEditorInput) {
context = ((IFileEditorInput) context).getFile().getProject();
}
if (context instanceof IProject) {
ProjectScope projectScope = new ProjectScope((IProject) context);
FixedScopedPreferenceStore result = new FixedScopedPreferenceStore(projectScope, getQualifier());
result.setSearchContexts(new IScopeContext[] {
projectScope,
new InstanceScope(),
new ConfigurationScope()
});
return result;
}
return getWritablePreferenceStore();
}
示例5: init
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
/**
* Initialize the preference page.
*/
public void init(IWorkbench workbench) {
// BundleContext bundleContext = Platform.getBundle("org.bbaw.bts.ui.main").getBundleContext();
context = StaticAccessController.getContext();
corpusController = context.get(CorpusNavigatorController.class);
prefs = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.app");
IEclipsePreferences defaultpref = DefaultScope.INSTANCE.getNode("org.bbaw.bts.app");
main_corpus_key = prefs.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, defaultpref.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, null));
active_corpora = prefs.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, defaultpref.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, null));
logger = context.get(Logger.class);
loadListInput();
activate = prefs.getBoolean(BTSPluginIDs.PREF_CORPUS_ACTIVATE_MAIN_CORPUS_SELECTION, false);
initialActivate = new Boolean(activate);
mainCorpusComboViewer.getCombo().setEnabled(activate);
activateButton.setSelection(activate);
}
示例6: loadAnnotationPreferenceNodes
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
/**
* @return
*/
private List<EclipsePreferences> loadAnnotationPreferenceNodes() {
Preferences rootNode = ConfigurationScope.INSTANCE.getNode(Activator.BUNDLE_ID);
annotationsNode = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
List<EclipsePreferences> nodes = new Vector<EclipsePreferences>();
if (annotationsNode != null)
{
try {
for (String n : annotationsNode.childrenNames())
{
if (annotationsNode.nodeExists(n))
{
nodes.add((EclipsePreferences) annotationsNode.node(n));
}
}
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
return nodes;
}
示例7: performOk
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
@Override
public boolean performOk() {
Preferences preferences = ConfigurationScope.INSTANCE.getNode("org.mdpm.lng.plan.preferences");
preferences.putBoolean("sunday", sunday.getSelection());
preferences.putBoolean("monday", monday.getSelection());
preferences.putBoolean("tuesday", tuesday.getSelection());
preferences.putBoolean("wednesday", wednesday.getSelection());
preferences.putBoolean("thursday", thursday.getSelection());
preferences.putBoolean("friday", friday.getSelection());
preferences.putBoolean("saturday", saturday.getSelection());
String tmp="";
if(dates.getItemCount()>0){
for (int k=0; k<dates.getItemCount();k++){
tmp = tmp+dates.getItem(k)+",";
}
}
preferences.put("dates",tmp);
//preferences.put
try {
preferences.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
return super.performOk();
}
示例8: getFolderFromPreferences
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
private static File getFolderFromPreferences() {
IPreferencesService service = Platform.getPreferencesService();
Preferences node = service.getRootNode().node(ConfigurationScope.SCOPE).node(CoreActivator.PLUGIN_ID);
if(node!=null) {
String folderPath = node.get(DesignerCoreConstants.CONFIG_FOLDER_PREFERENCE, null);
if(folderPath!=null) {
File file = new File(folderPath);
if(file!=null && file.isDirectory()) {
return file;
} else {
logger.warn("'{}' is no valid directory.", folderPath);
}
}
}
return null;
}
示例9: start
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void start(BundleContext context) throws Exception
{
super.start(context);
if (SingleSourcePlugin.getUIHelper().getUI() == UI.RAP)
{
// Is this necessary?
// RAPCorePlugin adds the "server" scope for all plugins,
// but starts too late...
Platform.getPreferencesService().setDefaultLookupOrder(
PLUGIN_ID, null,
new String[]
{
InstanceScope.SCOPE,
ConfigurationScope.SCOPE,
"server",
DefaultScope.SCOPE
});
}
plugin = this;
}
示例10: getPreferenceImportFilters
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
private IPreferenceFilter[] getPreferenceImportFilters() {
IPreferenceFilter filter = new IPreferenceFilter() {
/** {@inheritDoc} */
@Override
public String[] getScopes() {
return new String[] {ConfigurationScope.SCOPE, InstanceScope.SCOPE};
}
/** {@inheritDoc} */
@Override
public Map<?, ?> getMapping(String scope) {
return null;
}
};
return new IPreferenceFilter[] {filter};
}
示例11: getEclipsePreferences
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
/**
* Returns the eclipse preferences.
* @return the eclipse preferences
*/
public IEclipsePreferences getEclipsePreferences() {
if (eclipsePreferences==null) {
IScopeContext iScopeContext = ConfigurationScope.INSTANCE;
eclipsePreferences = iScopeContext.getNode(PlugInActivator.PLUGIN_ID);
eclipsePreferences.addPreferenceChangeListener(this.getChangeListener());
}
return eclipsePreferences;
}
示例12: getTimeZone
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
public static TimeZone getTimeZone ()
{
final IScopeContext[] scopeContext = new IScopeContext[] { ConfigurationScope.INSTANCE };
final String tzId = Platform.getPreferencesService ().getString ( PLUGIN_ID, TIME_ZONE_KEY, TimeZone.getDefault ().getID (), scopeContext );
if ( Arrays.asList ( TimeZone.getAvailableIDs () ).contains ( tzId ) )
{
return TimeZone.getTimeZone ( tzId );
}
return TimeZone.getDefault ();
}
示例13: saveSettings
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
public EclipsePreferencesSerializer<T> saveSettings(final T settings) {
IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(prefereneceId);
Gson gson = new Gson();
preferences.put(preferenceKey, gson.toJson(settings));
try {
preferences.flush();
} catch (BackingStoreException e) {
throw new RuntimeException(e);
}
return this;
}
示例14: loadSettings
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public T loadSettings(final Class<?> settingsTypeClass) {
IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(prefereneceId);
Gson gson = new Gson();
String keyValue = preferences.get(preferenceKey, null);
if (keyValue != null) {
return (T) gson.fromJson(keyValue, settingsTypeClass );
}
return null;
}
示例15: folderChoosed
import org.eclipse.core.runtime.preferences.ConfigurationScope; //导入依赖的package包/类
public void folderChoosed(String folderPath) {
this.folderPath = folderPath;
doResetProvider();
IEclipsePreferences node = ConfigurationScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
node.put(CHOOSED_FOLDER_PREF, folderPath);
try {
node.flush();
} catch (BackingStoreException e) {
PrefEditorPlugin.log(e);
}
setViewerTitle(folderPath);
}