[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Patch for Bugzilla # 71858 To select Default HP Error Parsers if os is HP-UX
|
Hi,
Please find the patch file for Bugzilla # 71858. Please apply this patch on
CDT HEAD.
Problem:
--------------
There are parsers for GNU compiler, assembler etc., These parsers are
selected by default in the UI screen.
If I write HP Error parsers, I would like these parsers to be selected by
default if OS = HP-UX.
Solution :
-------------
The fix will first check if the OS = HP-UX . If so , then it will select
the HP Error Parsers in the UI screen by default. The Error Parsers would be
submitted to the community in due course.
- Bala
Index: AbstractErrorParserBlock.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java,v
retrieving revision 1.9
diff -u -r1.9 AbstractErrorParserBlock.java
--- AbstractErrorParserBlock.java 11 Aug 2004 17:39:57 -0000 1.9
+++ AbstractErrorParserBlock.java 12 Aug 2004 10:18:16 -0000
@@ -52,6 +52,7 @@
protected HashMap mapParsers = new HashMap();
private CheckedListDialogField fErrorParserList;
protected boolean listDirty = false;
+ protected static boolean dirtyFlag = false;
class FieldListenerAdapter implements IDialogFieldListener {
@@ -107,13 +108,38 @@
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
List list = new ArrayList(tok.countTokens());
while (tok.hasMoreElements()) {
- list.add(tok.nextToken());
+
+ String arch = Platform.getOSArch();
+ String os = Platform.getOS();
+
+ if (! os.equalsIgnoreCase("hpux") ||
+ ! arch.equalsIgnoreCase("ia64")) {
+ list.add(tok.nextToken());
+ } else {
+ String nextToken = tok.nextToken();
+ String subString = nextToken.substring
+ (nextToken.lastIndexOf(".") + 1);
+ //dirtyFlag determines whether any change in the
+ //default selection of Error Parser was done.
+ //This flag is set in performApply(IProgressMonitor monitor)
+ //method.
+ if (!dirtyFlag) {
+ //If os is hpux and arch is ia64, then select all
+ //HP Error Parsers the very first time. After the first time,
+ //the selection depends on the user's selection.
+ if(subString.startsWith("HP")) {
+ list.add (nextToken);
+ }
+ } else {
+ list.add (nextToken);
+ }
+ }
}
return (String[]) list.toArray(empty);
}
return empty;
}
-
+
/**
* To be implemented, abstract method.
* @param project
@@ -224,7 +250,7 @@
fErrorParserList.setDownButtonIndex(1);
fErrorParserList.setCheckAllButtonIndex(3);
fErrorParserList.setUncheckAllButtonIndex(4);
-
+
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fErrorParserList }, true);
LayoutUtil.setHorizontalGrabbing(fErrorParserList.getListControl(null));
@@ -258,6 +284,7 @@
}
monitor.worked(1);
monitor.done();
+ dirtyFlag = true;
}
}