Search in sources :

Example 61 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 62 with IPreferencesService

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);
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 63 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 64 with IPreferencesService

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);
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 65 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Aggregations

IPreferencesService (org.eclipse.core.runtime.preferences.IPreferencesService)96 IFile (org.eclipse.core.resources.IFile)26 ArrayList (java.util.ArrayList)15 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)15 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)14 IProject (org.eclipse.core.resources.IProject)13 CoreException (org.eclipse.core.runtime.CoreException)13 Module (org.eclipse.titan.designer.AST.Module)11 ProjectSourceParser (org.eclipse.titan.designer.parsers.ProjectSourceParser)11 List (java.util.List)10 File (java.io.File)8 TextSelection (org.eclipse.jface.text.TextSelection)8 Path (org.eclipse.core.runtime.Path)6 IContainer (org.eclipse.core.resources.IContainer)5 IMarker (org.eclipse.core.resources.IMarker)5 IPath (org.eclipse.core.runtime.IPath)5 SubMonitor (org.eclipse.core.runtime.SubMonitor)5 RefactoringStatus (org.eclipse.ltk.core.refactoring.RefactoringStatus)5 IOException (java.io.IOException)4 IStatus (org.eclipse.core.runtime.IStatus)4