mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
mostly patch from thomasf with some additions to editor preferences (selection color)
and labels in preference page. no longer depends of runtime.compatibility
This commit is contained in:
parent
a42bdd4da8
commit
1a728b8a2a
36 changed files with 304 additions and 215 deletions
|
@ -16,7 +16,6 @@ import org.eclipse.cdt.ui.PreferenceConstants;
|
|||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
|
||||
|
||||
/**
|
||||
* JavaUILabelProvider that respects settings from the Appearance preference page.
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.browser.cbrowsing;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceRange;
|
||||
|
@ -30,12 +27,6 @@ import org.eclipse.core.resources.IMarker;
|
|||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IResourceStatus;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.text.Position;
|
||||
import org.eclipse.jface.text.source.Annotation;
|
||||
|
@ -43,11 +34,12 @@ import org.eclipse.jface.text.source.IAnnotationModel;
|
|||
import org.eclipse.jface.viewers.IBaseLabelProvider;
|
||||
import org.eclipse.jface.viewers.IDecoration;
|
||||
import org.eclipse.jface.viewers.ILabelDecorator;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ILabelProviderListener;
|
||||
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
|
||||
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
|
||||
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.ui.part.FileEditorInput;
|
||||
import org.eclipse.ui.texteditor.MarkerAnnotation;
|
||||
|
||||
|
|
|
@ -59,17 +59,12 @@ ActionDefinition.opendecl.description= Open an editor on the selected element's
|
|||
ActionDefinition.opencview.name= Show in C/C++ Project view
|
||||
ActionDefinition.opencview.description= Show the selected resource in the C/C++ Project view
|
||||
|
||||
CEditor.name=C Editor
|
||||
CEditor.name=C/C++ Editor
|
||||
CPluginPreferencePage.name=C/C++
|
||||
CPluginEditorPreferencePage.name=C/C++ Editor
|
||||
CPluginEditorPreferencePage.name=Editor
|
||||
CPluginTemplatePreferencePage.name=Code Templates
|
||||
CPluginBuildConsolePreferencePage.name=Build Console
|
||||
CPluginFileTypesPreferencePage.name=C/C++ File Types
|
||||
CProjectPropertyPage.name=C/C++ Project
|
||||
CLaunchingPropertyPage.executionArguments.name=C Execution Arguments
|
||||
CApplicationLauncher.label=Executable
|
||||
CApplicationLauncher.description=Launch a local command
|
||||
CProblemMarker.name=C Problem
|
||||
CPluginFileTypesPreferencePage.name=File Types
|
||||
|
||||
todoPageName=C/C++ Task Tags
|
||||
todoTaskPrefName=Task Tags
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
<import plugin="org.eclipse.search"/>
|
||||
<import plugin="org.eclipse.compare"/>
|
||||
<import plugin="org.eclipse.cdt.core"/>
|
||||
<import plugin="org.eclipse.core.runtime.compatibility"/>
|
||||
<import plugin="org.eclipse.ui.console"/>
|
||||
<import plugin="org.eclipse.core.filebuffers"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
</requires>
|
||||
|
||||
|
||||
|
@ -791,4 +791,8 @@
|
|||
name="org.eclipse.cdt.ui.indexmarker">
|
||||
</type>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.runtime.preferences">
|
||||
<initializer class="org.eclipse.cdt.ui.CUIPreferenceInitializer"/>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -61,7 +61,7 @@ public class RefactoringSaveHelper {
|
|||
description.setAutoBuilding(false);
|
||||
workspace.setDescription(description);
|
||||
try {
|
||||
CUIPlugin.getDefault().getActiveWorkbenchWindow().getWorkbench().saveAllEditors(false);
|
||||
CUIPlugin.getActiveWorkbenchWindow().getWorkbench().saveAllEditors(false);
|
||||
fFilesSaved= true;
|
||||
} finally {
|
||||
description.setAutoBuilding(autoBuild);
|
||||
|
@ -77,7 +77,7 @@ public class RefactoringSaveHelper {
|
|||
|
||||
public void triggerBuild() {
|
||||
if (fFilesSaved && ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
|
||||
new GlobalBuildAction(CUIPlugin.getDefault().getActiveWorkbenchWindow(), IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
|
||||
new GlobalBuildAction(CUIPlugin.getActiveWorkbenchWindow(), IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.eclipse.jface.dialogs.IDialogSettings;
|
|||
import org.eclipse.jface.dialogs.IMessageProvider;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.operation.ModalContext;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.jface.wizard.IWizardContainer;
|
||||
import org.eclipse.jface.wizard.IWizardPage;
|
||||
|
|
|
@ -89,14 +89,14 @@ public class CCompletionContributorManager {
|
|||
fCompletionContributors = new ArrayList(2);
|
||||
|
||||
// populate list
|
||||
IExtensionPoint extensionPoint = Platform.getPluginRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "CCompletionContributor"); //$NON-NLS-1$
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "CCompletionContributor"); //$NON-NLS-1$
|
||||
if (extensionPoint != null) {
|
||||
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
|
||||
for (int i = 0; i < elements.length; i++) {
|
||||
if (elements[i].getName().equals("provider")) { //$NON-NLS-1$
|
||||
try {
|
||||
final ICCompletionContributor c;
|
||||
// Instantiate the classe
|
||||
// Instantiate the class
|
||||
c = (ICCompletionContributor) elements[i].createExecutableExtension("class"); //$NON-NLS-1$
|
||||
ISafeRunnable runnable = new ISafeRunnable() {
|
||||
public void run() throws Exception {
|
||||
|
|
|
@ -27,7 +27,7 @@ public class CPluginImages {
|
|||
|
||||
static {
|
||||
try {
|
||||
fgIconBaseURL= new URL(CUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); //$NON-NLS-1$
|
||||
fgIconBaseURL= new URL(CUIPlugin.getDefault().getBundle().getEntry("/"), "icons/" ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} catch (MalformedURLException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
}
|
||||
|
|
|
@ -289,7 +289,7 @@ Editor.error.revert.message=Internal error:
|
|||
Editor.error.no_input=Unable to read text editor input
|
||||
Editor.error.invalid_input=Invalid text editor input
|
||||
|
||||
CEditorPreferencePage.description= C Editor Preferences
|
||||
CEditorPreferencePage.description= C/C++ Editor Preferences
|
||||
|
||||
# ------- OpenIncludeDeclarationAction------------
|
||||
|
||||
|
|
|
@ -56,9 +56,7 @@ public abstract class CViewActionGroup extends ActionGroup {
|
|||
protected ImageDescriptor getImageDescriptor(String relativePath) {
|
||||
String iconPath = "icons/full/"; //$NON-NLS-1$
|
||||
try {
|
||||
//AbstractUIPlugin plugin = (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID);
|
||||
//URL installURL = plugin.getDescriptor().getInstallURL();
|
||||
URL installURL = CUIPlugin.getDefault().getDescriptor().getInstallURL();
|
||||
URL installURL = CUIPlugin.getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
|
||||
URL url = new URL(installURL, iconPath + relativePath);
|
||||
return ImageDescriptor.createFromURL(url);
|
||||
} catch (MalformedURLException e) {
|
||||
|
|
|
@ -110,12 +110,12 @@ public class RefactorActionGroup extends CViewActionGroup {
|
|||
ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
|
||||
pasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
|
||||
pasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
|
||||
pasteAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_HOVER));
|
||||
pasteAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
|
||||
|
||||
copyAction = new CopyAction(shell, clipboard, pasteAction);
|
||||
copyAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
|
||||
copyAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
|
||||
copyAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_HOVER));
|
||||
copyAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
|
||||
|
||||
moveAction = new CViewMoveAction(shell, treeViewer);
|
||||
renameAction = new CViewRenameAction(shell, treeViewer);
|
||||
|
@ -123,7 +123,7 @@ public class RefactorActionGroup extends CViewActionGroup {
|
|||
deleteAction = new DeleteResourceAction(shell);
|
||||
deleteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
|
||||
deleteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
|
||||
deleteAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_HOVER));
|
||||
deleteAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
|
||||
}
|
||||
|
||||
public void updateActionBars() {
|
||||
|
|
|
@ -209,7 +209,7 @@ public class OpenIncludeAction extends Action {
|
|||
if (descriptor != null) {
|
||||
return descriptor.getId();
|
||||
} else {
|
||||
return registry.getDefaultEditor().getId();
|
||||
return IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -19,10 +19,9 @@ import java.util.Set;
|
|||
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IPluginRegistry;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.ISafeRunnable;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.jface.util.SafeRunnable;
|
||||
import org.eclipse.jface.viewers.ViewerFilter;
|
||||
|
@ -69,8 +68,8 @@ public class FilterDescriptor implements Comparable {
|
|||
*/
|
||||
public static FilterDescriptor[] getFilterDescriptors() {
|
||||
if (fgFilterDescriptors == null) {
|
||||
IPluginRegistry registry= Platform.getPluginRegistry();
|
||||
IConfigurationElement[] elements= registry.getConfigurationElementsFor(CUIPlugin.PLUGIN_ID, EXTENSION_POINT_NAME);
|
||||
IExtensionRegistry registory= Platform.getExtensionRegistry();
|
||||
IConfigurationElement[] elements= registory.getConfigurationElementsFor(CUIPlugin.PLUGIN_ID, EXTENSION_POINT_NAME);
|
||||
fgFilterDescriptors= createFilterDescriptors(elements);
|
||||
}
|
||||
return fgFilterDescriptors;
|
||||
|
|
|
@ -63,7 +63,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
* CEditorHoverConfigurationBlock
|
||||
*/
|
||||
public class CEditorHoverConfigurationBlock {
|
||||
private static final String DELIMITER= PreferencesMessages.getString("JavaEditorHoverConfigurationBlock.delimiter"); //$NON-NLS-1$
|
||||
private static final String DELIMITER= PreferencesMessages.getString("CEditorHoverConfigurationBlock.delimiter"); //$NON-NLS-1$
|
||||
|
||||
private static final int ENABLED_PROP= 0;
|
||||
private static final int MODIFIER_PROP= 1;
|
||||
|
@ -83,7 +83,7 @@ public class CEditorHoverConfigurationBlock {
|
|||
}
|
||||
|
||||
|
||||
private class JavaEditorTextHoverDescriptorLabelProvider implements ITableLabelProvider {
|
||||
private class CEditorTextHoverDescriptorLabelProvider implements ITableLabelProvider {
|
||||
|
||||
public Image getColumnImage(Object element, int columnIndex) {
|
||||
return null;
|
||||
|
@ -121,7 +121,7 @@ public class CEditorHoverConfigurationBlock {
|
|||
}
|
||||
|
||||
|
||||
private class JavaEditorTextHoverDescriptorContentProvider implements IStructuredContentProvider {
|
||||
private class CEditorTextHoverDescriptorContentProvider implements IStructuredContentProvider {
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// Do nothing since the viewer listens to resource deltas
|
||||
|
@ -261,8 +261,8 @@ public class CEditorHoverConfigurationBlock {
|
|||
|
||||
fHoverTableViewer= new CheckboxTableViewer(fHoverTable);
|
||||
fHoverTableViewer.setUseHashlookup(true);
|
||||
fHoverTableViewer.setContentProvider(new JavaEditorTextHoverDescriptorContentProvider());
|
||||
fHoverTableViewer.setLabelProvider(new JavaEditorTextHoverDescriptorLabelProvider());
|
||||
fHoverTableViewer.setContentProvider(new CEditorTextHoverDescriptorContentProvider());
|
||||
fHoverTableViewer.setLabelProvider(new CEditorTextHoverDescriptorLabelProvider());
|
||||
|
||||
((CheckboxTableViewer)fHoverTableViewer).addCheckStateListener(new ICheckStateListener() {
|
||||
/*
|
||||
|
|
|
@ -75,15 +75,14 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
PreferencesMessages.getString("CEditorPreferencePage.cCommentTaskTags"), PreferenceConstants.EDITOR_TASK_TAG_COLOR } //$NON-NLS-1$
|
||||
};
|
||||
|
||||
protected final String[][] fAppearanceColorListModel = new String[][] { { PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.lineNumberColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR }, //$NON-NLS-1$
|
||||
{
|
||||
PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.matchingBracketColor"), CEditor.MATCHING_BRACKETS_COLOR }, //$NON-NLS-1$
|
||||
{
|
||||
PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.currentLineHighlightColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR }, //$NON-NLS-1$
|
||||
{
|
||||
PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.printMarginColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR }, //$NON-NLS-1$
|
||||
{
|
||||
PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.linkedPositionColor"), CEditor.LINKED_POSITION_COLOR }, //$NON-NLS-1$
|
||||
protected final String[][] fAppearanceColorListModel = new String[][] { { PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.lineNumberColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, null }, //$NON-NLS-1$
|
||||
{PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.matchingBracketColor"), CEditor.MATCHING_BRACKETS_COLOR, null }, //$NON-NLS-1$
|
||||
{PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.currentLineHighlightColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR, null }, //$NON-NLS-1$
|
||||
{PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.printMarginColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, null }, //$NON-NLS-1$
|
||||
{PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.linkedPositionColor"), CEditor.LINKED_POSITION_COLOR, null }, //$NON-NLS-1$
|
||||
{PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.selectionForegroundColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR}, //$NON-NLS-1$
|
||||
{PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.selectionBackgroundColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR}, //$NON-NLS-1$
|
||||
|
||||
};
|
||||
|
||||
protected OverlayPreferenceStore fOverlayStore;
|
||||
|
@ -116,6 +115,13 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
|
||||
}
|
||||
};
|
||||
/**
|
||||
* List of master/slave listeners when there's a dependency.
|
||||
*
|
||||
* @see #createDependency(Button, String, Control)
|
||||
* @since 3.0
|
||||
*/
|
||||
private ArrayList fMasterSlaveListeners= new ArrayList();
|
||||
|
||||
protected List fList;
|
||||
protected ColorEditor fForegroundColorEditor;
|
||||
|
@ -127,13 +133,10 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
protected SourceViewer fPreviewViewer;
|
||||
|
||||
protected List fAppearanceColorList;
|
||||
protected ColorEditor fAppearanceForegroundColorEditor;
|
||||
protected ColorEditor fAppearanceColorEditor;
|
||||
private Button fAppearanceColorDefault;
|
||||
private CEditorHoverConfigurationBlock fCEditorHoverConfigurationBlock;
|
||||
|
||||
private Button fShowInOverviewRulerCheckBox;
|
||||
private Button fShowInVerticalRulerCheckBox;
|
||||
private Button fShowInTextCheckBox;
|
||||
|
||||
public CEditorPreferencePage() {
|
||||
setDescription(CUIPlugin.getResourceString("CEditorPreferencePage.description")); //$NON-NLS-1$
|
||||
setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore());
|
||||
|
@ -146,6 +149,12 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_BACKGROUND));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT));
|
||||
|
||||
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.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR));
|
||||
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_MULTI_LINE_COMMENT));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_MULTI_LINE_COMMENT + "_bold")); //$NON-NLS-1$
|
||||
|
@ -167,6 +176,10 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN));
|
||||
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_WIDE_CARET));
|
||||
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.LINKED_POSITION_COLOR));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR));
|
||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER));
|
||||
|
@ -200,12 +213,8 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
|
||||
public static void initDefaults(IPreferenceStore store) {
|
||||
|
||||
Color color;
|
||||
Display display = Display.getDefault();
|
||||
|
||||
store.setDefault(CEditor.MATCHING_BRACKETS, true);
|
||||
color = display.getSystemColor(SWT.COLOR_GRAY);
|
||||
PreferenceConverter.setDefault(store, CEditor.MATCHING_BRACKETS_COLOR, color.getRGB());
|
||||
PreferenceConverter.setDefault(store, CEditor.MATCHING_BRACKETS_COLOR, new RGB(170,170,170));
|
||||
|
||||
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, true);
|
||||
PreferenceConverter.setDefault(store, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR, new RGB(225, 235, 224));
|
||||
|
@ -214,13 +223,9 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 80);
|
||||
PreferenceConverter.setDefault(store, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, new RGB(176, 180, 185));
|
||||
|
||||
color = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
|
||||
PreferenceConverter.setDefault(store, CEditor.PREFERENCE_COLOR_FOREGROUND, color.getRGB());
|
||||
store.setDefault(CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true);
|
||||
|
||||
color = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
|
||||
PreferenceConverter.setDefault(store, CEditor.PREFERENCE_COLOR_BACKGROUND, color.getRGB());
|
||||
store.setDefault(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, false);
|
||||
store.setDefault(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true);
|
||||
|
||||
store.setDefault(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 4);
|
||||
|
||||
|
@ -270,8 +275,38 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
store.setDefault(ContentAssistPreference.ADD_INCLUDE, true);
|
||||
|
||||
store.setDefault(CEditor.HYPERLINK_ENABLED,true);
|
||||
|
||||
|
||||
// override default extended text editor prefs
|
||||
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS, true);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void initializeDefaultColors() {
|
||||
if (!getPreferenceStore().contains(CEditor.PREFERENCE_COLOR_FOREGROUND)) {
|
||||
RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB();
|
||||
PreferenceConverter.setDefault(fOverlayStore, CEditor.PREFERENCE_COLOR_FOREGROUND, rgb);
|
||||
PreferenceConverter.setDefault(getPreferenceStore(), CEditor.PREFERENCE_COLOR_FOREGROUND, rgb);
|
||||
}
|
||||
|
||||
if (!getPreferenceStore().contains(CEditor.PREFERENCE_COLOR_BACKGROUND)) {
|
||||
RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
|
||||
PreferenceConverter.setDefault(fOverlayStore, CEditor.PREFERENCE_COLOR_BACKGROUND, rgb);
|
||||
PreferenceConverter.setDefault(getPreferenceStore(), CEditor.PREFERENCE_COLOR_BACKGROUND, rgb);
|
||||
}
|
||||
|
||||
if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR)) {
|
||||
RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB();
|
||||
PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb);
|
||||
PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb);
|
||||
}
|
||||
if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR)) {
|
||||
RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT).getRGB();
|
||||
PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb);
|
||||
PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -285,6 +320,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
*/
|
||||
public void createControl(Composite parent) {
|
||||
super.createControl(parent);
|
||||
WorkbenchHelp.setHelp(parent, ICHelpContextIds.C_EDITOR_PREF_PAGE);
|
||||
}
|
||||
|
||||
protected void handleListSelection() {
|
||||
|
@ -293,7 +329,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
|
||||
fForegroundColorEditor.setColorValue(rgb);
|
||||
fBoldCheckBox.setSelection(fOverlayStore.getBoolean(key + "_bold")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
private Control createColorPage(Composite parent) {
|
||||
|
||||
|
@ -550,46 +586,65 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
}
|
||||
};
|
||||
|
||||
private Button fBracketHighlightButton;
|
||||
private Button fLineHighlightButton;
|
||||
|
||||
protected void handleAppearanceColorListSelection() {
|
||||
int i = fAppearanceColorList.getSelectionIndex();
|
||||
String key = fAppearanceColorListModel[i][1];
|
||||
RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
|
||||
fAppearanceForegroundColorEditor.setColorValue(rgb);
|
||||
fAppearanceColorEditor.setColorValue(rgb);
|
||||
updateAppearanceColorWidgets(fAppearanceColorListModel[i][2]);
|
||||
}
|
||||
|
||||
private void updateAppearanceColorWidgets(String systemDefaultKey) {
|
||||
if (systemDefaultKey == null) {
|
||||
fAppearanceColorDefault.setSelection(false);
|
||||
fAppearanceColorDefault.setVisible(false);
|
||||
fAppearanceColorEditor.getButton().setEnabled(true);
|
||||
} else {
|
||||
boolean systemDefault= fOverlayStore.getBoolean(systemDefaultKey);
|
||||
fAppearanceColorDefault.setSelection(systemDefault);
|
||||
fAppearanceColorDefault.setVisible(true);
|
||||
fAppearanceColorEditor.getButton().setEnabled(!systemDefault);
|
||||
}
|
||||
}
|
||||
|
||||
private Control createBehaviorPage(Composite parent) {
|
||||
|
||||
Composite behaviorComposite = new Composite(parent, SWT.NULL);
|
||||
Composite behaviorComposite = new Composite(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 2;
|
||||
behaviorComposite.setLayout(layout);
|
||||
|
||||
String label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.tabWidth"); //$NON-NLS-1$
|
||||
addTextField(behaviorComposite, label, CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 2, 0, true);
|
||||
addTextField(behaviorComposite, label, CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 3, 0, true);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.marginColumn"); //$NON-NLS-1$
|
||||
addTextField(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 4, 0, true);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.tabSpace"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, CEditor.SPACES_FOR_TABS, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.matchingBrackets"); //$NON-NLS-1$
|
||||
fBracketHighlightButton = addCheckBox(behaviorComposite, label, CEditor.MATCHING_BRACKETS, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.showLineNumbers"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.highlightLine"); //$NON-NLS-1$
|
||||
fLineHighlightButton = addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, 0);
|
||||
addTextField(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 3, 0, true);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.showOverviewRuler"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.showLineNumbers"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.matchingBrackets"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, CEditor.MATCHING_BRACKETS, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.highlightLine"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.printMargin"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, 0);
|
||||
|
||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.tabSpace"); //$NON-NLS-1$
|
||||
addCheckBox(behaviorComposite, label, CEditor.SPACES_FOR_TABS, 0);
|
||||
|
||||
label= PreferencesMessages.getString("CEditorPreferencePage.accessibility.disableCustomCarets"); //$NON-NLS-1$
|
||||
Button master= addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS, 0);
|
||||
|
||||
label= PreferencesMessages.getString("CEditorPreferencePage.accessibility.wideCaret"); //$NON-NLS-1$
|
||||
Button slave= addCheckBox(behaviorComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_WIDE_CARET, 0);
|
||||
createDependency(master, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS, slave);
|
||||
|
||||
|
||||
Label l = new Label(behaviorComposite, SWT.LEFT);
|
||||
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
||||
|
@ -632,12 +687,34 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
gd.horizontalAlignment = GridData.BEGINNING;
|
||||
l.setLayoutData(gd);
|
||||
|
||||
fAppearanceForegroundColorEditor = new ColorEditor(stylesComposite);
|
||||
Button foregroundColorButton = fAppearanceForegroundColorEditor.getButton();
|
||||
fAppearanceColorEditor = new ColorEditor(stylesComposite);
|
||||
Button foregroundColorButton = fAppearanceColorEditor.getButton();
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalAlignment = GridData.BEGINNING;
|
||||
foregroundColorButton.setLayoutData(gd);
|
||||
|
||||
SelectionListener colorDefaultSelectionListener= new SelectionListener() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
boolean systemDefault= fAppearanceColorDefault.getSelection();
|
||||
fAppearanceColorEditor.getButton().setEnabled(!systemDefault);
|
||||
|
||||
int i= fAppearanceColorList.getSelectionIndex();
|
||||
String key= fAppearanceColorListModel[i][2];
|
||||
if (key != null)
|
||||
fOverlayStore.setValue(key, systemDefault);
|
||||
}
|
||||
public void widgetDefaultSelected(SelectionEvent e) {}
|
||||
};
|
||||
|
||||
fAppearanceColorDefault= new Button(stylesComposite, SWT.CHECK);
|
||||
fAppearanceColorDefault.setText(PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.systemDefault")); //$NON-NLS-1$
|
||||
gd= new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalAlignment= GridData.BEGINNING;
|
||||
gd.horizontalSpan= 2;
|
||||
fAppearanceColorDefault.setLayoutData(gd);
|
||||
fAppearanceColorDefault.setVisible(false);
|
||||
fAppearanceColorDefault.addSelectionListener(colorDefaultSelectionListener);
|
||||
|
||||
fAppearanceColorList.addSelectionListener(new SelectionListener() {
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
// do nothing
|
||||
|
@ -654,14 +731,34 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
int i = fAppearanceColorList.getSelectionIndex();
|
||||
String key = fAppearanceColorListModel[i][1];
|
||||
|
||||
PreferenceConverter.setValue(fOverlayStore, key, fAppearanceForegroundColorEditor.getColorValue());
|
||||
PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue());
|
||||
}
|
||||
});
|
||||
|
||||
WorkbenchHelp.setHelp(behaviorComposite, ICHelpContextIds.C_EDITOR_PREF_PAGE);
|
||||
return behaviorComposite;
|
||||
}
|
||||
|
||||
private static void indent(Control control) {
|
||||
GridData gridData= new GridData();
|
||||
gridData.horizontalIndent= 20;
|
||||
control.setLayoutData(gridData);
|
||||
}
|
||||
|
||||
private void createDependency(final Button master, String masterKey, final Control slave) {
|
||||
indent(slave);
|
||||
boolean masterState= fOverlayStore.getBoolean(masterKey);
|
||||
slave.setEnabled(masterState);
|
||||
SelectionListener listener= new SelectionListener() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
slave.setEnabled(master.getSelection());
|
||||
}
|
||||
|
||||
public void widgetDefaultSelected(SelectionEvent e) {}
|
||||
};
|
||||
master.addSelectionListener(listener);
|
||||
fMasterSlaveListeners.add(listener);
|
||||
}
|
||||
|
||||
private Control createContentAssistPage(Composite parent) {
|
||||
|
||||
Composite contentAssistComposite = new Composite(parent, SWT.NULL);
|
||||
|
@ -731,6 +828,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
* @see PreferencePage#createContents(Composite)
|
||||
*/
|
||||
protected Control createContents(Composite parent) {
|
||||
initializeDefaultColors();
|
||||
|
||||
fCEditorHoverConfigurationBlock= new CEditorHoverConfigurationBlock(this, fOverlayStore);
|
||||
|
||||
|
@ -849,6 +947,12 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
fBackgroundCustomRadioButton.setSelection(!default_);
|
||||
fBackgroundColorButton.setEnabled(!default_);
|
||||
|
||||
// Update slaves
|
||||
Iterator iter= fMasterSlaveListeners.iterator();
|
||||
while (iter.hasNext()) {
|
||||
SelectionListener listener= (SelectionListener)iter.next();
|
||||
listener.widgetSelected(null);
|
||||
}
|
||||
//updateAutoactivationControls();
|
||||
}
|
||||
|
||||
|
@ -995,18 +1099,6 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
return textControl;
|
||||
}
|
||||
|
||||
private void addTextFontEditor(Composite parent, String label, String key) {
|
||||
|
||||
Composite editorComposite = new Composite(parent, SWT.NULL);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 3;
|
||||
editorComposite.setLayout(layout);
|
||||
|
||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalSpan = 2;
|
||||
editorComposite.setLayoutData(gd);
|
||||
}
|
||||
|
||||
private String loadPreviewContentFromFile(String filename) {
|
||||
String line;
|
||||
String separator = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||
|
|
|
@ -74,7 +74,7 @@ public class CFileTypesPreferenceBlock {
|
|||
}
|
||||
return 30;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private class AssocContentProvider implements IStructuredContentProvider {
|
||||
ICFileTypeAssociation[] assocs;
|
||||
|
@ -92,7 +92,7 @@ public class CFileTypesPreferenceBlock {
|
|||
assocs = (ICFileTypeAssociation[]) newInput;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private class AssocLabelProvider implements ILabelProvider, ITableLabelProvider {
|
||||
private ListenerList listeners = new ListenerList();
|
||||
|
@ -149,7 +149,7 @@ public class CFileTypesPreferenceBlock {
|
|||
return getColumnText(element, 0);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public CFileTypesPreferenceBlock(ICFileTypeResolver input) {
|
||||
fResolver = input;
|
||||
|
@ -212,7 +212,6 @@ public class CFileTypesPreferenceBlock {
|
|||
|
||||
Composite buttonPane = new Composite(control, SWT.NONE);
|
||||
GridLayout buttonPaneLayout = new GridLayout();
|
||||
GridData data = null;
|
||||
|
||||
buttonPaneLayout.marginHeight = 0;
|
||||
buttonPaneLayout.marginWidth = 0;
|
||||
|
@ -318,7 +317,7 @@ public class CFileTypesPreferenceBlock {
|
|||
private void handleAdd() {
|
||||
ICFileTypeAssociation assoc = null;
|
||||
|
||||
CFileTypeDialog dlg = new CFileTypeDialog(((Composite) fBtnNew.getParent()).getShell());
|
||||
CFileTypeDialog dlg = new CFileTypeDialog(fBtnNew.getParent().getShell());
|
||||
|
||||
if (Window.OK == dlg.open()) {
|
||||
assoc = getResolverModel().createAssocation(dlg.getPattern(), dlg.getType());
|
||||
|
|
|
@ -114,11 +114,16 @@ CEditorPreferencePage.behaviorPage.printMargin=Show print &margin
|
|||
CEditorPreferencePage.behaviorPage.showLineNumbers=Show &line numbers
|
||||
CEditorPreferencePage.behaviorPage.showOverviewRuler=Show &overview ruler
|
||||
CEditorPreferencePage.behaviorPage.appearanceColorOptions=Appearance color options
|
||||
CEditorPreferencePage.behaviorPage.lineNumberColor=Line number color
|
||||
CEditorPreferencePage.behaviorPage.matchingBracketColor=Matching bracket color
|
||||
CEditorPreferencePage.behaviorPage.currentLineHighlightColor=Current line highlight color
|
||||
CEditorPreferencePage.behaviorPage.printMarginColor=Print margin color
|
||||
CEditorPreferencePage.behaviorPage.linkedPositionColor=Linked position color
|
||||
CEditorPreferencePage.behaviorPage.lineNumberColor=Line number foreground
|
||||
CEditorPreferencePage.behaviorPage.matchingBracketColor=Matching bracket highlight
|
||||
CEditorPreferencePage.behaviorPage.currentLineHighlightColor=Current line highlight
|
||||
CEditorPreferencePage.behaviorPage.printMarginColor=Print margin
|
||||
CEditorPreferencePage.behaviorPage.linkedPositionColor=HyperLink
|
||||
CEditorPreferencePage.behaviorPage.selectionForegroundColor=Selection foreground
|
||||
CEditorPreferencePage.behaviorPage.selectionBackgroundColor=Selection background
|
||||
CEditorPreferencePage.behaviorPage.systemDefault=System Default
|
||||
CEditorPreferencePage.accessibility.disableCustomCarets= &Use custom caret
|
||||
CEditorPreferencePage.accessibility.wideCaret= Enable thic&k caret
|
||||
CEditorPreferencePage.behaviorPage.Color=Color:
|
||||
CEditorPreferencePage.textFont.changeButton=C&hange...
|
||||
CEditorPreferencePage.Navigation=Navigation
|
||||
|
|
|
@ -184,7 +184,7 @@ public class CSearchQuery implements ISearchQuery, ICSearchConstants {
|
|||
else
|
||||
label = CSearchMessages.getString("CSearchQuery.search_label"); //$NON-NLS-1$;
|
||||
|
||||
label += " \"";
|
||||
label += " \""; //$NON-NLS-1$
|
||||
label += _stringPattern;
|
||||
label += '"';
|
||||
return label;
|
||||
|
|
|
@ -123,7 +123,7 @@ public class CSearchScopeFactory {
|
|||
|
||||
|
||||
public IWorkingSet[] queryWorkingSets() {
|
||||
Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell();
|
||||
Shell shell= CUIPlugin.getActiveWorkbenchShell();
|
||||
if (shell == null)
|
||||
return null;
|
||||
IWorkingSetSelectionDialog dialog= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true);
|
||||
|
|
|
@ -46,7 +46,7 @@ public class OpenCSearchPageAction implements IWorkbenchWindowActionDelegate {
|
|||
}
|
||||
|
||||
protected void beep() {
|
||||
Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell();
|
||||
Shell shell= CUIPlugin.getActiveWorkbenchShell();
|
||||
if (shell != null && shell.getDisplay() != null)
|
||||
shell.getDisplay().beep();
|
||||
}
|
||||
|
|
|
@ -13,9 +13,10 @@ import org.eclipse.core.resources.IContainer;
|
|||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
public class CoreUtility {
|
||||
|
||||
|
@ -47,8 +48,10 @@ public class CoreUtility {
|
|||
public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
|
||||
// If plugin has been loaded create extension.
|
||||
// Otherwise, show busy cursor then create extension.
|
||||
IPluginDescriptor plugin = element.getDeclaringExtension().getDeclaringPluginDescriptor();
|
||||
if (plugin.isPluginActivated()) {
|
||||
|
||||
String id = element.getDeclaringExtension().getNamespace();
|
||||
Bundle bundle = Platform.getBundle(id);
|
||||
if(bundle.getState() == org.osgi.framework.Bundle.ACTIVE) {
|
||||
return element.createExecutableExtension(classAttribute);
|
||||
} else {
|
||||
final Object[] ret = new Object[1];
|
||||
|
|
|
@ -7,7 +7,6 @@ package org.eclipse.cdt.internal.ui.util;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
|
|
|
@ -155,7 +155,7 @@ public class Resources {
|
|||
private static IStatus addOutOfSync(IStatus status, IResource resource) {
|
||||
IStatus entry= new Status(
|
||||
IStatus.ERROR,
|
||||
ResourcesPlugin.getPlugin().getDescriptor().getUniqueIdentifier(),
|
||||
ResourcesPlugin.getPlugin().getBundle().getSymbolicName(),
|
||||
IResourceStatus.OUT_OF_SYNC_LOCAL,
|
||||
CorextMessages.getFormattedString("Resources.outOfSync", resource.getFullPath().toString()), //$NON-NLS-1$
|
||||
null);
|
||||
|
@ -166,7 +166,7 @@ public class Resources {
|
|||
return status;
|
||||
} else {
|
||||
MultiStatus result= new MultiStatus(
|
||||
ResourcesPlugin.getPlugin().getDescriptor().getUniqueIdentifier(),
|
||||
ResourcesPlugin.getPlugin().getBundle().getSymbolicName(),
|
||||
IResourceStatus.OUT_OF_SYNC_LOCAL,
|
||||
CorextMessages.getString("Resources.outOfSyncResources"), null); //$NON-NLS-1$
|
||||
result.add(status);
|
||||
|
|
|
@ -18,10 +18,8 @@ import org.eclipse.cdt.core.model.ICContainer;
|
|||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.IMethod;
|
||||
import org.eclipse.cdt.core.model.ISourceRoot;
|
||||
import org.eclipse.cdt.core.model.IStructure;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.corext.util.CModelUtil;
|
||||
import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.internal.ui.viewsupport;
|
|||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.ui.help.WorkbenchHelp;
|
||||
import org.eclipse.cdt.ui.actions.MemberFilterActionGroup;;
|
||||
import org.eclipse.cdt.ui.actions.MemberFilterActionGroup;
|
||||
|
||||
/**
|
||||
* Action used to enable / disable method filter properties
|
||||
|
|
|
@ -214,7 +214,7 @@ public class LinkToFileGroup extends StringButtonDialogField {
|
|||
private IStatus createStatus(int severity, String message) {
|
||||
return new Status(
|
||||
severity,
|
||||
WorkbenchPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
|
||||
WorkbenchPlugin.getDefault().getBundle().getSymbolicName(),
|
||||
severity,
|
||||
message,
|
||||
null);
|
||||
|
|
|
@ -18,8 +18,8 @@ import org.eclipse.cdt.core.model.ICProject;
|
|||
import org.eclipse.cdt.core.model.IFunction;
|
||||
import org.eclipse.cdt.core.model.IFunctionDeclaration;
|
||||
import org.eclipse.cdt.core.model.IInclude;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.core.model.IIncludeReference;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.core.model.IMacro;
|
||||
import org.eclipse.cdt.core.model.IMethod;
|
||||
import org.eclipse.cdt.core.model.IMethodDeclaration;
|
||||
|
@ -34,7 +34,6 @@ import org.eclipse.cdt.internal.ui.cview.LibraryRefContainer;
|
|||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IStorage;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
|
|
@ -33,16 +33,11 @@ import org.eclipse.cdt.internal.ui.ICStatusConstants;
|
|||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||
import org.eclipse.cdt.internal.ui.ResourceAdapterFactory;
|
||||
import org.eclipse.cdt.internal.ui.buildconsole.BuildConsoleManager;
|
||||
import org.eclipse.cdt.internal.ui.cview.CView;
|
||||
import org.eclipse.cdt.internal.ui.editor.CDocumentProvider;
|
||||
import org.eclipse.cdt.internal.ui.editor.CustomBufferFactory;
|
||||
import org.eclipse.cdt.internal.ui.editor.SharedTextColors;
|
||||
import org.eclipse.cdt.internal.ui.editor.WorkingCopyManager;
|
||||
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools;
|
||||
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.preferences.CEditorPreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.preferences.WorkInProgressPreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.text.CTextTools;
|
||||
import org.eclipse.cdt.internal.ui.text.PreferencesAdapter;
|
||||
import org.eclipse.cdt.internal.ui.text.c.hover.CEditorTextHoverDescriptor;
|
||||
|
@ -55,7 +50,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdapterManager;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
|
@ -77,7 +71,7 @@ import org.eclipse.ui.editors.text.EditorsUI;
|
|||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
|
||||
import org.eclipse.ui.texteditor.ConfigurationElementSorter;
|
||||
import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
public class CUIPlugin extends AbstractUIPlugin {
|
||||
|
||||
|
@ -300,12 +294,10 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
private ResourceAdapterFactory fResourceAdapterFactory;
|
||||
private CElementAdapterFactory fCElementAdapterFactory;
|
||||
|
||||
|
||||
public CUIPlugin(IPluginDescriptor descriptor) {
|
||||
super(descriptor);
|
||||
public CUIPlugin() {
|
||||
fgCPlugin = this;
|
||||
fDocumentProvider = null;
|
||||
fTextTools = null;
|
||||
fTextTools = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -356,11 +348,27 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
return fBuildConsoleManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Plugin#shutdown
|
||||
/* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void shutdown() throws CoreException {
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
|
||||
//Set debug tracing options
|
||||
configurePluginDebugOptions();
|
||||
|
||||
registerAdapters();
|
||||
AllTypesCache.initialize(new IWorkingCopyProvider() {
|
||||
public IWorkingCopy[] getWorkingCopies() {
|
||||
return CUIPlugin.getSharedWorkingCopies();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
AllTypesCache.terminate();
|
||||
|
||||
if (fTextTools != null) {
|
||||
|
@ -387,54 +395,7 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
Refactoring.getUndoManager().shutdown();
|
||||
|
||||
// Do this last.
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
private void runUI(Runnable run) {
|
||||
Display display;
|
||||
display = Display.getCurrent();
|
||||
if (display == null) {
|
||||
display = Display.getDefault();
|
||||
display.asyncExec(run);
|
||||
}
|
||||
else {
|
||||
run.run();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Plugin#startup
|
||||
*/
|
||||
public void startup() throws CoreException {
|
||||
super.startup();
|
||||
//Set debug tracing options
|
||||
CUIPlugin.getDefault().configurePluginDebugOptions();
|
||||
|
||||
registerAdapters();
|
||||
AllTypesCache.initialize(new IWorkingCopyProvider() {
|
||||
public IWorkingCopy[] getWorkingCopies() {
|
||||
return CUIPlugin.getSharedWorkingCopies();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see AbstractUIPlugin#initializeDefaultPreferences
|
||||
*/
|
||||
protected void initializeDefaultPreferences(final IPreferenceStore store) {
|
||||
super.initializeDefaultPreferences(store);
|
||||
MarkerAnnotationPreferences.initializeDefaultValues(store);
|
||||
PreferenceConstants.initializeDefaultValues(store);
|
||||
EditorsUI.useAnnotationsPreferencePage(store);
|
||||
runUI(new Runnable() {
|
||||
public void run() {
|
||||
CPluginPreferencePage.initDefaults(store);
|
||||
CEditorPreferencePage.initDefaults(store);
|
||||
CView.initDefaults(store);
|
||||
BuildConsolePreferencePage.initDefaults(store);
|
||||
WorkInProgressPreferencePage.initDefaults(store);
|
||||
}
|
||||
});
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
public CoreModel getCoreModel() {
|
||||
|
@ -486,8 +447,7 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
}
|
||||
|
||||
public void configurePluginDebugOptions(){
|
||||
|
||||
if(CUIPlugin.getDefault().isDebugging()){
|
||||
if(isDebugging()){
|
||||
String option = Platform.getDebugOption(CONTENTASSIST);
|
||||
if(option != null) Util.VERBOSE_CONTENTASSIST = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
/***********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v0.5
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.ui;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.cview.CView;
|
||||
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.preferences.CEditorPreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage;
|
||||
import org.eclipse.cdt.internal.ui.preferences.WorkInProgressPreferencePage;
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.ui.editors.text.EditorsUI;
|
||||
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
|
||||
|
||||
/**
|
||||
* This class implements the setting of the CUI initial preference store settings.
|
||||
*/
|
||||
public class CUIPreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
|
||||
*/
|
||||
public void initializeDefaultPreferences() {
|
||||
final IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore();
|
||||
|
||||
PreferenceConstants.initializeDefaultValues(store);
|
||||
EditorsUI.useAnnotationsPreferencePage(store);
|
||||
PreferenceConstants.initializeDefaultValues(store);
|
||||
EditorsUI.useAnnotationsPreferencePage(store);
|
||||
AbstractDecoratedTextEditorPreferenceConstants.initializeDefaultValues(store);
|
||||
CPluginPreferencePage.initDefaults(store);
|
||||
BuildConsolePreferencePage.initDefaults(store);
|
||||
WorkInProgressPreferencePage.initDefaults(store);
|
||||
CView.initDefaults(store);
|
||||
CEditorPreferencePage.initDefaults(store);
|
||||
}
|
||||
|
||||
}
|
|
@ -523,7 +523,7 @@ public class CustomFiltersActionGroup extends ActionGroup {
|
|||
StringTokenizer tokenizer= new StringTokenizer(lruFilterIds, SEPARATOR);
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
String id= tokenizer.nextToken();
|
||||
if (fFilterDescriptorMap.containsKey(id) && !fLRUFilterIdsStack.contains(id));
|
||||
if (fFilterDescriptorMap.containsKey(id) && !fLRUFilterIdsStack.contains(id))
|
||||
fLRUFilterIdsStack.push(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ import org.eclipse.cdt.utils.ui.controls.TabFolderLayout;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
|
@ -64,8 +64,7 @@ public abstract class AbstractBinaryParserPage extends AbstractCOptionPage {
|
|||
private void initializeParserPageMap() {
|
||||
fParserPageMap = new HashMap(5);
|
||||
|
||||
IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor();
|
||||
IExtensionPoint extensionPoint = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "BinaryParserPage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
|
||||
for (int i = 0; i < infos.length; i++) {
|
||||
if (infos[i].getName().equals("parserPage")) { //$NON-NLS-1$
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.core.runtime.IExtension;
|
|||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
|
@ -146,7 +147,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
|
|||
|
||||
protected void initMapParsers() {
|
||||
mapParsers.clear();
|
||||
IExtensionPoint point = CCorePlugin.getDefault().getDescriptor().getExtensionPoint(CCorePlugin.ERROR_PARSER_SIMPLE_ID);
|
||||
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, CCorePlugin.ERROR_PARSER_SIMPLE_ID);
|
||||
if (point != null) {
|
||||
IExtension[] exts = point.getExtensions();
|
||||
for (int i = 0; i < exts.length; i++) {
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.core.runtime.IExtension;
|
|||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
|
@ -142,7 +143,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
}
|
||||
|
||||
private void initializeParserList() {
|
||||
IExtensionPoint point = CCorePlugin.getDefault().getDescriptor().getExtensionPoint(CCorePlugin.BINARY_PARSER_SIMPLE_ID);
|
||||
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, CCorePlugin.BINARY_PARSER_SIMPLE_ID);
|
||||
if (point != null) {
|
||||
IExtension[] exts = point.getExtensions();
|
||||
configMap = new HashMap(exts.length);
|
||||
|
|
|
@ -23,9 +23,9 @@ import org.eclipse.core.resources.IProject;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -73,8 +73,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj);
|
||||
ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
if (cext.length > 0) {
|
||||
IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor();
|
||||
IExtensionPoint point = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$
|
||||
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "BinaryParserPage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = point.getConfigurationElements();
|
||||
for (int i = 0; i < infos.length; i++) {
|
||||
String id = infos[i].getAttribute("parserID"); //$NON-NLS-1$
|
||||
|
|
|
@ -23,9 +23,9 @@ import org.eclipse.core.resources.IProject;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -70,8 +70,7 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj);
|
||||
ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
if (cext.length > 0) {
|
||||
IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor();
|
||||
IExtensionPoint point = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$
|
||||
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "BinaryParserPage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = point.getConfigurationElements();
|
||||
for (int i = 0; i < infos.length; i++) {
|
||||
String id = infos[i].getAttribute("parserID"); //$NON-NLS-1$
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.eclipse.core.resources.IWorkspace;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||
import org.eclipse.jface.viewers.CheckboxTableViewer;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
|
@ -44,8 +45,8 @@ import org.eclipse.swt.widgets.Event;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.ide.IDE;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -366,7 +367,7 @@ public abstract class ConvertProjectWizardPage
|
|||
public Image getColumnImage(Object obj, int index) {
|
||||
|
||||
return PlatformUI.getWorkbench().getSharedImages().getImage(
|
||||
ISharedImages.IMG_OBJ_PROJECT);
|
||||
IDE.SharedImages.IMG_OBJ_PROJECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -448,13 +449,14 @@ public abstract class ConvertProjectWizardPage
|
|||
throws CoreException {
|
||||
monitor.beginTask(CUIPlugin.getResourceString(KEY_CONVERTING),
|
||||
selected.length);
|
||||
|
||||
for (int i = 0; i < selected.length; i++) {
|
||||
|
||||
IProject project = (IProject)selected[i];
|
||||
convertProject(project, monitor, projectID);
|
||||
monitor.worked(1);
|
||||
}
|
||||
try {
|
||||
for (int i = 0; i < selected.length; i++) {
|
||||
IProject project = (IProject)selected[i];
|
||||
convertProject(project, new SubProgressMonitor(monitor, 1), projectID);
|
||||
}
|
||||
} finally {
|
||||
monitor.done();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue