Display SDKs with errors in red.
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Thu Jun 17 16:52:50 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Fri Jun 18 11:57:32 2010 -0500
@@ -38,6 +38,7 @@
import org.eclipse.jface.viewers.EditingSupport;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -82,7 +83,7 @@
extends PreferencePage
implements IWorkbenchPreferencePage {
- private class SDKLabelProvider extends LabelProvider implements ITableLabelProvider {
+ private class SDKLabelProvider extends LabelProvider implements ITableLabelProvider, ITableColorProvider {
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
@@ -98,6 +99,15 @@
return "";
}
}
+
+ public Color getForeground(Object element, int columnIndex) {
+ ISymbianSDK sdk = (ISymbianSDK) element;
+ return updateSDKcolor(sdk);
+ }
+
+ public Color getBackground(Object element, int columnIndex) {
+ return white;
+ }
}
private class IdEditingSupport extends EditingSupport {
@@ -252,9 +262,10 @@
private Label iconLabel;
private Label statusLabel;
- private Color red;
private Color black;
private Color gray;
+ private Color red;
+ private Color white;
/**
* Constructor.
@@ -339,9 +350,10 @@
protected Control createContents(Composite parent) {
// Set up colors used in this preference page
Shell shell = parent.getShell();
- red = shell.getDisplay().getSystemColor(SWT.COLOR_RED);
black = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
gray = shell.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+ red = shell.getDisplay().getSystemColor(SWT.COLOR_RED);
+ white = shell.getDisplay().getSystemColor(SWT.COLOR_WHITE);
Composite content = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout();
@@ -636,6 +648,27 @@
statusLabel.getParent().layout(true);
}
+ private Color updateSDKcolor(ISymbianSDK sdk){
+ Color color = black;
+
+ // Check SDK EPOCROOT
+ String epocRootStr = sdk.getEPOCROOT();
+ IPath epocRoot = new Path(epocRootStr);
+ epocRoot = epocRoot.append("epoc32");
+ File epocRootFile = epocRoot.toFile();
+ if (!epocRootFile.exists()) {
+ color = red;
+ }
+
+ // Check SDK OS Version
+ if ((sdk.getOSVersion().getMajor() < 9 ||
+ (sdk.getOSVersion().getMajor() == 9 && sdk.getOSVersion().getMinor() < 4))) {
+ color = red;
+ }
+
+ return color;
+ }
+
private void updateSDKStatus(ISymbianSDK sdk){
// No SDK selected
if (sdk == null) {