1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

2004-08-26 Alain Magloire

Be on the same length as the Java Editor and Ant Editor
	for the Preference page.  Misc warning removes, when
	raising the level of warnings from the compiler.

	* src/org/eclipse/cdt/internal/ui/preference/CEditorPreferencePage.java
	* src/org/eclipse/cdt/internal/ui/preference/PreferencesMessages.properties
This commit is contained in:
Alain Magloire 2004-08-27 01:47:13 +00:00
parent 7d8a22cfd5
commit 017a326017
20 changed files with 87 additions and 92 deletions

View file

@ -1,3 +1,11 @@
2004-08-26 Alain Magloire
Be on the same length as the Java Editor and Ant Editor
for the Preference page. Misc warning removes, when
raising the level of warnings from the compiler.
* src/org/eclipse/cdt/internal/ui/preference/CEditorPreferencePage.java
* src/org/eclipse/cdt/internal/ui/preference/PreferencesMessages.properties
2004-08-25 Chris Wiebe 2004-08-25 Chris Wiebe
better handling of enclosing type better handling of enclosing type

View file

@ -6,7 +6,6 @@ package org.eclipse.cdt.internal.ui;
*/ */
import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
import org.eclipse.search.ui.SearchUI; import org.eclipse.search.ui.SearchUI;
import org.eclipse.ui.IFolderLayout; import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IPageLayout;

View file

@ -60,7 +60,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS
private TogglePresentationAction fTogglePresentation; private TogglePresentationAction fTogglePresentation;
private String fContextMenuId; private String fContextMenuId;
private OpenIncludeAction fOpenIncludeAction; OpenIncludeAction fOpenIncludeAction;
private ToggleLinkingAction fToggleLinkingAction; private ToggleLinkingAction fToggleLinkingAction;
private IncludeGroupingAction fIncludeGroupingAction; private IncludeGroupingAction fIncludeGroupingAction;

View file

@ -97,15 +97,15 @@ public class CEditorActionContributor extends TextEditorActionContributor {
ResourceBundle bundle = CEditorMessages.getResourceBundle(); ResourceBundle bundle = CEditorMessages.getResourceBundle();
fShiftRight= new SelectionAction("ShiftRight.", ITextOperationTarget.SHIFT_RIGHT); //$NON-NLS-1$ fShiftRight= new SelectionAction("ShiftRight.", ITextOperationTarget.SHIFT_RIGHT); //$NON-NLS-1$
fShiftRight.setActionDefinitionId(ICEditorActionDefinitionIds.SHIFT_RIGHT); fShiftRight.setActionDefinitionId(ITextEditorActionDefinitionIds.SHIFT_RIGHT);
CPluginImages.setImageDescriptors(fShiftRight, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SHIFT_RIGHT); CPluginImages.setImageDescriptors(fShiftRight, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SHIFT_RIGHT);
fShiftLeft= new SelectionAction("ShiftLeft.", ITextOperationTarget.SHIFT_LEFT); //$NON-NLS-1$ fShiftLeft= new SelectionAction("ShiftLeft.", ITextOperationTarget.SHIFT_LEFT); //$NON-NLS-1$
fShiftLeft.setActionDefinitionId(ICEditorActionDefinitionIds.SHIFT_LEFT); fShiftLeft.setActionDefinitionId(ITextEditorActionDefinitionIds.SHIFT_LEFT);
CPluginImages.setImageDescriptors(fShiftLeft, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SHIFT_LEFT); CPluginImages.setImageDescriptors(fShiftLeft, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SHIFT_LEFT);
fContentAssist = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); //$NON-NLS-1$ fContentAssist = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); //$NON-NLS-1$
fContentAssist.setActionDefinitionId(ICEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
fAddInclude = new RetargetTextEditorAction(bundle, "AddIncludeOnSelection."); //$NON-NLS-1$ fAddInclude = new RetargetTextEditorAction(bundle, "AddIncludeOnSelection."); //$NON-NLS-1$
fAddInclude.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_INCLUDE); fAddInclude.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_INCLUDE);

View file

