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

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

Introduction

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

Prototype

String getString(String name);

Source Link

Document

Returns the current value of the string-valued preference with the given name.

Usage

From source file:com.bb.extensions.plugin.unittests.internal.wizards.install.ConfigurationPage.java

License:Open Source License

/**
 * Create contents of the wizard./*from  w  w w. j  a v a 2  s. c o m*/
 * 
 * @param parent
 */
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);

    setControl(container);
    GridLayout gl_container = new GridLayout(1, false);
    gl_container.verticalSpacing = 0;
    gl_container.horizontalSpacing = 0;
    gl_container.marginWidth = 0;
    gl_container.marginHeight = 0;
    container.setLayout(gl_container);

    final ScrolledComposite scrolledComposite = new ScrolledComposite(container,
            SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    scrolledComposite.setExpandVertical(true);

    final Composite composite = new Composite(scrolledComposite, SWT.NONE);
    composite.addControlListener(new ControlAdapter() {
        @Override
        public void controlResized(ControlEvent e) {
            scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        }
    });
    GridLayout gl_composite = new GridLayout(1, false);
    gl_composite.marginWidth = 0;
    gl_composite.marginHeight = 0;
    gl_composite.horizontalSpacing = 0;
    composite.setLayout(gl_composite);

    Group grpBuildSystem = new Group(composite, SWT.NONE);
    grpBuildSystem.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpBuildSystem.setText("Build System");
    grpBuildSystem.setLayout(new GridLayout(1, false));

    _btnCmake = new Button(grpBuildSystem, SWT.RADIO);
    _btnCmake.setSelection(true);
    _btnCmake.setText("CMake");

    Group grpTestFramework = new Group(composite, SWT.NONE);
    grpTestFramework.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpTestFramework.setLayout(new GridLayout(1, false));
    grpTestFramework.setText("Test Framework");

    _btnGoogletestgooglemock = new Button(grpTestFramework, SWT.RADIO);
    _btnGoogletestgooglemock.setSelection(true);
    _btnGoogletestgooglemock.setText("GoogleTest/GoogleMock");

    Bundle depsBundle = Platform.getBundle(Constants.DEPENDENCIES_PLUGIN);
    if (depsBundle == null) {
        Label lblTheDependenciesBelow = new Label(composite, SWT.WRAP);
        lblTheDependenciesBelow.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
        GridData gd_lblTheDependenciesBelow = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
        gd_lblTheDependenciesBelow.widthHint = 0;
        lblTheDependenciesBelow.setLayoutData(gd_lblTheDependenciesBelow);
        lblTheDependenciesBelow.setText(
                "The dependencies below require the plugin com.bb.extensions.unittests.dependencies to be installed");
    }

    Group grpCmakeExecutable = new Group(composite, SWT.NONE);
    grpCmakeExecutable.setLayout(new GridLayout(2, false));
    grpCmakeExecutable.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
    grpCmakeExecutable.setSize(562, 87);
    grpCmakeExecutable.setText("CMake Executable");

    _btnCmakeInstallIntoProject = new Button(grpCmakeExecutable, SWT.RADIO);
    _btnCmakeInstallIntoProject.setText("Install Into Project");

    _btnCmakeUseExistingInstallation = new Button(grpCmakeExecutable, SWT.RADIO);
    _btnCmakeUseExistingInstallation.setSelection(true);
    _btnCmakeUseExistingInstallation.setText("Use Existing Installation");

    final Composite composite_1 = new Composite(grpCmakeExecutable, SWT.NONE);
    composite_1.setLayout(new GridLayout(2, false));
    composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));

    _textCmakeExecutable = new Text(composite_1, SWT.BORDER);
    _textCmakeExecutable.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    final Button btnCmakeExecutableBrowse = new Button(composite_1, SWT.NONE);
    btnCmakeExecutableBrowse.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            String s = getFileName();
            if (s != null) {
                _textCmakeExecutable.setText(s);
            }
        }
    });
    btnCmakeExecutableBrowse.setText("Browse");

    _btnCmakeUseExistingInstallation.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean enable = _btnCmakeUseExistingInstallation.getSelection();
            _textCmakeExecutable.setEnabled(enable);
            btnCmakeExecutableBrowse.setEnabled(enable);
        }
    });

    Group grpQmakeExecutable = new Group(composite, SWT.NONE);
    grpQmakeExecutable.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpQmakeExecutable.setText("QMake Executable");
    grpQmakeExecutable.setLayout(new GridLayout(2, false));

    _btnQmakeInstallIntoProject = new Button(grpQmakeExecutable, SWT.RADIO);
    _btnQmakeInstallIntoProject.setText("Install Into Project");

    _btnQmakeUseExistingInstallation = new Button(grpQmakeExecutable, SWT.RADIO);
    _btnQmakeUseExistingInstallation.setText("Use Existing Installation");
    _btnQmakeUseExistingInstallation.setSelection(true);

    Composite composite_2 = new Composite(grpQmakeExecutable, SWT.NONE);
    composite_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    composite_2.setLayout(new GridLayout(2, false));

    _textQmakeExecutable = new Text(composite_2, SWT.BORDER);
    _textQmakeExecutable.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    final Button btnQmakeExecutableBrowse = new Button(composite_2, SWT.NONE);
    btnQmakeExecutableBrowse.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            String s = getFileName();
            if (s != null) {
                _textQmakeExecutable.setText(s);
            }
        }
    });
    btnQmakeExecutableBrowse.setText("Browse");

    _btnQmakeUseExistingInstallation.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean enable = _btnQmakeUseExistingInstallation.getSelection();
            _textQmakeExecutable.setEnabled(enable);
            btnQmakeExecutableBrowse.setEnabled(enable);
        }
    });

    Group grpMingwmsysLocations = new Group(composite, SWT.NONE);
    grpMingwmsysLocations.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpMingwmsysLocations.setText("MinGW/MSys Locations");
    grpMingwmsysLocations.setLayout(new GridLayout(2, false));

    _btnMingwMsysInstallIntoProject = new Button(grpMingwmsysLocations, SWT.RADIO);
    _btnMingwMsysInstallIntoProject.setText("Install Into Project");

    _btnMingwMsysUseExistingInstallation = new Button(grpMingwmsysLocations, SWT.RADIO);
    _btnMingwMsysUseExistingInstallation.setText("Use Existing Installation");
    _btnMingwMsysUseExistingInstallation.setSelection(true);

    Composite composite_3 = new Composite(grpMingwmsysLocations, SWT.NONE);
    composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    composite_3.setLayout(new GridLayout(3, false));

    Label lblMingw = new Label(composite_3, SWT.NONE);
    lblMingw.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblMingw.setText("MinGW");

    _textMingwLocation = new Text(composite_3, SWT.BORDER);
    _textMingwLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    final Button btnMingwLocationBrowse = new Button(composite_3, SWT.NONE);
    btnMingwLocationBrowse.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            String s = getLocation();
            if (s != null) {
                _textMingwLocation.setText(s);
            }
        }
    });
    btnMingwLocationBrowse.setText("Browse");

    Label lblMsys = new Label(composite_3, SWT.NONE);
    lblMsys.setText("MSys");

    _textMsysLocation = new Text(composite_3, SWT.BORDER);
    _textMsysLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    final Button btnMsysLocationBrowse = new Button(composite_3, SWT.NONE);
    btnMsysLocationBrowse.setText("Browse");

    _btnMingwMsysUseExistingInstallation.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean enable = _btnMingwMsysUseExistingInstallation.getSelection();
            _textMingwLocation.setEnabled(enable);
            btnMingwLocationBrowse.setEnabled(enable);
            _textMsysLocation.setEnabled(enable);
            btnMsysLocationBrowse.setEnabled(enable);
        }
    });

    IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
    _textCmakeExecutable.setText(prefs.getString(PreferenceConstants.P_CMAKE));
    _textQmakeExecutable.setText(prefs.getString(PreferenceConstants.P_QMAKE));
    _textMingwLocation.setText(prefs.getString(PreferenceConstants.P_MINGW));
    _textMsysLocation.setText(prefs.getString(PreferenceConstants.P_MSYS));

    if (depsBundle == null) {
        // disable all dependency controls since the dependency plugin is
        // not installed
        _btnCmakeInstallIntoProject.setEnabled(false);
        _btnCmakeUseExistingInstallation.setEnabled(false);
        btnCmakeExecutableBrowse.setEnabled(false);
        _textCmakeExecutable.setEnabled(false);
        _btnQmakeInstallIntoProject.setEnabled(false);
        _btnQmakeUseExistingInstallation.setEnabled(false);
        btnQmakeExecutableBrowse.setEnabled(false);
        _textQmakeExecutable.setEnabled(false);
        _btnMingwMsysInstallIntoProject.setEnabled(false);
        _btnMingwMsysUseExistingInstallation.setEnabled(false);
        btnMingwLocationBrowse.setEnabled(false);
        btnMsysLocationBrowse.setEnabled(false);
        _textMingwLocation.setEnabled(false);
        _textMsysLocation.setEnabled(false);
    }

    scrolledComposite.setContent(composite);
    scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    composite.layout();
}

