| Summary: | [Preferences] FieldEditorPreferencePage doesn't honor FLAT style anymore (1GEHN17) | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dirk Baeumer <dirk_baeumer> |
| Component: | UI | Assignee: | Tod Creasey <Tod_Creasey> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Tod_Creasey |
| Version: | 2.0 | Keywords: | investigate |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
|
Description
Dirk Baeumer
PRODUCT VERSION: 113 This is an ugly bug that prevents people from using field editors in custom layouts. But not critical for 2.0. Can be postponed. Defering based on feedback from reporter. Reopen for investigation, may be obsolete The spec for the FLAT style bit is /** * style constant for flat appearance. (value is 1<<23) * <br>Note that this is a <em>HINT</em>. * <p><b>Used By:</b><ul> * <li><code>Button</code></li> * <li><code>ToolBar</code></li> * </ul></p> */ public static final int FLAT = 1 << 23; If it is used by buttons and tool bars it is not relevant to the text fields used in a IntegerFieldEditor The flat mode of a field editor preference page has nothing to do with the flat mode of SWT controls. In flat mode the preference page used to put a composite around the components of the field editor and but them into a parent composite with a grid layout with one column resulting in a layout like: label: [input field] loooooooooooooong label: [input field] Currently you get label: [input field] loooooooooooooong label: [input filed] which corresponds to GRID style. May be the name FLAT is bogus. Dirk can you point me at the code that specifies this and tell me how you would set it? FieldEditorPreferencePage page= new FieldEditorPreferencePage (FieldEditorPreferencePage.FLAT). As far as I can remember Randy did some changes to that code so may be it is the best to talk to him. May be JFace should remove the FLAT style bit. But it is API. This works in 20020910 - below is the source for my test field editor page:
package org.eclipse.ui.tests.tctestplugin;
import org.eclipse.jface.preference.*;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* Insert the type's description here.
* @see PreferencePage
*/
public class FlatFieldEditorTestPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
/**
* The constructor.
*/
public FlatFieldEditorTestPage() {
super(FLAT);
}
/**
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench)
*/
public void init(IWorkbench workbench) {
}
/**
* @see
org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
protected void createFieldEditors() {
FieldEditor text1 = new StringFieldEditor("Text 1","Short
Text",getFieldEditorParent());
addField(text1);
FieldEditor text2 = new StringFieldEditor("Text 2","Ver
looooooooooooooooooooooooooooooooong Text",getFieldEditorParent());
addField(text2);
}
}
Marking closed |