@ -170,7 +170,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener {
private IOpenable fOwner; private IOpenable fOwner;
private IFile fFile; private IFile fFile;
private ITextFileBuffer fTextFileBuffer; private ITextFileBuffer fTextFileBuffer;
private IDocument fDocument; IDocument fDocument;
private DocumentSetCommand fSetCmd= new DocumentSetCommand(); private DocumentSetCommand fSetCmd= new DocumentSetCommand();
private DocumentReplaceCommand fReplaceCmd= new DocumentReplaceCommand(); private DocumentReplaceCommand fReplaceCmd= new DocumentReplaceCommand();

View file

@ -60,13 +60,13 @@ public class CustomFiltersDialog extends SelectionDialog {
private String[] fPatterns; private String[] fPatterns;
private String[] fEnabledFilterIds; private String[] fEnabledFilterIds;
private FilterDescriptor[] fBuiltInFilters; FilterDescriptor[] fBuiltInFilters;
private CheckboxTableViewer fCheckBoxList; CheckboxTableViewer fCheckBoxList;
private Button fEnableUserDefinedPatterns; Button fEnableUserDefinedPatterns;
private Text fUserDefinedPatterns; Text fUserDefinedPatterns;
private Stack fFilterDescriptorChangeHistory; Stack fFilterDescriptorChangeHistory;
/** /**
@ -212,8 +212,9 @@ public class CustomFiltersDialog extends SelectionDialog {
Object element= event.getElement(); Object element= event.getElement();
if (element instanceof FilterDescriptor) { if (element instanceof FilterDescriptor) {
// renew if already touched // renew if already touched
if (fFilterDescriptorChangeHistory.contains(element)) if (fFilterDescriptorChangeHistory.contains(element)) {
fFilterDescriptorChangeHistory.remove(element); fFilterDescriptorChangeHistory.remove(element);
}
fFilterDescriptorChangeHistory.push(element); fFilterDescriptorChangeHistory.push(element);
} }
}}); }});
@ -238,9 +239,10 @@ public class CustomFiltersDialog extends SelectionDialog {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
fCheckBoxList.setAllChecked(true); fCheckBoxList.setAllChecked(true);
fFilterDescriptorChangeHistory.clear(); fFilterDescriptorChangeHistory.clear();
for (int i= 0; i < fBuiltInFilters.length; i++) for (int i= 0; i < fBuiltInFilters.length; i++) {
fFilterDescriptorChangeHistory.push(fBuiltInFilters[i]); fFilterDescriptorChangeHistory.push(fBuiltInFilters[i]);
} }
}
}; };
selectButton.addSelectionListener(listener); selectButton.addSelectionListener(listener);

View file

@ -61,7 +61,7 @@ public class FilterDescriptor implements Comparable {
private static FilterDescriptor[] fgFilterDescriptors; private static FilterDescriptor[] fgFilterDescriptors;
private IConfigurationElement fElement; IConfigurationElement fElement;
/** /**
* Returns all contributed Java element filters. * Returns all contributed Java element filters.
@ -92,7 +92,7 @@ public class FilterDescriptor implements Comparable {
/** /**
* Creates a new filter descriptor for the given configuration element. * Creates a new filter descriptor for the given configuration element.
*/ */
private FilterDescriptor(IConfigurationElement element) { FilterDescriptor(IConfigurationElement element) {
fElement= element; fElement= element;
// it is either a pattern filter or a custom filter // it is either a pattern filter or a custom filter
Assert.isTrue(isPatternFilter() ^ isCustomFilter(), "An extension for extension-point org.eclipse.cdt.ui.CElementFilters does not specify a correct filter"); //$NON-NLS-1$ Assert.isTrue(isPatternFilter() ^ isCustomFilter(), "An extension for extension-point org.eclipse.cdt.ui.CElementFilters does not specify a correct filter"); //$NON-NLS-1$

View file

@ -124,7 +124,7 @@ public class AppearancePreferencePage extends PreferencePage implements IWorkben
return result; return result;
} }
private void doDialogFieldChanged(DialogField field) { void doDialogFieldChanged(DialogField field) {
updateStatus(getValidationStatus()); updateStatus(getValidationStatus());
} }

View file

@ -65,7 +65,7 @@ import org.eclipse.ui.help.WorkbenchHelp;
* CEditorHoverConfigurationBlock * CEditorHoverConfigurationBlock
*/ */
public class CEditorHoverConfigurationBlock { public class CEditorHoverConfigurationBlock {
private static final String DELIMITER= PreferencesMessages.getString("CEditorHoverConfigurationBlock.delimiter"); //$NON-NLS-1$ static final String DELIMITER= PreferencesMessages.getString("CEditorHoverConfigurationBlock.delimiter"); //$NON-NLS-1$
private static final int ENABLED_PROP= 0; private static final int ENABLED_PROP= 0;
private static final int MODIFIER_PROP= 1; private static final int MODIFIER_PROP= 1;
@ -73,9 +73,9 @@ public class CEditorHoverConfigurationBlock {
// Data structure to hold the values which are edited by the user // Data structure to hold the values which are edited by the user
private static class HoverConfig { private static class HoverConfig {
private String fModifierString; String fModifierString;
private boolean fIsEnabled; boolean fIsEnabled;
private int fStateMask; int fStateMask;
private HoverConfig(String modifier, int stateMask, boolean enabled) { private HoverConfig(String modifier, int stateMask, boolean enabled) {
fModifierString= modifier; fModifierString= modifier;
@ -142,11 +142,11 @@ public class CEditorHoverConfigurationBlock {
} }
private OverlayPreferenceStore fStore; OverlayPreferenceStore fStore;
private HoverConfig[] fHoverConfigs; HoverConfig[] fHoverConfigs;
private Text fModifierEditor; Text fModifierEditor;
private Table fHoverTable; Table fHoverTable;
private TableViewer fHoverTableViewer; TableViewer fHoverTableViewer;
private TableColumn fNameColumn; private TableColumn fNameColumn;
private TableColumn fModifierColumn; private TableColumn fModifierColumn;
private Text fDescription; private Text fDescription;
@ -157,7 +157,7 @@ public class CEditorHoverConfigurationBlock {
private StatusInfo fStatus; private StatusInfo fStatus;
private Map fCheckBoxes= new HashMap(); Map fCheckBoxes= new HashMap();
private SelectionListener fCheckBoxListener= new SelectionListener() { private SelectionListener fCheckBoxListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) { public void widgetDefaultSelected(SelectionEvent e) {
Button button= (Button) e.widget; Button button= (Button) e.widget;
@ -370,7 +370,7 @@ public class CEditorHoverConfigurationBlock {
layouter.addColumnData(new ColumnWeightData(60, true)); layouter.addColumnData(new ColumnWeightData(60, true));
} }
private CEditorTextHoverDescriptor[] getContributedHovers() { CEditorTextHoverDescriptor[] getContributedHovers() {
CEditorTextHoverDescriptor[] hoverDescriptors= CUIPlugin.getDefault().getCEditorTextHoverDescriptors(); CEditorTextHoverDescriptor[] hoverDescriptors= CUIPlugin.getDefault().getCEditorTextHoverDescriptors();
// Move Best Match hover to front // Move Best Match hover to front
@ -509,7 +509,7 @@ public class CEditorHoverConfigurationBlock {
} }
} }
private void handleModifierModified() { void handleModifierModified() {
int i= fHoverTable.getSelectionIndex(); int i= fHoverTable.getSelectionIndex();
String modifiers= fModifierEditor.getText(); String modifiers= fModifierEditor.getText();
fHoverConfigs[i].fModifierString= modifiers; fHoverConfigs[i].fModifierString= modifiers;
@ -525,7 +525,7 @@ public class CEditorHoverConfigurationBlock {
updateStatus(); updateStatus();
} }
private void handleHoverListSelection() { void handleHoverListSelection() {
int i= fHoverTable.getSelectionIndex(); int i= fHoverTable.getSelectionIndex();
if (i < 0) { if (i < 0) {
@ -549,7 +549,7 @@ public class CEditorHoverConfigurationBlock {
return fStatus; return fStatus;
} }
private void updateStatus() { void updateStatus() {
int i= 0; int i= 0;
HashMap stateMasks= new HashMap(fHoverConfigs.length); HashMap stateMasks= new HashMap(fHoverConfigs.length);
while (fStatus.isOK() && i < fHoverConfigs.length) { while (fStatus.isOK() && i < fHoverConfigs.length) {

View file

@ -60,6 +60,7 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.ui.texteditor.AbstractTextEditor;
/* /*
* The page for setting the editor options. * The page for setting the editor options.
@ -133,7 +134,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
protected List fAppearanceColorList; protected List fAppearanceColorList;
protected ColorEditor fAppearanceColorEditor; protected ColorEditor fAppearanceColorEditor;
private Button fAppearanceColorDefault; Button fAppearanceColorDefault;
private CEditorHoverConfigurationBlock fCEditorHoverConfigurationBlock; private CEditorHoverConfigurationBlock fCEditorHoverConfigurationBlock;
private FoldingConfigurationBlock fFoldingConfigurationBlock; private FoldingConfigurationBlock fFoldingConfigurationBlock;
@ -146,10 +147,10 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
ArrayList overlayKeys = new ArrayList(); ArrayList overlayKeys = new ArrayList();
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_FOREGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_BACKGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR));
@ -224,9 +225,9 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 80); store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 80);
PreferenceConverter.setDefault(store, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, new RGB(176, 180, 185)); PreferenceConverter.setDefault(store, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, new RGB(176, 180, 185));
store.setDefault(CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true); store.setDefault(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true);
store.setDefault(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true); store.setDefault(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true);
store.setDefault(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 4); store.setDefault(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 4);
@ -285,16 +286,16 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
* *
*/ */
private void initializeDefaultColors() { private void initializeDefaultColors() {
if (!getPreferenceStore().contains(CEditor.PREFERENCE_COLOR_FOREGROUND)) { if (!getPreferenceStore().contains(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND)) {
RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(); RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB();
PreferenceConverter.setDefault(fOverlayStore, CEditor.PREFERENCE_COLOR_FOREGROUND, rgb); PreferenceConverter.setDefault(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, rgb);
PreferenceConverter.setDefault(getPreferenceStore(), CEditor.PREFERENCE_COLOR_FOREGROUND, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, rgb);
} }
if (!getPreferenceStore().contains(CEditor.PREFERENCE_COLOR_BACKGROUND)) { if (!getPreferenceStore().contains(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)) {
RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB(); RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
PreferenceConverter.setDefault(fOverlayStore, CEditor.PREFERENCE_COLOR_BACKGROUND, rgb); PreferenceConverter.setDefault(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb);
PreferenceConverter.setDefault(getPreferenceStore(), CEditor.PREFERENCE_COLOR_BACKGROUND, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb);
} }
if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR)) { if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR)) {
@ -332,29 +333,22 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
fBoldCheckBox.setSelection(fOverlayStore.getBoolean(key + "_bold")); //$NON-NLS-1$ fBoldCheckBox.setSelection(fOverlayStore.getBoolean(key + "_bold")); //$NON-NLS-1$
} }
private Control createColorPage(Composite parent) { private Control createSyntaxPage(Composite parent) {
Composite colorComposite = new Composite(parent, SWT.NULL); Composite colorComposite = new Composite(parent, SWT.NULL);
colorComposite.setLayout(new GridLayout()); colorComposite.setLayout(new GridLayout());
Composite backgroundComposite = new Composite(colorComposite, SWT.NULL); Group backgroundComposite= new Group(colorComposite, SWT.SHADOW_ETCHED_IN);
GridLayout layout = new GridLayout(); GridLayout layout = new GridLayout();
layout.marginHeight = 0; layout.numColumns = 3;
layout.marginWidth = 0;
layout.numColumns = 2;
backgroundComposite.setLayout(layout); backgroundComposite.setLayout(layout);
backgroundComposite.setText(PreferencesMessages.getString("CEditorPreferencePage.colorPage.backgroundColor"));//$NON-NLS-1$
Label label = new Label(backgroundComposite, SWT.NULL);
label.setText(PreferencesMessages.getString("CEditorPreferencePage.colorPage.backgroundColor")); //$NON-NLS-1$
GridData gd = new GridData();
gd.horizontalSpan = 2;
label.setLayoutData(gd);
SelectionListener backgroundSelectionListener = new SelectionListener() { SelectionListener backgroundSelectionListener = new SelectionListener() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
boolean custom = fBackgroundCustomRadioButton.getSelection(); boolean custom = fBackgroundCustomRadioButton.getSelection();
fBackgroundColorButton.setEnabled(custom); fBackgroundColorButton.setEnabled(custom);
fOverlayStore.setValue(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, !custom); fOverlayStore.setValue(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, !custom);
} }
public void widgetDefaultSelected(SelectionEvent e) { public void widgetDefaultSelected(SelectionEvent e) {
} }
@ -362,9 +356,6 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
fBackgroundDefaultRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT); fBackgroundDefaultRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
fBackgroundDefaultRadioButton.setText(PreferencesMessages.getString("CEditorPreferencePage.colorPage.systemDefault")); //$NON-NLS-1$ fBackgroundDefaultRadioButton.setText(PreferencesMessages.getString("CEditorPreferencePage.colorPage.systemDefault")); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 2;
fBackgroundDefaultRadioButton.setLayoutData(gd);
fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener); fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener);
fBackgroundCustomRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT); fBackgroundCustomRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
@ -373,11 +364,8 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
fBackgroundColorEditor = new ColorEditor(backgroundComposite); fBackgroundColorEditor = new ColorEditor(backgroundComposite);
fBackgroundColorButton = fBackgroundColorEditor.getButton(); fBackgroundColorButton = fBackgroundColorEditor.getButton();
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalAlignment = GridData.BEGINNING;
fBackgroundColorButton.setLayoutData(gd);
label = new Label(colorComposite, SWT.LEFT); Label label = new Label(colorComposite, SWT.LEFT);
label.setText(PreferencesMessages.getString("CEditorPreferencePage.colorPage.foreground")); //$NON-NLS-1$ label.setText(PreferencesMessages.getString("CEditorPreferencePage.colorPage.foreground")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@ -387,7 +375,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
layout.marginHeight = 0; layout.marginHeight = 0;
layout.marginWidth = 0; layout.marginWidth = 0;
editorComposite.setLayout(layout); editorComposite.setLayout(layout);
gd = new GridData(GridData.FILL_BOTH); GridData gd = new GridData(GridData.FILL_BOTH);
editorComposite.setLayoutData(gd); editorComposite.setLayoutData(gd);
fList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL); fList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL);
@ -460,7 +448,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
PreferenceConverter.setValue( PreferenceConverter.setValue(
fOverlayStore, fOverlayStore,
CEditor.PREFERENCE_COLOR_BACKGROUND, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND,
fBackgroundColorEditor.getColorValue()); fBackgroundColorEditor.getColorValue());
} }
}); });
@ -502,8 +490,8 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
fOverlayStore.addPropertyChangeListener(new IPropertyChangeListener() { fOverlayStore.addPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) { public void propertyChange(PropertyChangeEvent event) {
String p = event.getProperty(); String p = event.getProperty();
if (p.equals(CEditor.PREFERENCE_COLOR_BACKGROUND) if (p.equals(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)
|| p.equals(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) { || p.equals(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) {
initializeViewerColors(fPreviewViewer); initializeViewerColors(fPreviewViewer);
} }
@ -531,9 +519,9 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
// ---------- background color ---------------------- // ---------- background color ----------------------
Color color = Color color =
store.getBoolean(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)
? null ? null
: createColor(store, CEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); : createColor(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay());
styledText.setBackground(color); styledText.setBackground(color);
if (fBackgroundColor != null) if (fBackgroundColor != null)
@ -604,7 +592,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
} }
} }
private Control createBehaviorPage(Composite parent) { private Control createAppearancePage(Composite parent) {
Composite behaviorComposite = new Composite(parent, SWT.NONE); Composite behaviorComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(); GridLayout layout = new GridLayout();
@ -839,11 +827,11 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
TabItem item = new TabItem(folder, SWT.NONE); TabItem item = new TabItem(folder, SWT.NONE);
item.setText(PreferencesMessages.getString("CEditorPreferencePage.generalTabTitle")); //$NON-NLS-1$ item.setText(PreferencesMessages.getString("CEditorPreferencePage.generalTabTitle")); //$NON-NLS-1$
item.setControl(createBehaviorPage(folder)); item.setControl(createAppearancePage(folder));
item = new TabItem(folder, SWT.NONE); item = new TabItem(folder, SWT.NONE);
item.setText(PreferencesMessages.getString("CEditorPreferencePage.colorsTabTitle")); //$NON-NLS-1$ item.setText(PreferencesMessages.getString("CEditorPreferencePage.colorsTabTitle")); //$NON-NLS-1$
item.setControl(createColorPage(folder)); item.setControl(createSyntaxPage(folder));
item = new TabItem(folder, SWT.NONE); item = new TabItem(folder, SWT.NONE);
item.setText(PreferencesMessages.getString("CEditorPreferencePage.contentAssistTabTitle")); //$NON-NLS-1$ item.setText(PreferencesMessages.getString("CEditorPreferencePage.contentAssistTabTitle")); //$NON-NLS-1$
@ -938,10 +926,10 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
t.setText(fOverlayStore.getString(key)); t.setText(fOverlayStore.getString(key));
} }
RGB rgb = PreferenceConverter.getColor(fOverlayStore, CEditor.PREFERENCE_COLOR_BACKGROUND); RGB rgb = PreferenceConverter.getColor(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
fBackgroundColorEditor.setColorValue(rgb); fBackgroundColorEditor.setColorValue(rgb);
boolean default_ = fOverlayStore.getBoolean(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT); boolean default_ = fOverlayStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT);
fBackgroundDefaultRadioButton.setSelection(default_); fBackgroundDefaultRadioButton.setSelection(default_);
fBackgroundCustomRadioButton.setSelection(!default_); fBackgroundCustomRadioButton.setSelection(!default_);
fBackgroundColorButton.setEnabled(!default_); fBackgroundColorButton.setEnabled(!default_);

View file

@ -128,11 +128,11 @@ public class CFileTypeDialog extends Dialog {
return CCorePlugin.getDefault().getResolverModel(); return CCorePlugin.getDefault().getResolverModel();
} }
private Button getOkayButton() { Button getOkayButton() {
return getButton(IDialogConstants.OK_ID); return getButton(IDialogConstants.OK_ID);
} }
private String getPatternFromControl() { String getPatternFromControl() {
return fTextPattern.getText().trim(); return fTextPattern.getText().trim();
} }

View file

@ -10,12 +10,8 @@
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.internal.ui.preferences; package org.eclipse.cdt.internal.ui.preferences;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.filetype.ICFileTypeAssociation;
import org.eclipse.cdt.core.filetype.ICFileTypeResolver; import org.eclipse.cdt.core.filetype.ICFileTypeResolver;
import org.eclipse.cdt.core.filetype.IResolverModel; import org.eclipse.cdt.core.filetype.IResolverModel;
import org.eclipse.cdt.internal.ui.ICHelpContextIds; import org.eclipse.cdt.internal.ui.ICHelpContextIds;

View file

@ -41,7 +41,7 @@ public class CSearchPreferencePage extends PreferencePage
implements implements
IWorkbenchPreferencePage { IWorkbenchPreferencePage {
private Combo fExternLinks; Combo fExternLinks;
private Button fExternEnabled; private Button fExternEnabled;
protected OverlayPreferenceStore fOverlayStore; protected OverlayPreferenceStore fOverlayStore;

View file

@ -340,7 +340,7 @@ public class EditTemplateDialog extends StatusDialog {
control.getAccessible().addAccessibleListener(new AccessibleAdapter() { control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
public void getName(AccessibleEvent e) { public void getName(AccessibleEvent e) {
e.result = TemplateMessages.getString("EditTemplateDialog.pattern"); e.result = TemplateMessages.getString("EditTemplateDialog.pattern"); //$NON-NLS-1$
}}); }});
viewer.addTextListener(new ITextListener() { viewer.addTextListener(new ITextListener() {

View file

@ -61,9 +61,9 @@ TodoTaskInputDialog.error.noSpace=Name can not start or end with a whitespace.
CEditorPreferencePage.cCommentTaskTags=Task Tags CEditorPreferencePage.cCommentTaskTags=Task Tags
CEditorPreferencePage.generalTabTitle=&General CEditorPreferencePage.generalTabTitle=Appeara&nce
CEditorPreferencePage.annotationTabTitle= &Annotations CEditorPreferencePage.annotationTabTitle= &Annotations
CEditorPreferencePage.colorsTabTitle=&Colors CEditorPreferencePage.colorsTabTitle=Synta&x
CEditorPreferencePage.contentAssistTabTitle=Content A&ssist CEditorPreferencePage.contentAssistTabTitle=Content A&ssist
CEditorPreferencePage.invalid_input=Invalid input. CEditorPreferencePage.invalid_input=Invalid input.

View file

@ -319,7 +319,7 @@ public class TemplatePreferencePage extends PreferencePage implements IWorkbench
control.getAccessible().addAccessibleListener(new AccessibleAdapter() { control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
public void getName(AccessibleEvent e) { public void getName(AccessibleEvent e) {
e.result = TemplateMessages.getString("TemplatePreferencePage.preview"); e.result = TemplateMessages.getString("TemplatePreferencePage.preview"); //$NON-NLS-1$
}}); }});
return viewer; return viewer;

View file

@ -25,6 +25,7 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCorePreferenceConstants; import org.eclipse.cdt.core.CCorePreferenceConstants;
@ -288,14 +289,14 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
fWorkingValues.put(PREF_TRANSLATION_TASK_PRIORITIES, prios.toString()); fWorkingValues.put(PREF_TRANSLATION_TASK_PRIORITIES, prios.toString());
} }
private void doTodoButtonPressed(int index) { void doTodoButtonPressed(int index) {
TodoTask edited= null; TodoTask edited= null;
if (index != 0) { if (index != 0) {
edited= (TodoTask) fTodoTasksList.getSelectedElements().get(0); edited= (TodoTask) fTodoTasksList.getSelectedElements().get(0);
} }
TodoTaskInputDialog dialog= new TodoTaskInputDialog(getShell(), edited, fTodoTasksList.getElements()); TodoTaskInputDialog dialog= new TodoTaskInputDialog(getShell(), edited, fTodoTasksList.getElements());
if (dialog.open() == TodoTaskInputDialog.OK) { if (dialog.open() == Window.OK) {
if (edited != null) { if (edited != null) {
fTodoTasksList.replaceElement(edited, dialog.getResult()); fTodoTasksList.replaceElement(edited, dialog.getResult());
} else { } else {

View file

@ -135,7 +135,7 @@ public class TodoTaskInputDialog extends StatusDialog {
return composite; return composite;
} }
private void doValidation() { void doValidation() {
StatusInfo status= new StatusInfo(); StatusInfo status= new StatusInfo();
String newText= fNameDialogField.getText(); String newText= fNameDialogField.getText();
if (newText.length() == 0) { if (newText.length() == 0) {

View file

@ -26,6 +26,7 @@ import org.eclipse.jface.preference.IPreferencePage;
import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager; import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.preference.PreferenceNode; import org.eclipse.jface.preference.PreferenceNode;
import org.eclipse.jface.window.Window;
import org.eclipse.ui.dialogs.PropertyPage; import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.help.WorkbenchHelp;
@ -53,7 +54,7 @@ public class TodoTaskPropertyPage extends PropertyPage {
private SelectionButtonDialogField fUseWorkspaceSettings; private SelectionButtonDialogField fUseWorkspaceSettings;
private SelectionButtonDialogField fChangeWorkspaceSettings; private SelectionButtonDialogField fChangeWorkspaceSettings;
private SelectionButtonDialogField fUseProjectSettings; private SelectionButtonDialogField fUseProjectSettings;
private IStatus fBlockStatus; IStatus fBlockStatus;
public TodoTaskPropertyPage() { public TodoTaskPropertyPage() {
@ -139,7 +140,7 @@ public class TodoTaskPropertyPage extends PropertyPage {
return fUseProjectSettings.isSelected(); return fUseProjectSettings.isSelected();
} }
private void doDialogFieldChanged(DialogField field) { void doDialogFieldChanged(DialogField field) {
if (field == fChangeWorkspaceSettings) { if (field == fChangeWorkspaceSettings) {
TodoTaskPreferencePage page= new TodoTaskPreferencePage(); TodoTaskPreferencePage page= new TodoTaskPreferencePage();
showPreferencePage(TodoTaskPreferencePage.ID, page); showPreferencePage(TodoTaskPreferencePage.ID, page);
@ -151,7 +152,7 @@ public class TodoTaskPropertyPage extends PropertyPage {
/** /**
* Method statusChanged. * Method statusChanged.
*/ */
private void doStatusChanged() { void doStatusChanged() {
updateStatus(useProjectSettings() ? fBlockStatus : new StatusInfo()); updateStatus(useProjectSettings() ? fBlockStatus : new StatusInfo());
} }
@ -210,7 +211,7 @@ public class TodoTaskPropertyPage extends PropertyPage {
public void run() { public void run() {
dialog.create(); dialog.create();
dialog.setMessage(targetNode.getLabelText()); dialog.setMessage(targetNode.getLabelText());
result[0]= (dialog.open() == PreferenceDialog.OK); result[0]= (dialog.open() == Window.OK);
} }
}); });
return result[0]; return result[0];

View file

@ -49,7 +49,7 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
/** Border thickness in pixels. */ /** Border thickness in pixels. */
private static final int BORDER= 1; private static final int BORDER= 1;
/** The control's shell */ /** The control's shell */
private Shell fShell; Shell fShell;
/** The control's text widget */ /** The control's text widget */
private StyledText fText; private StyledText fText;
/** The control's source viewer */ /** The control's source viewer */