Bug 72727 [JFace] ColorFieldEditor doesn't call setPresentsDefaultValue(), unexpected results after Restore Defaults is pressed
Version: 3.0.1 Build id: 200408050912 In Preference page using ColorFieldEditor where default color is blue, 1) Change color to red 2) Press "Restore Defaults," color changes back to blue, boolean value isDefaultPresented is set to true in FieldEditor.loadDefault() 3) Change color to red. UI displays red, but preference is still set to default blue, since in FieldEditor.store() if (isDefaultPresented) { preferenceStore.setToDefault(preferenceName); } else { doStore(); } Other field editors have a selectionListener that setPresenetsDefaultValue (true). Can you do the same thing in ColorFieldEditor's PropertyChangeListener? eclipse.buildId=I200406192000
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ColorFieldEditor.java
gc.dispose();
        Point p = new Point(height * 3 - 6, height);
        return p;
    }
    /* (non-Javadoc)
     * Method declared on FieldEditor.
     */
    protected void doFillIntoGrid(Composite parent, int numColumns) {
        Control control = getLabelControl(parent);
        GridData gd = new GridData();
        gd.horizontalSpan = numColumns - 1;
        control.setLayoutData(gd);
        Button colorButton = getChangeControl(parent);
        gd = new GridData();
        gd.heightHint = convertVerticalDLUsToPixels(colorButton,
                IDialogConstants.BUTTON_HEIGHT);
        int widthHint = convertHorizontalDLUsToPixels(colorButton,
                IDialogConstants.BUTTON_WIDTH);
        gd.widthHint = Math.max(widthHint, colorButton.computeSize(SWT.DEFAULT,
                SWT.DEFAULT, true).x);
        colorButton.setLayoutData(gd);
    }
    /* (non-Javadoc)
     * Method declared on FieldEditor.
     */
    protected void doLoad() {
        if (colorSelector == null)
            return;
        colorSelector.setColorValue(PreferenceConverter.getColor(
                getPreferenceStore(), getPreferenceName()));