mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Increased warning levels for ui-plugin, fixed warnings.
This commit is contained in:
parent
89abaeb3e8
commit
a14a63c060
581 changed files with 2607 additions and 528 deletions
|
@ -1,6 +1,6 @@
|
|||
#Thu Jan 31 11:29:21 MSK 2008
|
||||
#Wed Apr 09 11:35:31 CEST 2008
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
|
@ -17,7 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
|
|||
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
|
@ -25,7 +25,7 @@ org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
|||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
|
@ -34,25 +34,26 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
|
|||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
|
@ -61,10 +62,11 @@ org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
|||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
*
|
||||
* @deprecated Use {@link ElementSelectionDialog} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class OpenTypeDialog extends ElementSelectionDialog {
|
||||
|
||||
/**
|
||||
|
|
|
@ -75,7 +75,7 @@ public class AddIncludesOperation implements IWorkspaceRunnable {
|
|||
|
||||
monitor.beginTask(CEditorMessages.getString("AddIncludesOperation.description"), 2); //$NON-NLS-1$
|
||||
|
||||
List elements = fTranslationUnit.getChildrenOfType(ICElement.C_INCLUDE);
|
||||
List<?> elements = fTranslationUnit.getChildrenOfType(ICElement.C_INCLUDE);
|
||||
for (int i = 0; i < fIncludes.length; ++i) {
|
||||
String name = fIncludes[i].getIncludeName();
|
||||
boolean found = false;
|
||||
|
@ -129,7 +129,7 @@ public class AddIncludesOperation implements IWorkspaceRunnable {
|
|||
|
||||
monitor.beginTask(CEditorMessages.getString("AddIncludesOperation.description"), 2); //$NON-NLS-1$
|
||||
|
||||
List elements = fTranslationUnit.getChildrenOfType(ICElement.C_USING);
|
||||
List<?> elements = fTranslationUnit.getChildrenOfType(ICElement.C_USING);
|
||||
for (int i = 0; i < fUsings.length; ++i) {
|
||||
String name = fUsings[i];
|
||||
boolean found = false;
|
||||
|
@ -154,7 +154,7 @@ public class AddIncludesOperation implements IWorkspaceRunnable {
|
|||
}
|
||||
|
||||
int pos;
|
||||
List includes = fTranslationUnit.getChildrenOfType(ICElement.C_INCLUDE);
|
||||
List<?> includes = fTranslationUnit.getChildrenOfType(ICElement.C_INCLUDE);
|
||||
if (includes.size() > 0) {
|
||||
IInclude lastInclude = (IInclude)includes.get(includes.size() - 1);
|
||||
ISourceRange range = lastInclude.getSourceRange();
|
||||
|
|
|
@ -468,9 +468,8 @@ public class StubUtility {
|
|||
int idx= markers.indexOf(',');
|
||||
if (idx == -1) {
|
||||
return markers;
|
||||
} else {
|
||||
return markers.substring(0, idx);
|
||||
}
|
||||
return markers.substring(0, idx);
|
||||
}
|
||||
return CCorePreferenceConstants.DEFAULT_TASK_TAG;
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ public class CContext extends TranslationUnitContext {
|
|||
/*
|
||||
* @see DocumentTemplateContext#getStart()
|
||||
*/
|
||||
@Override
|
||||
public int getStart() {
|
||||
if (fIsManaged && getCompletionLength() > 0)
|
||||
return super.getStart();
|
||||
|
@ -90,6 +91,7 @@ public class CContext extends TranslationUnitContext {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnd() {
|
||||
if (fIsManaged || getCompletionLength() == 0)
|
||||
return super.getEnd();
|
||||
|
@ -113,6 +115,7 @@ public class CContext extends TranslationUnitContext {
|
|||
/*
|
||||
* @see TemplateContext#evaluate(Template)
|
||||
*/
|
||||
@Override
|
||||
public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
|
||||
if (!canEvaluate(template))
|
||||
return null;
|
||||
|
|
|
@ -31,6 +31,7 @@ public class CContextType extends TranslationUnitContextType {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.corext.template.c.TranslationUnitContextType#createContext(org.eclipse.jface.text.IDocument, int, int, org.eclipse.cdt.core.model.ITranslationUnit)
|
||||
*/
|
||||
@Override
|
||||
public TranslationUnitContext createContext(IDocument document, int offset,
|
||||
int length, ITranslationUnit translationUnit) {
|
||||
return new CContext(this, document, offset, length, translationUnit);
|
||||
|
@ -39,6 +40,7 @@ public class CContextType extends TranslationUnitContextType {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.corext.template.c.TranslationUnitContextType#createContext(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.Position, org.eclipse.cdt.core.model.ITranslationUnit)
|
||||
*/
|
||||
@Override
|
||||
public TranslationUnitContext createContext(IDocument document,
|
||||
Position position, ITranslationUnit translationUnit) {
|
||||
return new CContext(this, document, position, translationUnit);
|
||||
|
|
|
@ -167,7 +167,7 @@ public class CFormatter {
|
|||
}
|
||||
|
||||
private void format(IDocument doc) throws BadLocationException {
|
||||
Map options;
|
||||
Map<String, String> options;
|
||||
if (fProject != null)
|
||||
options= fProject.getOptions(true);
|
||||
else
|
||||
|
|
|
@ -97,6 +97,7 @@ public class CodeTemplateContextType extends FileTemplateContextType {
|
|||
super("todo", TemplateMessages.CodeTemplateContextType_variable_description_todo); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String resolve(TemplateContext context) {
|
||||
String todoTaskTag= StubUtility.getTodoTaskTag(((CodeTemplateContext) context).getCProject());
|
||||
if (todoTaskTag == null)
|
||||
|
@ -184,6 +185,7 @@ public class CodeTemplateContextType extends FileTemplateContextType {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.corext.template.c.FileTemplateContextType#addResourceVariables()
|
||||
*/
|
||||
@Override
|
||||
protected void addResourceVariables() {
|
||||
// don't add resource variables by default
|
||||
}
|
||||
|
@ -213,6 +215,7 @@ public class CodeTemplateContextType extends FileTemplateContextType {
|
|||
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.DESTRUCTORCOMMENT_CONTEXTTYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(String pattern) throws TemplateException {
|
||||
super.validate(pattern);
|
||||
if (fIsComment) {
|
||||
|
|
|
@ -61,6 +61,7 @@ public class CommentContext extends TranslationUnitContext {
|
|||
/*
|
||||
* @see DocumentTemplateContext#getStart()
|
||||
*/
|
||||
@Override
|
||||
public int getStart() {
|
||||
if (fIsManaged && getCompletionLength() > 0)
|
||||
return super.getStart();
|
||||
|
@ -104,6 +105,7 @@ public class CommentContext extends TranslationUnitContext {
|
|||
/*
|
||||
* @see org.eclipse.jdt.internal.corext.template.DocumentTemplateContext#getEnd()
|
||||
*/
|
||||
@Override
|
||||
public int getEnd() {
|
||||
if (fIsManaged || getCompletionLength() == 0)
|
||||
return super.getEnd();
|
||||
|
@ -127,6 +129,7 @@ public class CommentContext extends TranslationUnitContext {
|
|||
/*
|
||||
* @see TemplateContext#evaluate(Template)
|
||||
*/
|
||||
@Override
|
||||
public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
|
||||
TemplateTranslator translator= new TemplateTranslator();
|
||||
TemplateBuffer buffer= translator.translate(template);
|
||||
|
|
|
@ -35,6 +35,7 @@ public class CommentContextType extends TranslationUnitContextType {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.corext.template.c.TranslationUnitContextType#createContext(org.eclipse.jface.text.IDocument, int, int, org.eclipse.cdt.core.model.ITranslationUnit)
|
||||
*/
|
||||
@Override
|
||||
public TranslationUnitContext createContext(IDocument document, int offset,
|
||||
int length, ITranslationUnit translationUnit) {
|
||||
return new CommentContext(this, document, offset, length, translationUnit);
|
||||
|
@ -43,6 +44,7 @@ public class CommentContextType extends TranslationUnitContextType {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.corext.template.c.TranslationUnitContextType#createContext(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.Position, org.eclipse.cdt.core.model.ITranslationUnit)
|
||||
*/
|
||||
@Override
|
||||
public TranslationUnitContext createContext(IDocument document,
|
||||
Position position, ITranslationUnit translationUnit) {
|
||||
return new CommentContext(this, document, position, translationUnit);
|
||||
|
|
|
@ -46,9 +46,10 @@ public class FileTemplateContext extends TemplateContext {
|
|||
/*
|
||||
* @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
|
||||
*/
|
||||
@Override
|
||||
public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
|
||||
// test that all variables are defined
|
||||
Iterator iterator= getContextType().resolvers();
|
||||
Iterator<?> iterator= getContextType().resolvers();
|
||||
while (iterator.hasNext()) {
|
||||
TemplateVariableResolver var= (TemplateVariableResolver) iterator.next();
|
||||
if (var.getClass() == FileTemplateContextType.FileTemplateVariableResolver.class) {
|
||||
|
@ -95,6 +96,7 @@ public class FileTemplateContext extends TemplateContext {
|
|||
/*
|
||||
* @see org.eclipse.jface.text.templates.TemplateContext#canEvaluate(org.eclipse.jface.text.templates.Template)
|
||||
*/
|
||||
@Override
|
||||
public boolean canEvaluate(Template template) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class FileTemplateContextType extends TemplateContextType {
|
|||
public void resolve(TemplateVariable variable, TemplateContext context) {
|
||||
fFormat= null;
|
||||
TemplateVariableType type= variable.getVariableType();
|
||||
List params= type.getParams();
|
||||
List<?> params= type.getParams();
|
||||
if (params.size() == 1) {
|
||||
fFormat= params.get(0).toString();
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public class FileTemplateContextType extends TemplateContextType {
|
|||
|
||||
@Override
|
||||
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
|
||||
ArrayList required= new ArrayList(5);
|
||||
ArrayList<String> required= new ArrayList<String>(5);
|
||||
for (int i= 0; i < variables.length; i++) {
|
||||
String type= variables[i].getType();
|
||||
if (getResolver(type) == null) {
|
||||
|
@ -188,7 +188,7 @@ public class FileTemplateContextType extends TemplateContextType {
|
|||
required.remove(type);
|
||||
}
|
||||
if (!required.isEmpty()) {
|
||||
String missing= (String) required.get(0);
|
||||
String missing= required.get(0);
|
||||
throw new TemplateException(Messages.format(TemplateMessages.FileTemplateContextType_validate_missingvariable, missing));
|
||||
}
|
||||
super.validateVariables(variables);
|
||||
|
|
|
@ -75,6 +75,7 @@ public abstract class TranslationUnitContext extends DocumentTemplateContext {
|
|||
/*
|
||||
* @see org.eclipse.jface.text.templates.DocumentTemplateContext#canEvaluate(org.eclipse.jface.text.templates.Template)
|
||||
*/
|
||||
@Override
|
||||
public boolean canEvaluate(Template template) {
|
||||
if (fForceEvaluation)
|
||||
return true;
|
||||
|
@ -89,6 +90,7 @@ public abstract class TranslationUnitContext extends DocumentTemplateContext {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.corext.template.DocumentTemplateContext#getKey()
|
||||
*/
|
||||
@Override
|
||||
public String getKey() {
|
||||
if (getCompletionLength() == 0)
|
||||
return super.getKey();
|
||||
|
|
|
@ -37,7 +37,8 @@ public abstract class TranslationUnitContextType extends TemplateContextType {
|
|||
public ReturnType() {
|
||||
super("return_type", TemplateMessages.CContextType_variable_description_return_type); //$NON-NLS-1$
|
||||
}
|
||||
public String resolve(TemplateContext context) {
|
||||
@Override
|
||||
public String resolve(TemplateContext context) {
|
||||
ICElement element= ((TranslationUnitContext) context).findEnclosingElement(ICElement.C_METHOD);
|
||||
if (element == null) {
|
||||
element= ((TranslationUnitContext) context).findEnclosingElement(ICElement.C_FUNCTION);
|
||||
|
@ -57,6 +58,7 @@ public abstract class TranslationUnitContextType extends TemplateContextType {
|
|||
public File() {
|
||||
super("file", TemplateMessages.CContextType_variable_description_file); //$NON-NLS-1$
|
||||
}
|
||||
@Override
|
||||
public String resolve(TemplateContext context) {
|
||||
ITranslationUnit unit= ((TranslationUnitContext) context).getTranslationUnit();
|
||||
|
||||
|
@ -71,6 +73,7 @@ public abstract class TranslationUnitContextType extends TemplateContextType {
|
|||
super(name, description);
|
||||
fElementType= elementType;
|
||||
}
|
||||
@Override
|
||||
public String resolve(TemplateContext context) {
|
||||
ICElement element= ((TranslationUnitContext) context).findEnclosingElement(fElementType);
|
||||
return (element == null) ? null : element.getElementName();
|
||||
|
@ -87,6 +90,7 @@ public abstract class TranslationUnitContextType extends TemplateContextType {
|
|||
public Project() {
|
||||
super("enclosing_project", TemplateMessages.CContextType_variable_description_enclosing_project); //$NON-NLS-1$
|
||||
}
|
||||
@Override
|
||||
public String resolve(TemplateContext context) {
|
||||
ITranslationUnit unit= ((TranslationUnitContext) context).getTranslationUnit();
|
||||
return (unit == null) ? null : unit.getCProject().getElementName();
|
||||
|
@ -97,6 +101,7 @@ public abstract class TranslationUnitContextType extends TemplateContextType {
|
|||
public Arguments() {
|
||||
super("enclosing_method_arguments", TemplateMessages.CContextType_variable_description_enclosing_method_arguments); //$NON-NLS-1$
|
||||
}
|
||||
@Override
|
||||
public String resolve(TemplateContext context) {
|
||||
ICElement element= ((TranslationUnitContext) context).findEnclosingElement(ICElement.C_FUNCTION);
|
||||
if (element == null) {
|
||||
|
@ -130,6 +135,7 @@ public abstract class TranslationUnitContextType extends TemplateContextType {
|
|||
public Todo() {
|
||||
super("todo", TemplateMessages.CContextType_variable_description_todo); //$NON-NLS-1$
|
||||
}
|
||||
@Override
|
||||
protected String resolve(TemplateContext context) {
|
||||
TranslationUnitContext cContext= (TranslationUnitContext) context;
|
||||
ITranslationUnit tUnit= cContext.getTranslationUnit();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CodeFormatterUtil {
|
|||
* @return the indent string
|
||||
*/
|
||||
public static String createIndentString(int indentationUnits, ICProject project) {
|
||||
Map options= project != null ? project.getOptions(true) : CCorePlugin.getOptions();
|
||||
Map<String, String> options= project != null ? project.getOptions(true) : CCorePlugin.getOptions();
|
||||
return ToolFactory.createDefaultCodeFormatter(options).createIndentationString(indentationUnits);
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ public class CodeFormatterUtil {
|
|||
* @throws IllegalArgumentException If the offset and length are not inside the string, a
|
||||
* IllegalArgumentException is thrown.
|
||||
*/
|
||||
public static TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator, Map options) {
|
||||
public static TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator, Map<String, String> options) {
|
||||
if (offset < 0 || length < 0 || offset + length > source.length()) {
|
||||
throw new IllegalArgumentException("offset or length outside of string. offset: " + offset + ", length: " + length + ", string size: " + source.length()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class CodeFormatterUtil {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static TextEdit format(int kind, String source, int indentationLevel, String lineSeparator, Map options) {
|
||||
public static TextEdit format(int kind, String source, int indentationLevel, String lineSeparator, Map<String, String> options) {
|
||||
String prefix= ""; //$NON-NLS-1$
|
||||
String suffix= ""; //$NON-NLS-1$
|
||||
switch (kind) {
|
||||
|
|
|
@ -16,6 +16,15 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
|
@ -38,14 +47,6 @@ import org.eclipse.cdt.ui.CElementGrouping;
|
|||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.IncludesGrouping;
|
||||
import org.eclipse.cdt.ui.NamespacesGrouping;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||
|
||||
/**
|
||||
* A base content provider for C elements. It provides access to the
|
||||
|
@ -328,7 +329,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
if (!cproject.getProject().isOpen())
|
||||
return NO_CHILDREN;
|
||||
|
||||
List list= new ArrayList();
|
||||
List<ICElement> list= new ArrayList<ICElement>();
|
||||
ICElement[] children = cproject.getChildren();
|
||||
for (int i= 0; i < children.length; i++) {
|
||||
ICElement child = children[i];
|
||||
|
@ -355,7 +356,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
Object[] children = unit.getChildren();
|
||||
if (fIncludesGrouping) {
|
||||
boolean hasInclude = false;
|
||||
ArrayList list = new ArrayList(children.length);
|
||||
ArrayList<Object> list = new ArrayList<Object>(children.length);
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
if (!(children[i] instanceof IInclude)) {
|
||||
list.add(children[i]);
|
||||
|
@ -370,12 +371,12 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
}
|
||||
if (fNamespacesGrouping) {
|
||||
// check if there is another namespace with the same name for the same parent
|
||||
List list = new ArrayList(children.length);
|
||||
Map map = new HashMap();
|
||||
List<Object> list = new ArrayList<Object>(children.length);
|
||||
Map<String, NamespacesGrouping> map = new HashMap<String, NamespacesGrouping>();
|
||||
for (int i = 0; i < children.length; ++i) {
|
||||
if (children[i] instanceof INamespace) {
|
||||
INamespace n1 = (INamespace)children[i];
|
||||
NamespacesGrouping namespacesGrouping = (NamespacesGrouping)map.get(n1.getElementName());
|
||||
NamespacesGrouping namespacesGrouping = map.get(n1.getElementName());
|
||||
if (namespacesGrouping == null) {
|
||||
for (int j = i + 1; j < children.length; ++j) {
|
||||
if (children[j] instanceof INamespace) {
|
||||
|
@ -457,7 +458,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
} catch (CModelException e) {
|
||||
roots = new ISourceRoot[0];
|
||||
}
|
||||
List nonCResources = new ArrayList(objects.length);
|
||||
List<Object> nonCResources = new ArrayList<Object>(objects.length);
|
||||
for (int i= 0; i < objects.length; i++) {
|
||||
Object o= objects[i];
|
||||
// A folder can also be a source root in the following case
|
||||
|
@ -533,7 +534,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
|
||||
protected IBinary[] getBinaries(IBinaryContainer container) throws CModelException {
|
||||
ICElement[] celements = container.getChildren();
|
||||
ArrayList list = new ArrayList(celements.length);
|
||||
ArrayList<IBinary> list = new ArrayList<IBinary>(celements.length);
|
||||
for (int i = 0; i < celements.length; i++) {
|
||||
if (celements[i] instanceof IBinary) {
|
||||
IBinary bin = (IBinary)celements[i];
|
||||
|
@ -552,7 +553,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
|||
|
||||
protected IArchive[] getArchives(IArchiveContainer container) throws CModelException {
|
||||
ICElement[] celements = container.getChildren();
|
||||
ArrayList list = new ArrayList(celements.length);
|
||||
ArrayList<IArchive> list = new ArrayList<IArchive>(celements.length);
|
||||
for (int i = 0; i < celements.length; i++) {
|
||||
if (celements[i] instanceof IArchive) {
|
||||
IArchive ar = (IArchive)celements[i];
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui;
|
||||
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.jface.viewers.IBasicPropertyConstants;
|
||||
import org.eclipse.ui.views.properties.FilePropertySource;
|
||||
|
@ -20,7 +18,10 @@ import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
|||
import org.eclipse.ui.views.properties.IPropertySource;
|
||||
import org.eclipse.ui.views.properties.PropertyDescriptor;
|
||||
|
||||
public class BinaryPropertySource extends FilePropertySource implements IPropertySource {
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
public class BinaryPropertySource extends FilePropertySource {
|
||||
|
||||
private final static String ELF_CPU= "CElementProperties.elf_cpu"; //$NON-NLS-1$
|
||||
private final static String ELF_TEXT= "CElementProperties.elf_text"; //$NON-NLS-1$
|
||||
|
@ -101,6 +102,7 @@ public class BinaryPropertySource extends FilePropertySource implements IPropert
|
|||
/**
|
||||
* @see IPropertySource#getPropertyDescriptors
|
||||
*/
|
||||
@Override
|
||||
public IPropertyDescriptor[] getPropertyDescriptors() {
|
||||
if (fgPropertyDescriptors == null) {
|
||||
initializeBinaryDescriptors();
|
||||
|
@ -111,6 +113,7 @@ public class BinaryPropertySource extends FilePropertySource implements IPropert
|
|||
/**
|
||||
* @see IPropertySource#getPropertyValue
|
||||
*/
|
||||
@Override
|
||||
public Object getPropertyValue(Object name) {
|
||||
if (element != null) {
|
||||
Object returnValue = super.getPropertyValue(name);
|
||||
|
@ -176,6 +179,7 @@ public class BinaryPropertySource extends FilePropertySource implements IPropert
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
|
||||
*/
|
||||
@Override
|
||||
public Object getEditableValue() {
|
||||
return this;
|
||||
}
|
||||
|
@ -183,6 +187,7 @@ public class BinaryPropertySource extends FilePropertySource implements IPropert
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean isPropertySet(Object id) {
|
||||
return false;
|
||||
}
|
||||
|
@ -190,12 +195,14 @@ public class BinaryPropertySource extends FilePropertySource implements IPropert
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void resetPropertyValue(Object id) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void setPropertyValue(Object id, Object value) {
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.cdt.core.model.ICElement;
|
|||
*/
|
||||
public class CElementAdapterFactory implements IAdapterFactory {
|
||||
|
||||
private static Class[] PROPERTIES= new Class[] {
|
||||
private static Class<?>[] PROPERTIES= new Class[] {
|
||||
IPropertySource.class,
|
||||
IResource.class,
|
||||
IWorkbenchAdapter.class,
|
||||
|
@ -45,13 +45,14 @@ public class CElementAdapterFactory implements IAdapterFactory {
|
|||
/**
|
||||
* @see CElementAdapterFactory#getAdapterList
|
||||
*/
|
||||
public Class[] getAdapterList() {
|
||||
public Class<?>[] getAdapterList() {
|
||||
return PROPERTIES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CElementAdapterFactory#getAdapter
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Object element, Class key) {
|
||||
ICElement celem = (ICElement) element;
|
||||
|
||||
|
|
|
@ -23,11 +23,12 @@ import org.eclipse.cdt.core.model.ICProject;
|
|||
*/
|
||||
public class CProjectAdapterFactory implements IAdapterFactory {
|
||||
|
||||
private static final Class[] ADAPTERS = { IProject.class };
|
||||
private static final Class<?>[] ADAPTERS = { IProject.class };
|
||||
|
||||
/*
|
||||
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
||||
if (IProject.class.equals(adapterType)) {
|
||||
return ((ICProject)adaptableObject).getProject();
|
||||
|
@ -38,7 +39,7 @@ public class CProjectAdapterFactory implements IAdapterFactory {
|
|||
/*
|
||||
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
|
||||
*/
|
||||
public Class[] getAdapterList() {
|
||||
public Class<?>[] getAdapterList() {
|
||||
return ADAPTERS;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ public class DocumentInputStream extends InputStream {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public int read() throws IOException {
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
try {
|
||||
if (fCurrPos < fDocument.getLength()) {
|
||||
return fDocument.getChar(fCurrPos++);
|
||||
|
|
|
@ -59,11 +59,11 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
/** The viewer's widget */
|
||||
private StyledText fTextWidget;
|
||||
/** Text positions (cursor line position is always at index 0 */
|
||||
private List fPositions= new ArrayList();
|
||||
private List<Position> fPositions= new ArrayList<Position>();
|
||||
/** Cached text positions */
|
||||
private List fLastPositions= new ArrayList();
|
||||
private List<Position> fLastPositions= new ArrayList<Position>();
|
||||
/** Temporary changed positions */
|
||||
private List fChangedPositions= new ArrayList();
|
||||
private List<Position> fChangedPositions= new ArrayList<Position>();
|
||||
/** Cursor line position */
|
||||
private Position fCursorLine= new TypedPosition(0, 0, CURSOR_LINE_TYPE);
|
||||
/** Saved cursor line position */
|
||||
|
@ -73,7 +73,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
/** Whether cursor line highlighting is active */
|
||||
private boolean fCursorLineActive;
|
||||
/** Map of position type to color */
|
||||
private Map fColorMap= new HashMap();
|
||||
private Map<String, Color> fColorMap= new HashMap<String, Color>();
|
||||
|
||||
/**
|
||||
* Creates a new painter for the given text viewer.
|
||||
|
@ -134,7 +134,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
*
|
||||
* @param positions a list of <code>Position</code>s
|
||||
*/
|
||||
public void setHighlightPositions(List positions) {
|
||||
public void setHighlightPositions(List<Position> positions) {
|
||||
boolean isActive= fIsActive;
|
||||
deactivate(isActive);
|
||||
fPositions.clear();
|
||||
|
@ -151,7 +151,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
*
|
||||
* @param positions a list of <code>Position</code>s
|
||||
*/
|
||||
public void addHighlightPositions(List positions) {
|
||||
public void addHighlightPositions(List<Position> positions) {
|
||||
boolean isActive= fIsActive;
|
||||
deactivate(isActive);
|
||||
fPositions.addAll(positions);
|
||||
|
@ -165,7 +165,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
*
|
||||
* @param positions a list of <code>Position</code>s
|
||||
*/
|
||||
public void removeHighlightPositions(List positions) {
|
||||
public void removeHighlightPositions(List<Position> positions) {
|
||||
boolean isActive= fIsActive;
|
||||
deactivate(isActive);
|
||||
fPositions.removeAll(positions);
|
||||
|
@ -180,7 +180,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
* @param removePositions a list of <code>Position</code>s to remove
|
||||
* @param addPositions a list of <code>Position</code>s to add
|
||||
*/
|
||||
public void replaceHighlightPositions(List removePositions, List addPositions) {
|
||||
public void replaceHighlightPositions(List<Position> removePositions, List<Position> addPositions) {
|
||||
boolean isActive= fIsActive;
|
||||
deactivate(isActive);
|
||||
fPositions.removeAll(removePositions);
|
||||
|
@ -203,13 +203,13 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
* Manage all positions.
|
||||
* @param positions
|
||||
*/
|
||||
private void managePositions(List positions) {
|
||||
private void managePositions(List<Position> positions) {
|
||||
if (fPositionManager == null) {
|
||||
return;
|
||||
}
|
||||
int sz= fPositions.size();
|
||||
for (int i= 0; i < sz; ++i) {
|
||||
Position position= (Position)positions.get(i);
|
||||
Position position= positions.get(i);
|
||||
fPositionManager.managePosition(position);
|
||||
}
|
||||
}
|
||||
|
@ -218,13 +218,13 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
* Unmanage all positions.
|
||||
* @param positions
|
||||
*/
|
||||
private void unmanagePositions(List positions) {
|
||||
private void unmanagePositions(List<Position> positions) {
|
||||
if (fPositionManager == null) {
|
||||
return;
|
||||
}
|
||||
int sz= fPositions.size();
|
||||
for (int i= 0; i < sz; ++i) {
|
||||
Position position= (Position)positions.get(i);
|
||||
Position position= positions.get(i);
|
||||
fPositionManager.unmanagePosition(position);
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
updateCursorLine();
|
||||
}
|
||||
}
|
||||
List changedPositions= getChangedPositions();
|
||||
List<Position> changedPositions= getChangedPositions();
|
||||
if (changedPositions != null) {
|
||||
redrawPositions(changedPositions);
|
||||
updatePositions();
|
||||
|
@ -319,14 +319,14 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
private void updatePositions() {
|
||||
int sz= fPositions.size();
|
||||
for (int i= 0; i < sz; ++i) {
|
||||
Position position= (Position)fPositions.get(i);
|
||||
Position position= fPositions.get(i);
|
||||
Position copy;
|
||||
if (i == fLastPositions.size()) {
|
||||
copy= new Position(position.offset, position.length);
|
||||
copy.isDeleted= position.isDeleted;
|
||||
fLastPositions.add(copy);
|
||||
} else {
|
||||
copy= (Position)fLastPositions.get(i);
|
||||
copy= fLastPositions.get(i);
|
||||
copy.offset= position.offset;
|
||||
copy.length= position.length;
|
||||
copy.isDeleted= position.isDeleted;
|
||||
|
@ -344,14 +344,14 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
* Check which positions have changed since last redraw.
|
||||
* @return a list of changed positions or <code>null</code> if none changed.
|
||||
*/
|
||||
private List getChangedPositions() {
|
||||
private List<Position> getChangedPositions() {
|
||||
if (fLastPositions.size() != fPositions.size()) {
|
||||
return fLastPositions;
|
||||
}
|
||||
List changedPositions= null;
|
||||
List<Position> changedPositions= null;
|
||||
for (int i= 0, sz= fPositions.size(); i < sz; ++i) {
|
||||
Position previous= (Position)fLastPositions.get(i);
|
||||
Position current= (Position)fPositions.get(i);
|
||||
Position previous= fLastPositions.get(i);
|
||||
Position current= fPositions.get(i);
|
||||
if (!previous.equals(current)) {
|
||||
if (changedPositions == null) {
|
||||
changedPositions= fChangedPositions;
|
||||
|
@ -368,7 +368,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
*
|
||||
* @param positions
|
||||
*/
|
||||
private void redrawPositions(List positions) {
|
||||
private void redrawPositions(List<Position> positions) {
|
||||
// TextViewer.getTopIndexStartOffset is buggy
|
||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=174419
|
||||
// final int minOffset= fTextViewer.getTopIndexStartOffset();
|
||||
|
@ -378,7 +378,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
int width= clientArea.width + fTextWidget.getHorizontalPixel();
|
||||
int lineHeight= fTextWidget.getLineHeight();
|
||||
for (int i= 0, sz= positions.size(); i < sz; ++i) {
|
||||
Position position= (Position)positions.get(i);
|
||||
Position position= positions.get(i);
|
||||
// if the position that is about to be drawn was deleted then we can't
|
||||
if (position.isDeleted()) {
|
||||
continue;
|
||||
|
@ -456,14 +456,13 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
if (fTextViewer instanceof ITextViewerExtension5) {
|
||||
ITextViewerExtension5 extension= (ITextViewerExtension5)fTextViewer;
|
||||
return extension.modelOffset2WidgetOffset(documentOffset);
|
||||
} else {
|
||||
IRegion visible= fTextViewer.getVisibleRegion();
|
||||
int widgetOffset= documentOffset - visible.getOffset();
|
||||
if (widgetOffset > visible.getLength()) {
|
||||
return -1;
|
||||
}
|
||||
return widgetOffset;
|
||||
}
|
||||
IRegion visible= fTextViewer.getVisibleRegion();
|
||||
int widgetOffset= documentOffset - visible.getOffset();
|
||||
if (widgetOffset > visible.getLength()) {
|
||||
return -1;
|
||||
}
|
||||
return widgetOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -475,13 +474,12 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
if (fTextViewer instanceof ITextViewerExtension5) {
|
||||
ITextViewerExtension5 extension= (ITextViewerExtension5)fTextViewer;
|
||||
return extension.widgetOffset2ModelOffset(widgetOffset);
|
||||
} else {
|
||||
IRegion visible= fTextViewer.getVisibleRegion();
|
||||
if (widgetOffset > visible.getLength()) {
|
||||
return -1;
|
||||
}
|
||||
return widgetOffset + visible.getOffset();
|
||||
}
|
||||
IRegion visible= fTextViewer.getVisibleRegion();
|
||||
if (widgetOffset > visible.getLength()) {
|
||||
return -1;
|
||||
}
|
||||
return widgetOffset + visible.getOffset();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -507,15 +505,14 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
private Color getColorForPosition(Position position) {
|
||||
if (position == fCursorLine) {
|
||||
if (fCursorLine.length == 0) {
|
||||
return (Color)fColorMap.get(CURSOR_LINE_TYPE);
|
||||
return fColorMap.get(CURSOR_LINE_TYPE);
|
||||
}
|
||||
} else {
|
||||
if (position instanceof TypedPosition) {
|
||||
String type= ((TypedPosition)position).getType();
|
||||
return (Color)fColorMap.get(type);
|
||||
} else {
|
||||
return (Color)fColorMap.get(DEFAULT_TYPE);
|
||||
return fColorMap.get(type);
|
||||
}
|
||||
return fColorMap.get(DEFAULT_TYPE);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -528,7 +525,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
|||
private Position findIncludingPosition(int offset) {
|
||||
// TLETODO [performance] Use binary search?
|
||||
for (int i= fCursorLineActive ? 0 : 1, sz= fPositions.size(); i < sz; ++i) {
|
||||
Position position= (Position)fPositions.get(i);
|
||||
Position position= fPositions.get(i);
|
||||
if (position.offset == offset || position.includes(offset)) {
|
||||
return position;
|
||||
}
|
||||
|
|
|
@ -18,12 +18,12 @@ import org.eclipse.core.resources.IResource;
|
|||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.runtime.IAdapterFactory;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
|
||||
public class ResourceAdapterFactory implements IAdapterFactory {
|
||||
|
||||
private static Class[] PROPERTIES= new Class[] {
|
||||
private static Class<?>[] PROPERTIES= new Class[] {
|
||||
ICElement.class
|
||||
};
|
||||
|
||||
|
@ -33,13 +33,14 @@ public class ResourceAdapterFactory implements IAdapterFactory {
|
|||
/**
|
||||
* @see IAdapterFactory#getAdapterList
|
||||
*/
|
||||
public Class[] getAdapterList() {
|
||||
public Class<?>[] getAdapterList() {
|
||||
return PROPERTIES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see IAdapterFactory#getAdapter
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Object element, Class key) {
|
||||
if (ICElement.class.equals(key)) {
|
||||
//try {
|
||||
|
|
|
@ -37,5 +37,6 @@ public abstract class AbstractToggleLinkingAction extends Action {
|
|||
/**
|
||||
* Runs the action.
|
||||
*/
|
||||
@Override
|
||||
public abstract void run();
|
||||
}
|
||||
|
|
|
@ -43,15 +43,15 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate
|
|||
return;
|
||||
|
||||
IStructuredSelection cElements= SelectionConverter.convertSelectionToCElements(fSelection);
|
||||
Iterator i= cElements.iterator();
|
||||
ArrayList tuSelection= new ArrayList();
|
||||
Iterator<?> i= cElements.iterator();
|
||||
ArrayList<ICElement> tuSelection= new ArrayList<ICElement>();
|
||||
while (i.hasNext()) {
|
||||
Object o= i.next();
|
||||
if (o instanceof ICProject || o instanceof ICContainer || o instanceof ITranslationUnit) {
|
||||
tuSelection.add(o);
|
||||
tuSelection.add((ICElement) o);
|
||||
}
|
||||
}
|
||||
ICElement[] tuArray= (ICElement[]) tuSelection.toArray(new ICElement[tuSelection.size()]);
|
||||
ICElement[] tuArray= tuSelection.toArray(new ICElement[tuSelection.size()]);
|
||||
|
||||
try {
|
||||
CCorePlugin.getIndexManager().update(tuArray, getUpdateOptions());
|
||||
|
|
|
@ -50,10 +50,11 @@ public class AddBlockCommentAction extends BlockCommentAction {
|
|||
/*
|
||||
* @see org.eclipse.jdt.internal.ui.actions.BlockCommentAction#runInternal(org.eclipse.jface.text.ITextSelection, org.eclipse.jface.text.IDocumentExtension3, org.eclipse.jdt.internal.ui.actions.BlockCommentAction.Edit.EditFactory)
|
||||
*/
|
||||
@Override
|
||||
protected void runInternal(ITextSelection selection, IDocumentExtension3 docExtension, Edit.EditFactory factory) throws BadLocationException, BadPartitioningException {
|
||||
int selectionOffset= selection.getOffset();
|
||||
int selectionEndOffset= selectionOffset + selection.getLength();
|
||||
List edits= new LinkedList();
|
||||
List<Edit> edits= new LinkedList<Edit>();
|
||||
ITypedRegion partition= docExtension.getPartition(ICPartitions.C_PARTITIONING, selectionOffset, false);
|
||||
|
||||
handleFirstPartition(partition, edits, factory, selectionOffset);
|
||||
|
@ -75,7 +76,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
|
|||
* @param factory
|
||||
* @param offset
|
||||
*/
|
||||
private void handleFirstPartition(ITypedRegion partition, List edits, Edit.EditFactory factory, int offset) throws BadLocationException {
|
||||
private void handleFirstPartition(ITypedRegion partition, List<Edit> edits, Edit.EditFactory factory, int offset) throws BadLocationException {
|
||||
|
||||
int partOffset= partition.getOffset();
|
||||
String partType= partition.getType();
|
||||
|
@ -104,7 +105,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
|
|||
* @throws BadPartitioningException
|
||||
* @return the region
|
||||
*/
|
||||
private ITypedRegion handleInteriorPartition(ITypedRegion partition, List edits, Edit.EditFactory factory, IDocumentExtension3 docExtension) throws BadPartitioningException, BadLocationException {
|
||||
private ITypedRegion handleInteriorPartition(ITypedRegion partition, List<Edit> edits, Edit.EditFactory factory, IDocumentExtension3 docExtension) throws BadPartitioningException, BadLocationException {
|
||||
|
||||
// end of previous partition
|
||||
String partType= partition.getType();
|
||||
|
@ -136,7 +137,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
|
|||
* @param factory
|
||||
* @param endOffset
|
||||
*/
|
||||
private void handleLastPartition(ITypedRegion partition, List edits, Edit.EditFactory factory, int endOffset) throws BadLocationException {
|
||||
private void handleLastPartition(ITypedRegion partition, List<Edit> edits, Edit.EditFactory factory, int endOffset) throws BadLocationException {
|
||||
|
||||
String partType= partition.getType();
|
||||
|
||||
|
@ -167,6 +168,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
|
|||
/*
|
||||
* @see org.eclipse.jdt.internal.ui.actions.BlockCommentAction#validSelection(org.eclipse.jface.text.ITextSelection)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isValidSelection(ITextSelection selection) {
|
||||
return selection != null && !selection.isEmpty() && selection.getLength() > 0;
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ public abstract class BlockCommentAction extends TextEditorAction {
|
|||
/*
|
||||
* @see org.eclipse.jface.text.DocumentEvent#getOffset()
|
||||
*/
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return fPosition.getOffset();
|
||||
}
|
||||
|
@ -166,6 +167,7 @@ public abstract class BlockCommentAction extends TextEditorAction {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!isEnabled())
|
||||
return;
|
||||
|
@ -227,9 +229,9 @@ public abstract class BlockCommentAction extends TextEditorAction {
|
|||
* @param edits a list of <code>Edit</code>s
|
||||
* @throws BadLocationException if an <code>Edit</code> threw such an exception.
|
||||
*/
|
||||
protected void executeEdits(List edits) throws BadLocationException {
|
||||
for (Iterator it= edits.iterator(); it.hasNext();) {
|
||||
Edit edit= (Edit) it.next();
|
||||
protected void executeEdits(List<Edit> edits) throws BadLocationException {
|
||||
for (Iterator<Edit> it= edits.iterator(); it.hasNext();) {
|
||||
Edit edit= it.next();
|
||||
edit.perform();
|
||||
}
|
||||
}
|
||||
|
@ -256,6 +258,7 @@ public abstract class BlockCommentAction extends TextEditorAction {
|
|||
/*
|
||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ public class CompositeActionGroup extends ActionGroup {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
if (fGroups == null)
|
||||
|
@ -60,6 +61,7 @@ public class CompositeActionGroup extends ActionGroup {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillActionBars(IActionBars actionBars) {
|
||||
super.fillActionBars(actionBars);
|
||||
if (fGroups == null)
|
||||
|
@ -69,6 +71,7 @@ public class CompositeActionGroup extends ActionGroup {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillContextMenu(IMenuManager menu) {
|
||||
super.fillContextMenu(menu);
|
||||
if (fGroups == null)
|
||||
|
@ -78,6 +81,7 @@ public class CompositeActionGroup extends ActionGroup {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContext(ActionContext context) {
|
||||
super.setContext(context);
|
||||
if (fGroups == null)
|
||||
|
@ -87,6 +91,7 @@ public class CompositeActionGroup extends ActionGroup {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateActionBars() {
|
||||
super.updateActionBars();
|
||||
if (fGroups == null)
|
||||
|
|
|
@ -125,7 +125,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
|||
|
||||
final String title= action.getText().replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
IStructuredSelection cElements= SelectionConverter.convertSelectionToCElements(fSelection);
|
||||
Iterator i= cElements.iterator();
|
||||
Iterator<?> i= cElements.iterator();
|
||||
ArrayList<ITranslationUnit> tuSelection= new ArrayList<ITranslationUnit>();
|
||||
while (i.hasNext()) {
|
||||
Object o= i.next();
|
||||
|
|
|
@ -40,6 +40,7 @@ public class FindWordAction extends TextEditorAction {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
ITextEditor editor = getTextEditor();
|
||||
if (editor == null )
|
||||
|
|
|
@ -122,6 +122,7 @@ public class FoldingActionGroup extends ActionGroup {
|
|||
editor.setAction("FoldingCollapse", fCollapse); //$NON-NLS-1$
|
||||
|
||||
fRestoreDefaults= new FoldingAction(FoldingMessages.getResourceBundle(), "Projection.Restore.") { //$NON-NLS-1$
|
||||
@Override
|
||||
public void run() {
|
||||
if (editor instanceof CEditor) {
|
||||
CEditor cEditor= (CEditor) editor;
|
||||
|
@ -148,6 +149,7 @@ public class FoldingActionGroup extends ActionGroup {
|
|||
/*
|
||||
* @see org.eclipse.ui.actions.ActionGroup#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (isEnabled()) {
|
||||
fViewer.removeProjectionListener(fProjectionListener);
|
||||
|
@ -191,6 +193,7 @@ public class FoldingActionGroup extends ActionGroup {
|
|||
/*
|
||||
* @see org.eclipse.ui.actions.ActionGroup#updateActionBars()
|
||||
*/
|
||||
@Override
|
||||
public void updateActionBars() {
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.core.index.IIndexManager;
|
|||
|
||||
public class FreshenIndexAction extends AbstractUpdateIndexAction {
|
||||
|
||||
@Override
|
||||
protected int getUpdateOptions() {
|
||||
return IIndexManager.UPDATE_ALL;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ public class GoToNextPreviousMemberAction extends TextEditorAction {
|
|||
/*
|
||||
* @see org.eclipse.ui.texteditor.TextEditorAction#update()
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
final ITextEditor editor = getTextEditor();
|
||||
setEnabled(editor instanceof CEditor && ((CEditor)editor).getInputCElement() != null);
|
||||
|
@ -81,7 +82,8 @@ public class GoToNextPreviousMemberAction extends TextEditorAction {
|
|||
/**
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
final CEditor editor = (CEditor) getTextEditor();
|
||||
final ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
|
||||
final IEditorInput editorInput = editor.getEditorInput();
|
||||
|
|
|
@ -27,10 +27,8 @@ public class GotoNextBookmarkAction extends TextEditorAction {
|
|||
/**
|
||||
* Private class to handle comparison of markers using their line numbers.
|
||||
*/
|
||||
private class CompareMarker implements Comparator {
|
||||
public int compare(Object o1, Object o2) {
|
||||
IMarker m1 = (IMarker) o1;
|
||||
IMarker m2 = (IMarker) o2;
|
||||
private class CompareMarker implements Comparator<IMarker> {
|
||||
public int compare(IMarker m1, IMarker m2) {
|
||||
int l1 = MarkerUtilities.getLineNumber(m1);
|
||||
int l2 = MarkerUtilities.getLineNumber(m2);
|
||||
if (l1 > l2) return 1;
|
||||
|
@ -50,7 +48,7 @@ public class GotoNextBookmarkAction extends TextEditorAction {
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void run() {
|
||||
ITextEditor editor = getTextEditor();
|
||||
if (editor == null )
|
||||
|
|
|
@ -14,9 +14,9 @@ package org.eclipse.cdt.internal.ui.actions;
|
|||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.IRegion;
|
||||
|
@ -88,6 +88,7 @@ public class IndentAction extends TextEditorAction {
|
|||
/*
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
// update has been called by the framework
|
||||
if (!isEnabled() || !validateEditorInputState())
|
||||
|
@ -290,9 +291,8 @@ public class IndentAction extends TextEditorAction {
|
|||
if (!indent.equals(currentIndent)) {
|
||||
document.replace(offset, length, indent);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -446,6 +446,7 @@ public class IndentAction extends TextEditorAction {
|
|||
/*
|
||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
|
@ -483,10 +484,9 @@ public class IndentAction extends TextEditorAction {
|
|||
// or the selection has to extend over multiple lines
|
||||
if (length == 0) {
|
||||
return document.get(lineOffset, offset - lineOffset).trim().length() == 0;
|
||||
} else {
|
||||
// return lineOffset + firstLine.getLength() < offset + length;
|
||||
return false; // only enable for empty selections for now
|
||||
}
|
||||
}
|
||||
// return lineOffset + firstLine.getLength() < offset + length;
|
||||
return false; // only enable for empty selections for now
|
||||
} catch (BadLocationException e) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,16 +14,6 @@ package org.eclipse.cdt.internal.ui.actions;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceReference;
|
||||
import org.eclipse.cdt.core.model.util.CElementBaseLabels;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider;
|
||||
|
||||
import org.eclipse.cdt.ui.CElementLabelProvider;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
@ -31,6 +21,15 @@ import org.eclipse.ui.IEditorPart;
|
|||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceReference;
|
||||
import org.eclipse.cdt.core.model.util.CElementBaseLabels;
|
||||
import org.eclipse.cdt.ui.CElementLabelProvider;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider;
|
||||
|
||||
public class OpenActionUtil {
|
||||
|
||||
private OpenActionUtil() {
|
||||
|
@ -57,12 +56,12 @@ public class OpenActionUtil {
|
|||
* Filters out source references from the given code resolve results.
|
||||
* A utility method that can be called by subclassers.
|
||||
*/
|
||||
public static List filterResolveResults(ICElement[] codeResolveResults) {
|
||||
public static List<ISourceReference> filterResolveResults(ICElement[] codeResolveResults) {
|
||||
int nResults= codeResolveResults.length;
|
||||
List refs= new ArrayList(nResults);
|
||||
List<ISourceReference> refs= new ArrayList<ISourceReference>(nResults);
|
||||
for (int i= 0; i < nResults; i++) {
|
||||
if (codeResolveResults[i] instanceof ISourceReference)
|
||||
refs.add(codeResolveResults[i]);
|
||||
refs.add((ISourceReference) codeResolveResults[i]);
|
||||
}
|
||||
return refs;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RebuildIndexAction implements IObjectActionDelegate {
|
|||
|
||||
public void run(IAction action) {
|
||||
IStructuredSelection cElements= SelectionConverter.convertSelectionToCElements(fSelection);
|
||||
for (Iterator i = cElements.iterator(); i.hasNext();) {
|
||||
for (Iterator<?> i = cElements.iterator(); i.hasNext();) {
|
||||
Object elem = i.next();
|
||||
if (elem instanceof ICProject) {
|
||||
CCorePlugin.getIndexManager().reindex((ICProject) elem);
|
||||
|
|
|
@ -47,8 +47,9 @@ public class RemoveBlockCommentAction extends BlockCommentAction {
|
|||
/*
|
||||
* @see org.eclipse.jdt.internal.ui.actions.AddBlockCommentAction#runInternal(org.eclipse.jface.text.ITextSelection, org.eclipse.jface.text.IDocumentExtension3, org.eclipse.jdt.internal.ui.actions.AddBlockCommentAction.Edit.EditFactory)
|
||||
*/
|
||||
@Override
|
||||
protected void runInternal(ITextSelection selection, IDocumentExtension3 docExtension, Edit.EditFactory factory) throws BadPartitioningException, BadLocationException {
|
||||
List edits= new LinkedList();
|
||||
List<Edit> edits= new LinkedList<Edit>();
|
||||
int tokenLength= getCommentStart().length();
|
||||
|
||||
int offset= selection.getOffset();
|
||||
|
@ -81,6 +82,7 @@ public class RemoveBlockCommentAction extends BlockCommentAction {
|
|||
/*
|
||||
* @see org.eclipse.jdt.internal.ui.actions.AddBlockCommentAction#validSelection(org.eclipse.jface.text.ITextSelection)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isValidSelection(ITextSelection selection) {
|
||||
return selection != null && !selection.isEmpty() && selection.getLength() > 0;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public class SelectAllAction extends Action {
|
|||
/**
|
||||
* Selects all resources in the view.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
fViewer.getTable().selectAll();
|
||||
// force viewer selection change
|
||||
|
|
|
@ -127,7 +127,7 @@ public class SelectionConverter {
|
|||
}
|
||||
|
||||
public static boolean allResourcesAreOfType(IStructuredSelection selection, int resourceMask) {
|
||||
Iterator resources = selection.iterator();
|
||||
Iterator<?> resources = selection.iterator();
|
||||
while (resources.hasNext()) {
|
||||
Object next = resources.next();
|
||||
if (next instanceof IAdaptable) {
|
||||
|
@ -159,7 +159,7 @@ public class SelectionConverter {
|
|||
* @see IResource#getType()
|
||||
*/
|
||||
public static IStructuredSelection allResources(IStructuredSelection selection, int resourceMask) {
|
||||
Iterator adaptables = selection.iterator();
|
||||
Iterator<?> adaptables = selection.iterator();
|
||||
List<IResource> result = new ArrayList<IResource>();
|
||||
while (adaptables.hasNext()) {
|
||||
Object next = adaptables.next();
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.core.index.IIndexManager;
|
|||
|
||||
public class UpdateIndexWithModifiedFilesAction extends AbstractUpdateIndexAction {
|
||||
|
||||
@Override
|
||||
protected int getUpdateOptions() {
|
||||
return IIndexManager.UPDATE_CHECK_TIMESTAMPS | IIndexManager.UPDATE_CHECK_CONFIGURATION;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ public class WorkbenchRunnableAdapter implements IRunnableWithProgress {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
WorkbenchRunnableAdapter.this.run(monitor);
|
||||
|
@ -89,6 +90,7 @@ public class WorkbenchRunnableAdapter implements IRunnableWithProgress {
|
|||
}
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
@Override
|
||||
public boolean belongsTo(Object family) {
|
||||
return jobFamiliy == family;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
|||
|
||||
ListenerList listeners = new ListenerList();
|
||||
BuildConsole fConsole;
|
||||
private Map fConsoleMap = new HashMap();
|
||||
private Map<IProject, BuildConsolePartitioner> fConsoleMap = new HashMap<IProject, BuildConsolePartitioner>();
|
||||
Color infoColor, outputColor, errorColor;
|
||||
BuildConsoleStream infoStream, outputStream, errorStream;
|
||||
String fName, fContextMenuId;
|
||||
|
@ -137,7 +137,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
|||
IResource resource = event.getResource();
|
||||
if (resource != null && resource.getType() == IResource.PROJECT) {
|
||||
if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) {
|
||||
IDocumentPartitioner partioner = (IDocumentPartitioner)fConsoleMap.remove(resource);
|
||||
IDocumentPartitioner partioner = fConsoleMap.remove(resource);
|
||||
if (partioner != null) {
|
||||
partioner.disconnect();
|
||||
Object[] list = listeners.getListeners();
|
||||
|
@ -273,7 +273,7 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
|||
}
|
||||
|
||||
private BuildConsolePartitioner getConsolePartioner(IProject project) {
|
||||
BuildConsolePartitioner partioner = (BuildConsolePartitioner)fConsoleMap.get(project);
|
||||
BuildConsolePartitioner partioner = fConsoleMap.get(project);
|
||||
if (partioner == null) {
|
||||
partioner = new BuildConsolePartitioner(this);
|
||||
fConsoleMap.put(project, partioner);
|
||||
|
|
|
@ -102,8 +102,8 @@ public class BuildConsolePage extends Page
|
|||
|
||||
// actions
|
||||
private ClearOutputAction fClearOutputAction;
|
||||
private Map fGlobalActions = new HashMap(10);
|
||||
private List fSelectionActions = new ArrayList(3);
|
||||
private Map<String, IAction> fGlobalActions = new HashMap<String, IAction>(10);
|
||||
private List<String> fSelectionActions = new ArrayList<String>(3);
|
||||
|
||||
// menus
|
||||
private Menu fMenu;
|
||||
|
@ -180,6 +180,7 @@ public class BuildConsolePage extends Page
|
|||
*
|
||||
* @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
fViewer = new BuildConsoleViewer(parent);
|
||||
|
||||
|
@ -217,11 +218,11 @@ public class BuildConsolePage extends Page
|
|||
* menu
|
||||
*/
|
||||
protected void contextMenuAboutToShow(IMenuManager menu) {
|
||||
menu.add((IAction)fGlobalActions.get(ActionFactory.COPY.getId()));
|
||||
menu.add((IAction)fGlobalActions.get(ActionFactory.SELECT_ALL.getId()));
|
||||
menu.add(fGlobalActions.get(ActionFactory.COPY.getId()));
|
||||
menu.add(fGlobalActions.get(ActionFactory.SELECT_ALL.getId()));
|
||||
menu.add(new Separator("FIND")); //$NON-NLS-1$
|
||||
menu.add((IAction)fGlobalActions.get(ActionFactory.FIND.getId()));
|
||||
menu.add((IAction)fGlobalActions.get(ITextEditorActionConstants.GOTO_LINE));
|
||||
menu.add(fGlobalActions.get(ActionFactory.FIND.getId()));
|
||||
menu.add(fGlobalActions.get(ITextEditorActionConstants.GOTO_LINE));
|
||||
menu.add(fClearOutputAction);
|
||||
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
}
|
||||
|
@ -287,14 +288,14 @@ public class BuildConsolePage extends Page
|
|||
}
|
||||
|
||||
protected void updateSelectionDependentActions() {
|
||||
Iterator iterator = fSelectionActions.iterator();
|
||||
Iterator<String> iterator = fSelectionActions.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
updateAction((String)iterator.next());
|
||||
updateAction(iterator.next());
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateAction(String actionId) {
|
||||
IAction action = (IAction)fGlobalActions.get(actionId);
|
||||
IAction action = fGlobalActions.get(actionId);
|
||||
if (action instanceof IUpdate) {
|
||||
((IUpdate)action).update();
|
||||
}
|
||||
|
@ -328,6 +329,7 @@ public class BuildConsolePage extends Page
|
|||
*
|
||||
* @see org.eclipse.ui.part.IPage#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
getSite().getPage().removeSelectionListener(this);
|
||||
getConsole().getConsoleManager().removeConsoleListener(this);
|
||||
|
@ -335,6 +337,7 @@ public class BuildConsolePage extends Page
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(IPageSite pageSite) {
|
||||
super.init(pageSite);
|
||||
getSite().getPage().addSelectionListener(this);
|
||||
|
@ -400,16 +403,14 @@ public class BuildConsolePage extends Page
|
|||
Object element = ssel.getFirstElement();
|
||||
if (element instanceof IAdaptable) {
|
||||
IAdaptable input = (IAdaptable)element;
|
||||
if (input != null) {
|
||||
IResource resource = null;
|
||||
if (input instanceof IResource) {
|
||||
resource = (IResource)input;
|
||||
} else {
|
||||
resource = (IResource)input.getAdapter(IResource.class);
|
||||
}
|
||||
if (resource != null) {
|
||||
project = resource.getProject();
|
||||
}
|
||||
IResource resource = null;
|
||||
if (input instanceof IResource) {
|
||||
resource = (IResource)input;
|
||||
} else {
|
||||
resource = (IResource)input.getAdapter(IResource.class);
|
||||
}
|
||||
if (resource != null) {
|
||||
project = resource.getProject();
|
||||
}
|
||||
}
|
||||
return project;
|
||||
|
@ -420,6 +421,7 @@ public class BuildConsolePage extends Page
|
|||
*
|
||||
* @see org.eclipse.ui.part.IPage#getControl()
|
||||
*/
|
||||
@Override
|
||||
public Control getControl() {
|
||||
if (fViewer != null) {
|
||||
return fViewer.getControl();
|
||||
|
@ -432,6 +434,7 @@ public class BuildConsolePage extends Page
|
|||
*
|
||||
* @see org.eclipse.ui.part.IPage#setFocus()
|
||||
*/
|
||||
@Override
|
||||
public void setFocus() {
|
||||
Control control = getControl();
|
||||
if (control != null) {
|
||||
|
@ -470,6 +473,7 @@ public class BuildConsolePage extends Page
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getAdapter(Class required) {
|
||||
if (IFindReplaceTarget.class.equals(required)) {
|
||||
return getViewer().getFindReplaceTarget();
|
||||
|
|
|
@ -33,6 +33,7 @@ public class BuildConsolePartition extends TypedRegion {
|
|||
/**
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object partition) {
|
||||
if (super.equals(partition)) {
|
||||
return fStream.equals(((BuildConsolePartition) partition).getStream());
|
||||
|
@ -43,6 +44,7 @@ public class BuildConsolePartition extends TypedRegion {
|
|||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() + fStream.hashCode();
|
||||
}
|
||||
|
|
|
@ -16,10 +16,6 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||
import org.eclipse.cdt.core.resources.IConsole;
|
||||
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
|
@ -35,6 +31,12 @@ import org.eclipse.jface.util.PropertyChangeEvent;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.ui.console.ConsolePlugin;
|
||||
|
||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||
import org.eclipse.cdt.core.resources.IConsole;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
||||
|
||||
public class BuildConsolePartitioner
|
||||
implements
|
||||
IDocumentPartitioner,
|
||||
|
@ -45,7 +47,7 @@ public class BuildConsolePartitioner
|
|||
/**
|
||||
* List of partitions
|
||||
*/
|
||||
List fPartitions = new ArrayList(5);
|
||||
List<ITypedRegion> fPartitions = new ArrayList<ITypedRegion>(5);
|
||||
|
||||
private int fMaxLines;
|
||||
|
||||
|
@ -64,7 +66,7 @@ public class BuildConsolePartitioner
|
|||
* Intentionally a vector to obtain synchronization as entries are added and
|
||||
* removed.
|
||||
*/
|
||||
Vector fQueue = new Vector(5);
|
||||
Vector<StreamEntry> fQueue = new Vector<StreamEntry>(5);
|
||||
|
||||
//private boolean fAppending;
|
||||
|
||||
|
@ -129,7 +131,7 @@ public class BuildConsolePartitioner
|
|||
synchronized (fQueue) {
|
||||
int i = fQueue.size();
|
||||
if (i > 0) {
|
||||
StreamEntry entry = (StreamEntry)fQueue.get(i - 1);
|
||||
StreamEntry entry = fQueue.get(i - 1);
|
||||
// if last stream is the same and we have not exceeded our
|
||||
// display write limit, append.
|
||||
if (entry.getStream() == stream && entry.size() < 10000) {
|
||||
|
@ -146,7 +148,7 @@ public class BuildConsolePartitioner
|
|||
public void run() {
|
||||
StreamEntry entry;
|
||||
try {
|
||||
entry = (StreamEntry)fQueue.remove(0);
|
||||
entry = fQueue.remove(0);
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
return;
|
||||
}
|
||||
|
@ -227,19 +229,19 @@ public class BuildConsolePartitioner
|
|||
*/
|
||||
public ITypedRegion[] computePartitioning(int offset, int length) {
|
||||
if (offset == 0 && length == fDocument.getLength()) {
|
||||
return (ITypedRegion[])fPartitions.toArray(new ITypedRegion[fPartitions.size()]);
|
||||
return fPartitions.toArray(new ITypedRegion[fPartitions.size()]);
|
||||
}
|
||||
int end = offset + length;
|
||||
List list = new ArrayList();
|
||||
List<ITypedRegion> list = new ArrayList<ITypedRegion>();
|
||||
for (int i = 0; i < fPartitions.size(); i++) {
|
||||
ITypedRegion partition = (ITypedRegion)fPartitions.get(i);
|
||||
ITypedRegion partition = fPartitions.get(i);
|
||||
int partitionStart = partition.getOffset();
|
||||
int partitionEnd = partitionStart + partition.getLength();
|
||||
if ( (offset >= partitionStart && offset <= partitionEnd) || (offset < partitionStart && end >= partitionStart)) {
|
||||
list.add(partition);
|
||||
}
|
||||
}
|
||||
return (ITypedRegion[])list.toArray(new ITypedRegion[list.size()]);
|
||||
return list.toArray(new ITypedRegion[list.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -247,7 +249,7 @@ public class BuildConsolePartitioner
|
|||
*/
|
||||
public ITypedRegion getPartition(int offset) {
|
||||
for (int i = 0; i < fPartitions.size(); i++) {
|
||||
ITypedRegion partition = (ITypedRegion)fPartitions.get(i);
|
||||
ITypedRegion partition = fPartitions.get(i);
|
||||
int start = partition.getOffset();
|
||||
int end = start + partition.getLength();
|
||||
if (offset >= start && offset < end) {
|
||||
|
@ -295,10 +297,10 @@ public class BuildConsolePartitioner
|
|||
} catch (BadLocationException e1) {
|
||||
}
|
||||
// update partitions
|
||||
List newParitions = new ArrayList(fPartitions.size());
|
||||
Iterator partitions = fPartitions.iterator();
|
||||
List<ITypedRegion> newParitions = new ArrayList<ITypedRegion>(fPartitions.size());
|
||||
Iterator<ITypedRegion> partitions = fPartitions.iterator();
|
||||
while (partitions.hasNext()) {
|
||||
ITypedRegion region = (ITypedRegion)partitions.next();
|
||||
ITypedRegion region = partitions.next();
|
||||
if (region instanceof BuildConsolePartition) {
|
||||
BuildConsolePartition messageConsolePartition = (BuildConsolePartition)region;
|
||||
|
||||
|
@ -389,13 +391,16 @@ public class BuildConsolePartitioner
|
|||
fStream = stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
appendToDocument(new String(b, off, len), fStream);
|
||||
}
|
||||
|
|
|
@ -127,6 +127,7 @@ public class BuildConsoleViewer extends TextViewer implements LineStyleListener
|
|||
*
|
||||
* @see org.eclipse.jface.text.ITextViewer#setDocument(org.eclipse.jface.text.IDocument)
|
||||
*/
|
||||
@Override
|
||||
public void setDocument(IDocument doc) {
|
||||
IDocument oldDoc = getDocument();
|
||||
IDocument document = doc;
|
||||
|
|
|
@ -32,6 +32,7 @@ public class ScrollLockAction extends Action {
|
|||
/**
|
||||
* @see org.eclipse.jface.action.IAction#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
fConsoleViewer.setAutoScroll(!isChecked());
|
||||
}
|
||||
|
|
|
@ -97,9 +97,7 @@ public class CHContentProvider extends AsyncTreeContentProvider {
|
|||
if (fComputeReferencedBy) {
|
||||
return asyncronouslyComputeReferencedBy(node);
|
||||
}
|
||||
else {
|
||||
return asyncronouslyComputeRefersTo(node);
|
||||
}
|
||||
return asyncronouslyComputeRefersTo(node);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.log(e);
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CHDropTargetListener implements DropTargetListener {
|
|||
private ICElement checkLocalSelection() {
|
||||
ISelection sel= LocalSelectionTransfer.getTransfer().getSelection();
|
||||
if (sel instanceof IStructuredSelection) {
|
||||
for (Iterator iter = ((IStructuredSelection)sel).iterator(); iter.hasNext();) {
|
||||
for (Iterator<?> iter = ((IStructuredSelection)sel).iterator(); iter.hasNext();) {
|
||||
Object element = iter.next();
|
||||
if (element instanceof ICElement) {
|
||||
return (ICElement) element;
|
||||
|
|
|
@ -52,6 +52,7 @@ public class CHHistoryAction extends Action {
|
|||
/*
|
||||
* @see Action#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
fViewPart.setInput(fElement);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ public class CHHistoryDropDownAction extends Action implements IMenuCreator {
|
|||
fView= view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
fView.setHistoryEntries(new ICElement[0]);
|
||||
fView.setInput(null);
|
||||
|
@ -99,6 +100,7 @@ public class CHHistoryDropDownAction extends Action implements IMenuCreator {
|
|||
item.fill(parent, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
(new CHHistoryListAction(fHierarchyView)).run();
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ public class CHHistoryListAction extends Action {
|
|||
|
||||
private void doSelectionChanged() {
|
||||
StatusInfo status= new StatusInfo();
|
||||
List selected= fHistoryList.getSelectedElements();
|
||||
List<?> selected= fHistoryList.getSelectedElements();
|
||||
if (selected.size() != 1) {
|
||||
status.setError(""); //$NON-NLS-1$
|
||||
fResult= null;
|
||||
|
|
|
@ -26,18 +26,22 @@ public class CHMultiDefChildNode extends CHNode {
|
|||
super(parent, fileOfReferences, timestamp, decl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReferenceCount() {
|
||||
return getParent().getReferenceCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CHReferenceInfo getReference(int idx) {
|
||||
return getParent().getReference(idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFirstReferenceOffset() {
|
||||
return getParent().getFirstReferenceOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addReference(CHReferenceInfo info) {
|
||||
assert false;
|
||||
}
|
||||
|
|
|
@ -34,19 +34,23 @@ public class CHMultiDefNode extends CHNode {
|
|||
return fChildren;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMacro() {
|
||||
return fChildren[0].isMacro();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVariableOrEnumerator() {
|
||||
return fChildren[0].isVariableOrEnumerator();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ICElement getOneRepresentedDeclaration() {
|
||||
return fChildren[0].getRepresentedDeclaration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMultiDef() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -770,7 +770,7 @@ public class CHViewPart extends ViewPart {
|
|||
private CHNode selectionToNode(ISelection selection) {
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection ss= (IStructuredSelection) selection;
|
||||
for (Iterator iter = ss.iterator(); iter.hasNext(); ) {
|
||||
for (Iterator<?> iter = ss.iterator(); iter.hasNext(); ) {
|
||||
Object cand= iter.next();
|
||||
if (cand instanceof CHNode) {
|
||||
return (CHNode) cand;
|
||||
|
|
|
@ -60,7 +60,8 @@ public class CallHierarchyUI {
|
|||
final Display display= Display.getCurrent();
|
||||
|
||||
Job job= new Job(CHMessages.CallHierarchyUI_label) {
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
final ICElement[] elems= findDefinitions(input);
|
||||
if (elems != null && elems.length > 0) {
|
||||
display.asyncExec(new Runnable() {
|
||||
|
@ -120,6 +121,7 @@ public class CallHierarchyUI {
|
|||
final Display display= Display.getCurrent();
|
||||
|
||||
Job job= new Job(CHMessages.CallHierarchyUI_label) {
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
StatusLineHandler.clearStatusLine(editor.getSite());
|
||||
|
@ -183,9 +185,7 @@ public class CallHierarchyUI {
|
|||
}
|
||||
}
|
||||
finally {
|
||||
if (index != null) {
|
||||
index.releaseReadLock();
|
||||
}
|
||||
index.releaseReadLock();
|
||||
}
|
||||
}
|
||||
catch (CoreException e) {
|
||||
|
@ -222,9 +222,7 @@ public class CallHierarchyUI {
|
|||
}
|
||||
}
|
||||
finally {
|
||||
if (index != null) {
|
||||
index.releaseReadLock();
|
||||
}
|
||||
index.releaseReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,10 +42,12 @@ public class OpenCallHierarchyAction extends SelectionDispatchAction {
|
|||
setEnabled(fEditor != null && CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editor.getEditorInput()) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ITextSelection sel) {
|
||||
CallHierarchyUI.open(fEditor, sel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(IStructuredSelection selection) {
|
||||
if (!selection.isEmpty()) {
|
||||
Object selectedObject= selection.getFirstElement();
|
||||
|
@ -56,9 +58,11 @@ public class OpenCallHierarchyAction extends SelectionDispatchAction {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionChanged(ITextSelection sel) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionChanged(IStructuredSelection selection) {
|
||||
if (selection.isEmpty()) {
|
||||
setEnabled(false);
|
||||
|
@ -88,6 +92,7 @@ public class OpenCallHierarchyAction extends SelectionDispatchAction {
|
|||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Object getAdapter(Object object, Class desiredClass) {
|
||||
if (desiredClass.isInstance(object)) {
|
||||
return object;
|
||||
|
|
|
@ -90,6 +90,7 @@ abstract class AbstractMergeViewer extends TextMergeViewer {
|
|||
return fPreferenceStore;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleDispose(DisposeEvent event) {
|
||||
if (fPreferenceChangeListener != null) {
|
||||
fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
|
||||
|
@ -130,14 +131,17 @@ abstract class AbstractMergeViewer extends TextMergeViewer {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDocumentPartitioning() {
|
||||
return ICPartitions.C_PARTITIONING;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IDocumentPartitioner getDocumentPartitioner() {
|
||||
return CUIPlugin.getDefault().getTextTools().createDocumentPartitioner(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureTextViewer(TextViewer textViewer) {
|
||||
if (textViewer instanceof SourceViewer) {
|
||||
((SourceViewer)textViewer).configure(getSourceViewerConfiguration());
|
||||
|
@ -147,6 +151,7 @@ abstract class AbstractMergeViewer extends TextMergeViewer {
|
|||
/*
|
||||
* @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getTitle()
|
||||
*/
|
||||
@Override
|
||||
public abstract String getTitle();
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,6 +46,7 @@ public class AsmMergeViewer extends AbstractMergeViewer {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.ui.compare.AbstractMergeViewer#getSourceViewerConfiguration()
|
||||
*/
|
||||
@Override
|
||||
protected SourceViewerConfiguration getSourceViewerConfiguration() {
|
||||
if (fSourceViewerConfiguration == null) {
|
||||
AsmTextTools tools= CUIPlugin.getDefault().getAsmTextTools();
|
||||
|
@ -58,6 +59,7 @@ public class AsmMergeViewer extends AbstractMergeViewer {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.ui.compare.AbstractMergeViewer#getTitle()
|
||||
*/
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return CUIPlugin.getResourceString(TITLE);
|
||||
}
|
||||
|
@ -65,6 +67,7 @@ public class AsmMergeViewer extends AbstractMergeViewer {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.ui.compare.AbstractMergeViewer#handlePropertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void handlePropertyChange(PropertyChangeEvent event) {
|
||||
super.handlePropertyChange(event);
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ public class CMergeViewer extends AbstractMergeViewer {
|
|||
super(parent, styles, mp);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SourceViewerConfiguration getSourceViewerConfiguration() {
|
||||
if (fSourceViewerConfiguration == null) {
|
||||
CTextTools tools= CUIPlugin.getDefault().getTextTools();
|
||||
|
@ -46,6 +47,7 @@ public class CMergeViewer extends AbstractMergeViewer {
|
|||
return fSourceViewerConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return CUIPlugin.getResourceString(TITLE);
|
||||
}
|
||||
|
@ -53,6 +55,7 @@ public class CMergeViewer extends AbstractMergeViewer {
|
|||
/*
|
||||
* @see org.eclipse.cdt.internal.ui.compare.AbstractMergeViewer#handlePropertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void handlePropertyChange(PropertyChangeEvent event) {
|
||||
super.handlePropertyChange(event);
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ public class CStructureCreator extends StructureCreator {
|
|||
/*
|
||||
* @see org.eclipse.compare.structuremergeviewer.StructureCreator#createStructureComparator(java.lang.Object, org.eclipse.jface.text.IDocument, org.eclipse.compare.ISharedDocumentAdapter, org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
@Override
|
||||
protected IStructureComparator createStructureComparator(Object element,
|
||||
IDocument document, ISharedDocumentAdapter sharedDocumentAdapter,
|
||||
IProgressMonitor monitor) throws CoreException {
|
||||
|
@ -153,6 +154,7 @@ public class CStructureCreator extends StructureCreator {
|
|||
/*
|
||||
* @see org.eclipse.compare.structuremergeviewer.StructureCreator#getDocumentPartitioning()
|
||||
*/
|
||||
@Override
|
||||
protected String getDocumentPartitioning() {
|
||||
return ICPartitions.C_PARTITIONING;
|
||||
}
|
||||
|
@ -160,6 +162,7 @@ public class CStructureCreator extends StructureCreator {
|
|||
/*
|
||||
* @see org.eclipse.compare.structuremergeviewer.StructureCreator#getDocumentPartitioner()
|
||||
*/
|
||||
@Override
|
||||
protected IDocumentPartitioner getDocumentPartitioner() {
|
||||
return CUIPlugin.getDefault().getTextTools().createDocumentPartitioner(null);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
private static final String TRANSLATION_UNIT_NAME = CUIMessages.getString("CStructureCreatorVisitor.translationUnitName"); //$NON-NLS-1$
|
||||
private static final String ANONYMOUS_NAME= CoreModelMessages.getString("CElementLabels.anonymous"); //$NON-NLS-1$
|
||||
|
||||
private Stack fStack = new Stack();
|
||||
private Stack<DocumentRangeNode> fStack = new Stack<DocumentRangeNode>();
|
||||
private IDocument fDocument;
|
||||
private String fTranslationUnitFileName;
|
||||
|
||||
|
@ -86,6 +86,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
|
||||
*/
|
||||
@Override
|
||||
public int visit(IASTTranslationUnit tu) {
|
||||
fTranslationUnitFileName= tu.getFilePath();
|
||||
|
||||
|
@ -167,6 +168,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#leave(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
|
||||
*/
|
||||
@Override
|
||||
public int leave(IASTTranslationUnit tu) {
|
||||
super.leave(tu);
|
||||
assert getCurrentContainer().getTypeCode() == ICElement.C_UNIT;
|
||||
|
@ -177,6 +179,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
|
||||
*/
|
||||
@Override
|
||||
public int visit(IASTDeclaration node) {
|
||||
boolean isTemplateDecl= isTemplateDecl(node);
|
||||
final int startOffset= isTemplateDecl ? getStartOffset(node.getParent()) : getStartOffset(node);
|
||||
|
@ -285,6 +288,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor#visit(org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition)
|
||||
*/
|
||||
@Override
|
||||
public int visit(ICPPASTNamespaceDefinition namespace) {
|
||||
push(ICElement.C_NAMESPACE, ASTStringUtil.getQualifiedName(namespace.getName()), getStartOffset(namespace));
|
||||
return super.visit(namespace);
|
||||
|
@ -293,6 +297,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator)
|
||||
*/
|
||||
@Override
|
||||
public int visit(IASTEnumerator enumerator) {
|
||||
push(ICElement.C_ENUMERATOR, ASTStringUtil.getQualifiedName(enumerator.getName()), getStartOffset(enumerator));
|
||||
pop(getEndOffset(enumerator));
|
||||
|
@ -302,6 +307,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#leave(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
|
||||
*/
|
||||
@Override
|
||||
public int leave(IASTDeclaration node) {
|
||||
super.leave(node);
|
||||
boolean isTemplateDecl= isTemplateDecl(node);
|
||||
|
@ -408,6 +414,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
/*
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor#leave(org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition)
|
||||
*/
|
||||
@Override
|
||||
public int leave(ICPPASTNamespaceDefinition namespace) {
|
||||
assert getCurrentContainer().getTypeCode() == ICElement.C_NAMESPACE;
|
||||
pop(getEndOffset(namespace));
|
||||
|
@ -415,7 +422,7 @@ class CStructureCreatorVisitor extends CPPASTVisitor {
|
|||
}
|
||||
|
||||
private DocumentRangeNode getCurrentContainer() {
|
||||
return (DocumentRangeNode) fStack.peek();
|
||||
return fStack.peek();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -89,7 +89,7 @@ public class BuildGroup extends CViewActionGroup {
|
|||
|
||||
menu.add(new GroupMarker(BUILD_GROUP_MARKER));
|
||||
|
||||
Iterator resources = selection.iterator();
|
||||
Iterator<?> resources = selection.iterator();
|
||||
while (resources.hasNext() && (!hasOpenProjects || !hasClosedProjects || hasBuilder || isProjectSelection)) {
|
||||
Object next = resources.next();
|
||||
IProject project = null;
|
||||
|
|
|
@ -198,6 +198,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
/**
|
||||
* @see IWorkbenchPart#setFocus()
|
||||
*/
|
||||
@Override
|
||||
public void setFocus() {
|
||||
viewer.getTree().setFocus();
|
||||
//composite.setFocus ();
|
||||
|
@ -309,6 +310,8 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
/**
|
||||
* Answer the property defined by key.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object getAdapter(Class key) {
|
||||
if (key.equals(ISelectionProvider.class)) {
|
||||
return viewer;
|
||||
|
@ -323,6 +326,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
/*
|
||||
* (non-Javadoc) Method declared on IViewPart.
|
||||
*/
|
||||
@Override
|
||||
public void init(IViewSite site, IMemento memento) throws PartInitException {
|
||||
super.init(site, memento);
|
||||
this.memento = memento;
|
||||
|
@ -496,16 +500,19 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
|
||||
viewer.getControl().addKeyListener(new KeyAdapter() {
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
handleKeyPressed(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
handleKeyReleased(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPartControl(Composite parent) {
|
||||
|
||||
viewer = createViewer(parent);
|
||||
|
@ -577,6 +584,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
/*
|
||||
* (non-Javadoc) Method declared on IWorkbenchPart.
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (fContextActivation != null) {
|
||||
IContextService ctxService = (IContextService)getSite().getService(IContextService.class);
|
||||
|
@ -920,7 +928,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
|
||||
IMemento childMem = memento.getChild(TAG_EXPANDED);
|
||||
if (childMem != null) {
|
||||
ArrayList elements = new ArrayList();
|
||||
ArrayList<ICElement> elements = new ArrayList<ICElement>();
|
||||
IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
|
||||
for (int i = 0; i < elementMem.length; i++) {
|
||||
String p = elementMem[i].getString(TAG_PATH);
|
||||
|
@ -936,7 +944,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
}
|
||||
childMem = memento.getChild(TAG_SELECTION);
|
||||
if (childMem != null) {
|
||||
ArrayList list = new ArrayList();
|
||||
ArrayList<ICElement> list = new ArrayList<ICElement>();
|
||||
IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
|
||||
for (int i = 0; i < elementMem.length; i++) {
|
||||
String p = elementMem[i].getString(TAG_PATH);
|
||||
|
@ -977,6 +985,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveState(IMemento memento) {
|
||||
if (viewer == null) {
|
||||
if (this.memento != null) { //Keep the old state;
|
||||
|
|
|
@ -97,13 +97,16 @@ public abstract class CViewActionGroup extends ActionGroup {
|
|||
* Called when the context menu is about to open.
|
||||
* Override to add your own context dependent menu contributions.
|
||||
*/
|
||||
@Override
|
||||
public abstract void fillContextMenu(IMenuManager menu);
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
|
||||
*/
|
||||
@Override
|
||||
public abstract void fillActionBars(IActionBars actionBars);
|
||||
|
||||
@Override
|
||||
public abstract void updateActionBars();
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,12 @@ package org.eclipse.cdt.internal.ui.cview;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.ui.IWorkbenchPartSite;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
import org.eclipse.cdt.core.model.IArchiveContainer;
|
||||
|
@ -22,14 +28,10 @@ import org.eclipse.cdt.core.model.ICElement;
|
|||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IIncludeReference;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.ui.CElementContentProvider;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.util.RemoteTreeContentManager;
|
||||
import org.eclipse.cdt.internal.ui.util.RemoteTreeViewer;
|
||||
import org.eclipse.cdt.ui.CElementContentProvider;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.ui.IWorkbenchPartSite;
|
||||
|
||||
/**
|
||||
* CViewContentProvider
|
||||
|
@ -68,6 +70,7 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object[] getChildren(Object element) {
|
||||
Object[] objs = null;
|
||||
|
||||
|
@ -102,7 +105,6 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
extras = ((ILibraryReference)element).getChildren();
|
||||
}*/
|
||||
} catch (CModelException e) {
|
||||
extras = null;
|
||||
}
|
||||
if (extras != null && extras.length > 0) {
|
||||
objs = concatenate(objs, extras);
|
||||
|
@ -165,7 +167,7 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
|
||||
protected IBinary[] getExecutables(IBinaryContainer container) throws CModelException {
|
||||
ICElement[] celements = container.getChildren();
|
||||
ArrayList list = new ArrayList(celements.length);
|
||||
ArrayList<IBinary> list = new ArrayList<IBinary>(celements.length);
|
||||
for (int i = 0; i < celements.length; i++) {
|
||||
if (celements[i] instanceof IBinary) {
|
||||
IBinary bin = (IBinary)celements[i];
|
||||
|
@ -182,6 +184,7 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.BaseCElementContentProvider#internalGetParent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object internalGetParent(Object element) {
|
||||
// since we insert logical containers we have to fix
|
||||
// up the parent for {IInclude,ILibrary}Reference so that they refer
|
||||
|
@ -203,6 +206,7 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildren(Object element) {
|
||||
if (fManager != null) {
|
||||
if (element instanceof IBinary) {
|
||||
|
@ -244,6 +248,7 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (fManager != null) {
|
||||
fManager.cancel();
|
||||
|
@ -254,6 +259,7 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
if (fManager != null) {
|
||||
fManager.cancel();
|
||||
|
|
|
@ -17,7 +17,8 @@ import org.eclipse.ui.views.framelist.TreeViewerFrameSource;
|
|||
public class CViewFrameSource extends TreeViewerFrameSource {
|
||||
private CView cview;
|
||||
|
||||
protected TreeFrame createFrame(Object input) {
|
||||
@Override
|
||||
protected TreeFrame createFrame(Object input) {
|
||||
TreeFrame frame = super.createFrame(input);
|
||||
frame.setToolTipText(cview.getToolTipText(input));
|
||||
return frame;
|
||||
|
@ -25,7 +26,8 @@ public class CViewFrameSource extends TreeViewerFrameSource {
|
|||
/**
|
||||
* Also updates the title of the packages explorer
|
||||
*/
|
||||
protected void frameChanged(TreeFrame frame) {
|
||||
@Override
|
||||
protected void frameChanged(TreeFrame frame) {
|
||||
super.frameChanged(frame);
|
||||
cview.updateTitle();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ public class CViewLabelProvider extends AppearanceAwareLabelProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
if (element instanceof IncludeReferenceProxy) {
|
||||
final IIncludeReference ref = ((IncludeReferenceProxy)element).getReference();
|
||||
|
@ -93,6 +94,7 @@ public class CViewLabelProvider extends AppearanceAwareLabelProvider {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
if (element instanceof IncludeReferenceProxy) {
|
||||
IIncludeReference reference = ((IncludeReferenceProxy)element).getReference();
|
||||
|
|
|
@ -62,11 +62,11 @@ public void run() {
|
|||
}
|
||||
|
||||
super.run();
|
||||
List destinations = getDestinations();
|
||||
List<?> destinations = getDestinations();
|
||||
if (destinations != null && destinations.isEmpty() == false) {
|
||||
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
||||
List<IResource> resources = new ArrayList<IResource>();
|
||||
Iterator iterator = destinations.iterator();
|
||||
Iterator<?> iterator = destinations.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
IResource newResource = root.findMember((IPath) iterator.next());
|
||||
|
|
|
@ -31,6 +31,7 @@ class CollapseAllAction extends Action {
|
|||
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.COLLAPSE_ALL_ACTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
cview.collapseAll();
|
||||
}
|
||||
|
|
|
@ -14,12 +14,11 @@ package org.eclipse.cdt.internal.ui.cview;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.SWTError;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
|
@ -32,6 +31,8 @@ import org.eclipse.ui.PlatformUI;
|
|||
import org.eclipse.ui.actions.SelectionListenerAction;
|
||||
import org.eclipse.ui.part.ResourceTransfer;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
|
||||
/**
|
||||
* Standard action for copying the currently selected resources to the clipboard.
|
||||
* <p>
|
||||
|
@ -97,9 +98,10 @@ public class CopyAction extends SelectionListenerAction {
|
|||
* on <code>IAction</code> copies the selected resources to the
|
||||
* clipboard.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
List selectedResources = getSelectedResources();
|
||||
IResource[] resources = (IResource[]) selectedResources.toArray(new IResource[selectedResources.size()]);
|
||||
List<?> selectedResources = getSelectedResources();
|
||||
IResource[] resources = selectedResources.toArray(new IResource[selectedResources.size()]);
|
||||
|
||||
// Get the file names and a string representation
|
||||
final int length = resources.length;
|
||||
|
@ -160,6 +162,7 @@ public class CopyAction extends SelectionListenerAction {
|
|||
* <code>SelectionListenerAction</code> method enables this action if
|
||||
* one or more resources of compatible types are selected.
|
||||
*/
|
||||
@Override
|
||||
protected boolean updateSelection(IStructuredSelection selection) {
|
||||
if (!super.updateSelection(selection))
|
||||
return false;
|
||||
|
@ -167,7 +170,7 @@ public class CopyAction extends SelectionListenerAction {
|
|||
if (getSelectedNonResources().size() > 0)
|
||||
return false;
|
||||
|
||||
List selectedResources = getSelectedResources();
|
||||
List<?> selectedResources = getSelectedResources();
|
||||
if (selectedResources.size() == 0)
|
||||
return false;
|
||||
|
||||
|
@ -185,7 +188,7 @@ public class CopyAction extends SelectionListenerAction {
|
|||
if (firstParent == null)
|
||||
return false;
|
||||
|
||||
Iterator resourcesEnum = selectedResources.iterator();
|
||||
Iterator<?> resourcesEnum = selectedResources.iterator();
|
||||
while (resourcesEnum.hasNext()) {
|
||||
IResource currentResource = (IResource) resourcesEnum.next();
|
||||
if (!currentResource.getParent().equals(firstParent))
|
||||
|
|
|
@ -25,6 +25,7 @@ public class DefaultAction extends Action {
|
|||
this.shell = shell;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageBox errorMsg = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
|
||||
errorMsg.setText(CViewMessages.getString("DefaultAction.WIP")); //$NON-NLS-1$
|
||||
|
|
|
@ -42,6 +42,7 @@ public class GotoActionGroup extends CViewActionGroup {
|
|||
super(cview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillContextMenu(IMenuManager menu) {
|
||||
IStructuredSelection celements = (IStructuredSelection) getContext().getSelection();
|
||||
IStructuredSelection selection = SelectionConverter.convertSelectionToResources(celements);
|
||||
|
@ -60,6 +61,7 @@ public class GotoActionGroup extends CViewActionGroup {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillActionBars(IActionBars actionBars) {
|
||||
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_INTO, goIntoAction);
|
||||
actionBars.setGlobalActionHandler(ActionFactory.BACK.getId(), backAction);
|
||||
|
@ -72,6 +74,7 @@ public class GotoActionGroup extends CViewActionGroup {
|
|||
toolBar.add(upAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void makeActions() {
|
||||
FrameList frameList = getCView().getFrameList();
|
||||
goIntoAction = new GoIntoAction(frameList);
|
||||
|
@ -82,6 +85,7 @@ public class GotoActionGroup extends CViewActionGroup {
|
|||
|
||||
/* (non-Javadoc)
|
||||
*/
|
||||
@Override
|
||||
public void updateActionBars() {
|
||||
ActionContext context = getContext();
|
||||
boolean enable = false;
|
||||
|
|
|
@ -12,13 +12,15 @@
|
|||
package org.eclipse.cdt.internal.ui.cview;
|
||||
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IIncludeReference;
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.ui.CElementGrouping;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
|
||||
/**
|
||||
* IncludeRefContainer
|
||||
|
@ -38,6 +40,8 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object getAdapter(Class adapter) {
|
||||
if (adapter == IWorkbenchAdapter.class) {
|
||||
return this;
|
||||
|
@ -51,6 +55,7 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object[] getChildren(Object o) {
|
||||
try {
|
||||
IIncludeReference[] references = fCProject.getIncludeReferences();
|
||||
|
@ -67,6 +72,7 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public ImageDescriptor getImageDescriptor(Object object) {
|
||||
return CPluginImages.DESC_OBJS_INCLUDES_CONTAINER;
|
||||
}
|
||||
|
@ -74,6 +80,7 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public String getLabel(Object o) {
|
||||
return CViewMessages.getString("IncludeRefContainer.Includes"); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -81,6 +88,7 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object getParent(Object o) {
|
||||
return getCProject();
|
||||
}
|
||||
|
@ -92,6 +100,7 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof IncludeRefContainer) {
|
||||
IncludeRefContainer other = (IncludeRefContainer)obj;
|
||||
|
@ -103,6 +112,7 @@ public class IncludeRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if (fCProject != null) {
|
||||
return fCProject.hashCode();
|
||||
|
|
|
@ -41,6 +41,7 @@ public class IncludeReferenceProxy extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object[] getChildren(Object object) {
|
||||
try {
|
||||
return reference.getChildren();
|
||||
|
@ -53,6 +54,7 @@ public class IncludeReferenceProxy extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public ImageDescriptor getImageDescriptor(Object object) {
|
||||
return CPluginImages.DESC_OBJS_INCLUDES_FOLDER;
|
||||
}
|
||||
|
@ -60,6 +62,7 @@ public class IncludeReferenceProxy extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object getParent(Object object) {
|
||||
return getIncludeRefContainer();
|
||||
}
|
||||
|
@ -71,6 +74,7 @@ public class IncludeReferenceProxy extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return reference.equals(obj);
|
||||
}
|
||||
|
@ -78,6 +82,7 @@ public class IncludeReferenceProxy extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return reference.toString();
|
||||
}
|
||||
|
|
|
@ -13,16 +13,18 @@ package org.eclipse.cdt.internal.ui.cview;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.ui.CElementGrouping;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.ILibraryReference;
|
||||
import org.eclipse.cdt.ui.CElementGrouping;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
|
||||
/**
|
||||
* VirtualGrouping
|
||||
*/
|
||||
|
@ -42,6 +44,8 @@ public class LibraryRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object getAdapter(Class adapter) {
|
||||
if (adapter == IWorkbenchAdapter.class) {
|
||||
return this;
|
||||
|
@ -55,10 +59,11 @@ public class LibraryRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object[] getChildren(Object o) {
|
||||
try {
|
||||
ILibraryReference[] references = fCProject.getLibraryReferences();
|
||||
ArrayList list = new ArrayList(references.length);
|
||||
ArrayList<ILibraryReference> list = new ArrayList<ILibraryReference>(references.length);
|
||||
for (int i = 0; i < references.length; i++) {
|
||||
IPath path = references[i].getPath();
|
||||
IFile file = references[i].getCModel().getWorkspace().getRoot().getFileForLocation(path);
|
||||
|
@ -75,6 +80,7 @@ public class LibraryRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public ImageDescriptor getImageDescriptor(Object object) {
|
||||
return CPluginImages.DESC_OBJS_LIBRARY;
|
||||
}
|
||||
|
@ -82,6 +88,7 @@ public class LibraryRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public String getLabel(Object o) {
|
||||
return CViewMessages.getString("LibraryRefContainer.Libraries"); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -89,6 +96,7 @@ public class LibraryRefContainer extends CElementGrouping {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object getParent(Object o) {
|
||||
return getCProject();
|
||||
}
|
||||
|
|
|
@ -43,10 +43,12 @@ public class OpenFileGroup extends CViewActionGroup {
|
|||
super(cview);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void makeActions() {
|
||||
openFileAction = new OpenFileAction(getCView().getSite().getPage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillContextMenu(IMenuManager menu) {
|
||||
IStructuredSelection celements = (IStructuredSelection) getContext().getSelection();
|
||||
IStructuredSelection selection = SelectionConverter.convertSelectionToResources(celements);
|
||||
|
@ -116,17 +118,20 @@ public class OpenFileGroup extends CViewActionGroup {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
|
||||
*/
|
||||
public void fillActionBars(IActionBars actionBars) {
|
||||
@Override
|
||||
public void fillActionBars(IActionBars actionBars) {
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.actions.ActionGroup#updateActionBars()
|
||||
*/
|
||||
public void updateActionBars() {
|
||||
@Override
|
||||
public void updateActionBars() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the default action (open file).
|
||||
*/
|
||||
@Override
|
||||
public void runDefaultAction(IStructuredSelection selection) {
|
||||
Object obj = selection.getFirstElement();
|
||||
if (obj instanceof ICElement) {
|
||||
|
|
|
@ -76,7 +76,7 @@ public class OpenProjectGroup extends CViewActionGroup {
|
|||
boolean isProjectSelection = true;
|
||||
boolean hasOpenProjects = false;
|
||||
boolean hasClosedProjects = false;
|
||||
Iterator resources = selection.iterator();
|
||||
Iterator<?> resources = selection.iterator();
|
||||
|
||||
while (resources.hasNext() && (!hasOpenProjects || !hasClosedProjects || isProjectSelection)) {
|
||||
Object next = resources.next();
|
||||
|
|
|
@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.ui.cview;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -29,6 +28,8 @@ import org.eclipse.ui.actions.CopyProjectOperation;
|
|||
import org.eclipse.ui.actions.SelectionListenerAction;
|
||||
import org.eclipse.ui.part.ResourceTransfer;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
|
||||
/**
|
||||
* Standard action for pasting resources on the clipboard to the selected resource's location.
|
||||
* <p>
|
||||
|
@ -77,7 +78,7 @@ public class PasteAction extends SelectionListenerAction {
|
|||
* @return the actual target of the paste action
|
||||
*/
|
||||
private IResource getTarget() {
|
||||
List selectedResources = getSelectedResources();
|
||||
List<?> selectedResources = getSelectedResources();
|
||||
|
||||
for (int i = 0; i < selectedResources.size(); i++) {
|
||||
IResource resource = (IResource) selectedResources.get(i);
|
||||
|
@ -111,6 +112,7 @@ public class PasteAction extends SelectionListenerAction {
|
|||
/**
|
||||
* Implementation of method defined on <code>IAction</code>.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
// try a resource transfer
|
||||
ResourceTransfer resTransfer = ResourceTransfer.getInstance();
|
||||
|
@ -149,7 +151,7 @@ public class PasteAction extends SelectionListenerAction {
|
|||
* Returns the container to hold the pasted resources.
|
||||
*/
|
||||
private IContainer getContainer() {
|
||||
List selection = getSelectedResources();
|
||||
List<?> selection = getSelectedResources();
|
||||
if (selection.get(0) instanceof IFile)
|
||||
return ((IFile) selection.get(0)).getParent();
|
||||
return (IContainer) selection.get(0);
|
||||
|
@ -159,6 +161,7 @@ public class PasteAction extends SelectionListenerAction {
|
|||
* <code>SelectionListenerAction</code> method enables this action if
|
||||
* a resource compatible with what is on the clipboard is selected.
|
||||
*/
|
||||
@Override
|
||||
protected boolean updateSelection(IStructuredSelection selection) {
|
||||
if (!super.updateSelection(selection))
|
||||
return false;
|
||||
|
@ -172,11 +175,7 @@ public class PasteAction extends SelectionListenerAction {
|
|||
}
|
||||
});
|
||||
IResource[] resourceData = clipboardData[0];
|
||||
boolean isProjectRes = resourceData != null
|
||||
&& resourceData.length > 0
|
||||
&& resourceData[0].getType() == IResource.PROJECT;
|
||||
|
||||
if (isProjectRes) {
|
||||
if (resourceData != null && resourceData.length > 0 && resourceData[0].getType() == IResource.PROJECT) {
|
||||
for (int i = 0; i < resourceData.length; i++) {
|
||||
// make sure all resource data are open projects
|
||||
// can paste open projects regardless of selection
|
||||
|
@ -199,7 +198,7 @@ public class PasteAction extends SelectionListenerAction {
|
|||
|
||||
// can paste files and folders to a single selection (file, folder,
|
||||
// open project) or multiple file selection with the same parent
|
||||
List selectedResources = getSelectedResources();
|
||||
List<?> selectedResources = getSelectedResources();
|
||||
if (selectedResources.size() > 1) {
|
||||
// if more than one resource is selected the selection has
|
||||
// to be all files with the same parent
|
||||
|
|
|
@ -13,22 +13,25 @@ package org.eclipse.cdt.internal.ui.cview;
|
|||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceReference;
|
||||
import org.eclipse.cdt.internal.ui.dnd.BasicSelectionTransferDragAdapter;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceReference;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.dnd.BasicSelectionTransferDragAdapter;
|
||||
|
||||
public class SelectionTransferDragAdapter extends BasicSelectionTransferDragAdapter {
|
||||
|
||||
public SelectionTransferDragAdapter(ISelectionProvider provider) {
|
||||
super(provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isDragable(ISelection selection) {
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
for (Iterator iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) {
|
||||
for (Iterator<?> iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) {
|
||||
Object element= iter.next();
|
||||
if (element instanceof ICElement) {
|
||||
if (!(element instanceof ISourceReference)) {
|
||||
|
|
|
@ -17,14 +17,6 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceReference;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.ui.dnd.CDTViewerDropAdapter;
|
||||
import org.eclipse.cdt.internal.ui.dnd.TransferDropTargetListener;
|
||||
import org.eclipse.cdt.internal.ui.util.ExceptionHandler;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
|
@ -38,9 +30,19 @@ import org.eclipse.swt.dnd.Transfer;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ISourceReference;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.dnd.CDTViewerDropAdapter;
|
||||
import org.eclipse.cdt.internal.ui.dnd.TransferDropTargetListener;
|
||||
import org.eclipse.cdt.internal.ui.util.ExceptionHandler;
|
||||
|
||||
public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implements TransferDropTargetListener {
|
||||
|
||||
private List fElements;
|
||||
private List<?> fElements;
|
||||
private ICElement[] fMoveData;
|
||||
private ICElement[] fCopyData;
|
||||
|
||||
|
@ -66,11 +68,13 @@ public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implement
|
|||
|
||||
//---- Actual DND -----------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void dragEnter(DropTargetEvent event) {
|
||||
clear();
|
||||
super.dragEnter(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragLeave(DropTargetEvent event) {
|
||||
clear();
|
||||
super.dragLeave(event);
|
||||
|
@ -82,6 +86,7 @@ public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implement
|
|||
fCopyData = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateDrop(Object target, DropTargetEvent event, int operation) {
|
||||
event.detail= DND.DROP_NONE;
|
||||
|
||||
|
@ -127,6 +132,7 @@ public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implement
|
|||
return Math.abs(LocalSelectionTransfer.getInstance().getSelectionSetTime() - (event.time & 0xFFFFFFFFL)) < DROP_TIME_DIFF_TRESHOLD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(Object target, DropTargetEvent event) {
|
||||
try {
|
||||
switch(event.detail) {
|
||||
|
@ -194,8 +200,10 @@ public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implement
|
|||
ICElement parent = elements[0];
|
||||
for (int i = 0; i < elements.length; ++i) {
|
||||
ICElement p = elements[i].getParent();
|
||||
if (parent == null && p!= null) {
|
||||
return false;
|
||||
if (parent == null) {
|
||||
if (p != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!parent.equals(p)){
|
||||
return false;
|
||||
}
|
||||
|
@ -318,17 +326,17 @@ public class SelectionTransferDropAdapter extends CDTViewerDropAdapter implement
|
|||
context.run(true, true, runnable);
|
||||
}
|
||||
|
||||
public static ICElement[] getCElements(List elements) {
|
||||
List resources= new ArrayList(elements.size());
|
||||
for (Iterator iter= elements.iterator(); iter.hasNext();) {
|
||||
public static ICElement[] getCElements(List<?> elements) {
|
||||
List<ICElement> resources= new ArrayList<ICElement>(elements.size());
|
||||
for (Iterator<?> iter= elements.iterator(); iter.hasNext();) {
|
||||
Object element= iter.next();
|
||||
if (element instanceof ITranslationUnit) {
|
||||
continue;
|
||||
}
|
||||
if (element instanceof ICElement)
|
||||
resources.add(element);
|
||||
resources.add((ICElement) element);
|
||||
}
|
||||
return (ICElement[]) resources.toArray(new ICElement[resources.size()]);
|
||||
return resources.toArray(new ICElement[resources.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ public class ToggleLinkingAction extends AbstractToggleLinkingAction {
|
|||
/**
|
||||
* Runs the action.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
fCView.setLinkingEnabled(isChecked());
|
||||
}
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.dialogs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
|
@ -26,8 +27,6 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
|
||||
/**
|
||||
* A class to select one or more elements out of an indexed property
|
||||
*/
|
||||
|
@ -57,6 +56,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* @private
|
||||
* @see Dialog#cancelPressed
|
||||
*/
|
||||
@Override
|
||||
protected void cancelPressed() {
|
||||
setResult(null);
|
||||
super.cancelPressed();
|
||||
|
@ -68,6 +68,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* @private
|
||||
* @see Window#createDialogArea(Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite contents= (Composite)super.createDialogArea(parent);
|
||||
|
||||
|
@ -116,6 +117,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* @private
|
||||
* @see Window#create(Shell)
|
||||
*/
|
||||
@Override
|
||||
public void create() {
|
||||
super.create();
|
||||
if (isEmptyList()) {
|
||||
|
@ -143,9 +145,9 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* Returns the widget selection. Returns empty list when the widget is not
|
||||
* usable.
|
||||
*/
|
||||
protected List getWidgetSelection() {
|
||||
protected List<?> getWidgetSelection() {
|
||||
if (fSelectionList == null || fSelectionList.isDisposed())
|
||||
return new ArrayList(0);
|
||||
return Collections.emptyList();
|
||||
return fSelectionList.getSelection();
|
||||
}
|
||||
/**
|
||||
|
@ -195,6 +197,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
/*
|
||||
* @private
|
||||
*/
|
||||
@Override
|
||||
public int open() {
|
||||
BusyIndicator.showWhile(null, new Runnable() {
|
||||
public void run() {
|
||||
|
@ -227,6 +230,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* Sets the message to be shown above the match text field.
|
||||
* Must be set before widget creation
|
||||
*/
|
||||
@Override
|
||||
public void setMessage(String message) {
|
||||
fMessageText= message;
|
||||
}
|
||||
|
@ -247,7 +251,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* Initializes the selection list widget with the given list of
|
||||
* elements.
|
||||
*/
|
||||
protected void setSelectionListElements(List elements, boolean refilter) {
|
||||
protected void setSelectionListElements(List<?> elements, boolean refilter) {
|
||||
fSelectionList.setElements(elements, refilter);
|
||||
}
|
||||
/**
|
||||
|
@ -262,7 +266,7 @@ public abstract class AbstractElementListSelectionDialog extends SelectionStatus
|
|||
* accordingly.
|
||||
*/
|
||||
protected boolean verifyCurrentSelection() {
|
||||
List sel= getWidgetSelection();
|
||||
List<?> sel= getWidgetSelection();
|
||||
int length= sel.size();
|
||||
if (length > 0) {
|
||||
if (fValidator != null) {
|
||||
|
|
|
@ -14,30 +14,31 @@ package org.eclipse.cdt.internal.ui.dialogs;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
|
||||
/**
|
||||
* A class to select one or more elements out of an indexed property
|
||||
*/
|
||||
public class ElementListSelectionDialog extends AbstractElementListSelectionDialog {
|
||||
|
||||
private List fElements;
|
||||
private List<?> fElements;
|
||||
|
||||
/*
|
||||
* @private
|
||||
*/
|
||||
@Override
|
||||
protected void computeResult() {
|
||||
setResult(getWidgetSelection());
|
||||
}
|
||||
/*
|
||||
* @private
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Control result= super.createDialogArea(parent);
|
||||
|
||||
|
@ -62,6 +63,7 @@ public class ElementListSelectionDialog extends AbstractElementListSelectionDial
|
|||
/*
|
||||
* @private
|
||||
*/
|
||||
@Override
|
||||
protected void handleDoubleClick() {
|
||||
if (verifyCurrentSelection()) {
|
||||
buttonPressed(IDialogConstants.OK_ID);
|
||||
|
@ -96,7 +98,7 @@ public class ElementListSelectionDialog extends AbstractElementListSelectionDial
|
|||
* @param elements The elements to show in the list
|
||||
* @return Returns OK or CANCEL
|
||||
*/
|
||||
public int open(List elements) {
|
||||
public int open(List<?> elements) {
|
||||
setElements(elements);
|
||||
return open();
|
||||
}
|
||||
|
@ -106,7 +108,7 @@ public class ElementListSelectionDialog extends AbstractElementListSelectionDial
|
|||
* @param initialSelection The initial content of the match text box.
|
||||
* @return Returns OK or CANCEL
|
||||
*/
|
||||
public int open(List elements, String initialSelection) {
|
||||
public int open(List<?> elements, String initialSelection) {
|
||||
setElements(elements);
|
||||
setInitialSelection(initialSelection);
|
||||
return open();
|
||||
|
@ -114,7 +116,7 @@ public class ElementListSelectionDialog extends AbstractElementListSelectionDial
|
|||
/**
|
||||
* Sets the elements presented by this dialog.
|
||||
*/
|
||||
public void setElements(List elements) {
|
||||
public void setElements(List<?> elements) {
|
||||
fElements= elements;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ public class OptionalMessageDialog extends MessageDialog {
|
|||
fId= id;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createCustomArea(Composite parent) {
|
||||
Composite composite= new Composite(parent, SWT.NONE);
|
||||
GridLayout layout= new GridLayout();
|
||||
|
@ -76,6 +77,7 @@ public class OptionalMessageDialog extends MessageDialog {
|
|||
fHideDialogCheckBox= new Button(composite, SWT.CHECK | SWT.LEFT);
|
||||
fHideDialogCheckBox.setText(CHECKBOX_TEXT);
|
||||
fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
setDialogEnabled(fId, !((Button)e.widget).getSelection());
|
||||
}
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
package org.eclipse.cdt.internal.ui.dialogs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
|
@ -29,8 +31,6 @@ import org.eclipse.swt.widgets.Table;
|
|||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.util.StringMatcher;
|
||||
import org.eclipse.cdt.internal.ui.util.TwoArrayQuickSort;
|
||||
|
||||
|
@ -122,11 +122,11 @@ public class SelectionList extends Composite {
|
|||
* returned in the list are the same as the ones passed to the selection list
|
||||
* via <code>setElements</code>. The list doesn't contain the rendered strings.
|
||||
*/
|
||||
public List getSelection() {
|
||||
public List<?> getSelection() {
|
||||
if (fList == null || fList.isDisposed() || fList.getSelectionCount() == 0)
|
||||
return new ArrayList(0);
|
||||
return Collections.emptyList();
|
||||
int[] listSelection= fList.getSelectionIndices();
|
||||
List selected= new ArrayList(listSelection.length);
|
||||
List<Object> selected= new ArrayList<Object>(listSelection.length);
|
||||
for (int i= 0; i < listSelection.length; i++) {
|
||||
selected.add(fElements[fFilteredElements[listSelection[i]]]);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ public class SelectionList extends Composite {
|
|||
/**
|
||||
* Sets the list of elements presented in the widget.
|
||||
*/
|
||||
public void setElements(List elements, boolean refilter) {
|
||||
public void setElements(List<?> elements, boolean refilter) {
|
||||
// We copy the list since we sort it.
|
||||
if (elements == null)
|
||||
fElements= new Object[0];
|
||||
|
@ -189,6 +189,7 @@ public class SelectionList extends Composite {
|
|||
/*
|
||||
* Non Java-doc
|
||||
*/
|
||||
@Override
|
||||
public void setEnabled(boolean enable) {
|
||||
super.setEnabled(enable);
|
||||
fText.setEnabled(enable);
|
||||
|
@ -205,12 +206,14 @@ public class SelectionList extends Composite {
|
|||
/*
|
||||
* Non Java-doc
|
||||
*/
|
||||
@Override
|
||||
public boolean setFocus() {
|
||||
return fText.setFocus();
|
||||
}
|
||||
/*
|
||||
* Non Java-doc
|
||||
*/
|
||||
@Override
|
||||
public void setFont(Font font) {
|
||||
super.setFont(font);
|
||||
fText.setFont(font);
|
||||
|
|
|
@ -14,6 +14,7 @@ package org.eclipse.cdt.internal.ui.dialogs;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -22,11 +23,8 @@ import org.eclipse.swt.widgets.Button;
|
|||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import org.eclipse.ui.dialogs.SelectionDialog;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
||||
/**
|
||||
* An abstract base class for dialogs with a status bar and ok/cancel buttons.
|
||||
* The status message must be passed over as StatusInfo object and can be
|
||||
|
@ -49,6 +47,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
/* (non-Javadoc)
|
||||
* Method declared in Window.
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
if (fImage != null)
|
||||
|
@ -57,6 +56,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
/* (non-Javadoc)
|
||||
* Method declared in Dialog.
|
||||
*/
|
||||
@Override
|
||||
protected Control createButtonBar(Composite parent) {
|
||||
Composite composite= new Composite(parent, SWT.NULL);
|
||||
GridLayout layout= new GridLayout();
|
||||
|
@ -80,6 +80,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
/* (non-Javadoc)
|
||||
* Method declared in Dialog.
|
||||
*/
|
||||
@Override
|
||||
public void create() {
|
||||
super.create();
|
||||
if (fLastStatus != null) {
|
||||
|
@ -92,7 +93,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
* @return the first element of the initial selection.
|
||||
*/
|
||||
protected Object getPrimaryInitialSelection() {
|
||||
List result= getInitialElementSelections();
|
||||
List<?> result= getInitialElementSelections();
|
||||
if (result == null || result.size() == 0)
|
||||
return null;
|
||||
return result.get(0);
|
||||
|
@ -117,6 +118,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
/* (non-Javadoc)
|
||||
* Method declared in Dialog.
|
||||
*/
|
||||
@Override
|
||||
protected void okPressed() {
|
||||
computeResult();
|
||||
super.okPressed();
|
||||
|
@ -130,7 +132,8 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
fImage= image;
|
||||
}
|
||||
protected void setInitialSelection(int position, Object element) {
|
||||
List l= getInitialElementSelections();
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> l= getInitialElementSelections();
|
||||
l.set(position, element);
|
||||
fInitialSelectionSet= true;
|
||||
}
|
||||
|
@ -148,6 +151,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
|
|||
setInitialSelections(new Object[0]);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void setInitialSelections(Object[] selectedElements) {
|
||||
super.setInitialSelections(selectedElements);
|
||||
fInitialSelectionSet= true;
|
||||
|
|
|
@ -78,6 +78,7 @@ public abstract class StatusDialog extends Dialog {
|
|||
/*
|
||||
* @see Window#create(Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
if (fTitle != null)
|
||||
|
@ -87,6 +88,7 @@ public abstract class StatusDialog extends Dialog {
|
|||
/*
|
||||
* @see Window#create()
|
||||
*/
|
||||
@Override
|
||||
public void create() {
|
||||
super.create();
|
||||
if (fLastStatus != null) {
|
||||
|
@ -103,6 +105,7 @@ public abstract class StatusDialog extends Dialog {
|
|||
/*
|
||||
* @see Dialog#createButtonsForButtonBar(Composite)
|
||||
*/
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
fOkButton= createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
|
@ -111,6 +114,7 @@ public abstract class StatusDialog extends Dialog {
|
|||
/*
|
||||
* @see Dialog#createButtonBar(Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createButtonBar(Composite parent) {
|
||||
Composite composite= new Composite(parent, SWT.NULL);
|
||||
GridLayout layout= new GridLayout();
|
||||
|
|
|
@ -126,6 +126,7 @@ public class StatusInfo implements IStatus {
|
|||
* Returns a string representation of the status, suitable
|
||||
* for debugging purposes only.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append("StatusInfo "); //$NON-NLS-1$
|
||||
|
|
|
@ -12,10 +12,8 @@ package org.eclipse.cdt.internal.ui.dialogs;
|
|||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
|
||||
|
||||
|
||||
|
@ -29,16 +27,16 @@ public class TypedElementSelectionValidator implements ISelectionStatusValidator
|
|||
private IStatus fgErrorStatus= new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$
|
||||
private IStatus fgOKStatus= new StatusInfo();
|
||||
|
||||
private Class[] fAcceptedTypes;
|
||||
private Class<?>[] fAcceptedTypes;
|
||||
private boolean fAllowMultipleSelection;
|
||||
private Collection fRejectedElements;
|
||||
private Collection<?> fRejectedElements;
|
||||
|
||||
/**
|
||||
* @param acceptedTypes The types accepted by the validator
|
||||
* @param allowMultipleSelection If set to <code>true</code>, the validator
|
||||
* allows multiple selection.
|
||||
*/
|
||||
public TypedElementSelectionValidator(Class[] acceptedTypes, boolean allowMultipleSelection) {
|
||||
public TypedElementSelectionValidator(Class<?>[] acceptedTypes, boolean allowMultipleSelection) {
|
||||
this(acceptedTypes, allowMultipleSelection, null);
|
||||
}
|
||||
|
||||
|
@ -48,7 +46,7 @@ public class TypedElementSelectionValidator implements ISelectionStatusValidator
|
|||
* allows multiple selection.
|
||||
* @param rejectedElements A list of elements that are not accepted
|
||||
*/
|
||||
public TypedElementSelectionValidator(Class[] acceptedTypes, boolean allowMultipleSelection, Collection rejectedElements) {
|
||||
public TypedElementSelectionValidator(Class<?>[] acceptedTypes, boolean allowMultipleSelection, Collection<Object> rejectedElements) {
|
||||
Assert.isNotNull(acceptedTypes);
|
||||
fAcceptedTypes= acceptedTypes;
|
||||
fAllowMultipleSelection= allowMultipleSelection;
|
||||
|
|
|
@ -19,14 +19,14 @@ import org.eclipse.jface.viewers.ViewerFilter;
|
|||
*/
|
||||
public class TypedViewerFilter extends ViewerFilter {
|
||||
|
||||
private Class[] fAcceptedTypes;
|
||||
private Class<?>[] fAcceptedTypes;
|
||||
private Object[] fRejectedElements;
|
||||
|
||||
/**
|
||||
* Creates a filter that only allows elements of gives types.
|
||||
* @param acceptedTypes The types of accepted elements
|
||||
*/
|
||||
public TypedViewerFilter(Class[] acceptedTypes) {
|
||||
public TypedViewerFilter(Class<?>[] acceptedTypes) {
|
||||
this(acceptedTypes, null);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class TypedViewerFilter extends ViewerFilter {
|
|||
* @param rejectedElements Element equals to the rejected elements are
|
||||
* filtered out
|
||||
*/
|
||||
public TypedViewerFilter(Class[] acceptedTypes, Object[] rejectedElements) {
|
||||
public TypedViewerFilter(Class<?>[] acceptedTypes, Object[] rejectedElements) {
|
||||
Assert.isNotNull(acceptedTypes);
|
||||
fAcceptedTypes= acceptedTypes;
|
||||
fRejectedElements= rejectedElements;
|
||||
|
@ -46,6 +46,7 @@ public class TypedViewerFilter extends ViewerFilter {
|
|||
/**
|
||||
* @see ViewerFilter#select
|
||||
*/
|
||||
@Override
|
||||
public boolean select(Viewer viewer, Object parentElement, Object element) {
|
||||
if (fRejectedElements != null) {
|
||||
for (int i= 0; i < fRejectedElements.length; i++) {
|
||||
|
|
|
@ -195,6 +195,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
|||
fUserSettingsTimeStamp = getEncodedSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
abstract protected void addTabs();
|
||||
|
||||
protected void setCElement(ICElement element) {
|
||||
|
@ -228,6 +229,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
|||
|
||||
// -------- tab switching ----------
|
||||
|
||||
@Override
|
||||
public void setCurrentPage(ICOptionPage page) {
|
||||
super.setCurrentPage(page);
|
||||
CPathBasePage newPage = (CPathBasePage) page;
|
||||
|
@ -278,6 +280,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
|||
fPageCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ICOptionPage getStartPage() {
|
||||
if (fCurrPage == null) {
|
||||
return super.getStartPage();
|
||||
|
|
|
@ -56,6 +56,7 @@ public class ArchiveFileFilter extends ViewerFilter {
|
|||
/*
|
||||
* @see ViewerFilter#select
|
||||
*/
|
||||
@Override
|
||||
public boolean select(Viewer viewer, Object parent, Object element) {
|
||||
if (element instanceof IFile) {
|
||||
if (fExcludes != null && fExcludes.contains(element)) {
|
||||
|
|
|
@ -420,6 +420,7 @@ public class CPElement {
|
|||
/*
|
||||
* @see Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other != null && other.getClass().equals(getClass())) {
|
||||
CPElement elem = (CPElement)other;
|
||||
|
@ -456,6 +457,7 @@ public class CPElement {
|
|||
/*
|
||||
* @see Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int HASH_FACTOR = 89;
|
||||
int hashCode = fPath.hashCode() + fEntryKind;
|
||||
|
@ -494,6 +496,7 @@ public class CPElement {
|
|||
*
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return getPathEntry().toString();
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ public class CPElementFilter extends ViewerFilter {
|
|||
/*
|
||||
* @see ViewerFilter#select
|
||||
*/
|
||||
@Override
|
||||
public boolean select(Viewer viewer, Object parent, Object element) {
|
||||
if (element instanceof CPElement) {
|
||||
for (int i = 0; i < fKind.length; i++) {
|
||||
|
|
|
@ -57,6 +57,7 @@ public class CPElementGroup {
|
|||
return kind;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object arg0) {
|
||||
if (arg0 == this) {
|
||||
return true;
|
||||
|
@ -68,6 +69,7 @@ public class CPElementGroup {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hashCode = parent != null ? parent.hashCode() : 0;
|
||||
hashCode += resource != null ? resource.hashCode() : 0;
|
||||
|
|
|
@ -75,12 +75,14 @@ class CPElementLabelProvider extends LabelProvider implements IColorProvider {
|
|||
/*
|
||||
* @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
inDirect.dispose();
|
||||
inDirect= null;
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
if (element instanceof CPElement) {
|
||||
return getCPElementText((CPElement)element);
|
||||
|
@ -356,6 +358,7 @@ class CPElementLabelProvider extends LabelProvider implements IColorProvider {
|
|||
|
||||
private static final Point SMALL_SIZE = new Point(16, 16);
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
if (element instanceof CPElement) {
|
||||
CPElement cpentry = (CPElement)element;
|
||||
|
|
|
@ -29,6 +29,7 @@ public class CPElementSorter extends ViewerSorter {
|
|||
/*
|
||||
* @see ViewerSorter#category(Object)
|
||||
*/
|
||||
@Override
|
||||
public int category(Object obj) {
|
||||
if (obj instanceof CPElement) {
|
||||
switch ( ((CPElement)obj).getEntryKind()) {
|
||||
|
@ -60,6 +61,7 @@ public class CPElementSorter extends ViewerSorter {
|
|||
return OTHER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sort(Viewer viewer, Object[] elements) {
|
||||
// include paths and symbol definitions must not be sorted
|
||||
List sort = new ArrayList(elements.length);
|
||||
|
|
|
@ -40,6 +40,7 @@ public class CPListImageDescriptor extends CompositeImageDescriptor {
|
|||
/**
|
||||
* @see CompositeImageDescriptor#getSize()
|
||||
*/
|
||||
@Override
|
||||
protected Point getSize() {
|
||||
if (fSize == null) {
|
||||
ImageData data = fBaseImage.getImageData();
|
||||
|
@ -51,6 +52,7 @@ public class CPListImageDescriptor extends CompositeImageDescriptor {
|
|||
/**
|
||||
* @see Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (!(object instanceof CPListImageDescriptor)) {
|
||||
return false;
|
||||
|
@ -63,6 +65,7 @@ public class CPListImageDescriptor extends CompositeImageDescriptor {
|
|||
/**
|
||||
* @see Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return fBaseImage.hashCode() & flags | fSize.hashCode();
|
||||
}
|
||||
|
@ -70,6 +73,7 @@ public class CPListImageDescriptor extends CompositeImageDescriptor {
|
|||
/**
|
||||
* @see CompositeImageDescriptor#drawCompositeImage(int, int)
|
||||
*/
|
||||
@Override
|
||||
protected void drawCompositeImage(int width, int height) {
|
||||
ImageData bg = fBaseImage.getImageData();
|
||||
if (bg == null) {
|
||||
|
|
|
@ -46,6 +46,7 @@ public class CPathContainerDescriptor implements IContainerDescriptor {
|
|||
* @author Dave
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public static class PathEntryContainerPageAdapter implements IWizardPage, IPathEntryContainerPage {
|
||||
public static IPathEntryContainerPage createAdapter(Object elem) {
|
||||
if (elem instanceof org.eclipse.cdt.ui.wizards.ICPathContainerPage) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue