Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2005-01-27 22:42:58 +0000
committercvs2svn2005-01-27 22:42:58 +0000
commit99ab45e9b465a45e819095f3ab04293a61246778 (patch)
treeee5989ed81f3d0593322521b3f3a6ad964c24109
parent3f89391e238488ff2a724603cc6933af767cdfaa (diff)
downloadeclipse.platform.runtime-99ab45e9b465a45e819095f3ab04293a61246778.tar.gz
eclipse.platform.runtime-99ab45e9b465a45e819095f3ab04293a61246778.tar.xz
eclipse.platform.runtime-99ab45e9b465a45e819095f3ab04293a61246778.zip
This commit was manufactured by cvs2svn to create tag 'R3_0_2'.R3_0_2
Sprout from master 2004-06-24 19:54:42 UTC Jeff McAffer <jeff> 'update jave doc' Cherrypick from R3_0_maintenance 2005-01-27 22:42:57 UTC rchaves <rchaves> 'Bug 72597 - bad line ending in MANIFEST.MF keeps eclipse from booting (again)': bundles/org.eclipse.core.runtime/.options bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentType.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentTypeManager.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/FileSpec.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyInputStream.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyReader.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/DefaultPreferences.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/InstancePreferences.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/Extension.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionRegistry.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionsParser.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CompatibilityHelper.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java tests/org.eclipse.core.tests.runtime/plugin.xml tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/IRegistryChangeEventTest.java tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyInputStreamTest.java tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyReaderTest.java Delete: bundles/org.eclipse.core.tools/.classpath bundles/org.eclipse.core.tools/.cvsignore bundles/org.eclipse.core.tools/.options bundles/org.eclipse.core.tools/.project bundles/org.eclipse.core.tools/.settings/org.eclipse.core.resources.prefs bundles/org.eclipse.core.tools/META-INF/MANIFEST.MF bundles/org.eclipse.core.tools/about.html bundles/org.eclipse.core.tools/about.ini bundles/org.eclipse.core.tools/about.mappings bundles/org.eclipse.core.tools/about.properties bundles/org.eclipse.core.tools/build.properties bundles/org.eclipse.core.tools/cpl-v10.html bundles/org.eclipse.core.tools/doc/hglegal2002.htm bundles/org.eclipse.core.tools/doc/ngibmcpy2002.gif bundles/org.eclipse.core.tools/doc/readme.html bundles/org.eclipse.core.tools/icons/classes.gif bundles/org.eclipse.core.tools/icons/clear.gif bundles/org.eclipse.core.tools/icons/collapseall.gif bundles/org.eclipse.core.tools/icons/datasheet.gif bundles/org.eclipse.core.tools/icons/plugin.gif bundles/org.eclipse.core.tools/icons/refresh.gif bundles/org.eclipse.core.tools/icons/req_plugins_obj.gif bundles/org.eclipse.core.tools/icons/reset.gif bundles/org.eclipse.core.tools/icons/spy.gif bundles/org.eclipse.core.tools/icons/trace.gif bundles/org.eclipse.core.tools/icons/zoom.gif bundles/org.eclipse.core.tools/notice.html bundles/org.eclipse.core.tools/plugin.xml bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractCopySelectionAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractTreeContentProvider.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/BaseTextView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ByteUtil.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ClearTextAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CollapseAllAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyStructuredSelectionAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyTextSelectionAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CoreToolsPlugin.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/DeepSize.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ErrorUtil.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/GlobalAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/IFlattable.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ISorter.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ITreeNodeVisitor.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/Policy.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SelectAllAction.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SpyView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableSelectionProviderDecorator.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableWithTotalView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeContentProviderNode.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeSelectionProviderDecorator.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeTextOperationTarget.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/messages.properties bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewContentProvider.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewLabelProvider.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewSorter.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/EclipsePreferencesView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewContentProvider.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewLabelProvider.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewSorter.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDataSheetView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyGraphNode.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyPerspective.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginListView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PreferenceStatsView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/RuntimeSpyPerspective.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/StackTraceView.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassInfo.java bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassloaderInfo.java features/org.eclipse.core.tools-feature/.project features/org.eclipse.core.tools-feature/build.properties features/org.eclipse.core.tools-feature/cpl-v10.html features/org.eclipse.core.tools-feature/eclipse_update_120.jpg features/org.eclipse.core.tools-feature/feature.properties features/org.eclipse.core.tools-feature/feature.xml features/org.eclipse.core.tools-feature/license.html
-rw-r--r--bundles/org.eclipse.core.runtime/.options3
-rw-r--r--bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentType.java120
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentTypeManager.java42
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/FileSpec.java18
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyInputStream.java6
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyReader.java6
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/DefaultPreferences.java8
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/InstancePreferences.java20
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/Extension.java5
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionRegistry.java17
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionsParser.java17
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java22
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java35
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CompatibilityHelper.java10
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java9
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties387
-rw-r--r--bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java6
-rw-r--r--bundles/org.eclipse.core.tools/.classpath7
-rw-r--r--bundles/org.eclipse.core.tools/.cvsignore2
-rw-r--r--bundles/org.eclipse.core.tools/.options11
-rw-r--r--bundles/org.eclipse.core.tools/.project34
-rw-r--r--bundles/org.eclipse.core.tools/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.core.tools/META-INF/MANIFEST.MF17
-rw-r--r--bundles/org.eclipse.core.tools/about.html30
-rw-r--r--bundles/org.eclipse.core.tools/about.ini27
-rw-r--r--bundles/org.eclipse.core.tools/about.mappings6
-rw-r--r--bundles/org.eclipse.core.tools/about.properties14
-rw-r--r--bundles/org.eclipse.core.tools/build.properties4
-rw-r--r--bundles/org.eclipse.core.tools/cpl-v10.html125
-rw-r--r--bundles/org.eclipse.core.tools/doc/hglegal2002.htm14
-rw-r--r--bundles/org.eclipse.core.tools/doc/ngibmcpy2002.gifbin1045 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/doc/readme.html236
-rw-r--r--bundles/org.eclipse.core.tools/icons/classes.gifbin164 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/clear.gifbin162 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/collapseall.gifbin88 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/datasheet.gifbin116 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/plugin.gifbin164 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/refresh.gifbin182 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/req_plugins_obj.gifbin173 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/reset.gifbin900 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/spy.gifbin908 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/trace.gifbin123 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/icons/zoom.gifbin923 -> 0 bytes
-rw-r--r--bundles/org.eclipse.core.tools/notice.html71
-rw-r--r--bundles/org.eclipse.core.tools/plugin.xml76
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractCopySelectionAction.java71
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractTreeContentProvider.java200
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/BaseTextView.java54
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ByteUtil.java54
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ClearTextAction.java61
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CollapseAllAction.java39
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyStructuredSelectionAction.java52
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyTextSelectionAction.java42
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CoreToolsPlugin.java62
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/DeepSize.java218
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ErrorUtil.java52
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/GlobalAction.java38
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/IFlattable.java18
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ISorter.java21
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ITreeNodeVisitor.java28
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/Policy.java85
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SelectAllAction.java43
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SpyView.java32
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableSelectionProviderDecorator.java123
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableWithTotalView.java260
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeContentProviderNode.java206
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeSelectionProviderDecorator.java132
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeTextOperationTarget.java41
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/messages.properties70
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsView.java224
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewContentProvider.java83
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewLabelProvider.java83
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewSorter.java112
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/EclipsePreferencesView.java134
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesView.java152
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewContentProvider.java121
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewLabelProvider.java54
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewSorter.java122
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDataSheetView.java109
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyGraphNode.java137
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyPerspective.java37
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyView.java145
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginListView.java100
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PreferenceStatsView.java407
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/RuntimeSpyPerspective.java29
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/StackTraceView.java54
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassInfo.java50
-rw-r--r--bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassloaderInfo.java108
-rw-r--r--features/org.eclipse.core.tools-feature/.project17
-rw-r--r--features/org.eclipse.core.tools-feature/build.properties2
-rw-r--r--features/org.eclipse.core.tools-feature/cpl-v10.html125
-rw-r--r--features/org.eclipse.core.tools-feature/eclipse_update_120.jpgbin14641 -> 0 bytes
-rw-r--r--features/org.eclipse.core.tools-feature/feature.properties113
-rw-r--r--features/org.eclipse.core.tools-feature/feature.xml43
-rw-r--r--features/org.eclipse.core.tools-feature/license.html71
-rw-r--r--tests/org.eclipse.core.tests.runtime/plugin.xml2
-rw-r--r--tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/IRegistryChangeEventTest.java44
-rw-r--r--tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java157
-rw-r--r--tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyInputStreamTest.java10
-rw-r--r--tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyReaderTest.java17
101 files changed, 661 insertions, 5613 deletions
diff --git a/bundles/org.eclipse.core.runtime/.options b/bundles/org.eclipse.core.runtime/.options
index 6886a7506..15efb866d 100644
--- a/bundles/org.eclipse.core.runtime/.options
+++ b/bundles/org.eclipse.core.runtime/.options
@@ -24,6 +24,9 @@ org.eclipse.core.runtime/timing/startup=false
# Prints time taken by Plugin.shutdown() methods.
org.eclipse.core.runtime/timing/shutdown=false
+# Turn on debugging for the compatibility layer
+org.eclipse.core.runtime/compatibility/debug=false
+
# Turn on debugging for the registry.
org.eclipse.core.runtime/registry/debug=false
# Specify a filename for a user-readable form of the plugin registry to be written to.
diff --git a/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF
index 63e00c1eb..99fb234ea 100644
--- a/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-Name: %pluginName
-Bundle-Version: 3.0.0
+Bundle-Version: 3.0.2
Bundle-SymbolicName: org.eclipse.core.runtime; singleton=true
Bundle-Vendor: %providerName
Bundle-ClassPath: runtime.jar
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentType.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentType.java
index aaecc2aa0..c140b4fdf 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentType.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentType.java
@@ -41,9 +41,9 @@ public final class ContentType implements IContentType {
private static final String DESCRIBER_ELEMENT = "describer"; //$NON-NLS-1$
final static byte NOT_ASSOCIATED = 0;
- final static String PREF_DEFAULT_CHARSET = "charset"; //$NON-NLS-1$
- final static String PREF_FILE_EXTENSIONS = "file-extensions"; //$NON-NLS-1$
- final static String PREF_FILE_NAMES = "file-names"; //$NON-NLS-1$
+ public final static String PREF_DEFAULT_CHARSET = "charset"; //$NON-NLS-1$
+ public final static String PREF_FILE_EXTENSIONS = "file-extensions"; //$NON-NLS-1$
+ public final static String PREF_FILE_NAMES = "file-names"; //$NON-NLS-1$
final static byte PRIORITY_HIGH = 1;
final static byte PRIORITY_LOW = -1;
final static byte PRIORITY_NORMAL = 0;
@@ -57,6 +57,7 @@ public final class ContentType implements IContentType {
private IContentType[] children;
private IConfigurationElement contentTypeElement;
private String defaultCharset;
+ private String userCharset;
private IContentDescription defaultDescription;
private IContentDescriber describer;
private List fileSpecs;
@@ -84,9 +85,26 @@ public final class ContentType implements IContentType {
contentType.defaultCharset = defaultCharset;
contentType.contentTypeElement = contentTypeElement;
contentType.baseTypeId = baseTypeId;
+ contentType.processPreferences();
return contentType;
}
+ private void processPreferences() {
+ Preferences contentTypeNode = manager.getPreferences().node(getId());
+ // user set default charset
+ this.userCharset = contentTypeNode.get(PREF_DEFAULT_CHARSET, null);
+ // user set file names
+ String userSetFileNames = contentTypeNode.get(PREF_FILE_NAMES, null);
+ String[] fileNames = parseItems(userSetFileNames);
+ for (int i = 0; i < fileNames.length; i++)
+ internalAddFileSpec(fileNames[i], FILE_NAME_SPEC | SPEC_USER_DEFINED);
+ // user set file extensions
+ String userSetFileExtensions = contentTypeNode.get(PREF_FILE_EXTENSIONS, null);
+ String[] fileExtensions = parseItems(userSetFileExtensions);
+ for (int i = 0; i < fileExtensions.length; i++)
+ internalAddFileSpec(fileExtensions[i], FILE_EXTENSION_SPEC | SPEC_USER_DEFINED);
+ }
+
static FileSpec createFileSpec(String fileSpec, int type) {
return new FileSpec(fileSpec, type);
}
@@ -133,7 +151,7 @@ public final class ContentType implements IContentType {
return ""; //$NON-NLS-1$
StringBuffer result = new StringBuffer();
for (int i = 0; i < list.length; i++) {
- result.append(list);
+ result.append(list[i]);
result.append(',');
}
// ignore last comma
@@ -152,12 +170,16 @@ public final class ContentType implements IContentType {
if (type != FILE_EXTENSION_SPEC && type != FILE_NAME_SPEC)
throw new IllegalArgumentException("Unknown type: " + type); //$NON-NLS-1$
if (!internalAddFileSpec(fileSpec, type | SPEC_USER_DEFINED))
+ // the entry was already there, nothing to do...
return;
- // persist using preferences
+ // notify listeners
+ manager.fireContentTypeChangeEvent(this);
+ // update preferences
String key = getPreferenceKey(type);
Preferences contentTypeNode = manager.getPreferences().node(getId());
- //TODO are we including user and plug-in provided file specs here?
- contentTypeNode.put(key, toListString(fileSpecs));
+ final String[] userSet = internalGetFileSpecs(type | IGNORE_PRE_DEFINED);
+ contentTypeNode.put(key, toListString(userSet));
+ // persist preferences
try {
contentTypeNode.flush();
} catch (BackingStoreException bse) {
@@ -185,7 +207,7 @@ public final class ContentType implements IContentType {
invalidateDescriber(e);
throw e;
} finally {
- ((LazyInputStream) contents).reset();
+ ((LazyInputStream) contents).rewind();
}
}
@@ -207,13 +229,7 @@ public final class ContentType implements IContentType {
invalidateDescriber(e);
throw e;
} finally {
- try {
- contents.reset();
- } catch (IOException ioe) {
- // this should only happen if the describer closed the reader (it should not)
- String message = Policy.bind("content.errorReadingContents", getId()); //$NON-NLS-1$
- log(message, ioe);
- }
+ ((LazyReader) contents).rewind();
}
}
@@ -242,8 +258,7 @@ public final class ContentType implements IContentType {
public String getDefaultCharset() {
if (aliasTarget != null)
return getTarget().getDefaultCharset();
- Preferences contentTypeNode = manager.getPreferences().node(getId());
- String currentCharset = contentTypeNode.get(PREF_DEFAULT_CHARSET, internalGetDefaultCharset());
+ String currentCharset = userCharset != null ? userCharset : internalGetDefaultCharset();
// an empty string as charset means: no default charset
return "".equals(currentCharset) ? null : currentCharset; //$NON-NLS-1$
}
@@ -307,6 +322,10 @@ public final class ContentType implements IContentType {
public String[] getFileSpecs(int typeMask) {
if (aliasTarget != null)
return getTarget().getFileSpecs(typeMask);
+ return internalGetFileSpecs(typeMask);
+ }
+
+ private String[] internalGetFileSpecs(int typeMask) {
if (fileSpecs == null)
return new String[0];
// invert the last two bits so it is easier to compare
@@ -349,10 +368,6 @@ public final class ContentType implements IContentType {
return validation;
}
- boolean hasAnyFileSpec() {
- return fileSpecs != null && !fileSpecs.isEmpty();
- }
-
/**
* @param text the file spec string
* @param typeMask FILE_NAME_SPEC or FILE_EXTENSION_SPEC
@@ -436,30 +451,44 @@ public final class ContentType implements IContentType {
public byte internalIsAssociatedWith(String fileName) {
if (aliasTarget != null)
return getTarget().internalIsAssociatedWith(fileName);
- if (fileSpecs == null) {
- IContentType baseType = getBaseType();
- return baseType == null ? NOT_ASSOCIATED : ((ContentType) baseType).internalIsAssociatedWith(fileName);
- }
if (hasFileSpec(fileName, FILE_NAME_SPEC))
return ASSOCIATED_BY_NAME;
String fileExtension = ContentTypeManager.getFileExtension(fileName);
- return (fileExtension == null || !hasFileSpec(fileExtension, FILE_EXTENSION_SPEC)) ? NOT_ASSOCIATED : ASSOCIATED_BY_EXTENSION;
+ if (hasFileSpec(fileExtension, FILE_EXTENSION_SPEC))
+ return ASSOCIATED_BY_EXTENSION;
+ // if does not have *built-in* file specs, delegate to parent (if any)
+ if (!hasAnyFileSpec(SPEC_PRE_DEFINED)) {
+ IContentType baseType = getBaseType();
+ if (baseType != null)
+ return ((ContentType) baseType).internalIsAssociatedWith(fileName);
+ }
+ return NOT_ASSOCIATED;
}
- void internalRemoveFileSpec(String fileSpec, int typeMask) {
- if (aliasTarget != null) {
- aliasTarget.internalRemoveFileSpec(fileSpec, typeMask);
- return;
+ private boolean hasAnyFileSpec(int typeMask) {
+ if (fileSpecs == null || fileSpecs.isEmpty())
+ return false;
+ for (Iterator i = fileSpecs.iterator(); i.hasNext();) {
+ FileSpec spec = (FileSpec) i.next();
+ if ((spec.getType() & typeMask) == typeMask)
+ return true;
}
+ return false;
+ }
+
+ boolean internalRemoveFileSpec(String fileSpec, int typeMask) {
+ if (aliasTarget != null)
+ return aliasTarget.internalRemoveFileSpec(fileSpec, typeMask);
if (fileSpecs == null)
- return;
+ return false;
for (Iterator i = fileSpecs.iterator(); i.hasNext();) {
FileSpec spec = (FileSpec) i.next();
if ((spec.getType() == typeMask) && fileSpec.equals(spec.getText())) {
i.remove();
- return;
+ return true;
}
}
+ return false;
}
private IContentDescriber invalidateDescriber(Throwable reason) {
@@ -507,11 +536,20 @@ public final class ContentType implements IContentType {
}
if (type != FILE_EXTENSION_SPEC && type != FILE_NAME_SPEC)
throw new IllegalArgumentException("Unknown type: " + type); //$NON-NLS-1$
- internalRemoveFileSpec(fileSpec, type | SPEC_USER_DEFINED);
- // persist using preferences
+ if (!internalRemoveFileSpec(fileSpec, type | SPEC_USER_DEFINED))
+ // the entry was not there... nothing to do
+ return;
+ // notify listeners
+ manager.fireContentTypeChangeEvent(this);
+ // update preferences
String key = getPreferenceKey(type);
Preferences contentTypeNode = manager.getPreferences().node(getId());
- contentTypeNode.put(key, toListString(fileSpecs));
+ final String[] userSet = internalGetFileSpecs(type | IGNORE_PRE_DEFINED);
+ if (userSet.length == 0)
+ contentTypeNode.remove(key);
+ else
+ contentTypeNode.put(key, toListString(userSet));
+ // persist using preferences
try {
contentTypeNode.flush();
} catch (BackingStoreException bse) {
@@ -537,12 +575,22 @@ public final class ContentType implements IContentType {
* (non-Javadoc)
* @see org.eclipse.core.runtime.content.IContentType#setDefaultCharset(java.lang.String)
*/
- public void setDefaultCharset(String userCharset) throws CoreException {
+ public void setDefaultCharset(String newCharset) throws CoreException {
+ if (userCharset == null) {
+ if (newCharset == null)
+ return;
+ } else if (userCharset.equals(newCharset))
+ return;
+ userCharset = newCharset;
+ // notify listeners
+ manager.fireContentTypeChangeEvent(this);
+ // update preferences
Preferences contentTypeNode = manager.getPreferences().node(getId());
if (userCharset == null)
contentTypeNode.remove(PREF_DEFAULT_CHARSET);
else
contentTypeNode.put(PREF_DEFAULT_CHARSET, userCharset);
+ // persist preferences
try {
contentTypeNode.flush();
} catch (BackingStoreException bse) {
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentTypeManager.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentTypeManager.java
index bdd04c0b7..0b4f95a9c 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentTypeManager.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/ContentTypeManager.java
@@ -13,13 +13,15 @@ package org.eclipse.core.internal.content;
import java.io.*;
import java.util.*;
import org.eclipse.core.internal.runtime.InternalPlatform;
+import org.eclipse.core.internal.runtime.ListenerList;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.content.*;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.service.prefs.Preferences;
public class ContentTypeManager implements IContentTypeManager {
- final static String CONTENT_TYPE_PREF_NODE = Platform.PI_RUNTIME + IPath.SEPARATOR + "content-types"; //$NON-NLS-1$
+ public final static String CONTENT_TYPE_PREF_NODE = Platform.PI_RUNTIME + IPath.SEPARATOR + "content-types"; //$NON-NLS-1$
private static final String OPTION_DEBUG_CONTENT_TYPES = Platform.PI_RUNTIME + "/contenttypes/debug"; //$NON-NLS-1$;
static final boolean DEBUGGING = Boolean.TRUE.toString().equalsIgnoreCase(InternalPlatform.getDefault().getOption(OPTION_DEBUG_CONTENT_TYPES));
private static ContentTypeManager instance;
@@ -27,6 +29,13 @@ public class ContentTypeManager implements IContentTypeManager {
private ContentTypeBuilder builder;
private Map catalog = new HashMap();
+ /**
+ * List of registered listeners (element type:
+ * <code>IContentTypeChangeListener</code>).
+ * These listeners are to be informed when
+ * something in a content type changes.
+ */
+ protected ListenerList contentTypeListeners = new ListenerList();
// a comparator used when resolving conflicts (two types associated to the same spec)
private Comparator conflictComparator = new Comparator() {
@@ -178,7 +187,7 @@ public class ContentTypeManager implements IContentTypeManager {
for (int i = 0; i < children.length; i++) {
ContentType child = (ContentType) children[i];
// must avoid duplicates and ensure children do not override filespecs
- if (child.internalIsAssociatedWith(fileName) == ContentType.ASSOCIATED_BY_NAME && !result.contains(child))
+ if (!result.contains(child) && child.internalIsAssociatedWith(fileName) == ContentType.ASSOCIATED_BY_NAME)
result.add(count++, child);
}
}
@@ -193,7 +202,8 @@ public class ContentTypeManager implements IContentTypeManager {
IContentType[] children = main.getChildren();
for (int i = 0; i < children.length; i++) {
ContentType child = (ContentType) children[i];
- if (child.internalIsAssociatedWith(fileName) == ContentType.ASSOCIATED_BY_EXTENSION && !result.contains(children[i]))
+ // must avoid duplicates and ensure children do not override filespecs
+ if (!result.contains(children[i]) && child.internalIsAssociatedWith(fileName) == ContentType.ASSOCIATED_BY_EXTENSION)
result.add(count++, children[i]);
}
}
@@ -260,7 +270,7 @@ public class ContentTypeManager implements IContentTypeManager {
}
Preferences getPreferences() {
- return InternalPlatform.getDefault().getPreferencesService().getRootNode().node(CONTENT_TYPE_PREF_NODE);
+ return new InstanceScope().getNode(CONTENT_TYPE_PREF_NODE);
}
protected IContentType[] internalFindContentTypesFor(InputStream buffer, IContentType[] subset) {
@@ -373,15 +383,31 @@ public class ContentTypeManager implements IContentTypeManager {
* @see IContentTypeManager#addContentTypeChangeListener(IContentTypeChangeListener)
*/
public void addContentTypeChangeListener(IContentTypeChangeListener listener) {
- // TODO https://bugs.eclipse.org/bugs/show_bug.cgi?id=67884
- // Content type change events not reported
+ contentTypeListeners.add(listener);
}
/* (non-Javadoc)
* @see IContentTypeManager#removeContentTypeChangeListener(IContentTypeChangeListener)
*/
public void removeContentTypeChangeListener(IContentTypeChangeListener listener) {
- // TODO https://bugs.eclipse.org/bugs/show_bug.cgi?id=67884
- // Content type change events not reported
+ contentTypeListeners.remove(listener);
+ }
+
+ public void fireContentTypeChangeEvent(ContentType type) {
+ Object[] listeners = this.contentTypeListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final ContentTypeChangeEvent event = new ContentTypeChangeEvent(type);
+ final IContentTypeChangeListener listener = (IContentTypeChangeListener) listeners[i];
+ ISafeRunnable job = new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // already logged in Platform#run()
+ }
+
+ public void run() throws Exception {
+ listener.contentTypeChanged(event);
+ }
+ };
+ Platform.run(job);
+ }
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/FileSpec.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/FileSpec.java
index 4cb73aa51..c0a0d4ff4 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/FileSpec.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/FileSpec.java
@@ -34,7 +34,7 @@ class FileSpec {
return type;
}
- public int getBasicType() {
+ public static int getBasicType(int type) {
return BASIC_TYPE & type;
}
@@ -42,18 +42,22 @@ class FileSpec {
if (!(other instanceof FileSpec))
return false;
FileSpec otherFileSpec = (FileSpec) other;
- return getBasicType() == otherFileSpec.getBasicType() && text.equalsIgnoreCase(otherFileSpec.text);
+ return equals(text, otherFileSpec.getType());
+ }
+
+ public boolean equals(String text, int otherType) {
+ return getBasicType(type) == getBasicType(otherType) && this.text.equalsIgnoreCase(text);
}
-
- public boolean equals(String text, int basicType) {
- return getBasicType() == basicType && this.text.equalsIgnoreCase(text);
- }
public int hashCode() {
return text.hashCode();
}
-
+
public static String getMappingKeyFor(String fileSpecText) {
return fileSpecText.toLowerCase();
}
+
+ public String toString() {
+ return getText();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyInputStream.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyInputStream.java
index d81390e96..aa808b8a9 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyInputStream.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyInputStream.java
@@ -124,7 +124,6 @@ public class LazyInputStream extends InputStream {
public void reset() {
offset = mark;
- mark = 0;
}
public long skip(long toSkip) throws IOException {
@@ -135,4 +134,9 @@ public class LazyInputStream extends InputStream {
offset += skipped;
return skipped;
}
+
+ public void rewind() {
+ mark = 0;
+ offset = 0;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyReader.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyReader.java
index dba1d1de6..47ab0b225 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyReader.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/content/LazyReader.java
@@ -124,7 +124,6 @@ public class LazyReader extends Reader {
public void reset() {
offset = mark;
- mark = 0;
}
public long skip(long toSkip) throws IOException {
@@ -139,4 +138,9 @@ public class LazyReader extends Reader {
public void close() {
// we don't close the underlying stream
}
+
+ public void rewind() {
+ mark = 0;
+ offset = 0;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/DefaultPreferences.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/DefaultPreferences.java
index 1fdad39c5..5f8637422 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/DefaultPreferences.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/DefaultPreferences.java
@@ -14,8 +14,7 @@ import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
-import org.eclipse.core.internal.runtime.InternalPlatform;
-import org.eclipse.core.internal.runtime.Policy;
+import org.eclipse.core.internal.runtime.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -193,8 +192,9 @@ public class DefaultPreferences extends EclipsePreferences {
}
}
- // No extension exists. Get the plug-in object and call #initializeDefaultPluginPreferences()
- if (plugin == null)
+ // No extension exists. Get the plug-in object and call #initializeDefaultPluginPreferences().
+ // We can only call this if the runtime compatibility layer is installed.
+ if (plugin == null && InternalPlatform.getDefault().getBundle(CompatibilityHelper.PI_RUNTIME_COMPATIBILITY) != null)
plugin = Platform.getPlugin(name());
if (plugin == null) {
if (InternalPlatform.DEBUG_PREFERENCES)
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/InstancePreferences.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/InstancePreferences.java
index c44ac7d3a..9c308f413 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/InstancePreferences.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/InstancePreferences.java
@@ -32,8 +32,14 @@ public class InstancePreferences extends EclipsePreferences {
private static boolean initialized = false;
private static IPath baseLocation;
- static {
- baseLocation = InternalPlatform.getDefault().getMetaArea().getStateLocation(Platform.PI_RUNTIME);
+ private static IPath getBaseLocation() {
+ // If we are running with -data=@none we won't have an instance location.
+ // By leaving the value of baseLocation as null we still allow the users
+ // to set preferences in this scope but the values will not be persisted
+ // to disk when #flush() is called.
+ if (baseLocation == null && Platform.getInstanceLocation() != null)
+ baseLocation = InternalPlatform.getDefault().getMetaArea().getStateLocation(Platform.PI_RUNTIME);
+ return baseLocation;
}
/**
@@ -61,7 +67,7 @@ public class InstancePreferences extends EclipsePreferences {
if (qualifier == null)
return;
// get the base location from the platform
- location = computeLocation(baseLocation, qualifier);
+ location = computeLocation(getBaseLocation(), qualifier);
}
protected boolean isAlreadyLoaded(IEclipsePreferences node) {
@@ -81,6 +87,12 @@ public class InstancePreferences extends EclipsePreferences {
IPath path = new Path(absolutePath());
if (path.segmentCount() != 2)
return;
+ // If we are running with -data=@none we won't have an instance location.
+ if (Platform.getInstanceLocation() == null) {
+ if (InternalPlatform.DEBUG_PREFERENCES)
+ Policy.debug("Cannot load Legacy plug-in preferences since instance location is not set."); //$NON-NLS-1$
+ return;
+ }
String bundleName = path.segment(1);
// the preferences file is located in the plug-in's state area at a well-known name
// don't need to create the directory if there are no preferences to load
@@ -173,7 +185,7 @@ public class InstancePreferences extends EclipsePreferences {
return;
try {
synchronized (this) {
- String[] names = computeChildren(baseLocation);
+ String[] names = computeChildren(getBaseLocation());
for (int i = 0; i < names.length; i++)
addChild(names[i], null);
}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/Extension.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/Extension.java
index 9e33d1a14..f05d9248d 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/Extension.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/Extension.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.core.internal.registry;
-import org.eclipse.core.internal.runtime.CompatibilityHelper;
-import org.eclipse.core.internal.runtime.InternalPlatform;
+import org.eclipse.core.internal.runtime.*;
import org.eclipse.core.runtime.*;
import org.osgi.framework.Bundle;
@@ -167,6 +166,8 @@ public class Extension extends NestedRegistryModelObject implements IExtension {
result = CompatibilityHelper.getPluginDescriptor(hosts[0].getSymbolicName());
}
}
+ if (CompatibilityHelper.DEBUG && result == null)
+ Policy.debug("Could not obtain plug-in descriptor for bundle " + ((Namespace) getParent()).getName()); //$NON-NLS-1$
return result;
}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionRegistry.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
index 253114ac1..d1b467168 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
@@ -185,12 +185,21 @@ public class ExtensionRegistry extends NestedRegistryModelObject implements IExt
* point. If none is found, there is nothing to do. Otherwise, link them.
*/
private void addExtensionPoint(IExtensionPoint extPoint) {
- IExtension[] existingExtensions = (IExtension[]) orphanExtensions.remove(extPoint.getUniqueIdentifier());
- if (existingExtensions == null)
+ IExtension[] orphans = (IExtension[]) orphanExtensions.remove(extPoint.getUniqueIdentifier());
+ if (orphans == null)
return;
// otherwise, link them
- link(extPoint, existingExtensions);
- recordChange(extPoint, existingExtensions, IExtensionDelta.ADDED);
+ IExtension[] newExtensions;
+ IExtension[] existingExtensions = extPoint.getExtensions();
+ if (existingExtensions.length == 0)
+ newExtensions = orphans;
+ else {
+ newExtensions = new IExtension[existingExtensions.length + orphans.length];
+ System.arraycopy(existingExtensions, 0, newExtensions, 0, existingExtensions.length);
+ System.arraycopy(orphans, 0, newExtensions, existingExtensions.length, orphans.length);
+ }
+ link(extPoint, newExtensions);
+ recordChange(extPoint, orphans, IExtensionDelta.ADDED);
}
private void addExtensionsAndExtensionPoints(Namespace element) {
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionsParser.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionsParser.java
index e68b01f66..ca00a61d2 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionsParser.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/registry/ExtensionsParser.java
@@ -126,6 +126,8 @@ public class ExtensionsParser extends DefaultHandler {
private Locator locator = null;
+ private String configurationElementValue = null;
+
public ExtensionsParser(MultiStatus status) {
super();
this.status = status;
@@ -147,13 +149,15 @@ public class ExtensionsParser extends DefaultHandler {
// part of a configuration element (i.e. an element within an EXTENSION element
ConfigurationElement currentConfigElement = (ConfigurationElement) objectStack.peek();
String value = new String(ch, start, length);
- String oldValue = currentConfigElement.getValueAsIs();
- if (oldValue == null) {
- if (value.trim().length() != 0)
- currentConfigElement.setValue(translate(value));
+ if (configurationElementValue == null) {
+ if (value.trim().length() != 0) {
+ configurationElementValue = value;
+ }
} else {
- currentConfigElement.setValue(oldValue + value);
+ configurationElementValue = configurationElementValue + value;
}
+ if (configurationElementValue != null)
+ currentConfigElement.setValue(translate(configurationElementValue));
}
}
@@ -209,6 +213,7 @@ public class ExtensionsParser extends DefaultHandler {
// We don't care what the element name was
stateStack.pop();
// Now finish up the configuration element object
+ configurationElementValue = null;
ConfigurationElement currentConfigElement = (ConfigurationElement) objectStack.pop();
String value = currentConfigElement.getValueAsIs();
@@ -267,6 +272,8 @@ public class ExtensionsParser extends DefaultHandler {
// be added to a vector in the extension object called _configuration.
stateStack.push(new Integer(CONFIGURATION_ELEMENT_STATE));
+ configurationElementValue = null;
+
// create a new Configuration Element and push it onto the object stack
ConfigurationElement currentConfigurationElement = new ConfigurationElement();
objectStack.push(currentConfigurationElement);
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java
index 22459d0d7..af60d3891 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java
@@ -302,6 +302,8 @@ public class AuthorizationDatabase {
return;
try {
file.delete();
+ if ((!file.getParentFile().exists() && !file.getParentFile().mkdirs()) || !canWrite(file.getParentFile()))
+ throw new CoreException(new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.FAILED_WRITE_METADATA, Policy.bind("meta.unableToWriteAuthorization", file.toString()), null)); //$NON-NLS-1$
file.createNewFile();
FileOutputStream out = new FileOutputStream(file);
try {
@@ -315,6 +317,26 @@ public class AuthorizationDatabase {
needsSaving = false;
}
+ private static boolean canWrite(File installDir) {
+ if (!installDir.canWrite())
+ return false;
+
+ if (!installDir.isDirectory())
+ return false;
+
+ File fileTest = null;
+ try {
+ fileTest = File.createTempFile("writtableArea", null, installDir); //$NON-NLS-1$
+ } catch (IOException e) {
+ //If an exception occured while trying to create the file, it means that it is not writtable
+ return false;
+ } finally {
+ if (fileTest != null)
+ fileTest.delete();
+ }
+ return true;
+ }
+
private void save(OutputStream os) throws IOException {
//write the version number
os.write(KEYRING_FILE_VERSION);
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java
index 2084e3278..126c08e78 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java
@@ -20,17 +20,17 @@ import org.eclipse.core.runtime.Platform;
// This class factors out the management of the .keyring location
public class AuthorizationHandler {
/* package */static final String F_KEYRING = ".keyring"; //$NON-NLS-1$
-
+
//Authorization related informations
private static AuthorizationDatabase keyring = null;
private static long keyringTimeStamp;
private static String keyringFile = null;
private static String password = ""; //$NON-NLS-1$
-
+
/**
* Opens the password database (if any) initally provided to the platform at startup.
*/
- private static void loadKeyring() {
+ private static void loadKeyring() throws CoreException {
if (keyring != null && new File(keyringFile).lastModified() == keyringTimeStamp)
return;
if (keyringFile == null) {
@@ -46,15 +46,12 @@ public class AuthorizationHandler {
if (keyring == null) {
//try deleting the file and loading again - format may have changed
new java.io.File(keyringFile).delete();
- try {
- keyring = new AuthorizationDatabase(keyringFile, password);
- } catch (CoreException e) {
- //don't bother logging a second failure
- }
+ keyring = new AuthorizationDatabase(keyringFile, password);
+ //don't bother logging a second failure and let it flows to the callers
}
keyringTimeStamp = new File(keyringFile).lastModified();
}
-
+
/**
* @see org.eclipse.core.runtime.Platform
*/
@@ -86,8 +83,13 @@ public class AuthorizationHandler {
* @see org.eclipse.core.runtime.Platform
*/
public static Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
- loadKeyring();
- Map info = keyring.getAuthorizationInfo(serverUrl, realm, authScheme);
+ Map info = null;
+ try {
+ loadKeyring();
+ info = keyring.getAuthorizationInfo(serverUrl, realm, authScheme);
+ } catch (CoreException e) {
+ // The error has already been logged in loadKeyring()
+ }
return info == null ? null : new HashMap(info);
}
@@ -95,10 +97,15 @@ public class AuthorizationHandler {
* @see org.eclipse.core.runtime.Platform
*/
public static String getProtectionSpace(URL resourceUrl) {
- loadKeyring();
+ try {
+ loadKeyring();
+ } catch (CoreException e) {
+ // The error has already been logged in loadKeyring()
+ return null;
+ }
return keyring.getProtectionSpace(resourceUrl);
}
-
+
public static void setKeyringFile(String file) {
if (keyringFile != null)
throw new IllegalStateException(Policy.bind("meta.keyringFileAlreadySpecified", keyringFile)); //$NON-NLS-1$
@@ -108,4 +115,4 @@ public class AuthorizationHandler {
public static void setPassword(String keyringPassword) {
password = keyringPassword;
}
-}
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CompatibilityHelper.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CompatibilityHelper.java
index 533a89f81..6d5ffb657 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CompatibilityHelper.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CompatibilityHelper.java
@@ -22,7 +22,8 @@ import org.osgi.framework.Bundle;
* @deprecated Marked as deprecated to suppress deprecation warnings.
*/
public class CompatibilityHelper {
-
+ private static final String OPTION_DEBUG_COMPATIBILITY = Platform.PI_RUNTIME + "/compatibility/debug"; //$NON-NLS-1$
+ public static final boolean DEBUG = Boolean.TRUE.toString().equalsIgnoreCase(InternalPlatform.getDefault().getOption(OPTION_DEBUG_COMPATIBILITY));
public static final String PI_RUNTIME_COMPATIBILITY = "org.eclipse.core.runtime.compatibility"; //$NON-NLS-1$
public static Bundle compatibility = null;
@@ -57,7 +58,12 @@ public class CompatibilityHelper {
Method getPluginDescriptor = oldInternalPlatform.getMethod("getPluginDescriptor", new Class[] {String.class}); //$NON-NLS-1$
return (IPluginDescriptor) getPluginDescriptor.invoke(oldInternalPlatform, new Object[] {pluginId});
} catch (Exception e) {
- //Ignore the exceptions, return false
+ if (DEBUG) {
+ String msg = "Error running compatibility code"; //$NON-NLS-1$
+ IStatus error = new Status(IStatus.ERROR, Platform.PI_RUNTIME, 1, msg, e);
+ InternalPlatform.getDefault().log(error);
+ }
+ //Ignore the exceptions, return null
}
return null;
}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
index ac88fe101..b359ffb91 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
@@ -77,7 +77,8 @@ public final class InternalPlatform {
private ArrayList groupProviders = new ArrayList(3);
private IProduct product;
-
+ private boolean missingProductReported = false;
+
private FileManager runtimeFileManager;
private Path cachedInstanceLocation; // Cache the path of the instance location
@@ -1201,7 +1202,11 @@ public final class InternalPlatform {
}
if (logEntries != null)
getFrameworkLog().log(new FrameworkLogEntry(Platform.PI_RUNTIME, Policy.bind("provider.invalid.general"), 0, null, (FrameworkLogEntry[]) logEntries.toArray())); //$NON-NLS-1$
-
+
+ if (!missingProductReported) {
+ getFrameworkLog().log(new FrameworkLogEntry(Platform.PI_RUNTIME, Policy.bind("product.notFound", productId), 0, null, null)); //$NON-NLS-1$
+ missingProductReported = true;
+ }
return null;
}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties
index 555733861..1a677cb8f 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties
@@ -1,193 +1,194 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-### Runtime plugin message catalog
-
-ok = OK
-
-### application
-application.notFound=Application \"{0}\" could not be found in the registry. The applications available are: {1}.
-application.returned=The application \"{0}\" returned with code: {1}.
-application.noIdFound = No application id has been found.
-application.invalidExtension = Invalid (empty) application extension \"{0}\".
-
-### plugins
-plugin.extDefNotFound = Executable extension definition for \"{0}\" not found.
-plugin.extDefNoClass = Executable extension definition \"{0}\" does not specify a class name.
-plugin.deactivatedLoad = Attempt to load class \"{0}\" from deactivated plug-in \"{1}\".
-plugin.loadClassError = Plug-in {0} was unable to load class {1}.
-plugin.instantiateClassError = Plug-in \"{0}\" was unable to instantiate class \"{1}\".
-plugin.initObjectError = Plug-in \"{0}\" was unable to execute setInitializationData on an instance of \"{1}\".
-plugin.bundleNotFound = Plug-in \"{0}\" could not find resource bundle \"{1}\".
-plugin.notPluginClass = Supplied runtime class \"{0}\" does not extend class Plugin.
-plugin.startupProblems = Problems encountered starting up plug-in: \"{0}\".
-plugin.shutdownProblems = Problems encountered shutting down plug-in: \"{0}\".
-plugin.pluginDisabled = Attempt to activate a disabled plug-in: \"{0}\".
-plugin.unableToResolve = Unable to resolve plug-in registry.
-plugin.mismatchRuntime = Runtime class declaration mismatch for plug-in: \"{0}\".
-plugin.delegatingLoaderTrouble = Plug-in \"{0}\" activation failed while loading class \"{1}\".
-plugin.eventListenerError = Error notifying registry change listener.
-
-### parsing/resolve
-parse.error = Parsing error: \"{0}\".
-parse.errorProcessing = Error while processing \"{0}\".
-parse.errorNameLineColumn = Parsing error in \"{0}\" [line {1}, column {2}]: \"{3}\".
-parse.extPointUnknown = Unknown extension point \"{0}\" specified in plug-in \"{1}\".
-parse.extPointDisabled = Extension point \"{0}\" specified in plug-in \"{1}\" is disabled.
-parse.prereqDisabled = Plug-in \"{0}\" was disabled due to missing or disabled prerequisite plug-in \"{1}\".
-parse.unsatisfiedPrereq = Unable to satisfy prerequisite constraint from \"{0}\" to \"{1}\".
-parse.prereqLoop = Detected prerequisite loop from \"{0}\" to \"{1}\".
-parse.registryProblems = Problems encountered loading the plug-in registry.
-parse.fragmentMissingAttr = Fragment \"{0}\" ignored due to missing attributes.
-parse.fragmentMissingIdName = Fragment ignored due to missing attributes (including name and id).
-parse.pluginMissingAttr = Plug-in \"{0}\" disabled due to missing attributes.
-parse.pluginMissingIdName = Plug-in disabled due to missing attributes (including name and id).
-parse.unknownElement = Unknown element \"{1}\", found within a \"{0}\", ignored.
-parse.unknownTopElement = Unknown element \"{0}\", found at the top level, ignored.
-parse.initializationTrouble = Parser initialization using setFeature failed.
-parse.internalStack = Element/end element mismatch for element \"{0}\".
-parse.validMatch = \"{0}\" is not a valid value for the attribute \"match\". Use \"perfect\", \"equivalent\", \"compatible\" or \"greaterOrEqual\".
-parse.validExport = \"{0}\" is not a valid value for the attribute \"export\". Use \"true\" or \"false\".
-parse.missingFragmentPd = Plug-in descriptor \"{0}\" not found for fragment \"{1}\". Fragment ignored.
-parse.unsatisfiedOptPrereq = Optional prerequisite constraint from \"{0}\" to\" {1}\" ignored.
-parse.prereqOptLoop = Optional prerequisite from \"{0}\" to \"{1}\" produced loop. Prerequisite ignored.
-parse.unknownLibraryType = Unknown library type \"{0}\" for library \"{1}\".
-parse.duplicatePlugin= Two plug-ins found with the same id: \"{0}\". Ignoring duplicate at \"{1}\".
-parse.unknownEntry=Unknown element parsed by plug-in registry: \"{0}\".
-parse.nullPluginIdentifier=Plug-in not loaded due to missing id or version number: \"{0}\".
-parse.nullFragmentIdentifier=Fragment not loaded due to missing id or version number: \"{0}\".
-parse.missingPluginName=Name attribute missing from plug-in or fragment at \"{0}\".
-parse.missingPluginId=Id attribute missing from plug-in or fragment at \"{0}\".
-parse.missingPluginVersion=Version attribute missing from plug-in or fragment at \"{0}\".
-parse.missingFPName=Plug-in name attribute missing from fragment at \"{0}\".
-parse.missingFPVersion=Plug-in version attribute missing from fragment at \"{0}\".
-parse.postiveMajor=Plug-in version identifier, \"{0}\", must have a positive major (1st) component.
-parse.postiveMinor=Plug-in version identifier, \"{0}\", must have a positive minor (2nd) component.
-parse.postiveService=Plug-in version identifier, \"{0}\", must have a positive service (3rd) component.
-parse.emptyPluginVersion=A plug-in version identifier must be non-empty.
-parse.separatorStartVersion=Plug-in version identifier, \"{0}\", must not start with a separator character.
-parse.separatorEndVersion=Plug-in version identifier, \"{0}\", must not end with a separator character.
-parse.doubleSeparatorVersion=Plug-in version identifier, \"{0}\", must not contain two consecutive separator characters.
-parse.oneElementPluginVersion=Plug-in version identifier, \"{0}\", must contain at least one component.
-parse.fourElementPluginVersion=Plug-in version identifier, \"{0}\", can contain a maximum of four components.
-parse.numericMajorComponent=The major (1st) component of plug-in version identifier, \"{0}\", must be numeric.
-parse.numericMinorComponent=The minor (2nd) component of plug-in version identifier, \"{0}\", must be numeric.
-parse.numericServiceComponent=The service (3rd) component of plug-in version identifier, \"{0}\", must be numeric.
-parse.badPrereqOnFrag=Fragment \"{0}\" requires non-existent plug-in \"{1}\". Fragment ignored.
-parse.duplicateFragment=Duplicate fragment found with id \"{0}\" and version \"{1}\".
-parse.duplicateLib=Fragment \"{0}\" for plug-in \"{1}\", has added duplicate library entry \"{2}\" .
-parse.notIncremental=Cannot install/uninstall dynamically: registry is not incremental (use -incrementalRegistry).
-
-### new parsing messages
-parse.problems = Problems parsing plug-in manifest for: \"{0}\".
-parse.missingAttribute=Missing \"{0}\" attribute in \"{1}\" element. Element ignored.
-parse.missingAttributeLine=Missing \"{0}\" attribute in \"{1}\" element (line: {2}). Element ignored.
-parse.unknownAttribute = Unknown attribute \"{1}\" for element \"{0}\" ignored.
-parse.unknownAttributeLine= Unknown attribute \"{1}\" for element \"{0}\" ignored (line: {2}).
-parse.unknownElement = Unknown element \"{1}\", found within a \"{0}\", ignored.
-parse.unknownElementLine = Unknown element \"{1}\", found within a \"{0}\", ignored (line: {2}).
-parse.xmlParserNotAvailable=Could not acquire XML parsing service.
-parse.failedParsingManifest=Could not parse plug-in manifest for \"{0}\". Any contributed extensions and extension points will be ignored.
-
-
-### metadata
-meta.appNotInit = The application has not been initialized.
-meta.instanceDataUnspecified = The instance data location has not been specified yet.
-meta.instanceDataAlreadySpecified = The instance data location has already been specified {0}.
-meta.keyringFileAlreadySpecified = The keyring file location has already been specified {0}.
-meta.noDataModeSpecified = No instance data can be specified.
-meta.authFormatChanged = The platform's authorization database file format has changed. Cached authorization information will be lost.
-meta.couldNotCreate = Error trying to create the platform metadata area: {0}.
-meta.exceptionParsingLog = An exception occurred while parsing the log file: {0}
-meta.failCreateLock = Unable to create platform lock file: {0}.
-meta.inUse = \nThe platform metadata area is already in use by another platform instance, or there was a failure\n\
- in deleting the old lock file. If no other platform instances are running, delete the \n\
- lock file ({0}) and try starting the platform again.
-meta.notDir = Specified platform location \"{0}\" is not a directory.
-meta.platform = Unexpected error starting the platform.
-meta.pluginProblems = Problems occurred when invoking code from plug-in: \"{0}\".
-meta.readonly = The platform metadata area could not be written: {0}. By default the platform writes its content\nunder the current working directory when the platform is launched. Use the -data parameter to\nspecify a different content area for the platform.
-meta.readPlatformMeta = Could not read platform metadata: {0}.
-meta.registryCacheWriteProblems = Trouble writing to the registry cache file.
-meta.registryCacheReadProblems = Trouble reading from the registry cache file.
-meta.regCacheIOExceptionWriting = IOException encountered while writing \"{0}\".
-meta.regCacheIOExceptionReading = IOException encountered while reading \"{0}\".
-meta.registryCacheEOFException = Unexpected end-of-file when reading registry cache. Defaulting to not using cached file.
-meta.unableToWriteRegistry = Unable to write plug-in registry to cache.
-meta.unableToCreateCache = Unable to create output stream for registry cache.
-meta.unableToReadCache = Unable to create input stream for registry cache.
-meta.unableToCreateRegDebug = Unable to create output stream for registry debug information in \"{0}\".
-meta.unableToWriteDebugRegistry = Unable to write plug-in registry debug information to \"{0}\".
-meta.unableToReadAuthorization = Unable to read authorization database: {0}.
-meta.unableToWriteAuthorization = Unable to write to authorization database: {0}.
-meta.writePlatformMeta = Could not write platform metadata: {0}.
-meta.invalidRegDebug = Unable to create file \"{0}\" for plug-in registry debug information.
-meta.infoRegDebug = Plug-in registry debug information created in file \"{0}\".
-meta.unableToDeleteCache = Unable to delete registry cache file \"{0}\".
-meta.writeVersion = Unable to write workspace version file: \"{0}\".
-meta.versionCheckRun = Unable to run the version check application: \"{0}\".
-meta.checkVersion = Exception trying to read version from file: \"{0}\".
-meta.fileManagerInitializationFailed = Exception trying to create the fileManager for the area: \"{0}\".
-
-### URL
-url.noaccess=Unhandled URL protocol \"{0}\".
-url.createConnection=Unable to create connection on \"{0}\".
-url.invalidURL=Invalid URL \"{0}\".
-url.badVariant=Unsupported \"platform:\" protocol variation \"{0}\".
-url.resolveFragment=Unable to resolve fragment \"{0}\".
-url.resolvePlugin=Unable to resolve plug-in \"{0}\".
-
-### Preferences
-preferences.errorReading=Error reading exported preferences file: {0}. {1}
-preferences.errorWriting=Error writing preference file {0}. {1}
-preferences.fileNotFound=Preference export file not found: {0}.
-preferences.incompatible=The preference file contains preferences for version \"{0}\" of plug-in \"{1}\", but version \"{2}\" is currently installed.
-preferences.invalidProperty=The preference export file contained an invalid entry: {0}={1}.
-preferences.validate=Some preferences may not be compatible with the currently installed plug-ins.
-preferences.validationException=Exception while validating bundle versions.
-
-preferences.removeRoot=The root preference node cannot be removed.
-preferences.classCast=Extensions to org.eclipse.core.runtime.preferences extension point must implement the IScope interface.
-preferences.removedNode=Preference node \"{0}\" has been removed.
-preferences.syncException=Exception synchronizing preferences for node: {0}.
-preferences.loadException=Exception loading preferences from: {0}.
-preferences.saveException=Exception saving preferences to: {0}.
-preferences.exportProblems=Problems exporting preferences.
-preferences.importProblems=Problems importing preferences.
-preferences.missingScopeAttribute= Missing 'scope' attribute in 'preference' element in extension declaration for: {0}.
-preferences.failedDelete=Failed to delete preferences file: {0}.
-preferences.noLocation=Unable to determine location of preference file for node: {0}.
-preferences.invalidParentClass=Parent node of: {0} should be instance of EclipsePreferences and not: {1}.
-preferences.applyProblems=Problems applying preference changes.
-preferences.saveProblems=Problems saving preferences.
-preferences.invalidExtensionSuperclass=Extension does not extend class AbstractPreferenceInitializer.
-preferences.removeExported=Exception trying to remove node from exported preferences: {0}.
-
-### Job Manager and Locks
-jobs.blocked0=The user operation is waiting for background work to complete.
-jobs.blocked1=The user operation is waiting for \"{0}\" to complete.
-jobs.internalError=An internal error occurred during: \"{0}\".
-jobs.waitFamSub={0} work items left.
-
-### Adapter manager
-adapters.badAdapterFactory = Malformed adapter factory extension in plug-in: {0}.
-
-### Content type manager
-content.invalidContentDescriber = Could not create content describer for {0}. Content type has been disabled.
-content.errorReadingContents = Error reading contents using content type: {0}.
-content.parserConfiguration = XML parser configuration error during content description.
-content.badInitializationData = Invalid initialization data for \"{0}\".
-content.missingIdentifier = Content type {0} has no identifier. Content type has been disabled.
-content.missingName = Content type {0} has no name. Content type has been disabled.
-content.errorSavingSettings = Failed saving settings for content type {0}.
-
-### Product
-provider.invalid.general = Errors while processing the product providers.
-provider.invalid = Problem creating the provider registered by {0}. \ No newline at end of file
+###############################################################################
+# Copyright (c) 2000, 2004 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+### Runtime plugin message catalog
+
+ok = OK
+
+### application
+application.notFound=Application \"{0}\" could not be found in the registry. The applications available are: {1}.
+application.returned=The application \"{0}\" returned with code: {1}.
+application.noIdFound = No application id has been found.
+application.invalidExtension = Invalid (empty) application extension \"{0}\".
+
+### plugins
+plugin.extDefNotFound = Executable extension definition for \"{0}\" not found.
+plugin.extDefNoClass = Executable extension definition \"{0}\" does not specify a class name.
+plugin.deactivatedLoad = Attempt to load class \"{0}\" from deactivated plug-in \"{1}\".
+plugin.loadClassError = Plug-in {0} was unable to load class {1}.
+plugin.instantiateClassError = Plug-in \"{0}\" was unable to instantiate class \"{1}\".
+plugin.initObjectError = Plug-in \"{0}\" was unable to execute setInitializationData on an instance of \"{1}\".
+plugin.bundleNotFound = Plug-in \"{0}\" could not find resource bundle \"{1}\".
+plugin.notPluginClass = Supplied runtime class \"{0}\" does not extend class Plugin.
+plugin.startupProblems = Problems encountered starting up plug-in: \"{0}\".
+plugin.shutdownProblems = Problems encountered shutting down plug-in: \"{0}\".
+plugin.pluginDisabled = Attempt to activate a disabled plug-in: \"{0}\".
+plugin.unableToResolve = Unable to resolve plug-in registry.
+plugin.mismatchRuntime = Runtime class declaration mismatch for plug-in: \"{0}\".
+plugin.delegatingLoaderTrouble = Plug-in \"{0}\" activation failed while loading class \"{1}\".
+plugin.eventListenerError = Error notifying registry change listener.
+
+### parsing/resolve
+parse.error = Parsing error: \"{0}\".
+parse.errorProcessing = Error while processing \"{0}\".
+parse.errorNameLineColumn = Parsing error in \"{0}\" [line {1}, column {2}]: \"{3}\".
+parse.extPointUnknown = Unknown extension point \"{0}\" specified in plug-in \"{1}\".
+parse.extPointDisabled = Extension point \"{0}\" specified in plug-in \"{1}\" is disabled.
+parse.prereqDisabled = Plug-in \"{0}\" was disabled due to missing or disabled prerequisite plug-in \"{1}\".
+parse.unsatisfiedPrereq = Unable to satisfy prerequisite constraint from \"{0}\" to \"{1}\".
+parse.prereqLoop = Detected prerequisite loop from \"{0}\" to \"{1}\".
+parse.registryProblems = Problems encountered loading the plug-in registry.
+parse.fragmentMissingAttr = Fragment \"{0}\" ignored due to missing attributes.
+parse.fragmentMissingIdName = Fragment ignored due to missing attributes (including name and id).
+parse.pluginMissingAttr = Plug-in \"{0}\" disabled due to missing attributes.
+parse.pluginMissingIdName = Plug-in disabled due to missing attributes (including name and id).
+parse.unknownElement = Unknown element \"{1}\", found within a \"{0}\", ignored.
+parse.unknownTopElement = Unknown element \"{0}\", found at the top level, ignored.
+parse.initializationTrouble = Parser initialization using setFeature failed.
+parse.internalStack = Element/end element mismatch for element \"{0}\".
+parse.validMatch = \"{0}\" is not a valid value for the attribute \"match\". Use \"perfect\", \"equivalent\", \"compatible\" or \"greaterOrEqual\".
+parse.validExport = \"{0}\" is not a valid value for the attribute \"export\". Use \"true\" or \"false\".
+parse.missingFragmentPd = Plug-in descriptor \"{0}\" not found for fragment \"{1}\". Fragment ignored.
+parse.unsatisfiedOptPrereq = Optional prerequisite constraint from \"{0}\" to\" {1}\" ignored.
+parse.prereqOptLoop = Optional prerequisite from \"{0}\" to \"{1}\" produced loop. Prerequisite ignored.
+parse.unknownLibraryType = Unknown library type \"{0}\" for library \"{1}\".
+parse.duplicatePlugin= Two plug-ins found with the same id: \"{0}\". Ignoring duplicate at \"{1}\".
+parse.unknownEntry=Unknown element parsed by plug-in registry: \"{0}\".
+parse.nullPluginIdentifier=Plug-in not loaded due to missing id or version number: \"{0}\".
+parse.nullFragmentIdentifier=Fragment not loaded due to missing id or version number: \"{0}\".
+parse.missingPluginName=Name attribute missing from plug-in or fragment at \"{0}\".
+parse.missingPluginId=Id attribute missing from plug-in or fragment at \"{0}\".
+parse.missingPluginVersion=Version attribute missing from plug-in or fragment at \"{0}\".
+parse.missingFPName=Plug-in name attribute missing from fragment at \"{0}\".
+parse.missingFPVersion=Plug-in version attribute missing from fragment at \"{0}\".
+parse.postiveMajor=Plug-in version identifier, \"{0}\", must have a positive major (1st) component.
+parse.postiveMinor=Plug-in version identifier, \"{0}\", must have a positive minor (2nd) component.
+parse.postiveService=Plug-in version identifier, \"{0}\", must have a positive service (3rd) component.
+parse.emptyPluginVersion=A plug-in version identifier must be non-empty.
+parse.separatorStartVersion=Plug-in version identifier, \"{0}\", must not start with a separator character.
+parse.separatorEndVersion=Plug-in version identifier, \"{0}\", must not end with a separator character.
+parse.doubleSeparatorVersion=Plug-in version identifier, \"{0}\", must not contain two consecutive separator characters.
+parse.oneElementPluginVersion=Plug-in version identifier, \"{0}\", must contain at least one component.
+parse.fourElementPluginVersion=Plug-in version identifier, \"{0}\", can contain a maximum of four components.
+parse.numericMajorComponent=The major (1st) component of plug-in version identifier, \"{0}\", must be numeric.
+parse.numericMinorComponent=The minor (2nd) component of plug-in version identifier, \"{0}\", must be numeric.
+parse.numericServiceComponent=The service (3rd) component of plug-in version identifier, \"{0}\", must be numeric.
+parse.badPrereqOnFrag=Fragment \"{0}\" requires non-existent plug-in \"{1}\". Fragment ignored.
+parse.duplicateFragment=Duplicate fragment found with id \"{0}\" and version \"{1}\".
+parse.duplicateLib=Fragment \"{0}\" for plug-in \"{1}\", has added duplicate library entry \"{2}\" .
+parse.notIncremental=Cannot install/uninstall dynamically: registry is not incremental (use -incrementalRegistry).
+
+### new parsing messages
+parse.problems = Problems parsing plug-in manifest for: \"{0}\".
+parse.missingAttribute=Missing \"{0}\" attribute in \"{1}\" element. Element ignored.
+parse.missingAttributeLine=Missing \"{0}\" attribute in \"{1}\" element (line: {2}). Element ignored.
+parse.unknownAttribute = Unknown attribute \"{1}\" for element \"{0}\" ignored.
+parse.unknownAttributeLine= Unknown attribute \"{1}\" for element \"{0}\" ignored (line: {2}).
+parse.unknownElement = Unknown element \"{1}\", found within a \"{0}\", ignored.
+parse.unknownElementLine = Unknown element \"{1}\", found within a \"{0}\", ignored (line: {2}).
+parse.xmlParserNotAvailable=Could not acquire XML parsing service.
+parse.failedParsingManifest=Could not parse plug-in manifest for \"{0}\". Any contributed extensions and extension points will be ignored.
+
+
+### metadata
+meta.appNotInit = The application has not been initialized.
+meta.instanceDataUnspecified = The instance data location has not been specified yet.
+meta.instanceDataAlreadySpecified = The instance data location has already been specified {0}.
+meta.keyringFileAlreadySpecified = The keyring file location has already been specified {0}.
+meta.noDataModeSpecified = No instance data can be specified.
+meta.authFormatChanged = The platform's authorization database file format has changed. Cached authorization information will be lost.
+meta.couldNotCreate = Error trying to create the platform metadata area: {0}.
+meta.exceptionParsingLog = An exception occurred while parsing the log file: {0}
+meta.failCreateLock = Unable to create platform lock file: {0}.
+meta.inUse = \nThe platform metadata area is already in use by another platform instance, or there was a failure\n\
+ in deleting the old lock file. If no other platform instances are running, delete the \n\
+ lock file ({0}) and try starting the platform again.
+meta.notDir = Specified platform location \"{0}\" is not a directory.
+meta.platform = Unexpected error starting the platform.
+meta.pluginProblems = Problems occurred when invoking code from plug-in: \"{0}\".
+meta.readonly = The platform metadata area could not be written: {0}. By default the platform writes its content\nunder the current working directory when the platform is launched. Use the -data parameter to\nspecify a different content area for the platform.
+meta.readPlatformMeta = Could not read platform metadata: {0}.
+meta.registryCacheWriteProblems = Trouble writing to the registry cache file.
+meta.registryCacheReadProblems = Trouble reading from the registry cache file.
+meta.regCacheIOExceptionWriting = IOException encountered while writing \"{0}\".
+meta.regCacheIOExceptionReading = IOException encountered while reading \"{0}\".
+meta.registryCacheEOFException = Unexpected end-of-file when reading registry cache. Defaulting to not using cached file.
+meta.unableToWriteRegistry = Unable to write plug-in registry to cache.
+meta.unableToCreateCache = Unable to create output stream for registry cache.
+meta.unableToReadCache = Unable to create input stream for registry cache.
+meta.unableToCreateRegDebug = Unable to create output stream for registry debug information in \"{0}\".
+meta.unableToWriteDebugRegistry = Unable to write plug-in registry debug information to \"{0}\".
+meta.unableToReadAuthorization = Unable to read authorization database: {0}.
+meta.unableToWriteAuthorization = Unable to write to authorization database: {0}.
+meta.writePlatformMeta = Could not write platform metadata: {0}.
+meta.invalidRegDebug = Unable to create file \"{0}\" for plug-in registry debug information.
+meta.infoRegDebug = Plug-in registry debug information created in file \"{0}\".
+meta.unableToDeleteCache = Unable to delete registry cache file \"{0}\".
+meta.writeVersion = Unable to write workspace version file: \"{0}\".
+meta.versionCheckRun = Unable to run the version check application: \"{0}\".
+meta.checkVersion = Exception trying to read version from file: \"{0}\".
+meta.fileManagerInitializationFailed = Exception trying to create the fileManager for the area: \"{0}\".
+
+### URL
+url.noaccess=Unhandled URL protocol \"{0}\".
+url.createConnection=Unable to create connection on \"{0}\".
+url.invalidURL=Invalid URL \"{0}\".
+url.badVariant=Unsupported \"platform:\" protocol variation \"{0}\".
+url.resolveFragment=Unable to resolve fragment \"{0}\".
+url.resolvePlugin=Unable to resolve plug-in \"{0}\".
+
+### Preferences
+preferences.errorReading=Error reading exported preferences file: {0}. {1}
+preferences.errorWriting=Error writing preference file {0}. {1}
+preferences.fileNotFound=Preference export file not found: {0}.
+preferences.incompatible=The preference file contains preferences for version \"{0}\" of plug-in \"{1}\", but version \"{2}\" is currently installed.
+preferences.invalidProperty=The preference export file contained an invalid entry: {0}={1}.
+preferences.validate=Some preferences may not be compatible with the currently installed plug-ins.
+preferences.validationException=Exception while validating bundle versions.
+
+preferences.removeRoot=The root preference node cannot be removed.
+preferences.classCast=Extensions to org.eclipse.core.runtime.preferences extension point must implement the IScope interface.
+preferences.removedNode=Preference node \"{0}\" has been removed.
+preferences.syncException=Exception synchronizing preferences for node: {0}.
+preferences.loadException=Exception loading preferences from: {0}.
+preferences.saveException=Exception saving preferences to: {0}.
+preferences.exportProblems=Problems exporting preferences.
+preferences.importProblems=Problems importing preferences.
+preferences.missingScopeAttribute= Missing 'scope' attribute in 'preference' element in extension declaration for: {0}.
+preferences.failedDelete=Failed to delete preferences file: {0}.
+preferences.noLocation=Unable to determine location of preference file for node: {0}.
+preferences.invalidParentClass=Parent node of: {0} should be instance of EclipsePreferences and not: {1}.
+preferences.applyProblems=Problems applying preference changes.
+preferences.saveProblems=Problems saving preferences.
+preferences.invalidExtensionSuperclass=Extension does not extend class AbstractPreferenceInitializer.
+preferences.removeExported=Exception trying to remove node from exported preferences: {0}.
+
+### Job Manager and Locks
+jobs.blocked0=The user operation is waiting for background work to complete.
+jobs.blocked1=The user operation is waiting for \"{0}\" to complete.
+jobs.internalError=An internal error occurred during: \"{0}\".
+jobs.waitFamSub={0} work items left.
+
+### Adapter manager
+adapters.badAdapterFactory = Malformed adapter factory extension in plug-in: {0}.
+
+### Content type manager
+content.invalidContentDescriber = Could not create content describer for {0}. Content type has been disabled.
+content.errorReadingContents = Error reading contents using content type: {0}.
+content.parserConfiguration = XML parser configuration error during content description.
+content.badInitializationData = Invalid initialization data for \"{0}\".
+content.missingIdentifier = Content type {0} has no identifier. Content type has been disabled.
+content.missingName = Content type {0} has no name. Content type has been disabled.
+content.errorSavingSettings = Failed saving settings for content type {0}.
+
+### Product
+provider.invalid.general = Errors while processing the product providers.
+provider.invalid = Problem creating the provider registered by {0}.
+product.notFound = Product {0} could not be found. \ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
index 39b99bb3b..5dcdd393f 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
@@ -621,9 +621,9 @@ public final class Platform {
* @param id the unique identifier of the desired plug-in
* (e.g., <code>"com.example.acme"</code>).
* @return the plug-in runtime object, or <code>null</code>
- * @deprecated If the compatibility layer is installed, this method works
- * as described. If the compatibility layer is not installed, <code>null</code>
- * is returned in all cases.
+ * @deprecated
+ * This method only works if the compatibility layer is installed and must not be used otherwise.
+ * See the comments on {@link IPluginDescriptor#getPlugin()} for details.
*/
public static Plugin getPlugin(String id) {
try {
diff --git a/bundles/org.eclipse.core.tools/.classpath b/bundles/org.eclipse.core.tools/.classpath
deleted file mode 100644
index 065ac06e1..000000000
--- a/bundles/org.eclipse.core.tools/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.core.tools/.cvsignore b/bundles/org.eclipse.core.tools/.cvsignore
deleted file mode 100644
index 3aa619389..000000000
--- a/bundles/org.eclipse.core.tools/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-coretools.jar
diff --git a/bundles/org.eclipse.core.tools/.options b/bundles/org.eclipse.core.tools/.options
deleted file mode 100644
index b28b8edc9..000000000
--- a/bundles/org.eclipse.core.tools/.options
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#### Resources settings
-# enable Resourced debugging
-org.eclipse.core.resources/debug=true
-
-# Monitor builders and gather time statistics etc.
-org.eclipse.core.resources/monitor/builders=true
-
-# Monitor resource change listeners and gather time statistics etc.
-org.eclipse.core.resources/monitor/listeners=true
-
diff --git a/bundles/org.eclipse.core.tools/.project b/bundles/org.eclipse.core.tools/.project
deleted file mode 100644
index 4d63ad907..000000000
--- a/bundles/org.eclipse.core.tools/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.core.tools</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.resources.spysupport</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.core.tools/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.core.tools/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index f3ab745c0..000000000
--- a/bundles/org.eclipse.core.tools/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Thu May 27 16:37:13 EDT 2004
-encoding/<project>=ISO-8859-1
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.core.tools/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.tools/META-INF/MANIFEST.MF
deleted file mode 100644
index 2952fb344..000000000
--- a/bundles/org.eclipse.core.tools/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Bundle-Name: Core Tools
-Bundle-SymbolicName: org.eclipse.core.tools; singleton=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-ClassPath: coretools.jar,
- tools.jar
-Bundle-Activator: org.eclipse.core.tools.CoreToolsPlugin
-Bundle-Vendor: Eclipse.org
-Bundle-Localization: plugin
-Provide-Package: org.eclipse.core.tools,
- org.eclipse.core.tools.runtime
-Require-Bundle: org.eclipse.core.resources;optional=true,
- org.eclipse.core.runtime,
- org.eclipse.jface.text,
- org.eclipse.ui,
- org.eclipse.ui.workbench.texteditor
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.core.tools/about.html b/bundles/org.eclipse.core.tools/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/bundles/org.eclipse.core.tools/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/about.ini b/bundles/org.eclipse.core.tools/about.ini
deleted file mode 100644
index e521604dd..000000000
--- a/bundles/org.eclipse.core.tools/about.ini
+++ /dev/null
@@ -1,27 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-#welcomePage=$nl$/welcome.xml
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
diff --git a/bundles/org.eclipse.core.tools/about.mappings b/bundles/org.eclipse.core.tools/about.mappings
deleted file mode 100644
index 720ca870f..000000000
--- a/bundles/org.eclipse.core.tools/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/about.properties b/bundles/org.eclipse.core.tools/about.properties
deleted file mode 100644
index f66741d50..000000000
--- a/bundles/org.eclipse.core.tools/about.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Eclipse Core Tools\n\
-\n\
-Version: 1.0.0\n\
-Build id: {0}\n\
-\n\
-(c) Copyright IBM Corp. and others 2000, 2004. All rights reserved.\n\
-Visit http://eclipse.org/eclipse/development/performance
-
diff --git a/bundles/org.eclipse.core.tools/build.properties b/bundles/org.eclipse.core.tools/build.properties
deleted file mode 100644
index 8318141fc..000000000
--- a/bundles/org.eclipse.core.tools/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-src.includes=*.html
-bin.includes=plugin.xml,icons/,doc/,*.html,.options, META-INF/,.
-qualifier=context \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/cpl-v10.html b/bundles/org.eclipse.core.tools/cpl-v10.html
deleted file mode 100644
index 36aa208d4..000000000
--- a/bundles/org.eclipse.core.tools/cpl-v10.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
-<TITLE>Common Public License - v 1.0</TITLE>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF" VLINK="#800000">
-
-
-<P ALIGN="CENTER"><B>Common Public License - v 1.0</B>
-<P><B></B><FONT SIZE="3"></FONT>
-<P><FONT SIZE="3"></FONT><FONT SIZE="2">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"><B>1. DEFINITIONS</B></FONT>
-<P><FONT SIZE="2">"Contribution" means:</FONT>
-
-<UL><FONT SIZE="2">a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and<BR CLEAR="LEFT">
-b) in the case of each subsequent Contributor:</FONT></UL>
-
-
-<UL><FONT SIZE="2">i) changes to the Program, and</FONT></UL>
-
-
-<UL><FONT SIZE="2">ii) additions to the Program;</FONT></UL>
-
-
-<UL><FONT SIZE="2">where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. </FONT><FONT SIZE="2">A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. </FONT><FONT SIZE="2">Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. </FONT></UL>
-
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">"Contributor" means any person or entity that distributes the Program.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. </FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">"Program" means the Contributions distributed in accordance with this Agreement.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.</FONT>
-<P><FONT SIZE="2"><B></B></FONT>
-<P><FONT SIZE="2"><B>2. GRANT OF RIGHTS</B></FONT>
-
-<UL><FONT SIZE="2"></FONT><FONT SIZE="2">a) </FONT><FONT SIZE="2">Subject to the terms of this Agreement, each Contributor hereby grants</FONT><FONT SIZE="2"> Recipient a non-exclusive, worldwide, royalty-free copyright license to</FONT><FONT SIZE="2" COLOR="#FF0000"> </FONT><FONT SIZE="2">reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.</FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT><FONT SIZE="2">b) Subject to the terms of this Agreement, each Contributor hereby grants </FONT><FONT SIZE="2">Recipient a non-exclusive, worldwide,</FONT><FONT SIZE="2" COLOR="#008000"> </FONT><FONT SIZE="2">royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. </FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-
-<UL><FONT SIZE="2">c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.</FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-
-<UL><FONT SIZE="2">d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. </FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-<P><FONT SIZE="2"><B>3. REQUIREMENTS</B></FONT>
-<P><FONT SIZE="2"><B></B>A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:</FONT>
-
-<UL><FONT SIZE="2">a) it complies with the terms and conditions of this Agreement; and</FONT></UL>
-
-
-<UL><FONT SIZE="2">b) its license agreement:</FONT></UL>
-
-
-<UL><FONT SIZE="2">i) effectively disclaims</FONT><FONT SIZE="2"> on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; </FONT></UL>
-
-
-<UL><FONT SIZE="2">ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; </FONT></UL>
-
-
-<UL><FONT SIZE="2">iii)</FONT><FONT SIZE="2"> states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and</FONT></UL>
-
-
-<UL><FONT SIZE="2">iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.</FONT><FONT SIZE="2" COLOR="#0000FF"> </FONT><FONT SIZE="2" COLOR="#FF0000"></FONT></UL>
-
-
-<UL><FONT SIZE="2" COLOR="#FF0000"></FONT><FONT SIZE="2"></FONT></UL>
-
-<P><FONT SIZE="2">When the Program is made available in source code form:</FONT>
-
-<UL><FONT SIZE="2">a) it must be made available under this Agreement; and </FONT></UL>
-
-
-<UL><FONT SIZE="2">b) a copy of this Agreement must be included with each copy of the Program. </FONT></UL>
-
-<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT>
-<P><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT><FONT SIZE="2">Contributors may not remove or alter any copyright notices contained within the Program. </FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. </FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"><B>4. COMMERCIAL DISTRIBUTION</B></FONT>
-<P><FONT SIZE="2">Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"></FONT>
-<P><FONT SIZE="2" COLOR="#0000FF"></FONT><FONT SIZE="2"><B>5. NO WARRANTY</B></FONT>
-<P><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is</FONT><FONT SIZE="2"> solely responsible for determining the appropriateness of using and distributing </FONT><FONT SIZE="2">the Program</FONT><FONT SIZE="2"> and assumes all risks associated with its exercise of rights under this Agreement</FONT><FONT SIZE="2">, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, </FONT><FONT SIZE="2">programs or equipment, and unavailability or interruption of operations</FONT><FONT SIZE="2">. </FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"><B>6. DISCLAIMER OF LIABILITY</B></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES </FONT><FONT SIZE="2">(INCLUDING WITHOUT LIMITATION LOST PROFITS),</FONT><FONT SIZE="2"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"><B>7. GENERAL</B></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. </FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. </FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to </FONT><FONT SIZE="2">publish new versions (including revisions) of this Agreement from time to </FONT><FONT SIZE="2">time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. </FONT><FONT SIZE="2">Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new </FONT><FONT SIZE="2">version. </FONT><FONT SIZE="2">Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, </FONT><FONT SIZE="2">by implication, estoppel or otherwise</FONT><FONT SIZE="2">.</FONT><FONT SIZE="2"> All rights in the Program not expressly granted under this Agreement are reserved.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-
-</BODY>
-
-</HTML> \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/doc/hglegal2002.htm b/bundles/org.eclipse.core.tools/doc/hglegal2002.htm
deleted file mode 100644
index 5df454d51..000000000
--- a/bundles/org.eclipse.core.tools/doc/hglegal2002.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved.
-</body>
-</html>
diff --git a/bundles/org.eclipse.core.tools/doc/ngibmcpy2002.gif b/bundles/org.eclipse.core.tools/doc/ngibmcpy2002.gif
deleted file mode 100644
index 61cef4852..000000000
--- a/bundles/org.eclipse.core.tools/doc/ngibmcpy2002.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/doc/readme.html b/bundles/org.eclipse.core.tools/doc/readme.html
deleted file mode 100644
index 6caf1c746..000000000
--- a/bundles/org.eclipse.core.tools/doc/readme.html
+++ /dev/null
@@ -1,236 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Core Tools Readme</title>
-</head>
-
-<body>
-<h2 align="center">Core Tools</h2>
-<h3>Introduction</h3>
-
-
-<p>Core Tools is a set of views and perspectives useful for people writing Eclipse
- plugins or just wanting to know what is going on under the covers. Roughly speaking
- there are three kinds of tools:</p>
-<dl>
- <dt><b>Runtime tools</b></dt>
- <dd>The runtime tools expose the internal behaviour of the Platform runtime
- as well as certain aspects of plugins (activation ordering, classes loaded,
- relation to other plugins, ...) and classes (load order, load nesting, ...).
- Plugin developers can use this information to ensure that their plugins/classes
- are be activated/loaded as expected, and that they are not taking more time/space
- than is warranted.</dd>
- <dt><b>Resources tools</b></dt>
- <dd>The resources tools expose the behaviour/performance of installed builders
- and listeners as well as the structure of the workspace, resources and resource
- deltas.</dd>
- <dt><b>Metadata tools</b></dt>
- <dd>The metadata tools enable users to investigate the metadata files used to
- maintain the resource model. Point these tools at a workspace and browse...</dd>
-</dl>
-
-
-<h3>Installing and Running Core Tools</h3>
-
-<h4>Installing Core Tools</h4>
-<p>Core Tools comes in two parts; the tools themselves and some patches for the
- boot, runtime and resources plugins. To install:</p>
-<ol>
- <li>To install the Core Tools, get org.eclipse.core.tools.zip and extract all
- files into the &lt;eclipse install&gt;/plugins directory. This will a add
- the Core Tools plugins and fragments to your install.
- Use Core Tools version 1.0.0 for Eclipse builds prior to I20030128, and
- Core Tools 1.0.1 for all builds after that (including the 2.1 release).</li>
- <li>If you are running an Eclipse build from before I20021127 (this includes
- 2.0.*) you will need to get the patched versions of the boot, runtime and
- resources plugins. Get core-tools-patches.zip and extract all files into your
- &lt;eclipse install&gt;/plugins directory. This will overwrite boot.jar, runtime.jar
- and resources.jar. Note that if your install has version numbers in the plug-in
- directory names, you have to manually copy/extract the patch files into the
- corresponding versioned plug-in directory in your install.</li>
-</ol>
-<h4>Running Core Tools</h4>
-<p>After installing the Core Tools, you must enable them. The tools are enabled
- using Eclipse's debug options mechanism. To run Eclipse in &quot;debug&quot;
- mode, use the -debug command line option. If nothing else is said, Eclipse will
- look for the file &lt;eclipse install&gt;/.options. This is a Java properties
- file detailing which debug options should be enabled etc. See the Eclipse runtime
- documentation for more details. </p>
-<p>The org.eclipse.core.tools plugin contains an example .options file which enables
- all options (except class load trace filters). To run Eclipse with the Core
- Tools, either copy this file to your &lt;eclipse install&gt; directory or identify
- it on the command line after -debug. For example, </p>
-<pre> eclipse -debug file:d:/.options</pre>
-<p>Note that not all tools require enablement. You need only enable the debug
- options required by the tools you choose to use. See the tool descriptions for
- details.</p>
-<p>If you are using PDE's runtime workbench then you can enable tracing and set
- the appropriate options for the target workspace. See PDE Guide -&gt; Running
- a plug-in -&gt; Running with tracing found in the standard Eclipse documentation
- set for more information.</p>
-<p>Once you are running with the Core Tools installed, there are a number of new
- perspectives and views. These are accessed by opening a new perspective or using
- the Window-&gt;Show View functions in the workbench.</p>
-<h3>Runtime Tools</h3>
-
-
-<p>The runtime tooling contributes a Runtime Spy and Plugin Dependency perspectives.
- Note that in some cases the views can be combined or used in other contexts.
- The individual views are accessed via the Workspace-&gt;Show View-&gt;Runtime
- Tools menu.</p>
-<h4>Runtime Spy Perspective</h4>
-<p>The Runtime Spy perspective shows information about the plugin activation,
- class loading, resource bundles etc. It is extremely useful when trying to track
- down why plugins are being activated or classes loaded as well as getting a
- handle on how much code is loaded. This tool contains four views: </p>
-<dl>
- <dt><b>Activated Plugins</b> </dt>
- <dd>This is the list of plugins which have been activated since the start of
- this Eclipse session. Included is total code footprint, startup time, activation
- order as well as the number of classes loaded for each plugin.<br>
- When plugins are activated a snapshot of the execution stack is taken. This
- stack trace can be viewed by selecting plugin and clicking on the stack trace
- 'T' button on the title bar or in the context menu.<br>
- The classes loaded by the selected plugins is shown in the Loaded Classes
- view when the &quot;Classes&quot; button ('C') on the menu bar or context
- menu is used.<br>
- Note that this list is not automatically updated when a new plugin is activated
- so users should use the refresh button on the view title bar or in the context
- menu.</dd>
- <dt><b>Loaded Classes</b> </dt>
- <dd>This view is populated with classes loaded by plugins selected in the Activated
- Plugins view. For each class data such as load order and memory footprint
- are listed. If the appropriate filtering is enabled when the platform is started
- (see below), stack snapshots taken at class loading time are available by
- selecting a class and using the Stack Trace menu entry or title bar button.</dd>
- <dt><b>Plugin Datasheet</b> </dt>
- <dd>Shows a summary of the currently selected plugin.</dd>
- <dt><b>Stack Trace</b> </dt>
- <dd>Shows a snapshot of the execution stack at the time of some event (e.g.,
- plugin activation, class loading).</dd>
-</dl>
-<p>The following debug options control what data is available in Runtime Spy perspective
- views.</p>
-<dl>
- <dt>org.eclipse.core.boot/monitor/classes=&lt;boolean&gt;</dt>
- <dd>Whether or not to monitor which classes are loaded.</dd>
- <dt>org.eclipse.core.boot/monitor/plugins=&lt;boolean&gt;</dt>
- <dd>Whether or not to monitor which plugins are activated.</dd>
- <dt>org.eclipse.core.boot/monitor/bundles=&lt;boolean&gt;</dt>
- <dd>Whether or not to monitor which resource bundles (i.e., *.properties files
- ) are loaded</dd>
- <dt>org.eclipse.core.boot/trace/classLoading=&lt;boolean&gt;</dt>
- <dd>Whether or not to snapshot the execution stack when a class is loaded</dd>
- <dt>org.eclipse.core.boot/trace/filename=&lt;file location&gt;</dt>
- <dd>The file in which execution traces are written</dd>
- <dt>org.eclipse.core.boot/trace/filters=&lt;properties file&gt;</dt>
- <dd>The location of a Java properties file identifying the classes which should
- be traced (if trace/classLoading is true). The File format is: <br>
- plugins=&lt;comma separated list of plugins whose classes to trace&gt;<br>
- packages=&lt;comma separated list of package prefixes of classes to trace&gt;<br>
- Note that there may be many 'plugins' and 'packages' lines in one file.</dd>
- <dt>org.eclipse.core.boot/trace/pluginActivation=&lt;boolean&gt;</dt>
- <dd>Whether or not to snapshot the execution stack when a plugin is activated.<br>
- </dd>
-</dl>
-<p></p>
-<h4>Plug-In Dependency Perspective</h4>
-<p>This perspective includes 2 views: a plug-in list view listing all the plug-ins
- available in the workspace and a plug-in dependency view. The plug-in ids in
- the list view are given in alphabetical order (according to their plug-in id).
- Select a plug-in in the list view and the dependency view is updated to show
- all plug-ins that the selected plug-in requires as well as all plug-ins that
- require this selected plug-in. This information is currently only presented
- in a text format.</p>
-<h3>Resources Tools</h3>
-<p>The Resources tooling consists of a number of views described below. These
- are accessed via the Workspace-&gt;Show View-&gt;Resources Tools menu and can
- be used independently or together to as desired. </p>
-<h4>Resource Spy view</h4>
-This view shows detailed public/internal information about the resource currently
-selected in any Eclipse view (e.g. Resource Navigator, Package Explorer, etc).
-It shows details about: flags, markers, synchronization information, and session/persistent
-properties.
-<h4>Delta Spy View</h4>
-The Delta Spy listens for any resource changes, echoing the resource delta for
-each change event listened. For each affected resource (and its child resources),
-it shows the following information:
-<ul>
- <li>the resource's full path;</li>
- <li>the kind of change (between brackets): addition (+), phantom addition (&gt;),
- removal (-), phantom removal (&lt;), change (*), no change (~), and unknown
- (?);</li>
- <li>the change flags (between curly braces): CONTENT, MOVED_FROM, MOVED_TO,
- OPEN, TYPE, SYNC, MARKERS, REPLACED, DESCRIPTION;</li>
- <li>in the case it is a marker change, it will show (between brackets) for each
- marker changed:
- <ul>
- <li>the kind of marker change: addition (+), removal (-), change (*);</li>
- <li>the marker's id;</li>
- </ul>
- </li>
- <li>if it is a team private change, a "(team private)" tag.</li>
-</ul>
-<h4>Builders/Listeners Spy</h4>
-<p>The Builders/Listeners Spy view displays statistical information about the
- behaviour and performance of installed builders and resource change listeners.
- The information includes:</p>
-<ul>
- <li>the name of builder/listener (listeners do not technically have names so
- their toString() is used)</li>
- <li>the project related to the builder (blank for listeners)</li>
- <li>the number of events (builds or resource changed) processed by the builder/listener</li>
- <li>the amount of time spent processing these events</li>
- <li>the number of core exceptions encountered</li>
-</ul>
-<p>For more informatioin on listeners see the Eclipse article &quot;How You've
- Changed! Responding to resource changes in the Eclipse workspace&quot; by John
- Arthorne (OTI) August 23, 2002. Documentation on builders can be found in the
- Platform Plug-in Developer Guide included with the Eclipse documentation.</p>
-<p>The following debug options control what data is available in Builder/Listener
- Spy view.</p>
-<dl>
- <dt>org.eclipse.core.resources/monitor/builders=&lt;boolean&gt;</dt>
- <dd>Whether or not to monitor which builders.</dd>
- <dt>org.eclipse.core.resources/monitor/listeners=&lt;boolean&gt;</dt>
- <dd>Whether or not to monitor which listeners.</dd>
-</dl>
-
-<h3>Metadata Tools</h3>
-<p>The metadata tooling contributes a Metadata perspective. The individual views
- are not particularly useful on their own but are accessed via the Workspace-&gt;Show
- View-&gt;Metadata Tools menu.</p>
-<h4></h4>
-<h4>The Metadata Perspective</h4>
-This perspective contains three views which allows the user to select a workspace
-metadata directory, browse its structure and see supported files contents and
-integrity status.
-<h4></h4>
-<dl>
- <dt><b>Workspace Files Spy</b></dt>
- <dd>This view allows the user to select a given workspace .metadata directory
- and uses a tree view to show a directory hierarchy (having .metadata as root)
- containing all known metadata files as leaf nodes. If the user double-clicks
- one of these leaf nodes, the Dump Contents view will be opened having this
- file as its current selected file. </dd>
- <dt><b>Dump Contents</b></dt>
- <dd>This view presents to the user the contents of a selected metadata file
- in a human-readable format. It provides an action for selecting a new file
- to dump. The contents layout will depend on what kind of file is being dumped.
- This view has a sub-view called &quot;Dump Summary&quot; that shows whether
- the file read was ok or not. </dd>
- <dt><b>Dump Summary</b></dt>
- <dd>This view presents to the user the results of a file dumped using the Dump
- Contents view. In the case of a error during the dumping process (because
- the metadata file being dumped was corrupted), the reason will be shown here,
- along with the number of bytes read. This view will only be updated if it
- is open when a file is being dumped. </dd>
-</dl>
-<p>Note: the dumping functionality is also available through a command-line tool:
- <code>org.eclipse.core.tools.dumper.DumpTool</code>. To run it, you need to
- provide the file to be dumped as an argument. Beware the classpath must include
- both Spy and Resources plug-ins' JARs. </p>
-<h4><a href="hglegal2002.htm"><img SRC="ngibmcpy2002.gif" ALT="Copyright IBM Corporation and others 2000, 2002. All Rights Reserved." BORDER=0 height=14 width=324></a></h4>
- </body>
-</html>
diff --git a/bundles/org.eclipse.core.tools/icons/classes.gif b/bundles/org.eclipse.core.tools/icons/classes.gif
deleted file mode 100644
index 4fa09405d..000000000
--- a/bundles/org.eclipse.core.tools/icons/classes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/clear.gif b/bundles/org.eclipse.core.tools/icons/clear.gif
deleted file mode 100644
index 255832653..000000000
--- a/bundles/org.eclipse.core.tools/icons/clear.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/collapseall.gif b/bundles/org.eclipse.core.tools/icons/collapseall.gif
deleted file mode 100644
index 0bae56c34..000000000
--- a/bundles/org.eclipse.core.tools/icons/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/datasheet.gif b/bundles/org.eclipse.core.tools/icons/datasheet.gif
deleted file mode 100644
index ec0cba1aa..000000000
--- a/bundles/org.eclipse.core.tools/icons/datasheet.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/plugin.gif b/bundles/org.eclipse.core.tools/icons/plugin.gif
deleted file mode 100644
index 8a87648f3..000000000
--- a/bundles/org.eclipse.core.tools/icons/plugin.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/refresh.gif b/bundles/org.eclipse.core.tools/icons/refresh.gif
deleted file mode 100644
index a063c230a..000000000
--- a/bundles/org.eclipse.core.tools/icons/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/req_plugins_obj.gif b/bundles/org.eclipse.core.tools/icons/req_plugins_obj.gif
deleted file mode 100644
index 689f522dd..000000000
--- a/bundles/org.eclipse.core.tools/icons/req_plugins_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/reset.gif b/bundles/org.eclipse.core.tools/icons/reset.gif
deleted file mode 100644
index 8d50500da..000000000
--- a/bundles/org.eclipse.core.tools/icons/reset.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/spy.gif b/bundles/org.eclipse.core.tools/icons/spy.gif
deleted file mode 100644
index ce3fc5185..000000000
--- a/bundles/org.eclipse.core.tools/icons/spy.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/trace.gif b/bundles/org.eclipse.core.tools/icons/trace.gif
deleted file mode 100644
index 34027a546..000000000
--- a/bundles/org.eclipse.core.tools/icons/trace.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/icons/zoom.gif b/bundles/org.eclipse.core.tools/icons/zoom.gif
deleted file mode 100644
index 3c1058233..000000000
--- a/bundles/org.eclipse.core.tools/icons/zoom.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.core.tools/notice.html b/bundles/org.eclipse.core.tools/notice.html
deleted file mode 100644
index af8c38096..000000000
--- a/bundles/org.eclipse.core.tools/notice.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse.org Software User Agreement</h2>
-<p>14th August, 2003</p>
-
-<h3>Usage Of Content</h3>
-
-<p>ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by Eclipse.org is provided to you under the terms and conditions of the Common Public License Version 1.0
- (&quot;CPL&quot;). A copy of the CPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
- For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<p>Content may be apportioned into plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories
- named &quot;plugins&quot; and Features are located in directories named &quot;features&quot;.</p>
-
-<p>Features may also include other Features (&quot;Included Features&quot;). Files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</p>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Subdirectories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by Eclipse.org is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot;.
-Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE CPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please
-contact Eclipse.org to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/plugin.xml b/bundles/org.eclipse.core.tools/plugin.xml
deleted file mode 100644
index 7ceb5d19f..000000000
--- a/bundles/org.eclipse.core.tools/plugin.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-<!-- Perspectives -->
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="Plug-in Dependency Perspective"
- icon="icons/req_plugins_obj.gif"
- class="org.eclipse.core.tools.runtime.PluginDependencyPerspective"
- id="org.eclipse.core.tools.runtime.PluginDependencyPerspective">
- </perspective>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="Runtime Spy"
- icon="icons/zoom.gif"
- class="org.eclipse.core.tools.runtime.RuntimeSpyPerspective"
- id="org.eclipse.core.tools.runtime.RuntimeSpyPerspective">
- </perspective>
- </extension>
-<!-- Runtime Views -->
- <extension point="org.eclipse.ui.views">
- <category name="Runtime Tools" id="org.eclipse.core.tools.runtime"/>
- <view
- name="Activated Plugins"
- icon="icons/plugin.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.ActivePluginsView"
- id="org.eclipse.core.tools.runtime.ActivePluginsView"/>
- <view
- name="Loaded Classes"
- icon="icons/classes.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.LoadedClassesView"
- id="org.eclipse.core.tools.runtime.LoadedClassesView"/>
- <view
- name="Plugin Datasheet"
- icon="icons/datasheet.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.PluginDataSheetView"
- id="org.eclipse.core.tools.runtime.PluginDataSheetView"/>
- <view
- name="Stack Trace View"
- icon="icons/trace.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.StackTraceView"
- id="org.eclipse.core.tools.runtime.StackTraceView"/>
- <view
- name="Plug-in Dependency Spy"
- icon="icons/spy.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.PluginDependencyView"
- id="org.eclipse.core.tools.runtime.PluginDependencyView"/>
- <view
- name="Plug-in List Spy"
- icon="icons/spy.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.PluginListView"
- id="org.eclipse.core.tools.runtime.PluginListView"/>
- <view
- name="Eclipse Preferences"
- icon="icons/spy.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.EclipsePreferencesView"
- id="org.eclipse.core.tools.runtime.EclipsePreferencesView"/>
- <view
- name="Eclipse Preference Stats Spy"
- icon="icons/spy.gif"
- category="org.eclipse.core.tools.runtime"
- class="org.eclipse.core.tools.runtime.PreferenceStatsView"
- id="org.eclipse.core.tools.runtime.PreferenceStatsView"/>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractCopySelectionAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractCopySelectionAction.java
deleted file mode 100644
index 817e64965..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractCopySelectionAction.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-/**
- * A base abstract implementation for "copy selection" actions.
- */
-
-public abstract class AbstractCopySelectionAction extends GlobalAction {
-
- /**
- * The selection provider.
- */
- protected ISelectionProvider selectionProvider;
-
- /**
- * Sets action's text and tool tip text.
- *
- * @param selectionProvider the selection provider
- */
- public AbstractCopySelectionAction(ISelectionProvider selectionProvider) {
- super("Copy"); //$NON-NLS-1$
- this.selectionProvider = selectionProvider;
- }
-
- /**
- * Copies the currently selected contents to the clipboard. The meaning of the
- * currently selected contents is defined by overriding the getContents()
- * method.
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- // puts that content in the clipboard
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- clipboard.setContents(new Object[] {getContents()}, new Transfer[] {TextTransfer.getInstance()});
- clipboard.dispose();
- }
-
- /**
- * Registers this action as a global action handler.
- *
- * @param actionBars the action bars where this action will be registered.
- * @see org.eclipse.core.tools.GlobalAction#registerAsGlobalAction(
- * org.eclipse.ui.IActionBars)
- */
- public void registerAsGlobalAction(IActionBars actionBars) {
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, this);
- }
-
- /**
- * Returns the currently selected contents as a String object.
- *
- * @return the selected contents as string.
- */
- protected abstract String getContents();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractTreeContentProvider.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractTreeContentProvider.java
deleted file mode 100644
index a860d2a54..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/AbstractTreeContentProvider.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * An abstract base class for hierarchical content providers. Uses
- * <code>TreeContentProviderNode</code> objects to keep a hierarchical
- * data model. Subclasses must provide an implementation for the
- * <code>#rebuild(Object)</code> operation in order to define how the data model
- * will be built upon a given input provided by the viewer.
- */
-
-public abstract class AbstractTreeContentProvider implements ITreeContentProvider {
-
- /**
- * Flag for omitting the root or not when providing the contents.
- */
- private boolean omitRoot;
-
- /**
- * The root node.
- */
- private TreeContentProviderNode rootNode;
-
- /**
- * Constructs a AbstractTreeContentProvider.
- *
- * @param omitRoot if true, the root node will be omitted when providing
- * contents.
- */
- protected AbstractTreeContentProvider(boolean omitRoot) {
- this.omitRoot = omitRoot;
- }
-
- /**
- * Constructs a AbstractTreeContentProvider that will omit the root node when
- * providing contents.
- *
- * @see #AbstractTreeContentProvider(boolean)
- */
- protected AbstractTreeContentProvider() {
- this(true);
- }
-
- /**
- * Returns the child elements of the given parent element.
- *
- * @return an array containing <code>parentElement</code>'s children.
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(
- * java.lang.Object)
- * @see org.eclipse.core.tools.TreeContentProviderNode#getChildren()
- */
- public Object[] getChildren(Object parentElement) {
- if (!(parentElement instanceof TreeContentProviderNode))
- return null;
-
- TreeContentProviderNode treeNode = (TreeContentProviderNode) parentElement;
- return treeNode.getChildren();
- }
-
- /**
- * Returns the parent for the given element, or <code>null</code>
- * indicating that the parent can't be computed.
- *
- * @return <coded>element</code>'s parent node or null, if it is a root node
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(
- * java.lang.Object)
- * @see org.eclipse.core.tools.TreeContentProviderNode#getParent()
- */
- public Object getParent(Object element) {
- if (!(element instanceof TreeContentProviderNode))
- return null;
-
- TreeContentProviderNode treeNode = (TreeContentProviderNode) element;
- return treeNode.getParent();
- }
-
- /**
- * Returns whether the given element has children.
- *
- * @return true, if <code>element</code> has children, false otherwise
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(
- * java.lang.Object)
- * @see org.eclipse.core.tools.TreeContentProviderNode#hasChildren() *
- */
- public boolean hasChildren(Object element) {
- return element instanceof TreeContentProviderNode && ((TreeContentProviderNode) element).hasChildren();
- }
-
- /**
- * Returns the elements to display in the viewer
- * when its input is set to the given element.
- *
- * @return this content provider root element's children
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(
- * java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- if (rootNode == null)
- return new Object[0];
-
- return omitRoot ? rootNode.getChildren() : new Object[] {rootNode};
- }
-
- /**
- * Disposes of this content provider.
- * This is called by the viewer when it is disposed.
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- rootNode = null;
- }
-
- /**
- * Helper method that creates a root node given a node name and value.
- *
- * @param name the name of the node
- * @param value the value of the node. May be null.
- * @return the tree node created
- * @see TreeContentProviderNode#TreeContentProviderNode(String, Object)
- */
- protected TreeContentProviderNode createNode(String name, Object value) {
- return new TreeContentProviderNode(name, value);
- }
-
- /**
- * Helper method that creates a root node given a node name and no value.
- *
- * @param name the name of the node
- * @return the tree node created
- * @see TreeContentProviderNode#TreeContentProviderNode(String)
- */
- protected TreeContentProviderNode createNode(String name) {
- return new TreeContentProviderNode(name);
- }
-
- /**
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- * Rebuilds this content provider's state from a given resource.
- *
- * @param viewer ignored
- * @param oldInput ignored
- * @param input the new input. If null, clears this content provider. If not,
- * is passed in a call to <code>rebuild(Object)</code>.
- * @see
- * org.eclipse.jface.viewers.IContentProvider#inputChanged(
- * org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- * @see #rebuild(Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, final Object input) {
- if (input == null) {
- rootNode = createNode("root"); //$NON-NLS-1$
- return;
- }
-
- if (!acceptInput(input))
- return;
-
- rootNode = createNode("root"); //$NON-NLS-1$
- rebuild(input);
- }
-
- /**
- * Reconstructs this content provider data model upon the provided input object.
- *
- * @param input the new input object - must not be null
- */
- protected abstract void rebuild(Object input);
-
- /**
- * Returns true if the provided input is accepted by this content provider.
- *
- * @param input an input object
- * @return boolean true if the provided object is accepted, false otherwise
- */
- protected abstract boolean acceptInput(Object input);
-
- /**
- * Returns the rootNode.
- *
- * @return this content provider root node
- */
- protected TreeContentProviderNode getRootNode() {
- return rootNode;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/BaseTextView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/BaseTextView.java
deleted file mode 100644
index f5f85307b..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/BaseTextView.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.part.ViewPart;
-
-public class BaseTextView extends ViewPart {
- protected TextViewer viewer;
-
- public BaseTextView() {
- super();
- }
-
- public void createPartControl(Composite parent) {
- viewer = new TextViewer(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- viewer.setDocument(new Document());
-
- IActionBars bars = getViewSite().getActionBars();
-
- GlobalAction selectAllAction = new SelectAllAction(viewer);
- selectAllAction.registerAsGlobalAction(bars);
-
- GlobalAction copyAction = new CopyTextSelectionAction(viewer);
- copyAction.registerAsGlobalAction(bars);
-
- bars.updateActionBars();
-
- // creates a context menu with actions and adds it to the viewer control
- MenuManager menuMgr = new MenuManager();
- menuMgr.add(copyAction);
- menuMgr.add(selectAllAction);
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- }
-
- public void setFocus() {
- // do nothing
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ByteUtil.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ByteUtil.java
deleted file mode 100644
index 2dfd1998f..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ByteUtil.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-/**
- * A set of utility methods for dealing with byte arrays.
- */
-public class ByteUtil {
-
- /**
- * Helper method that creates a string representation for a byte array.
- *
- * @param byteArray a byte array to be represented as string
- * @param max a maximum number of bytes to be considered - if zero, there is
- * no maximum.
- * @return a byte array string representation
- */
- public static String byteArrayToString(byte[] byteArray, int max) {
- StringBuffer result = new StringBuffer(byteArray.length * 2 + 2);
- int bytesToBeShown = (max > 0) ? (Math.min(max, byteArray.length)) : byteArray.length;
- result.append('[');
- for (int i = 0; i < bytesToBeShown; i++) {
- result.append(byteArray[i]);
- result.append(',');
- }
- // adds an ellipsis if there is too much bytes to show
- if (max > 0 && max < byteArray.length)
- result.append("..."); //$NON-NLS-1$
- // or remove the trailing comma
- else
- result.deleteCharAt(result.length() - 1);
- result.append(']');
- return result.toString();
- }
-
- /**
- * Calls <code>byteArrayToString()</code> with no limit for array lenght.
- *
- * @see #byteArrayToString(byte[], int)
- * @param byteArray the array to be converted to string
- * @return a string representation for the array
- */
- public static String byteArrayToString(byte[] byteArray) {
- return byteArrayToString(byteArray, 0);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ClearTextAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ClearTextAction.java
deleted file mode 100644
index c8cda0a5f..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ClearTextAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-
-/**
- * Generic "clear contents" action. Sets action's text, tool tip text and icon.
- */
-
-public class ClearTextAction extends GlobalAction {
-
- /**
- * The document on which this action performs its duty.
- */
- private IDocument document;
-
- /**
- * Constructs a ClearTextAction action with the provided document.
- *
- * @param document the document to be cleared when this action is run.
- */
- public ClearTextAction(IDocument document) {
- super("Clear contents"); //$NON-NLS-1$
- this.setToolTipText("Clear contents"); //$NON-NLS-1$
- this.document = document;
- // the delete key is not captured by the workbench
- // then we need to provide an action definition id
- // so clients can register this action in their key binding services
- this.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
- this.setImageDescriptor(CoreToolsPlugin.createImageDescriptor("clear.gif")); //$NON-NLS-1$
- }
-
- /**
- * Executes this action (clears associated document's contents).
- */
- public void run() {
- document.set(""); //$NON-NLS-1$
- }
-
- /**
- * Registers this action as a global action handler.
- *
- * @param actionBars the action bars where this action will be registered.
- * @see GlobalAction#registerAsGlobalAction(org.eclipse.ui.IActionBars)
- */
- public void registerAsGlobalAction(IActionBars actionBars) {
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE, this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CollapseAllAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CollapseAllAction.java
deleted file mode 100644
index a0292fa5d..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CollapseAllAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.TreeViewer;
-
-/**
- * @since 3.0
- */
-public class CollapseAllAction extends Action implements IAction {
-
- private static final String label = "Collapse All"; //$NON-NLS-1$
- private static final String imageName = "collapseall.gif"; //$NON-NLS-1$
- private TreeViewer viewer;
-
- public CollapseAllAction(TreeViewer viewer) {
- super(label);
- this.setToolTipText(label);
- this.viewer = viewer;
- this.setImageDescriptor(CoreToolsPlugin.createImageDescriptor(imageName));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- viewer.collapseAll();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyStructuredSelectionAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyStructuredSelectionAction.java
deleted file mode 100644
index 104cb5969..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyStructuredSelectionAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.util.Iterator;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * A concrete implementation for <code>AbstractCopySelectionAction</code> that
- * supports structured selections.
- *
- * @see org.eclipse.jface.viewers.IStructuredSelection
- */
-public class CopyStructuredSelectionAction extends AbstractCopySelectionAction {
-
- /**
- * @see org.eclipse.core.tools.AbstractCopySelectionAction#AbstractCopySelectionAction(ISelectionProvider)
- */
- public CopyStructuredSelectionAction(ISelectionProvider selectionProvider) {
- super(selectionProvider);
- }
-
- /**
- * Returns the current structured selection as a string object where each
- * node is followed by a line terminator char. This method depends on the
- * toString() method of each node to define a reasonably formatted string
- * for display.
- *
- * @return a string containing the currently selected elements separated by
- * line terminators
- * @see org.eclipse.core.tools.AbstractCopySelectionAction#getContents()
- */
- public String getContents() {
- // retrieves the selected contents from the selection provider
- IStructuredSelection selection = (IStructuredSelection) selectionProvider.getSelection();
- StringBuffer content = new StringBuffer();
- for (Iterator selectionIter = selection.iterator(); selectionIter.hasNext();) {
- content.append(selectionIter.next());
- content.append('\n');
- }
- return content.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyTextSelectionAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyTextSelectionAction.java
deleted file mode 100644
index 787fb34a7..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CopyTextSelectionAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-/**
- * A concrete implementation for <code>AbstractCopySelectionAction</code> that
- * supports text selections.
- *
- * @see org.eclipse.jface.text.ITextSelection
- */
-public class CopyTextSelectionAction extends AbstractCopySelectionAction {
-
- /**
- * @see AbstractCopySelectionAction#AbstractCopySelectionAction
- * (ISelectionProvider)
- */
- public CopyTextSelectionAction(ISelectionProvider selectionProvider) {
- super(selectionProvider);
- }
-
- /**
- * Returns the current text selection.
- *
- * @return a string containing the currently selected text
- * @see org.eclipse.core.tools.AbstractCopySelectionAction#getContents()
- */
- protected String getContents() {
- return ((ITextSelection) selectionProvider.getSelection()).getText();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CoreToolsPlugin.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CoreToolsPlugin.java
deleted file mode 100644
index 9d019c509..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/CoreToolsPlugin.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.net.URL;
-import org.eclipse.core.tools.runtime.VMClassInfo;
-import org.eclipse.core.tools.runtime.VMClassloaderInfo;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osgi.framework.stats.ClassloaderStats;
-import org.eclipse.osgi.framework.stats.StatsManager;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class CoreToolsPlugin extends AbstractUIPlugin {
- private static CoreToolsPlugin instance;
- public static String PLUGIN_ID = "org.eclipse.core.tools"; //$NON-NLS-1$
-
- static {
- if (StatsManager.MONITOR_ACTIVATION)
- initializeBootClasses();
- }
-
- public static CoreToolsPlugin getDefault() {
- return instance;
- }
-
- private static void initializeBootClasses() {
- if (!VMClassloaderInfo.hasNatives)
- return;
- ClassloaderStats loader = ClassloaderStats.getLoader("org.eclipse.osgi"); //$NON-NLS-1$
- //class loading trace option not enabled
- if (loader == null)
- return;
- VMClassInfo[] classes = VMClassloaderInfo.getBaseClasses();
- String[] names = new String[classes.length];
- for (int i = 0; i < classes.length; i++)
- names[i] = classes[i].getName();
- loader.addBaseClasses(names);
- }
-
- /**
- * find an icon - caller must dispose of it
- */
- public static ImageDescriptor createImageDescriptor(String imageName) {
- URL url = getDefault().getBundle().getEntry("icons/" + imageName); //$NON-NLS-1$
- if (url != null)
- return ImageDescriptor.createFromURL(url);
- return ImageDescriptor.getMissingImageDescriptor();
- }
-
- public CoreToolsPlugin() {
- super();
- instance = this;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/DeepSize.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/DeepSize.java
deleted file mode 100644
index 861af460b..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/DeepSize.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.*;
-
-/**
- * How to use DeepSize:
- * DeepSize result= DeepSize.deepSize(anObject);
- * int size= result.getSize(); // accumulated size of transitive closure of anObject
- * Hashtable sizes= result.getSizes(); // hashtable of internal results: class name-> sum of shallowsize of instances of class
- * Hashtable counts= result.getCounts(); // hashtable of internal results: class name -> instances of class
- * Additional function
- * DeepSize d= new DeepSize();
- * d.setIgnoreTypeNames(aSet); // don't consider instances of classes named in aSet as part of the size
- * d.ignore(anObject); // don't consider anObject as part of the size
- * d.deepCompute(anObject); // advanced compute method - computes the size given the additional ignore configuration
- */
-public class DeepSize {
- /**
- * Used as keys to track sets of non-identical objects.
- */
- public static class ObjectWrapper {
- private Object object;
-
- public ObjectWrapper(Object object) {
- this.object = object;
- }
-
- public boolean equals(Object o) {
- if (o.getClass() != ObjectWrapper.class)
- return false;
- return object == ((ObjectWrapper) o).object;
- }
-
- public int hashCode() {
- return object == null ? 1 : object.hashCode();
- }
-
- public String toString() {
- return "ObjectWrapper(" + object + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public static final int HEADER_SIZE = 12;
- public static final int OBJECT_HEADER_SIZE = HEADER_SIZE;
- public static final int ARRAY_HEADER_SIZE = 16;
- public static final int POINTER_SIZE = 4;
-
- Set ignoreTypeNames = null;
- static final HashSet ignoreSet = new HashSet();
- final Map sizes = new HashMap();
- final Map counts = new HashMap();
- int size;
-
- void setIgnoreTypeNames(Set ignore) {
- ignoreTypeNames = ignore;
- }
-
- public void deepSize(Object o) {
- size += sizeOf(o);
- }
-
- public int getSize() {
- return size;
- }
-
- public Map getSizes() {
- return sizes;
- }
-
- public Map getCounts() {
- return counts;
- }
-
- public static boolean ignore(Object o) {
- return !ignoreSet.add(new ObjectWrapper(o));
- }
-
- Set getDefaultIgnoreTypeNames() {
- Set ignoreTypeNames = new HashSet();
- String[] ignore = {"org.eclipse.core.runtime.Plugin", "java.lang.ClassLoader", "org.eclipse.team.internal.ccvs.core.CVSTeamProvider", "org.eclipse.core.internal.events.BuilderPersistentInfo", "org.eclipse.core.internal.resources.Workspace", "org.eclipse.core.internal.events.EventStats"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-6$
- for (int i = 0; i < ignore.length; i++) {
- ignoreTypeNames.add(ignore[i]);
- }
- return ignoreTypeNames;
- }
-
- private void count(Class c, int size) {
- Object accumulatedSizes = sizes.get(c);
- int existingSize = (accumulatedSizes == null) ? 0 : ((Integer) accumulatedSizes).intValue();
- sizes.put(c, new Integer(existingSize + size));
-
- Object accumulatedCounts = counts.get(c);
- int existingCount = (accumulatedCounts == null) ? 0 : ((Integer) accumulatedCounts).intValue();
- counts.put(c, new Integer(existingCount + 1));
- }
-
- private boolean shouldIgnoreType(Class clazz) {
- if (ignoreTypeNames == null) {
- ignoreTypeNames = getDefaultIgnoreTypeNames();
- }
- while (clazz != null) {
- if (ignoreTypeNames.contains(clazz.getName()))
- return true;
- clazz = clazz.getSuperclass();
- }
- return false;
- }
-
- private int sizeOf(Object o) {
- if (o == null)
- return 0;
- if (ignore(o))
- return 0;
- Class clazz = o.getClass();
- if (shouldIgnoreType(clazz))
- return 0;
- return clazz.isArray() ? sizeOfArray(clazz, o) : sizeOfObject(clazz, o);
- }
-
- private int sizeOfObject(Class type, Object o) {
-
- int internalSize = 0; // size of referenced objects
- int shallowSize = OBJECT_HEADER_SIZE;
- Class clazz = type;
- while (clazz != null) {
- Field[] fields = clazz.getDeclaredFields();
- for (int i = 0; i < fields.length; i++) {
- Field f = fields[i];
- if (!isStaticField(f)) {
- Class fieldType = f.getType();
- if (fieldType.isPrimitive()) {
- shallowSize += sizeOfPrimitiveField(fieldType);
- } else {
- shallowSize += POINTER_SIZE;
- internalSize += sizeOf(getFieldObject(f, o));
- }
- }
- }
- clazz = clazz.getSuperclass();
- }
- count(type, shallowSize);
- return shallowSize + internalSize;
-
- }
-
- private int sizeOfPrimitiveField(Class type) {
- if (type == long.class || type == double.class)
- return 8;
- return 4;
- }
-
- public static void reset() {
- ignoreSet.clear();
- }
-
- private boolean isStaticField(Field f) {
- return (Modifier.STATIC & f.getModifiers()) != 0;
- }
-
- private int sizeOfArray(Class type, Object array) {
-
- int size = ARRAY_HEADER_SIZE;
- Class componentType = type.getComponentType();
- if (componentType.isPrimitive()) {
-
- if (componentType == char.class) {
- char[] a = (char[]) array;
- size += a.length * 2;
- } else if (componentType == int.class) {
- int[] a = (int[]) array;
- size += a.length * 4;
- } else if (componentType == byte.class) {
- byte[] a = (byte[]) array;
- size += a.length;
- } else if (componentType == short.class) {
- short[] a = (short[]) array;
- size += a.length * 2;
- } else if (componentType == long.class) {
- long[] a = (long[]) array;
- size += a.length * 8;
- } else {
- //TODO: primitive arrays
- System.out.println(componentType);
- }
- count(type, size);
- return size;
- }
- Object[] a = (Object[]) array;
- for (int i = 0; i < a.length; i++) {
- size += POINTER_SIZE + sizeOf(a[i]);
- }
- count(type, ARRAY_HEADER_SIZE + POINTER_SIZE * a.length);
- return size;
-
- }
-
- private Object getFieldObject(Field f, Object o) {
- try {
- f.setAccessible(true);
- return f.get(o);
- } catch (IllegalAccessException e) {
- throw new Error(e.toString());
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ErrorUtil.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ErrorUtil.java
deleted file mode 100644
index 4deedb909..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ErrorUtil.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A helper class that supports error report and logging for
- * Spy plug-in classes.
- */
-public class ErrorUtil {
-
- /**
- * Logs the provided exception and user message in Spy plug-in's log.
- *
- * @param exception the exception to be logged
- * @param userMessage an optional higher-level explanation for the exception
- */
- public static void logException(Exception exception, String userMessage) {
- String pluginID = CoreToolsPlugin.PLUGIN_ID;
- if (userMessage == null)
- userMessage = exception.getMessage();
- IStatus status = new Status(IStatus.ERROR, pluginID, -1, userMessage, exception);
- CoreToolsPlugin.getDefault().getLog().log(status);
- }
-
- /**
- * Shows the provided message using a MessageDialog.
- *
- * @param message
- * @param title
- * @see org.eclipse.jface.dialogs.MessageDialog#openError(Shell,String,String)
- */
- public static void showErrorMessage(String message, String title) {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- if (title == null)
- title = "Error in Spy plug-in"; //$NON-NLS-1$
- MessageDialog.openError(shell, title, message);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/GlobalAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/GlobalAction.java
deleted file mode 100644
index 3671fce82..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/GlobalAction.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IActionBars;
-
-/**
- * An abstract base class for global actions. Global actions
- * are able to register themselves in a view's action bars.
- */
-public abstract class GlobalAction extends Action {
- /**
- * Constructs an action.
- *
- * @param text the action description
- */
- GlobalAction(String text) {
- super(text);
- setToolTipText(text);
- }
-
- /**
- * Registers this action as a global action handler.
- *
- * @param actionBars the action bars where this action will be registered.
- * @see IActionBars#updateActionBars()
- */
- public abstract void registerAsGlobalAction(IActionBars actionBars);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/IFlattable.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/IFlattable.java
deleted file mode 100644
index c88413b46..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/IFlattable.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-/**
- * Interface indicating if a view (normally a tree) support a flat display
- */
-public interface IFlattable {
- public void setFlat(boolean mode);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ISorter.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ISorter.java
deleted file mode 100644
index 5fbd5306b..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ISorter.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-public interface ISorter {
- public boolean isReversed();
-
- public void setReversed(boolean value);
-
- public int getColumnNumber();
-
- public int states();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ITreeNodeVisitor.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ITreeNodeVisitor.java
deleted file mode 100644
index f99d0a9c7..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/ITreeNodeVisitor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-/**
- * This interface is implemented by objects that visit trees made of
- * <code>TreeContentProviderNode</code> objects.
- *
- * @see org.eclipse.core.tools.TreeContentProviderNode#accept(ITreeNodeVisitor)
- */
-public interface ITreeNodeVisitor {
- /**
- * Visits the given node.
- *
- * @param node the node to visit
- * @return <code>true</code> if the node's child nodes should be visited;
- * <code>false</code> if they should be skipped
- */
- public boolean visit(TreeContentProviderNode node);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/Policy.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/Policy.java
deleted file mode 100644
index 820a0792e..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/Policy.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2000, 2002 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.text.MessageFormat;
-import java.util.*;
-import org.eclipse.core.runtime.*;
-
-public class Policy {
- private static String bundleName = "org.eclipse.core.tools.messages"; //$NON-NLS-1$
- private static ResourceBundle bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault());
-
- /**
- * Lookup the message with the given ID in this catalog
- */
- public static String bind(String id) {
- return bind(id, (String[]) null);
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string.
- */
- public static String bind(String id, String binding) {
- return bind(id, new String[] {binding});
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given strings.
- */
- public static String bind(String id, String binding1, String binding2) {
- return bind(id, new String[] {binding1, binding2});
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string values.
- */
- public static String bind(String id, String[] bindings) {
- if (id == null)
- return "No message available"; //$NON-NLS-1$
- String message = null;
- try {
- message = bundle.getString(id);
- } catch (MissingResourceException e) {
- // If we got an exception looking for the message, fail gracefully by just returning
- // the id we were looking for. In most cases this is semi-informative so is not too bad.
- return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (bindings == null)
- return message;
- return MessageFormat.format(message, bindings);
- }
-
- public static IProgressMonitor monitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
-
- public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-
- public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SelectAllAction.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SelectAllAction.java
deleted file mode 100644
index 1f83e288b..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SelectAllAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-public class SelectAllAction extends GlobalAction {
-
- private ITextOperationTarget target;
-
- public SelectAllAction(ITextOperationTarget target) {
- super("Select all"); //$NON-NLS-1$
- this.target = target;
- }
-
- /**
- * Registers this action as a global action handler.
- *
- * @param actionBars the action bars where this action will be registered.
- * @see org.eclipse.core.tools.GlobalAction#registerAsGlobalAction(org.eclipse.ui.IActionBars)
- */
- public void registerAsGlobalAction(IActionBars actionBars) {
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.SELECT_ALL, this);
- }
-
- /**
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- target.doOperation(ITextOperationTarget.SELECT_ALL);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SpyView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SpyView.java
deleted file mode 100644
index adb7fab6c..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/SpyView.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * A common base class for all Spy Plug-in views
- */
-public abstract class SpyView extends ViewPart {
- /**
- * SpyView constructor comment.
- */
- public SpyView() {
- super();
- }
-
- /**
- * Asks this part to take focus within the workbench. Does nothing.
- */
- public void setFocus() {
- // do nothing
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableSelectionProviderDecorator.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableSelectionProviderDecorator.java
deleted file mode 100644
index 020ad355d..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableSelectionProviderDecorator.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.core.internal.events.EventStats;
-import org.eclipse.jface.viewers.*;
-
-/**
- * This class provides a decorator for ISelectionProviders that use
- * TableViewer as their viewer and PluginStats as the basis for their data
- * model. The only affected method is <code>getSelection()</code>, which will
- * return a string that closely resembles the table view of this object.
- *
- */
-public class TableSelectionProviderDecorator implements ISelectionProvider {
-
- /** The decorated selection provider. */
- private ISelectionProvider selectionProvider;
-
- /**
- * Constructs a <code>TableSelectionProviderDecorator</code> having
- * the given selection provider as its decorated object.
- *
- * @param selectionProvider the selection provider to be decorated
- */
- public TableSelectionProviderDecorator(ISelectionProvider selectionProvider) {
- this.selectionProvider = selectionProvider;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionProvider.addSelectionChangedListener(listener);
- }
-
- /**
- * Returns the current selection for this provider. If the selection is a
- * structured selection made of <code>PluginStats</code> elements, this method
- * will return a structured selection of strings that resemble the table view
- * of this data.
- *
- * @return the current selection, printed in table view format
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection() {
- // gets the original selection object
- ISelection selection = selectionProvider.getSelection();
-
- // in these cases the original selection will be returned
- if (selection == null || selection.isEmpty() || !(selection instanceof IStructuredSelection))
- return selection;
-
- // constructs a list with the selected elements
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-
- StringBuffer copyText = new StringBuffer();
- copyText.append(headerPluginStats());
- for (Iterator selectionIter = structuredSelection.iterator(); selectionIter.hasNext();) {
- Object obj = selectionIter.next();
- if (obj instanceof EventStats) {
- copyText.append(prettyPluginStats((EventStats) obj));
- copyText.append("\n"); //$NON-NLS-1$
- }
- }
- return new StructuredSelection(copyText);
-
- }
-
- private String headerPluginStats() {
- String retString = ""; //$NON-NLS-1$
- retString += Policy.bind("stats.statIdHeader") + "\t"; //$NON-NLS-1$ //$NON-NLS-2$
- retString += Policy.bind("stats.numberOfNotificationsHeader") + "\t"; //$NON-NLS-1$ //$NON-NLS-2$
- retString += Policy.bind("stats.notifcationTimeHeader") + "\t"; //$NON-NLS-1$ //$NON-NLS-2$
- retString += Policy.bind("stats.numberOfBuildsHeader") + "\t"; //$NON-NLS-1$ //$NON-NLS-2$
- retString += Policy.bind("stats.buildTimeHeader") + "\t"; //$NON-NLS-1$ //$NON-NLS-2$
- retString += Policy.bind("stats.numberOfErrorsHeader") + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- return retString;
- }
-
- private String prettyPluginStats(EventStats stats) {
- String retString = ""; //$NON-NLS-1$
- retString += stats.getName() + "\t"; //$NON-NLS-1$
- retString += stats.getNotifyCount() + "\t"; //$NON-NLS-1$
- retString += stats.getNotifyRunningTime() + "\t"; //$NON-NLS-1$
- retString += stats.getBuildCount() + "\t"; //$NON-NLS-1$
- retString += stats.getBuildRunningTime() + "\t"; //$NON-NLS-1$
- for (Enumeration excepts = stats.getRuntimeExceptions(); excepts.hasMoreElements();) {
- Exception next = (Exception) excepts.nextElement();
- retString += next.toString() + "\n"; //$NON-NLS-1$
- }
- for (Enumeration excepts = stats.getCoreExceptions(); excepts.hasMoreElements();) {
- Exception next = (Exception) excepts.nextElement();
- retString += next.toString() + "\n"; //$NON-NLS-1$
- }
- return retString;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionProvider.removeSelectionChangedListener(listener);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection) {
- selectionProvider.setSelection(selection);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableWithTotalView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableWithTotalView.java
deleted file mode 100644
index f2eae6083..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TableWithTotalView.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.util.Iterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableTree;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * Abstract class representing a view made of two tables.
- * The first one is used to display data and the second to display totals of the
- * data showed in the first table.
- */
-public abstract class TableWithTotalView extends ViewPart implements ISelectionProvider {
- protected TableTreeViewer viewer; // Table tree viewer used to contain all the data but the total
- protected TableTree tableTree; // The table tree that will populate the viewer
- protected Table totalTable; // The table used to display the totals
- protected boolean flat; // Flag indicating the view mode
- protected Clipboard clipboard;
- protected Action copyAction;
- protected Action selectAllAction;
-
- abstract protected String[] getColumnHeaders();
-
- abstract protected ColumnLayoutData[] getColumnLayout();
-
- abstract protected void createActions();
-
- abstract protected void createToolbar();
-
- abstract protected void createContextMenu();
-
- private SelectionListener getColumnListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent event) {
- // column selected - need to sort
- int column = viewer.getTableTree().getTable().indexOf((TableColumn) event.widget);
-
- ISorter oldSorter = (ISorter) viewer.getSorter();
- boolean threeState = oldSorter.states() == 3;
- ISelection selection = viewer.getSelection();
-
- // first check to see if we are changing sort columns.
- // If so, set flatness and get a new sorter
- if (oldSorter == null || !threeState || column != oldSorter.getColumnNumber()) {
- flat = column != 0; // default for column 0 is NOT flat
- viewer.setSorter(getSorter(column));
- } else {
- // Not changing sorters so we have to cycle through states for the columns
- // Three state sort for column 0. !flat/!reverse -> flat/!reverse -> flat/reverse
- if (column == 0) {
- if (flat) {
- if (oldSorter.isReversed())
- flat = false;
- oldSorter.setReversed(!oldSorter.isReversed());
- } else {
- flat = true;
- oldSorter.setReversed(false);
- }
- } else { // for all other columns flatten and simply reverse
- flat = true;
- oldSorter.setReversed(!oldSorter.isReversed());
- }
- }
- if (viewer.getContentProvider() instanceof IFlattable)
- ((IFlattable) viewer.getContentProvider()).setFlat(flat);
- viewer.refresh();
- viewer.setSelection(selection);
- }
- };
- }
-
- protected ControlListener getColumnResizeListener() {
- return new ControlListener() {
- public void controlMoved(ControlEvent event) {
- // do nothing
- }
-
- public void controlResized(ControlEvent event) {
- TableColumn column = (TableColumn) event.widget;
- int columnNumber = viewer.getTableTree().getTable().indexOf(column);
- totalTable.getColumn(columnNumber).setWidth(column.getWidth());
- }
- };
- }
-
- private void createTables(Composite parent) {
- // create a first table, that will display all the data
- tableTree = new TableTree(parent, SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- tableTree.setLayoutData(new GridData(GridData.FILL_BOTH));
- Table table = tableTree.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- SelectionListener headerListener = getColumnListener();
-
- // create a second table for totals
- totalTable = new Table(parent, 0);
- GridData gridInfo = new GridData(GridData.FILL_HORIZONTAL);
- gridInfo.heightHint = totalTable.getItemHeight();
- totalTable.setLayoutData(gridInfo);
- totalTable.setHeaderVisible(false);
- totalTable.setLinesVisible(true);
- TableLayout totalLayout = new TableLayout();
- totalTable.setLayout(totalLayout);
-
- ControlListener columnResizeListener = getColumnResizeListener();
- //create the columns for the two tables
- ColumnLayoutData[] columnLayout = getColumnLayout();
- String[] headers = getColumnHeaders();
- for (int i = 0; i < getColumnHeaders().length; i++) {
- // column for the first table
- tableLayout.addColumnData(columnLayout[i]);
- TableColumn column = new TableColumn(table, SWT.NONE, i);
- column.setResizable(true);
- column.setText(headers[i]);
- column.addSelectionListener(headerListener);
- // "connect" the two tables so the width of their column evolve simultaneously
- // more precisely here, only the resize of the first table will trigger a resize of the second one
- column.addControlListener(columnResizeListener);
-
- // column for the second table
- totalLayout.addColumnData(columnLayout[i]);
- column = new TableColumn(totalTable, SWT.NONE, i);
- column.setResizable(true);
- }
- }
-
- protected abstract ITreeContentProvider getContentProvider();
-
- protected abstract ITableLabelProvider getLabelProvider();
-
- protected abstract ViewerSorter getSorter(int column);
-
- protected abstract String getStatusLineMessage(Object element);
-
- public void createPartControl(Composite parent) {
- Composite composite = new Composite(parent, 0);
- // crete a grid layout of one column
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- composite.setLayout(layout);
-
- createTables(composite);
-
- clipboard = new Clipboard(parent.getDisplay());
- //create the viewer
- viewer = new TableTreeViewer(tableTree);
- viewer.setContentProvider(getContentProvider());
- viewer.setLabelProvider(getLabelProvider());
- viewer.setSorter(getSorter(0));
- viewer.addSelectionChangedListener(getTableListener());
-
- createCommonActions();
- createActions();
- createToolbar();
- createContextMenu();
- }
-
- abstract protected String[] computeTotalLine(Iterator elements);
-
- private void createCommonActions() {
- copyAction = new Action() {
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- String result = ""; //$NON-NLS-1$
- String[] columnHeaders = getColumnHeaders();
- for (int i = 0; i < columnHeaders.length; i++)
- result += columnHeaders[i] + ","; //$NON-NLS-1$
- result += "\n\n"; //$NON-NLS-1$
-
- ITableLabelProvider labelProvider = (ITableLabelProvider) viewer.getLabelProvider();
- for (Iterator iterator = selection.iterator(); iterator.hasNext();) {
- Object selectedItem = iterator.next();
- for (int i = 0; i < columnHeaders.length; i++)
- result += labelProvider.getColumnText(selectedItem, i) + ","; //$NON-NLS-1$
- result += "\n"; //$NON-NLS-1$
- }
- clipboard.setContents(new Object[] {result}, new Transfer[] {TextTransfer.getInstance()});
- }
- };
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, copyAction);
-
- selectAllAction = new Action() {
- public void run() {
- tableTree.selectAll();
- // force viewer selection change
- viewer.setSelection(viewer.getSelection());
- }
- };
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.SELECT_ALL, selectAllAction);
- }
-
- protected ISelectionChangedListener getTableListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- IStructuredSelection selection = (IStructuredSelection) e.getSelection();
- copyAction.setEnabled(!selection.isEmpty());
- if (selection.size() == 1) {
- String message = getStatusLineMessage(selection.getFirstElement());
- getViewSite().getActionBars().getStatusLineManager().setMessage(message);
- }
- totalTable.removeAll();
- updateTotals();
- }
- };
- }
-
- public void updateTotals() {
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- TableItem item = new TableItem(totalTable, 0);
- item.setText(computeTotalLine(selection.iterator()));
- }
-
- public ISelection getSelection() {
- return viewer.getSelection();
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- // do nothing
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- // do nothing
- }
-
- public void setSelection(ISelection selection) {
- // do nothing
- }
-
- public void setFocus() {
- if (tableTree != null)
- tableTree.setFocus();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeContentProviderNode.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeContentProviderNode.java
deleted file mode 100644
index 4c4309c6e..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeContentProviderNode.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.util.*;
-
-/**
- * Represents a node (possibly containing children) in a tree content
- * provider model. Every node has a name and optionally a value.
- */
-public class TreeContentProviderNode implements Comparable {
-
- /**
- * A list containing this node's children.
- */
- private List children;
-
- /**
- * This node's name.
- */
- private String name;
-
- /**
- * This node's value (may be null).
- */
- private Object value;
-
- /**
- * This node's parent node.
- */
- private TreeContentProviderNode parent;
-
- /**
- * Constructs a TreeContentProviderNode with the given name and value.
- *
- * @param name this node's name
- * @param value this node's value (may be null)
- */
- public TreeContentProviderNode(String name, Object value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Constructs a TreeContentProviderNode with the given name.
- *
- * @param name this node's name.
- */
- public TreeContentProviderNode(String name) {
- this(name, null);
- }
-
- /**
- * Sets this node's parent.
- *
- * @param parent this node's new parent
- */
- private void setParent(TreeContentProviderNode parent) {
- this.parent = parent;
- }
-
- /**
- * Adds a new child. If the child is a TreeContentProviderNode, sets its parent
- * to this object.
- *
- * @param child a new child to be added.
- */
- public void addChild(Object child) {
- // lazilly instantiates the children's list
- if (this.children == null) {
- this.children = new ArrayList();
- }
- this.children.add(child);
- if (child instanceof TreeContentProviderNode) {
- TreeContentProviderNode childNode = (TreeContentProviderNode) child;
- childNode.setParent(this);
- }
- }
-
- /**
- * Returns an array containing all children this node has. If this node
- * has no children, returns an empty array.
- *
- * @return an array containing this node's children.
- */
- public Object[] getChildren() {
- return children == null ? new Object[0] : children.toArray();
- }
-
- /**
- * Returns a boolean indicating if this node has any children.
- *
- * @return true, if this node has children, false otherwise
- */
- public boolean hasChildren() {
- return children != null && !children.isEmpty();
- }
-
- /**
- * Returns a string representation of the object.
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return name + (value == null ? "" : (" = " + value.toString())); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Returns this node's parent node.
- *
- * @return this node's parent node or null, if this node is a root
- */
- public TreeContentProviderNode getParent() {
- return parent;
- }
-
- /**
- * Returns this node's value (may be null).
- *
- * @return this node's value
- */
- public Object getValue() {
- return value;
- }
-
- /**
- * Returns a boolean indicating if this node is root or not.
- *
- * @return true if this node is root, false otherwise
- */
- public boolean isRoot() {
- return parent == null;
- }
-
- /**
- * Removes all child nodes (if any) from this node. This operation affects
- * only this node. No changes are made to the child nodes.
- */
- public void removeAllChildren() {
- if (children == null)
- return;
-
- children.clear();
- }
-
- /**
- * Sorts this node's children list in ascending order. The children are
- * ordered by name. Any changes in the children list will potentially
- * invalidate the ordering. All children must be instances of
- * <code>TreeContentProviderNode</code>.
- */
- public void sort() {
- if (children == null)
- return;
- Collections.sort(children);
- }
-
- /**
- * Compares this node with another node.
- *
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Object other) {
- TreeContentProviderNode otherNode = (TreeContentProviderNode) other;
- return this.name.compareTo(otherNode.name);
- }
-
- /**
- * Accepts the given visitor. The visitor's <code>visit</code> method is called
- * with this node. If the visitor returns <code>true</code>, this method visits
- * this node's child nodes.
- *
- * @param visitor the visitor
- * @see ITreeNodeVisitor#visit
- */
- public void accept(ITreeNodeVisitor visitor) {
- if (!visitor.visit(this))
- return;
- if (children == null)
- return;
- for (Iterator childrenIter = children.iterator(); childrenIter.hasNext();) {
- Object child = childrenIter.next();
- // child nodes don't need to be TreeContentProviderNodes
- if (child instanceof TreeContentProviderNode)
- ((TreeContentProviderNode) child).accept(visitor);
- }
- }
-
- /**
- * Returns this node's tree root node. If this node is a root node, returns itself.
- *
- * @return this node's tree root node
- */
- public TreeContentProviderNode getRoot() {
- return this.getParent() == null ? this : this.getParent().getRoot();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeSelectionProviderDecorator.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeSelectionProviderDecorator.java
deleted file mode 100644
index 991719220..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeSelectionProviderDecorator.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import java.util.*;
-import org.eclipse.jface.viewers.*;
-
-/**
- * This class provides a decorator for ISelectionProviders that use
- * TreeContentProviderNode as the basis for their data model.
- * The only affected method is <code>getSelection()</code>, which will return a
- * selection object that provides selected elements in the same order they
- * appear in the tree.
- *
- * <p>This class is an workaround to the SWT's <code>Tree.getSelection()</code>
- * method, which returns an array of selected elements without preserving the
- * order they appear in the tree widget.</p>
- */
-public class TreeSelectionProviderDecorator implements ISelectionProvider {
-
- /** The decorated selection provider. */
- private ISelectionProvider selectionProvider;
-
- /**
- * Constructs a <code>TreeSelectionProviderDecorator</code> having the given
- * selection provider as its decorated object.
- *
- * @param selectionProvider the selection provider to be decorated
- */
- public TreeSelectionProviderDecorator(ISelectionProvider selectionProvider) {
- this.selectionProvider = selectionProvider;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionProvider.addSelectionChangedListener(listener);
- }
-
- /**
- * Returns the current selection for this provider. If the selection is a
- * structured selection made of <code>TreeContentProviderNode</code>
- * elements, this method will return a structured selection where the order of
- * elements is the same order the elements appear in the tree (only for tree
- * elements that are instances of <code>TreeContentProviderNode</code>).
- *
- * @return the current selection, ordered in the same sequence they appear in
- * the tree
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection() {
- // gets the original selection object
- ISelection selection = selectionProvider.getSelection();
-
- // in these cases the original selection will be returned
- if (selection == null || selection.isEmpty() || !(selection instanceof IStructuredSelection))
- return selection;
-
- // constructs a list with the selected elements
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- final List selectedElements = new ArrayList(structuredSelection.toList());
-
- // tries to find a TreeContentProviderNode between the selected elements
- TreeContentProviderNode anyNode = findNodeElement(selectedElements);
-
- // if there is no TreeContentProviderNodes, there is nothing to do
- if (anyNode == null)
- return selection;
-
- // otherwise, we will move the elements to a new list in the same order
- // we find them in the tree.
- final List orderedElements = new LinkedList();
-
- // uses a visitor to traverse the whole tree
- // when a visited node is the selected list, it is moved to the ordered list
- anyNode.getRoot().accept(new ITreeNodeVisitor() {
- public boolean visit(TreeContentProviderNode node) {
- int elementIndex = selectedElements.indexOf(node);
-
- if (selectedElements.contains(node))
- orderedElements.add(selectedElements.remove(elementIndex));
-
- return true;
- }
- });
-
- // any remaining elements in the list (probably they are not tree nodes)
- // are copied to the end of the ordered list
- orderedElements.addAll(selectedElements);
- return new StructuredSelection(orderedElements);
- }
-
- /**
- * Returns the first element in the list that is instance of
- * <code>TreeContentProviderNode</code>.
- *
- * @return the first element that is a tree node or null, if none is found.
- */
- private TreeContentProviderNode findNodeElement(List elements) {
- for (Iterator iter = elements.iterator(); iter.hasNext();) {
- Object element = iter.next();
- if (element instanceof TreeContentProviderNode)
- return (TreeContentProviderNode) element;
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionProvider.removeSelectionChangedListener(listener);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection) {
- selectionProvider.setSelection(selection);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeTextOperationTarget.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeTextOperationTarget.java
deleted file mode 100644
index d5cf5fbfd..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/TreeTextOperationTarget.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools;
-
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.swt.widgets.Tree;
-
-public class TreeTextOperationTarget implements ITextOperationTarget {
-
- private Tree tree;
-
- public TreeTextOperationTarget(Tree tree) {
- this.tree = tree;
- }
-
- /**
- * @see org.eclipse.jface.text.ITextOperationTarget#canDoOperation(int)
- */
- public boolean canDoOperation(int operation) {
- return true;
- }
-
- /**
- * @see org.eclipse.jface.text.ITextOperationTarget#doOperation(int)
- */
- public void doOperation(int operation) {
- //TODO: add support to other operations
- switch (operation) {
- case ITextOperationTarget.SELECT_ALL :
- tree.selectAll();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/messages.properties b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/messages.properties
deleted file mode 100644
index 3a4254743..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/messages.properties
+++ /dev/null
@@ -1,70 +0,0 @@
-### Spy message catalog
-
-
-### Stats View
-stats.statIdHeader = Listener/Builder
-stats.projectHeader = Project
-stats.countHeader = Count
-stats.timeHeader = Time
-stats.errorsHeader = Errors
-
-#stats.numberOfNotificationsHeader = Notify
-#stats.notifcationTimeHeader = Notify Time
-#stats.numberOfBuildsHeader = Builds
-#stats.buildTimeHeader = Build Time
-
-stats.toolTipText = Builder/Listener Statistics
-stats.badStat = Not an EventStats
-stats.badColumn = Invalid Column
-stats.pluginid = Plug-in Identifier: {0}
-
-### Resource Spy
-resource.error_unknown_resource_impl = Error: unknown IResource implementation: {0}
-
-resource.file = File
-resource.folder = Folder
-resource.project = Project
-resource.root = Root
-resource.full_path = Full Path
-resource.content_id = Content ID
-resource.type = Type
-resource.node_id = Node ID
-resource.local_sync_info = Local Sync Info
-
-resource.persistent_properties = Persistent Properties
-resource.error_stored_properties = Error getting resource's stored properties: {0}
-
-resource.session_properties = Session Properties
-
-resource.flags = Flags
-resource.open = Open
-resource.local_exists = Local exists
-resource.local_is_file = Local is file
-resource.phantom = Phantom
-resource.used = Used
-resource.derived = Derived
-resource.team_private = Team private
-resource.markers_snap_dirty = Marker snapshot is dirty
-resource.sync_info_snap_dirty = Sync info snapshot is dirty
-resource.no_content_description = No content description
-resource.default_content_description = Default content description
-
-resource.content_description = Content description
-resource.error_content_description = Error getting file's content description: {0}
-resource.content_description_from_cache = cached: {0}
-
-resource.markers = Markers
-resource.error_marker = Error getting marker information: {0}
-
-resource.sync_info = Sync information
-
-### Plug-in Dependency Spy
-depend.clearContents = Clear contents
-depend.badURL = Bad URL:
-depend.noInformation = Unable to find information for {0}.
-depend.noParentPlugins = Not required by any plug-ins.
-depend.requiredBy = Required by:
-depend.noChildrenPlugins = Requires no plug-ins.
-depend.requires = Requires:
-depend.badPluginId = Invalid plugin id
-
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsView.java
deleted file mode 100644
index d0e084d83..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsView.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.tools.CoreToolsPlugin;
-import org.eclipse.core.tools.TableWithTotalView;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.osgi.framework.stats.BundleStats;
-import org.eclipse.osgi.framework.stats.StatsManager;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-
-/**
- * View used to display the activated plugins
- */
-public class ActivePluginsView extends TableWithTotalView {
- private Action refreshAction;
- private Action displayClassesInfoAction;
- private Action displayStackAction;
-
- public static String VIEW_ID = ActivePluginsView.class.getName();
- private static String columnHeaders[] = {"Plugin", "Classes", "Alloc", "Used", "Startup time", "Order", "Timestamp", "Class load time", "Startup method time", "RAM Alloc", "RAM Used", "ROM Alloc", "ROM Used"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$
- private static int columnWidths[] = {500, 150, 200, 200, 150, 100, 0, 0, 0, 0, 0, 0, 0};
-
- protected String[] getColumnHeaders() {
- return columnHeaders;
- }
-
- protected ColumnLayoutData[] getColumnLayout() {
- ColumnLayoutData[] result = new ColumnLayoutData[columnWidths.length];
- for (int i = 0; i < columnWidths.length; i++) {
- int width = columnWidths[i];
- result[i] = width == 0 ? (ColumnLayoutData) new ColumnPixelData(width) : (ColumnLayoutData) new ColumnWeightData(width);
- }
- return result;
- }
-
- protected void createToolbar() {
- IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager manager = actionBars.getToolBarManager();
- manager.add(refreshAction);
- manager.add(displayClassesInfoAction);
- manager.add(displayStackAction);
- }
-
- protected void createContextMenu() {
- // Create menu manager.
- MenuManager manager = new MenuManager();
- manager.setRemoveAllWhenShown(true);
- manager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
-
- // Create menu.
- Menu menu = manager.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
-
- // Register menu for extension.
- getSite().registerContextMenu(manager, viewer);
- }
-
- protected void fillContextMenu(IMenuManager manager) {
- manager.add(refreshAction);
- manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- manager.add(new Separator());
- manager.add(displayClassesInfoAction);
- manager.add(displayStackAction);
- }
-
- protected String[] computeTotalLine(Iterator iterator) {
- int sumOfClasses = 0;
- int sumOfMemoryUsed = 0;
- int sumOfMemoryAlloc = 0;
- long sumOfStartupTime = 0;
- long sumOfClassloadtime = 0;
- int sumOfRAMAlloc = 0;
- int sumOfRAMUsed = 0;
- long sumOfStartupMethodTime = 0;
- int sumOfROMAlloc = 0;
- int sumOfROMUsed = 0;
- int count = 0;
- if (!iterator.hasNext()) {
- Object[] elements = ((ITreeContentProvider) viewer.getContentProvider()).getElements(viewer.getInput());
- iterator = Arrays.asList(elements).iterator();
- }
- for (; iterator.hasNext();) {
- BundleStats element = StatsManager.getDefault().getPlugin(((IPluginDescriptor) iterator.next()).getUniqueIdentifier());
- if (element != null) {
- VMClassloaderInfo vmInfo = VMClassloaderInfo.getClassloader(element.getPluginId());
- sumOfClasses += element.getClassLoadCount();
- sumOfMemoryUsed += (vmInfo.getUsedRAM() + vmInfo.getUsedROM());
- sumOfMemoryAlloc += (vmInfo.getAllocRAM() + vmInfo.getAllocROM());
- sumOfStartupTime = sumOfStartupTime + element.getStartupTime();
- sumOfClassloadtime = sumOfClassloadtime + element.getClassLoadTime();
- sumOfStartupMethodTime = sumOfStartupMethodTime + element.getStartupMethodTime();
- sumOfRAMAlloc += vmInfo.getAllocRAM();
- sumOfRAMUsed += vmInfo.getUsedRAM();
- sumOfROMAlloc += vmInfo.getAllocROM();
- sumOfROMUsed += vmInfo.getUsedROM();
- count++;
- }
- }
- String[] totalLine = new String[getColumnHeaders().length];
- totalLine[0] = "Total: " + count; //$NON-NLS-1$
- totalLine[1] = "" + sumOfClasses; //$NON-NLS-1$
- totalLine[2] = "" + sumOfMemoryAlloc; //$NON-NLS-1$
- totalLine[3] = "" + sumOfMemoryUsed; //$NON-NLS-1$
- totalLine[4] = "" + sumOfStartupTime; //$NON-NLS-1$
- totalLine[8] = "" + sumOfStartupMethodTime; //$NON-NLS-1$
- totalLine[9] = "" + sumOfRAMAlloc; //$NON-NLS-1$
- totalLine[10] = "" + sumOfRAMUsed; //$NON-NLS-1$
- totalLine[11] = "" + sumOfROMAlloc; //$NON-NLS-1$
- totalLine[12] = "" + sumOfROMUsed; //$NON-NLS-1$
- return totalLine;
- }
-
- public void createPartControl(Composite parent) {
- if (!StatsManager.MONITOR_ACTIVATION) {
- Text text = new Text(parent, 0);
- text.setText("Plugin monitoring is not enabled"); //$NON-NLS-1$
- return;
- }
- super.createPartControl(parent);
- viewer.setInput(BundleStats.class);
- getSite().setSelectionProvider(viewer);
- viewer.setSelection(StructuredSelection.EMPTY);
- }
-
- protected void createActions() {
- refreshAction = new Action("Refresh") { //$NON-NLS-1$
- public void run() {
- VMClassloaderInfo.refreshInfos();
- getViewer().refresh();
- }
- };
- refreshAction.setImageDescriptor(CoreToolsPlugin.createImageDescriptor("refresh.gif")); //$NON-NLS-1$
- refreshAction.setToolTipText("Refresh the data"); //$NON-NLS-1$
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.REFRESH, refreshAction);
-
- displayClassesInfoAction = new Action("Classes") { //$NON-NLS-1$
- public void run() {
- try {
- LoadedClassesView view = (LoadedClassesView) getSite().getPage().showView(LoadedClassesView.VIEW_ID);
- IStructuredSelection selection = ((IStructuredSelection) getViewer().getSelection());
- if (selection == null)
- return;
-
- view.setInput(selection.toArray());
-
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
- };
- displayClassesInfoAction.setToolTipText("Display classes loaded by the selected plugin"); //$NON-NLS-1$
- displayClassesInfoAction.setImageDescriptor(CoreToolsPlugin.createImageDescriptor("classes.gif")); //$NON-NLS-1$
-
- displayStackAction = new Action("Stack trace") { //$NON-NLS-1$
- public void run() {
- try {
- StackTraceView view = (StackTraceView) getSite().getPage().showView(StackTraceView.VIEW_ID);
- IPluginDescriptor descriptor = (IPluginDescriptor) ((IStructuredSelection) getViewer().getSelection()).getFirstElement();
- BundleStats plugin = StatsManager.getDefault().getPlugin(descriptor.getUniqueIdentifier());
- if (plugin == null)
- return;
- view.setInput(StatsManager.TRACE_FILENAME, plugin.getTraceStart(), plugin.getTraceEnd());
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
- };
- displayStackAction.setToolTipText("Display the plugin activation stack trace"); //$NON-NLS-1$
- displayStackAction.setImageDescriptor(CoreToolsPlugin.createImageDescriptor("trace.gif")); //$NON-NLS-1$
- }
-
- protected ITreeContentProvider getContentProvider() {
- return new ActivePluginsViewContentProvider();
- }
-
- protected ITableLabelProvider getLabelProvider() {
- return new ActivePluginsViewLabelProvider();
- }
-
- protected ViewerSorter getSorter(int column) {
- return new ActivePluginsViewSorter(column);
- }
-
- /**
- * @see org.eclipse.core.tools.TableWithTotalView#getStatusLineMessage(Object)
- */
- protected String getStatusLineMessage(Object element) {
- return ""; //$NON-NLS-1$
- }
-
- protected TableTreeViewer getViewer() {
- return viewer;
- }
-
- public void dispose() {
- // if there is no viewer then we were not monitoring plugins so there
- // is nothing to dispose.
- if (viewer == null)
- return;
- refreshAction.setImageDescriptor(null);
- displayClassesInfoAction.setImageDescriptor(null);
- displayStackAction.setImageDescriptor(null);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewContentProvider.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewContentProvider.java
deleted file mode 100644
index 3ba70f73f..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewContentProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.tools.IFlattable;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osgi.framework.stats.BundleStats;
-import org.eclipse.osgi.framework.stats.StatsManager;
-
-/**
- * Content provider for the ActivePluginsView
- */
-public class ActivePluginsViewContentProvider implements ITreeContentProvider, IFlattable {
- private boolean flat;
-
- public void setFlat(boolean mode) {
- flat = mode;
- }
-
- public void dispose() {
- // do nothing
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public Object[] getChildren(Object element) {
- if (flat || !(element instanceof IPluginDescriptor))
- return new Object[0];
- BundleStats plugin = StatsManager.getDefault().getPlugin(((IPluginDescriptor) element).getUniqueIdentifier());
- if (plugin == null)
- return null;
- ArrayList stats = plugin.getPluginsActivated();
- Object[] result = new Object[stats.size()];
- IPluginRegistry registry = Platform.getPluginRegistry();
- for (int i = 0; i < stats.size(); i++)
- result[i] = registry.getPluginDescriptor(((BundleStats) stats.get(i)).getPluginId());
- return result;
- }
-
- public Object getParent(Object element) {
- if (flat || !(element instanceof IPluginDescriptor))
- return null;
- BundleStats plugin = StatsManager.getDefault().getPlugin(((IPluginDescriptor) element).getUniqueIdentifier());
- if (plugin == null)
- return null;
- return Platform.getPluginRegistry().getPluginDescriptor(plugin.getActivatedBy().getPluginId());
- }
-
- public boolean hasChildren(Object element) {
- if (flat || !(element instanceof IPluginDescriptor))
- return false;
- BundleStats plugin = StatsManager.getDefault().getPlugin(((IPluginDescriptor) element).getUniqueIdentifier());
- return plugin == null ? false : plugin.getPluginsActivated().size() > 0;
- }
-
- public Object[] getElements(Object inputElement) {
- if (!StatsManager.MONITOR_ACTIVATION || inputElement != BundleStats.class)
- return null;
-
- BundleStats[] activePlugins = StatsManager.getDefault().getPlugins();
- IPluginRegistry registry = Platform.getPluginRegistry();
- ArrayList result = new ArrayList(activePlugins.length);
- for (int i = 0; i < activePlugins.length; i++) {
- if (flat || activePlugins[i].getActivatedBy() == null)
- result.add(registry.getPluginDescriptor(activePlugins[i].getPluginId()));
- }
- return result.toArray(new IPluginDescriptor[result.size()]);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewLabelProvider.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewLabelProvider.java
deleted file mode 100644
index 3b05f896c..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewLabelProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.osgi.framework.stats.BundleStats;
-import org.eclipse.osgi.framework.stats.StatsManager;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Label provider for the ActivePluginsView
- *
- */
-public class ActivePluginsViewLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (!(element instanceof IPluginDescriptor))
- return "not a plugin"; //$NON-NLS-1$
- BundleStats plugin = StatsManager.getDefault().getPlugin(((IPluginDescriptor) element).getUniqueIdentifier());
- if (plugin == null)
- return "no info for plugin"; //$NON-NLS-1$
- VMClassloaderInfo pluginInfo = VMClassloaderInfo.getClassloader(plugin.getPluginId());
- switch (columnIndex) {
- case 0 : /* plugin id */
- return plugin.getPluginId() + (plugin.isStartupPlugin() ? "*" : ""); //$NON-NLS-1$ //$NON-NLS-2$
- case 1 : /* class load count */
- return "" + plugin.getClassLoadCount(); //$NON-NLS-1$
- case 2 : /* Total Mem Alloc */
- return "" + (pluginInfo.getAllocRAM() + pluginInfo.getAllocROM()); //$NON-NLS-1$
- case 3 : /* Total Mem Used */
- return "" + (pluginInfo.getUsedRAM() + pluginInfo.getUsedROM()); //$NON-NLS-1$
- case 4 : /* startup time */
- return "" + (plugin.getStartupTime()); //$NON-NLS-1$
- case 5 : /* activation order */
- return "" + plugin.getActivationOrder(); //$NON-NLS-1$
- case 6 : /* activation time */
- return "" + (int) (plugin.getTimestamp()); //$NON-NLS-1$
- case 7 : /* class load time*/
- return "" + (int) (plugin.getClassLoadTime()); //$NON-NLS-1$
- case 8 : /* startup method time */
- return "" + (int) (plugin.getStartupMethodTime()); //$NON-NLS-1$
- case 9 : /* RAM alloc */
- return "" + pluginInfo.getAllocRAM(); //$NON-NLS-1$
- case 10 : /* RAM used */
- return "" + pluginInfo.getUsedRAM(); //$NON-NLS-1$
- case 11 : /* ROM alloc */
- return "" + pluginInfo.getAllocROM(); //$NON-NLS-1$
- case 12 : /* ROM used */
- return "" + pluginInfo.getUsedROM(); //$NON-NLS-1$
- }
- return null;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewSorter.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewSorter.java
deleted file mode 100644
index 18a50fdc8..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/ActivePluginsViewSorter.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.text.Collator;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.tools.ISorter;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.osgi.framework.stats.BundleStats;
-import org.eclipse.osgi.framework.stats.StatsManager;
-
-/**
- * Sorter used in the ActivePluginsView
- */
-public class ActivePluginsViewSorter extends ViewerSorter implements ISorter {
- private boolean reversed = true;
- private int columnNumber;
- private Collator collator = Collator.getInstance();
-
- // column headings: "Plugin", "Classes", "Alloc", "Used", "Startup time", "Order", "Timestamp", "Class load time", "Startup method time", "RAM Alloc", "RAM Used", "ROM Alloc", "ROM Used" };
- private int[][] SORT_ORDERS_BY_COLUMN = { //
- {0}, /* Plugin */{1, 0}, /* Count */{2, 0}, /* Alloc */{3, 0}, /* Used */{4, 0}, /* Startup time */{5, 0}, /* Order */{6, 0}, /* timestamp */{7, 0}, /* Class load time */{8, 0}, /* Startup method time */{9, 0}, /* RAM Alloc */{10, 0}, /* RAM Used */{11, 0}, /* ROM Alloc */{12, 0} /* ROM Used */
- };
-
- public ActivePluginsViewSorter(int columnNumber) {
- this.columnNumber = columnNumber;
- if (columnNumber == 0)
- reversed = false;
- }
-
- /**
- * Compares two stats objects, sorting first by the main column of this sorter,
- * then by subsequent columns, depending on the column sort order.
- */
- public int compare(Viewer viewer, Object o1, Object o2) {
- BundleStats plugin1 = StatsManager.getDefault().getPlugin(((IPluginDescriptor) o1).getUniqueIdentifier());
- BundleStats plugin2 = StatsManager.getDefault().getPlugin(((IPluginDescriptor) o2).getUniqueIdentifier());
- int[] columnSortOrder = SORT_ORDERS_BY_COLUMN[columnNumber];
- int result = 0;
- for (int i = 0; i < columnSortOrder.length; ++i) {
- result = compareColumnValue(columnSortOrder[i], plugin1, plugin2);
- if (result != 0)
- break;
- }
- return reversed ? -result : result;
- }
-
- /**
- * Compares two markers, based only on the value of the specified column.
- */
- int compareColumnValue(int columnNumber, BundleStats plugin1, BundleStats plugin2) {
- VMClassloaderInfo pluginInfo1 = VMClassloaderInfo.getClassloader(plugin1.getPluginId());
- VMClassloaderInfo pluginInfo2 = VMClassloaderInfo.getClassloader(plugin2.getPluginId());
- switch (columnNumber) {
- case 0 : /* Plugin ID */
- return collator.compare(plugin1.getPluginId(), plugin2.getPluginId());
- case 1 : /*Number Of classes loaded */
- return plugin1.getClassLoadCount() - plugin2.getClassLoadCount();
- case 2 : /* Total Mem Alloc */
- return (pluginInfo1.getAllocRAM() + pluginInfo1.getAllocROM()) - (pluginInfo2.getAllocRAM() + pluginInfo2.getAllocROM());
- case 3 : //Total Mem Used
- return (pluginInfo1.getUsedRAM() + pluginInfo1.getUsedROM()) - (pluginInfo2.getUsedRAM() + pluginInfo2.getUsedROM());
- case 4 : /* startup time */
- return (int) (plugin1.getStartupTime() - plugin2.getStartupTime());
- case 5 : /* actionvation order */
- return plugin1.getActivationOrder() - plugin2.getActivationOrder();
- case 6 : //Activation time
- return (int) (plugin1.getTimestamp() - plugin2.getTimestamp());
- case 7 : /*Class load time*/
- return (int) (plugin1.getClassLoadTime() - plugin2.getClassLoadTime());
- case 8 : /* Startup method time */
- return (int) (plugin1.getStartupMethodTime() - plugin2.getStartupMethodTime());
- case 9 : /* RAM Alloc */
- return pluginInfo1.getAllocRAM() - pluginInfo2.getAllocRAM();
- case 10 : /* RAM Alloc */
- return pluginInfo1.getUsedRAM() - pluginInfo2.getUsedRAM();
- case 11 :
- return pluginInfo1.getAllocROM() - pluginInfo2.getAllocROM();
- case 12 :
- return pluginInfo1.getUsedROM() - pluginInfo2.getUsedROM();
- }
- return 0;
- }
-
- public int getColumnNumber() {
- return columnNumber;
- }
-
- public boolean isReversed() {
- return reversed;
- }
-
- public void setReversed(boolean value) {
- reversed = value;
- }
-
- /**
- * @see org.eclipse.core.tools.ISorter#states()
- */
- public int states() {
- return 3;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/EclipsePreferencesView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/EclipsePreferencesView.java
deleted file mode 100644
index 7f22c1776..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/EclipsePreferencesView.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.tools.CollapseAllAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.ViewPart;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class EclipsePreferencesView extends ViewPart {
-
- private TreeViewer viewer;
- private IAction collapseAllAction;
-
- class ViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
-
- private IEclipsePreferences invisibleRoot;
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public Object[] getElements(Object parent) {
- if (parent.equals(getViewSite())) {
- if (invisibleRoot == null)
- invisibleRoot = Platform.getPreferencesService().getRootNode();
- return new Object[] {invisibleRoot};
- }
- return getChildren(parent);
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object getParent(Object child) {
- if (child instanceof IEclipsePreferences)
- return ((IEclipsePreferences) child).parent();
- return null;
- }
-
- public Object[] getChildren(Object parent) {
- ArrayList result = new ArrayList();
- if (parent instanceof IEclipsePreferences) {
- IEclipsePreferences node = (IEclipsePreferences) parent;
- try {
- String[] childrenNames = node.childrenNames();
- for (int i = 0; childrenNames != null && i < childrenNames.length; i++)
- result.add(node.node(childrenNames[i]));
- String[] keys = node.keys();
- for (int i = 0; i < keys.length; i++)
- result.add(keys[i] + '=' + node.get(keys[i], "")); //$NON-NLS-1$
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- }
- return result.toArray(new Object[result.size()]);
- }
-
- public boolean hasChildren(Object parent) {
- if (parent instanceof IEclipsePreferences)
- try {
- IEclipsePreferences node = (IEclipsePreferences) parent;
- return node.childrenNames().length != 0 || node.keys().length != 0;
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- return false;
- }
- }
-
- class ViewLabelProvider extends LabelProvider {
-
- public String getText(Object obj) {
- String result = obj.toString();
- if (obj instanceof IEclipsePreferences) {
- IEclipsePreferences node = (IEclipsePreferences) obj;
- result = node.name();
- if (result.length() == 0)
- result = "<root>"; //$NON-NLS-1$
- }
- return result;
- }
-
- public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- if (obj instanceof IEclipsePreferences)
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
- }
- }
-
- public EclipsePreferencesView() {
- super();
- }
-
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setSorter(new ViewerSorter());
- viewer.setInput(getViewSite());
- getViewSite().setSelectionProvider(viewer);
- IActionBars bars = getViewSite().getActionBars();
- collapseAllAction = new CollapseAllAction(viewer);
- bars.getToolBarManager().add(collapseAllAction);
- bars.updateActionBars();
- }
-
- public void dispose() {
- super.dispose();
- collapseAllAction = null;
- }
-
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesView.java
deleted file mode 100644
index e9c85600c..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesView.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import org.eclipse.core.tools.CoreToolsPlugin;
-import org.eclipse.core.tools.TableWithTotalView;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.osgi.framework.stats.ClassStats;
-import org.eclipse.osgi.framework.stats.StatsManager;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-
-/**
- * View that display information about classes
- */
-public class LoadedClassesView extends TableWithTotalView {
- private Action displayStackAction;
-
- public static String VIEW_ID = LoadedClassesView.class.getName();
- private String[] columnHeaders = new String[] {"Class", "Order", "Memory", "Plugin", "Timestamp", "RAM", "ROM"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- private ColumnLayoutData[] columnLayout = new ColumnLayoutData[] {new ColumnWeightData(500), new ColumnWeightData(100), new ColumnWeightData(100), new ColumnWeightData(200), new ColumnPixelData(0), new ColumnPixelData(0), new ColumnPixelData(0)};
-
- protected String[] getColumnHeaders() {
- return columnHeaders;
- }
-
- protected ColumnLayoutData[] getColumnLayout() {
- return columnLayout;
- }
-
- public void createPartControl(Composite parent) {
- if (!StatsManager.MONITOR_CLASSES) {
- Text text = new Text(parent, 0);
- text.setText("Class monitoring is not enabled."); //$NON-NLS-1$
- return;
- }
- super.createPartControl(parent);
- viewer.setSelection(StructuredSelection.EMPTY);
- }
-
- protected ITreeContentProvider getContentProvider() {
- return new LoadedClassesViewContentProvider();
- }
-
- protected ITableLabelProvider getLabelProvider() {
- return new LoadedClassesViewLabelProvider();
- }
-
- protected ViewerSorter getSorter(int column) {
- return new LoadedClassesViewSorter(column);
- }
-
- /**
- * @see org.eclipse.core.tools.TableWithTotalView#getStatusLineMessage(Object)
- */
- protected String getStatusLineMessage(Object element) {
- return ""; //$NON-NLS-1$
- }
-
- protected TableTreeViewer getViewer() {
- return viewer;
- }
-
- protected void createActions() {
- displayStackAction = new Action("Stack trace") { //$NON-NLS-1$
- public void run() {
- try {
- StackTraceView view = (StackTraceView) getSite().getPage().showView(StackTraceView.VIEW_ID);
- ClassStats clazz = (ClassStats) ((IStructuredSelection) getViewer().getSelection()).getFirstElement();
- if (clazz == null)
- return;
- view.setInput(StatsManager.TRACE_FILENAME, clazz.getTraceStart(), clazz.getTraceEnd());
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
- };
- displayStackAction.setToolTipText("Display the class activation stack trace"); //$NON-NLS-1$
- displayStackAction.setImageDescriptor(CoreToolsPlugin.createImageDescriptor("trace.gif")); //$NON-NLS-1$
- }
-
- protected void createToolbar() {
- IToolBarManager manager = getViewSite().getActionBars().getToolBarManager();
- manager.add(displayStackAction);
- }
-
- public void setInput(Object input) {
- viewer.setInput(input);
- viewer.setSelection(StructuredSelection.EMPTY);
- }
-
- protected String[] computeTotalLine(Iterator iterator) {
- String[] totals = new String[getColumnHeaders().length];
- int ramTotal = 0;
- int romTotal = 0;
- int jitTotal = 0;
- int count = 0;
- if (!iterator.hasNext()) {
- Object[] elements = ((ITreeContentProvider) viewer.getContentProvider()).getElements(viewer.getInput());
- iterator = Arrays.asList(elements == null ? new Object[0] : elements).iterator();
- }
- while (iterator.hasNext()) {
- ClassStats clazz = (ClassStats) iterator.next();
- VMClassloaderInfo loader = VMClassloaderInfo.getClassloader(clazz.getClassloader().getId());
- VMClassInfo classInfo = loader.getClass(clazz.getClassName());
- ramTotal += classInfo.getRAMSize();
- romTotal += classInfo.getROMSize();
- jitTotal += classInfo.getJitSize();
- count++;
- }
- totals[0] = "Total: " + count; //$NON-NLS-1$
- totals[2] = Integer.toString(ramTotal + romTotal);
- totals[5] = Integer.toString(ramTotal);
- totals[6] = Integer.toString(romTotal);
- return totals;
- }
-
- public void dispose() {
- if (displayStackAction != null)
- displayStackAction.setImageDescriptor(null);
- }
-
- protected void createContextMenu() {
- MenuManager manager = new MenuManager();
- manager.setRemoveAllWhenShown(true);
- manager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu = manager.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(manager, viewer);
- }
-
- protected void fillContextMenu(IMenuManager manager) {
- manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- manager.add(displayStackAction);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewContentProvider.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewContentProvider.java
deleted file mode 100644
index 4f9facbc9..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewContentProvider.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.*;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.tools.IFlattable;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osgi.framework.stats.*;
-
-/**
- * Content provider for the LoadedClassesView
- */
-public class LoadedClassesViewContentProvider implements ITreeContentProvider, IFlattable {
- private boolean flat;
- private String inputNames[] = new String[0];
-
- public void setFlat(boolean mode) {
- flat = mode;
- }
-
- public Object[] getChildren(Object element) {
- if (flat || !(element instanceof ClassStats))
- return new Object[0];
- ArrayList result = new ArrayList(10);
- for (Iterator i = ((ClassStats) element).getLoadedClasses().iterator(); i.hasNext();) {
- ClassStats child = (ClassStats) i.next();
- if (filterChildren(child, inputNames))
- result.add(child);
- }
- return result.toArray(new Object[result.size()]);
- }
-
- private boolean filterChildren(ClassStats element, String[] filters) {
- String name = element.getClassloader().getId();
- for (int i = 0; i < filters.length; i++)
- if (filters[i].equals(name))
- return true;
- ArrayList children = element.getLoadedClasses();
- for (Iterator i = children.iterator(); i.hasNext();)
- if (filterChildren((ClassStats) i.next(), filters))
- return true;
- return false;
- }
-
- public Object getParent(Object element) {
- if (flat || !(element instanceof ClassStats))
- return null;
- return ((ClassStats) element).getLoadedBy();
- }
-
- public boolean hasChildren(Object element) {
- if (flat || !(element instanceof ClassStats))
- return false;
- for (Iterator i = ((ClassStats) element).getLoadedClasses().iterator(); i.hasNext();)
- if (filterChildren((ClassStats) i.next(), inputNames))
- return true;
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- if (!StatsManager.MONITOR_CLASSES)
- return null;
- if (inputElement instanceof Object[]) {
- Object[] elements = (Object[]) inputElement;
- if (elements.length == 0 || !(elements[0] instanceof IPluginDescriptor))
- return null;
- Set result = new HashSet(51);
- for (int i = 0; i < elements.length; i++) {
- ClassStats[] classes = getClasses(((IPluginDescriptor) elements[i]).getUniqueIdentifier());
- result.addAll(Arrays.asList(classes));
- }
- return result.toArray(new Object[result.size()]);
- }
- return null;
- }
-
- private ClassStats[] getClasses(String pluginId) {
- ClassloaderStats loader = ClassloaderStats.getLoader(pluginId);
- if (loader == null)
- return new ClassStats[0];
- ClassStats[] classes = loader.getClasses();
- if (flat)
- return classes;
- ArrayList result = new ArrayList();
- for (int i = 0; i < classes.length; i++) {
- ClassStats target = classes[i];
- while (target.getLoadedBy() != null)
- target = target.getLoadedBy();
- result.add(target);
- }
- return (ClassStats[]) result.toArray(new ClassStats[result.size()]);
- }
-
- public void dispose() {
- // do nothing
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (oldInput == newInput)
- return;
- if (newInput == null) {
- inputNames = new String[0];
- return;
- }
- Object[] list = (Object[]) newInput;
- inputNames = new String[list.length];
- for (int i = 0; i < list.length; i++)
- inputNames[i] = ((IPluginDescriptor) list[i]).getUniqueIdentifier();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewLabelProvider.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewLabelProvider.java
deleted file mode 100644
index d616f7b35..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewLabelProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.osgi.framework.stats.ClassStats;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * LabelProvider for the LoadedClassesView
- */
-
-public class LoadedClassesViewLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (!(element instanceof ClassStats))
- return "not a class info"; //$NON-NLS-1$
- ClassStats clazz = (ClassStats) element;
- VMClassloaderInfo loader = VMClassloaderInfo.getClassloader(clazz.getClassloader().getId());
- VMClassInfo classInfo = loader.getClass(clazz.getClassName());
-
- switch (columnIndex) {
- case 0 : //"Class name"
- return clazz.getClassName() + (clazz.isStartupClass() ? "*" : ""); //$NON-NLS-1$ //$NON-NLS-2$
- case 1 : // "Loading order",
- return clazz.getLoadOrder() == -2 ? "<boot>" : "" + clazz.getLoadOrder(); //$NON-NLS-1$ //$NON-NLS-2$
- case 2 : // "Memory",
- return classInfo == null ? "" : "" + (classInfo.getRAMSize() + classInfo.getROMSize()); //$NON-NLS-1$ //$NON-NLS-2$
- case 3 : // "Plugin Id",
- return clazz.getClassloader().getId();
- case 4 : // "Activation time",
- return "" + clazz.getTimestamp(); //$NON-NLS-1$
- case 5 : // "RAM",
- return classInfo == null ? "" : "" + classInfo.getRAMSize(); //$NON-NLS-1$ //$NON-NLS-2$
- case 6 : // "ROM"
- return classInfo == null ? "" : "" + classInfo.getROMSize(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return ""; //$NON-NLS-1$
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewSorter.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewSorter.java
deleted file mode 100644
index 197f67f8d..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/LoadedClassesViewSorter.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.text.Collator;
-import org.eclipse.core.tools.ISorter;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.osgi.framework.stats.ClassStats;
-
-public class LoadedClassesViewSorter extends ViewerSorter implements ISorter {
- private boolean reversed = true;
- private int columnNumber;
- private Collator collator = Collator.getInstance();
-
- // columnHeaders = new String[]{ "Class", "Order", "Memory", "Plugin", "Timestamp", "RAM", "ROM" };
- private int[][] SORT_ORDERS_BY_COLUMN = { //
- { 0, 3 }, /* Class */ {
- 1, 0, 3 }, /* Order */ {
- 2, 0, 3 }, /* Memory*/ {
- 3, 0 }, /* Plugin */ {
- 4, 0, 3 }, /* Timestamp */ {
- 5, 0, 3 }, /* RAM */ {
- 6, 0, 3 }, /* ROM */
- };
-
- public LoadedClassesViewSorter(int columnNumber) {
- this.columnNumber = columnNumber;
- if (columnNumber == 0)
- reversed = false;
- }
- /**
- * Compares two stats objects, sorting first by the main column of this sorter,
- * then by subsequent columns, depending on the column sort order.
- */
- public int compare(Viewer viewer, Object o1, Object o2) {
- ClassStats class1 = (ClassStats) o1;
- ClassStats class2 = (ClassStats) o2;
-
- int[] columnSortOrder;
- columnSortOrder = SORT_ORDERS_BY_COLUMN[columnNumber];
-
- int result = 0;
- for (int i = 0; i < columnSortOrder.length; ++i) {
- result = compareColumnValue(columnSortOrder[i], class1, class2);
- if (result != 0)
- break;
- }
- if (reversed)
- result = -result;
- return result;
- }
- /**
- * Compares two markers, based only on the value of the specified column.
- */
- private int compareColumnValue(int columnNumber, ClassStats class1, ClassStats class2) {
- VMClassloaderInfo loader = VMClassloaderInfo.getClassloader(class1.getClassloader().getId());
- VMClassInfo classInfo1 = loader.getClass(class1.getClassName());
- loader = VMClassloaderInfo.getClassloader(class2.getClassloader().getId());
- VMClassInfo classInfo2 = loader.getClass(class2.getClassName());
- switch (columnNumber) {
- case 0 :
- { /* class name */
- String package1 = getPackageName(class1.getClassName());
- String package2 = getPackageName(class2.getClassName());
- int result = collator.compare(package1, package2);
- return result != 0 ? result : collator.compare(class1.getClassName(), class2.getClassName());
- }
- case 1 : /*Loading order */
- return class1.getLoadOrder() - class2.getLoadOrder();
- case 2 : /* Memory */
- return (classInfo1.getRAMSize() + classInfo1.getROMSize()) - (classInfo2.getRAMSize() + classInfo2.getROMSize());
- case 3 : /* Plugin Id */
- return collator.compare(class1.getClassloader().getId(), class2.getClassloader().getId());
- case 4 : /* Activation time */
- return (int) (class1.getTimestamp() - class2.getTimestamp());
- case 5 : /* RAM */
- return classInfo1.getRAMSize() - classInfo2.getRAMSize();
- case 6 : /* ROM */
- return classInfo1.getROMSize() - classInfo2.getROMSize();
- }
- return 0;
- }
-
- private String getPackageName(String className) {
- int index = className.lastIndexOf('.');
- return index == -1 ? "" : className.substring(0, index); //$NON-NLS-1$
- }
-
- /**
- * Returns the number of the column by which this is sorting.
- */
- public int getColumnNumber() {
- return columnNumber;
- }
- /**
- * Returns true for descending, or false for ascending sorting order.
- */
- public boolean isReversed() {
- return reversed;
- }
- /**
- * Sets the sorting order.
- */
- public void setReversed(boolean value) {
- reversed = value;
- }
- /**
- * @see org.eclipse.core.tools.ISorter#states()
- */
- public int states() {
- return 3;
- }
-}
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDataSheetView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDataSheetView.java
deleted file mode 100644
index 78357b4fd..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDataSheetView.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.core.internal.registry.Extension;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.tools.BaseTextView;
-import org.eclipse.core.tools.DeepSize;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.framework.stats.ClassloaderStats;
-import org.eclipse.osgi.framework.stats.ResourceBundleStats;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * View displaying information about the resources for a given plugin
- *
- */
-public class PluginDataSheetView extends BaseTextView implements ISelectionListener {
-
- /** The id by which this view is known in the plug-in registry */
- public static final String VIEW_ID = PluginDataSheetView.class.getName();
-
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- getViewSite().getPage().addSelectionListener(this);
- }
-
- public void dispose() {
- getViewSite().getPage().removeSelectionListener(this);
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- Object first = ((IStructuredSelection) selection).getFirstElement();
- if (first != null && first instanceof IPluginDescriptor) {
- viewer.getDocument().set(printStats((IPluginDescriptor) first));
- viewer.refresh();
- }
- }
- }
-
- private String printStats(IPluginDescriptor descriptor) {
- StringBuffer result = new StringBuffer(200);
- ClassloaderStats classloader = ClassloaderStats.getLoader(descriptor.getUniqueIdentifier());
- printResourceBundleStats(result, classloader == null ? null : classloader.getBundles(), descriptor);
- result.append('\n');
- printExtensionLoadingStats(result, descriptor.getExtensions());
- return result.toString();
- }
-
- private void printExtensionLoadingStats(StringBuffer result, IExtension[] extensions) {
- if (extensions.length == 0) {
- result.append("No extensions contributed by this plugin\n"); //$NON-NLS-1$
- return;
- }
- result.append("Extension loading stats:\n"); //$NON-NLS-1$
- for (int i = 0; i < extensions.length; i++) {
- Extension extension = (Extension) extensions[i];
- result.append('\t');
- result.append(extension.getExtensionPointUniqueIdentifier());
- result.append(" <- "); //$NON-NLS-1$
- result.append(extension.getUniqueIdentifier());
- if (!extension.isFullyLoaded())
- result.append(" (not loaded yet)"); //$NON-NLS-1$
- result.append('\n');
- }
- }
-
- private void printResourceBundleStats(StringBuffer result, ArrayList bundles, IPluginDescriptor descriptor) {
- if (bundles == null || bundles.size() == 0) {
- result.append("No resources loaded by this plugin\n"); //$NON-NLS-1$
- return;
- }
- result.append("Resource bundles stats:\n"); //$NON-NLS-1$
- for (Iterator iterator = bundles.iterator(); iterator.hasNext();) {
- ResourceBundleStats bundle = (ResourceBundleStats) iterator.next();
- result.append('\t');
- result.append(bundle.getFileName());
- result.append("\tElements: #" + bundle.getKeyCount()); //$NON-NLS-1$
- long totalSize;
- // if hashsize == 0, we should compute the total size using DeepSize
- if (bundle.getHashSize() == 0) {
- DeepSize.reset();
- DeepSize calculator = new DeepSize();
- calculator.deepSize(descriptor.getResourceBundle());
- totalSize = calculator.getSize();
- } else
- totalSize = bundle.getTotalSize();
- result.append(" \ttotal: " + totalSize); //$NON-NLS-1$
- result.append("b \tkeys: " + bundle.getKeySize()); //$NON-NLS-1$
- result.append("b \tvalues: " + bundle.getValueSize() + "b\n"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyGraphNode.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyGraphNode.java
deleted file mode 100644
index 3f3f5b15d..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyGraphNode.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.*;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.tools.Policy;
-
-/**
- * This class is used to build up a dependency graph. The full dependency
- * graph is just a hash table containing PluginDependencyGraphNode's. Each
- * node represents one plug-in. They are retrievable based on the plug-in
- * id. Each node has a list of all the plug-in ids for plug-ins that this
- * plug-in requires (children) and another list of all the plug-in ids that
- * require this particular plug-in (ancestors).
- */
-public class PluginDependencyGraphNode {
-
- private IPluginDescriptor descriptor = null;
- private Set children = new HashSet();
- private Set ancestors = new HashSet();
-
- /**
- * Constructor for this class. Each node is associated with a plug-in so
- * we accept the plug-in descriptor here and keep it around for later use.
- */
- public PluginDependencyGraphNode(IPluginDescriptor descriptor) {
- this.descriptor = descriptor;
- }
-
- /**
- * Add the given node to this node's set of ancestors.
- */
- public void addAncestor(PluginDependencyGraphNode ancestor) {
- ancestors.add(ancestor);
- }
-
- /**
- * Add the given node to this node's set of children.
- */
- public void addChild(PluginDependencyGraphNode child) {
- children.add(child);
- }
-
- /**
- * Return the identifier for this node. It is the unique plug-in identifier
- * for this object's plug-in descriptor.
- *
- * @return the plug-in id
- */
- public String getId() {
- return descriptor.getUniqueIdentifier();
- }
-
- /**
- * Return a string representation of this object. It should be nicely formated
- * and include the list of children and ancestor nodes.
- */
- public String toDeepString() {
- StringBuffer buffer = new StringBuffer();
-
- // write ID
- writeln(buffer, 0, Policy.bind("stats.pluginid", descriptor.getUniqueIdentifier())); //$NON-NLS-1$
-
- // write ancestors
- if (ancestors.size() == 0) {
- writeln(buffer, 1, Policy.bind("depend.noParentPlugins")); //$NON-NLS-1$
- } else {
- writeln(buffer, 1, Policy.bind("depend.requiredBy")); //$NON-NLS-1$
- for (Iterator i = ancestors.iterator(); i.hasNext();) {
- PluginDependencyGraphNode ancestor = (PluginDependencyGraphNode) i.next();
- writeln(buffer, 2, ancestor.getId());
- }
- }
-
- // write children
- if (children.size() == 0) {
- writeln(buffer, 1, Policy.bind("depend.noChildrenPlugins")); //$NON-NLS-1$
- } else {
- writeln(buffer, 1, Policy.bind("depend.requires")); //$NON-NLS-1$
- for (Iterator i = children.iterator(); i.hasNext();) {
- PluginDependencyGraphNode child = (PluginDependencyGraphNode) i.next();
- writeln(buffer, 2, child.getId());
- }
- }
- return buffer.toString();
- }
-
- /**
- * Ultility method to write a string and cr to the given buffer. Indent the
- * text the given number of tabs.
- */
- private void writeln(StringBuffer buffer, int indent, String text) {
- for (int i = 0; i < indent; i++)
- buffer.append('\t');
- buffer.append(text);
- buffer.append('\n');
- }
-
- /**
- * @see java.lang.Object#equals(Object)
- */
- public boolean equals(Object obj) {
- if (obj == null)
- return false;
- if (!(obj instanceof PluginDependencyGraphNode))
- return false;
- PluginDependencyGraphNode other = (PluginDependencyGraphNode) obj;
- return this.getId().equals(other.getId());
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getId().hashCode();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("PluginDependencyGraphNode("); //$NON-NLS-1$
- buffer.append(descriptor.getUniqueIdentifier());
- buffer.append(')');
- return buffer.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyPerspective.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyPerspective.java
deleted file mode 100644
index 39fef4708..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyPerspective.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2000,2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import org.eclipse.ui.*;
-
-/**
- * A perspective for working with metadata files.
- */
-public class PluginDependencyPerspective implements IPerspectiveFactory {
- /**
- * Creates a layout containing the following views:
- * PluginListView and
- * PluginDependencyView
- * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
- */
- public void createInitialLayout(IPageLayout layout) {
- String editorAreaId = layout.getEditorArea();
-
- layout.setEditorAreaVisible(false);
-
- IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, (float) 0.30, editorAreaId); //$NON-NLS-1$
- left.addView(PluginListView.VIEW_ID);
-
- IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, (float) 0.7, editorAreaId); //$NON-NLS-1$
- right.addView(PluginDependencyView.VIEW_ID);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyView.java
deleted file mode 100644
index 1426699a4..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginDependencyView.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.tools.*;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.*;
-
-public class PluginDependencyView extends SpyView implements ISelectionListener {
-
- private TextViewer viewer;
- private Map dependencyGraph = null;
-
- /** The id by which this view is known in the plug-in registry */
- public static final String VIEW_ID = PluginDependencyView.class.getName();
-
- /**
- * @see IWorkbenchPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- viewer = new TextViewer(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.WRAP | SWT.READ_ONLY);
- viewer.setDocument(new Document());
-
- IActionBars bars = getViewSite().getActionBars();
-
- final GlobalAction clearOutputAction = new ClearTextAction(viewer.getDocument());
- clearOutputAction.registerAsGlobalAction(bars);
-
- final GlobalAction selectAllAction = new SelectAllAction(viewer);
- selectAllAction.registerAsGlobalAction(bars);
-
- // Delete action shortcuts are not captured by the workbench
- // so we need our key binding service to handle Delete keystrokes for us
- this.viewer.getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == SWT.DEL)
- clearOutputAction.run();
- }
- });
-
- GlobalAction copyAction = new CopyTextSelectionAction(viewer);
- copyAction.registerAsGlobalAction(bars);
-
- bars.getToolBarManager().add(clearOutputAction);
-
- bars.updateActionBars();
-
- // creates a context menu with actions and adds it to the viewer control
- MenuManager menuMgr = new MenuManager();
- menuMgr.add(copyAction);
- menuMgr.add(clearOutputAction);
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
-
- // build up the dependency graph
- buildDependencyGraph();
- getViewSite().getPage().addSelectionListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- super.dispose();
- dependencyGraph = null;
- }
-
- /**
- * Build the table of plug-in dependencies. Iterate over all the plug-ins in the
- * plug-in registry and the cycle through the list of pre-requisites and create the
- * parent/child relationships in the nodes.
- */
- private void buildDependencyGraph() {
- // Build up the dependency graph (see PluginDependencyGraphNode) so
- // we have the information readily available for any plug-in.
- IPluginDescriptor[] plugins = Platform.getPluginRegistry().getPluginDescriptors();
- dependencyGraph = new HashMap();
- for (int i = 0; i < plugins.length; i++) {
- IPluginDescriptor descriptor = plugins[i];
- PluginDependencyGraphNode node = (PluginDependencyGraphNode) dependencyGraph.get(descriptor);
- if (node == null) {
- node = new PluginDependencyGraphNode(descriptor);
- dependencyGraph.put(descriptor, node);
- }
-
- // Cycle through the prerequisites
- IPluginPrerequisite[] requires = descriptor.getPluginPrerequisites();
- for (int j = 0; j < requires.length; j++) {
- String childId = requires[j].getUniqueIdentifier();
- IPluginDescriptor childDesc = Platform.getPluginRegistry().getPluginDescriptor(childId);
- // if the child doesn't exist in the plug-in registry then move to the next child
- if (childDesc == null)
- continue;
-
- // if the child entry is not in the table yet then add it
- PluginDependencyGraphNode childNode = (PluginDependencyGraphNode) dependencyGraph.get(childDesc);
- if (childNode == null) {
- childNode = new PluginDependencyGraphNode(childDesc);
- dependencyGraph.put(childDesc, childNode);
- }
-
- // Add the child to this node's children and set this node as an ancestor
- // of the child node
- node.addChild(childNode);
- childNode.addAncestor(node);
- }
- }
- }
-
- /**
- * @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (!(selection instanceof IStructuredSelection))
- return;
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (!(element instanceof IPluginDescriptor))
- return;
- IPluginDescriptor descriptor = (IPluginDescriptor) element;
- PluginDependencyGraphNode node = (PluginDependencyGraphNode) dependencyGraph.get(descriptor);
- String text = node == null ? Policy.bind("depend.noInformation", descriptor.getUniqueIdentifier()) : node.toDeepString(); //$NON-NLS-1$
- viewer.getDocument().set(text);
- viewer.refresh();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginListView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginListView.java
deleted file mode 100644
index a9be6459d..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PluginListView.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.*;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.tools.Policy;
-import org.eclipse.core.tools.SpyView;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class PluginListView extends SpyView implements IStructuredContentProvider {
-
- // cache the plug-in list
- private Object[] plugins = null;
-
- /** The id by which this view is known in the plug-in registry */
- public static final String VIEW_ID = PluginListView.class.getName();
-
- /**
- * Class which provides the text labels for the view.
- */
- class PluginListLabelProvider extends LabelProvider implements ITableLabelProvider {
- /**
- * @see ITableLabelProvider#getColumnImage(Object, int)
- */
- public Image getColumnImage(Object arg0, int arg1) {
- return null;
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- return element == null ? Policy.bind("depend.badPluginId") : ((IPluginDescriptor) element).getUniqueIdentifier(); //$NON-NLS-1$
- }
- }
-
- /**
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object arg0) {
- if (plugins == null) {
- // before caching the array of descriptors, sort them.
- // we have to use a comparator here because plug-in
- // descriptors cannot be compared against each other
- // in a tree set.
- Comparator comparator = new Comparator() {
- public int compare(Object obj1, Object obj2) {
- String id1 = ((IPluginDescriptor) obj1).getUniqueIdentifier();
- String id2 = ((IPluginDescriptor) obj2).getUniqueIdentifier();
- return id1.compareTo(id2);
- }
- };
- Set set = new TreeSet(comparator);
- IPluginDescriptor[] descriptors = Platform.getPluginRegistry().getPluginDescriptors();
- for (int i = 0; i < descriptors.length; i++)
- set.add(descriptors[i]);
- plugins = set.toArray();
- }
- return plugins;
- }
-
- /**
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- plugins = null;
- }
-
- /**
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
- // do nothing
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- // Create viewer.
- ListViewer viewer = new ListViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- viewer.setContentProvider(this);
- viewer.setLabelProvider(new PluginListLabelProvider());
- viewer.setInput(""); //$NON-NLS-1$
- getSite().setSelectionProvider(viewer);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PreferenceStatsView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PreferenceStatsView.java
deleted file mode 100644
index efc53b367..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/PreferenceStatsView.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.core.tools.runtime;
-
-import java.util.*;
-import org.eclipse.core.internal.preferences.EclipsePreferences;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.preferences.*;
-import org.eclipse.core.tools.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.text.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * Text view that dumps sizeof info and stats about the
- * Eclipse preferences tree.
- *
- * @since 3.0
- */
-public class PreferenceStatsView extends SpyView {
-
- // The JFace widget used for showing the Element Tree info.
- protected TextViewer viewer;
-
- private IAction updateAction;
-
- class UpdateAction extends Action {
-
- // number of nodes in the tree
- int nodeCount;
- // number of key/value pairs in the tree
- int kvCount;
- // number of nodes without key/value pairs
- int emptyNodes;
- // size of the tree
- int treeSize;
- // list of node with key/value pairs
- Set nonEmptyNodes;
-
- // root node
- IEclipsePreferences rootNode = Platform.getPreferencesService().getRootNode();
-
- UpdateAction() {
- super("Update view"); //$NON-NLS-1$
- this.setToolTipText("Update"); //$NON-NLS-1$
- this.setImageDescriptor(CoreToolsPlugin.createImageDescriptor("refresh.gif")); //$NON-NLS-1$
- }
-
- public void run() {
- super.run();
- reset();
- try {
- visitTree();
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- updateTextView();
- reset();
- }
-
- void reset() {
- nodeCount = 0;
- kvCount = 0;
- emptyNodes = 0;
- treeSize = 0;
- nonEmptyNodes = new TreeSet();
- }
-
- int basicSizeof(IEclipsePreferences node) {
- if (node instanceof EclipsePreferences)
- return basicSizeof((EclipsePreferences) node);
-
- // name
- int count = sizeof(node.name());
-
- // key/value pairs
- try {
- String[] keys = node.keys();
- for (int i = 0; i < keys.length; i++) {
- count += sizeof(keys[i]);
- String value = node.get(keys[i], null);
- count += sizeof(value);
- }
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- return count;
- }
-
- int calculateOldSize() {
- int count = 0;
- IPluginRegistry registry = Platform.getPluginRegistry();
- if (registry == null)
- return count;
- IPluginDescriptor[] descriptors = registry.getPluginDescriptors();
- if (descriptors == null)
- return count;
- for (int i = 0; i < descriptors.length; i++) {
- IPluginDescriptor desc = descriptors[i];
- // if (desc.isPluginActivated())
- count += calculateOldSizeFor(desc.getUniqueIdentifier());
- }
- return count;
- }
-
- int calculateOldSizeFor(String pluginID) {
- int count = 0;
- // 12 for the object header + 4 for each field
- count += 12;
-
- // dirty boolean
- count += 4;
-
- // listener list
- // TODO
- count += 4;
-
- // Properties properties
- count += 4;
- IEclipsePreferences node = new InstanceScope().getNode(pluginID);
- if (node != null) {
- // add the key/value pairs
- // TODO rough estimate
- try {
- String[] keys = node.keys();
- for (int i = 0; i < keys.length; i++) {
- count += sizeof(keys[i]);
- String value = node.get(keys[i], null);
- count += sizeof(value);
- }
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- }
-
- // Properties defaults
- count += 4;
- node = new DefaultScope().getNode(pluginID);
- if (node != null) {
- // add the key/value pairs
- // TODO rough estimate
- try {
- String[] keys = node.keys();
- for (int i = 0; i < keys.length; i++) {
- count += sizeof(keys[i]);
- String value = node.get(keys[i], null);
- count += sizeof(value);
- }
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- }
-
- return count;
- }
-
- /*
- * 12 for the object header
- * 4 for each slot
- */
- int basicSizeof(EclipsePreferences node) {
- int count = 12;
-
- // name
- count += 4;
- count += sizeof(node.name());
-
- // dirty boolean
- count += 4;
-
- // removed boolean
- count += 4;
-
- // loading boolean
- count += 4;
-
- // slot for the parent pointer
- count += 4;
-
- // child map
- // TODO this isn't quite right but is ok for now
- count += 4;
- String[] childrenNames = node.childrenNames();
- for (int i = 0; i < childrenNames.length; i++)
- count += sizeof(childrenNames[i]);
-
- // node change listener list
- // TODO
- count += 4;
-
- // preference change listener list
- // TODO
- count += 4;
-
- // cached path
- count += 4;
- count += sizeof(node.absolutePath());
-
- // key/value pairs
- // TODO this isn't quite right but is ok for now
- count += 4;
- String[] keys = node.keys();
- for (int i = 0; i < keys.length; i++) {
- count += sizeof(keys[i]);
- String value = node.get(keys[i], null);
- count += sizeof(value);
- }
-
- return count;
- }
-
- int basicSizeof(Map map) {
- if (map == null)
- return 0;
-
- //formula taken from BundleStats
- int count = (int) Math.round(44 + (16 + (map.size() * 1.25 * 4)) + (24 * map.size()));
-
- for (Iterator it = map.entrySet().iterator(); it.hasNext();) {
- Map.Entry entry = (Map.Entry) it.next();
- count += sizeof(entry.getKey());
- count += sizeof(entry.getValue());
- }
- return count;
- }
-
- /**
- * All sizeof tests should go through this central method to weed out
- * duplicates.
- */
- int sizeof(Object object) {
- if (object == null)//|| DeepSize.ignore(object))
- return 0;
- if (object instanceof String)
- return 44 + 2 * ((String) object).length();
- if (object instanceof byte[])
- return 16 + ((byte[]) object).length;
- if (object instanceof Integer)
- return 16;
- if (object instanceof Map)
- return basicSizeof((Map) object);
- if (object instanceof IEclipsePreferences)
- return basicSizeof((IEclipsePreferences) object);
- if (object instanceof QualifiedName) {
- QualifiedName name = (QualifiedName) object;
- return 20 + sizeof(name.getQualifier()) + sizeof(name.getLocalName());
- }
- // unknown -- use deep size
- return 0;
- }
-
- void visitTree() throws BackingStoreException {
- // count the number of nodes in the preferences tree
- reset();
- IPreferenceNodeVisitor visitor = new IPreferenceNodeVisitor() {
- public boolean visit(IEclipsePreferences node) {
- try {
- treeSize += sizeof(node);
- nodeCount++;
- int keys = node.keys().length;
- kvCount += keys;
- if (keys == 0)
- emptyNodes++;
- else
- nonEmptyNodes.add(node.absolutePath() + " (" + keys + ")"); //$NON-NLS-1$//$NON-NLS-2$
- } catch (BackingStoreException e) {
- e.printStackTrace();
- }
- return true;
- }
- };
- rootNode.accept(visitor);
- }
-
- void updateTextView() {
- final StringBuffer buffer = new StringBuffer();
- buffer.append("Size of Eclipse 2.1 preference objects: " + prettyPrint(calculateOldSize()) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("Total node count: " + prettyPrint(nodeCount) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("Nodes without keys: " + prettyPrint(emptyNodes) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("Key/value pairs: " + prettyPrint(kvCount) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("Total size of tree: " + prettyPrint(treeSize) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append("Nodes with key/value pairs:\n"); //$NON-NLS-1$
- for (Iterator i = nonEmptyNodes.iterator(); i.hasNext();)
- buffer.append("\t" + i.next() + "\n"); //$NON-NLS-1$//$NON-NLS-2$
-
- //post changes to UI thread
- viewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (!viewer.getControl().isDisposed()) {
- IDocument doc = viewer.getDocument();
- doc.set(buffer.toString());
- viewer.setDocument(doc);
- }
- }
- });
- }
-
- private String prettyPrint(int i) {
- StringBuffer buf = new StringBuffer();
- for (;;) {
- if (i < 1000) {
- String val = Integer.toString(i);
- //pad with zeros if necessary
- if (buf.length() > 0) {
- if (val.length() < 2)
- buf.append('0');
- if (val.length() < 3)
- buf.append('0');
- }
- buf.append(val);
- return buf.toString();
- }
- if (i < 1000000) {
- String val = Integer.toString(i / 1000);
- //pad with zeros if necessary
- if (buf.length() > 0) {
- if (val.length() < 2)
- buf.append('0');
- if (val.length() < 3)
- buf.append('0');
- }
- buf.append(val);
- buf.append(',');
- i = i % 1000;
- continue;
- }
- buf.append(Integer.toString(i / 1000000));
- buf.append(',');
- i = i % 1000000;
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
-
- viewer = new TextViewer(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.WRAP | SWT.READ_ONLY);
- viewer.setDocument(new Document());
-
- IActionBars bars = getViewSite().getActionBars();
-
- final GlobalAction clearOutputAction = new ClearTextAction(viewer.getDocument());
- clearOutputAction.registerAsGlobalAction(bars);
-
- final GlobalAction selectAllAction = new SelectAllAction(viewer);
- selectAllAction.registerAsGlobalAction(bars);
-
- IMenuManager barMenuManager = getViewSite().getActionBars().getMenuManager();
- updateAction = new UpdateAction();
- barMenuManager.add(updateAction);
-
- // Delete action shortcuts are not captured by the workbench
- // so we need our key binding service to handle Delete keystrokes for us
-
- this.viewer.getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == SWT.DEL)
- clearOutputAction.run();
- }
- });
-
- GlobalAction copyAction = new CopyTextSelectionAction(viewer);
- copyAction.registerAsGlobalAction(bars);
-
- bars.getToolBarManager().add(updateAction);
- bars.getToolBarManager().add(clearOutputAction);
-
- bars.updateActionBars();
-
- // creates a context menu with actions and adds it to the viewer control
- MenuManager menuMgr = new MenuManager();
- menuMgr.add(copyAction);
- menuMgr.add(clearOutputAction);
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
-
- // populate the view with the initial data
- if (updateAction != null)
- updateAction.run();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- super.dispose();
- updateAction = null;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/RuntimeSpyPerspective.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/RuntimeSpyPerspective.java
deleted file mode 100644
index fd92f9f57..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/RuntimeSpyPerspective.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-public class RuntimeSpyPerspective implements IPerspectiveFactory {
-
- public RuntimeSpyPerspective() {
- super();
- }
-
- public void createInitialLayout(IPageLayout layout) {
- layout.setEditorAreaVisible(false);
- layout.addView(ActivePluginsView.VIEW_ID, IPageLayout.LEFT, 0.75f, layout.getEditorArea());
- layout.addView(PluginDataSheetView.VIEW_ID, IPageLayout.RIGHT, 0.75f, ActivePluginsView.VIEW_ID);
- layout.addView(LoadedClassesView.VIEW_ID, IPageLayout.BOTTOM, 0.50f, ActivePluginsView.VIEW_ID);
- layout.addView(StackTraceView.VIEW_ID, IPageLayout.BOTTOM, 0.25f, PluginDataSheetView.VIEW_ID);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/StackTraceView.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/StackTraceView.java
deleted file mode 100644
index 2b1c6fe66..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/StackTraceView.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.io.*;
-import org.eclipse.core.tools.*;
-
-public class StackTraceView extends BaseTextView {
-
- /** The id by which this view is known in the plug-in registry */
- public static final String VIEW_ID = StackTraceView.class.getName();
-
- public StackTraceView() {
- super();
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public void setInput(String stackFileName, long begin, long end) {
- if (begin == -1 || end == -1) {
- viewer.getDocument().set("No stack trace available.\nSee <eclipse install>/plugins/org.eclipse.core.boot/.options"); //$NON-NLS-1$
- viewer.refresh();
- return;
- }
-
- try {
- byte[] chars = new byte[0];
- FileInputStream fis = new FileInputStream(stackFileName);
- try {
- fis.skip(begin);
- chars = new byte[(int) (end - begin)];
- fis.read(chars);
- } finally {
- fis.close();
- }
- viewer.getDocument().set(new String(chars));
- viewer.refresh();
- } catch (FileNotFoundException e) {
- // ignore
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassInfo.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassInfo.java
deleted file mode 100644
index c842738fa..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassInfo.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-public class VMClassInfo {
- String name;
- int ramSize = 0;
- int romSize = 0;
- int jitSize = 0;
-
- public VMClassInfo(String name) {
- this.name = name.replace('/', '.');
- }
-
- public int getJitSize() {
- return jitSize;
- }
-
- public String getName() {
- return name;
- }
-
- public int getRAMSize() {
- return ramSize;
- }
-
- public int getROMSize() {
- return romSize;
- }
-
- public void setJITSize(int value) {
- jitSize = value;
- }
-
- public void setRAMSize(int value) {
- ramSize = value;
- }
-
- public void setROMSize(int value) {
- romSize = value;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassloaderInfo.java b/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassloaderInfo.java
deleted file mode 100644
index c8ec413b8..000000000
--- a/bundles/org.eclipse.core.tools/src/org/eclipse/core/tools/runtime/VMClassloaderInfo.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.core.tools.runtime;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class VMClassloaderInfo {
-
- protected String id;
- protected ClassLoader loader;
- protected VMClassInfo[] classes;
- protected int allocRAM = 0;
- protected int allocROM = 0;
- protected int usedRAM = 0;
- protected int usedROM = 0;
-
- public static boolean hasNatives = false;
- protected static Map loaders = new HashMap(20);
-
- public static VMClassInfo[] getBaseClasses() {
- return new VMClassInfo[0];
- }
-
- public static VMClassloaderInfo getClassloader(String id) {
- return new VMClassloaderInfo(id, null);
- }
-
- public static void refreshInfos() {
- loaders = new HashMap(20);
- }
-
- protected VMClassloaderInfo(String id, ClassLoader loader) {
- this.id = id;
- if (loader != null)
- this.loader = loader;
- }
-
- public int getAllocRAM() {
- return allocRAM;
- }
-
- public int getAllocROM() {
- return allocROM;
- }
-
- public VMClassloaderInfo getClassloader() {
- return this;
- }
-
- public int getCount() {
- return getClasses().length;
- }
-
- public int getFreeRAM() {
- return getAllocRAM() - getUsedRAM();
- }
-
- public int getFreeROM() {
- return getAllocROM() - getUsedROM();
- }
-
- public String getName() {
- return id;
- }
-
- protected int getTotal(long type, int aspect) {
- return 0;
- }
-
- public int getUsedRAM() {
- return usedRAM;
- }
-
- public int getUsedROM() {
- return usedROM;
- }
-
- protected VMClassInfo[] getClasses() {
- if (classes == null)
- initializeClasses();
- return classes;
- }
-
- public VMClassInfo getClass(String name) {
- return new VMClassInfo(name);
- }
-
- public void refresh() {
- allocRAM = 0;
- allocROM = 0;
- usedRAM = 0;
- usedROM = 0;
- classes = null;
- }
-
- public void initializeClasses() {
- return;
- }
-} \ No newline at end of file
diff --git a/features/org.eclipse.core.tools-feature/.project b/features/org.eclipse.core.tools-feature/.project
deleted file mode 100644
index 9cdfafd07..000000000
--- a/features/org.eclipse.core.tools-feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.core.tools-feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.core.tools-feature/build.properties b/features/org.eclipse.core.tools-feature/build.properties
deleted file mode 100644
index 9ea7649b0..000000000
--- a/features/org.eclipse.core.tools-feature/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = feature.xml, license.html, feature.properties, cpl-v10.html, *.jpg
-qualifier=context \ No newline at end of file
diff --git a/features/org.eclipse.core.tools-feature/cpl-v10.html b/features/org.eclipse.core.tools-feature/cpl-v10.html
deleted file mode 100644
index 36aa208d4..000000000
--- a/features/org.eclipse.core.tools-feature/cpl-v10.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
-<TITLE>Common Public License - v 1.0</TITLE>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF" VLINK="#800000">
-
-
-<P ALIGN="CENTER"><B>Common Public License - v 1.0</B>
-<P><B></B><FONT SIZE="3"></FONT>
-<P><FONT SIZE="3"></FONT><FONT SIZE="2">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"><B>1. DEFINITIONS</B></FONT>
-<P><FONT SIZE="2">"Contribution" means:</FONT>
-
-<UL><FONT SIZE="2">a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and<BR CLEAR="LEFT">
-b) in the case of each subsequent Contributor:</FONT></UL>
-
-
-<UL><FONT SIZE="2">i) changes to the Program, and</FONT></UL>
-
-
-<UL><FONT SIZE="2">ii) additions to the Program;</FONT></UL>
-
-
-<UL><FONT SIZE="2">where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. </FONT><FONT SIZE="2">A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. </FONT><FONT SIZE="2">Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. </FONT></UL>
-
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">"Contributor" means any person or entity that distributes the Program.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. </FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">"Program" means the Contributions distributed in accordance with this Agreement.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.</FONT>
-<P><FONT SIZE="2"><B></B></FONT>
-<P><FONT SIZE="2"><B>2. GRANT OF RIGHTS</B></FONT>
-
-<UL><FONT SIZE="2"></FONT><FONT SIZE="2">a) </FONT><FONT SIZE="2">Subject to the terms of this Agreement, each Contributor hereby grants</FONT><FONT SIZE="2"> Recipient a non-exclusive, worldwide, royalty-free copyright license to</FONT><FONT SIZE="2" COLOR="#FF0000"> </FONT><FONT SIZE="2">reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.</FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT><FONT SIZE="2">b) Subject to the terms of this Agreement, each Contributor hereby grants </FONT><FONT SIZE="2">Recipient a non-exclusive, worldwide,</FONT><FONT SIZE="2" COLOR="#008000"> </FONT><FONT SIZE="2">royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. </FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-
-<UL><FONT SIZE="2">c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.</FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-
-<UL><FONT SIZE="2">d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. </FONT></UL>
-
-
-<UL><FONT SIZE="2"></FONT></UL>
-
-<P><FONT SIZE="2"><B>3. REQUIREMENTS</B></FONT>
-<P><FONT SIZE="2"><B></B>A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:</FONT>
-
-<UL><FONT SIZE="2">a) it complies with the terms and conditions of this Agreement; and</FONT></UL>
-
-
-<UL><FONT SIZE="2">b) its license agreement:</FONT></UL>
-
-
-<UL><FONT SIZE="2">i) effectively disclaims</FONT><FONT SIZE="2"> on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; </FONT></UL>
-
-
-<UL><FONT SIZE="2">ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; </FONT></UL>
-
-
-<UL><FONT SIZE="2">iii)</FONT><FONT SIZE="2"> states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and</FONT></UL>
-
-
-<UL><FONT SIZE="2">iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.</FONT><FONT SIZE="2" COLOR="#0000FF"> </FONT><FONT SIZE="2" COLOR="#FF0000"></FONT></UL>
-
-
-<UL><FONT SIZE="2" COLOR="#FF0000"></FONT><FONT SIZE="2"></FONT></UL>
-
-<P><FONT SIZE="2">When the Program is made available in source code form:</FONT>
-
-<UL><FONT SIZE="2">a) it must be made available under this Agreement; and </FONT></UL>
-
-
-<UL><FONT SIZE="2">b) a copy of this Agreement must be included with each copy of the Program. </FONT></UL>
-
-<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT>
-<P><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT><FONT SIZE="2">Contributors may not remove or alter any copyright notices contained within the Program. </FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. </FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"><B>4. COMMERCIAL DISTRIBUTION</B></FONT>
-<P><FONT SIZE="2">Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"></FONT>
-<P><FONT SIZE="2" COLOR="#0000FF"></FONT><FONT SIZE="2"><B>5. NO WARRANTY</B></FONT>
-<P><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is</FONT><FONT SIZE="2"> solely responsible for determining the appropriateness of using and distributing </FONT><FONT SIZE="2">the Program</FONT><FONT SIZE="2"> and assumes all risks associated with its exercise of rights under this Agreement</FONT><FONT SIZE="2">, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, </FONT><FONT SIZE="2">programs or equipment, and unavailability or interruption of operations</FONT><FONT SIZE="2">. </FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"><B>6. DISCLAIMER OF LIABILITY</B></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES </FONT><FONT SIZE="2">(INCLUDING WITHOUT LIMITATION LOST PROFITS),</FONT><FONT SIZE="2"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"><B>7. GENERAL</B></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. </FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. </FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2">Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to </FONT><FONT SIZE="2">publish new versions (including revisions) of this Agreement from time to </FONT><FONT SIZE="2">time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. </FONT><FONT SIZE="2">Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new </FONT><FONT SIZE="2">version. </FONT><FONT SIZE="2">Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, </FONT><FONT SIZE="2">by implication, estoppel or otherwise</FONT><FONT SIZE="2">.</FONT><FONT SIZE="2"> All rights in the Program not expressly granted under this Agreement are reserved.</FONT>
-<P><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2">This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.</FONT>
-<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
-<P><FONT SIZE="2"></FONT>
-
-</BODY>
-
-</HTML> \ No newline at end of file
diff --git a/features/org.eclipse.core.tools-feature/eclipse_update_120.jpg b/features/org.eclipse.core.tools-feature/eclipse_update_120.jpg
deleted file mode 100644
index 68e3e0248..000000000
--- a/features/org.eclipse.core.tools-feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.core.tools-feature/feature.properties b/features/org.eclipse.core.tools-feature/feature.properties
deleted file mode 100644
index 93ed48d83..000000000
--- a/features/org.eclipse.core.tools-feature/feature.properties
+++ /dev/null
@@ -1,113 +0,0 @@
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Eclipse Core Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=Eclipse.org update site
-
-# "description" property - description of the feature
-description=Tools for plug-in developers by plug-in developers
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE.ORG SOFTWARE USER AGREEMENT\n\
-14th August, 2003\n\
-\n\
-Usage Of Content\n\
-\n\
-ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by Eclipse.org\n\
-is provided to you under the terms and conditions of the Common Public\n\
-License Version 1.0 ("CPL"). A copy of the CPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/cpl-v10.html.\n\
-For purposes of the CPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments\n\
-("Fragments"), and features ("Features"). A Feature is a bundle of one or\n\
-more Plug-ins and/or Fragments and associated material. Files named\n\
-"feature.xml" may contain a list of the names and version numbers of the\n\
-Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments\n\
-are located in directories named "plugins" and Features are located in\n\
-directories named "features".\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Subdirectories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by Eclipse.org is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE CPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact Eclipse.org to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.core.tools-feature/feature.xml b/features/org.eclipse.core.tools-feature/feature.xml
deleted file mode 100644
index c6c7abaf9..000000000
--- a/features/org.eclipse.core.tools-feature/feature.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.core.tools"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://update.eclipse.org/updates"/>
- </url>
-
- <plugin
- id="org.eclipse.core.tools"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.core.tools.resources"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.core.resources.spysupport"
- download-size="0"
- install-size="0"
- version="0.0.0"
- fragment="true"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.core.tools-feature/license.html b/features/org.eclipse.core.tools-feature/license.html
deleted file mode 100644
index af8c38096..000000000
--- a/features/org.eclipse.core.tools-feature/license.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse.org Software User Agreement</h2>
-<p>14th August, 2003</p>
-
-<h3>Usage Of Content</h3>
-
-<p>ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by Eclipse.org is provided to you under the terms and conditions of the Common Public License Version 1.0
- (&quot;CPL&quot;). A copy of the CPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
- For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<p>Content may be apportioned into plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories
- named &quot;plugins&quot; and Features are located in directories named &quot;features&quot;.</p>
-
-<p>Features may also include other Features (&quot;Included Features&quot;). Files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</p>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Subdirectories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by Eclipse.org is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot;.
-Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE CPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please
-contact Eclipse.org to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-</body>
-</html> \ No newline at end of file
diff --git a/tests/org.eclipse.core.tests.runtime/plugin.xml b/tests/org.eclipse.core.tests.runtime/plugin.xml
index 9a645d24f..cb98d4d2b 100644
--- a/tests/org.eclipse.core.tests.runtime/plugin.xml
+++ b/tests/org.eclipse.core.tests.runtime/plugin.xml
@@ -3,7 +3,7 @@
<plugin
id="org.eclipse.core.tests.runtime"
name="Eclipse Core Tests Runtime"
- version="3.0.0"
+ version="3.0.1"
provider-name="Eclipse.org"
class="org.eclipse.core.tests.runtime.RuntimeTestsPlugin">
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/IRegistryChangeEventTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/IRegistryChangeEventTest.java
index ec27df4c4..4cbfee08f 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/IRegistryChangeEventTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/IRegistryChangeEventTest.java
@@ -267,6 +267,50 @@ public class IRegistryChangeEventTest extends TestCase {
}
}
+ public void testBug71826() {
+ ExtensionRegistry registry = new ExtensionRegistry();
+
+ // plugin A provides an extension point
+ final Namespace pluginA = new Namespace();
+ pluginA.setUniqueIdentifier("a");
+ final ExtensionPoint xp1 = new ExtensionPoint();
+ xp1.setSimpleIdentifier("xp1");
+ pluginA.setExtensionPoints(new ExtensionPoint[] {xp1});
+ xp1.setParent(pluginA);
+
+ // plugin B provides an extension to A's extension point
+ final Namespace pluginB = new Namespace();
+ pluginB.setUniqueIdentifier("b");
+ final Extension ext1 = new Extension();
+ ext1.setExtensionPointIdentifier("a.xp1");
+ ext1.setSimpleIdentifier("ext1");
+ pluginB.setExtensions(new Extension[] {ext1});
+ ext1.setParent(pluginB);
+
+ // fragment C has plugin A as host and also contributes an extension to its extension point
+ final Namespace fragmentC = new Namespace();
+ fragmentC.setUniqueIdentifier("c");
+ final Extension ext2 = new Extension();
+ ext2.setExtensionPointIdentifier("a.xp1");
+ ext2.setSimpleIdentifier("ext2");
+ fragmentC.setExtensions(new Extension[] {ext2});
+ ext2.setParent(fragmentC);
+ fragmentC.setHostIdentifier(pluginA.getUniqueIdentifier());
+
+ // if B and C were added to the registry before A, C's extension point would get lost.
+ registry.add(fragmentC);
+ registry.add(pluginB);
+ registry.add(pluginA);
+
+ // ensure all extensions are there
+ IExtensionPoint xp = registry.getExtensionPoint(xp1.getUniqueIdentifier());
+ assertNotNull("1.0", xp);
+ IExtension[] exts = xp.getExtensions();
+ assertEquals("1.1", 2, exts.length);
+ assertEquals("1.2", ext1, xp.getExtension(ext1.getUniqueIdentifier()));
+ assertEquals("1.3", ext2, xp.getExtension(ext2.getUniqueIdentifier()));
+ }
+
public static Test suite() {
return new TestSuite(IRegistryChangeEventTest.class);
}
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java
index 85e34c9ee..21a34e3d7 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java
@@ -11,17 +11,24 @@
package org.eclipse.core.tests.runtime.content;
import java.io.*;
-import junit.framework.*;
+import java.util.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.eclipse.core.internal.content.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.content.*;
+import org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.tests.harness.BundleTestingHelper;
+import org.eclipse.core.tests.harness.EclipseWorkspaceTest;
import org.eclipse.core.tests.runtime.RuntimeTestsPlugin;
import org.eclipse.core.tests.runtime.TestRegistryChangeListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
-public class IContentTypeManagerTest extends TestCase {
+public class IContentTypeManagerTest extends EclipseWorkspaceTest {
private final static String MINIMAL_XML = "<?xml version=\"1.0\"?><org.eclipse.core.runtime.tests.root/>";
private final static String SAMPLE_BIN1_OFFSET = "12345";
private final static byte[] SAMPLE_BIN1_SIGNATURE = {0x10, (byte) 0xAB, (byte) 0xCD, (byte) 0xFF};
@@ -585,4 +592,150 @@ public class IContentTypeManagerTest extends TestCase {
assertNotNull("1.0", selected);
assertEquals("1.1", rootElement, selected);
}
+
+ /**
+ * Bug 68894
+ */
+ public void testPreferences() throws CoreException, BackingStoreException {
+ ContentTypeManager manager = ContentTypeManager.getInstance();
+ IContentType text = manager.getContentType(IContentTypeManager.CT_TEXT);
+ Preferences textPrefs = new InstanceScope().getNode(ContentTypeManager.CONTENT_TYPE_PREF_NODE).node(text.getId());
+ assertNotNull("0.1", text);
+
+ // ensure the "default charset" preference is being properly used
+ assertNull("1.0", text.getDefaultCharset());
+ assertNull("1.1", textPrefs.get(ContentType.PREF_DEFAULT_CHARSET, null));
+ text.setDefaultCharset("UTF-8");
+ assertEquals("1.2", "UTF-8", textPrefs.get(ContentType.PREF_DEFAULT_CHARSET, null));
+ text.setDefaultCharset(null);
+ assertNull("1.3", textPrefs.get(ContentType.PREF_DEFAULT_CHARSET, null));
+
+ // ensure the file spec preferences are being properly used
+ // some sanity checking
+ assertFalse("2.01", text.isAssociatedWith("xyz.foo"));
+ assertFalse("2.01", text.isAssociatedWith("xyz.bar"));
+ assertFalse("2.03", text.isAssociatedWith("foo.ext"));
+ assertFalse("2.04", text.isAssociatedWith("bar.ext"));
+ // play with file name associations first...
+ assertNull("2.0a", textPrefs.get(ContentType.PREF_FILE_NAMES, null));
+ assertNull("2.0b", textPrefs.get(ContentType.PREF_FILE_EXTENSIONS, null));
+ text.addFileSpec("foo.ext", IContentType.FILE_NAME_SPEC);
+ assertTrue("2.1", text.isAssociatedWith("foo.ext"));
+ assertEquals("2.2", "foo.ext", textPrefs.get(ContentType.PREF_FILE_NAMES, null));
+ text.addFileSpec("bar.ext", IContentType.FILE_NAME_SPEC);
+ assertTrue("2.3", text.isAssociatedWith("bar.ext"));
+ assertEquals("2.4", "foo.ext,bar.ext", textPrefs.get(ContentType.PREF_FILE_NAMES, null));
+ // ... and then with file extensions
+ text.addFileSpec("foo", IContentType.FILE_EXTENSION_SPEC);
+ assertTrue("2.5", text.isAssociatedWith("xyz.foo"));
+ assertEquals("2.6", "foo", textPrefs.get(ContentType.PREF_FILE_EXTENSIONS, null));
+ text.addFileSpec("bar", IContentType.FILE_EXTENSION_SPEC);
+ assertTrue("2.7", text.isAssociatedWith("xyz.bar"));
+ assertEquals("2.4", "foo,bar", textPrefs.get(ContentType.PREF_FILE_EXTENSIONS, null));
+ // remove all associations made
+ text.removeFileSpec("foo.ext", IContentType.FILE_NAME_SPEC);
+ text.removeFileSpec("bar.ext", IContentType.FILE_NAME_SPEC);
+ text.removeFileSpec("foo", IContentType.FILE_EXTENSION_SPEC);
+ text.removeFileSpec("bar", IContentType.FILE_EXTENSION_SPEC);
+ // ensure all is as before
+ assertFalse("3.1", text.isAssociatedWith("xyz.foo"));
+ assertFalse("3.2", text.isAssociatedWith("xyz.bar"));
+ assertFalse("3.3", text.isAssociatedWith("foo.ext"));
+ assertFalse("3.4", text.isAssociatedWith("bar.ext"));
+
+ // ensure the serialization format is correct
+ try {
+ text.addFileSpec("foo.bar", IContentType.FILE_NAME_SPEC);
+ textPrefs.sync();
+ assertEquals("4.0", "foo.bar", textPrefs.get(ContentType.PREF_FILE_NAMES, null));
+ } finally {
+ // clean-up
+ text.removeFileSpec("foo.bar", IContentType.FILE_NAME_SPEC);
+ }
+ }
+
+ class ContentTypeChangeTracer implements IContentTypeManager.IContentTypeChangeListener {
+ private Set changed = new HashSet();
+
+ public void contentTypeChanged(ContentTypeChangeEvent event) {
+ changed.add(event.getContentType());
+ }
+
+ public Collection getChanges() {
+ return changed;
+ }
+
+ public void reset() {
+ changed.clear();
+ }
+
+ public boolean isOnlyChange(IContentType myType) {
+ return changed.size() == 1 && changed.contains(myType);
+ }
+ }
+
+ public void testEvents() {
+ IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
+ IContentType myType = contentTypeManager.getContentType(RuntimeTestsPlugin.PI_RUNTIME_TESTS + ".myContent");
+ assertNotNull("0.9", myType);
+
+ ContentTypeChangeTracer tracer;
+
+ tracer = new ContentTypeChangeTracer();
+ contentTypeManager.addContentTypeChangeListener(tracer);
+
+ // add a file spec and check event
+ try {
+ myType.addFileSpec("another.file.name", IContentType.FILE_NAME_SPEC);
+ } catch (CoreException e) {
+ fail("1.0", e);
+ }
+ assertTrue("1.1", tracer.isOnlyChange(myType));
+
+ // remove a non-existing file spec - should not cause an event to be fired
+ tracer.reset();
+ try {
+ myType.removeFileSpec("another.file.name", IContentType.FILE_EXTENSION_SPEC);
+ } catch (CoreException e) {
+ fail("2.0", e);
+ }
+ assertTrue("2.1", !tracer.isOnlyChange(myType));
+
+ // add a file spec again and check no event is generated
+ tracer.reset();
+ try {
+ myType.addFileSpec("another.file.name", IContentType.FILE_NAME_SPEC);
+ } catch (CoreException e) {
+ fail("3.0", e);
+ }
+ assertTrue("3.1", !tracer.isOnlyChange(myType));
+
+ // remove a file spec and check event
+ tracer.reset();
+ try {
+ myType.removeFileSpec("another.file.name", IContentType.FILE_NAME_SPEC);
+ } catch (CoreException e) {
+ fail("4.0", e);
+ }
+ assertTrue("4.1", tracer.isOnlyChange(myType));
+
+ // change the default charset and check event
+ tracer.reset();
+ try {
+ myType.setDefaultCharset("FOO");
+ } catch (CoreException e) {
+ fail("5.0", e);
+ }
+ assertTrue("5.1", tracer.isOnlyChange(myType));
+
+ // set the default charset to the same - no event should be generated
+ tracer.reset();
+ try {
+ myType.setDefaultCharset("FOO");
+ } catch (CoreException e) {
+ fail("6.0", e);
+ }
+ assertTrue("6.1", !tracer.isOnlyChange(myType));
+
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyInputStreamTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyInputStreamTest.java
index 4f7fdd2a1..02aae41ff 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyInputStreamTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyInputStreamTest.java
@@ -11,11 +11,7 @@
package org.eclipse.core.tests.runtime.content;
import java.io.*;
-import java.io.ByteArrayInputStream;
-import java.io.UnsupportedEncodingException;
import junit.framework.*;
-import junit.framework.Test;
-import junit.framework.TestCase;
import org.eclipse.core.internal.content.LazyInputStream;
public class LazyInputStreamTest extends TestCase {
@@ -117,8 +113,10 @@ public class LazyInputStreamTest extends TestCase {
assertEquals("2.5", 17, stream.available());
assertEquals("2.6", 13, stream.getOffset());
stream.reset();
- assertEquals("2.7", 0, stream.getOffset());
- assertEquals("2.8", 30, stream.available());
+ assertEquals("2.7", 17, stream.available());
+ assertEquals("2.8", 13, stream.getOffset());
+ stream.rewind();
+ assertEquals("3.0", 0, stream.getOffset());
}
public void testContentHasEOF() throws IOException {
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyReaderTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyReaderTest.java
index 0875cd274..e2333a0a5 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyReaderTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/LazyReaderTest.java
@@ -71,19 +71,19 @@ public class LazyReaderTest extends TestCase {
assertEquals("2.0", 4, read);
assertEquals("2.1", DATA.substring(11, 11 + read), new String(buffer, 3, read));
assertEquals("2.2", 15, stream.getOffset());
- stream.mark(0);
+ stream.mark(0);
buffer = new char[100];
read = stream.read(buffer);
assertEquals("3.0", DATA.length() - 15, read);
assertEquals("3.1", DATA.substring(15, 15 + read), new String(buffer, 0, read));
- assertFalse("3.2", stream.ready());
+ assertFalse("3.2", stream.ready());
stream.reset();
assertEquals("4.0", 15, stream.getOffset());
read = stream.read(buffer, 10, 14);
assertEquals("4.1", 29, stream.getOffset());
assertTrue("4.2", stream.ready());
assertEquals("4.3", 14, read);
- assertEquals("4.4", DATA.substring(15, 15+ read), new String(buffer, 10, read));
+ assertEquals("4.4", DATA.substring(15, 15 + read), new String(buffer, 10, read));
read = stream.read(buffer);
assertEquals("5.0", 30, stream.getOffset());
assertFalse("5.1", stream.ready());
@@ -92,7 +92,7 @@ public class LazyReaderTest extends TestCase {
read = stream.read(buffer);
assertEquals("6.0", 30, stream.getOffset());
assertFalse("6.1", stream.ready());
- assertEquals("6.2", -1, read);
+ assertEquals("6.2", -1, read);
}
public void testMarkAndReset() throws UnsupportedEncodingException, IOException {
@@ -113,8 +113,13 @@ public class LazyReaderTest extends TestCase {
assertEquals("2.7", 17, stream.skip(1000));
assertFalse("2.8", stream.ready());
stream.reset();
- assertEquals("2.9", 0, stream.getOffset());
- assertTrue("2.10", stream.ready());
+ assertTrue("2.9", stream.ready());
+ assertEquals("2.10", 13, stream.getOffset());
+ stream.reset();
+ assertTrue("2.11", stream.ready());
+ assertEquals("2.12", 13, stream.getOffset());
+ stream.rewind();
+ assertEquals("3.0", 0, stream.getOffset());
}
public static Test suite() {

Back to the top