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

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

Introduction

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

Prototype

long getDefaultLong(String name);

Source Link

Document

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

Usage

From source file:org.eclipse.cdt.dsf.debug.internal.ui.disassembly.preferences.DisassemblyPreferencePage.java

License:Open Source License

@Override
protected void performDefaults() {
    IPreferenceStore store = getPreferenceStore();
    for (Iterator<Button> iter = fCheckBoxes.iterator(); iter.hasNext();) {
        Button btn = iter.next();
        btn.setSelection(store.getDefaultBoolean((String) btn.getData()));
    }//  w  w  w .j a v a 2 s.  c  o m
    for (Iterator<Text> iter = fNumberFields.iterator(); iter.hasNext();) {
        Text field = iter.next();
        long value = store.getDefaultLong((String) field.getData());
        field.setText("0x" + Long.toHexString(value)); //$NON-NLS-1$
    }
    for (Iterator<Combo> iter = fComboBoxes.iterator(); iter.hasNext();) {
        Combo combo = iter.next();
        int value = store.getDefaultInt((String) combo.getData());
        for (int i = 0; i < fcRadixValues.length; i++) {
            if (fcRadixValues[i] == value) {
                combo.select(i);
            }
        }
    }
    super.performDefaults();
}

From source file:org.eclipse.ptp.internal.ui.preferences.ViewerPreferencesPage.java

License:Open Source License

public void performDefaults() {
    IPreferenceStore store = getPreferenceStore();
    /*/*from  w ww .j  a va 2  s .  c om*/
    iconSpacingXField.setValue(store.getDefaultInt(IPTPUIConstants.VIEW_ICON_SPACING_X));
    iconSpacingYField.setValue(store.getDefaultInt(IPTPUIConstants.VIEW_ICON_SPACING_Y));
    iconWidthField.setValue(store.getDefaultInt(IPTPUIConstants.VIEW_ICON_WIDTH));
    iconHeightField.setValue(store.getDefaultInt(IPTPUIConstants.VIEW_ICON_HEIGHT));
    */
    toolTipField.setValue((int) store.getDefaultLong(IPTPUIConstants.VIEW_TOOLTIP_TIMEOUT));
    tooltipIsWrapButton.setSelection(store.getDefaultBoolean(IPTPUIConstants.VIEW_TOOLTIP_ISWRAP));
    tooltipShowAllTimeButton.setSelection(store.getDefaultBoolean(IPTPUIConstants.VIEW_TOOLTIP_SHOWALLTIME));
    super.performDefaults();
}

From source file:org.eclipse.ui.texteditor.ChainedPreferenceStore.java

License:Open Source License

public long getDefaultLong(String name) {
    IPreferenceStore visibleStore = getVisibleStore(name);
    if (visibleStore != null)
        return visibleStore.getDefaultLong(name);
    return LONG_DEFAULT_DEFAULT;
}

From source file:org.erlide.ui.util.OverlayPreferenceStore.java

License:Open Source License

/**
 * Loads the given key from the orgin into the target.
 * /*  w  w w.  ja va 2 s  . co  m*/
 * @param orgin
 *            the source preference store
 * @param key
 *            the overlay key
 * @param target
 *            the preference store to which the key is propagated
 * @param forceInitialization
 *            if <code>true</code> the value in the target gets initialized
 *            before loading
 */
private void loadProperty(final IPreferenceStore orgin, final OverlayKey key, final IPreferenceStore target,
        final boolean forceInitialization) {
    final TypeDescriptor d = key.fDescriptor;
    if (TypeDescriptor.BOOLEAN == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, true);
        }
        target.setValue(key.fKey, orgin.getBoolean(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));

    } else if (TypeDescriptor.DOUBLE == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1.0D);
        }
        target.setValue(key.fKey, orgin.getDouble(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));

    } else if (TypeDescriptor.FLOAT == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1.0F);
        }
        target.setValue(key.fKey, orgin.getFloat(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));

    } else if (TypeDescriptor.INT == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1);
        }
        target.setValue(key.fKey, orgin.getInt(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));

    } else if (TypeDescriptor.LONG == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1L);
        }
        target.setValue(key.fKey, orgin.getLong(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));

    } else if (TypeDescriptor.STRING == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, "1"); //$NON-NLS-1$
        }
        target.setValue(key.fKey, orgin.getString(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));

    }
}

From source file:_org.eclipse.dltk.ui.preferences.OverlayPreferenceStore.java

License:Open Source License

protected void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target,
        boolean forceInitialization) {
    TypeDescriptor d = key.fDescriptor;//from  ww  w.ja  v  a 2  s  .c  o  m
    if (BOOLEAN == d) {

        if (forceInitialization)
            target.setValue(key.fKey, true);
        target.setValue(key.fKey, orgin.getBoolean(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));

    } else if (DOUBLE == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1.0D);
        target.setValue(key.fKey, orgin.getDouble(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));

    } else if (FLOAT == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1.0F);
        target.setValue(key.fKey, orgin.getFloat(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));

    } else if (INT == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1);
        target.setValue(key.fKey, orgin.getInt(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));

    } else if (LONG == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1L);
        target.setValue(key.fKey, orgin.getLong(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));

    } else if (STRING == d) {

        if (forceInitialization)
            target.setValue(key.fKey, "1"); //$NON-NLS-1$
        target.setValue(key.fKey, orgin.getString(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));

    }
}