From source file:com.bdaum.zoom.ai.clarifai.internal.core.ClarifaiServiceProvider.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override//  ww  w .  j  a  v  a2  s .c o  m
public Prediction predict(byte[] jpeg) {
    Prediction prediction = null;
    ClarifaiActivator activator = ClarifaiActivator.getDefault();
    ClarifaiClient client = activator.getClient();
    if (client != null) {
        String modelId = activator.getModelId();
        if (modelId != null) {
            IPreferenceStore preferenceStore = activator.getPreferenceStore();
            String lang = preferenceStore.getString(PreferenceConstants.LANGUAGE);
            int maxConcepts = preferenceStore.getInt(PreferenceConstants.MAXCONCEPTS);
            double minConfidence = preferenceStore.getInt(PreferenceConstants.MINCONFIDENCE) * 0.01f;
            Model<?> model = getModel(client, modelId);
            ClarifaiInput input = ClarifaiInput.forInputValue(ClarifaiImage.of(jpeg));
            ClarifaiResponse<?> response = model.predict().withInputs(input).withLanguage(lang)
                    .withMaxConcepts(maxConcepts).withMinValue(minConfidence).executeSync();
            ClarifaiStatus status = response.getStatus();
            if (response.isSuccessful()) {
                List<Token> result = new ArrayList<>(20);
                for (ClarifaiOutput<Concept> clarifaiOutput : (List<ClarifaiOutput<Concept>>) response.get())
                    for (Concept concept : clarifaiOutput.data())
                        result.add(new Token(concept.name(), concept.value()));
                if (preferenceStore.getBoolean(PreferenceConstants.TRANSLATE)) {
                    TranslatorClient translatorClient = AiActivator.getDefault().getClient();
                    if (translatorClient != null) {
                        StringBuilder sb = new StringBuilder();
                        for (Token tok : result) {
                            if (sb.length() > 0)
                                sb.append(", "); //$NON-NLS-1$
                            sb.append(tok.getLabel());
                        }
                        try {
                            String translate = translatorClient.translate(sb.toString());
                            StringTokenizer st = new StringTokenizer(translate, ","); //$NON-NLS-1$
                            Iterator<Token> it = result.iterator();
                            while (st.hasMoreTokens() && it.hasNext())
                                it.next().setLabel(st.nextToken().trim());
                        } catch (Exception e) {
                            // don't translate
                        }
                    }
                }
                prediction = new Prediction(getName(), result.toArray(new Token[result.size()]), null,
                        getStatus(status));
                if (checkAdultContent()) {
                    ClarifaiResponse<List<ClarifaiOutput<Concept>>> response2 = client.getDefaultModels()
                            .nsfwModel().predict().withInputs(input).executeSync();
                    if (response2.isSuccessful())
                        lp: for (ClarifaiOutput<Concept> clarifaiOutput : response2.get())
                            for (Concept concept : clarifaiOutput.data())
                                if (SAFE_FOR_WORK.equals(concept.name())) {
                                    prediction.setSafeForWork(concept.value(), -1f);
                                    break lp;
                                }
                }
                List<Rectangle> rects = null;
                if (checkCelebrities()) {
                    ClarifaiResponse<List<ClarifaiOutput<clarifai2.dto.prediction.Prediction>>> response4 = client
                            .predict(CELEBRITIES_ID)
                            .withInputs(ClarifaiInput.forInputValue(ClarifaiImage.of(jpeg)))
                            .withMaxConcepts(maxConcepts).withMinValue(minConfidence).executeSync();
                    if (response4.isSuccessful()) {
                        int height = 0;
                        int width = 0;
                        if (checkFaces()) {
                            try (InputStream in = new ByteArrayInputStream(jpeg)) {
                                BufferedImage image = ImageIO.read(in);
                                height = image.getHeight();
                                width = image.getWidth();
                                rects = new ArrayList<>();
                            } catch (IOException e) {
                                // should never happen
                            }
                        }
                        for (ClarifaiOutput<clarifai2.dto.prediction.Prediction> clarifaiOutput : response4
                                .get())
                            for (clarifai2.dto.prediction.Prediction p : clarifaiOutput.data()) {
                                if (p instanceof FaceConcepts) {
                                    FaceConcepts fc = (FaceConcepts) p;
                                    if (rects != null) {
                                        Crop crop = fc.boundingBox();
                                        rects.add(new Rectangle((int) (crop.left() * width + 0.5f),
                                                (int) (crop.top() * height + 0.5f),
                                                (int) ((crop.right() - crop.left()) * width + 0.5f),
                                                (int) ((crop.bottom() - crop.top()) * height + 0.5f)));

                                    }
                                    for (Concept concept : fc.concepts())
                                        result.add(new Token(concept.name(), concept.value()));
                                }
                            }
                        if (rects != null)
                            prediction.setFaces(rects);
                    }
                }
                if (rects == null && checkFaces()) {
                    Model<?> faceModel = client.getDefaultModels().faceDetectionModel();
                    ClarifaiResponse<?> response3 = faceModel.predict().withInputs(input).executeSync();
                    if (response3.isSuccessful()) {
                        try (InputStream in = new ByteArrayInputStream(jpeg)) {
                            BufferedImage image = ImageIO.read(in);
                            int height = image.getHeight();
                            int width = image.getWidth();
                            rects = new ArrayList<>();
                            for (ClarifaiOutput<clarifai2.dto.prediction.Prediction> clarifaiOutput : (List<ClarifaiOutput<clarifai2.dto.prediction.Prediction>>) response3
                                    .get())
                                for (clarifai2.dto.prediction.Prediction p : clarifaiOutput.data()) {
                                    Crop crop = p.asFaceDetection().boundingBox();
                                    rects.add(new Rectangle((int) (crop.left() * width + 0.5f),
                                            (int) (crop.top() * height + 0.5f),
                                            (int) ((crop.right() - crop.left()) * width + 0.5f),
                                            (int) ((crop.bottom() - crop.top()) * height + 0.5f)));
                                }
                            prediction.setFaces(rects);
                        } catch (IOException e) {
                            // should never happen
                        }
                    }
                }
                return prediction;
            } else if (status.networkErrorOccurred())
                return new Prediction(getName(), null, null, getStatus(status));
        }
    }
    return null;
}

