mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix annotations in overview bar, added index IProblem markers, added new preference page for controlling external search markers
This commit is contained in:
parent
5cfae571a1
commit
5c3d8fdb41
16 changed files with 480 additions and 72 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-03-31 Bogdan Gheorghe
|
||||||
|
Modified SourceIndexer and SourceIndexerRequestor to place IProblem markers
|
||||||
|
on resources.
|
||||||
|
|
||||||
2004-03-15 Andrew Niefer
|
2004-03-15 Andrew Niefer
|
||||||
updated SourceIndexerRequestor with acceptTemplateParameterReference
|
updated SourceIndexerRequestor with acceptTemplateParameterReference
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,8 @@ public class SourceIndexer extends AbstractIndexer {
|
||||||
// Add the name of the file to the index
|
// Add the name of the file to the index
|
||||||
output.addDocument(document);
|
output.addDocument(document);
|
||||||
// Create a new Parser
|
// Create a new Parser
|
||||||
SourceIndexerRequestor requestor = new SourceIndexerRequestor(this, document);
|
SourceIndexerRequestor requestor = new SourceIndexerRequestor(this, resourceFile);
|
||||||
|
requestor.removeMarkers(resourceFile);
|
||||||
|
|
||||||
//Get the scanner info
|
//Get the scanner info
|
||||||
IProject currentProject = resourceFile.getProject();
|
IProject currentProject = resourceFile.getProject();
|
||||||
|
|
|
@ -18,6 +18,8 @@ package org.eclipse.cdt.internal.core.search.indexing;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
|
import org.eclipse.cdt.core.model.ICModelMarker;
|
||||||
import org.eclipse.cdt.core.parser.DefaultProblemHandler;
|
import org.eclipse.cdt.core.parser.DefaultProblemHandler;
|
||||||
import org.eclipse.cdt.core.parser.IProblem;
|
import org.eclipse.cdt.core.parser.IProblem;
|
||||||
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
||||||
|
@ -58,7 +60,12 @@ import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
|
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
|
import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
|
||||||
import org.eclipse.cdt.internal.core.index.IDocument;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
import org.eclipse.core.resources.IMarker;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bgheorgh
|
* @author bgheorgh
|
||||||
|
@ -69,7 +76,7 @@ import org.eclipse.cdt.internal.core.index.IDocument;
|
||||||
public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants {
|
public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants {
|
||||||
|
|
||||||
SourceIndexer indexer;
|
SourceIndexer indexer;
|
||||||
IDocument document;
|
IFile resourceFile;
|
||||||
|
|
||||||
char[] packageName;
|
char[] packageName;
|
||||||
char[][] enclosingTypeNames = new char[5][];
|
char[][] enclosingTypeNames = new char[5][];
|
||||||
|
@ -79,15 +86,39 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
|
||||||
private IASTInclusion currentInclude = null;
|
private IASTInclusion currentInclude = null;
|
||||||
private LinkedList includeStack = new LinkedList();
|
private LinkedList includeStack = new LinkedList();
|
||||||
|
|
||||||
public SourceIndexerRequestor(SourceIndexer indexer, IDocument document) {
|
public SourceIndexerRequestor(SourceIndexer indexer, IFile resourceFile) {
|
||||||
super();
|
super();
|
||||||
this.indexer = indexer;
|
this.indexer = indexer;
|
||||||
this.document= document;
|
this.resourceFile = resourceFile;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem)
|
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem)
|
||||||
*/
|
*/
|
||||||
public boolean acceptProblem(IProblem problem) {
|
public boolean acceptProblem(IProblem problem) {
|
||||||
|
|
||||||
|
IASTInclusion include = peekInclude();
|
||||||
|
IFile tempFile = resourceFile;
|
||||||
|
int lineNumber = problem.getSourceLineNumber();
|
||||||
|
|
||||||
|
//If we are in an include file, get the include file
|
||||||
|
if (include != null){
|
||||||
|
|
||||||
|
IPath newPath = new Path(include.getFullFileName());
|
||||||
|
IPath problemPath = new Path(new String(problem.getOriginatingFileName()));
|
||||||
|
|
||||||
|
|
||||||
|
tempFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(newPath);
|
||||||
|
//Needed for external files
|
||||||
|
if (tempFile == null)
|
||||||
|
tempFile = resourceFile;
|
||||||
|
|
||||||
|
if (!newPath.equals(problemPath)){
|
||||||
|
lineNumber = include.getStartingLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addMarkers(tempFile,problem, lineNumber);
|
||||||
|
|
||||||
return DefaultProblemHandler.ruleOnProblem( problem, ParserMode.COMPLETE_PARSE );
|
return DefaultProblemHandler.ruleOnProblem( problem, ParserMode.COMPLETE_PARSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,6 +219,15 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
|
||||||
*/
|
*/
|
||||||
public void enterInclusion(IASTInclusion inclusion) {
|
public void enterInclusion(IASTInclusion inclusion) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
IPath newPath = new Path(inclusion.getFullFileName());
|
||||||
|
IFile tempFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(newPath);
|
||||||
|
if (tempFile !=null){
|
||||||
|
removeMarkers(tempFile);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
//File is out of workspace
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
IASTInclusion parent = peekInclude();
|
IASTInclusion parent = peekInclude();
|
||||||
indexer.addInclude(inclusion, parent);
|
indexer.addInclude(inclusion, parent);
|
||||||
|
@ -491,6 +531,59 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
|
||||||
public Reader createReader(String finalPath) {
|
public Reader createReader(String finalPath) {
|
||||||
return ParserUtil.createReader(finalPath);
|
return ParserUtil.createReader(finalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void removeMarkers(IFile resource) {
|
||||||
|
int depth = IResource.DEPTH_INFINITE;
|
||||||
|
try {
|
||||||
|
resource.deleteMarkers(ICModelMarker.INDEXER_MARKER, true, depth);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
// something went wrong
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addMarkers(IFile tempFile, IProblem problem, int lineNumber){
|
||||||
|
try {
|
||||||
|
IMarker[] markers = tempFile.findMarkers(ICModelMarker.INDEXER_MARKER, true,IResource.DEPTH_INFINITE);
|
||||||
|
|
||||||
|
boolean newProblem = true;
|
||||||
|
|
||||||
|
if (markers.length > 0){
|
||||||
|
IMarker tempMarker = null;
|
||||||
|
Integer tempInt = null;
|
||||||
|
String tempMsgString = null;
|
||||||
|
|
||||||
|
for (int i=0; i<markers.length; i++){
|
||||||
|
tempMarker = markers[i];
|
||||||
|
tempInt = (Integer) tempMarker.getAttribute(IMarker.LINE_NUMBER);
|
||||||
|
tempMsgString = (String) tempMarker.getAttribute(IMarker.MESSAGE);
|
||||||
|
if (tempInt.intValue()==problem.getSourceLineNumber() &&
|
||||||
|
tempMsgString.equals(problem.getMessage())){
|
||||||
|
newProblem = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newProblem){
|
||||||
|
IMarker marker = tempFile.createMarker(ICModelMarker.INDEXER_MARKER);
|
||||||
|
|
||||||
|
marker.setAttribute(IMarker.LOCATION, problem.getSourceLineNumber());
|
||||||
|
marker.setAttribute(IMarker.MESSAGE, /*"Resource File: " + resourceFile.getName() + " - " +*/ problem.getMessage());
|
||||||
|
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
|
||||||
|
marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
|
||||||
|
marker.setAttribute(IMarker.CHAR_START,-1);
|
||||||
|
marker.setAttribute(IMarker.CHAR_END, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (CoreException e) {
|
||||||
|
// You need to handle the cases where attribute value is rejected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#parserTimeout()
|
* @see org.eclipse.cdt.core.parser.ISourceElementRequestor#parserTimeout()
|
||||||
*/
|
*/
|
||||||
|
@ -498,4 +591,5 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,8 @@ public interface ICModelMarker {
|
||||||
* option <code>"org.eclipse.cdt.core.translation.taskTag"</code>.
|
* option <code>"org.eclipse.cdt.core.translation.taskTag"</code>.
|
||||||
*/
|
*/
|
||||||
public static final String TASK_MARKER = CCorePlugin.PLUGIN_ID + ".task"; //$NON-NLS-1$
|
public static final String TASK_MARKER = CCorePlugin.PLUGIN_ID + ".task"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
public static final String INDEXER_MARKER = CCorePlugin.PLUGIN_ID + ".indexermarker"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ ErrorParser.name=Error Parser
|
||||||
|
|
||||||
CTaskName=C/C++ Task
|
CTaskName=C/C++ Task
|
||||||
|
|
||||||
|
IndexerMarker=Indexer Marker
|
||||||
|
|
||||||
ElfParser.name=Elf Parser
|
ElfParser.name=Elf Parser
|
||||||
GNUElfParser.name=GNU Elf Parser
|
GNUElfParser.name=GNU Elf Parser
|
||||||
PEWindowsParser.name=PE Windows Parser
|
PEWindowsParser.name=PE Windows Parser
|
||||||
|
|
|
@ -268,5 +268,19 @@
|
||||||
value="true">
|
value="true">
|
||||||
</persistent>
|
</persistent>
|
||||||
</extension>
|
</extension>
|
||||||
|
<extension
|
||||||
|
id="indexermarker"
|
||||||
|
name="%IndexerMarker"
|
||||||
|
point="org.eclipse.core.resources.markers">
|
||||||
|
<super
|
||||||
|
type="org.eclipse.core.resources.problemmarker">
|
||||||
|
</super>
|
||||||
|
<persistent
|
||||||
|
value="true">
|
||||||
|
</persistent>
|
||||||
|
<super
|
||||||
|
type="org.eclipse.core.resources.textmarker">
|
||||||
|
</super>
|
||||||
|
</extension>
|
||||||
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
2004-03-31 Bogdan Gheorghe
|
||||||
|
Fixed the overview annotations in the Overview bar in the CEditor
|
||||||
|
Modified the CEditorPreferencePage to add the Index Marker annotation
|
||||||
|
Created a new Preference Page to contain the options for placing markers
|
||||||
|
on external files
|
||||||
|
Modified CSearchResultCollector to use external marker search prefs
|
||||||
|
|
||||||
|
* src/org/eclipse/cdt/internal/ui/editor/CEditor.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/search/CSearchPage.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java
|
||||||
|
* plugin.xml
|
||||||
|
|
||||||
2004-03-30 Bogdan Gheorghe
|
2004-03-30 Bogdan Gheorghe
|
||||||
|
|
||||||
Modified the AnnotationModel to solve all annotation refresh problems.
|
Modified the AnnotationModel to solve all annotation refresh problems.
|
||||||
|
|
|
@ -146,3 +146,5 @@ HideCFiles.description= Hides all C files
|
||||||
|
|
||||||
HideHeaderFiles.label= Header files
|
HideHeaderFiles.label= Header files
|
||||||
HideHeaderFiles.description= Hides all Header files
|
HideHeaderFiles.description= Hides all Header files
|
||||||
|
|
||||||
|
WorkInProgress.name=Work In Progress
|
|
@ -96,14 +96,6 @@
|
||||||
class="org.eclipse.cdt.internal.ui.filters.NonCElementFilter"
|
class="org.eclipse.cdt.internal.ui.filters.NonCElementFilter"
|
||||||
id="org.eclipse.cdt.internal.ui.CView.NonCElementFilter">
|
id="org.eclipse.cdt.internal.ui.CView.NonCElementFilter">
|
||||||
</filter>
|
</filter>
|
||||||
<!--filter
|
|
||||||
targetId="org.eclipse.cdt.ui.CView"
|
|
||||||
name="%HideHeaderFilter.label"
|
|
||||||
enabled="false"
|
|
||||||
description="%HideHeaderFilter.description"
|
|
||||||
class="org.eclipse.cdt.internal.ui.filters.HeaderFilter"
|
|
||||||
id="org.eclipse.cdt.internal.ui.CView.HeaderFilter">
|
|
||||||
</filter-->
|
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.perspectives">
|
point="org.eclipse.ui.perspectives">
|
||||||
|
@ -196,35 +188,35 @@
|
||||||
id="org.eclipse.cdt.ui.ceditor"
|
id="org.eclipse.cdt.ui.ceditor"
|
||||||
point="org.eclipse.ui.editors">
|
point="org.eclipse.ui.editors">
|
||||||
<editor
|
<editor
|
||||||
name="%CEditor.name"
|
|
||||||
default="true"
|
default="true"
|
||||||
icon="icons/full/obj16/c_file_obj.gif"
|
name="%CEditor.name"
|
||||||
extensions="c, cc, cpp, cxx"
|
extensions="c, cc, cpp, cxx"
|
||||||
contributorClass="org.eclipse.cdt.internal.ui.editor.CEditorActionContributor"
|
icon="icons/full/obj16/c_file_obj.gif"
|
||||||
class="org.eclipse.cdt.internal.ui.editor.CEditor"
|
class="org.eclipse.cdt.internal.ui.editor.CEditor"
|
||||||
|
contributorClass="org.eclipse.cdt.internal.ui.editor.CEditorActionContributor"
|
||||||
id="org.eclipse.cdt.ui.editor.CEditor">
|
id="org.eclipse.cdt.ui.editor.CEditor">
|
||||||
</editor>
|
</editor>
|
||||||
<editor
|
<editor
|
||||||
name="%CEditor.name"
|
|
||||||
default="true"
|
default="true"
|
||||||
icon="icons/full/obj16/h_file_obj.gif"
|
name="%CEditor.name"
|
||||||
extensions="h, hh, hpp"
|
extensions="h, hh, hpp"
|
||||||
contributorClass="org.eclipse.cdt.internal.ui.editor.CEditorActionContributor"
|
icon="icons/full/obj16/h_file_obj.gif"
|
||||||
class="org.eclipse.cdt.internal.ui.editor.CEditor"
|
class="org.eclipse.cdt.internal.ui.editor.CEditor"
|
||||||
|
contributorClass="org.eclipse.cdt.internal.ui.editor.CEditorActionContributor"
|
||||||
id="org.eclipse.cdt.ui.editor.CEditor">
|
id="org.eclipse.cdt.ui.editor.CEditor">
|
||||||
</editor>
|
</editor>
|
||||||
<editor
|
<editor
|
||||||
name="%Editors.DefaultTextEditor"
|
name="%Editors.DefaultTextEditor"
|
||||||
icon="icons/full/obj16/file_obj.gif"
|
|
||||||
extensions="mk"
|
extensions="mk"
|
||||||
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
|
icon="icons/full/obj16/file_obj.gif"
|
||||||
class="org.eclipse.ui.editors.text.TextEditor"
|
class="org.eclipse.ui.editors.text.TextEditor"
|
||||||
|
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
|
||||||
id="org.eclipse.ui.DefaultTextEditor">
|
id="org.eclipse.ui.DefaultTextEditor">
|
||||||
</editor>
|
</editor>
|
||||||
<editor
|
<editor
|
||||||
name="%AsmEditor.name"
|
name="%AsmEditor.name"
|
||||||
icon="icons/full/obj16/c_file_obj.gif"
|
|
||||||
extensions="s"
|
extensions="s"
|
||||||
|
icon="icons/full/obj16/c_file_obj.gif"
|
||||||
class="org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor"
|
class="org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor"
|
||||||
id="org.eclipse.cdt.ui.editor.asm.AsmEditor">
|
id="org.eclipse.cdt.ui.editor.asm.AsmEditor">
|
||||||
</editor>
|
</editor>
|
||||||
|
@ -293,16 +285,16 @@
|
||||||
<action
|
<action
|
||||||
label="%AddTask.label"
|
label="%AddTask.label"
|
||||||
helpContextId="org.eclipse.ui.AddTask_action_context"
|
helpContextId="org.eclipse.ui.AddTask_action_context"
|
||||||
tooltip="%AddTask.tooltip"
|
|
||||||
class="org.eclipse.ui.texteditor.TaskRulerAction"
|
class="org.eclipse.ui.texteditor.TaskRulerAction"
|
||||||
|
tooltip="%AddTask.tooltip"
|
||||||
menubarPath="add"
|
menubarPath="add"
|
||||||
id="org.eclipse.ui.texteditor.TaskRulerAction">
|
id="org.eclipse.ui.texteditor.TaskRulerAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%AddBookmark.label"
|
label="%AddBookmark.label"
|
||||||
helpContextId="org.eclipse.ui.bookmark_action_context"
|
helpContextId="org.eclipse.ui.bookmark_action_context"
|
||||||
tooltip="%AddBookmark.tooltip"
|
|
||||||
class="org.eclipse.ui.texteditor.BookmarkRulerAction"
|
class="org.eclipse.ui.texteditor.BookmarkRulerAction"
|
||||||
|
tooltip="%AddBookmark.tooltip"
|
||||||
menubarPath="add"
|
menubarPath="add"
|
||||||
id="org.eclipse.ui.texteditor.BookmarkRulerAction">
|
id="org.eclipse.ui.texteditor.BookmarkRulerAction">
|
||||||
</action>
|
</action>
|
||||||
|
@ -313,16 +305,16 @@
|
||||||
<action
|
<action
|
||||||
label="%AddTask.label"
|
label="%AddTask.label"
|
||||||
helpContextId="org.eclipse.ui.AddTask_action_context"
|
helpContextId="org.eclipse.ui.AddTask_action_context"
|
||||||
tooltip="%AddTask.tooltip"
|
|
||||||
class="org.eclipse.ui.texteditor.TaskRulerAction"
|
class="org.eclipse.ui.texteditor.TaskRulerAction"
|
||||||
|
tooltip="%AddTask.tooltip"
|
||||||
menubarPath="add"
|
menubarPath="add"
|
||||||
id="org.eclipse.ui.texteditor.TaskRulerAction">
|
id="org.eclipse.ui.texteditor.TaskRulerAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%AddBookmark.label"
|
label="%AddBookmark.label"
|
||||||
helpContextId="org.eclipse.ui.bookmark_action_context"
|
helpContextId="org.eclipse.ui.bookmark_action_context"
|
||||||
tooltip="%AddBookmark.tooltip"
|
|
||||||
class="org.eclipse.ui.texteditor.BookmarkRulerAction"
|
class="org.eclipse.ui.texteditor.BookmarkRulerAction"
|
||||||
|
tooltip="%AddBookmark.tooltip"
|
||||||
menubarPath="add"
|
menubarPath="add"
|
||||||
id="org.eclipse.ui.texteditor.BookmarkRulerAction">
|
id="org.eclipse.ui.texteditor.BookmarkRulerAction">
|
||||||
</action>
|
</action>
|
||||||
|
@ -352,24 +344,24 @@
|
||||||
<action
|
<action
|
||||||
label="%OpenNewFileWizardAction.label"
|
label="%OpenNewFileWizardAction.label"
|
||||||
icon="icons/full/ctool16/newfile_wiz.gif"
|
icon="icons/full/ctool16/newfile_wiz.gif"
|
||||||
tooltip="%OpenNewFileWizardAction.tooltip"
|
|
||||||
class="org.eclipse.cdt.internal.ui.wizards.OpenNewFileWizardAction"
|
class="org.eclipse.cdt.internal.ui.wizards.OpenNewFileWizardAction"
|
||||||
|
tooltip="%OpenNewFileWizardAction.tooltip"
|
||||||
toolbarPath="Normal/FolderWizards"
|
toolbarPath="Normal/FolderWizards"
|
||||||
id="org.eclipse.cdt.ui.actions.OpenNewFileWizardAction">
|
id="org.eclipse.cdt.ui.actions.OpenNewFileWizardAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%OpenNewFolderWizardAction.label"
|
label="%OpenNewFolderWizardAction.label"
|
||||||
icon="icons/full/ctool16/newfolder_wiz.gif"
|
icon="icons/full/ctool16/newfolder_wiz.gif"
|
||||||
tooltip="%OpenNewFolderWizardAction.tooltip"
|
|
||||||
class="org.eclipse.cdt.internal.ui.wizards.OpenNewFolderWizardAction"
|
class="org.eclipse.cdt.internal.ui.wizards.OpenNewFolderWizardAction"
|
||||||
|
tooltip="%OpenNewFolderWizardAction.tooltip"
|
||||||
toolbarPath="Normal/FolderWizards"
|
toolbarPath="Normal/FolderWizards"
|
||||||
id="org.eclipse.cdt.ui.actions.OpenNewFolderWizardAction">
|
id="org.eclipse.cdt.ui.actions.OpenNewFolderWizardAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%OpenClassWizardAction.label"
|
label="%OpenClassWizardAction.label"
|
||||||
icon="icons/full/ctool16/newclass_wiz.gif"
|
icon="icons/full/ctool16/newclass_wiz.gif"
|
||||||
tooltip="%OpenClassWizardAction.tooltip"
|
|
||||||
class="org.eclipse.cdt.ui.actions.OpenClassWizardAction"
|
class="org.eclipse.cdt.ui.actions.OpenClassWizardAction"
|
||||||
|
tooltip="%OpenClassWizardAction.tooltip"
|
||||||
toolbarPath="Normal/FolderWizards"
|
toolbarPath="Normal/FolderWizards"
|
||||||
id="org.eclipse.cdt.ui.actions.OpenClassWizardAction">
|
id="org.eclipse.cdt.ui.actions.OpenClassWizardAction">
|
||||||
<enablement>
|
<enablement>
|
||||||
|
@ -410,8 +402,8 @@
|
||||||
</category>
|
</category>
|
||||||
<command
|
<command
|
||||||
name="%ActionDefinition.comment.name"
|
name="%ActionDefinition.comment.name"
|
||||||
description="%ActionDefinition.comment.description"
|
|
||||||
category="org.eclipse.cdt.ui.category.source"
|
category="org.eclipse.cdt.ui.category.source"
|
||||||
|
description="%ActionDefinition.comment.description"
|
||||||
id="org.eclipse.cdt.ui.edit.text.c.comment">
|
id="org.eclipse.cdt.ui.edit.text.c.comment">
|
||||||
</command>
|
</command>
|
||||||
<keyBinding
|
<keyBinding
|
||||||
|
@ -422,8 +414,8 @@
|
||||||
</keyBinding>
|
</keyBinding>
|
||||||
<command
|
<command
|
||||||
name="%ActionDefinition.uncomment.name"
|
name="%ActionDefinition.uncomment.name"
|
||||||
description="%ActionDefinition.uncomment.description"
|
|
||||||
category="org.eclipse.cdt.ui.category.source"
|
category="org.eclipse.cdt.ui.category.source"
|
||||||
|
description="%ActionDefinition.uncomment.description"
|
||||||
id="org.eclipse.cdt.ui.edit.text.c.uncomment">
|
id="org.eclipse.cdt.ui.edit.text.c.uncomment">
|
||||||
</command>
|
</command>
|
||||||
<keyBinding
|
<keyBinding
|
||||||
|
@ -434,8 +426,8 @@
|
||||||
</keyBinding>
|
</keyBinding>
|
||||||
<command
|
<command
|
||||||
name="%ActionDefinition.opendecl.name"
|
name="%ActionDefinition.opendecl.name"
|
||||||
description="%ActionDefinition.opendecl.description"
|
|
||||||
category="org.eclipse.cdt.ui.category.source"
|
category="org.eclipse.cdt.ui.category.source"
|
||||||
|
description="%ActionDefinition.opendecl.description"
|
||||||
id="org.eclipse.cdt.ui.edit.opendecl">
|
id="org.eclipse.cdt.ui.edit.opendecl">
|
||||||
</command>
|
</command>
|
||||||
<keyBinding
|
<keyBinding
|
||||||
|
@ -446,8 +438,8 @@
|
||||||
</keyBinding>
|
</keyBinding>
|
||||||
<command
|
<command
|
||||||
name="%ActionDefinition.openType.name"
|
name="%ActionDefinition.openType.name"
|
||||||
description="%ActionDefinition.openType.description"
|
|
||||||
category="org.eclipse.cdt.ui.category.source"
|
category="org.eclipse.cdt.ui.category.source"
|
||||||
|
description="%ActionDefinition.openType.description"
|
||||||
id="org.eclipse.cdt.ui.navigate.opentype">
|
id="org.eclipse.cdt.ui.navigate.opentype">
|
||||||
</command>
|
</command>
|
||||||
<keyBinding
|
<keyBinding
|
||||||
|
@ -458,8 +450,8 @@
|
||||||
</keyBinding>
|
</keyBinding>
|
||||||
<command
|
<command
|
||||||
name="%ActionDefinition.opencview.name"
|
name="%ActionDefinition.opencview.name"
|
||||||
category="org.eclipse.cdt.ui.category.source"
|
|
||||||
description="%ActionDefinition.opencview.description"
|
description="%ActionDefinition.opencview.description"
|
||||||
|
category="org.eclipse.cdt.ui.category.source"
|
||||||
id="org.eclipse.cdt.ui.edit.opencview">
|
id="org.eclipse.cdt.ui.edit.opencview">
|
||||||
</command>
|
</command>
|
||||||
</extension>
|
</extension>
|
||||||
|
@ -470,8 +462,8 @@
|
||||||
<page
|
<page
|
||||||
showScopeSection="true"
|
showScopeSection="true"
|
||||||
label="%CSearchPage.label"
|
label="%CSearchPage.label"
|
||||||
icon="icons/full/obj16/csearch_obj.gif"
|
|
||||||
extensions="c:90,cpp:90, cxx:90, cc:90,C:90, h:90, hh:90, hpp:90, H:90"
|
extensions="c:90,cpp:90, cxx:90, cc:90,C:90, h:90, hh:90, hpp:90, H:90"
|
||||||
|
icon="icons/full/obj16/csearch_obj.gif"
|
||||||
class="org.eclipse.cdt.internal.ui.search.CSearchPage"
|
class="org.eclipse.cdt.internal.ui.search.CSearchPage"
|
||||||
sizeHint="460, 160"
|
sizeHint="460, 160"
|
||||||
id="org.eclipse.cdt.ui.CSearchPage">
|
id="org.eclipse.cdt.ui.CSearchPage">
|
||||||
|
@ -483,24 +475,24 @@
|
||||||
pageId="org.eclipse.cdt.ui.CSearchPage"
|
pageId="org.eclipse.cdt.ui.CSearchPage"
|
||||||
label="%ElementNameSorter.label"
|
label="%ElementNameSorter.label"
|
||||||
icon="icons/full/clcl16/search_sortmatch.gif"
|
icon="icons/full/clcl16/search_sortmatch.gif"
|
||||||
tooltip="%ElementNameSorter.tooltip"
|
|
||||||
class="org.eclipse.cdt.internal.ui.search.ElementNameSorter"
|
class="org.eclipse.cdt.internal.ui.search.ElementNameSorter"
|
||||||
|
tooltip="%ElementNameSorter.tooltip"
|
||||||
id="org.eclipse.cdt.search.internal.ui.ElementNameSorter">
|
id="org.eclipse.cdt.search.internal.ui.ElementNameSorter">
|
||||||
</sorter>
|
</sorter>
|
||||||
<sorter
|
<sorter
|
||||||
pageId="org.eclipse.cdt.ui.CSearchPage"
|
pageId="org.eclipse.cdt.ui.CSearchPage"
|
||||||
label="%ParentNameSorter.label"
|
label="%ParentNameSorter.label"
|
||||||
icon="icons/full/clcl16/search_sortmatch.gif"
|
icon="icons/full/clcl16/search_sortmatch.gif"
|
||||||
tooltip="%ParentNameSorter.tooltip"
|
|
||||||
class="org.eclipse.cdt.internal.ui.search.ParentNameSorter"
|
class="org.eclipse.cdt.internal.ui.search.ParentNameSorter"
|
||||||
|
tooltip="%ParentNameSorter.tooltip"
|
||||||
id="org.eclipse.cdt.search.internal.ui.ParentNameSorter">
|
id="org.eclipse.cdt.search.internal.ui.ParentNameSorter">
|
||||||
</sorter>
|
</sorter>
|
||||||
<sorter
|
<sorter
|
||||||
pageId="org.eclipse.cdt.ui.CSearchPage"
|
pageId="org.eclipse.cdt.ui.CSearchPage"
|
||||||
label="%PathNameSorter.label"
|
label="%PathNameSorter.label"
|
||||||
icon="icons/full/clcl16/search_sortmatch.gif"
|
icon="icons/full/clcl16/search_sortmatch.gif"
|
||||||
tooltip="%PathNameSorter.tooltip"
|
|
||||||
class="org.eclipse.cdt.internal.ui.search.PathNameSorter"
|
class="org.eclipse.cdt.internal.ui.search.PathNameSorter"
|
||||||
|
tooltip="%PathNameSorter.tooltip"
|
||||||
id="org.eclipse.cdt.search.internal.ui.PathNameSorter">
|
id="org.eclipse.cdt.search.internal.ui.PathNameSorter">
|
||||||
</sorter>
|
</sorter>
|
||||||
</extension>
|
</extension>
|
||||||
|
@ -553,16 +545,16 @@
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.cdt.ui.BinaryParserPage">
|
point="org.eclipse.cdt.ui.BinaryParserPage">
|
||||||
<parserPage
|
<parserPage
|
||||||
parserID="org.eclipse.cdt.core.GNU_ELF"
|
|
||||||
class="org.eclipse.cdt.ui.dialogs.GNUElfBinaryParserPage"
|
class="org.eclipse.cdt.ui.dialogs.GNUElfBinaryParserPage"
|
||||||
|
parserID="org.eclipse.cdt.core.GNU_ELF"
|
||||||
id="ElfBinaryParserPage">
|
id="ElfBinaryParserPage">
|
||||||
</parserPage>
|
</parserPage>
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.cdt.ui.BinaryParserPage">
|
point="org.eclipse.cdt.ui.BinaryParserPage">
|
||||||
<parserPage
|
<parserPage
|
||||||
parserID="org.eclipse.cdt.core.Cygwin_PE"
|
|
||||||
class="org.eclipse.cdt.ui.dialogs.CygwinPEBinaryParserPage"
|
class="org.eclipse.cdt.ui.dialogs.CygwinPEBinaryParserPage"
|
||||||
|
parserID="org.eclipse.cdt.core.Cygwin_PE"
|
||||||
id="PEBinaryParserPage">
|
id="PEBinaryParserPage">
|
||||||
</parserPage>
|
</parserPage>
|
||||||
</extension>
|
</extension>
|
||||||
|
@ -586,6 +578,43 @@
|
||||||
</description>
|
</description>
|
||||||
</fontDefinition>
|
</fontDefinition>
|
||||||
</extension>
|
</extension>
|
||||||
|
<extension
|
||||||
|
point="org.eclipse.ui.editors.markerAnnotationSpecification">
|
||||||
|
<specification
|
||||||
|
colorPreferenceValue="192,192,192"
|
||||||
|
annotationType="org.eclipse.cdt.ui.indexmarker"
|
||||||
|
verticalRulerPreferenceValue="false"
|
||||||
|
colorPreferenceKey="indexResultIndicationColor"
|
||||||
|
contributesToHeader="false"
|
||||||
|
overviewRulerPreferenceValue="false"
|
||||||
|
presentationLayer="3"
|
||||||
|
textStylePreferenceValue="NONE"
|
||||||
|
symbolicIcon="warning"
|
||||||
|
icon="icons/full/obj16/unknown_obj.gif"
|
||||||
|
label="Index Markers"
|
||||||
|
textPreferenceValue="false"
|
||||||
|
textPreferenceKey="indexResultIndication"
|
||||||
|
verticalRulerPreferenceKey="indexResultIndicationInVerticalRuler"
|
||||||
|
overviewRulerPreferenceKey="indexResultIndicationInOverviewRuler">
|
||||||
|
</specification>
|
||||||
|
</extension>
|
||||||
|
<extension
|
||||||
|
point="org.eclipse.ui.editors.annotationTypes">
|
||||||
|
<type
|
||||||
|
markerType="org.eclipse.cdt.core.indexermarker"
|
||||||
|
name="org.eclipse.cdt.ui.indexmarker">
|
||||||
|
</type>
|
||||||
|
</extension>
|
||||||
|
<extension
|
||||||
|
point="org.eclipse.ui.preferencePages">
|
||||||
|
<page
|
||||||
|
name="%WorkInProgress.name"
|
||||||
|
category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage"
|
||||||
|
class="org.eclipse.cdt.internal.ui.preferences.WorkInProgressPreferencePage"
|
||||||
|
id="org.eclipse.cdt.ui.preferneces.WorkInProgressPreferencePage">
|
||||||
|
</page>
|
||||||
|
</extension>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.propertyPages">
|
point="org.eclipse.ui.propertyPages">
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
|
|
||||||
/** Preference key for hyperlink enablement */
|
/** Preference key for hyperlink enablement */
|
||||||
public final static String HYPERLINK_ENABLED = "hyperlinkEnable"; //$NON-NLS-1$
|
public final static String HYPERLINK_ENABLED = "hyperlinkEnable"; //$NON-NLS-1$
|
||||||
|
|
||||||
private class PropertyChangeListener implements org.eclipse.core.runtime.Preferences.IPropertyChangeListener, org.eclipse.jface.util.IPropertyChangeListener {
|
private class PropertyChangeListener implements org.eclipse.core.runtime.Preferences.IPropertyChangeListener, org.eclipse.jface.util.IPropertyChangeListener {
|
||||||
/*
|
/*
|
||||||
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
|
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
|
||||||
|
@ -902,7 +902,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
fSourceViewerDecorationSupport =
|
fSourceViewerDecorationSupport =
|
||||||
new SourceViewerDecorationSupport(sourceViewer, fOverviewRuler, fAnnotationAccess, sharedColors);
|
new SourceViewerDecorationSupport(sourceViewer, fOverviewRuler, fAnnotationAccess, sharedColors);
|
||||||
|
|
||||||
getSourceViewerDecorationSupport(sourceViewer);
|
configureSourceViewerDecorationSupport(fSourceViewerDecorationSupport);
|
||||||
|
|
||||||
return sourceViewer;
|
return sourceViewer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
private ColorEditor fAnnotationForegroundColorEditor;
|
private ColorEditor fAnnotationForegroundColorEditor;
|
||||||
private List fAnnotationList;
|
private List fAnnotationList;
|
||||||
private Button fShowInOverviewRulerCheckBox;
|
private Button fShowInOverviewRulerCheckBox;
|
||||||
|
private Button fShowInVerticalRulerCheckBox;
|
||||||
private Button fShowInTextCheckBox;
|
private Button fShowInTextCheckBox;
|
||||||
|
|
||||||
public CEditorPreferencePage() {
|
public CEditorPreferencePage() {
|
||||||
|
@ -157,6 +158,12 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
|
||||||
overlayKeys.add(
|
overlayKeys.add(
|
||||||
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
|
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
|
||||||
|
|
||||||
|
String verticalKey = info.getVerticalRulerPreferenceKey();
|
||||||
|
if (verticalKey != null){
|
||||||
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, verticalKey));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_FOREGROUND));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_FOREGROUND));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT));
|
||||||
|
@ -208,7 +215,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CEditor.HYPERLINK_ENABLED));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CEditor.HYPERLINK_ENABLED));
|
||||||
|
|
||||||
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
|
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
|
||||||
overlayKeys.toArray(keys);
|
overlayKeys.toArray(keys);
|
||||||
return new OverlayPreferenceStore(getPreferenceStore(), keys);
|
return new OverlayPreferenceStore(getPreferenceStore(), keys);
|
||||||
|
@ -225,6 +232,14 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
AnnotationPreference info = (AnnotationPreference) e.next();
|
AnnotationPreference info = (AnnotationPreference) e.next();
|
||||||
store.setDefault(info.getTextPreferenceKey(), info.getTextPreferenceValue());
|
store.setDefault(info.getTextPreferenceKey(), info.getTextPreferenceValue());
|
||||||
store.setDefault(info.getOverviewRulerPreferenceKey(), info.getOverviewRulerPreferenceValue());
|
store.setDefault(info.getOverviewRulerPreferenceKey(), info.getOverviewRulerPreferenceValue());
|
||||||
|
|
||||||
|
String verticalRulerKey = info.getVerticalRulerPreferenceKey();
|
||||||
|
boolean verticalRulerPreference = info.getVerticalRulerPreferenceValue();
|
||||||
|
|
||||||
|
if (verticalRulerKey != null){
|
||||||
|
store.setDefault(verticalRulerKey,verticalRulerPreference);
|
||||||
|
}
|
||||||
|
|
||||||
PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue());
|
PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue());
|
||||||
}
|
}
|
||||||
store.setDefault(CEditor.MATCHING_BRACKETS, true);
|
store.setDefault(CEditor.MATCHING_BRACKETS, true);
|
||||||
|
@ -369,6 +384,13 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
gd.horizontalAlignment = GridData.BEGINNING;
|
gd.horizontalAlignment = GridData.BEGINNING;
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
fShowInOverviewRulerCheckBox.setLayoutData(gd);
|
fShowInOverviewRulerCheckBox.setLayoutData(gd);
|
||||||
|
|
||||||
|
fShowInVerticalRulerCheckBox = new Button(optionsComposite, SWT.CHECK);
|
||||||
|
fShowInVerticalRulerCheckBox.setText(PreferencesMessages.getString("CEditorPreferencePage.annotationsPage.showInVertical")); //$NON-NLS-1$
|
||||||
|
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
|
gd.horizontalAlignment = GridData.BEGINNING;
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
fShowInVerticalRulerCheckBox.setLayoutData(gd);
|
||||||
|
|
||||||
label = new Label(optionsComposite, SWT.LEFT);
|
label = new Label(optionsComposite, SWT.LEFT);
|
||||||
label.setText(PreferencesMessages.getString("CEditorPreferencePage.annotationsPage.color")); //$NON-NLS-1$
|
label.setText(PreferencesMessages.getString("CEditorPreferencePage.annotationsPage.color")); //$NON-NLS-1$
|
||||||
|
@ -415,6 +437,18 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
fOverlayStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection());
|
fOverlayStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fShowInVerticalRulerCheckBox.addSelectionListener(new SelectionListener() {
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
int i = fAnnotationList.getSelectionIndex();
|
||||||
|
String key = fAnnotationColorListModel[i][4];
|
||||||
|
fOverlayStore.setValue(key, fShowInVerticalRulerCheckBox.getSelection());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
foregroundColorButton.addSelectionListener(new SelectionListener() {
|
foregroundColorButton.addSelectionListener(new SelectionListener() {
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
@ -444,6 +478,11 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
|
|
||||||
key = fAnnotationColorListModel[i][3];
|
key = fAnnotationColorListModel[i][3];
|
||||||
fShowInOverviewRulerCheckBox.setSelection(fOverlayStore.getBoolean(key));
|
fShowInOverviewRulerCheckBox.setSelection(fOverlayStore.getBoolean(key));
|
||||||
|
|
||||||
|
key = fAnnotationColorListModel[i][4];
|
||||||
|
if (key != null){
|
||||||
|
fShowInVerticalRulerCheckBox.setSelection(fOverlayStore.getBoolean(key));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[][] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) {
|
private String[][] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) {
|
||||||
|
@ -456,7 +495,8 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
info.getPreferenceLabel(),
|
info.getPreferenceLabel(),
|
||||||
info.getColorPreferenceKey(),
|
info.getColorPreferenceKey(),
|
||||||
info.getTextPreferenceKey(),
|
info.getTextPreferenceKey(),
|
||||||
info.getOverviewRulerPreferenceKey()});
|
info.getOverviewRulerPreferenceKey(),
|
||||||
|
info.getVerticalRulerPreferenceKey()});
|
||||||
}
|
}
|
||||||
String[][] items = new String[listModelItems.size()][];
|
String[][] items = new String[listModelItems.size()][];
|
||||||
listModelItems.toArray(items);
|
listModelItems.toArray(items);
|
||||||
|
@ -761,6 +801,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP
|
||||||
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.printMargin"); //$NON-NLS-1$
|
label = PreferencesMessages.getString("CEditorPreferencePage.behaviorPage.printMargin"); //$NON-NLS-1$
|
||||||
addCheckBox(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, 0);
|
addCheckBox(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, 0);
|
||||||
|
|
||||||
|
|
||||||
Label l = new Label(behaviorComposite, SWT.LEFT);
|
Label l = new Label(behaviorComposite, SWT.LEFT);
|
||||||
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
|
|
|
@ -95,6 +95,7 @@ CEditorPreferencePage.cCommentTaskTags.others=Others
|
||||||
CEditorPreferencePage.annotationsPage.presentationOptions=Annotation Presentation Options
|
CEditorPreferencePage.annotationsPage.presentationOptions=Annotation Presentation Options
|
||||||
CEditorPreferencePage.annotationsPage.showInText=Show In Text
|
CEditorPreferencePage.annotationsPage.showInText=Show In Text
|
||||||
CEditorPreferencePage.annotationsPage.showInOverview=Show In Overview Ruler
|
CEditorPreferencePage.annotationsPage.showInOverview=Show In Overview Ruler
|
||||||
|
CEditorPreferencePage.annotationsPage.showInVertical=Show In Vertical Ruler
|
||||||
CEditorPreferencePage.annotationsPage.color=Annotations Color
|
CEditorPreferencePage.annotationsPage.color=Annotations Color
|
||||||
CEditorPreferencePage.colorPage.backgroundColor=Bac&kground Color:
|
CEditorPreferencePage.colorPage.backgroundColor=Bac&kground Color:
|
||||||
CEditorPreferencePage.colorPage.systemDefault=S&ystem Default
|
CEditorPreferencePage.colorPage.systemDefault=S&ystem Default
|
||||||
|
|
|
@ -0,0 +1,181 @@
|
||||||
|
/*
|
||||||
|
* Created on Mar 30, 2004
|
||||||
|
*
|
||||||
|
* TODO To change the template for this generated file go to
|
||||||
|
* Window - Preferences - Java - Code Generation - Code and Comments
|
||||||
|
*/
|
||||||
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.ui.search.CSearchPage;
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
import org.eclipse.jface.preference.PreferencePage;
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
import org.eclipse.swt.events.SelectionListener;
|
||||||
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
import org.eclipse.swt.widgets.Combo;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Group;
|
||||||
|
import org.eclipse.ui.IWorkbench;
|
||||||
|
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bgheorgh
|
||||||
|
*
|
||||||
|
* TODO To change the template for this generated type comment go to
|
||||||
|
* Window - Preferences - Java - Code Generation - Code and Comments
|
||||||
|
*/
|
||||||
|
public class WorkInProgressPreferencePage extends PreferencePage
|
||||||
|
implements
|
||||||
|
IWorkbenchPreferencePage {
|
||||||
|
|
||||||
|
private Combo fExternLinks;
|
||||||
|
private Button fExternEnabled;
|
||||||
|
|
||||||
|
protected OverlayPreferenceStore fOverlayStore;
|
||||||
|
|
||||||
|
public WorkInProgressPreferencePage(){
|
||||||
|
setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore());
|
||||||
|
fOverlayStore = createOverlayStore();
|
||||||
|
}
|
||||||
|
|
||||||
|
private OverlayPreferenceStore createOverlayStore() {
|
||||||
|
ArrayList overlayKeys = new ArrayList();
|
||||||
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CSearchPage.EXTERNALMATCH_ENABLED));
|
||||||
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, CSearchPage.EXTERNALMATCH_VISIBLE));
|
||||||
|
|
||||||
|
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
|
||||||
|
overlayKeys.toArray(keys);
|
||||||
|
return new OverlayPreferenceStore(getPreferenceStore(), keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
|
||||||
|
*/
|
||||||
|
protected Control createContents(Composite parent) {
|
||||||
|
fOverlayStore.load();
|
||||||
|
fOverlayStore.start();
|
||||||
|
|
||||||
|
initializeDialogUnits(parent);
|
||||||
|
|
||||||
|
Composite result= new Composite(parent, SWT.NONE);
|
||||||
|
GridLayout layout= new GridLayout();
|
||||||
|
layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
|
||||||
|
layout.marginWidth= 0;
|
||||||
|
layout.verticalSpacing= convertVerticalDLUsToPixels(10);
|
||||||
|
layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
|
||||||
|
result.setLayout(layout);
|
||||||
|
|
||||||
|
Group group= new Group(result, SWT.NONE);
|
||||||
|
group.setLayout(new GridLayout());
|
||||||
|
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
group.setText("External Search Links"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
fExternEnabled = createCheckButton(group, "Enable external search markers"); //$NON-NLS-1$
|
||||||
|
fExternEnabled.addSelectionListener(new SelectionListener() {
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
}
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
Button button = (Button) e.widget;
|
||||||
|
boolean externLinkEnabled = false;
|
||||||
|
fExternLinks.setEnabled(false);
|
||||||
|
if (button.getSelection()){
|
||||||
|
fExternLinks.setEnabled(true);
|
||||||
|
externLinkEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
fOverlayStore.setValue(CSearchPage.EXTERNALMATCH_ENABLED, externLinkEnabled);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
fExternLinks = createComboBox(group,"External Marker Link Type",new String[]{"Visible","Invisible"},"Visible"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||||
|
fExternLinks.addSelectionListener(new SelectionListener() {
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
}
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
Combo combo = (Combo) e.widget;
|
||||||
|
fOverlayStore.setValue(CSearchPage.EXTERNALMATCH_VISIBLE, combo.getSelectionIndex());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
initialize();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initialize(){
|
||||||
|
boolean extEnabled = fOverlayStore.getBoolean(CSearchPage.EXTERNALMATCH_ENABLED);
|
||||||
|
fExternEnabled.setSelection(extEnabled);
|
||||||
|
|
||||||
|
fExternLinks.select(fOverlayStore.getInt(CSearchPage.EXTERNALMATCH_VISIBLE));
|
||||||
|
fExternLinks.setEnabled(extEnabled);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
||||||
|
*/
|
||||||
|
public void init(IWorkbench workbench) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a button with the given label and sets the default
|
||||||
|
* configuration data.
|
||||||
|
*/
|
||||||
|
private Combo createComboBox( Composite parent, String label, String[] items, String selection )
|
||||||
|
{
|
||||||
|
ControlFactory.createLabel( parent, label );
|
||||||
|
Combo combo = ControlFactory.createSelectCombo( parent, items, selection );
|
||||||
|
combo.setLayoutData( new GridData() );
|
||||||
|
return combo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates a button with the given label and sets the default
|
||||||
|
* configuration data.
|
||||||
|
*/
|
||||||
|
private Button createCheckButton( Composite parent, String label )
|
||||||
|
{
|
||||||
|
Button button = new Button( parent, SWT.CHECK | SWT.LEFT );
|
||||||
|
button.setText( label );
|
||||||
|
// FieldEditor GridData
|
||||||
|
GridData data = new GridData();
|
||||||
|
button.setLayoutData( data );
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @see IPreferencePage#performOk()
|
||||||
|
*/
|
||||||
|
public boolean performOk() {
|
||||||
|
fOverlayStore.propagate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param store
|
||||||
|
*/
|
||||||
|
public static void initDefaults(IPreferenceStore store) {
|
||||||
|
store.setDefault(CSearchPage.EXTERNALMATCH_ENABLED, false);
|
||||||
|
store.setDefault(CSearchPage.EXTERNALMATCH_VISIBLE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @see PreferencePage#performDefaults()
|
||||||
|
*/
|
||||||
|
protected void performDefaults() {
|
||||||
|
fOverlayStore.loadDefaults();
|
||||||
|
initialize();
|
||||||
|
super.performDefaults();
|
||||||
|
}
|
||||||
|
}
|
|
@ -638,6 +638,11 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
|
||||||
private final static String PAGE_NAME= "CSearchPage"; //$NON-NLS-1$
|
private final static String PAGE_NAME= "CSearchPage"; //$NON-NLS-1$
|
||||||
private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; //$NON-NLS-1$
|
private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/** Preference key for external marker enablement */
|
||||||
|
public final static String EXTERNALMATCH_ENABLED = "externMatchEnable"; //$NON-NLS-1$
|
||||||
|
/** Preference key for external marker visibilty */
|
||||||
|
public final static String EXTERNALMATCH_VISIBLE = "externMatchVisible"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static List fgPreviousSearchPatterns = new ArrayList(20);
|
private static List fgPreviousSearchPatterns = new ArrayList(20);
|
||||||
|
|
||||||
private Button[] fSearchFor;
|
private Button[] fSearchFor;
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.cdt.core.search.BasicSearchMatch;
|
||||||
import org.eclipse.cdt.core.search.BasicSearchResultCollector;
|
import org.eclipse.cdt.core.search.BasicSearchResultCollector;
|
||||||
import org.eclipse.cdt.core.search.IMatch;
|
import org.eclipse.cdt.core.search.IMatch;
|
||||||
import org.eclipse.cdt.ui.CSearchResultLabelProvider;
|
import org.eclipse.cdt.ui.CSearchResultLabelProvider;
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -28,6 +29,7 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
import org.eclipse.search.ui.IGroupByKeyComputer;
|
import org.eclipse.search.ui.IGroupByKeyComputer;
|
||||||
import org.eclipse.search.ui.ISearchResultView;
|
import org.eclipse.search.ui.ISearchResultView;
|
||||||
import org.eclipse.search.ui.SearchUI;
|
import org.eclipse.search.ui.SearchUI;
|
||||||
|
@ -128,34 +130,46 @@ public class CSearchResultCollector extends BasicSearchResultCollector{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Create Link in referring file's project
|
//Check to see if external markers are enabled
|
||||||
IPath refLocation = searchMatch.getReferenceLocation();
|
IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore();
|
||||||
IFile refFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(refLocation);
|
if (store.getBoolean(CSearchPage.EXTERNALMATCH_ENABLED)){
|
||||||
IProject refProject = refFile.getProject();
|
//Create Link in referring file's project
|
||||||
IPath externalMatchLocation = searchMatch.getLocation();
|
IPath refLocation = searchMatch.getReferenceLocation();
|
||||||
IFile linksFile = refProject.getFile(externalMatchLocation.lastSegment());
|
IFile refFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(refLocation);
|
||||||
|
IProject refProject = refFile.getProject();
|
||||||
//Check to see if the file already exists - create if doesn't, mark team private
|
IPath externalMatchLocation = searchMatch.getLocation();
|
||||||
if (!linksFile.exists()){
|
IFile linksFile = refProject.getFile(externalMatchLocation.lastSegment());
|
||||||
linksFile.createLink(externalMatchLocation,IResource.NONE,null);
|
//Delete links file to keep up to date with latest prefs
|
||||||
//linksFile.setTeamPrivateMember(true);
|
if (linksFile.exists())
|
||||||
linksFile.setDerived(true);
|
linksFile.delete(true,null);
|
||||||
}
|
|
||||||
|
//Check to see if the file already exists - create if doesn't, mark team private
|
||||||
IMarker marker = linksFile.createMarker( SearchUI.SEARCH_MARKER );
|
if (!linksFile.exists()){
|
||||||
|
linksFile.createLink(externalMatchLocation,IResource.NONE,null);
|
||||||
HashMap markerAttributes = new HashMap( 2 );
|
int number = store.getInt(CSearchPage.EXTERNALMATCH_VISIBLE);
|
||||||
|
if (number==0){
|
||||||
markerAttributes.put( IMarker.CHAR_START, new Integer( Math.max( searchMatch.startOffset, 0 ) ) );
|
linksFile.setDerived(true);
|
||||||
markerAttributes.put( IMarker.CHAR_END, new Integer( Math.max( searchMatch.endOffset, 0 ) ) );
|
}
|
||||||
markerAttributes.put( IMATCH, searchMatch );
|
else{
|
||||||
|
linksFile.setTeamPrivateMember(true);
|
||||||
marker.setAttributes( markerAttributes );
|
}
|
||||||
|
|
||||||
if( _view != null ){
|
}
|
||||||
_view.addMatch( searchMatch.name, _computer.computeGroupByKey( marker ), linksFile, marker );
|
|
||||||
}
|
IMarker marker = linksFile.createMarker( SearchUI.SEARCH_MARKER );
|
||||||
|
|
||||||
|
HashMap markerAttributes = new HashMap( 2 );
|
||||||
|
|
||||||
|
markerAttributes.put( IMarker.CHAR_START, new Integer( Math.max( searchMatch.startOffset, 0 ) ) );
|
||||||
|
markerAttributes.put( IMarker.CHAR_END, new Integer( Math.max( searchMatch.endOffset, 0 ) ) );
|
||||||
|
markerAttributes.put( IMATCH, searchMatch );
|
||||||
|
|
||||||
|
marker.setAttributes( markerAttributes );
|
||||||
|
|
||||||
|
if( _view != null ){
|
||||||
|
_view.addMatch( searchMatch.name, _computer.computeGroupByKey( marker ), linksFile, marker );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_matchCount++;
|
_matchCount++;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools;
|
||||||
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
||||||
import org.eclipse.cdt.internal.ui.preferences.CEditorPreferencePage;
|
import org.eclipse.cdt.internal.ui.preferences.CEditorPreferencePage;
|
||||||
import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage;
|
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.CTextTools;
|
||||||
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||||
import org.eclipse.cdt.internal.ui.util.ProblemMarkerManager;
|
import org.eclipse.cdt.internal.ui.util.ProblemMarkerManager;
|
||||||
|
@ -68,6 +69,7 @@ import org.eclipse.ui.IWorkbench;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||||
|
import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
|
||||||
|
|
||||||
public class CUIPlugin extends AbstractUIPlugin {
|
public class CUIPlugin extends AbstractUIPlugin {
|
||||||
|
|
||||||
|
@ -345,6 +347,7 @@ public class CUIPlugin extends AbstractUIPlugin {
|
||||||
*/
|
*/
|
||||||
protected void initializeDefaultPreferences(final IPreferenceStore store) {
|
protected void initializeDefaultPreferences(final IPreferenceStore store) {
|
||||||
super.initializeDefaultPreferences(store);
|
super.initializeDefaultPreferences(store);
|
||||||
|
MarkerAnnotationPreferences.initializeDefaultValues(store);
|
||||||
PreferenceConstants.initializeDefaultValues(store);
|
PreferenceConstants.initializeDefaultValues(store);
|
||||||
|
|
||||||
runUI(new Runnable() {
|
runUI(new Runnable() {
|
||||||
|
@ -353,6 +356,7 @@ public class CUIPlugin extends AbstractUIPlugin {
|
||||||
CEditorPreferencePage.initDefaults(store);
|
CEditorPreferencePage.initDefaults(store);
|
||||||
CView.initDefaults(store);
|
CView.initDefaults(store);
|
||||||
BuildConsolePreferencePage.initDefaults(store);
|
BuildConsolePreferencePage.initDefaults(store);
|
||||||
|
WorkInProgressPreferencePage.initDefaults(store);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue