# HG changeset patch # User timkelly # Date 1282776905 18000 # Node ID 9c8b9f280200f1bc5ad8e3602b654d7ea0244664 # Parent d61921bcf8f341ad7143065f86cbc29b6563a1d0# Parent 988b4ab1b8c1a166c31b8cfb7dacc9f57cad93f5 merge commit diff -r d61921bcf8f3 -r 9c8b9f280200 carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/img/about_cpp.png Binary file carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/img/about_cpp.png has changed diff -r d61921bcf8f3 -r 9c8b9f280200 carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/img/gold_header.png Binary file carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/img/gold_header.png has changed diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about.png has changed diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about_cpp.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about_cpp.png has changed diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/gold_header.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/gold_header.png has changed diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java Wed Aug 25 17:54:33 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java Wed Aug 25 17:55:05 2010 -0500 @@ -65,8 +65,10 @@ public static String ExportPage_Title; public static String ExportPage_ViewerGroupLabel; public static String ExportWizard_ErrorTitle; + public static String ExportWizard_ReadInstalledFeaturesError; public static String ExportWizard_Title; public static String ExportWizard_WriteFileError; + public static String ExportWizard_WriteInstalledFeaturesError; public static String FeatureInstallOperation_ConfiguringTaskName; public static String FeatureInstallOperation_IdLabel; public static String FeatureInstallOperation_MissingFeaturesError; diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties Wed Aug 25 17:54:33 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties Wed Aug 25 17:55:05 2010 -0500 @@ -43,8 +43,10 @@ ExportPage_Title=Export Installed Feature Configuration ExportPage_ViewerGroupLabel=Export features: ExportWizard_ErrorTitle=Error +ExportWizard_ReadInstalledFeaturesError=Could not read installed features file: ExportWizard_Title=Export ExportWizard_WriteFileError=Could not write export file due to error: {0} +ExportWizard_WriteInstalledFeaturesError=Could not write installed features file: FeatureInstallOperation_ConfiguringTaskName=Configuring install operation FeatureInstallOperation_IdLabel=id= FeatureInstallOperation_MissingFeaturesError=Install failed. Could not find some features: \n diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/AbstractImportExportPage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/AbstractImportExportPage.java Wed Aug 25 17:54:33 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/AbstractImportExportPage.java Wed Aug 25 17:55:05 2010 -0500 @@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; @@ -137,6 +138,7 @@ return null; } }); + viewer.setSorter(new ViewerSorter()); viewer.getControl().setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportPage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportPage.java Wed Aug 25 17:54:33 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportPage.java Wed Aug 25 17:55:05 2010 -0500 @@ -21,6 +21,8 @@ import java.io.File; import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; +import java.util.Set; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; @@ -46,9 +48,11 @@ private File file; private Collection featureInfos; private static String saveAsParent; + private Set filteredFeatureIds; - protected ExportPage() { + protected ExportPage(Collection filteredFeatureIds) { super("ExportPage"); //$NON-NLS-1$ + this.filteredFeatureIds = new HashSet(filteredFeatureIds); setTitle(Messages.ExportPage_Title); setDescription(Messages.ExportPage_Description); } @@ -100,14 +104,25 @@ UIJob j = new UIJob(Messages.ExportPage_GetFeaturesJobName) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { - viewer.setInput(P2Utils.getInstalledFeatures(monitor)); + viewer.setInput(getInstalledFeatureInfos(monitor)); updateViewer(); return Status.OK_STATUS; - } + } }; j.schedule(); } + private Collection getInstalledFeatureInfos(IProgressMonitor monitor) { + Collection featureInfos = new ArrayList(); + // filter out the filtered ids + for (FeatureInfo featureInfo : P2Utils.getInstalledFeatures(monitor)) { + if (!filteredFeatureIds.contains(featureInfo.getId())) + featureInfos.add(featureInfo); + } + + return featureInfos; + } + protected boolean validatePage() { setErrorMessage(null); if (viewer.getTable().getItemCount() == 0) { diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportWizard.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportWizard.java Wed Aug 25 17:54:33 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportWizard.java Wed Aug 25 17:55:05 2010 -0500 @@ -19,14 +19,24 @@ package com.nokia.carbide.internal.discovery.ui.wizard; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream; +import java.net.URI; +import java.net.URL; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.ui.IExportWizard; import org.eclipse.ui.IWorkbench; @@ -61,8 +71,42 @@ public void init(IWorkbench workbench, IStructuredSelection selection) { setDefaultPageImageDescriptor(Activator.getImageDescriptor("icons\\install_wiz.gif")); //$NON-NLS-1$ setWindowTitle(Messages.ExportWizard_Title); - exportPage = new ExportPage(); + exportPage = new ExportPage(getFilteredFeatureIds()); addPage(exportPage); } + private Collection getFilteredFeatureIds() { + Collection installedFeatures = null; + Location installLocation = Platform.getInstallLocation(); + URL url = installLocation.getURL(); + IPath path = new Path(url.getPath()); + path = path.append("configuration/installedFeatures.xml"); //$NON-NLS-1$ + File file = path.toFile(); + if (!file.exists()) { + installedFeatures = P2Utils.getInstalledFeatures(new NullProgressMonitor()); + ImportExportData data = new ImportExportData(false, Collections.emptyList(), installedFeatures); + try { + Streamer.writeToXML(new FileOutputStream(file), data); + } catch (Exception e) { + Activator.logError(Messages.ExportWizard_WriteInstalledFeaturesError + file, e); + } + } + else { + try { + ImportExportData data = Streamer.readFromXML(new FileInputStream(file)); + installedFeatures = data.getFeatureInfos(); + } catch (Exception e) { + Activator.logError(Messages.ExportWizard_ReadInstalledFeaturesError + file, e); + } + } + + Collection filteredIds = new ArrayList(); + if (installedFeatures != null) { + for (FeatureInfo featureInfo : installedFeatures) { + filteredIds.add(featureInfo.getId()); + } + } + return filteredIds; + } + } diff -r d61921bcf8f3 -r 9c8b9f280200 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/FeatureInfo.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/FeatureInfo.java Wed Aug 25 17:54:33 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/FeatureInfo.java Wed Aug 25 17:55:05 2010 -0500 @@ -70,4 +70,9 @@ return false; return true; } + + @Override + public String toString() { + return getId() + " " + getVersion().toString(); //$NON-NLS-1$ + } } \ No newline at end of file