From source file:com.bdaum.zoom.ai.clarifai.internal.preference.PagePart.java

License:Open Source License

@Override
public void fillValues() {
    clientIdField.removeModifyListener(this);
    clientSecretField.removeModifyListener(this);
    IPreferenceStore preferenceStore = getPreferenceStore();
    clientIdField.setText(preferenceStore.getString(PreferenceConstants.CLIENTID));
    clientSecretField.setText(preferenceStore.getString(PreferenceConstants.CLIENTSECRET));
    conceptField.setSelection(preferenceStore.getInt(PreferenceConstants.MAXCONCEPTS));
    confidenceField.setSelection(preferenceStore.getInt(PreferenceConstants.MINCONFIDENCE));
    aboveField.setSelection(preferenceStore.getInt(PreferenceConstants.MARKABOVE));
    knownButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.MARKKNOWNONLY));
    adultButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.ADULTCONTENTS));
    faceButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.FACES));
    celebrityButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.CELEBRITIES));
    translateButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.TRANSLATE));
    ClarifaiActivator activator = ClarifaiActivator.getDefault();
    activator.setAccountCredentials(clientIdField.getText().trim(), clientSecretField.getText().trim());
    verifyAccountCredenials(100);/*from  www. j  ava2  s  . co m*/
    modelCombo.setSelection(new StructuredSelection(ClarifaiActivator.getDefault().getTheme()));
    currentLanguage = preferenceStore.getString(PreferenceConstants.LANGUAGE);
    languageCombo.setSelection(new StructuredSelection(currentLanguage));
    clientIdField.addModifyListener(this);
    clientSecretField.addModifyListener(this);
}

