use of org.eclipse.core.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class PreferencesHelperTest method nextContexts_3.
@Test
public void nextContexts_3() {
final IScopeContext[] list = PreferencesHelperTest.ALL_SCOPE_CONTEXTS;
final IScopeContext item = InstanceScope.INSTANCE;
final IScopeContext[] val = PreferencesHelper.getNextContexts(list, item);
Assert.assertNotNull(val);
Assert.assertEquals(2, val.length);
Assert.assertEquals(ConfigurationScope.INSTANCE, val[0]);
Assert.assertEquals(DefaultScope.INSTANCE, val[1]);
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class PreferencesHelper method getNextContexts.
public static IScopeContext[] getNextContexts(final IScopeContext[] list, final IScopeContext item) {
final List<IScopeContext> result = new ArrayList<>();
boolean found = false;
for (final IScopeContext ctx : list) {
if (found) {
result.add(ctx);
}
if (ctx.equals(item)) {
found = true;
}
}
return result.toArray(new IScopeContext[result.size()]);
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class PreferencesHelper method hasAnyAtLowestScope.
public boolean hasAnyAtLowestScope() {
final IScopeContext sc = storeContext;
final IEclipsePreferences p = sc.getNode(qualifier);
if (p != null) {
try {
final String[] keys = p.keys();
return keys.length > 0;
} catch (final BackingStoreException e) {
}
}
return false;
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class CodeAssistPreferences method getNode.
public static IEclipsePreferences getNode() {
final IScopeContext context = InstanceScope.INSTANCE;
final IEclipsePreferences eclipsePreferences = context.getNode(CodeAssistPreferences.QUALIFIER);
return eclipsePreferences;
}
Aggregations