Package org.eclipse.jface.preference

Examples of org.eclipse.jface.preference.IPreferenceStore


    }

    public final synchronized void loadExclusions()
    {
        exclusionSet.clear();
        IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
        String[] exclusions = PrefsUtils.stringToArray(store.getString(SigilCore.DEFAULT_EXCLUDED_RESOURCES));
        for (String exclusion : exclusions)
        {
            exclusionSet.add(GlobCompiler.compile(exclusion));
        }
    }
View Full Code Here


    private void init()
    {
        boolean show = false;

        IPreferenceStore prefs = getPreferenceStore();

        synchronized (this)
        {
            if (!initialised)
            {
                initialised = true;

                prefs.addPropertyChangeListener(this);

                String val = prefs.getString(SigilCore.OSGI_INSTALLS);

                boolean noAsk = prefs.getBoolean(SigilCore.PREFERENCES_NOASK_OSGI_INSTALL);
                if (val == null || val.trim().length() == 0)
                {
                    show = !noAsk;
                }
                else
                {
                    addInstalls(val);
                    defaultId = prefs.getString(SigilCore.OSGI_DEFAULT_INSTALL_ID);
                }
            }
        }

        if (show)
View Full Code Here

    private void addInstalls(String prop)
    {
        if (prop != null && prop.trim().length() > 0)
        {
            IPreferenceStore prefs = getPreferenceStore();

            for (String id : prop.split(","))
            {
                String path = prefs.getString(SigilCore.OSGI_INSTALL_PREFIX + id);
                addInstall(id, new Path(path));
            }
        }
    }
View Full Code Here

        return composite;
    }

    private void loadPreferences(boolean useDefaults)
    {
        IPreferenceStore prefs = getPreferenceStore();
        String lowerBoundStr;
        if (useDefaults)
        {
            lowerBoundStr = prefs.getDefaultString(SigilCore.DEFAULT_VERSION_LOWER_BOUND);
        }
        else
        {
            lowerBoundStr = prefs.getString(SigilCore.DEFAULT_VERSION_LOWER_BOUND);
        }

        String upperBoundStr;
        if (useDefaults)
        {
            upperBoundStr = prefs.getDefaultString(SigilCore.DEFAULT_VERSION_UPPER_BOUND);
        }
        else
        {
            upperBoundStr = prefs.getString(SigilCore.DEFAULT_VERSION_UPPER_BOUND);
        }

        lowerBoundRule = VersionRangeBoundingRule.valueOf(lowerBoundStr);
        upperBoundRule = VersionRangeBoundingRule.valueOf(upperBoundStr);
    }
View Full Code Here

    private static final String LOC = ".loc";
    private static final String TIMESTAMP = ".timestamp";

    public List<IRepositoryModel> loadRepositories()
    {
        IPreferenceStore prefs = SigilCore.getDefault().getPreferenceStore();

        ArrayList<IRepositoryModel> repositories = new ArrayList<IRepositoryModel>();

        for (IRepositoryType type : loadRepositoryTypes())
        {
            String typeID = type.getId();

            if (type.isDynamic())
            {
                String instances = prefs.getString(REPOSITORY + typeID + INSTANCES);
                if (instances.trim().length() > 0)
                {
                    for (String instance : instances.split(","))
                    {
                        String key = REPOSITORY + typeID + "." + instance;
                        repositories.add(loadRepository(instance, key, type, prefs));
                    }
                }
            }
            else
            {
                String key = REPOSITORY + typeID;
                repositories.add(loadRepository(typeID, key, type, prefs));
            }

        }
       
        final List<String> order = PrefsUtils.stringToList(prefs.getString(REPOSITORY_ORDER));
       
        Collections.sort(repositories, new Comparator<IRepositoryModel>() {
            public int compare(IRepositoryModel o1, IRepositoryModel o2)
            {
                int i1 = order.indexOf(o1.getId());
View Full Code Here

    }

    public void saveRepositories(List<IRepositoryModel> repositories)
        throws CoreException
    {
        IPreferenceStore prefs = getPreferences();

        HashMap<IRepositoryType, List<IRepositoryModel>> mapped = new HashMap<IRepositoryType, List<IRepositoryModel>>(
            repositories.size());

        saveRepositoryPreferences(repositories, mapped);
View Full Code Here

    }

    @Override
    public boolean performOk()
    {
        IPreferenceStore prefs = getPreferenceStore();
        for (String key : prefs.getString(SigilCore.LIBRARY_KEYS_PREF).split(","))
        {
            prefs.setToDefault(key);
        }

        StringBuffer keys = new StringBuffer();

        for (ILibrary lib : libraries)
        {
            throw new IllegalStateException("XXX-FIXME-XXX");
        }

        prefs.setValue(SigilCore.LIBRARY_KEYS_PREF, keys.toString());

        return true;
    }
View Full Code Here

        libraryView.refresh();
    }

    private void loadPreferences()
    {
        IPreferenceStore prefs = getPreferenceStore();
        String keys = prefs.getString(SigilCore.LIBRARY_KEYS_PREF);
        if (keys.trim().length() > 0)
        {
            for (String key : keys.split(","))
            {
                String libStr = prefs.getString(key);
                // XXX-FIXME-XXX parse library string
                // lib = parse(libstr);
                // libraries.add(lib);
            }
            libraryView.refresh();
View Full Code Here

    public PropertiesForm(SigilProjectEditorPart editor, ISigilProjectModel project)
    {
        super(PAGE_ID);
        JavaTextTools textTools = JavaPlugin.getDefault().getJavaTextTools();
        IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
        setPreferenceStore(store);
        setSourceViewerConfiguration(new PropertiesFileSourceViewerConfiguration(
            textTools.getColorManager(), store, this,
            IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
        /*IFileEditorInput fileInput = (IFileEditorInput) editor.getEditorInput();
View Full Code Here

        }
    }

    public static VersionRange getDefaultRange(Version version)
    {
        IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();

        VersionRangeBoundingRule lowerBoundRule = VersionRangeBoundingRule.valueOf(store.getString(SigilCore.DEFAULT_VERSION_LOWER_BOUND));
        VersionRangeBoundingRule upperBoundRule = VersionRangeBoundingRule.valueOf(store.getString(SigilCore.DEFAULT_VERSION_UPPER_BOUND));

        VersionRange selectedVersions = VersionRange.newInstance(version, lowerBoundRule,
            upperBoundRule);
        return selectedVersions;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.preference.IPreferenceStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.