From source file:com.bdaum.zoom.ai.internal.preference.AiPreferencePage.java

License:Open Source License

@Override
protected void doFillValues() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    enableButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.ENABLE));
    keyField.setText(preferenceStore.getString(PreferenceConstants.TRANSLATORKEY));
}

From source file:com.bdaum.zoom.ai.msvision.internal.preference.PagePart.java

License:Open Source License

@Override
public void fillValues() {
    keyField.removeModifyListener(this);
    IPreferenceStore preferenceStore = getPreferenceStore();
    keyField.setText(preferenceStore.getString(PreferenceConstants.KEY));
    conceptField.setSelection(preferenceStore.getInt(PreferenceConstants.MAXCONCEPTS));
    confidenceField.setSelection(preferenceStore.getInt(PreferenceConstants.MINCONFIDENCE));
    aboveField.setSelection(preferenceStore.getInt(PreferenceConstants.MARKABOVE));
    knownButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.MARKKNOWNONLY));
    adultButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.ADULTCONTENTS));
    faceButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.FACES));
    celebrityButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.CELEBRITIES));
    descriptionButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.DESCRIPTION));
    translateDescriptionButton/*from w ww.  j  a  va  2  s.  com*/
            .setSelection(preferenceStore.getBoolean(PreferenceConstants.TRANSLATE_DESCRIPTION));
    translateCatButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.TRANSLATE_CATEGORIES));
    translateTagButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.TRANSLATE_TAGS));
    MsVisionActivator activator = MsVisionActivator.getDefault();
    activator.setAccountCredentials(keyField.getText().trim());
    verifyAccountCredenials(100);
    keyField.addModifyListener(this);
    updateButtons();
}

