01: /*******************************************************************************
02: * Copyright (c) 2003, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide.dialogs;
11:
12: import java.io.PrintWriter;
13: import java.net.URL;
14: import com.ibm.icu.text.DateFormat;
15: import java.util.Date;
16:
17: import org.eclipse.osgi.util.NLS;
18: import org.eclipse.ui.about.ISystemSummarySection;
19: import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
20: import org.eclipse.update.configurator.ConfiguratorUtils;
21: import org.eclipse.update.configurator.IPlatformConfiguration;
22: import org.eclipse.update.configurator.IPlatformConfiguration.IFeatureEntry;
23: import org.eclipse.update.configurator.IPlatformConfiguration.ISiteEntry;
24:
25: /**
26: * Writes information about the update configurer into the system summary.
27: *
28: * @since 3.0
29: */
30: public class ConfigurationLogUpdateSection implements
31: ISystemSummarySection {
32: public void write(PrintWriter writer) {
33:
34: IPlatformConfiguration platformConf = ConfiguratorUtils
35: .getCurrentPlatformConfiguration();
36: writer
37: .println(IDEWorkbenchMessages.ConfigurationLogUpdateSection_installConfiguration);
38: writer
39: .println(" " + NLS.bind(IDEWorkbenchMessages.ConfigurationLogUpdateSection_lastChangedOn, DateFormat.getDateInstance().format(new Date(platformConf.getChangeStamp())))); //$NON-NLS-1$
40: writer
41: .println(" " + NLS.bind(IDEWorkbenchMessages.ConfigurationLogUpdateSection_location, platformConf.getConfigurationLocation())); //$NON-NLS-1$
42:
43: ISiteEntry[] sites = platformConf.getConfiguredSites();
44: writer.println();
45: writer
46: .println(" " + IDEWorkbenchMessages.ConfigurationLogUpdateSection_configurationSites); //$NON-NLS-1$
47: for (int i = 0; i < sites.length; i++) {
48: writer.println(" " + sites[i].getURL().toExternalForm()); //$NON-NLS-1$
49: }
50:
51: writer.println();
52: writer
53: .println(" " + IDEWorkbenchMessages.ConfigurationLogUpdateSection_configurationFeatures); //$NON-NLS-1$
54: IFeatureEntry[] features = platformConf
55: .getConfiguredFeatureEntries();
56: for (int i = 0; i < features.length; i++) {
57: writer
58: .println(" " + NLS.bind(IDEWorkbenchMessages.ConfigurationLogUpdateSection_featureIdAndVersion, features[i].getFeaturePluginIdentifier(), features[i].getFeaturePluginVersion())); //$NON-NLS-1$
59: }
60:
61: writer.println();
62: URL[] urls = platformConf.getPluginPath();
63: writer
64: .println(" " + IDEWorkbenchMessages.ConfigurationLogUpdateSection_plugins); //$NON-NLS-1$
65: for (int j = 0; j < urls.length; j++) {
66: writer.println(" " + urls[j].toExternalForm()); //$NON-NLS-1$
67: }
68: }
69: }
|