aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Fantato2009-01-29 11:50:54 (EST)
committerFabio Fantato2009-01-29 11:50:54 (EST)
commit269db0c940e33c459e66926db3fcee4a4ea8e825 (patch)
tree0296ff530dffda5c3ce0f7924a5280c15c0c06c6
parentaf27d689e0acd26c560b5e2fe0fe829fe82165db (diff)
downloadorg.eclipse.linuxtools-269db0c940e33c459e66926db3fcee4a4ea8e825.zip
org.eclipse.linuxtools-269db0c940e33c459e66926db3fcee4a4ea8e825.tar.gz
org.eclipse.linuxtools-269db0c940e33c459e66926db3fcee4a4ea8e825.tar.bz2
fixing build scripts
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/.project17
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/META-INF/MANIFEST.MF15
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/build.properties4
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/plugin.xml6
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/capabilities.exsd148
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/protocols.exsd218
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConnectionProvider.java74
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConstants.java44
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/AbstractNotifier.java66
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/IListener.java31
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/INotifier.java51
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/ITool.java74
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogConnect.java184
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogLogin.java127
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/IToolViewPart.java25
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.java40
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.properties31
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages_pt.properties31
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionConnect.java52
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionDisconnect.java53
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionPause.java55
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRefresh.java55
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRun.java55
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/Extensions.java84
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/ProtocolDescriptor.java48
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/.project2
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/META-INF/MANIFEST.MF22
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/build.properties4
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.properties2
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.xml20
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin_pt.properties27
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/LinuxToolsPlugin.java85
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.java33
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.properties21
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages_pt.properties21
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFProvider.java140
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFWrapper.java100
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetProvider.java194
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetWrapper.java237
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadProcessor.java280
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadTool.java208
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadView.java336
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewContentProvider.java61
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewLabelProvider.java54
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/DialogOptions.java109
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.java49
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.properties38
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages_pt.properties38
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/ViewActionOptions.java60
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapProcessor.java139
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapTool.java184
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapVViewLabelProvider.java59
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapView.java290
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapViewContentProvider.java60
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.java40
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.properties27
-rw-r--r--proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages_pt.properties27
57 files changed, 4332 insertions, 223 deletions
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/.project b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/.project
index e7728b1..c4fe3e5 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/.project
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/.project
@@ -5,7 +5,24 @@
<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>
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/META-INF/MANIFEST.MF b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/META-INF/MANIFEST.MF
index f91aaf9..ecdfabf 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/META-INF/MANIFEST.MF
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/META-INF/MANIFEST.MF
@@ -1,16 +1,15 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.sequoyah.device.linuxtools.base;singleton:=true
-Bundle-Version: 0.1.0.qualifier
+Bundle-SymbolicName: org.eclipse.tml.linuxtools.base;singleton:=true
+Bundle-Version: 0.1.0
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Export-Package: org.eclipse.sequoyah.device.linuxtools.network,
- org.eclipse.sequoyah.device.linuxtools.tools,
- org.eclipse.sequoyah.device.linuxtools.ui,
- org.eclipse.sequoyah.device.linuxtools.utilities
-Require-Bundle: org.eclipse.sequoyah.device.common.utilities,
+Export-Package: org.eclipse.tml.linuxtools.network,
+ org.eclipse.tml.linuxtools.tools,
+ org.eclipse.tml.linuxtools.ui,
+ org.eclipse.tml.linuxtools.utilities
+Require-Bundle: org.eclipse.tml.common.utilities;bundle-version="0.2.0",
org.eclipse.ui,
org.eclipse.core.runtime
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/build.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/build.properties
index a092d25..e522427 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/build.properties
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/build.properties
@@ -2,7 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
- .,\
- plugin.properties,\
- schema/
+ .
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/plugin.xml b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/plugin.xml
index 0874964..3cecbff 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/plugin.xml
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/plugin.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
-<extension-point id="org.eclipse.sequoyah.device.linuxtools.base.protocols" name="Linux Tools protocols" schema="schema/protocols.exsd" />
-<extension-point id="org.eclipse.sequoyah.device.linuxtools.base.capabilities" name="Linux Tools capabilities" schema="schema/capabilities.exsd"/>
+<extension-point id="org.eclipse.tml.linuxtools.base.protocols" name="Linux Tools protocols" schema="schema/protocols.exsd" />
+<extension-point id="org.eclipse.tml.linuxtools.base.capabilities" name="Linux Tools capabilities" schema="schema/capabilities.exsd"/>
<extension
- point="org.eclipse.sequoyah.device.linuxtools.base.capabilities">
+ point="org.eclipse.tml.linuxtools.base.capabilities">
<capability
id="GET_FILE"
name="Get file"/>
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/capabilities.exsd b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/capabilities.exsd
index 7a5e14c..a26decf 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/capabilities.exsd
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/capabilities.exsd
@@ -1,74 +1,74 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.sequoyah.device.linuxtools.base" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.sequoyah.device.linuxtools.base" id="org.eclipse.sequoyah.device.linuxtools.base.capabilities" name="Linux tools capabilities"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="capability" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="capability">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tml.linuxtools.base" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tml.linuxtools.base" id="org.eclipse.tml.linuxtools.base.capabilities" name="Linux tools capabilities"/>
+ </appinfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="capability" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="capability">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+
+
+
+
+
+</schema>
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/protocols.exsd b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/protocols.exsd
index 369d980..70a571d 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/protocols.exsd
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/schema/protocols.exsd
@@ -1,109 +1,109 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.sequoyah.device.linuxtools.base" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.sequoyah.device.linuxtools.base" id="org.eclipse.sequoyah.device.linuxtools.base.protocols" name="Linux Tools protocols"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="protocol" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="protocol">
- <complexType>
- <sequence>
- <element ref="capability" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.sequoyah.device.linuxtools.network.IConnectionProvider"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="default_port" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="capability">
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.tml.linuxtools.base.capabilities/capability/@id"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tml.linuxtools.base" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tml.linuxtools.base" id="org.eclipse.tml.linuxtools.base.protocols" name="Linux Tools protocols"/>
+ </appinfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="protocol" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="protocol">
+ <complexType>
+ <sequence>
+ <element ref="capability" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.tml.linuxtools.network.IConnectionProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="default_port" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="capability">
+ <complexType>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.tml.linuxtools.base.capabilities/capability/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+
+
+
+
+
+</schema>
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConnectionProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConnectionProvider.java
new file mode 100644
index 0000000..481c7bf
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConnectionProvider.java
@@ -0,0 +1,74 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.network;
+
+import java.io.IOException;
+
+import org.eclipse.tml.linuxtools.tools.INotifier;
+import org.eclipse.tml.linuxtools.network.IConstants.CommandCode;;
+
+/**
+ * @author Otávio Ferranti
+ */
+public interface IConnectionProvider extends INotifier{
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ * @param host
+ * @param port
+ * @throws IOException
+ */
+ public void connect(String host, int port) throws IOException ;
+
+ /**
+ * @throws IOException
+ */
+ public void disconnect() throws IOException ;
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ * @param user
+ * @param password
+ * @throws IOException
+ */
+ public void login(String user, String password) throws IOException ;
+
+ /**
+ * Retrieves the last response.
+ * @return
+ */
+ public StringBuffer getLastResponde() ;
+
+ /**
+ * Sends a command to be executed and waits for the results.
+ * @param command
+ * @throws IOException
+ */
+ public void sendCommand(CommandCode cmd, String cmdStr) throws IOException ;
+
+ /**
+ * Sends some command or data without waiting any response or result.
+ * @param out
+ */
+ public void sendData(String out) ;
+
+ /**
+ * Sets the maximum response length.
+ * @param maxLength
+ */
+ public void setResponseLength(int maxLength) ;
+
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConstants.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConstants.java
new file mode 100644
index 0000000..f1ceccc
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/network/IConstants.java
@@ -0,0 +1,44 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.network;
+
+/**
+ * @author Otávio Ferranti
+ */
+public interface IConstants {
+
+ public enum EventCode { EVT_PROVIDER_CONNECT_FINISHED,
+ EVT_PROVIDER_CONNECT_ERROR,
+ EVT_PROVIDER_LOGIN_FINISHED,
+ EVT_PROVIDER_LOGIN_ERROR,
+ EVT_PROVIDER_SENDCOMMAND_FINISHED,
+ EVT_PROVIDER_SENDCOMMAND_ERROR,
+ EVT_PROVIDER_SENDDATA_FINISHED,
+ EVT_PROVIDER_SENDDATA_ERROR,
+ EVT_PROVIDER_DISCONNECT_FINISHED,
+ EVT_PROCESSOR_GATHERDATA_FINISHED,
+ EVT_PROCESSOR_GATHERDATA_ERROR,
+ EVT_TOOL_REFRESH_VIEW,
+ EVT_TOOL_CONNECT_FINISHED,
+ EVT_TOOL_LOGIN_FINISHED,
+ EVT_TOOL_DISCONNECT_FINISHED };
+
+ public enum OperationCode { SUCCESS,
+ LOGIN_REQUIRED,
+ LOGIN_FAILED,
+ UNEXPECTED_RESULT };
+
+ public enum CommandCode { FETCH_FILE };
+
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/AbstractNotifier.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/AbstractNotifier.java
new file mode 100644
index 0000000..6394080
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/AbstractNotifier.java
@@ -0,0 +1,66 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class AbstractNotifier implements INotifier{
+
+ private ArrayList<IListener> listeners = new ArrayList<IListener>();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#addListener(org.eclipse.tml.linuxmemorymapviewer.network.IListener)
+ */
+ public void addListener(IListener listener) {
+ if (null != listener) {
+ listeners.add(listener);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.INotifier#listeners()
+ */
+ public List<IListener> listeners() {
+ return listeners;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#notifyListeners(org.eclipse.tml.linuxmemorymapviewer.network.IConnectionConstants.EventCode, java.lang.Object)
+ */
+ public void notifyListeners(EventCode event, Object result) {
+ for (IListener listener:listeners){
+ listener.notify(this, event, result);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.INotifier#removeAllListeners()
+ */
+ public void removeAllListeners() {
+ listeners.clear();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.INotifier#removeListener(org.eclipse.tml.linuxtools.tools.IListener)
+ */
+ public void removeListener(IListener listener) {
+ listeners.remove(listener);
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/IListener.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/IListener.java
new file mode 100644
index 0000000..ecc9560
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/IListener.java
@@ -0,0 +1,31 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools;
+
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+
+/**
+ * @author Otávio Ferranti
+ */
+public interface IListener {
+
+ /**
+ * @param notifier
+ * @param event
+ * @param result
+ */
+ public void notify (INotifier notifier,
+ EventCode event,
+ Object result);
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/INotifier.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/INotifier.java
new file mode 100644
index 0000000..a3cbfbd
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/INotifier.java
@@ -0,0 +1,51 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools;
+
+import java.util.List;
+
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+
+/**
+ * @author Otávio Ferranti
+ */
+public interface INotifier {
+
+ /**
+ * @param listener
+ */
+ public void addListener(IListener listener);
+
+ /**
+ * @return
+ */
+ public List<IListener> listeners();
+
+ /**
+ * @param event
+ * @param result
+ */
+ public void notifyListeners (EventCode event, Object result);
+
+ /**
+ *
+ */
+ public void removeAllListeners ();
+
+ /**
+ * @param listener
+ */
+ public void removeListener (IListener listener);
+
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/ITool.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/ITool.java
new file mode 100644
index 0000000..355c239
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/tools/ITool.java
@@ -0,0 +1,74 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools;
+
+import java.util.List;
+
+import org.eclipse.tml.linuxtools.utilities.ProtocolDescriptor;
+
+/**
+ * @author Otávio Ferranti
+ */
+public interface ITool extends INotifier {
+
+ /**
+ *
+ */
+ public void disconnect();
+
+ /**
+ * @param host
+ * @param port
+ * @param protocol
+ * @param viewer
+ */
+ public void connect(String host, int port, ProtocolDescriptor protocol);
+
+ /**
+ * @param user
+ * @param password
+ */
+ public void login(String user, String password);
+
+ /**
+ *
+ */
+ public List<ProtocolDescriptor> getProtocolsDescriptors();
+
+ /**
+ * @param delay
+ */
+ public int getRefreshDelay();
+
+ /**
+ *
+ */
+ public void refresh();
+
+ /**
+ * @param delay
+ */
+ public void setRefreshDelay(int delay);
+
+ /**
+ *
+ */
+ public void start();
+
+ /**
+ *
+ */
+ public void stop ();
+
+} \ No newline at end of file
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogConnect.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogConnect.java
new file mode 100644
index 0000000..d48bb3b
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogConnect.java
@@ -0,0 +1,184 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+import org.eclipse.tml.linuxtools.utilities.ProtocolDescriptor;
+
+
+/**
+ * @author Otávio Ferranti
+ */
+public class DialogConnect extends TitleAreaDialog {
+
+ final private String WINDOW_TITLE = Messages.OpenConnectionDialog_Window_Title;
+ final private String WINDOW_MESSAGE = Messages.OpenConnectionDialog_Window_Message;
+ final private String LABEL_HOST = Messages.OpenConnectionDialog_Label_Host;
+ final private String LABEL_PORT = Messages.OpenConnectionDialog_Label_Port;
+ final private String LABEL_PROTOCOL = Messages.OpenConnectionDialog_Label_Protocol;
+
+ private Text hostText;
+ private Text portText;
+ private Combo protocolCombo;
+
+ private ITool tool = null;
+
+ private List <ProtocolDescriptor> pdList = null;
+
+ /**
+ * The constructor.
+ * @param parent
+ */
+ public DialogConnect(Shell parent, ITool tool) {
+ super(parent);
+ this.tool = tool;
+ this.pdList = tool.getProtocolsDescriptors();
+ }
+
+ /**
+ *
+ */
+ private int getProtocolDefaultPort(String name) {
+ int retVal = -1;
+ for (ProtocolDescriptor pd : this.pdList) {
+ if(pd.getName().equalsIgnoreCase(name)) {
+ retVal = pd.getDefaultPort();;
+ break;
+ };
+ }
+ return retVal;
+ }
+
+ /**
+ *
+ */
+ private ProtocolDescriptor getProcotolDescriptor(String name) {
+ ProtocolDescriptor retVal = null;
+ for (ProtocolDescriptor pd : this.pdList) {
+ if(pd.getName().equalsIgnoreCase(name)) {
+ retVal = pd;
+ break;
+ };
+ }
+ return retVal;
+ }
+
+ /**
+ *
+ */
+ private String[] getProcotolsNames() {
+ List<String> aux = new LinkedList<String>();
+ for (ProtocolDescriptor pd : this.pdList) {
+ aux.add(pd.getName());
+ }
+ String[] retVal = new String[1];
+ retVal = aux.toArray(retVal);
+ return retVal;
+ }
+
+ /**
+ *
+ */
+ private void updatePortToDefault() {
+ String selection = protocolCombo.getText();
+ int port = this.getProtocolDefaultPort(selection);
+ portText.setText(new Integer(port).toString());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TitleAreaDialog#getInitialSize()
+ */
+ protected Point getInitialSize() {
+ return super.getInitialSize();
+ }
+
+ protected Control createDialogArea(Composite parent) {
+
+ setTitle(WINDOW_TITLE);
+ setMessage(WINDOW_MESSAGE);
+
+ Composite dialogArea = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+
+ gridLayout.marginLeft = 7;
+ gridLayout.marginRight = 7;
+
+ dialogArea.setLayout(gridLayout);
+ dialogArea.setLayoutData(new GridData(GridData.FILL_BOTH));
+ dialogArea.setFont(parent.getFont());
+
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+
+ Label hostLabel = new Label(dialogArea, SWT.NULL);
+ hostLabel.setText(LABEL_HOST);
+ hostText = new Text(dialogArea, SWT.BORDER);
+ hostText.setLayoutData(gridData);
+
+ Label portLabel = new Label(dialogArea, SWT.NULL);
+ portLabel.setText(LABEL_PORT);
+ portText = new Text(dialogArea, SWT.BORDER);
+ portText.setLayoutData(gridData);
+
+ Label protocolLabel = new Label(dialogArea, SWT.NULL);
+ protocolLabel.setText(LABEL_PROTOCOL);
+
+ protocolCombo = new Combo(dialogArea, SWT.READ_ONLY);
+ protocolCombo.setItems(this.getProcotolsNames());
+ protocolCombo.select(0);
+ updatePortToDefault();
+
+ protocolCombo.addListener(SWT.Selection, new Listener () {
+ public void handleEvent(Event e) {
+ updatePortToDefault();
+ }
+ });
+
+ return dialogArea;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ tool.disconnect();
+ tool.connect(hostText.getText(),
+ new Integer(portText.getText()),
+ this.getProcotolDescriptor(protocolCombo.getText()));
+ super.okPressed();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
+ */
+ protected void cancelPressed() {
+ super.cancelPressed();
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogLogin.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogLogin.java
new file mode 100644
index 0000000..ee77f1a
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/DialogLogin.java
@@ -0,0 +1,127 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class DialogLogin extends TitleAreaDialog {
+
+ final private String WINDOW_TITLE = Messages.LoginDialog_Window_Title;
+ final private String WINDOW_MESSAGE = Messages.LoginDialog_Window_Message;
+ final private String WINDOW_MESSAGE_LOGIN_INVALID =
+ Messages.LoginDialog_Msg_Login_Invalid;
+ final private String LABEL_USER = Messages.LoginDialog_Label_User;
+ final private String LABEL_PASSWORD = Messages.LoginDialog_Label_Password;
+
+ private Text userText;
+ private Text passwordText;
+
+ private ITool tool;
+ private boolean login_retry = false;
+
+ /**
+ * The constructor.
+ * @param parentShell
+ * @param tool
+ */
+ public DialogLogin(Shell parentShell, ITool tool) {
+ this(parentShell, tool, false);
+ }
+
+ /**
+ * The other constructor.
+ * @param parentShell
+ * @param tool
+ * @param login_retry
+ */
+ public DialogLogin(Shell parentShell, ITool tool, boolean login_retry) {
+ super(parentShell);
+ this.login_retry = login_retry;
+ this.tool = tool;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ setTitle(WINDOW_TITLE);
+
+ if (login_retry) {
+ setErrorMessage(WINDOW_MESSAGE_LOGIN_INVALID);
+ } else {
+ setMessage(WINDOW_MESSAGE);
+ }
+
+ Composite dialogArea = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+
+ gridLayout.marginLeft = 7;
+ gridLayout.marginRight = 7;
+
+ dialogArea.setLayout(gridLayout);
+ dialogArea.setLayoutData(new GridData(GridData.FILL_BOTH));
+ dialogArea.setFont(parent.getFont());
+
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+
+ Label hostLabel = new Label(dialogArea, SWT.NULL);
+ hostLabel.setText(LABEL_USER);
+ userText = new Text(dialogArea, SWT.BORDER);
+ userText.setLayoutData(gridData);
+
+ Label portLabel = new Label(dialogArea, SWT.NULL);
+ portLabel.setText(LABEL_PASSWORD);
+ passwordText = new Text(dialogArea, SWT.BORDER | SWT.PASSWORD);
+ passwordText.setLayoutData(gridData);
+
+ return dialogArea;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TitleAreaDialog#getInitialSize()
+ */
+ protected Point getInitialSize() {
+ return super.getInitialSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ tool.login(userText.getText(), passwordText.getText());
+ super.okPressed();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
+ */
+ protected void cancelPressed() {
+ tool.disconnect();
+ super.cancelPressed();
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/IToolViewPart.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/IToolViewPart.java
new file mode 100644
index 0000000..c61079a
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/IToolViewPart.java
@@ -0,0 +1,25 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+import org.eclipse.ui.IViewPart;
+
+/**
+ * @author Otávio Ferranti
+ */
+public interface IToolViewPart extends IViewPart{
+
+ public ITool getTool();
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.java
new file mode 100644
index 0000000..2d15fb2
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.java
@@ -0,0 +1,40 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tml.linuxtools.ui.messages"; //$NON-NLS-1$
+ public static String LoginDialog_Label_Password;
+ public static String LoginDialog_Label_User;
+ public static String LoginDialog_Msg_Login_Invalid;
+ public static String LoginDialog_Window_Message;
+ public static String LoginDialog_Window_Title;
+ public static String OpenConnectionDialog_Label_Host;
+ public static String OpenConnectionDialog_Label_Port;
+ public static String OpenConnectionDialog_Label_Protocol;
+ public static String OpenConnectionDialog_Window_Message;
+ public static String OpenConnectionDialog_Window_Title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.properties
new file mode 100644
index 0000000..494d38a
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages.properties
@@ -0,0 +1,31 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+OpenConnectionDialog_Window_Title=New connection
+OpenConnectionDialog_Window_Message=Enter values for the connection parameters
+
+OpenConnectionDialog_Label_Host=Host:
+OpenConnectionDialog_Label_Port=Port:
+OpenConnectionDialog_Label_Protocol=Protocol:
+
+LoginDialog_Window_Title=Login
+LoginDialog_Window_Message=Please, enter a valid user and password
+
+LoginDialog_Msg_Login_Invalid=Login failed. Please, enter a valid user and password
+
+LoginDialog_Label_User=User:
+LoginDialog_Label_Password=Password:
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages_pt.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages_pt.properties
new file mode 100644
index 0000000..a008f5d
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/Messages_pt.properties
@@ -0,0 +1,31 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+OpenConnectionDialog_Window_Title=Nova conexão
+OpenConnectionDialog_Window_Message=Entre com os valores para os parâmetros de conexão
+
+OpenConnectionDialog_Label_Host=Máquina:
+OpenConnectionDialog_Label_Port=Porta:
+OpenConnectionDialog_Label_Protocol=Protocolo:
+
+LoginDialog_Window_Title=Conectar
+LoginDialog_Window_Message=Por favor, forneça um nome de usuário e senha
+
+LoginDialog_Msg_Login_Invalid=A autenticação falhou. Por favor, forneça um par usuário e senha válido
+
+LoginDialog_Label_User=Usuário:
+LoginDialog_Label_Password=Senha:
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionConnect.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionConnect.java
new file mode 100644
index 0000000..8d38179
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionConnect.java
@@ -0,0 +1,52 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class ViewActionConnect implements IViewActionDelegate {
+
+ private IViewPart targetPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ this.targetPart = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ final DialogConnect dialog = new DialogConnect(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ ((IToolViewPart) this.targetPart).getTool());
+ dialog.open();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionDisconnect.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionDisconnect.java
new file mode 100644
index 0000000..9d64886
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionDisconnect.java
@@ -0,0 +1,53 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class ViewActionDisconnect implements IViewActionDelegate {
+
+ private IViewPart targetPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ this.targetPart = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IToolViewPart toolView = ((IToolViewPart) this.targetPart);
+ ITool tool =((ITool) toolView.getTool());
+ if (null != tool) {
+ tool.disconnect();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionPause.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionPause.java
new file mode 100644
index 0000000..7d6b873
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionPause.java
@@ -0,0 +1,55 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class ViewActionPause implements IViewActionDelegate {
+
+ private IViewPart targetPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ this.targetPart = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IToolViewPart toolView = ((IToolViewPart) this.targetPart);
+ ITool tool = toolView.getTool();
+
+ if (null != tool) {
+ tool.stop();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ // TODO Auto-generated method stub
+ }
+} \ No newline at end of file
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRefresh.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRefresh.java
new file mode 100644
index 0000000..d8b9499
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRefresh.java
@@ -0,0 +1,55 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class ViewActionRefresh implements IViewActionDelegate {
+
+ private IViewPart targetPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ this.targetPart = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IToolViewPart toolView = ((IToolViewPart) this.targetPart);
+ ITool tool = toolView.getTool();
+
+ if (null != tool) {
+ tool.refresh();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ // TODO Auto-generated method stub
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRun.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRun.java
new file mode 100644
index 0000000..dccdb24
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/ui/ViewActionRun.java
@@ -0,0 +1,55 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.ui;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class ViewActionRun implements IViewActionDelegate {
+
+ private IViewPart targetPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ this.targetPart = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IToolViewPart toolView = ((IToolViewPart) this.targetPart);
+ ITool tool = toolView.getTool();
+
+ if (null != tool) {
+ tool.start();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ // TODO Auto-generated method stub
+ }
+} \ No newline at end of file
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/Extensions.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/Extensions.java
new file mode 100644
index 0000000..e9dcf24
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/Extensions.java
@@ -0,0 +1,84 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.utilities;
+
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+
+import org.eclipse.tml.common.utilities.PluginUtils;
+
+public class Extensions {
+
+ static final private String PROTOCOLS_EXTENSION =
+ "org.eclipse.tml.linuxtools.base.protocols"; //$NON-NLS-1$
+
+ static final private String CLASS = "class"; //$NON-NLS-1$
+ static final private String DEFAULT_PORT = "default_port"; //$NON-NLS-1$
+ static final private String ID = "id"; //$NON-NLS-1$
+ static final private String NAME = "name"; //$NON-NLS-1$
+ static final private String CAPABILITY = "capability";
+
+ static public List <ProtocolDescriptor> findProcotols (String[] reqCapabilities) {
+ Collection<IExtension> extensions =
+ PluginUtils.getInstalledExtensions(PROTOCOLS_EXTENSION);
+
+ List <ProtocolDescriptor> pdList = new LinkedList<ProtocolDescriptor>();
+
+ for (IExtension extension:extensions){
+ IConfigurationElement[] protocolElements = extension.getConfigurationElements();
+ for (IConfigurationElement protocolElement:protocolElements) {
+ IConfigurationElement[] capabilityElements = protocolElement.getChildren(CAPABILITY);
+
+ boolean allCapabilitiesFound = true;
+ for (String reqCapability:reqCapabilities) {
+ boolean capabilityMissing = true;
+ for (IConfigurationElement capabilityElement:capabilityElements) {
+ String capabilityStr = capabilityElement.getAttribute(ID);
+ if(capabilityStr.equalsIgnoreCase(reqCapability)) {
+ capabilityMissing = false; //Capability found
+ break;
+ }
+ }
+ if (true == capabilityMissing) {
+ allCapabilitiesFound = false;
+ break; // Could not find one of the req'd capabilities
+ }
+ }
+
+ if(true == allCapabilitiesFound) {
+ String protDefaultPortStr = protocolElement.getAttribute(DEFAULT_PORT);
+ Integer protDefaultPort = new Integer(protDefaultPortStr);
+ String protIdStr = protocolElement.getAttribute(ID);
+ String protNameStr = protocolElement.getAttribute(NAME);
+ try {
+ IConnectionProvider protConnProv = (IConnectionProvider) protocolElement.createExecutableExtension(CLASS);
+ pdList.add(new ProtocolDescriptor((Class) protConnProv.getClass(), protNameStr,
+ protIdStr, protDefaultPort.intValue()));
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ return pdList;
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/ProtocolDescriptor.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/ProtocolDescriptor.java
new file mode 100644
index 0000000..e03e3f0
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools.base/src/org/eclipse/sequoyah/linuxtools/utilities/ProtocolDescriptor.java
@@ -0,0 +1,48 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.utilities;
+
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+
+public class ProtocolDescriptor {
+
+ private Class<IConnectionProvider> connectionProviderClass = null;
+ private String name = null;
+ private String id = null;
+ private int defaultPort = -1;
+
+ ProtocolDescriptor(Class<IConnectionProvider> connectionProviderClass,
+ String name, String id, int defaultPort) {
+ this.connectionProviderClass = connectionProviderClass;
+ this.name = name;
+ this.id = id;
+ this.defaultPort = defaultPort;
+ }
+
+ public Class<IConnectionProvider> getConnectionProviderClass() {
+ return connectionProviderClass;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public int getDefaultPort() {
+ return defaultPort;
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/.project b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/.project
index 20cac40..5a6facf 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/.project
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.sequoyah.device.linuxtools</name>
+ <name>org.eclipse.tml.linuxtools</name>
<comment></comment>
<projects>
</projects>
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/META-INF/MANIFEST.MF b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/META-INF/MANIFEST.MF
index 006ce30..bc18f2d 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/META-INF/MANIFEST.MF
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/META-INF/MANIFEST.MF
@@ -1,21 +1,21 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.sequoyah.device.linuxtools;singleton:=true
-Bundle-Version: 0.1.0.qualifier
+Bundle-SymbolicName: org.eclipse.tml.linuxtools;singleton:=true
+Bundle-Version: 0.1.0
Bundle-Localization: plugin
-Bundle-Activator: org.eclipse.sequoyah.device.linuxtools.LinuxToolsPlugin
+Bundle-Activator: org.eclipse.tml.linuxtools.LinuxToolsPlugin
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.sequoyah.device.linuxtools.base,
- org.eclipse.sequoyah.device.common.utilities,
+Require-Bundle: org.eclipse.tml.linuxtools.base;bundle-version="0.1.0",
+ org.eclipse.tml.common.utilities;bundle-version="0.2.0",
org.eclipse.ui,
org.eclipse.core.runtime,
org.apache.commons.net,
- org.eclipse.tm.tcf,
- org.eclipse.rse.core,
- org.eclipse.rse.subsystems.files.core,
- org.eclipse.rse.services
-Export-Package: org.eclipse.sequoyah.device.linuxtools.network.tcf,
- org.eclipse.sequoyah.device.linuxtools.network.telnet
+ org.eclipse.tm.tcf;bundle-version="0.2.0",
+ org.eclipse.rse.core;bundle-version="3.0.100",
+ org.eclipse.rse.subsystems.files.core;bundle-version="3.0.1",
+ org.eclipse.rse.services;bundle-version="3.1.0"
+Export-Package: org.eclipse.tml.linuxtools.network.tcf,
+ org.eclipse.tml.linuxtools.network.telnet
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/build.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/build.properties
index de23fe3..c88359b 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/build.properties
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/build.properties
@@ -4,6 +4,4 @@ bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
- plugin.properties,\
- dsdp32.png
-src.includes = dsdp32.png
+ plugin.properties
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.properties
index d7a7e78..6457c85 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.properties
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.properties
@@ -15,7 +15,7 @@
# NLS_MESSAGEFORMAT_NONE
# NLS_ENCODING=UTF-8
-pluginName=Linux Tools Plugin (Incubation)
+pluginName=Linux Tools Plugin
providerName=Eclipse.org
category.name=Linux Tools
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.xml b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.xml
index abb8f68..ce8fcd3 100644
--- a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.xml
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin.xml
@@ -6,27 +6,27 @@
point="org.eclipse.ui.views">
<category
name="%category.name"
- id="org.eclipse.sequoyah.device.linuxtools.Category">
+ id="org.eclipse.tml.linuxtools.Category">
</category>
<view
name="%view.memorymap.name"
icon="icons/eclipse.gif"
- category="org.eclipse.sequoyah.device.linuxtools.Category"
- class="org.eclipse.sequoyah.device.linuxtools.tools.memorymap.MemoryMapView"
- id="org.eclipse.sequoyah.device.linuxtools.tools.memorymap.View">
+ category="org.eclipse.tml.linuxtools.Category"
+ class="org.eclipse.tml.linuxtools.tools.memorymap.MemoryMapView"
+ id="org.eclipse.tml.linuxtools.tools.memorymap.View">
</view>
<view
- category="org.eclipse.sequoyah.device.linuxtools.Category"
- class="org.eclipse.sequoyah.device.linuxtools.tools.cpuload.CpuLoadView"
+ category="org.eclipse.tml.linuxtools.Category"
+ class="org.eclipse.tml.linuxtools.tools.cpuload.CpuLoadView"
icon="icons/eclipse.gif"
- id="org.eclipse.sequoyah.device.linuxtools.tools.cpuload.View"
+ id="org.eclipse.tml.linuxtools.tools.cpuload.View"
name="%view.cpuload.name">
</view>
</extension>
<extension
- point="org.eclipse.sequoyah.device.linuxtools.base.protocols">
+ point="org.eclipse.tml.linuxtools.base.protocols">
<protocol
- class="org.eclipse.sequoyah.device.linuxtools.network.telnet.TelnetProvider"
+ class="org.eclipse.tml.linuxtools.network.telnet.TelnetProvider"
default_port="23"
id="TELNET"
name="Telnet">
@@ -35,7 +35,7 @@
</capability>
</protocol>
<protocol
- class="org.eclipse.sequoyah.device.linuxtools.network.tcf.TCFProvider"
+ class="org.eclipse.tml.linuxtools.network.tcf.TCFProvider"
default_port="1534"
id="TM_TCF_AGENT"
name="TM TCF Agent">
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin_pt.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin_pt.properties
new file mode 100644
index 0000000..64b65d0
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/plugin_pt.properties
@@ -0,0 +1,27 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributor:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_NONE
+# NLS_ENCODING=UTF-8
+
+pluginName=Plugin de Ferramentas Linux
+providerName=Eclipse.org
+
+category.name=Linux Tools
+
+view.memorymap.name=Mapa de Memória
+view.cpuload.name=Carga de CPU
+
+
+
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/LinuxToolsPlugin.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/LinuxToolsPlugin.java
new file mode 100644
index 0000000..551a2f5
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/LinuxToolsPlugin.java
@@ -0,0 +1,85 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools;
+
+import org.eclipse.tml.common.utilities.BasePlugin;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class LinuxToolsPlugin extends BasePlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.tml.linuxtools"; //$NON-NLS-1$
+
+ // Common icons
+ public static final String ICON_RUN = "run.gif"; //$NON-NLS-1$
+ public static final String ICON_PAUSE = "pause.gif"; //$NON-NLS-1$
+ public static final String ICON_OPTIONS = "options.gif"; //$NON-NLS-1$
+ public static final String ICON_REFRESH = "refresh.gif"; //$NON-NLS-1$
+ public static final String ICON_DISCONNECT = "disconnect.gif"; //$NON-NLS-1$
+ public static final String ICON_CONNECT = "connect.gif"; //$NON-NLS-1$
+
+ // The shared instance
+ private static LinuxToolsPlugin plugin;
+
+ private static final String[] allIcons = {ICON_RUN,
+ ICON_PAUSE,
+ ICON_OPTIONS,
+ ICON_REFRESH,
+ ICON_DISCONNECT,
+ ICON_CONNECT};
+
+ /**
+ * Returns the shared instance
+ * @return the shared instance
+ */
+ public static LinuxToolsPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * The constructor
+ */
+ public LinuxToolsPlugin() {
+ }
+
+ /*
+ * (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);
+ }
+
+ @Override
+ protected void initializeImageRegistry() {
+ String path = getIconPath();
+ for (String s: allIcons) {
+ putImageInRegistry(s, path + s);
+ }
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.java
new file mode 100644
index 0000000..230ef50
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.java
@@ -0,0 +1,33 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Otávio Ferranti
+ *
+ */
+public class Messages extends NLS {
+
+ private static String BUNDLE_NAME = "org.eclipse.tml.linuxtools.messages"; //$NON-NLS-1$
+ public static String TML_Plugin_Name;
+ public static String TML_Error;
+ public static String TML_Resource_Not_Available;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.properties
new file mode 100644
index 0000000..7bbec42
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages.properties
@@ -0,0 +1,21 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+TML_Plugin_Name=Linux Tools Plugin (Incubation)
+TML_Error=A unexpected exception was found
+TML_Resource_Not_Available=Resource not available
+
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages_pt.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages_pt.properties
new file mode 100644
index 0000000..04197c9
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/Messages_pt.properties
@@ -0,0 +1,21 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+TML_Plugin_Name=Plugin de Ferramentas Linux (Incubation)
+TML_Error=Uma exceção inesperada ocorreu
+TML_Resource_Not_Available=Recurso não disponível
+
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFProvider.java
new file mode 100644
index 0000000..e98ba8b
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFProvider.java
@@ -0,0 +1,140 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.network.tcf;
+
+import java.io.IOException;
+
+import org.eclipse.tml.common.utilities.logger.ILogger;
+
+import org.eclipse.tml.linuxtools.LinuxToolsPlugin;
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+import org.eclipse.tml.linuxtools.network.IConstants.CommandCode;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+import org.eclipse.tml.linuxtools.tools.AbstractNotifier;
+
+public class TCFProvider extends AbstractNotifier implements
+ IConnectionProvider {
+
+ private TCFWrapper connectionWrapper = null;
+ private ILogger logger = null;
+
+ private Thread connectThread = null;
+ private Thread sendCommandThread = null;
+
+ /**
+ * The constructor.
+ */
+ public TCFProvider() {
+ connectionWrapper = new TCFWrapper();
+ logger = LinuxToolsPlugin.getLogger();
+ }
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ */
+ public void connect(String host, int port) throws IOException {
+ final String hostAux = host;
+ final int portAux = port;
+ final TCFWrapper connectionWrapperAux = connectionWrapper;
+
+ /*TODO: Enhance this. It would be great if all these executed-in-other threads
+ were located under a synchronized block */
+
+ connectThread = new Thread() {
+ public void run() {
+ try {
+ connectionWrapperAux.connect(hostAux, portAux);
+ TCFProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_CONNECT_FINISHED,
+ OperationCode.SUCCESS);
+ } catch (IOException ie) {
+ TCFProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_CONNECT_ERROR,
+ OperationCode.UNEXPECTED_RESULT);
+ }
+
+ }
+ };
+ connectThread.start();
+ }
+
+ public void disconnect() throws IOException {
+ if (null != connectThread &&
+ connectThread.isAlive()) {
+ connectThread.interrupt();
+ }
+
+ if (null != sendCommandThread &&
+ sendCommandThread.isAlive()) {
+ sendCommandThread.interrupt();
+ }
+ connectionWrapper.disconnect();
+ notifyListeners(
+ EventCode.EVT_PROVIDER_DISCONNECT_FINISHED, OperationCode.SUCCESS);
+ }
+
+ public StringBuffer getLastResponde() {
+ return connectionWrapper.getLastResponde();
+ }
+
+ public void login(String user, String password) throws IOException {
+
+ }
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ */
+ public void sendCommand(CommandCode cmd, String cmdStr) throws IOException {
+
+ if (CommandCode.FETCH_FILE != cmd) {
+ return;
+ }
+
+ final TCFWrapper connectionWrapperAux = connectionWrapper;
+
+ final String path = cmdStr.substring(0, cmdStr.lastIndexOf("/"));
+ final String fileName = cmdStr.substring(cmdStr.lastIndexOf("/"));
+
+ sendCommandThread = new Thread() {
+ public void run() {
+ try {
+
+ if (null != connectionWrapperAux.fetchFile(path, fileName)) {
+ StringBuffer result = connectionWrapperAux.getLastResponde();
+ TCFProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_SENDCOMMAND_FINISHED, result);
+ } else {
+ logger.info("##### NULL ######");
+ }
+ } catch (IOException ie) {
+ TCFProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_SENDCOMMAND_ERROR, null);
+ }
+
+ }
+ };
+ sendCommandThread.start();
+ }
+
+ public void sendData(String out) {
+ connectionWrapper.sendData(out);
+ }
+
+ public void setResponseLength(int maxLength) {
+ connectionWrapper.setResponseLength(maxLength);
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFWrapper.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFWrapper.java
new file mode 100644
index 0000000..f5a125c
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/tcf/TCFWrapper.java
@@ -0,0 +1,100 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.network.tcf;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.rse.core.IRSECoreRegistry;
+import org.eclipse.rse.core.IRSESystemType;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.model.ISystemRegistry;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
+
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+
+public class TCFWrapper {
+
+ private StringBuffer lastResponse = null;
+ private IHost rseHost = null;
+
+ public void connect(String host, int port) throws IOException {
+ ISystemRegistry rseSystemRegistry = RSECorePlugin.getTheSystemRegistry();
+ IRSECoreRegistry rseCoreRegistry = RSECorePlugin.getTheCoreRegistry();
+ IRSESystemType tcfSystemType = rseCoreRegistry.getSystemTypeById("org.eclipse.tm.tcf.rse.systemType");
+ try {
+ rseHost = rseSystemRegistry.createHost(tcfSystemType, host, host, host);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void disconnect() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public StringBuffer getLastResponde() {
+ return lastResponse;
+ }
+
+ public OperationCode login(String user, String password) throws IOException {
+ // TODO Auto-generated method stub
+ return OperationCode.SUCCESS;
+ }
+
+ public String fetchFile(String path, String fileName) throws IOException {
+ IRemoteFileSubSystem remoteFileSubSystem =
+ RemoteFileUtility.getFileSubSystem(rseHost);
+ InputStream inputStream = null;
+
+ try {
+ remoteFileSubSystem.connect(new NullProgressMonitor(), false);
+ inputStream = remoteFileSubSystem.getInputStream(path, fileName,
+ false, new NullProgressMonitor());
+ } catch (SystemMessageException sme) {
+ // TODO Auto-generated catch block
+ sme.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ lastResponse = new StringBuffer();
+
+ byte[] b = new byte[16];
+ char[] c = new char[16];
+ while (inputStream.read(b) >= 0) {
+ for (int i = 0; i < b.length; i++) {
+ c[i] = (char) b[i];
+ }
+ lastResponse.append(c);
+ }
+ return "OK";
+ }
+
+ public void sendData(String out) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setResponseLength(int maxLength) {
+ // TODO Auto-generated method stub
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetProvider.java
new file mode 100644
index 0000000..9d100c3
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetProvider.java
@@ -0,0 +1,194 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.network.telnet;
+
+import java.io.IOException;
+
+import org.eclipse.tml.common.utilities.logger.ILogger;
+
+import org.eclipse.tml.linuxtools.LinuxToolsPlugin;
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+import org.eclipse.tml.linuxtools.network.IConstants.CommandCode;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+import org.eclipse.tml.linuxtools.tools.AbstractNotifier;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class TelnetProvider extends AbstractNotifier implements IConnectionProvider {
+
+ final private String CMD_FETCH_PREFIX = "cat "; //$NON-NLS-1$
+
+ private TelnetWrapper connectionWrapper = null;
+ private ILogger logger = null;
+
+ private Thread connectThread = null;
+ private Thread loginThread = null;
+ private Thread sendCommandThread = null;
+
+ /**
+ * The constructor.
+ */
+ public TelnetProvider() {
+ connectionWrapper = new TelnetWrapper();
+ logger = LinuxToolsPlugin.getLogger();
+ }
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ */
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#connect(java.lang.String, int)
+ */
+ public void connect(String host, int port) throws IOException {
+ final String hostAux = host;
+ final int portAux = port;
+ final TelnetWrapper connectionWrapperAux = connectionWrapper;
+
+ /*TODO: Enhance this. It would be great if all these executed-in-other threads
+ were located under a synchronized block */
+
+ connectThread = new Thread() {
+ public void run() {
+ try {
+ OperationCode opCode;
+ opCode = connectionWrapperAux.connect(hostAux, portAux);
+ TelnetProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_CONNECT_FINISHED, opCode);
+ } catch (IOException ie) {
+ TelnetProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_CONNECT_ERROR,
+ OperationCode.UNEXPECTED_RESULT);
+ }
+
+ }
+ };
+ connectThread.start();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#disconnect()
+ */
+ public void disconnect() throws IOException {
+ if (null != connectThread &&
+ connectThread.isAlive()) {
+ connectThread.interrupt();
+ }
+ if (null != loginThread &&
+ loginThread.isAlive()) {
+ loginThread.interrupt();
+ }
+ if (null != sendCommandThread &&
+ sendCommandThread.isAlive()) {
+ sendCommandThread.interrupt();
+ }
+ connectionWrapper.disconnect();
+ notifyListeners(
+ EventCode.EVT_PROVIDER_DISCONNECT_FINISHED, OperationCode.SUCCESS);
+ }
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ */
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#login(java.lang.String, java.lang.String)
+ */
+ public void login(String user, String password) throws IOException {
+ final String userAux = user;
+ final String passwordAux = password;
+ final TelnetWrapper connectionWrapperAux = connectionWrapper;
+
+ /*TODO: Enhance this. It would be great if all these executed-in-other threads
+ were located under a synchronized block */
+ loginThread = new Thread() {
+ public void run() {
+ try {
+ OperationCode opCode;
+ opCode = connectionWrapperAux.login(userAux, passwordAux);
+ TelnetProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_LOGIN_FINISHED, opCode);
+ } catch (IOException ie) {
+ TelnetProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_LOGIN_ERROR,
+ OperationCode.UNEXPECTED_RESULT);
+ }
+ }
+ };
+ loginThread.start();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#getLastResponde()
+ */
+ public StringBuffer getLastResponde() {
+ return connectionWrapper.getLastResponde();
+ }
+
+ /**
+ * This method will be executed in a separated thread and will produce
+ * an event to be sent to the registered listeners.
+ */
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#sendCommand(java.lang.String)
+ */
+ public void sendCommand(CommandCode cmd, String cmdStr) throws IOException {
+
+ if (CommandCode.FETCH_FILE != cmd) {
+ return;
+ }
+
+ final String commandAux = CMD_FETCH_PREFIX + cmdStr + "\n"; //$NON-NLS-1$
+
+ final TelnetWrapper connectionWrapperAux = connectionWrapper;
+
+ /*TODO: Enhance this. It would be great if all these executed-in-other threads
+ were located under a synchronized block */
+ sendCommandThread = new Thread() {
+ public void run() {
+ try {
+ connectionWrapperAux.setResponseLength(2048);
+ if (null != connectionWrapperAux.sendCommand(commandAux)) {
+ StringBuffer result = connectionWrapperAux.getLastResponde();
+ TelnetProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_SENDCOMMAND_FINISHED, result);
+ } else {
+ logger.info("##### NULL ######");
+ }
+ } catch (IOException ie) {
+ TelnetProvider.this.notifyListeners(
+ EventCode.EVT_PROVIDER_SENDCOMMAND_ERROR, null);
+ }
+
+ }
+ };
+ sendCommandThread.start();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#sendData(java.lang.String)
+ */
+ public void sendData(String out) {
+ connectionWrapper.sendData(out);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxmemorymapviewer.network.IConnectionProvider#setResponseLength(int)
+ */
+ public void setResponseLength(int maxLength) {
+ connectionWrapper.setResponseLength(maxLength);
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetWrapper.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetWrapper.java
new file mode 100644
index 0000000..0818f29
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/network/telnet/TelnetWrapper.java
@@ -0,0 +1,237 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.network.telnet;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.Thread;
+import java.util.HashMap;
+
+import org.apache.commons.net.telnet.EchoOptionHandler;
+import org.apache.commons.net.telnet.InvalidTelnetOptionException;
+import org.apache.commons.net.telnet.SuppressGAOptionHandler;
+import org.apache.commons.net.telnet.TelnetClient;
+import org.apache.commons.net.telnet.TerminalTypeOptionHandler;
+
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class TelnetWrapper {
+
+ final public String PROMPT = "[###]:"; //$NON-NLS-1$
+ final private String[] LOGIN_TOKENS = {"login:", //$NON-NLS-1$
+ "Login:"}; //$NON-NLS-1$
+ final private String[] PASSWORD_TOKENS = {"password:", //$NON-NLS-1$
+ "Password:"}; //$NON-NLS-1$
+ final private String[] LOGIN_FAILED_TOKENS = {"Login incorrect", //$NON-NLS-1$
+ "Access denied"}; //$NON-NLS-1$
+ final private String CHANGE_PROMPT = "export PS1='[\\043\\043\\043]:'\n"; //$NON-NLS-1$
+
+ // private ILogger logger = null;
+ private TelnetClient client = null;
+ private InputStream inStream = null;
+ private PrintStream outStream = null;
+ private StringBuffer lastResponse = null;
+ private int maxResponseDataLength = 1024;
+
+ private int MAX_LENGTH_PASSWORD_TOKENS = 32;
+ private int MAX_LENGTH_LOGIN_FAILED = 32;
+ private int MAX_LENGTH_LOGIN_INITSCREEN = 2048;
+ private int MAX_LENGTH_CHANGE_PROMPT = 128;
+
+ /**
+ * Constructor
+ */
+ public TelnetWrapper() {
+ if (null == this.client) {
+ this.client = new TelnetClient();
+ try {
+ this.client.addOptionHandler(new TerminalTypeOptionHandler(
+ "VT100", false, false, true, false)); //$NON-NLS-1$
+ this.client.addOptionHandler(new SuppressGAOptionHandler(
+ true, true, true, true));
+ this.client.addOptionHandler(new EchoOptionHandler(
+ false, false, false, false));
+ } catch (InvalidTelnetOptionException itoe) { }
+ // logger = LinuxToolsPlugin.getLogger();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#connect(java.lang.String, int)
+ */
+ public OperationCode connect(String host, int port) throws IOException {
+ OperationCode retVal;
+
+ this.client.connect(host, port);
+
+ inStream = client.getInputStream();
+ outStream = new PrintStream (client.getOutputStream());
+
+ // sendData(user+"\n");
+ if(null == readUntilTokens(LOGIN_TOKENS)) {
+ retVal = OperationCode.SUCCESS;
+ } else {
+ retVal = OperationCode.LOGIN_REQUIRED;
+ }
+ return retVal;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#disconnect()
+ */
+ public void disconnect() throws IOException {
+ if (null != client) {
+ client.disconnect();
+ // System.out.println("Connection closed ...");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#login(java.lang.String, java.lang.String)
+ */
+ public OperationCode login(String user, String password) throws IOException {
+ OperationCode retVal = OperationCode.UNEXPECTED_RESULT;
+
+ sendData(user+"\n"); //$NON-NLS-1$
+ setResponseLength(MAX_LENGTH_PASSWORD_TOKENS);
+ if (null != readUntilTokens(PASSWORD_TOKENS)) {
+ sendData(password+"\n"); //$NON-NLS-1$
+
+ setResponseLength(MAX_LENGTH_LOGIN_FAILED);
+ if (null != readUntilTokens(LOGIN_FAILED_TOKENS)) {
+ if(null != readUntilTokens(LOGIN_TOKENS)) {
+ retVal = OperationCode.LOGIN_FAILED;
+ } else {
+ retVal = OperationCode.UNEXPECTED_RESULT;
+ }
+ return retVal;
+ } else {
+ setResponseLength(MAX_LENGTH_LOGIN_INITSCREEN);
+ int toBeSkipped = inStream.available();
+ inStream.skip(toBeSkipped);
+ }
+ }
+ try {
+ Thread.sleep (2000);
+ } catch (InterruptedException ite) {
+
+ }
+ setResponseLength(MAX_LENGTH_CHANGE_PROMPT);
+ sendData(CHANGE_PROMPT);
+ if (null != readUntilTokens(PROMPT)) {
+ retVal = OperationCode.SUCCESS;
+ }
+ return retVal;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#getLastResponde()
+ */
+ public StringBuffer getLastResponde() {
+ return lastResponse;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#sendCommand(java.lang.String)
+ */
+ public String sendCommand(String command) throws IOException {
+ sendData (command);
+ return readUntilTokens (PROMPT);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#sendData(java.lang.String)
+ */
+ public void sendData(String out) {
+ if (null != outStream) {
+ outStream.print(out);
+ outStream.flush();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IConnectionWrapper#setResponseLength(int)
+ */
+ public void setResponseLength(int maxLength) {
+ maxResponseDataLength = maxLength;
+ }
+
+ /**
+ * @param token
+ * @return
+ * @throws IOException
+ */
+ private String readUntilTokens(String token)throws IOException {
+ return readUntilTokens(new String[] {token});
+ }
+
+ /**
+ * @param tokenArray
+ * @return
+ * @throws IOException
+ */
+ private String readUntilTokens(final String []tokenArray) throws IOException {
+ String matchedString = null;
+ boolean tokenFound = false;
+ StringBuffer readData = new StringBuffer();
+
+ HashMap<String,Integer> hashMap = new HashMap<String,Integer>();
+
+ for (int i = 0; i < tokenArray.length; i++) {
+ hashMap.put(tokenArray[i], new Integer(0));
+ }
+
+ for (int i = 0; i < this.maxResponseDataLength; i++) {
+
+ int aux = inStream.read();
+
+ char ch = 0;
+ if (aux == 0 || aux == 1) {
+ continue;
+ } else {
+ ch = (char) aux;
+ }
+ readData.append(ch);
+
+ // if (ch != 1 && ch != 0)
+ // logger.info(ch);
+
+ for (int j = 0; j < tokenArray.length; j++) {
+ String token = tokenArray[j];
+ Integer rank = hashMap.get(token);
+ if (ch == token.charAt(rank)) {
+ rank ++;
+ if (rank >= token.length()) {
+ // MATCHED
+ readData.setLength(readData.length() - token.length());
+ matchedString = token;
+ tokenFound = true;
+ }
+ } else {
+ rank = 0;
+ }
+ hashMap.put(token, rank);
+ }
+ if (tokenFound) {
+ break;
+ }
+ }
+ this.lastResponse = readData;
+ return matchedString;
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadProcessor.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadProcessor.java
new file mode 100644
index 0000000..a61aa62
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadProcessor.java
@@ -0,0 +1,280 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Scanner;
+import java.util.regex.MatchResult;
+
+import org.eclipse.tml.common.utilities.logger.ILogger;
+
+import org.eclipse.tml.linuxtools.LinuxToolsPlugin;
+import org.eclipse.tml.linuxtools.network.IConstants.CommandCode;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+import org.eclipse.tml.linuxtools.tools.AbstractNotifier;
+import org.eclipse.tml.linuxtools.tools.IListener;
+import org.eclipse.tml.linuxtools.tools.INotifier;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class CpuLoadProcessor extends AbstractNotifier implements IListener {
+
+ final private String CMD_FETCH_STAT = "/proc/stat"; //$NON-NLS-1$
+ final private String PARSE_PATTERN_1 = "cpu(\\d*)(.*)"; //$NON-NLS-1$;
+ final private String PARSE_PATTERN_2 = "\\s+(\\d+)"; //$NON-NLS-1$;
+ final private String DATA_FORMAT = "%1$02.1f %%"; //$NON-NLS-1$;
+
+ final private String MSG_EXECUTING_COMMAND =
+ Messages.CpuLoadProcessor_Msg_Executing_the_command;
+
+ final private String MSG_GOT_RESULT =
+ Messages.CpuLoadProcessor_Msg_Got_The_Result;
+
+ final private int MAX_COLUMNS = 100;
+
+ private int[][] previousData = null;
+ private long[] previousTotal = null;
+ private IConnectionProvider connectionProvider = null;
+
+ private ILogger logger = null;
+
+ /**
+ * The constructor;
+ * @param connectionProvider
+ */
+ public CpuLoadProcessor(IConnectionProvider connectionProvider) {
+ setConnectionProvider(connectionProvider);
+ logger = LinuxToolsPlugin.getLogger();
+ }
+
+ /**
+ * Requests data.
+ * @throws IOException
+ */
+ public void gatherData() throws IOException {
+ this.connectionProvider.sendCommand(CommandCode.FETCH_FILE, this.CMD_FETCH_STAT);
+ logger.debug(MSG_EXECUTING_COMMAND + "\n" + this.CMD_FETCH_STAT); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IListener#notify(org.eclipse.tml.linuxtools.network.INotifier, org.eclipse.tml.linuxtools.network.IConstants.EventCode, java.lang.Object)
+ */
+ public void notify(INotifier notifier,
+ EventCode event,
+ Object result) {
+ if (notifier == this.connectionProvider &&
+ event == EventCode.EVT_PROVIDER_SENDCOMMAND_FINISHED) {
+ Object[][] parsedResult = parseStat((StringBuffer) result);
+ this.notifyListeners(EventCode.EVT_PROCESSOR_GATHERDATA_FINISHED,
+ parsedResult);
+ }
+ }
+
+ /**
+ * Set the connection provider.
+ * @param connectionProvider
+ */
+ public void setConnectionProvider (IConnectionProvider connectionProvider) {
+ if (null != this.connectionProvider) {
+ this.connectionProvider.removeListener(this);
+ }
+ this.connectionProvider = connectionProvider;
+ if (null != this.connectionProvider) {
+ this.connectionProvider.addListener(this);
+ }
+ }
+
+ /**
+ * @param currentDataStr
+ * @return
+ */
+ private Object[][] calculateTimes(String[][] currentDataStr) {
+ String[][] resultStr = null;
+
+ if (null == currentDataStr) {
+ currentDataStr = new String[][] {{"0"}};
+ }
+ if (null == previousData) {
+ previousData = new int[][] {{0}};
+ previousTotal = new long[] {1};
+ }
+ if (previousData.length != currentDataStr.length ||
+ previousData[0].length != currentDataStr[0].length) {
+ previousData = String2int(currentDataStr);
+ previousTotal = new long[previousData.length];
+
+ for (int j = 0; j < previousData.length; j++) {
+ long total = 0;
+ for (int i = 0; i < previousData[0].length; i++) {
+ total += previousData[j][i];
+ }
+ previousTotal[j] = total;
+ }
+ }
+ final int[][] currentDataInt = String2int(currentDataStr);
+ float[][] resultFloat = new float[currentDataStr.length][currentDataStr[0].length];
+
+ for (int j = 0; j < currentDataInt.length; j++) {
+ long total = 0;
+ for (int i = 0; i < currentDataInt[0].length; i++) {
+ total += currentDataInt[j][i];
+ }
+ float deltaTotal = total - previousTotal[j];
+ previousTotal[j] = total;
+ for (int i = 0; i < currentDataInt[0].length; i++) {
+ float deltaData = currentDataInt[j][i] - previousData[j][i];
+ if (0 == deltaTotal) {
+ resultFloat[j][i] = 0;
+ } else {
+ resultFloat[j][i] = 100* deltaData / deltaTotal;
+ }
+ }
+ }
+ previousData = currentDataInt;
+ resultStr = float2StringFormated(resultFloat, DATA_FORMAT);
+ return resultStr;
+ }
+
+ /**
+ * @param target
+ * @param Source
+ */
+ private void copyData(Object[][] target, Object[][] Source) {
+ for (int j = 0; j < target.length; j++) {
+ for (int i = 1; i < target[0].length; i++) {
+ target[j][i] = Source[j][i-1];
+ }
+ }
+ }
+
+ /**
+ * @param input
+ * @return
+ */
+ private String[][] float2StringFormated (float[][] input, String format) {
+ String[][] output = null;
+ if (null != input) {
+ output = new String[input.length][input[0].length];
+ for (int j = 0; j < output.length; j++) {
+ for (int i = 0; i < output[0].length; i++) {
+ output[j][i] = String.format(format, new Float(input[j][i]));
+ }
+ }
+ }
+ return output;
+ }
+
+ /**
+ * @param data
+ * @return
+ */
+ private Object[][] parseStat(StringBuffer data) {
+ logger.debug(MSG_GOT_RESULT + "\n" + data.toString());
+
+ int requiredColumns = 0;
+
+ Scanner s1 = new Scanner(data.toString());
+ ArrayList<String[]> list = new ArrayList<String[]>();
+
+ while (s1.hasNextLine()) {
+ String[] entry = new String[MAX_COLUMNS];;
+
+ Scanner s2 = new Scanner(s1.nextLine());
+ s2.findInLine(PARSE_PATTERN_1);
+
+ try {
+
+ MatchResult result = s2.match();
+ entry[0] = result.group(1).trim();
+
+ String aux = result.group(2);
+
+ Scanner s3 = new Scanner(aux);
+ entry[1] = s3.findInLine(PARSE_PATTERN_2).trim();
+
+ s3.match();
+ int i = 2;
+
+ while (s3.hasNext() && i < MAX_COLUMNS) {
+ entry[i] = s3.next().trim();
+
+ if (i > requiredColumns) {
+ requiredColumns = i;
+ }
+ i++;
+ }
+ s3.close();
+ if (null != entry) {
+ list.add(entry);
+ }
+ } catch (IllegalStateException ise) {
+ }
+ s2.close();
+ }
+ s1.close();
+
+ String[][] dataAux = new String[list.size()][requiredColumns + 1];
+ for (int j = 0; j < dataAux.length; j++) {
+ for (int i = 0; i < dataAux[0].length; i++) {
+ dataAux[j][i] = list.get(j)[i];
+ }
+ }
+ String[][] dataStrippedAux = stripFirstColumn(dataAux);
+ Object[][] result = calculateTimes(dataStrippedAux);
+ copyData(dataAux, result);
+ return dataAux;
+ }
+
+ /**
+ * @param input
+ * @return
+ */
+ private int[][] String2int (String[][] input) {
+ int[][] output = null;
+ if (null != input) {
+ output = new int[input.length][input[0].length];
+ for (int j = 0; j < output.length; j++) {
+ for (int i = 0; i < output[0].length; i++) {
+ try {
+ output[j][i] = new Integer(input[j][i]).intValue();
+ }
+ catch (NumberFormatException nfe) {
+ output[j][i] = -1;
+ }
+ }
+ }
+ }
+ return output;
+ }
+
+ /**
+ * @param input
+ * @return
+ */
+ private String[][] stripFirstColumn (String[][] input) {
+ String output[][] = null;
+ if (null != input) {
+ output = new String[input.length][input[0].length-1];
+ for (int j = 0; j < output.length; j++) {
+ for (int i = 0; i < output[0].length; i++) {
+ output[j][i] = input[j][i+1];
+ }
+ }
+ }
+ return output;
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadTool.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadTool.java
new file mode 100644
index 0000000..923bc31
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadTool.java
@@ -0,0 +1,208 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+import org.eclipse.tml.linuxtools.tools.AbstractNotifier;
+import org.eclipse.tml.linuxtools.tools.IListener;
+import org.eclipse.tml.linuxtools.tools.INotifier;
+import org.eclipse.tml.linuxtools.tools.ITool;
+import org.eclipse.tml.linuxtools.utilities.Extensions;
+import org.eclipse.tml.linuxtools.utilities.ProtocolDescriptor;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class CpuLoadTool extends AbstractNotifier implements IListener, ITool {
+
+ public enum ToolStateEnum {RUNNING, STOPPED, STOP_SCHEDULED};
+
+ private IConnectionProvider connectionProvider = null;
+ private CpuLoadProcessor processor = null;
+ private int delay = 1000;
+
+ private ToolStateEnum toolState = ToolStateEnum.STOPPED;
+
+ private String[] requiredCapabilities = {"GET_FILE"}; //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#createConnection(java.lang.String, int, java.lang.String)
+ */
+ public void connect (String host,
+ int port,
+ ProtocolDescriptor protocol) {
+
+ Class<IConnectionProvider> connectionProviderClass =
+ protocol.getConnectionProviderClass();
+
+ try {
+ Object aux = connectionProviderClass.newInstance();
+ connectionProvider = (IConnectionProvider) aux;
+ } catch (InstantiationException ie) {
+ } catch (IllegalAccessException iae) {
+ } catch (ClassCastException cce) {
+ }
+
+ connectionProvider.addListener(this);
+ try {
+ connectionProvider.connect(host, port);
+ } catch (IOException ie) { }
+ processor = new CpuLoadProcessor(connectionProvider);
+
+ processor.addListener(this);
+ toolState = ToolStateEnum.STOPPED;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#closeConnection()
+ */
+ public void disconnect() {
+ if (null != connectionProvider) {
+ try {
+ connectionProvider.disconnect();
+ } catch (IOException ie) {
+ }
+ connectionProvider = null;
+ toolState = ToolStateEnum.STOPPED;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#login(java.lang.String, java.lang.String)
+ */
+ public void login (String user, String password) {
+ try {
+ connectionProvider.login(user, password);
+ } catch (IOException ie) {
+ //TODO: Nothing ?
+ }
+ }
+
+ public List<ProtocolDescriptor> getProtocolsDescriptors() {
+ List <ProtocolDescriptor> pdList = Extensions.findProcotols(requiredCapabilities);
+ return pdList;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.IListener#notify(org.eclipse.tml.linuxtools.tools.INotifier, org.eclipse.tml.linuxtools.network.IConstants.EventCode, java.lang.Object)
+ */
+ public void notify(INotifier notifier, EventCode event, Object result) {
+ try {
+ if (notifier == connectionProvider) {
+ switch (event) {
+ case EVT_PROVIDER_CONNECT_FINISHED:
+ if (OperationCode.SUCCESS == result) {
+ start();
+ }
+ this.notifyListeners(
+ EventCode.EVT_TOOL_CONNECT_FINISHED,
+ result);
+ break;
+ case EVT_PROVIDER_CONNECT_ERROR:
+
+ break;
+ case EVT_PROVIDER_LOGIN_FINISHED:
+ if (OperationCode.SUCCESS == result) {
+ start();
+ }
+ this.notifyListeners(
+ EventCode.EVT_TOOL_LOGIN_FINISHED,
+ result);
+ break;
+ case EVT_PROVIDER_SENDCOMMAND_FINISHED:
+ break;
+ case EVT_PROVIDER_SENDCOMMAND_ERROR:
+ break;
+ case EVT_PROVIDER_SENDDATA_FINISHED:
+ break;
+ case EVT_PROVIDER_SENDDATA_ERROR:
+ break;
+ case EVT_PROVIDER_DISCONNECT_FINISHED:
+ this.notifyListeners(
+ EventCode.EVT_TOOL_DISCONNECT_FINISHED,
+ result);
+ break;
+ }
+ }
+ if (notifier == processor) {
+ switch (event) {
+ case EVT_PROCESSOR_GATHERDATA_FINISHED:
+ if (ToolStateEnum.RUNNING == toolState) {
+ try {
+ notifyListeners(EventCode.EVT_TOOL_REFRESH_VIEW,
+ result);
+ Thread.sleep(delay);
+ processor.gatherData();
+ } catch (InterruptedException ie) {
+ }
+ } else if (ToolStateEnum.STOP_SCHEDULED == toolState) {
+ toolState = ToolStateEnum.STOPPED;
+ }
+ break;
+ case EVT_PROCESSOR_GATHERDATA_ERROR:
+ break;
+ }
+ }
+ } catch (IOException ie) {
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#getRefreshDelay()
+ */
+ public int getRefreshDelay() {
+ return this.delay;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#setRefreshDelay(int)
+ */
+ public void setRefreshDelay(int delay) {
+ this.delay = delay;
+ }
+
+ /**
+ *
+ */
+ public void start() {
+ try {
+ if (null != processor) {
+ if (ToolStateEnum.STOPPED == toolState) {
+ toolState = ToolStateEnum.RUNNING;
+ processor.gatherData();
+ } else if (ToolStateEnum.STOP_SCHEDULED == toolState) {
+ toolState = ToolStateEnum.RUNNING;
+ }
+ }
+ } catch (IOException ie) {
+ //TODO: Nothing ?
+ }
+ }
+
+ /**
+ *
+ */
+ public void stop () {
+ toolState = ToolStateEnum.STOP_SCHEDULED;
+ }
+
+ public void refresh() {
+ // TODO Auto-generated method stub
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadView.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadView.java
new file mode 100644
index 0000000..bb64d55
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadView.java
@@ -0,0 +1,336 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.SWT;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.ViewPart;
+
+import org.eclipse.tml.linuxtools.LinuxToolsPlugin;
+
+import org.eclipse.tml.linuxtools.tools.IListener;
+import org.eclipse.tml.linuxtools.tools.INotifier;
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+import org.eclipse.tml.linuxtools.ui.IToolViewPart;
+import org.eclipse.tml.linuxtools.ui.DialogLogin;
+import org.eclipse.tml.linuxtools.ui.ViewActionConnect;
+import org.eclipse.tml.linuxtools.ui.ViewActionDisconnect;
+import org.eclipse.tml.linuxtools.ui.ViewActionPause;
+import org.eclipse.tml.linuxtools.ui.ViewActionRun;
+
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class CpuLoadView extends ViewPart implements IToolViewPart, IListener {
+
+ private class CpuSorter extends ViewerSorter {
+
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ int result = 0;
+ try {
+ int a = new Integer(((String[]) e1)[0]).intValue();
+ int b = new Integer(((String[]) e2)[0]).intValue();
+ if (a > b) {
+ result = 1;
+ } else if (a < b) {
+ result = -1;
+ };
+ }
+ catch (NumberFormatException nfe) {
+ //TODO: Nothing ?
+ }
+ return result;
+ }
+ }
+ final private String COL_LABEL_CPU = Messages.CpuLoadView_Col_Label_Cpu;
+ final private String COL_LABEL_USER_MODE = Messages.CpuLoadView_Col_Label_User_Mode;
+ final private String COL_LABEL_NICE = Messages.CpuLoadView_Col_Label_Nice;
+ final private String COL_LABEL_SYSTEM = Messages.CpuLoadView_Col_Label_System;
+ final private String COL_LABEL_IDLE = Messages.CpuLoadView_Col_Label_Idle;
+ final private String COL_LABEL_WAIT = Messages.CpuLoadView_Col_Label_Wait;
+ final private String COL_LABEL_HIRQ = Messages.CpuLoadView_Col_label_HIrq;
+
+ final private String COL_LABEL_SIRQ = Messages.CpuLoadView_Col_Label_SIrq;
+
+ private ITool tool = null;
+ private TableViewer viewer;
+
+ private Action runAction;
+ private Action pauseAction;
+ private Action optionsAction;
+ private Action disconnectAction;
+ private Action connectAction;
+
+ private boolean receivedData = false;
+
+ private IPartListener partActivationListener = new IPartListener() {
+ public void partActivated(IWorkbenchPart part) {
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (CpuLoadView.this.getSite().getPart() == part) {
+ ITool tool = CpuLoadView.this.getTool();
+ if (null != tool) {
+ tool.disconnect();
+ }
+ }
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ }
+ };
+
+ /**
+ * The constructor.
+ */
+ public CpuLoadView() {
+ }
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+
+ viewer = new TableViewer(parent, SWT.FULL_SELECTION |
+ SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setContentProvider(new CpuLoadViewContentProvider());
+ viewer.setLabelProvider(new CpuLoadViewLabelProvider());
+ viewer.setSorter(new CpuSorter());
+
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_CPU);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_USER_MODE);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_NICE);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_SYSTEM);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_IDLE);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_WAIT);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_HIRQ);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_SIRQ);
+
+ refresh();
+ resize();
+
+ makeActions();
+ // hookDoubleClickAction();
+ addToToolBar();
+
+ getViewSite()
+ .getWorkbenchWindow()
+ .getPartService()
+ .addPartListener(partActivationListener);
+
+ setConnectEnabled(true);
+ setRunPauseEnabled(false, false);
+ }
+
+ private void addToToolBar() {
+ IActionBars actionBars = getViewSite().getActionBars();
+ IToolBarManager toolBarMmanager = actionBars.getToolBarManager();
+ toolBarMmanager.add(runAction);
+ toolBarMmanager.add(pauseAction);
+ toolBarMmanager.add(optionsAction);
+ toolBarMmanager.add(disconnectAction);
+ toolBarMmanager.add(connectAction);
+ }
+
+ private void makeActions() {
+
+ runAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionRun();
+ delegate.init(CpuLoadView.this);
+ delegate.run(this);
+ setRunPauseEnabled(false, true);
+ }
+ };
+ runAction.setToolTipText(Messages.CpuLoadView_Action_Run);
+ runAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_RUN));
+
+ pauseAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionPause();
+ delegate.init(CpuLoadView.this);
+ delegate.run(this);
+ setRunPauseEnabled(true, false);
+ }
+ };
+ pauseAction.setToolTipText(Messages.CpuLoadView_Action_Pause);
+ pauseAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_PAUSE));
+
+ optionsAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionOptions();
+ delegate.init(CpuLoadView.this);
+ delegate.run(this);
+ }
+ };
+ optionsAction.setToolTipText(Messages.CpuLoadView_Action_Options);
+ optionsAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_OPTIONS));
+
+ disconnectAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionDisconnect();
+ delegate.init(CpuLoadView.this);
+ delegate.run(this);
+ }
+ };
+ disconnectAction.setToolTipText(Messages.CpuLoadView_Action_Disconnect);
+ disconnectAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_DISCONNECT));
+
+ connectAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionConnect();
+ delegate.init(CpuLoadView.this);
+ delegate.run(this);
+ }
+ };
+ connectAction.setToolTipText(Messages.CpuLoadView_Action_Connect);
+ connectAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_CONNECT));
+ }
+
+ private void setConnectEnabled(boolean bool) {
+ connectAction.setEnabled(bool);
+ disconnectAction.setEnabled(!bool);
+ }
+
+ private void setRunPauseEnabled(boolean runBool, boolean pauseBool) {
+ runAction.setEnabled(runBool);
+ pauseAction.setEnabled(pauseBool);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.ui.IToolView#getTool()
+ */
+ public ITool getTool() {
+ if(null == tool) {
+ tool = new CpuLoadTool();
+ tool.addListener(this);
+ }
+ return tool;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IListener#notify(org.eclipse.tml.linuxtools.network.INotifier, org.eclipse.tml.linuxtools.network.IConstants.EventCode, java.lang.Object)
+ */
+ public void notify(INotifier notifier, EventCode event, Object result) {
+ if (notifier == this.tool) {
+ final Object finalResult = result;
+ final EventCode finalEvent = event;
+ final ViewPart finalView = this;
+ final ITool finalTool = this.tool;
+
+ this.getViewSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ switch(finalEvent) {
+ case EVT_TOOL_REFRESH_VIEW:
+ viewer.setInput(finalResult);
+ refresh();
+ if (!receivedData) {
+ resize();
+ receivedData = true;
+ }
+ break;
+ case EVT_TOOL_CONNECT_FINISHED:
+ case EVT_TOOL_LOGIN_FINISHED:
+ switch ((OperationCode)finalResult) {
+ case SUCCESS:
+ setConnectEnabled(false);
+ setRunPauseEnabled(false, true);
+ break;
+ case LOGIN_REQUIRED: {
+ final DialogLogin dialog = new DialogLogin(
+ finalView.getViewSite().getShell(),
+ finalTool, false);
+ dialog.open();
+ }
+ break;
+ case LOGIN_FAILED: {
+ final DialogLogin dialog = new DialogLogin(
+ finalView.getViewSite().getShell(),
+ finalTool, true);
+ dialog.open();
+ }
+ break;
+ }
+ break;
+ case EVT_TOOL_DISCONNECT_FINISHED:
+ setConnectEnabled(true);
+ setRunPauseEnabled(false, false);
+ break;
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ *
+ */
+ public void refresh() {
+ viewer.refresh();
+ }
+
+ /**
+ *
+ */
+ public void resize() {
+ Table table = viewer.getTable();
+ for (int i = 0, n = table.getColumnCount(); i < n; i++) {
+ table.getColumn(i).pack();
+ }
+ }
+
+ /**
+ * @param data
+ */
+ public void setData (Object data) {
+ viewer.setInput(data);
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+} \ No newline at end of file
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewContentProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewContentProvider.java
new file mode 100644
index 0000000..968b005
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewContentProvider.java
@@ -0,0 +1,61 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/*
+ * 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).
+ */
+
+/**
+ * @author Otávio Ferranti
+ */
+public class CpuLoadViewContentProvider implements IStructuredContentProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object parent) {
+ if (parent instanceof String[][]) {
+ return (String[][]) parent;
+ } else {
+ String[][] aux = new String[1][];
+ aux[0] = new String[] {"", "", //$NON-NLS-1$ //$NON-NLS-2$
+ "", "", //$NON-NLS-1$ //$NON-NLS-2$
+ "", "", //$NON-NLS-1$ //$NON-NLS-2$
+ "", ""}; //$NON-NLS-1$ //$NON-NLS-2$
+ return aux;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewLabelProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewLabelProvider.java
new file mode 100644
index 0000000..9ad1c21
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/CpuLoadViewLabelProvider.java
@@ -0,0 +1,54 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class CpuLoadViewLabelProvider extends LabelProvider implements
+ ITableLabelProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ public Image getColumnImage(Object obj, int index) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ public String getColumnText(Object obj, int index) {
+ if (obj instanceof String[]) {
+ return getText(((Object[]) obj)[index]);
+ } else {
+ return new String(""); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object obj) {
+ return PlatformUI.getWorkbench().
+ getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
+ }
+}
+
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/DialogOptions.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/DialogOptions.java
new file mode 100644
index 0000000..187ba65
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/DialogOptions.java
@@ -0,0 +1,109 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import org.eclipse.tml.linuxtools.tools.ITool;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class DialogOptions extends TitleAreaDialog {
+
+ final private String WINDOW_TITLE = Messages.OptionsDialog_Window_Title;
+ final private String WINDOW_MESSAGE = Messages.OptionsDialog_Window_Message;
+ final private String LABEL_REFRESH = Messages.OptionsDialog_Label_Refresh_Rate;
+ final private String LABEL_TIMEUNIT = "ms"; //$NON-NLS-1$
+
+ private Spinner spinner;
+
+ private ITool tool = null;
+
+ /**
+ * The constructor.
+ * @param parent
+ */
+ public DialogOptions(Shell parent, ITool tool) {
+ super(parent);
+ this.tool = tool;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ setTitle(WINDOW_TITLE);
+ setMessage(WINDOW_MESSAGE);
+
+ Composite dialogArea = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(3, false);
+
+ gridLayout.marginLeft = 7;
+ gridLayout.marginRight = 7;
+
+ dialogArea.setLayout(gridLayout);
+ dialogArea.setLayoutData(new GridData(GridData.FILL_BOTH));
+ dialogArea.setFont(parent.getFont());
+
+ Label refreshLabel = new Label(dialogArea, SWT.NULL);
+ refreshLabel.setText(LABEL_REFRESH);
+
+ spinner = new Spinner(dialogArea, SWT.BORDER);
+
+ Label timeUnit = new Label(dialogArea, SWT.NULL);
+ timeUnit.setText(LABEL_TIMEUNIT);
+
+ spinner.setMinimum(0);
+ spinner.setMaximum(50000);
+ spinner.setSelection(tool.getRefreshDelay());
+ spinner.setIncrement(100);
+ spinner.setPageIncrement(500);
+ spinner.pack();
+
+ return dialogArea;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TitleAreaDialog#getInitialSize()
+ */
+ protected Point getInitialSize() {
+ return super.getInitialSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ tool.setRefreshDelay(spinner.getSelection());
+ super.okPressed();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
+ */
+ protected void cancelPressed() {
+ super.cancelPressed();
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.java
new file mode 100644
index 0000000..c5a3830
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.java
@@ -0,0 +1,49 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
+ "org.eclipse.tml.linuxtools.tools.cpuload.messages"; //$NON-NLS-1$
+ public static String CpuLoadProcessor_Msg_Executing_the_command;
+ public static String CpuLoadProcessor_Msg_Got_The_Result;
+ public static String CpuLoadView_Action_Connect;
+ public static String CpuLoadView_Action_Disconnect;
+ public static String CpuLoadView_Action_Options;
+ public static String CpuLoadView_Action_Pause;
+ public static String CpuLoadView_Action_Run;
+ public static String CpuLoadView_Col_Label_Cpu;
+ public static String CpuLoadView_Col_label_HIrq;
+ public static String CpuLoadView_Col_Label_Idle;
+ public static String CpuLoadView_Col_Label_Nice;
+ public static String CpuLoadView_Col_Label_SIrq;
+ public static String CpuLoadView_Col_Label_System;
+ public static String CpuLoadView_Col_Label_User_Mode;
+ public static String CpuLoadView_Col_Label_Wait;
+ public static String OptionsDialog_Label_Refresh_Rate;
+ public static String OptionsDialog_Window_Message;
+ public static String OptionsDialog_Window_Title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.properties
new file mode 100644
index 0000000..4c8f821
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages.properties
@@ -0,0 +1,38 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+CpuLoadView_Col_Label_Cpu=Cpu
+CpuLoadView_Col_Label_User_Mode=User
+CpuLoadView_Col_Label_Nice=Nice
+CpuLoadView_Col_Label_System=System
+CpuLoadView_Col_Label_Idle=Idle
+CpuLoadView_Col_Label_Wait=Wait
+CpuLoadView_Col_label_HIrq=HW Irq
+CpuLoadView_Col_Label_SIrq=SW Irq
+
+CpuLoadView_Action_Run=Run
+CpuLoadView_Action_Pause=Pause
+CpuLoadView_Action_Options=Options
+CpuLoadView_Action_Disconnect=Disconnect
+CpuLoadView_Action_Connect=Connect
+
+CpuLoadProcessor_Msg_Executing_the_command=Executing the command:
+CpuLoadProcessor_Msg_Got_The_Result=Got the result:
+
+OptionsDialog_Window_Title=Options
+OptionsDialog_Window_Message=Some options may take effect only after reconnection
+OptionsDialog_Label_Refresh_Rate=Refresh delay:
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages_pt.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages_pt.properties
new file mode 100644
index 0000000..f052c1b
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/Messages_pt.properties
@@ -0,0 +1,38 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+CpuLoadView_Col_Label_Cpu=Cpu
+CpuLoadView_Col_Label_User_Mode=Usuário
+CpuLoadView_Col_Label_Nice=Nice
+CpuLoadView_Col_Label_System=Sistema
+CpuLoadView_Col_Label_Idle=Ocioso
+CpuLoadView_Col_Label_Wait=Espera
+CpuLoadView_Col_label_HIrq=Int HW
+CpuLoadView_Col_Label_SIrq=Int SW
+
+CpuLoadView_Action_Run=Executar
+CpuLoadView_Action_Pause=Pausar
+CpuLoadView_Action_Options=Opções
+CpuLoadView_Action_Disconnect=Desconectar
+CpuLoadView_Action_Connect=Conectar
+
+CpuLoadProcessor_Msg_Executing_the_command=Executando o comando:
+CpuLoadProcessor_Msg_Got_The_Result=Resultado obtido:
+
+OptionsDialog_Window_Title=Opções
+OptionsDialog_Window_Message=Algumas opções só terão efeito após reconectar
+OptionsDialog_Label_Refresh_Rate=Intervalo de atualização:
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/ViewActionOptions.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/ViewActionOptions.java
new file mode 100644
index 0000000..8392868
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/cpuload/ViewActionOptions.java
@@ -0,0 +1,60 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.cpuload;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.tml.linuxtools.ui.IToolViewPart;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class ViewActionOptions implements IViewActionDelegate {
+
+ private IViewPart targetPart;
+
+ /**
+ * The constructor.
+ */
+ public ViewActionOptions() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ this.targetPart = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ final DialogOptions dialog = new DialogOptions(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ ((IToolViewPart) this.targetPart).getTool());
+ dialog.open();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapProcessor.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapProcessor.java
new file mode 100644
index 0000000..adacf50
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapProcessor.java
@@ -0,0 +1,139 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.memorymap;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Scanner;
+import java.util.regex.MatchResult;
+
+import org.eclipse.tml.common.utilities.logger.ILogger;
+
+import org.eclipse.tml.linuxtools.LinuxToolsPlugin;
+import org.eclipse.tml.linuxtools.network.IConstants.CommandCode;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+import org.eclipse.tml.linuxtools.tools.AbstractNotifier;
+import org.eclipse.tml.linuxtools.tools.IListener;
+import org.eclipse.tml.linuxtools.tools.INotifier;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class MemoryMapProcessor extends AbstractNotifier implements IListener {
+
+ final private String CMD_FETCH_IOMEM = "/proc/iomem"; //$NON-NLS-1$
+ final private String PARSE_PATTERN = "\\s*(\\w{8})-(\\w{8})\\s*:\\s*(.*)"; //$NON-NLS-1$
+
+ final private String MSG_EXECUTING_COMMAND =
+ Messages.MemoryMapProcessor_Msg_Executing_The_Command;
+
+ final private String MSG_GOT_RESULT =
+ Messages.MemoryMapProcessor_Msg_Got_The_Result;
+
+ final private int MAX_COLUMNS = 4;
+ private IConnectionProvider connectionProvider = null;
+
+ private ILogger logger = null;
+
+ /**
+ * The constructor;
+ * @param connectionProvider
+ */
+ public MemoryMapProcessor(IConnectionProvider connectionProvider) {
+ setConnectionProvider(connectionProvider);
+ logger = LinuxToolsPlugin.getLogger();
+ }
+
+ /**
+ * @throws IOException
+ */
+ public void gatherData() throws IOException {
+ connectionProvider.setResponseLength(8192);
+ connectionProvider.sendCommand(CommandCode.FETCH_FILE, this.CMD_FETCH_IOMEM);
+ logger.debug(MSG_EXECUTING_COMMAND + "\n" + this.CMD_FETCH_IOMEM); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IListener#notify(org.eclipse.tml.linuxtools.network.INotifier, org.eclipse.tml.linuxtools.network.IConstants.EventCode, java.lang.Object)
+ */
+ public void notify(INotifier notifier,
+ EventCode event,
+ Object result) {
+ if (notifier == this.connectionProvider &&
+ event == EventCode.EVT_PROVIDER_SENDCOMMAND_FINISHED) {
+ this.connectionProvider.setResponseLength(1024);
+ Object[][] parsedResult = parseIomem((StringBuffer) result);
+ this.notifyListeners(EventCode.EVT_PROCESSOR_GATHERDATA_FINISHED,
+ parsedResult);
+ }
+ }
+
+ /**
+ * @param connectionProvider
+ */
+ public void setConnectionProvider (IConnectionProvider connectionProvider) {
+ if (null != this.connectionProvider) {
+ this.connectionProvider.removeListener(this);
+ }
+ this.connectionProvider = connectionProvider;
+ if (null != this.connectionProvider) {
+ this.connectionProvider.addListener(this);
+ }
+ }
+
+ /**
+ * @param data
+ * @return
+ */
+ private Object[][] parseIomem(StringBuffer data) {
+ logger.debug(MSG_GOT_RESULT + "\n" + data.toString());
+
+ Scanner s1 = new Scanner(data.toString());
+
+ ArrayList<String[]> list = new ArrayList<String[]>();
+
+ int j = 0;
+
+ while (s1.hasNextLine()) {
+ Scanner s2 = new Scanner(s1.nextLine());
+ s2.findInLine(PARSE_PATTERN);
+
+ String[] entry = null;
+ try {
+ MatchResult result = s2.match();
+ entry = new String[MAX_COLUMNS];
+ for (int i = 1; i <= result.groupCount() && i <= MAX_COLUMNS - 1; i++) {
+ entry[i-1] = result.group(i);
+ }
+ entry[MAX_COLUMNS - 1] = new Integer(j).toString();
+ j++;
+ } catch (IllegalStateException ise) {
+ //TODO: Nothing ?
+ }
+
+ s2.close();
+ if (null != entry) {
+ list.add(entry);
+ }
+ }
+ s1.close();
+
+ String[][] retVal = new String[list.size()][MAX_COLUMNS];
+ for (int i = 0; i < retVal.length; i++) {
+ retVal[i] = list.get(i);
+ }
+ return retVal;
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapTool.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapTool.java
new file mode 100644
index 0000000..048fe45
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapTool.java
@@ -0,0 +1,184 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * Otávio Ferranti - Eldorado Research Institute - Bug 255255 [tml][proctools] Add extension points
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.memorymap;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.tml.linuxtools.network.IConnectionProvider;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+import org.eclipse.tml.linuxtools.tools.AbstractNotifier;
+import org.eclipse.tml.linuxtools.tools.IListener;
+import org.eclipse.tml.linuxtools.tools.INotifier;
+import org.eclipse.tml.linuxtools.tools.ITool;
+import org.eclipse.tml.linuxtools.utilities.Extensions;
+import org.eclipse.tml.linuxtools.utilities.ProtocolDescriptor;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class MemoryMapTool extends AbstractNotifier implements IListener, ITool {
+
+ private IConnectionProvider connectionProvider = null;
+ private MemoryMapProcessor processor = null;
+
+ private String[] requiredCapabilities = {"GET_FILE"}; //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.memorymap.iTool#createInstance(java.lang.String, int, java.lang.String)
+ */
+ public void connect (String host,
+ int port,
+ ProtocolDescriptor protocol) {
+
+ Class<IConnectionProvider> connectionProviderClass =
+ protocol.getConnectionProviderClass();
+
+ try {
+ Object aux = connectionProviderClass.newInstance();
+ connectionProvider = (IConnectionProvider) aux;
+ } catch (InstantiationException ie) {
+ } catch (IllegalAccessException iae) {
+ } catch (ClassCastException cce) {
+ }
+
+ connectionProvider.addListener(this);
+ try {
+ connectionProvider.connect(host, port);
+ } catch (IOException ie) { }
+ processor = new MemoryMapProcessor(connectionProvider);
+
+ processor.addListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#closeConnection()
+ */
+ public void disconnect() {
+ if (null != connectionProvider) {
+ try {
+ connectionProvider.disconnect();
+ } catch (IOException ie) {
+ }
+ connectionProvider = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.memorymap.iTool#login(java.lang.String, java.lang.String)
+ */
+ public void login (String user, String password) {
+ try {
+ connectionProvider.login(user, password);
+ } catch (IOException ie) {
+ //TODO: Nothing ?
+ }
+ }
+
+ public List<ProtocolDescriptor> getProtocolsDescriptors() {
+ List <ProtocolDescriptor> pdList = Extensions.findProcotols(requiredCapabilities);
+ return pdList;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.IListener#notify(org.eclipse.tml.linuxtools.tools.INotifier, org.eclipse.tml.linuxtools.network.IConstants.EventCode, java.lang.Object)
+ */
+ public void notify(INotifier notifier, EventCode event, Object result) {
+ try {
+ if (notifier == connectionProvider) {
+ switch (event) {
+ case EVT_PROVIDER_CONNECT_FINISHED:
+ if (OperationCode.SUCCESS == result) {
+ processor.gatherData();
+ }
+ this.notifyListeners(
+ EventCode.EVT_TOOL_CONNECT_FINISHED,
+ result);
+ break;
+ case EVT_PROVIDER_CONNECT_ERROR:
+ break;
+ case EVT_PROVIDER_LOGIN_FINISHED:
+ if (OperationCode.SUCCESS == result) {
+ processor.gatherData();
+ }
+ this.notifyListeners(
+ EventCode.EVT_TOOL_LOGIN_FINISHED,
+ result);
+ break;
+ case EVT_PROVIDER_SENDCOMMAND_FINISHED:
+ break;
+ case EVT_PROVIDER_SENDCOMMAND_ERROR:
+ break;
+ case EVT_PROVIDER_SENDDATA_FINISHED:
+ break;
+ case EVT_PROVIDER_SENDDATA_ERROR:
+ break;
+ case EVT_PROVIDER_DISCONNECT_FINISHED:
+ this.notifyListeners(
+ EventCode.EVT_TOOL_DISCONNECT_FINISHED,
+ result);
+ break;
+ }
+ }
+ if (notifier == processor) {
+ switch (event) {
+ case EVT_PROCESSOR_GATHERDATA_FINISHED:
+ notifyListeners(EventCode.EVT_TOOL_REFRESH_VIEW,
+ result);
+ break;
+ case EVT_PROCESSOR_GATHERDATA_ERROR:
+ break;
+ }
+ }
+ } catch (IOException ie) {
+ }
+ }
+
+ /**
+ *
+ */
+ public void refresh() {
+ try {
+ if (null != processor) {
+ processor.gatherData();
+ }
+ } catch (IOException ie) {
+ //TODO: Nothing ?
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#getRefreshDelay()
+ */
+ public int getRefreshDelay() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.tools.ITool#setRefreshDelay(int)
+ */
+ public void setRefreshDelay(int delay) {
+ // TODO Auto-generated method stub
+ }
+
+ public void start() {
+ // TODO Auto-generated method stub
+ }
+
+ public void stop() {
+ // TODO Auto-generated method stub
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapVViewLabelProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapVViewLabelProvider.java
new file mode 100644
index 0000000..0a6f34b
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapVViewLabelProvider.java
@@ -0,0 +1,59 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.memorymap;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class MemoryMapVViewLabelProvider extends LabelProvider implements
+ ITableLabelProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ public Image getColumnImage(Object obj, int index) {
+ //TODO: Enhance this.
+ if (index == 2) {
+ return getImage(((Object[]) obj)[index]);
+ } else {
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ public String getColumnText(Object obj, int index) {
+ if (obj instanceof String[]) {
+ return getText(((Object[]) obj)[index]);
+ } else {
+ return new String(""); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object obj) {
+ return PlatformUI.getWorkbench().
+ getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
+ }
+}
+
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapView.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapView.java
new file mode 100644
index 0000000..9a095f7
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapView.java
@@ -0,0 +1,290 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.memorymap;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.action.*;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.SWT;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.ViewPart;
+
+import org.eclipse.tml.linuxtools.LinuxToolsPlugin;
+import org.eclipse.tml.linuxtools.tools.IListener;
+import org.eclipse.tml.linuxtools.tools.INotifier;
+import org.eclipse.tml.linuxtools.tools.ITool;
+import org.eclipse.tml.linuxtools.ui.IToolViewPart;
+import org.eclipse.tml.linuxtools.ui.DialogLogin;
+import org.eclipse.tml.linuxtools.ui.ViewActionDisconnect;
+import org.eclipse.tml.linuxtools.ui.ViewActionConnect;
+import org.eclipse.tml.linuxtools.ui.ViewActionRefresh;
+import org.eclipse.tml.linuxtools.network.IConstants.EventCode;
+import org.eclipse.tml.linuxtools.network.IConstants.OperationCode;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class MemoryMapView extends ViewPart implements IToolViewPart, IListener {
+
+ private class AddressSorter extends ViewerSorter {
+
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ int result = 0;
+ try {
+ int a = new Integer(((String[]) e1)[MAX_COLUMNS - 1]).intValue();
+ int b = new Integer(((String[]) e2)[MAX_COLUMNS - 1]).intValue();
+ if (a > b) {
+ result = 1;
+ } else if (a < b) {
+ result = -1;
+ };
+ }
+ catch (NumberFormatException nfe) {
+ //TODO: Nothing ?
+ }
+ return result;
+ }
+ }
+ final private String COL_LABEL_ADDRESS_START = Messages.MemoryMapView_Col_Label_Address_Start;
+ final private String COL_LABEL_ADDRESS_END = Messages.MemoryMapView_Col_Label_Address_End;
+ final private String COL_LABEL_REGION = Messages.MemoryMapView_Col_label_Region;
+
+ final private int MAX_COLUMNS = 4;
+
+ private ITool tool = null;
+ private TableViewer viewer;
+
+ private Action refreshAction;
+ private Action disconnectAction;
+ private Action connectAction;
+
+ private IPartListener partActivationListener = new IPartListener() {
+ public void partActivated(IWorkbenchPart part) {
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (MemoryMapView.this.getSite().getPart() == part) {
+ ITool tool = MemoryMapView.this.getTool();
+ if (null != tool) {
+ tool.disconnect();
+ }
+ }
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ }
+ };
+
+ /**
+ * The constructor.
+ */
+ public MemoryMapView() {
+ }
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+
+ viewer = new TableViewer(parent, SWT.FULL_SELECTION |
+ SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setContentProvider(new MemoryMapViewContentProvider());
+ viewer.setLabelProvider(new MemoryMapVViewLabelProvider());
+ viewer.setSorter(new AddressSorter());
+
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_ADDRESS_START);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_ADDRESS_END);
+ new TableColumn(table, SWT.LEFT).setText(COL_LABEL_REGION);
+
+ refresh();
+ resize();
+
+ makeActions();
+ // hookDoubleClickAction();
+ addToToolBar();
+
+ getViewSite()
+ .getWorkbenchWindow()
+ .getPartService()
+ .addPartListener(partActivationListener);
+
+ setConnectEnabled(true);
+ refreshAction.setEnabled(false);
+ }
+
+ private void addToToolBar() {
+ IActionBars actionBars = getViewSite().getActionBars();
+ IToolBarManager toolBarMmanager = actionBars.getToolBarManager();
+ toolBarMmanager.add(refreshAction);
+ toolBarMmanager.add(disconnectAction);
+ toolBarMmanager.add(connectAction);
+ }
+
+ private void makeActions() {
+
+ refreshAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionRefresh();
+ delegate.init(MemoryMapView.this);
+ delegate.run(this);
+ this.setEnabled(false);
+ }
+ };
+ refreshAction.setToolTipText(Messages.MemoryMapView_Action_Refresh);
+ refreshAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_REFRESH));
+
+ disconnectAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionDisconnect();
+ delegate.init(MemoryMapView.this);
+ delegate.run(this);
+ }
+ };
+ disconnectAction.setToolTipText(Messages.MemoryMapView_Action_Disconnect);
+ disconnectAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_DISCONNECT));
+
+ connectAction = new Action() {
+ public void run() {
+ IViewActionDelegate delegate = new ViewActionConnect();
+ delegate.init(MemoryMapView.this);
+ delegate.run(this);
+ }
+ };
+ connectAction.setToolTipText(Messages.MemoryMapView_Action_Connect);
+ connectAction.setImageDescriptor(
+ LinuxToolsPlugin.getDefault().getImageDescriptor(LinuxToolsPlugin.ICON_CONNECT));
+
+ }
+
+ private void setConnectEnabled(boolean bool) {
+ connectAction.setEnabled(bool);
+ disconnectAction.setEnabled(!bool);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.ui.IToolView#getTool()
+ */
+ public ITool getTool() {
+ if(null == tool) {
+ tool = new MemoryMapTool();
+ tool.addListener(this);
+ }
+ return tool;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tml.linuxtools.network.IListener#notify(org.eclipse.tml.linuxtools.network.INotifier, org.eclipse.tml.linuxtools.network.IConstants.EventCode, java.lang.Object)
+ */
+ public void notify(INotifier notifier, EventCode event, Object result) {
+ if (notifier == tool) {
+ final Object finalResult = result;
+ final EventCode finalEvent = event;
+ final ViewPart finalView = this;
+ final ITool finalTool = this.tool;
+
+ this.getViewSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ switch(finalEvent) {
+ case EVT_TOOL_REFRESH_VIEW:
+ viewer.setInput(finalResult);
+ refreshAction.setEnabled(true);
+ refresh();
+ resize();
+ break;
+ case EVT_TOOL_CONNECT_FINISHED:
+ case EVT_TOOL_LOGIN_FINISHED:
+ switch ((OperationCode)finalResult) {
+ case SUCCESS:
+ setConnectEnabled(false);
+ refreshAction.setEnabled(true);
+ break;
+ case LOGIN_REQUIRED: {
+ final DialogLogin dialog = new DialogLogin(
+ finalView.getViewSite().getShell(),
+ finalTool, false);
+ dialog.open();
+ }
+ break;
+ case LOGIN_FAILED: {
+ final DialogLogin dialog = new DialogLogin(
+ finalView.getViewSite().getShell(),
+ finalTool, true);
+ dialog.open();
+ }
+ break;
+ }
+ break;
+ case EVT_TOOL_DISCONNECT_FINISHED:
+ setConnectEnabled(true);
+ refreshAction.setEnabled(false);
+ break;
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ *
+ */
+ public void refresh() {
+ viewer.refresh();
+ }
+
+ /**
+ *
+ */
+ public void resize() {
+ Table table = viewer.getTable();
+ for (int i = 0, n = table.getColumnCount(); i < n; i++) {
+ table.getColumn(i).pack();
+ }
+ }
+
+ /**
+ * @param data
+ */
+ public void setData (Object data) {
+ viewer.setInput(data);
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+} \ No newline at end of file
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapViewContentProvider.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapViewContentProvider.java
new file mode 100644
index 0000000..e24f886
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/MemoryMapViewContentProvider.java
@@ -0,0 +1,60 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.memorymap;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/*
+ * 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).
+ */
+
+/**
+ * @author Otávio Ferranti
+ */
+public class MemoryMapViewContentProvider implements IStructuredContentProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object parent) {
+ if (parent instanceof String[][]) {
+ return (String[][]) parent;
+ } else {
+ String[][] aux = new String[1][];
+ aux[0] = new String[] {"", //$NON-NLS-1$
+ "", //$NON-NLS-1$
+ ""}; //$NON-NLS-1$
+ return aux;
+ }
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.java b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.java
new file mode 100644
index 0000000..41ee2b3
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.java
@@ -0,0 +1,40 @@
+/********************************************************************************
+ * Copyright (c) 2008 Motorola Inc. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributor:
+ * Otávio Ferranti (Motorola)
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.tml.linuxtools.tools.memorymap;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Otávio Ferranti
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
+ "org.eclipse.tml.linuxtools.tools.memorymap.messages"; //$NON-NLS-1$
+
+ public static String MemoryMapProcessor_Msg_Executing_The_Command;
+ public static String MemoryMapProcessor_Msg_Got_The_Result;
+ public static String MemoryMapView_Action_Refresh;
+ public static String MemoryMapView_Action_Disconnect;
+ public static String MemoryMapView_Action_Connect;
+ public static String MemoryMapView_Col_Label_Address_End;
+ public static String MemoryMapView_Col_Label_Address_Start;
+ public static String MemoryMapView_Col_label_Region;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.properties
new file mode 100644
index 0000000..26498c4
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages.properties
@@ -0,0 +1,27 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+MemoryMapView_Col_Label_Address_Start=Start
+MemoryMapView_Col_Label_Address_End=End
+MemoryMapView_Col_label_Region=Region name
+
+MemoryMapView_Action_Refresh=Refresh
+MemoryMapView_Action_Disconnect=Disconnect
+MemoryMapView_Action_Connect=Connect
+
+MemoryMapProcessor_Msg_Executing_The_Command=Executing the command:
+MemoryMapProcessor_Msg_Got_The_Result=Got the result:
diff --git a/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages_pt.properties b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages_pt.properties
new file mode 100644
index 0000000..5e5213a
--- /dev/null
+++ b/proctools/plugins/org.eclipse.sequoyah.device.linuxtools/src/org/eclipse/sequoyah/linuxtools/tools/memorymap/Messages_pt.properties
@@ -0,0 +1,27 @@
+################################################################################
+# Copyright (c) 2008 Motorola Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Initial Contributors:
+# Otávio Ferranti (Motorola)
+#
+# Contributors:
+# {Name} (company) - description of contribution.
+################################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+# NLS_ENCODING=UTF-8
+
+MemoryMapView_Col_Label_Address_Start=Início
+MemoryMapView_Col_Label_Address_End=Fim
+MemoryMapView_Col_label_Region=Nome do intervalo
+
+MemoryMapView_Action_Refresh=Atualizar
+MemoryMapView_Action_Disconnect=Desconectar
+MemoryMapView_Action_Connect=Conectar
+
+MemoryMapProcessor_Msg_Executing_The_Command=Executando o comando:
+MemoryMapProcessor_Msg_Got_The_Result=Resultado obtido: