Example usage for org.eclipse.jface.preference IPreferenceStore getDefaultInt

List of usage examples for org.eclipse.jface.preference IPreferenceStore getDefaultInt

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore getDefaultInt.

Prototype

int getDefaultInt(String name);

Source Link

Document

Returns the default value for the integer-valued preference with the given name.

Usage

From source file:org.talend.dataprofiler.core.license.LicenseManagement.java

License:Open Source License

private static void initPreferenceStore() {
    IPreferenceStore prefStore = PlatformUI.getPreferenceStore();
    if (prefStore.getDefaultInt("LICENSE_VALIDATION_DONE") == 0) { //$NON-NLS-1$
        prefStore.setDefault("LICENSE_VALIDATION_DONE", LICENSE_VALIDATION_DONE); //$NON-NLS-1$
    }//from   ww w .j a  v  a  2 s  .com
}

From source file:org.talend.repository.license.LicenseManagement.java

License:Open Source License

/**
 * DOC mhirt Comment method "init"./* w  w  w. j  a  va2s  . c  o  m*/
 * @return
 */
private static void initPreferenceStore() {
    IPreferenceStore prefStore = PlatformUI.getPreferenceStore();
    if (prefStore.getDefaultInt("LICENSE_VALIDATION_DONE") == 0) { //$NON-NLS-1$
        prefStore.setDefault("LICENSE_VALIDATION_DONE", LICENSE_VALIDATION_DONE); //$NON-NLS-1$
    }
}

From source file:org.tigris.subversion.subclipse.ui.preferences.SVNMenuIconsPreferencesPage.java

License:Open Source License

/**
 * Defaults was clicked. Restore the SVN preferences to
 * their default values/*w ww.j  a v  a 2s .com*/
 */
protected void performDefaults() {
    super.performDefaults();

    IPreferenceStore store = getPreferenceStore();

    int iconSet = store.getDefaultInt(ISVNUIConstants.PREF_MENU_ICON_SET);
    useTortoiseSVN.setSelection(ISVNUIConstants.MENU_ICON_SET_TORTOISESVN == iconSet);
    useDefault.setSelection(ISVNUIConstants.MENU_ICON_SET_DEFAULT == iconSet);
    useDefault.setSelection(ISVNUIConstants.MENU_ICON_SET_SUBVERSIVE == iconSet);

    verifyValidation();
}

From source file:tarlog.encoder.tool.eclipse.preferences.PropertiesStore.java

License:Apache License

public PropertiesStore(IPreferenceStore preferenceStore, boolean isDefault) throws MalformedURLException {
    int groupsAmount = isDefault ? preferenceStore.getDefaultInt(PropertiesStore.class.getName())
            : preferenceStore.getInt(PropertiesStore.class.getName());
    for (int i = 0; i < groupsAmount; ++i) {
        store.add(new EncodersGroup(i, preferenceStore, isDefault));
    }/*from w  w w.j a v a 2s  . c  o m*/
}

From source file:uk.ac.diamond.scisoft.analysis.rcp.DataExplorationPerspective.java

License:Apache License

private int getDefaultPlottingSystemChoice() {
    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
    return preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_PLOTTING_SYSTEM)
            ? preferenceStore.getDefaultInt(PreferenceConstants.PLOT_VIEW_PLOTTING_SYSTEM)
            : preferenceStore.getInt(PreferenceConstants.PLOT_VIEW_PLOTTING_SYSTEM);
}

From source file:uk.ac.diamond.scisoft.analysis.rcp.plotting.Plot1DStackUI.java

License:Apache License

private int getCameraPerspectiveChoice() {
    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
    return preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_MULTI1D_CAMERA_PROJ)
            ? preferenceStore.getDefaultInt(PreferenceConstants.PLOT_VIEW_MULTI1D_CAMERA_PROJ)
            : preferenceStore.getInt(PreferenceConstants.PLOT_VIEW_MULTI1D_CAMERA_PROJ);
}

From source file:uk.ac.diamond.scisoft.analysis.rcp.plotting.Plot2DMultiUI.java

License:Apache License

private int getDefaultPlottingSystemChoice() {
    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
    return preferenceStore.isDefault(DeprecatedPreferenceConstants.PLOT_VIEW_PLOTTING_SYSTEM)
            ? preferenceStore.getDefaultInt(DeprecatedPreferenceConstants.PLOT_VIEW_PLOTTING_SYSTEM)
            : preferenceStore.getInt(DeprecatedPreferenceConstants.PLOT_VIEW_PLOTTING_SYSTEM);
}

