You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by sp...@apache.org on 2009/05/11 07:55:58 UTC

svn commit: r773494 - in /incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer: ./ .settings/ META-INF/ icons/ src/ src/org/ src/org/apache/ src/org/apache/kato/ src/org/apache/kato/tools/ src/org/apache/kato/tools/plugins/ src/org/apache/kato...

Author: spoole
Date: Mon May 11 07:55:57 2009
New Revision: 773494

URL: http://svn.apache.org/viewvc?rev=773494&view=rev
Log:
initial commit of Runtime Explorer contributed by Adam Pilkington

Added:
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.classpath   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.project   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/org.eclipse.jdt.core.prefs   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/MANIFEST.MF   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/build.properties   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/contexts.xml   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/icons/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/icons/sample.gif   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/plugin.xml   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/Activator.java   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/RTEDataException.java   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/ViewRuntimeAction.java   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/LazyNode.java   (with props)
    incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/RuntimeExplorer.java   (with props)

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.classpath
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.classpath?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.classpath (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.classpath Mon May 11 07:55:57 2009
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.classpath
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.project
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.project?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.project (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.project Mon May 11 07:55:57 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.apache.kato.tools.plugins.rtexplorer</name>
+	<comment></comment>
+	<projects>
+	</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.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.project
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/org.eclipse.jdt.core.prefs?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/org.eclipse.jdt.core.prefs Mon May 11 07:55:57 2009
@@ -0,0 +1,7 @@
+#Sun May 03 20:10:11 BST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/MANIFEST.MF?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/MANIFEST.MF (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/MANIFEST.MF Mon May 11 07:55:57 2009
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Kato_Plugins_Runtime_Explorer Plug-in
+Bundle-SymbolicName: org.apache.kato.tools.plugins.rtexplorer;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.apache.kato.tools.plugins.rtexplorer.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ KatoHProfAdapterPOC;bundle-version="1.0.0",
+ org.apache.kato.api;bundle-version="1.3.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: 
+ .

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/build.properties
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/build.properties?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/build.properties (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/build.properties Mon May 11 07:55:57 2009
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               icons/,\
+               contexts.xml

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/contexts.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/contexts.xml?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/contexts.xml (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/contexts.xml Mon May 11 07:55:57 2009
@@ -0,0 +1,12 @@
+<contexts>
+	<context id="viewer" title="Sample View">
+		<description>This is the context help for the sample view with a tree viewer. It was generated by a PDE template.</description>
+		<topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
+			<enablement>
+				<with variable="platform">
+	            	<test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
+	     		</with>
+			</enablement>
+		</topic>
+	</context>
+</contexts>

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/contexts.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/icons/sample.gif
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/icons/sample.gif?rev=773494&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/icons/sample.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/plugin.xml?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/plugin.xml (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/plugin.xml Mon May 11 07:55:57 2009
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.ui.views">
+      <category
+            name="Kato Tools"
+            id="KatoTools">
+      </category>
+      <view
+            name="Apache Kato Runtime Explorer"
+            icon="icons/sample.gif"
+            category="KatoTools"
+            class="org.apache.kato.tools.plugins.rtexplorer.views.RuntimeExplorer"
+            id="org.apache.kato.tools.plugins.rtexplorer.views.RuntimeExplorer">
+      </view>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="org.eclipse.jdt.ui.JavaPerspective">
+         <view
+               ratio="0.5"
+               relative="org.eclipse.ui.views.TaskList"
+               relationship="right"
+               id="org.apache.kato.tools.plugins.rtexplorer.views.RuntimeExplorer">
+         </view>
+      </perspectiveExtension>
+   </extension>
+   <extension
+         point="org.eclipse.help.contexts">
+      <contexts
+            file="contexts.xml">
+      </contexts>
+   </extension>
+   <extension
+         point="org.eclipse.ui.popupMenus">
+      <objectContribution
+            id="Kato_Plugins_Runtime_Explorer.contribution1"
+            objectClass="org.eclipse.core.resources.IFile">
+         <menu
+               id="Kato_Plugins_Runtime_Explorer.menu1"
+               label="Apache Kato"
+               path="additions">
+            <separator
+                  name="group1">
+            </separator>
+         </menu>
+         <action
+               class="org.apache.kato.tools.plugins.rtexplorer.actions.ViewRuntimeAction"
+               enablesFor="1"
+               id="Kato_Plugins_Runtime_Explorer.newAction"
+               label="View in Runtime Explorer"
+               menubarPath="Kato_Plugins_Runtime_Explorer.menu1/group1">
+         </action>
+      </objectContribution>
+   </extension>
+
+</plugin>

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/Activator.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/Activator.java?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/Activator.java (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/Activator.java Mon May 11 07:55:57 2009
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tools.plugins.rtexplorer;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "Kato_Plugins_Runtime_Explorer";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/Activator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/RTEDataException.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/RTEDataException.java?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/RTEDataException.java (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/RTEDataException.java Mon May 11 07:55:57 2009
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tools.plugins.rtexplorer;
+
+public class RTEDataException extends RuntimeException {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -195004880819773897L;
+
+	public RTEDataException() {
+		super();
+	}
+
+	public RTEDataException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public RTEDataException(String message) {
+		super(message);
+	}
+
+	public RTEDataException(Throwable cause) {
+		super(cause);
+	}
+
+}

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/RTEDataException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/ViewRuntimeAction.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/ViewRuntimeAction.java?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/ViewRuntimeAction.java (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/ViewRuntimeAction.java Mon May 11 07:55:57 2009
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tools.plugins.rtexplorer.actions;
+
+
+import org.apache.kato.tools.plugins.rtexplorer.views.RuntimeExplorer;
+import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+public class ViewRuntimeAction implements IObjectActionDelegate {
+
+	private Shell shell;
+	private IWorkbenchPart part = null;
+	private IFile file = null; 				//currently selected file
+	
+	/**
+	 * Constructor for Action1.
+	 */
+	public ViewRuntimeAction() {
+		super();
+	}
+
+	/**
+	 * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+	 */
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		shell = targetPart.getSite().getShell();
+		part = targetPart;
+	}
+
+	/**
+	 * @see IActionDelegate#run(IAction)
+	 */
+	public void run(IAction action) {
+		try {
+			IViewPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.apache.kato.tools.plugins.rtexplorer.views.RuntimeExplorer");
+			RuntimeExplorer explorer = (RuntimeExplorer) part;
+			explorer.openFile(file);
+		} catch (Exception e) {
+			showMessage("Could not display Runtime Explorer view : " + e.getMessage());
+		}
+	}
+
+	private void showMessage(String message) {
+		MessageDialog.openInformation(shell, "Apache Kato Runtime Explorer", message);
+	}
+	
+	/**
+	 * @see IActionDelegate#selectionChanged(IAction, ISelection)
+	 */
+	public void selectionChanged(IAction action, ISelection selection) {
+		if(selection instanceof ITreeSelection) {
+			ITreeSelection tselection = (ITreeSelection) selection;
+			IAdaptable firstElement = (IAdaptable) tselection.getFirstElement();
+			IFile file = (IFile) firstElement.getAdapter(IFile.class);
+			if (file != null && file.isAccessible()) {
+			    this.file = file;
+			}
+
+		}
+	}
+
+}

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/actions/ViewRuntimeAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/LazyNode.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/LazyNode.java?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/LazyNode.java (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/LazyNode.java Mon May 11 07:55:57 2009
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tools.plugins.rtexplorer.views;
+
+import java.lang.reflect.Method;
+
+public class LazyNode {
+	private Object item;
+	private Method method;
+	
+	public LazyNode(Object item, Method method) {
+		super();
+		this.item = item;
+		this.method = method;
+	}
+
+	public Object getItem() {
+		return item;
+	}
+
+	public void setItem(Object item) {
+		this.item = item;
+	}
+
+	public Method getMethod() {
+		return method;
+	}
+
+	public void setMethod(Method method) {
+		this.method = method;
+	}
+	
+	
+}

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/LazyNode.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/RuntimeExplorer.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/RuntimeExplorer.java?rev=773494&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/RuntimeExplorer.java (added)
+++ incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/RuntimeExplorer.java Mon May 11 07:55:57 2009
@@ -0,0 +1,642 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tools.plugins.rtexplorer.views;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.apache.kato.hprof.image.ImageFactoryImpl;
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.ImageFactory;
+import org.apache.kato.tools.plugins.rtexplorer.Activator;
+import org.apache.kato.tools.plugins.rtexplorer.RTEDataException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ITreeViewerListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeExpansionEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.DrillDownAdapter;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+/**
+ * This sample class demonstrates how to plug-in a new
+ * workbench view. The view shows data obtained from the
+ * model. The sample creates a dummy model on the fly,
+ * but a real implementation would connect to the model
+ * available either in this or another plug-in (e.g. the workspace).
+ * The view is connected to the model using a content provider.
+ * <p>
+ * The view uses a label provider to define how model
+ * objects should be presented in the view. Each
+ * view can present the same model objects using
+ * different labels and icons, if needed. Alternatively,
+ * a single label provider can be shared between views
+ * in order to ensure that objects of the same type are
+ * presented in the same way everywhere.
+ * <p>
+ */
+
+public class RuntimeExplorer extends ViewPart {
+	private TreeViewer viewer;
+	private DrillDownAdapter drillDownAdapter;
+	private Action action1;
+	private Action action2;
+	private Action doubleClickAction;
+	private ViewContentProvider contentProvider = new ViewContentProvider();
+	private HashMap<TreeParent, LazyNode> lazyNodes = new HashMap<TreeParent, LazyNode>();
+	private ISelectionListener selectionListener = null;
+	private File dataFile = null;		//file currently being viewed
+	private final String saveFileName = "rte.dat";
+
+	/*
+	 * The content provider class is responsible for
+	 * providing objects to the view. It can wrap
+	 * existing objects in adapters or simply return
+	 * objects as-is. These objects may be sensitive
+	 * to the current input of the view, or ignore
+	 * it and always show the same content 
+	 * (like Task List, for example).
+	 */
+	 
+	class TreeObject implements IAdaptable {
+		private String name;
+		private TreeParent parent;
+		
+		public TreeObject(String name) {
+			this.name = name;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setParent(TreeParent parent) {
+			this.parent = parent;
+		}
+		public TreeParent getParent() {
+			return parent;
+		}
+		public String toString() {
+			return getName();
+		}
+		public Object getAdapter(Class key) {
+			return null;
+		}
+	}
+	
+	class TreeParent extends TreeObject {
+		private ArrayList children;
+		public TreeParent(String name) {
+			super(name);
+			children = new ArrayList();
+		}
+		public void addChild(TreeObject child) {
+			children.add(child);
+			child.setParent(this);
+		}
+		public void removeChild(TreeObject child) {
+			children.remove(child);
+			child.setParent(null);
+		}
+		public TreeObject [] getChildren() {
+			return (TreeObject [])children.toArray(new TreeObject[children.size()]);
+		}
+		public boolean hasChildren() {
+			return children.size()>0;
+		}
+	}
+
+	class ViewContentProvider implements IStructuredContentProvider, 
+										   ITreeContentProvider, ITreeViewerListener {
+		private TreeParent invisibleRoot;
+		private HashSet<String> containerNames = new HashSet<String>();
+		private HashSet<String> primitiveNames = new HashSet<String>();
+		private TreeObject nodeDataNotLoaded = new TreeObject("");
+		private Viewer viewer = null;	
+		private File dump = null;
+
+		public ViewContentProvider() {
+			containerNames.add(Iterator.class.getName());
+			primitiveNames.add(Long.class.getName());
+			primitiveNames.add(Integer.class.getName());
+			primitiveNames.add(String.class.getName());
+			primitiveNames.add(Short.class.getName());
+			primitiveNames.add(Float.class.getName());
+			primitiveNames.add(Double.class.getName());
+			primitiveNames.add("long");
+			primitiveNames.add("int");
+			primitiveNames.add("boolean");
+			primitiveNames.add("float");
+			primitiveNames.add("short");
+			primitiveNames.add("double");
+		}
+		
+		public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+			if(viewer == null) {
+				viewer = v;			//cache reference to viewer
+			}
+			if((newInput != null) && (newInput instanceof File)) {
+				invisibleRoot = null;
+				dump = (File)newInput;
+				return;
+			}
+			if((newInput != null) && (newInput instanceof String)) {	//assumes that the string is the full path
+				invisibleRoot = null;
+				dump = new File((String)newInput);
+				return;
+			}
+		}
+		
+		public void dispose() {
+		}
+		
+		public Object[] getElements(Object parent) {
+//			if (parent.equals(getViewSite())) {
+//				if (invisibleRoot==null) getRuntime();
+//				return getChildren(invisibleRoot);
+//			}
+			if (invisibleRoot==null) {
+				getRuntime();
+				return getChildren(invisibleRoot);
+			}
+			return getChildren(parent);
+		}
+		public Object getParent(Object child) {
+			if (child instanceof TreeObject) {
+				return ((TreeObject)child).getParent();
+			}
+			return null;
+		}
+		public Object [] getChildren(Object obj) {
+			if (obj instanceof TreeParent) {
+				TreeParent parent = (TreeParent)obj;
+				loadDataForLazyNodes(parent);
+				return parent.getChildren();
+			}
+			return new Object[0];
+		}
+		
+		public void loadDataForLazyNodes(TreeParent parent) {
+			try {
+				if(parent.hasChildren()) {
+					TreeObject child = parent.getChildren()[0];
+					if(child == nodeDataNotLoaded) {
+						parent.removeChild(child);
+						if(lazyNodes.containsKey(parent)) {
+							LazyNode node = lazyNodes.get(parent);
+							if(node.getMethod().getReturnType() == Iterator.class) {
+								Iterator i = (Iterator) node.getMethod().invoke(node.getItem(), (Object[]) null);
+								createNodeFromIterator(parent, i);
+								return;
+							}
+							Object obj = node.getMethod().invoke(node.getItem(), (Object[]) null);
+							Class iface = getKatoInterface(obj.getClass());
+							createNodeFromItem(parent, iface, obj);
+						}
+					}
+				}
+			} catch (Exception e) {
+				throw new RTEDataException("Could not expand node ", e);
+			}
+		}
+		
+		public boolean hasChildren(Object parent) {
+			if (parent instanceof TreeParent)
+				return ((TreeParent)parent).hasChildren();
+			return false;
+		}
+		
+		//get the runtime
+		private void getRuntime() {
+			ImageFactory factory = new ImageFactoryImpl();	//this will need to be replaced with the correct factory implementation
+			if(dump.exists()) {
+				try {
+					org.apache.kato.image.Image image = factory.getImage(dump);
+					TreeParent root = createNodeFromItem(dump.getName(), org.apache.kato.image.Image.class, image);
+					invisibleRoot = new TreeParent("");
+					invisibleRoot.addChild(root);
+				} catch (IOException e) {
+					showMessage("Error getting ImageFactory : " + e.getMessage());
+					e.printStackTrace();
+				}
+			} else {
+				showMessage("File " + dump.getAbsolutePath() + " does not exist");
+			}
+		}
+
+		private void createNodeFromIterator(TreeParent parent, Iterator i) {
+			try {
+				Class iface = null;
+				for(;i.hasNext();) {
+					Object obj = i.next();
+					if(iface == null) {
+						iface = getKatoInterface(obj.getClass());
+					}
+					TreeParent itemParent = createNodeFromItem(obj.toString(), iface, obj);
+					parent.addChild(itemParent);
+				}
+			} catch (Exception e) {
+				throw new RTEDataException("Could not add node", e);
+			}
+		}
+
+		private Class getKatoInterface(Class clazz) {
+			Class[] ifaces = clazz.getInterfaces();
+			for(int i = 0; i < ifaces.length; i++) {
+				if(ifaces[i].getName().startsWith("org.apache.kato")) {
+					return ifaces[i];
+				}
+			}
+			if(clazz.getSuperclass() != null) {
+				return getKatoInterface(clazz.getSuperclass());
+			}
+			throw new RTEDataException("Could not find kato interface for " + clazz.getName());
+		}
+		
+		private TreeParent createNodeFromItem(String name, Class iface, Object item) {
+			TreeParent parent = new TreeParent(name);
+			createNodeFromItem(parent, iface, item);
+			return parent;
+		}
+		
+		private void createNodeFromItem(TreeParent parent, Class iface, Object item) {
+			Method[] methods = iface.getMethods();
+			for(int j = 0; j < methods.length; j++) {
+				if(methods[j].getParameterTypes().length == 0) {
+					String nodeName = getDisplayName(methods[j].getName());
+					if(isPrimitive(methods[j].getReturnType())) {
+						Object data = null;
+						if(methods[j].getParameterTypes().length == 0) {
+							data = getItemData(item, methods[j].getName(), null);
+						} else {
+							data = "";
+						}
+						TreeObject tobj = new TreeObject(nodeName + " : " + data.toString());
+						parent.addChild(tobj);	
+					} else {
+						TreeParent container = new TreeParent(nodeName);
+						container.addChild(nodeDataNotLoaded);		//add special marker node to indicate that the underlying data has not been loaded yet
+						lazyNodes.put(container, new LazyNode(item, methods[j]));
+						parent.addChild(container);
+					}
+				} else {
+					//TODO methods which take parameters should be added to the popup menu so that they can be invoked by the user
+				}
+			}
+		}
+		
+		private String getDisplayName(String rawName) {
+			StringBuffer displayName = new StringBuffer();
+			int state = 0;
+			for(int i = 0; i < rawName.length(); i++) {
+				switch(state) {
+					case 0:
+						if(Character.isUpperCase(rawName.charAt(i))) {
+							state = 1;
+							displayName.append(rawName.charAt(i));
+						}
+						break;
+					case 1:
+						if(Character.isUpperCase(rawName.charAt(i))) {
+							if(i < (rawName.length() - 1)) {
+								if(Character.isLowerCase(rawName.charAt(i+1))) {
+									displayName.append(" ");
+								}
+							} else {
+								displayName.append(" ");
+							}
+						}
+						displayName.append(rawName.charAt(i));
+				}
+
+			}
+			return displayName.toString();
+		}
+		
+		private boolean isContainer(Class clazz) {
+			if(containerNames.contains(clazz.getName())) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+		
+		private boolean isPrimitive(Class clazz) {
+			if(primitiveNames.contains(clazz.getName())) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+		
+		private Method findMethod(Class clazz, String methodName, Object[] types) {
+			Method[] methods = clazz.getMethods();
+			for(int i = 0; i < methods.length; i++) {
+				if(methods[i].getName().equals(methodName)) {
+					if((methods[i].getParameterTypes().length == 0) && (types == null)) {
+						return methods[i];
+					}
+					if((methods[i].getParameterTypes().length == 0) && (types.length == 0)) {
+						return methods[i];
+					}
+					Class[] params = methods[i].getParameterTypes();
+					boolean match = true;
+					for(int j = 0; j < params.length; j++) {
+						if(!params[j].isInstance(types[j])) {
+							match = false;
+							break;
+						}
+					}
+					if(match) {
+						return methods[i];
+					}
+				}
+			}
+			if(clazz.getSuperclass() == null) {
+				throw new RTEDataException("Could not find method " + methodName);
+			} else {
+				return findMethod(clazz.getSuperclass(), methodName, types);
+			}
+		}
+		
+		private Object getItemData(Object item, String methodName, Object[] parameters) {
+			try {
+				Class[] types = null;
+				if(parameters != null) {
+					types = new Class[parameters.length];
+				}
+				Method method = item.getClass().getMethod(methodName, types);
+				//Method method = findMethod(item.getClass(), methodName, types);
+				try {
+					Object result = method.invoke(item, parameters);
+					if(result == null) {
+						return "<null>";
+					}
+					return result;				
+				} catch (InvocationTargetException e) {
+					if(e.getCause() instanceof CorruptDataException) {
+						return "Corrupt data";
+					}
+					if(e.getCause() instanceof DataUnavailable) {
+						return "Data unavailable";
+					}
+					throw new RTEDataException("Could not read data for " + methodName, e);
+				}
+			} catch (Exception e) {
+				throw new RTEDataException("Could not read data for " + methodName, e);
+			}
+		}
+
+		public void treeCollapsed(TreeExpansionEvent arg0) {
+			// NOOP
+		}
+		
+		public void treeExpanded(TreeExpansionEvent event) {
+			try {
+				TreeParent parent = (TreeParent) event.getElement();
+				if(parent.hasChildren()) {
+					TreeObject child = parent.getChildren()[0];
+					if(child == nodeDataNotLoaded) {
+						parent.removeChild(child);
+						if(lazyNodes.containsKey(parent)) {
+							LazyNode node = lazyNodes.get(parent);
+							if(node.getMethod().getReturnType() == Iterator.class) {
+								Iterator i = (Iterator) node.getMethod().invoke(node.getItem(), (Object[]) null);
+								createNodeFromIterator(parent, i);
+							}
+						}
+					}
+				}
+			} catch (Exception e) {
+				throw new RTEDataException("Could not expand node ", e);
+			}
+		}
+		
+		
+	}
+	class ViewLabelProvider extends LabelProvider {
+
+		public String getText(Object obj) {
+			return obj.toString();
+		}
+		public Image getImage(Object obj) {
+			String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
+			if (obj instanceof TreeParent)
+			   imageKey = ISharedImages.IMG_OBJ_FOLDER;
+			return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
+		}
+	}
+	class NameSorter extends ViewerSorter {
+	}
+
+	/**
+	 * The constructor.
+	 */
+	public RuntimeExplorer() {
+		int a=1;
+		System.out.println("in RT");
+	}
+
+	/**
+	 * This is a callback that will allow us
+	 * to create the viewer and initialize it.
+	 */
+	public void createPartControl(Composite parent) {
+		viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+		drillDownAdapter = new DrillDownAdapter(viewer);
+		viewer.setContentProvider(contentProvider);
+		viewer.setLabelProvider(new ViewLabelProvider());
+		viewer.setSorter(new NameSorter());
+		//viewer.setInput(getViewSite());
+
+		// Create the help context id for the viewer's control
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "Kato_Plugins_Runtime_Explorer.viewer");
+		makeActions();
+		hookContextMenu();
+		hookDoubleClickAction();
+		contributeToActionBars();
+		loadState();
+	}
+	
+	private void hookContextMenu() {
+		MenuManager menuMgr = new MenuManager("#PopupMenu");
+		menuMgr.setRemoveAllWhenShown(true);
+		menuMgr.addMenuListener(new IMenuListener() {
+			public void menuAboutToShow(IMenuManager manager) {
+				RuntimeExplorer.this.fillContextMenu(manager);
+			}
+		});
+		Menu menu = menuMgr.createContextMenu(viewer.getControl());
+		viewer.getControl().setMenu(menu);
+		getSite().registerContextMenu(menuMgr, viewer);
+	}
+
+	private void contributeToActionBars() {
+		IActionBars bars = getViewSite().getActionBars();
+		fillLocalPullDown(bars.getMenuManager());
+		fillLocalToolBar(bars.getToolBarManager());
+	}
+
+	private void fillLocalPullDown(IMenuManager manager) {
+		manager.add(action1);
+		manager.add(new Separator());
+		manager.add(action2);
+	}
+
+	private void fillContextMenu(IMenuManager manager) {
+		manager.add(action1);
+		manager.add(action2);
+		manager.add(new Separator());
+		drillDownAdapter.addNavigationActions(manager);
+		// Other plug-ins can contribute there actions here
+		manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+	}
+	
+	private void fillLocalToolBar(IToolBarManager manager) {
+		manager.add(action1);
+		manager.add(action2);
+		manager.add(new Separator());
+		drillDownAdapter.addNavigationActions(manager);
+	}
+
+	private void makeActions() {
+		action1 = new Action() {
+			public void run() {
+				showMessage("Action 1 executed");
+			}
+		};
+		action1.setText("Action 1");
+		action1.setToolTipText("Action 1 tooltip");
+		action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+			getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+		
+		action2 = new Action() {
+			public void run() {
+				showMessage("Action 2 executed");
+			}
+		};
+		action2.setText("Action 2");
+		action2.setToolTipText("Action 2 tooltip");
+		action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+				getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+		doubleClickAction = new Action() {
+			public void run() {
+				ISelection selection = viewer.getSelection();
+				Object obj = ((IStructuredSelection)selection).getFirstElement();
+				showMessage("Double-click detected on "+obj.toString());
+			}
+		};
+	}
+
+	private void hookDoubleClickAction() {
+		viewer.addDoubleClickListener(new IDoubleClickListener() {
+			public void doubleClick(DoubleClickEvent event) {
+				doubleClickAction.run();
+			}
+		});
+	}
+	
+	private void showMessage(String message) {
+		MessageDialog.openInformation(
+			viewer.getControl().getShell(),
+			"Apache Kato Runtime Explorer",
+			message);
+	}
+
+	/**
+	 * Passing the focus request to the viewer's control.
+	 */
+	public void setFocus() {
+		viewer.getControl().setFocus();
+	}
+	
+	public void openFile(IFile file) {
+		dataFile = file.getLocation().toFile();
+		viewer.setInput(dataFile);
+	}
+
+	private void saveState() {
+		if(dataFile == null) return;		//nothing to save
+		try {
+			File file = Activator.getDefault().getStateLocation().append(saveFileName).toFile();
+			if(file.exists()) file.delete();
+			FileOutputStream out = new FileOutputStream(file);
+			out.write(dataFile.getAbsolutePath().getBytes());
+			out.close();
+		} catch (Exception e) {
+			showMessage("Error saving file " + e.getMessage());
+			e.printStackTrace();
+		}
+	}
+	
+	private void loadState() {
+		try {
+			File file = Activator.getDefault().getStateLocation().append(saveFileName).toFile();
+			if(file.exists()) {
+				FileInputStream in = new FileInputStream(file);
+				byte[] buffer = new byte[(int)file.length()];
+				in.read(buffer);
+				in.close();
+				dataFile = new File(new String(buffer));
+				viewer.setInput(dataFile);
+			}
+		} catch (Exception e) {
+			showMessage("Error saving file " + e.getMessage());
+			e.printStackTrace();
+		}
+	}
+	
+	@Override
+	public void saveState(IMemento memento) {
+		super.saveState(memento);
+		saveState();
+	}
+	
+	
+}
\ No newline at end of file

Propchange: incubator/kato/trunk/org.apache.kato.tools.plugins.rtexplorer/src/org/apache/kato/tools/plugins/rtexplorer/views/RuntimeExplorer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain