Package org.erlide.ui.editors.erl.folding

Examples of org.erlide.ui.editors.erl.folding.IErlangFoldingPreferenceBlock


     * @throws CoreException
     *             if creation fails
     */
    public IErlangFoldingPreferenceBlock createPreferences() throws CoreException {
        if (fHasPreferences) {
            final IErlangFoldingPreferenceBlock prefs = (IErlangFoldingPreferenceBlock) fElement
                    .createExecutableExtension(PREFERENCES_CLASS);
            return prefs;
        }
        return new EmptyErlangFoldingPreferenceBlock();
    }
View Full Code Here


    void updateListDependencies() {
        final String id = fStore.getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER);
        final ErlangFoldingStructureProviderDescriptor desc = fProviderDescriptors
                .get(id);
        IErlangFoldingPreferenceBlock prefs;

        if (desc == null) {
            // safety in case there is no such descriptor
            final String message = PreferencesMessages.FoldingConfigurationBlock_error_not_exist;
            ErlideUIPlugin.log(new Status(IStatus.WARNING, ErlideUIPlugin.PLUGIN_ID,
                    IStatus.OK, message, null));
            prefs = new ErrorPreferences(message);
        } else {
            prefs = fProviderPreferences.get(id);
            if (prefs == null) {
                try {
                    prefs = desc.createPreferences();
                    fProviderPreferences.put(id, prefs);
                } catch (final CoreException e) {
                    ErlideUIPlugin.log(e);
                    prefs = new ErrorPreferences(e.getLocalizedMessage());
                }
            }
        }

        Control control = fProviderControls.get(id);
        if (control == null) {
            control = prefs.createControl(fGroup);
            if (control == null) {
                final String message = PreferencesMessages.FoldingConfigurationBlock_info_no_preferences;
                control = new ErrorPreferences(message).createControl(fGroup);
            } else {
                fProviderControls.put(id, control);
            }
        }
        Dialog.applyDialogFont(control);
        fStackLayout.topControl = control;
        control.pack();
        fGroup.layout();
        fGroup.getParent().layout();

        prefs.initialize();
    }
View Full Code Here

    }

    @Override
    public void performOk() {
        for (final Object element : fProviderPreferences.values()) {
            final IErlangFoldingPreferenceBlock prefs = (IErlangFoldingPreferenceBlock) element;
            prefs.performOk();
        }
    }
View Full Code Here

    @Override
    public void performDefaults() {
        restoreFromPreferences();
        for (final Object element : fProviderPreferences.values()) {
            final IErlangFoldingPreferenceBlock prefs = (IErlangFoldingPreferenceBlock) element;
            prefs.performDefaults();
        }
    }
View Full Code Here

    }

    @Override
    public void dispose() {
        for (final Object element : fProviderPreferences.values()) {
            final IErlangFoldingPreferenceBlock prefs = (IErlangFoldingPreferenceBlock) element;
            prefs.dispose();
        }
    }
View Full Code Here

TOP

Related Classes of org.erlide.ui.editors.erl.folding.IErlangFoldingPreferenceBlock

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.