use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getPlotUpdateDelayMillisec.
public static int getPlotUpdateDelayMillisec() {
int milli = 100;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
milli = prefs.getInt(ID, "plot_update_delay", milli, null);
return milli;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class AutoCompleteUpdater method updateHistory.
@Override
public void updateHistory(String entry) {
LinkedList<String> fifo = AutoCompleteUIPlugin.getDefault().getHistory(AutoCompleteType.PV.value());
if (fifo == null)
return;
IPreferencesService service = null;
try {
service = org.eclipse.core.runtime.Platform.getPreferencesService();
} finally {
}
final int size = // $NON-NLS-1$
service != null ? // $NON-NLS-1$
service.getInt(AutoCompleteUIPlugin.PLUGIN_ID, "history_size", 100, null) : 100;
if (size == 0) {
fifo.clear();
return;
}
// Remove if present, so that is re-added on top
int index = -1;
while ((index = fifo.indexOf(entry)) >= 0) fifo.remove(index);
// Maybe remove oldest, i.e. bottom-most, entry
while (fifo.size() >= size) fifo.removeLast();
// Add at the top
fifo.addFirst(entry);
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getArchiveFetchDelay.
public static long getArchiveFetchDelay() {
long delay = 1000;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
delay = prefs.getLong(Activator.PLUGIN_ID, ARCHIVE_FETCH_DELAY, delay, null);
return delay;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getPltRepository.
public static IPath getPltRepository() {
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs == null)
return null;
String pltRepo = prefs.getString(Activator.PLUGIN_ID, PLT_REPOSITORY, null, null);
if (pltRepo == null || pltRepo.trim().isEmpty())
return null;
return SingleSourcePlugin.getResourceHelper().newPath(pltRepo);
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getReadTimeout.
/**
* @return Read timeout [ms]
*/
public static int getReadTimeout() {
int timeout = 10000;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
timeout = prefs.getInt(ModelPlugin.ID, READ_TIMEOUT, timeout, null);
return timeout;
}
Aggregations