From source file:uk.ac.diamond.scisoft.analysis.rcp.plotting.Plot2DUI.java

License:Apache License

private int getPreferenceColourScaleChoice() {
    if (histogramView != null && logScaleSettings.get(histogramView.getPartName()) != null)
        return logScaleSettings.get(histogramView.getPartName());
    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
    if (histogramView != null) {
        String pName = histogramView.getPartName();
        if (!preferenceStore.isDefault(pName + "." + PreferenceConstants.PLOT_VIEW_PLOT2D_SCALING))
            return preferenceStore.getInt(pName + "." + PreferenceConstants.PLOT_VIEW_PLOT2D_SCALING);
    }//from  www.j a va2 s.c  om
    return preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_PLOT2D_SCALING)
            ? preferenceStore.getDefaultInt(PreferenceConstants.PLOT_VIEW_PLOT2D_SCALING)
            : preferenceStore.getInt(PreferenceConstants.PLOT_VIEW_PLOT2D_SCALING);
}

From source file:uk.ac.diamond.scisoft.analysis.rcp.plotting.printing.PlotPrintPreviewDialog.java

License:Apache License

/**
 * PlotPrintPreviewDialog is listening to eventual property changes done through the Preference Page
 *//*from  w w w  .  j av a 2s. c o  m*/
private void addPropertyListeners() {
    AnalysisRCPActivator.getDefault().getPreferenceStore()
            .addPropertyChangeListener(new IPropertyChangeListener() {

                @Override
                public void propertyChange(PropertyChangeEvent event) {
                    String property = event.getProperty();
                    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
                    if (property.equals(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME)
                            || property.equals(PreferenceConstants.PRINTSETTINGS_SCALE)
                            || property.equals(PreferenceConstants.PRINTSETTINGS_RESOLUTION)
                            || property.equals(PreferenceConstants.PRINTSETTINGS_ORIENTATION)) {

                        int printerName;
                        if (preferenceStore.isDefault(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME)) {
                            printerName = preferenceStore
                                    .getDefaultInt(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME);
                        } else {
                            printerName = preferenceStore
                                    .getInt(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME);
                        }
                        printerNames = Printer.getPrinterList();
                        for (int i = 0; i < printerNames.length; i++) {
                            if (i == printerName) {
                                settings.setPrinterData(printerNames[i]);
                                break;
                            }
                        }

                        int scale;
                        if (preferenceStore.isDefault(PreferenceConstants.PRINTSETTINGS_SCALE)) {
                            scale = preferenceStore.getDefaultInt(PreferenceConstants.PRINTSETTINGS_SCALE);
                        } else {
                            scale = preferenceStore.getInt(PreferenceConstants.PRINTSETTINGS_SCALE);
                        }
                        Scale[] scales = Scale.values();
                        for (int i = 0; i < scales.length; i++) {
                            if (i == scale) {
                                settings.setScale(scales[i]);
                                break;
                            }
                        }

                        int resolution;
                        if (preferenceStore.isDefault(PreferenceConstants.PRINTSETTINGS_RESOLUTION)) {
                            resolution = preferenceStore
                                    .getDefaultInt(PreferenceConstants.PRINTSETTINGS_RESOLUTION);
                        } else {
                            resolution = preferenceStore.getInt(PreferenceConstants.PRINTSETTINGS_RESOLUTION);
                        }
                        Resolution[] resolutions = Resolution.values();
                        for (int i = 0; i < resolutions.length; i++) {
                            if (i == resolution) {
                                settings.setResolution(resolutions[i]);
                                break;
                            }
                        }

                        int orientation;
                        if (preferenceStore.isDefault(PreferenceConstants.PRINTSETTINGS_ORIENTATION)) {
                            orientation = preferenceStore
                                    .getDefaultInt(PreferenceConstants.PRINTSETTINGS_ORIENTATION);
                        } else {
                            orientation = preferenceStore.getInt(PreferenceConstants.PRINTSETTINGS_ORIENTATION);
                        }
                        Orientation[] orientations = Orientation.values();
                        for (int i = 0; i < orientations.length; i++) {
                            if (i == orientation) {
                                settings.setOrientation(orientations[i]);
                                break;
                            }
                        }
                    }
                }
            });
}

From source file:uk.ac.diamond.scisoft.analysis.rcp.plotting.printing.PlotPrintPreviewDialog.java

License:Apache License

private int getPreferencePrinterName() {
    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
    return preferenceStore.isDefault(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME)
            ? preferenceStore.getDefaultInt(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME)
            : preferenceStore.getInt(PreferenceConstants.PRINTSETTINGS_PRINTER_NAME);
}