From source file:com.bdaum.zoom.gps.internal.GpsUtilities.java

License:Open Source License

public static void getGeoAreas(IPreferenceStore preferenceStore, Collection<GeoArea> areas) {
    NumberFormat nf = NumberFormat.getNumberInstance(Locale.US);
    nf.setMaximumFractionDigits(8);/*from   w  ww.  j av a 2 s  .  co  m*/
    nf.setGroupingUsed(false);
    String nogo = preferenceStore.getString(PreferenceConstants.NOGO);
    if (nogo != null) {
        int i = 0;
        double lat = 0, lon = 0, km = 0;
        String name = null;
        StringTokenizer st = new StringTokenizer(nogo, ";,", true); //$NON-NLS-1$
        while (st.hasMoreTokens()) {
            String s = st.nextToken();
            if (";".equals(s)) { //$NON-NLS-1$
                areas.add(new GeoArea(name, lat, lon, km));
                i = 0;
            } else if (",".equals(s)) //$NON-NLS-1$
                ++i;
            else
                try {
                    switch (i) {
                    case 0:
                        name = s;
                        break;
                    case 1:
                        lat = nf.parse(s).doubleValue();
                        break;
                    case 2:
                        lon = nf.parse(s).doubleValue();
                        break;
                    case 3:
                        km = nf.parse(s).doubleValue();
                        break;
                    }
                } catch (ParseException e) {
                    // do nothing
                }
        }
    }
}

