1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Patch for Devin Steffler -

Fixed 92074- [Indexer View] constructors (now methodDecl) do not show up in Indexer View
This commit is contained in:
Bogdan Gheorghe 2005-04-21 15:53:36 +00:00
parent cef2041f15
commit f9c9df1db7
3 changed files with 12 additions and 28 deletions

View file

@ -66,8 +66,6 @@ public class FilterIndexerViewDialog extends Dialog {
private String message = "Filter Indexer Results (. = any character, .* = any string):"; //$NON-NLS-1$ private String message = "Filter Indexer Results (. = any character, .* = any string):"; //$NON-NLS-1$
//public static final int ENTRY_REF = 1;
//public static final String ENTRY_REF_STRING = String.valueOf(IndexerOutput.REF);
public static final int ENTRY_TYPE_REF = 2; public static final int ENTRY_TYPE_REF = 2;
public static final String ENTRY_TYPE_REF_STRING = String.valueOf(IndexerOutput.TYPE_REF); public static final String ENTRY_TYPE_REF_STRING = String.valueOf(IndexerOutput.TYPE_REF);
public static final String ENTRY_TYPE_DECL_STRING = String.valueOf(IndexerOutput.TYPE_DECL); public static final String ENTRY_TYPE_DECL_STRING = String.valueOf(IndexerOutput.TYPE_DECL);
@ -75,10 +73,6 @@ public class FilterIndexerViewDialog extends Dialog {
public static final String ENTRY_FUNCTION_REF_STRING = String.valueOf(IndexerOutput.FUNCTION_REF); public static final String ENTRY_FUNCTION_REF_STRING = String.valueOf(IndexerOutput.FUNCTION_REF);
public static final int ENTRY_FUNCTION_DECL = 5; public static final int ENTRY_FUNCTION_DECL = 5;
public static final String ENTRY_FUNCTION_DECL_STRING = String.valueOf(IndexerOutput.FUNCTION_DECL); public static final String ENTRY_FUNCTION_DECL_STRING = String.valueOf(IndexerOutput.FUNCTION_DECL);
public static final int ENTRY_CONSTRUCTOR_REF = 6;
//public static final String ENTRY_CONSTRUCTOR_REF_STRING = String.valueOf(IndexerOutput.CONSTRUCTOR_REF);
//public static final int ENTRY_CONSTRUCTOR_DECL = 7;
//public static final String ENTRY_CONSTRUCTOR_DECL_STRING = String.valueOf(IndexerOutput.CONSTRUCTOR_DECL);
public static final int ENTRY_NAMESPACE_REF = 8; public static final int ENTRY_NAMESPACE_REF = 8;
public static final String ENTRY_NAMESPACE_REF_STRING = String.valueOf(IndexerOutput.NAMESPACE_REF); public static final String ENTRY_NAMESPACE_REF_STRING = String.valueOf(IndexerOutput.NAMESPACE_REF);
public static final int ENTRY_NAMESPACE_DECL = 9; public static final int ENTRY_NAMESPACE_DECL = 9;
@ -99,8 +93,6 @@ public class FilterIndexerViewDialog extends Dialog {
public static final String ENTRY_MACRO_DECL_STRING = String.valueOf(IndexerOutput.MACRO_DECL); public static final String ENTRY_MACRO_DECL_STRING = String.valueOf(IndexerOutput.MACRO_DECL);
public static final int ENTRY_INCLUDE_REF = 17; public static final int ENTRY_INCLUDE_REF = 17;
public static final String ENTRY_INCLUDE_REF_STRING = String.valueOf(IndexerOutput.INCLUDE_REF); public static final String ENTRY_INCLUDE_REF_STRING = String.valueOf(IndexerOutput.INCLUDE_REF);
//public static final int ENTRY_SUPER_REF = 18;
//public static final String ENTRY_SUPER_REF_STRING = String.valueOf(IndexerOutput.SUPER_REF);
public static final int ENTRY_TYPE_DECL_T = 19; public static final int ENTRY_TYPE_DECL_T = 19;
public static final String ENTRY_TYPE_DECL_T_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.TYPEDEF_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR); public static final String ENTRY_TYPE_DECL_T_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.TYPEDEF_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
public static final int ENTRY_TYPE_DECL_C = 20; public static final int ENTRY_TYPE_DECL_C = 20;

View file

@ -36,7 +36,7 @@ public class IndexerFilterManager {
if (leaf.getName() != null && nameFilters != null && nameFilters.length > 0) { if (leaf.getName() != null && nameFilters != null && nameFilters.length > 0) {
boolean matchesPattern=false; boolean matchesPattern=false;
for(int l=0; l<nameFilters.length; l++) { for(int l=0; l<nameFilters.length; l++) {
if (nameFilters[l].equals(BLANK_STRING) || leaf.getName().matches(nameFilters[l])) { if (nameFilters[l].equals(BLANK_STRING) || leaf.getShortName().matches(nameFilters[l])) {
matchesPattern=true; matchesPattern=true;
break; break;
} }

View file

@ -53,28 +53,16 @@ public class IndexerNodeLeaf implements IAdaptable {
String stringBeforeName = null; String stringBeforeName = null;
// set the filtersFlag // set the filtersFlag
/*if (word.startsWith(FilterIndexerViewDialog.ENTRY_REF_STRING)) { if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_REF;
} else */if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING; stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_TYPE_REF; filtersType = FilterIndexerViewDialog.ENTRY_TYPE_REF;
// } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_STRING)) {
// stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_DECL_STRING;
// filtersType = FilterIndexerViewDialog.ENTRY_TYPE_DECL;
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING; stringBeforeName = FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_FUNCTION_REF; filtersType = FilterIndexerViewDialog.ENTRY_FUNCTION_REF;
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING; stringBeforeName = FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_FUNCTION_DECL; filtersType = FilterIndexerViewDialog.ENTRY_FUNCTION_DECL;
} /*else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF;
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL;
}*/ else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING; stringBeforeName = FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_NAMESPACE_REF; filtersType = FilterIndexerViewDialog.ENTRY_NAMESPACE_REF;
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_DECL_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_DECL_STRING)) {
@ -104,10 +92,7 @@ public class IndexerNodeLeaf implements IAdaptable {
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING; stringBeforeName = FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_INCLUDE_REF; filtersType = FilterIndexerViewDialog.ENTRY_INCLUDE_REF;
} /*else if (word.startsWith(FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_SUPER_REF;
}*/ else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) {
stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING; stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING;
filtersType = FilterIndexerViewDialog.ENTRY_TYPE_DECL_T; filtersType = FilterIndexerViewDialog.ENTRY_TYPE_DECL_T;
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_C_STRING)) { } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_C_STRING)) {
@ -295,7 +280,7 @@ public class IndexerNodeLeaf implements IAdaptable {
public String toString() { public String toString() {
if (!parent.isDisplayFullName() && name.indexOf(IndexerOutput.SEPARATOR) > 0) if (!parent.isDisplayFullName() && name.indexOf(IndexerOutput.SEPARATOR) > 0)
return name.substring(0, name.indexOf(IndexerOutput.SEPARATOR)); return getShortName();
return name; return name;
} }
@ -311,4 +296,11 @@ public class IndexerNodeLeaf implements IAdaptable {
public String getName() { public String getName() {
return name; return name;
} }
public String getShortName() {
if (name.indexOf(IndexerOutput.SEPARATOR) > 0)
return name.substring(0, name.indexOf(IndexerOutput.SEPARATOR));
return name;
}
} }