mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
@Override annotations.
This commit is contained in:
parent
911ecee8eb
commit
b1013baa60
12 changed files with 87 additions and 78 deletions
|
@ -440,7 +440,7 @@ public class NameStyleBlock extends OptionsConfigurationBlock {
|
||||||
private Key prefixKey;
|
private Key prefixKey;
|
||||||
private Key alternativePrefixKey;
|
private Key alternativePrefixKey;
|
||||||
private Key suffixKey;
|
private Key suffixKey;
|
||||||
private String seedName;
|
private final String seedName;
|
||||||
private Category seedNameGenerator;
|
private Category seedNameGenerator;
|
||||||
private NameValidator nameValidator;
|
private NameValidator nameValidator;
|
||||||
|
|
||||||
|
@ -630,31 +630,39 @@ public class NameStyleBlock extends OptionsConfigurationBlock {
|
||||||
private class NameStyleAdapter extends ViewerComparator
|
private class NameStyleAdapter extends ViewerComparator
|
||||||
implements ITreeListAdapter<Category>, IDialogFieldListener {
|
implements ITreeListAdapter<Category>, IDialogFieldListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void selectionChanged(TreeListDialogField<Category> field) {
|
public void selectionChanged(TreeListDialogField<Category> field) {
|
||||||
updateConfigurationBlock(field.getSelectedElements());
|
updateConfigurationBlock(field.getSelectedElements());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void customButtonPressed(TreeListDialogField<Category> field, int index) {
|
public void customButtonPressed(TreeListDialogField<Category> field, int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doubleClicked(TreeListDialogField<Category> field) {
|
public void doubleClicked(TreeListDialogField<Category> field) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Category[] getChildren(TreeListDialogField<Category> field, Object element) {
|
public Category[] getChildren(TreeListDialogField<Category> field, Object element) {
|
||||||
return ((Category) element).getChildren();
|
return ((Category) element).getChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Category getParent(TreeListDialogField<Category> field, Object element) {
|
public Category getParent(TreeListDialogField<Category> field, Object element) {
|
||||||
return ((Category) element).parent;
|
return ((Category) element).parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasChildren(TreeListDialogField<Category> field, Object element) {
|
public boolean hasChildren(TreeListDialogField<Category> field, Object element) {
|
||||||
return ((Category) element).hasChildren();
|
return ((Category) element).hasChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void dialogFieldChanged(DialogField field) {
|
public void dialogFieldChanged(DialogField field) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void keyPressed(TreeListDialogField<Category> field, KeyEvent event) {
|
public void keyPressed(TreeListDialogField<Category> field, KeyEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin, Google
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.resources.ProjectScope;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.preferences.DefaultScope;
|
import org.eclipse.core.runtime.preferences.DefaultScope;
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||||
import org.eclipse.core.runtime.preferences.IScopeContext;
|
import org.eclipse.core.runtime.preferences.IScopeContext;
|
||||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IProject;
|
|
||||||
import org.eclipse.core.resources.ProjectScope;
|
|
||||||
|
|
||||||
import org.eclipse.ui.preferences.IWorkingCopyManager;
|
import org.eclipse.ui.preferences.IWorkingCopyManager;
|
||||||
|
|
||||||
import org.osgi.service.prefs.BackingStoreException;
|
import org.osgi.service.prefs.BackingStoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,9 +53,7 @@ public class PreferencesAccess {
|
||||||
public void applyChanges() throws BackingStoreException {
|
public void applyChanges() throws BackingStoreException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class WorkingCopyPreferencesAccess extends PreferencesAccess {
|
private static class WorkingCopyPreferencesAccess extends PreferencesAccess {
|
||||||
|
|
||||||
private final IWorkingCopyManager fWorkingCopyManager;
|
private final IWorkingCopyManager fWorkingCopyManager;
|
||||||
|
|
||||||
private WorkingCopyPreferencesAccess(IWorkingCopyManager workingCopyManager) {
|
private WorkingCopyPreferencesAccess(IWorkingCopyManager workingCopyManager) {
|
||||||
|
@ -85,9 +79,6 @@ public class PreferencesAccess {
|
||||||
return getWorkingCopyScopeContext(super.getProjectScope(project));
|
return getWorkingCopyScopeContext(super.getProjectScope(project));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.ui.preferences.PreferencesAccess#applyChanges()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void applyChanges() throws BackingStoreException {
|
public void applyChanges() throws BackingStoreException {
|
||||||
fWorkingCopyManager.applyChanges();
|
fWorkingCopyManager.applyChanges();
|
||||||
|
@ -95,7 +86,6 @@ public class PreferencesAccess {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class WorkingCopyScopeContext implements IScopeContext {
|
private static class WorkingCopyScopeContext implements IScopeContext {
|
||||||
|
|
||||||
private final IWorkingCopyManager fWorkingCopyManager;
|
private final IWorkingCopyManager fWorkingCopyManager;
|
||||||
private final IScopeContext fOriginal;
|
private final IScopeContext fOriginal;
|
||||||
|
|
||||||
|
@ -104,23 +94,17 @@ public class PreferencesAccess {
|
||||||
fOriginal= original;
|
fOriginal= original;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.core.runtime.preferences.IScopeContext#getName()
|
|
||||||
*/
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return fOriginal.getName();
|
return fOriginal.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.core.runtime.preferences.IScopeContext#getNode(java.lang.String)
|
|
||||||
*/
|
|
||||||
public IEclipsePreferences getNode(String qualifier) {
|
public IEclipsePreferences getNode(String qualifier) {
|
||||||
return fWorkingCopyManager.getWorkingCopy(fOriginal.getNode(qualifier));
|
return fWorkingCopyManager.getWorkingCopy(fOriginal.getNode(qualifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.core.runtime.preferences.IScopeContext#getLocation()
|
|
||||||
*/
|
|
||||||
public IPath getLocation() {
|
public IPath getLocation() {
|
||||||
return fOriginal.getLocation();
|
return fOriginal.getLocation();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Qnx Software Systems - initial API and implementation
|
* Qnx Software Systems - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
@ -30,7 +29,6 @@ import org.eclipse.ui.texteditor.AbstractTextEditor;
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
class PreviewSourceViewer extends SourceViewer implements IPropertyChangeListener {
|
class PreviewSourceViewer extends SourceViewer implements IPropertyChangeListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This viewer's foreground color.
|
* This viewer's foreground color.
|
||||||
*
|
*
|
||||||
|
@ -251,6 +249,7 @@ class PreviewSourceViewer extends SourceViewer implements IPropertyChangeListene
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent event) {
|
public void propertyChange(PropertyChangeEvent event) {
|
||||||
String property = event.getProperty();
|
String property = event.getProperty();
|
||||||
if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property)
|
if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property)
|
||||||
|
|
|
@ -46,7 +46,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
||||||
|
|
||||||
public class ProjectSelectionDialog extends SelectionStatusDialog {
|
public class ProjectSelectionDialog extends SelectionStatusDialog {
|
||||||
|
|
||||||
// the visual selection widget group
|
// the visual selection widget group
|
||||||
private TableViewer fTableViewer;
|
private TableViewer fTableViewer;
|
||||||
private Set<ICProject> fProjectsWithSpecifics;
|
private Set<ICProject> fProjectsWithSpecifics;
|
||||||
|
@ -89,11 +88,13 @@ public class ProjectSelectionDialog extends SelectionStatusDialog {
|
||||||
|
|
||||||
fTableViewer= new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
|
fTableViewer= new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
|
||||||
fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||||
|
@Override
|
||||||
public void selectionChanged(SelectionChangedEvent event) {
|
public void selectionChanged(SelectionChangedEvent event) {
|
||||||
doSelectionChanged(((IStructuredSelection) event.getSelection()).toArray());
|
doSelectionChanged(((IStructuredSelection) event.getSelection()).toArray());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fTableViewer.addDoubleClickListener(new IDoubleClickListener() {
|
fTableViewer.addDoubleClickListener(new IDoubleClickListener() {
|
||||||
|
@Override
|
||||||
public void doubleClick(DoubleClickEvent event) {
|
public void doubleClick(DoubleClickEvent event) {
|
||||||
okPressed();
|
okPressed();
|
||||||
}
|
}
|
||||||
|
@ -112,9 +113,11 @@ public class ProjectSelectionDialog extends SelectionStatusDialog {
|
||||||
checkbox.setText(PreferencesMessages.ProjectSelectionDialog_filter);
|
checkbox.setText(PreferencesMessages.ProjectSelectionDialog_filter);
|
||||||
checkbox.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false));
|
checkbox.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false));
|
||||||
checkbox.addSelectionListener(new SelectionListener() {
|
checkbox.addSelectionListener(new SelectionListener() {
|
||||||
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
updateFilter(((Button) e.widget).getSelection());
|
updateFilter(((Button) e.widget).getSelection());
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
updateFilter(((Button) e.widget).getSelection());
|
updateFilter(((Button) e.widget).getSelection());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin, Google
|
* Sergey Prigogin (Google)
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFie
|
||||||
* Base for project property and preference pages
|
* Base for project property and preference pages
|
||||||
*/
|
*/
|
||||||
public abstract class PropertyAndPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IWorkbenchPropertyPage {
|
public abstract class PropertyAndPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IWorkbenchPropertyPage {
|
||||||
|
|
||||||
private Control fConfigurationBlockControl;
|
private Control fConfigurationBlockControl;
|
||||||
private ControlEnableState fBlockEnableState;
|
private ControlEnableState fBlockEnableState;
|
||||||
private Link fChangeWorkspaceSettings;
|
private Link fChangeWorkspaceSettings;
|
||||||
|
@ -63,7 +62,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
private Composite fParentComposite;
|
private Composite fParentComposite;
|
||||||
|
|
||||||
private IProject fProject; // project or null
|
private IProject fProject; // project or null
|
||||||
private Map <?,?> fData; // page data
|
private Map<?, ?> fData; // page data
|
||||||
|
|
||||||
public static final String DATA_NO_LINK= "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$
|
public static final String DATA_NO_LINK= "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -102,6 +101,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
|
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
|
||||||
|
|
||||||
IDialogFieldListener listener= new IDialogFieldListener() {
|
IDialogFieldListener listener= new IDialogFieldListener() {
|
||||||
|
@Override
|
||||||
public void dialogFieldChanged(DialogField field) {
|
public void dialogFieldChanged(DialogField field) {
|
||||||
enableProjectSpecificSettings(((SelectionButtonDialogField)field).isSelected());
|
enableProjectSpecificSettings(((SelectionButtonDialogField)field).isSelected());
|
||||||
}
|
}
|
||||||
|
@ -162,10 +162,12 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
link.setFont(composite.getFont());
|
link.setFont(composite.getFont());
|
||||||
link.setText("<A>" + text + "</A>"); //$NON-NLS-1$//$NON-NLS-2$
|
link.setText("<A>" + text + "</A>"); //$NON-NLS-1$//$NON-NLS-2$
|
||||||
link.addSelectionListener(new SelectionListener() {
|
link.addSelectionListener(new SelectionListener() {
|
||||||
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
doLinkActivated((Link) e.widget);
|
doLinkActivated((Link) e.widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
doLinkActivated((Link) e.widget);
|
doLinkActivated((Link) e.widget);
|
||||||
}
|
}
|
||||||
|
@ -228,7 +230,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings) {
|
protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings) {
|
||||||
fUseProjectSettings.setSelection(useProjectSpecificSettings);
|
fUseProjectSettings.setSelection(useProjectSpecificSettings);
|
||||||
enablePreferenceContent(useProjectSpecificSettings);
|
enablePreferenceContent(useProjectSpecificSettings);
|
||||||
|
@ -246,7 +247,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void setPreferenceContentStatus(IStatus status) {
|
protected void setPreferenceContentStatus(IStatus status) {
|
||||||
fBlockStatus= status;
|
fBlockStatus= status;
|
||||||
doStatusChanged();
|
doStatusChanged();
|
||||||
|
@ -259,6 +259,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
*/
|
*/
|
||||||
protected IStatusChangeListener getNewStatusChangedListener() {
|
protected IStatusChangeListener getNewStatusChangedListener() {
|
||||||
return new IStatusChangeListener() {
|
return new IStatusChangeListener() {
|
||||||
|
@Override
|
||||||
public void statusChanged(IStatus status) {
|
public void statusChanged(IStatus status) {
|
||||||
setPreferenceContentStatus(status);
|
setPreferenceContentStatus(status);
|
||||||
}
|
}
|
||||||
|
@ -290,9 +291,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
if (useProjectSettings()) {
|
if (useProjectSettings()) {
|
||||||
|
@ -306,34 +304,24 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
StatusUtil.applyToStatusLine(this, status);
|
StatusUtil.applyToStatusLine(this, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
|
||||||
*/
|
|
||||||
public void init(IWorkbench workbench) {
|
public void init(IWorkbench workbench) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.ui.IWorkbenchPropertyPage#getElement()
|
|
||||||
*/
|
|
||||||
public IAdaptable getElement() {
|
public IAdaptable getElement() {
|
||||||
return fProject;
|
return fProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable)
|
|
||||||
*/
|
|
||||||
public void setElement(IAdaptable element) {
|
public void setElement(IAdaptable element) {
|
||||||
fProject= (IProject) element.getAdapter(IResource.class);
|
fProject= (IProject) element.getAdapter(IResource.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.jface.preference.PreferencePage#applyData(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void applyData(Object data) {
|
public void applyData(Object data) {
|
||||||
if (data instanceof Map<?, ?>) {
|
if (data instanceof Map<?, ?>) {
|
||||||
fData= (Map<?,?>) data;
|
fData= (Map<?, ?>) data;
|
||||||
}
|
}
|
||||||
if (fChangeWorkspaceSettings != null) {
|
if (fChangeWorkspaceSettings != null) {
|
||||||
if (!offerLink()) {
|
if (!offerLink()) {
|
||||||
|
@ -343,7 +331,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Map<?,?> getData() {
|
protected Map<?, ?> getData() {
|
||||||
return fData;
|
return fData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,8 @@
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
import com.ibm.icu.text.MessageFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -40,14 +38,15 @@ import org.eclipse.ui.IWorkbench;
|
||||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.ibm.icu.text.MessageFormat;
|
||||||
|
|
||||||
import org.eclipse.cdt.ui.PreferenceConstants;
|
import org.eclipse.cdt.ui.PreferenceConstants;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.Separator;
|
import org.eclipse.cdt.internal.ui.wizards.dialogfields.Separator;
|
||||||
|
|
||||||
public class ScalabilityPreferencePage extends PreferencePage implements
|
public class ScalabilityPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
||||||
IWorkbenchPreferencePage {
|
|
||||||
|
|
||||||
// Files with this number of lines will trigger scalability mode
|
// Files with this number of lines will trigger scalability mode
|
||||||
private IntegerFieldEditor fLinesToTrigger;
|
private IntegerFieldEditor fLinesToTrigger;
|
||||||
|
@ -64,14 +63,14 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
|
|
||||||
private Button fContentAssistAutoActivation;
|
private Button fContentAssistAutoActivation;
|
||||||
|
|
||||||
private Map<Object, String> fCheckBoxes= new HashMap<Object, String>();
|
private final Map<Object, String> fCheckBoxes= new HashMap<Object, String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of master/slave listeners when there's a dependency.
|
* List of master/slave listeners when there's a dependency.
|
||||||
*
|
*
|
||||||
* @see #createDependency(Button, String, Control)
|
* @see #createDependency(Button, String, Control)
|
||||||
*/
|
*/
|
||||||
private ArrayList<Object> fMasterSlaveListeners= new ArrayList<Object>();
|
private final ArrayList<Object> fMasterSlaveListeners= new ArrayList<Object>();
|
||||||
|
|
||||||
public ScalabilityPreferencePage() {
|
public ScalabilityPreferencePage() {
|
||||||
setPreferenceStore(PreferenceConstants.getPreferenceStore());
|
setPreferenceStore(PreferenceConstants.getPreferenceStore());
|
||||||
|
@ -196,6 +195,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
fLinesToTrigger.load();
|
fLinesToTrigger.load();
|
||||||
fLinesToTrigger.setPropertyChangeListener( new IPropertyChangeListener() {
|
fLinesToTrigger.setPropertyChangeListener( new IPropertyChangeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void propertyChange( PropertyChangeEvent event ) {
|
public void propertyChange( PropertyChangeEvent event ) {
|
||||||
if ( event.getProperty().equals( FieldEditor.IS_VALID ) )
|
if ( event.getProperty().equals( FieldEditor.IS_VALID ) )
|
||||||
setValid( fLinesToTrigger.isValid() );
|
setValid( fLinesToTrigger.isValid() );
|
||||||
|
@ -246,6 +246,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionListener listener= new SelectionListener() {
|
SelectionListener listener= new SelectionListener() {
|
||||||
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
slave.setEnabled(!master.getSelection());
|
slave.setEnabled(!master.getSelection());
|
||||||
if (master.getSelection()) {
|
if (master.getSelection()) {
|
||||||
|
@ -253,6 +254,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {}
|
public void widgetDefaultSelected(SelectionEvent e) {}
|
||||||
};
|
};
|
||||||
master.addSelectionListener(listener);
|
master.addSelectionListener(listener);
|
||||||
|
@ -262,6 +264,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
/*
|
/*
|
||||||
* @see IWorkbenchPreferencePage#init(IWorkbench)
|
* @see IWorkbenchPreferencePage#init(IWorkbench)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(IWorkbench workbench) {
|
public void init(IWorkbench workbench) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin, Google
|
* Sergey Prigogin (Google)
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
@ -73,6 +73,7 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock {
|
||||||
* @param parent the parent composite
|
* @param parent the parent composite
|
||||||
* @return the control for the preference page
|
* @return the control for the preference page
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Control createControl(Composite parent) {
|
public Control createControl(Composite parent) {
|
||||||
ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
|
ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
|
||||||
scrolled.setExpandHorizontal(true);
|
scrolled.setExpandHorizontal(true);
|
||||||
|
@ -190,10 +191,13 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock {
|
||||||
String linkTooltip= PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tooltip;
|
String linkTooltip= PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tooltip;
|
||||||
String text;
|
String text;
|
||||||
String indentMode= CUIPlugin.getDefault().getCombinedPreferenceStore().getString(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR);
|
String indentMode= CUIPlugin.getDefault().getCombinedPreferenceStore().getString(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR);
|
||||||
if (CCorePlugin.TAB.equals(indentMode))
|
if (CCorePlugin.TAB.equals(indentMode)) {
|
||||||
text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tab_text, Integer.toString(getTabDisplaySize()));
|
text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tab_text,
|
||||||
else
|
Integer.toString(getTabDisplaySize()));
|
||||||
text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_others_text, Integer.toString(getTabDisplaySize()), Integer.toString(getIndentSize()), getIndentMode());
|
} else {
|
||||||
|
text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_others_text,
|
||||||
|
Integer.toString(getTabDisplaySize()), Integer.toString(getIndentSize()), getIndentMode());
|
||||||
|
}
|
||||||
|
|
||||||
final Link link= new Link(composite, SWT.NONE);
|
final Link link= new Link(composite, SWT.NONE);
|
||||||
link.setText(text);
|
link.setText(text);
|
||||||
|
@ -204,13 +208,15 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock {
|
||||||
link.addSelectionListener(new SelectionAdapter() {
|
link.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
PreferencesUtil.createPreferenceDialogOn(link.getShell(), "org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage", null, null); //$NON-NLS-1$
|
PreferencesUtil.createPreferenceDialogOn(link.getShell(),
|
||||||
|
"org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage", null, null); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final IPreferenceStore combinedStore= CUIPlugin.getDefault().getCombinedPreferenceStore();
|
final IPreferenceStore combinedStore= CUIPlugin.getDefault().getCombinedPreferenceStore();
|
||||||
final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() {
|
final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() {
|
||||||
private boolean fHasRun= false;
|
private boolean fHasRun= false;
|
||||||
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent event) {
|
public void propertyChange(PropertyChangeEvent event) {
|
||||||
if (fHasRun)
|
if (fHasRun)
|
||||||
return;
|
return;
|
||||||
|
@ -230,6 +236,7 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock {
|
||||||
};
|
};
|
||||||
combinedStore.addPropertyChangeListener(propertyChangeListener);
|
combinedStore.addPropertyChangeListener(propertyChangeListener);
|
||||||
link.addDisposeListener(new DisposeListener() {
|
link.addDisposeListener(new DisposeListener() {
|
||||||
|
@Override
|
||||||
public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) {
|
public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) {
|
||||||
combinedStore.removePropertyChangeListener(propertyChangeListener);
|
combinedStore.removePropertyChangeListener(propertyChangeListener);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,10 +99,12 @@ public class SpellingConfigurationBlock extends OptionsConfigurationBlock {
|
||||||
*/
|
*/
|
||||||
protected static void createSelectionDependency(final Button master, final Control slave) {
|
protected static void createSelectionDependency(final Button master, final Control slave) {
|
||||||
master.addSelectionListener(new SelectionListener() {
|
master.addSelectionListener(new SelectionListener() {
|
||||||
|
@Override
|
||||||
public void widgetDefaultSelected(SelectionEvent event) {
|
public void widgetDefaultSelected(SelectionEvent event) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
slave.setEnabled(master.getSelection());
|
slave.setEnabled(master.getSelection());
|
||||||
}
|
}
|
||||||
|
@ -485,6 +487,7 @@ public class SpellingConfigurationBlock extends OptionsConfigurationBlock {
|
||||||
|
|
||||||
// Redirect status messages from the field editor to the status change listener
|
// Redirect status messages from the field editor to the status change listener
|
||||||
DialogPage fakePage= new DialogPage() {
|
DialogPage fakePage= new DialogPage() {
|
||||||
|
@Override
|
||||||
public void createControl(Composite c) {
|
public void createControl(Composite c) {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,10 +13,8 @@
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
import org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor;
|
import org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor;
|
||||||
import org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock;
|
import org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock;
|
||||||
|
|
||||||
|
@ -31,12 +29,13 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus)
|
* @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void statusChanged(IStatus status) {
|
public void statusChanged(IStatus status) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class StatusChangeListenerAdapter implements IStatusChangeListener {
|
private class StatusChangeListenerAdapter implements IStatusChangeListener {
|
||||||
private IPreferenceStatusMonitor fMonitor;
|
private final IPreferenceStatusMonitor fMonitor;
|
||||||
|
|
||||||
private IStatus fStatus;
|
private IStatus fStatus;
|
||||||
|
|
||||||
|
@ -48,6 +47,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus)
|
* @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void statusChanged(IStatus status) {
|
public void statusChanged(IStatus status) {
|
||||||
fStatus= status;
|
fStatus= status;
|
||||||
fMonitor.statusChanged(status);
|
fMonitor.statusChanged(status);
|
||||||
|
@ -58,13 +58,14 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpellingConfigurationBlock fBlock= new SpellingConfigurationBlock(new NullStatusChangeListener(), null, null);
|
private final SpellingConfigurationBlock fBlock= new SpellingConfigurationBlock(new NullStatusChangeListener(), null, null);
|
||||||
|
|
||||||
private SpellingPreferenceBlock.StatusChangeListenerAdapter fStatusMonitor;
|
private SpellingPreferenceBlock.StatusChangeListenerAdapter fStatusMonitor;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#createControl(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#createControl(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Control createControl(Composite parent) {
|
public Control createControl(Composite parent) {
|
||||||
return fBlock.createContents(parent);
|
return fBlock.createContents(parent);
|
||||||
}
|
}
|
||||||
|
@ -72,6 +73,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#initialize(org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor)
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#initialize(org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void initialize(IPreferenceStatusMonitor statusMonitor) {
|
public void initialize(IPreferenceStatusMonitor statusMonitor) {
|
||||||
fStatusMonitor= new StatusChangeListenerAdapter(statusMonitor);
|
fStatusMonitor= new StatusChangeListenerAdapter(statusMonitor);
|
||||||
fBlock.fContext= fStatusMonitor;
|
fBlock.fContext= fStatusMonitor;
|
||||||
|
@ -80,6 +82,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#canPerformOk()
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#canPerformOk()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean canPerformOk() {
|
public boolean canPerformOk() {
|
||||||
return fStatusMonitor == null || fStatusMonitor.getStatus() == null || !fStatusMonitor.getStatus().matches(IStatus.ERROR);
|
return fStatusMonitor == null || fStatusMonitor.getStatus() == null || !fStatusMonitor.getStatus().matches(IStatus.ERROR);
|
||||||
}
|
}
|
||||||
|
@ -87,6 +90,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performOk()
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performOk()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void performOk() {
|
public void performOk() {
|
||||||
fBlock.performOk();
|
fBlock.performOk();
|
||||||
}
|
}
|
||||||
|
@ -94,6 +98,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performDefaults()
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performDefaults()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void performDefaults() {
|
public void performDefaults() {
|
||||||
fBlock.performDefaults();
|
fBlock.performDefaults();
|
||||||
}
|
}
|
||||||
|
@ -101,6 +106,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performRevert()
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performRevert()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void performRevert() {
|
public void performRevert() {
|
||||||
fBlock.performRevert();
|
fBlock.performRevert();
|
||||||
}
|
}
|
||||||
|
@ -108,6 +114,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#dispose()
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#dispose()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
fBlock.dispose();
|
fBlock.dispose();
|
||||||
}
|
}
|
||||||
|
@ -115,6 +122,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#setEnabled(boolean)
|
* @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#setEnabled(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
fBlock.setEnabled(enabled);
|
fBlock.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -88,12 +87,14 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
|
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Image getColumnImage(Object element, int columnIndex) {
|
public Image getColumnImage(Object element, int columnIndex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
|
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getColumnText(Object element, int columnIndex) {
|
public String getColumnText(Object element, int columnIndex) {
|
||||||
TodoTask task = (TodoTask) element;
|
TodoTask task = (TodoTask) element;
|
||||||
if (columnIndex == 0) {
|
if (columnIndex == 0) {
|
||||||
|
@ -116,6 +117,7 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
|
* @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Font getFont(Object element) {
|
public Font getFont(Object element) {
|
||||||
if (isDefaultTask((TodoTask) element)) {
|
if (isDefaultTask((TodoTask) element)) {
|
||||||
return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
|
return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
|
||||||
|
@ -138,8 +140,8 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
|
||||||
private static final int IDX_DEFAULT = 4;
|
private static final int IDX_DEFAULT = 4;
|
||||||
|
|
||||||
private IStatus fTaskTagsStatus;
|
private IStatus fTaskTagsStatus;
|
||||||
private ListDialogField<TodoTask> fTodoTasksList;
|
private final ListDialogField<TodoTask> fTodoTasksList;
|
||||||
private SelectionButtonDialogField fCaseSensitiveCheckBox;
|
private final SelectionButtonDialogField fCaseSensitiveCheckBox;
|
||||||
|
|
||||||
|
|
||||||
public TodoTaskConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
|
public TodoTaskConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
|
||||||
|
@ -212,22 +214,26 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
|
||||||
return selectedElements.size() == 1 && !isDefaultTask(selectedElements.get(0));
|
return selectedElements.size() == 1 && !isDefaultTask(selectedElements.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void customButtonPressed(ListDialogField<TodoTask> field, int index) {
|
public void customButtonPressed(ListDialogField<TodoTask> field, int index) {
|
||||||
doTodoButtonPressed(index);
|
doTodoButtonPressed(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void selectionChanged(ListDialogField<TodoTask> field) {
|
public void selectionChanged(ListDialogField<TodoTask> field) {
|
||||||
List<TodoTask> selectedElements = field.getSelectedElements();
|
List<TodoTask> selectedElements = field.getSelectedElements();
|
||||||
field.enableButton(IDX_EDIT, canEdit(selectedElements));
|
field.enableButton(IDX_EDIT, canEdit(selectedElements));
|
||||||
field.enableButton(IDX_DEFAULT, canSetToDefault(selectedElements));
|
field.enableButton(IDX_DEFAULT, canSetToDefault(selectedElements));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doubleClicked(ListDialogField<TodoTask> field) {
|
public void doubleClicked(ListDialogField<TodoTask> field) {
|
||||||
if (canEdit(field.getSelectedElements())) {
|
if (canEdit(field.getSelectedElements())) {
|
||||||
doTodoButtonPressed(IDX_EDIT);
|
doTodoButtonPressed(IDX_EDIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void dialogFieldChanged(DialogField field) {
|
public void dialogFieldChanged(DialogField field) {
|
||||||
updateModel(field);
|
updateModel(field);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -40,15 +39,16 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField;
|
||||||
public class TodoTaskInputDialog extends StatusDialog {
|
public class TodoTaskInputDialog extends StatusDialog {
|
||||||
|
|
||||||
private class CompilerTodoTaskInputAdapter implements IDialogFieldListener {
|
private class CompilerTodoTaskInputAdapter implements IDialogFieldListener {
|
||||||
|
@Override
|
||||||
public void dialogFieldChanged(DialogField field) {
|
public void dialogFieldChanged(DialogField field) {
|
||||||
doValidation();
|
doValidation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private StringDialogField fNameDialogField;
|
private final StringDialogField fNameDialogField;
|
||||||
private ComboDialogField fPriorityDialogField;
|
private final ComboDialogField fPriorityDialogField;
|
||||||
|
|
||||||
private List<String> fExistingNames;
|
private final List<String> fExistingNames;
|
||||||
|
|
||||||
public TodoTaskInputDialog(Shell parent, TodoTask task, List<TodoTask> existingEntries) {
|
public TodoTaskInputDialog(Shell parent, TodoTask task, List<TodoTask> existingEntries) {
|
||||||
super(parent);
|
super(parent);
|
||||||
|
|
|
@ -35,10 +35,9 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
* Preference page for work in progress.
|
* Preference page for work in progress.
|
||||||
*/
|
*/
|
||||||
public class WorkInProgressPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
public class WorkInProgressPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
||||||
|
private final List<Button> fCheckBoxes;
|
||||||
private List<Button> fCheckBoxes;
|
private final List<Button> fRadioButtons;
|
||||||
private List<Button> fRadioButtons;
|
private final List<Text> fTextControls;
|
||||||
private List<Text> fTextControls;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates a new preference page.
|
* creates a new preference page.
|
||||||
|
@ -95,6 +94,7 @@ public class WorkInProgressPreferencePage extends PreferencePage implements IWor
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(IWorkbench workbench) {
|
public void init(IWorkbench workbench) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue