--- a/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/BuildPKGCommandHandler.java Fri Sep 17 11:13:41 2010 -0500
+++ b/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/BuildPKGCommandHandler.java Fri Sep 17 11:14:06 2010 -0500
@@ -48,9 +48,7 @@
import com.nokia.carbide.cdt.builder.builder.CarbideCommandLauncher;
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
-import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1;
import com.nokia.carbide.cpp.internal.builder.utils.Activator;
-import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
public class BuildPKGCommandHandler extends AbstractHandler {
@@ -151,14 +149,11 @@
IPath workingDir = cpi.getINFWorkingDirectory();
CarbideCommandLauncher bldMakeLauncher = new CarbideCommandLauncher(project, monitor, CarbideCPPBuilder.getParserIdArray(ICarbideBuildConfiguration.ERROR_PARSERS_SIS_BUILDER), workingDir);
bldMakeLauncher.showCommand(true);
- String defaultConfigName = cpi.getDefaultBuildConfigName();
ICarbideBuildConfiguration defaultConfig = cpi.getDefaultConfiguration();
- // TODO: YUCKY!!!
- ISymbianBuildContext context = BuildContextSBSv1.getBuildContextFromDisplayName(defaultConfigName);
bldMakeLauncher.startTimingStats();
- bldMakeLauncher.writeToConsole("\n***Building \"" + finalComponentName + "\" for project \"" + projectName + "\" and configuration \"" + context.getDisplayString() + "\".\n");
+ bldMakeLauncher.writeToConsole("\n***Building \"" + finalComponentName + "\" for project \"" + projectName + "\" and configuration \"" + defaultConfig.getDisplayString() + "\".\n");
CarbideCPPBuilder.invokeSISBuilder(finalPKGPath, defaultConfig, bldMakeLauncher, subMonitor, false);
bldMakeLauncher.writeToConsole(bldMakeLauncher.getTimingStats());
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/ConnectionUIUtils.java Fri Sep 17 11:13:41 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/ConnectionUIUtils.java Fri Sep 17 11:14:06 2010 -0500
@@ -20,16 +20,15 @@
import java.util.Collection;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
import com.nokia.carbide.remoteconnections.interfaces.IConnectedService;
-import com.nokia.carbide.remoteconnections.interfaces.IConnection;
import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus;
import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus;
+import com.nokia.carbide.remoteconnections.interfaces.IConnection;
import com.nokia.carbide.remoteconnections.internal.api.IConnection2;
import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IConnectionStatus;
import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IConnectionStatus.EConnectionStatus;
@@ -77,7 +76,6 @@
public static final Color COLOR_GREEN = new Color(Display.getDefault(), 0, 128, 0);
public static final Color COLOR_ELECTRIC = new Color(Display.getDefault(), 0, 0, 255);
public static final Color COLOR_GREY = new Color(Display.getDefault(), 96, 96, 96);
- public static final Color COLOR_HYPERLINK = JFaceColors.getHyperlinkText(Display.getDefault());
/**
* Get the image representing the connection status.
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/StatusDisplay.java Fri Sep 17 11:13:41 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/StatusDisplay.java Fri Sep 17 11:14:06 2010 -0500
@@ -151,7 +151,7 @@
});
}
else {
- int style = SWT.YES | SWT.NO;
+ int style = prompt != null ? SWT.YES | SWT.NO : 0;
switch (status.getSeverity()) {
case IStatus.INFO:
style |= SWT.ICON_INFORMATION;
@@ -170,8 +170,10 @@
messageBox.setText(getTitleString(status));
StringBuilder sb = new StringBuilder();
sb.append(status.getMessage());
- sb.append("\n");
- sb.append(prompt);
+ if (prompt != null) {
+ sb.append("\n");
+ sb.append(prompt);
+ }
messageBox.setMessage(sb.toString());
int open = messageBox.open();
closed = true;
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Fri Sep 17 11:13:41 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Fri Sep 17 11:14:06 2010 -0500
@@ -48,6 +48,7 @@
import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeNodeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
@@ -111,6 +112,8 @@
import com.nokia.cpp.internal.api.utils.core.ObjectUtils;
import com.nokia.cpp.internal.api.utils.core.Pair;
import com.nokia.cpp.internal.api.utils.ui.BrowseDialogUtils;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser.Element;
public class ConnectionSettingsPage extends WizardPage implements ISettingsChangedListener {
@@ -802,8 +805,15 @@
public void statusChanged(final IStatus status) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- if (!statusText.isDisposed())
- statusText.setText(status.getLongDescription());
+ if (!statusText.isDisposed()) {
+ String longDescription = status.getLongDescription();
+ if (longDescription != null) {
+ List<Element> elements = LinkParser.parseText(longDescription);
+ StyledString styledString = LinkParser.getStyledString(elements);
+ longDescription = styledString.getString();
+ }
+ statusText.setText(longDescription);
+ }
if (status.getEStatus().equals(EStatus.UP))
resetServiceTesting(false);
}
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/DescriptionLabelProvider.java Fri Sep 17 11:13:41 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/DescriptionLabelProvider.java Fri Sep 17 11:14:06 2010 -0500
@@ -2,15 +2,11 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.StyledString;
-import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeViewerColumn;
import org.eclipse.jface.viewers.ViewerCell;
@@ -19,7 +15,6 @@
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.TextStyle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@@ -36,41 +31,16 @@
import com.nokia.carbide.remoteconnections.internal.ui.ConnectionUIUtils;
import com.nokia.carbide.remoteconnections.settings.ui.SettingsWizard;
import com.nokia.cpp.internal.api.utils.core.TextUtils;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser;
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser.Element;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser.LinkElement;
public class DescriptionLabelProvider extends StyledCellLabelProvider {
- private class Element {
- private String text;
-
- public Element(String text) {
- this.text = text;
- }
-
- public String getText() {
- return text;
- }
- }
-
- private class LinkElement extends Element {
- private String href;
-
- public LinkElement(String href, String text) {
- super(text);
- this.href = href;
- }
-
- public String getHref() {
- return href;
- }
- }
-
- private static final Pattern HREF_PATTERN =
- Pattern.compile("<a href=\"([^\"]*)\">(.*?)</a>", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
private static final String AGENT_INSTALLERS_URL = "about:agentInstallers"; //$NON-NLS-1$
private final ConnectionsView connectionsView;
- private Styler hyperLinkStyler;
private TreeViewerColumn treeViewerColumn;
private Listener mouseListener;
@@ -78,13 +48,6 @@
this.connectionsView = connectionsView;
this.treeViewerColumn = treeViewerColumn;
hookColumn();
- hyperLinkStyler = new Styler() {
- @Override
- public void applyStyles(TextStyle textStyle) {
- textStyle.foreground = ConnectionUIUtils.COLOR_HYPERLINK;
- textStyle.underline = true;
- }
- };
}
private void hookColumn() {
@@ -122,7 +85,7 @@
return null;
TreeItem item = (TreeItem) cell.getItem();
String text = getText(cell.getElement());
- List<Element> elements = parseText(text);
+ List<Element> elements = LinkParser.parseText(text);
if (elements.isEmpty())
return null;
int locMouseX = event.x - item.getTextBounds(ConnectionsView.DESCRIPTION_COLUMN_INDEX).x;
@@ -211,9 +174,9 @@
public void update(ViewerCell cell) {
Object element = cell.getElement();
String text = getText(element);
- List<Element> elements = parseText(text);
+ List<Element> elements = LinkParser.parseText(text);
- StyledString styledString = getStyledString(elements);
+ StyledString styledString = LinkParser.getStyledString(elements);
cell.setText(styledString.toString());
cell.setStyleRanges(styledString.getStyleRanges());
@@ -223,34 +186,6 @@
super.update(cell);
}
- private List<Element> parseText(String text) {
- List<Element> elements = new ArrayList<Element>();
- if (text != null) {
- Matcher m = HREF_PATTERN.matcher(text);
- int start = 0;
- int end;
- while (m.find()) {
- end = m.start();
- if (start <= end)
- elements.add(new Element(text.substring(start, end)));
- elements.add(new LinkElement(m.group(1), m.group(2)));
- start = m.end();
- }
- end = text.length();
- if (start <= end)
- elements.add(new Element(text.substring(start, end)));
- }
- return elements;
- }
-
- private StyledString getStyledString(List<Element> elements) {
- StyledString styledString = new StyledString();
- for (Element element : elements) {
- styledString.append(element.getText(), element instanceof LinkElement ? hyperLinkStyler : null);
- }
- return styledString;
- }
-
private String getText(Object obj) {
TreeNode node = (TreeNode) obj;
Object value = node.getValue();
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Fri Sep 17 11:14:06 2010 -0500
@@ -153,7 +153,7 @@
SBSv2QueryUtils.removeAllCachedQueries();
// do the real sdk scanning in a job.
if (scanJob.getState() == Job.NONE) {
- scanJob.setUser(true);
+ scanJob.setSystem(false);
scanJob.schedule();
}
}
@@ -331,9 +331,6 @@
sdk = SymbianSDKFactory.createInstance(id,
entry.getEpocRoot(),
osVersion);
- if (isInSDKList(sdk)) {
- continue;
- }
((SymbianSDK)sdk).setEnabled(entry.isEnabled());
synchronized (sdkList) {
sdkList.add(sdk);
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Fri Sep 17 11:14:06 2010 -0500
@@ -83,6 +83,7 @@
protected boolean doScanSDKs(IProgressMonitor monitor) {
boolean result = true;
+ scanCarbideSDKCache();
DevicesType devicesType;
try {
File devicesFile = getDevicesXMLFile();
@@ -108,7 +109,6 @@
result = false;
}
- scanCarbideSDKCache();
doScanDrives(monitor);
return result;
}
@@ -490,7 +490,9 @@
@Override
protected boolean isInSDKList(ISymbianSDK sdk) {
for (ISymbianSDK entry : sdkList) {
- if (entry.getEPOCROOT().equalsIgnoreCase(sdk.getEPOCROOT())) {
+ File f1 = new File(entry.getEPOCROOT());
+ File f2 = new File(sdk.getEPOCROOT());
+ if (f1.equals(f2)) {
return true;
}
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF Fri Sep 17 11:14:06 2010 -0500
@@ -14,7 +14,8 @@
com.nokia.carbide.templatewizard,
com.nokia.cpp.utils.core,
com.nokia.cpp.utils.ui,
- com.nokia.carbide.discovery.ui;bundle-version="1.0.0"
+ com.nokia.carbide.discovery.ui;bundle-version="1.0.0",
+ com.nokia.carbide.remoteConnections;bundle-version="3.0.0"
Bundle-ActivationPolicy: lazy
Export-Package: com.nokia.carbide.cpp.internal.api.sdk.ui,
com.nokia.carbide.cpp.sdk.ui.shared
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java Fri Sep 17 11:14:06 2010 -0500
@@ -35,6 +35,7 @@
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin;
import com.nokia.carbide.internal.discovery.ui.p2.DynamicP2Installer;
+import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
public class NewPluginChecker {
@@ -72,7 +73,8 @@
try {
IStatus status = DynamicP2Installer.install(sdk.getUniqueId(), featureDir, subMonitor);
if (status.isOK()) {
- // TODO advise user??
+ RemoteConnectionsActivator.getStatusDisplay().displayStatus(
+ SDKUIPlugin.makeStatus(IStatus.INFO, "Installed features from\n" + sdk.getUniqueId(), null));
installed = true;
}
else if (status.getSeverity() == IStatus.CANCEL) {
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java Fri Sep 17 11:14:06 2010 -0500
@@ -16,6 +16,8 @@
*/
package com.nokia.carbide.cpp.sdk.ui;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Shell;
@@ -150,4 +152,13 @@
}
}
+
+ public static IStatus makeErrorStatus(String message, Throwable t) {
+ return makeStatus(IStatus.ERROR, message, t);
+ }
+
+ public static IStatus makeStatus(int severity, String message, Throwable t) {
+ return new Status(severity, PLUGIN_ID, message, t);
+ }
+
}
--- a/core/com.nokia.carbide.discovery.ui/META-INF/MANIFEST.MF Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/META-INF/MANIFEST.MF Fri Sep 17 11:14:06 2010 -0500
@@ -22,7 +22,6 @@
org.eclipse.jface.text,
org.eclipse.ui.editors,
org.eclipse.ui.forms;bundle-version="3.5.0",
- com.nokia.carbide.remoteConnections;bundle-version="3.0.0",
com.nokia.cpp.utils.ui;bundle-version="1.0.0",
com.nokia.cpp.utils.core;bundle-version="1.0.0",
org.eclipse.equinox.p2.touchpoint.natives;bundle-version="1.0.200"
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/NavigationBar.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/NavigationBar.java Fri Sep 17 11:14:06 2010 -0500
@@ -19,8 +19,6 @@
import java.util.LinkedHashMap;
import java.util.Map;
-import org.eclipse.jface.layout.RowDataFactory;
-import org.eclipse.jface.layout.RowLayoutFactory;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
@@ -29,6 +27,7 @@
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
@@ -56,7 +55,11 @@
parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
this.portalEditor = portalEditor;
buttonToPageMap = new LinkedHashMap<Button, PortalPage>();
- RowLayoutFactory.swtDefaults().margins(3, 3).wrap(false).applyTo(this);
+ FillLayout layout = new FillLayout(SWT.HORIZONTAL);
+ layout.spacing = 5;
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ setLayout(layout);
listener = new ButtonListener();
selectedButtonFont = JFaceResources.getHeaderFont();
FontData[] fontData = selectedButtonFont.getFontData();
@@ -79,7 +82,6 @@
b.setText(page.getTitle());
b.setImage(portalEditor.createImage(page.getImageDescriptor(), 16, 16));
b.addSelectionListener(listener);
- RowDataFactory.swtDefaults().applyTo(b);
buttonToPageMap.put(b, page);
}
@@ -94,10 +96,4 @@
button.setFont(selectedButtonFont);
layout();
}
-
- @Override
- public void layout() {
- super.layout();
- pack();
- }
}
\ No newline at end of file
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java Fri Sep 17 11:14:06 2010 -0500
@@ -243,10 +243,10 @@
// create background
backgroundParent = new Composite(parent, SWT.NONE);
applyBG(backgroundParent);
- GridLayoutFactory.fillDefaults().applyTo(backgroundParent);
+ GridLayoutFactory.fillDefaults().margins(10, 0).applyTo(backgroundParent);
// create top navigation bar
navigationBar = createNavigationBar(backgroundParent);
- GridDataFactory.swtDefaults().grab(true, false).align(SWT.CENTER, SWT.TOP).indent(10, 10).applyTo(navigationBar);
+ GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.TOP).indent(0, 10).applyTo(navigationBar);
// create stack composite
createStackComposite(backgroundParent, navigationBar);
return backgroundParent;
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalPage.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalPage.java Fri Sep 17 11:14:06 2010 -0500
@@ -154,7 +154,7 @@
for (Layer layer : layers) {
Composite layerComposite = new SharedBackgroundComposite(pageComposite, backgroundParent);
GridDataFactory.fillDefaults().grab(true, true).applyTo(layerComposite);
- GridLayoutFactory.fillDefaults().numColumns(2).spacing(20, 0).extendedMargins(20, 20, 20, 0).applyTo(layerComposite);
+ GridLayoutFactory.fillDefaults().numColumns(2).spacing(10, 0).extendedMargins(0, 0, 10, 0).applyTo(layerComposite);
createTaskBarControls(portalEditor, layerComposite, layer.getLayer());
createMainControl(portalEditor, layerComposite, layer.getLayer());
layer.setControl(layerComposite);
@@ -167,7 +167,7 @@
GridLayoutFactory.fillDefaults().applyTo(taskComposite);
GridDataFactory.fillDefaults().grab(false, true).applyTo(taskComposite);
TaskBar taskBar = new TaskBar(taskComposite, backgroundParent, this);
- GridDataFactory.fillDefaults().minSize(150, SWT.DEFAULT).grab(true, false).indent(0, 0).applyTo(taskBar);
+ GridDataFactory.fillDefaults().minSize(120, SWT.DEFAULT).grab(true, false).indent(0, 0).applyTo(taskBar);
pageTaskBars.add(taskBar);
ActionUIUpdater updater = new ActionUIUpdater();
createCommandBars(backgroundParent, taskComposite, updater,
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/p2/DynamicP2Installer.java Fri Sep 17 11:13:41 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/p2/DynamicP2Installer.java Fri Sep 17 11:14:06 2010 -0500
@@ -39,7 +39,6 @@
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import com.nokia.carbide.discovery.ui.Activator;
-import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
/**
* Installer to install features from a p2 repository at a supplied URL or directory.
@@ -85,8 +84,6 @@
try {
DynamicP2Installer installer = new DynamicP2Installer(repositoryDirectory);
installer.doInstall(monitor);
- RemoteConnectionsActivator.getStatusDisplay().displayStatus(
- Activator.makeStatus(IStatus.INFO, "Installed features from " + sdkId, null));
return Status.OK_STATUS;
} catch (CoreException e) {
return e.getStatus();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.cpp.utils.ui/src/com/nokia/cpp/internal/api/utils/ui/LinkParser.java Fri Sep 17 11:14:06 2010 -0500
@@ -0,0 +1,78 @@
+package com.nokia.cpp.internal.api.utils.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.resource.JFaceColors;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.widgets.Display;
+
+public class LinkParser {
+
+ public static class Element {
+ private String text;
+
+ public Element(String text) {
+ this.text = text;
+ }
+
+ public String getText() {
+ return text;
+ }
+ }
+
+ public static class LinkElement extends Element {
+ private String href;
+
+ public LinkElement(String href, String text) {
+ super(text);
+ this.href = href;
+ }
+
+ public String getHref() {
+ return href;
+ }
+ }
+
+ private static final Pattern HREF_PATTERN = Pattern.compile("<a href=\"([^\"]*)\">(.*?)</a>", Pattern.CASE_INSENSITIVE);
+ private static Styler hyperLinkStyler = new Styler() {
+ @Override
+ public void applyStyles(TextStyle textStyle) {
+ textStyle.foreground = JFaceColors.getHyperlinkText(Display.getDefault());
+ textStyle.underline = true;
+ }
+ };
+
+ public static List<Element> parseText(String text) {
+ List<Element> elements = new ArrayList<Element>();
+ if (text != null) {
+ Matcher m = HREF_PATTERN.matcher(text);
+ int start = 0;
+ int end;
+ while (m.find()) {
+ end = m.start();
+ if (start <= end)
+ elements.add(new Element(text.substring(start, end)));
+ elements.add(new LinkElement(m.group(1), m.group(2)));
+ start = m.end();
+ }
+ end = text.length();
+ if (start <= end)
+ elements.add(new Element(text.substring(start, end)));
+ }
+ return elements;
+ }
+
+ public static StyledString getStyledString(List<Element> elements) {
+ StyledString styledString = new StyledString();
+ for (Element element : elements) {
+ styledString.append(element.getText(), element instanceof LinkElement ? hyperLinkStyler : null);
+ }
+ return styledString;
+ }
+
+}
\ No newline at end of file
--- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Fri Sep 17 11:13:41 2010 -0500
+++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Fri Sep 17 11:14:06 2010 -0500
@@ -234,7 +234,7 @@
EStatus serviceStatus = tcfTRKStatus;
EConnectionStatus connectionStatus = service2ConnectionStatus(serviceStatus);
if (!connectionStatus.equals(EConnectionStatus.READY)) {
- serviceStatus = trkStatus;
+ serviceStatus = tcfTRKStatus; // C3TCF !!!!!!!!!!!!!
connectionStatus = service2ConnectionStatus(serviceStatus);
}
--- a/debuggercdi/com.nokia.cdt.debug.common/src/com/nokia/cdt/debug/common/internal/executables/SymbianSourceFileRemapping.java Fri Sep 17 11:13:41 2010 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.common/src/com/nokia/cdt/debug/common/internal/executables/SymbianSourceFileRemapping.java Fri Sep 17 11:14:06 2010 -0500
@@ -16,19 +16,83 @@
*/
package com.nokia.cdt.debug.common.internal.executables;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping;
+import org.eclipse.cdt.debug.core.sourcelookup.MappingSourceContainer;
+import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
+import org.eclipse.cdt.debug.internal.core.sourcelookup.MapEntrySourceContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
import com.nokia.cdt.debug.common.internal.source.lookup.SymbianSourceContainer;
public class SymbianSourceFileRemapping implements ISourceFileRemapping {
+ public final String foundMappingsContainerName = "Found Mappings"; //$NON-NLS-1$
+
+ private Job saveThePrefsJob = new Job(""){
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ System.out.println("save prefs");
+ CDebugCorePlugin.getDefault().savePluginPreferences();
+ return Status.OK_STATUS;
+ }};
+
+ @SuppressWarnings("restriction")
+ private void addSourceMappingToDirector(IPath missingPath, IPath newSourcePath, AbstractSourceLookupDirector director) throws CoreException {
+
+ ArrayList<ISourceContainer> containerList = new ArrayList<ISourceContainer>(Arrays.asList(director.getSourceContainers()));
+
+ boolean hasFoundMappings = false;
+
+ MappingSourceContainer foundMappings = null;
+
+ for (Iterator<ISourceContainer> iter = containerList.iterator(); iter.hasNext() && !hasFoundMappings;) {
+ ISourceContainer container = (ISourceContainer) iter.next();
+ if (container instanceof MappingSourceContainer)
+ {
+ hasFoundMappings = container.getName().equals(foundMappingsContainerName);
+ if (hasFoundMappings)
+ foundMappings = (MappingSourceContainer) container;
+ }
+ }
+
+ if (!hasFoundMappings) {
+ foundMappings = new MappingSourceContainer(foundMappingsContainerName);
+ foundMappings.init(director);
+ containerList.add(foundMappings);
+ director.setSourceContainers((ISourceContainer[]) containerList.toArray(new ISourceContainer[containerList.size()]));
+ }
+
+ foundMappings.addMapEntry(new MapEntrySourceContainer(missingPath, newSourcePath));
+ }
+
+ @SuppressWarnings("restriction")
+ private void addSourceMappingToCommon(IPath missingPath, IPath newSourcePath) throws CoreException {
+ CSourceLookupDirector director = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector();
+ addSourceMappingToDirector(missingPath, newSourcePath, director);
+ // We need to save the prefs to make sure this is persistent. But if we do it immediately
+ // here it will be slow and redundant if we are being used to remap a large collection
+ // of source files. So we save the prefs later in a job.
+ saveThePrefsJob.cancel();
+ saveThePrefsJob.schedule(1000);
+ }
+
public String remapSourceFile(IPath executable, String filePath) {
try {
@@ -54,17 +118,22 @@
Object[] foundElements = symbianSourceContainer.findSourceElements(filePath);
if (foundElements.length == 1)
{
+ IPath missingPath = new Path(filePath);
+ IPath foundPath = null;
if (foundElements[0] instanceof LocalFileStorage)
{
LocalFileStorage newLocation = (LocalFileStorage) foundElements[0];
- filePath = newLocation.getFullPath().toOSString();
+ foundPath = newLocation.getFullPath();
+ filePath = foundPath.toOSString();
}
else
if (foundElements[0] instanceof IResource)
{
IResource newResource = (IResource) foundElements[0];
- filePath = newResource.getLocation().toOSString();
+ foundPath = newResource.getLocation();
+ filePath = foundPath.toOSString();
}
+ addSourceMappingToCommon(missingPath, foundPath);
}
} catch (CoreException e) {}
--- a/debuggercdi/com.nokia.cdt.debug.common/src/com/nokia/cdt/debug/common/internal/source/lookup/SourceMappingUtils.java Fri Sep 17 11:13:41 2010 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.common/src/com/nokia/cdt/debug/common/internal/source/lookup/SourceMappingUtils.java Fri Sep 17 11:14:06 2010 -0500
@@ -4,7 +4,9 @@
import java.util.Arrays;
import java.util.Iterator;
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -70,6 +72,16 @@
if (!hasSymbianContainer) {
String epocRootPath = configuration.getAttribute( EPOCROOT_SETTING, (String)null );
+ if (epocRootPath == null)
+ {
+ String exeName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
+ IPath executable = new Path(exeName);
+ String[] segs = executable.segments();
+ for (int i = 0; i < segs.length; i++) {
+ if (segs[i].equalsIgnoreCase("epoc32"))
+ epocRootPath = executable.removeLastSegments(segs.length - i).toOSString();
+ }
+ }
if (epocRootPath != null)
{
symbianContainer = new SymbianSourceContainer(new Path(epocRootPath));
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/ConnectToDeviceDialog.java Fri Sep 17 11:13:41 2010 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/ConnectToDeviceDialog.java Fri Sep 17 11:14:06 2010 -0500
@@ -38,6 +38,7 @@
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
@@ -59,13 +60,15 @@
import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
import com.nokia.carbide.remoteconnections.interfaces.IConnectedService;
+import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatusChangedListener;
import com.nokia.carbide.remoteconnections.interfaces.IConnection;
import com.nokia.carbide.remoteconnections.interfaces.IConnectionType;
import com.nokia.carbide.remoteconnections.interfaces.IConnectionTypeProvider;
import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager;
-import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatusChangedListener;
import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionListener;
import com.nokia.carbide.remoteconnections.settings.ui.SettingsWizard;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser;
+import com.nokia.cpp.internal.api.utils.ui.LinkParser.Element;
/**
* This dialog allows in-depth configuration of the connection settings.
@@ -216,6 +219,11 @@
if (!serviceStatus.getEStatus().equals(
com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus.UP)) {
String description = serviceStatus.getLongDescription();
+ if (description != null) {
+ List<Element> elements = LinkParser.parseText(description);
+ StyledString styledString = LinkParser.getStyledString(elements);
+ description = styledString.getString();
+ }
status = warning(Messages.getString("ConnectToDeviceDialog.ServiceNotAvailWarning"), //$NON-NLS-1$
description == null ? "" : description); //$NON-NLS-1$
}