From source file:com.bdaum.zoom.gps.internal.preferences.GpsPreferencePage.java

License:Open Source License

@Override
protected void doFillValues() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    altitudeButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.UPDATEALTITUDE));
    coordinateButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.INCLUDECOORDINATES));
    placenameButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.INCLUDENAMES));
    editButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.EDIT));
    tagButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.OVERWRITE));
    waypointButton.setSelection(preferenceStore.getBoolean(PreferenceConstants.USEWAYPOINTS));
    timeShiftMinuteField.setSelection(preferenceStore.getInt(PreferenceConstants.TIMESHIFT));
    toleranceHourField.setSelection(preferenceStore.getInt(PreferenceConstants.TOLERANCE) / 60);
    toleranceMinuteField.setSelection(preferenceStore.getInt(PreferenceConstants.TOLERANCE) % 60);
    GpsUtilities.getGeoAreas(preferenceStore, nogoAreas);
    nogoViewer.setInput(nogoAreas);/*from w w  w  .  j  av  a 2  s .  c om*/
    reqhField.setSelection(preferenceStore.getInt(PreferenceConstants.HOURLYLIMIT));
    String nservice = preferenceStore.getString(PreferenceConstants.NAMINGSERVICE);
    setNamingServiceCombo(nservice);
    for (IGeocodingService service : GpsActivator.getDefault().getNamingServices())
        for (Parameter parameter : service.getParameters()) {
            CheckedText field = keyMap.get(parameter.getId());
            field.setText(preferenceStore.getString(parameter.getId()));
            field.setHint(parameter.getHint());
        }
}

From source file:com.bdaum.zoom.rcp.internal.intro.VersionChangeDetector.java

License:Open Source License

private static boolean isVersionChange() {
    IPreferenceStore preferenceStore = RcpActivator.getDefault().getPreferenceStore();
    String v = preferenceStore.getString(PreferenceConstants.PREVIOUSVERSION);
    if (v == null || v.isEmpty()) {
        preferenceStore.putValue(PreferenceConstants.PREVIOUSVERSION,
                Platform.getProduct().getDefiningBundle().getVersion().toString());
        return true;
    }/*www.  j a va  2s  .c om*/
    Version oldVersion = new Version(v);
    Version version = Platform.getProduct().getDefiningBundle().getVersion();
    if (version.getMajor() > oldVersion.getMajor()
            || (version.getMajor() == oldVersion.getMajor() && version.getMinor() > oldVersion.getMinor())) {
        preferenceStore.putValue(PreferenceConstants.PREVIOUSVERSION, version.toString());
        return true;
    }
    return false;
}

From source file:com.bdaum.zoom.ui.internal.dialogs.ConfigureColumnsDialog.java

License:Open Source License

private void fillValues() {
    IPreferenceStore preferenceStore = UiActivator.getDefault().getPreferenceStore();
    StringTokenizer st = new StringTokenizer(preferenceStore.getString(PreferenceConstants.TABLECOLUMNS), "\n"); //$NON-NLS-1$
    while (st.hasMoreTokens())
        columnFields.add(QueryField.findQueryField(st.nextToken()));
    columnsViewer.setInput(columnFields);
}

From source file:com.bdaum.zoom.ui.internal.hover.AbstractHoverContribution.java

License:Open Source License

@Override
public String getTemplate() {
    IPreferenceStore preferenceStore = UiActivator.getDefault().getPreferenceStore();
    return preferenceStore.getString(id + ".text.template"); //$NON-NLS-1$
}