KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > dialogs > ConfigurationLogUpdateSection


1 /*******************************************************************************
2  * Copyright (c) 2003, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.ide.dialogs;
12
13 import java.io.PrintWriter JavaDoc;
14 import java.net.URL JavaDoc;
15 import com.ibm.icu.text.DateFormat;
16 import java.util.Date JavaDoc;
17
18 import org.eclipse.osgi.util.NLS;
19 import org.eclipse.ui.about.ISystemSummarySection;
20 import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
21 import org.eclipse.update.configurator.ConfiguratorUtils;
22 import org.eclipse.update.configurator.IPlatformConfiguration;
23 import org.eclipse.update.configurator.IPlatformConfiguration.IFeatureEntry;
24 import org.eclipse.update.configurator.IPlatformConfiguration.ISiteEntry;
25
26 /**
27  * Writes information about the update configurer into the system summary.
28  *
29  * @since 3.0
30  */

31 public class ConfigurationLogUpdateSection implements ISystemSummarySection {
32     public void write(PrintWriter JavaDoc writer) {
33         
34         IPlatformConfiguration platformConf = ConfiguratorUtils.getCurrentPlatformConfiguration();
35         writer.println(IDEWorkbenchMessages.ConfigurationLogUpdateSection_installConfiguration);
36         writer.println(" " + NLS.bind( IDEWorkbenchMessages.ConfigurationLogUpdateSection_lastChangedOn, DateFormat.getDateInstance().format(new Date JavaDoc(platformConf.getChangeStamp())))); //$NON-NLS-1$
37
writer.println(" " + NLS.bind( IDEWorkbenchMessages.ConfigurationLogUpdateSection_location, platformConf.getConfigurationLocation())); //$NON-NLS-1$
38

39         ISiteEntry[] sites = platformConf.getConfiguredSites();
40         writer.println();
41         writer.println(" " + IDEWorkbenchMessages.ConfigurationLogUpdateSection_configurationSites); //$NON-NLS-1$
42
for(int i = 0; i < sites.length; i++){
43             writer.println(" " + sites[i].getURL().toExternalForm()); //$NON-NLS-1$
44
}
45         
46         writer.println();
47         writer.println(" " + IDEWorkbenchMessages.ConfigurationLogUpdateSection_configurationFeatures); //$NON-NLS-1$
48
IFeatureEntry[] features = platformConf.getConfiguredFeatureEntries();
49         for(int i = 0; i < features.length; i++){
50             writer.println(" " + NLS.bind( IDEWorkbenchMessages.ConfigurationLogUpdateSection_featureIdAndVersion, features[i].getFeaturePluginIdentifier(), features[i].getFeaturePluginVersion())); //$NON-NLS-1$
51
}
52         
53         writer.println();
54         URL JavaDoc[] urls = platformConf.getPluginPath();
55         writer.println(" " + IDEWorkbenchMessages.ConfigurationLogUpdateSection_plugins); //$NON-NLS-1$
56
for(int j = 0; j < urls.length; j++){
57             writer.println(" " + urls[j].toExternalForm()); //$NON-NLS-1$
58
}
59     }
60 }
61
Popular Tags