Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 224561 Details for
Bug 379217
Juno RC compatibility: Error messages after startup / when changing perspectives in an 4.2 AUT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Renamed plugin ...jubula.rc.rcp to ...jubula.rc.rcp.e3
0001-Sprint-Task-Renamed-plugin-.jubula.rc.rcp-to-.jubula.patch (text/plain), 266.16 KB, created by
Raimar Bühmann
on 2012-12-11 09:43:29 EST
(
hide
)
Description:
Renamed plugin ...jubula.rc.rcp to ...jubula.rc.rcp.e3
Filename:
MIME Type:
Creator:
Raimar Bühmann
Created:
2012-12-11 09:43:29 EST
Size:
266.16 KB
patch
obsolete
>From 067eb32a5f91daf5001e5e7f53318476ecb805c2 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Raimar=20B=C3=BChmann?= <raimar.buehmann@bredex.de> >Date: Mon, 10 Dec 2012 16:35:35 +0100 >Subject: [PATCH] Sprint Task - Renamed plugin ...jubula.rc.rcp to > ...jubula.rc.rcp.e3.common > >--- > .../gefapi/javadoc/javadoc.xml | 2 +- > org.eclipse.jubula.feature.source/feature.xml | 2 +- > org.eclipse.jubula.feature/feature.xml | 2 +- > org.eclipse.jubula.rc.rcp.e3.specific/.checkstyle | 7 + > org.eclipse.jubula.rc.rcp.e3.specific/.classpath | 7 + > org.eclipse.jubula.rc.rcp.e3.specific/.gitignore | 2 + > org.eclipse.jubula.rc.rcp.e3.specific/.project | 41 ++ > .../META-INF/MANIFEST.MF | 12 + > org.eclipse.jubula.rc.rcp.e3.specific/about.html | 28 + > .../build.properties | 17 + > org.eclipse.jubula.rc.rcp.e3.specific/plugin.xml | 11 + > org.eclipse.jubula.rc.rcp.e3.specific/pom.xml | 20 + > org.eclipse.jubula.rc.rcp.e3/.checkstyle | 7 + > org.eclipse.jubula.rc.rcp.e3/.classpath | 24 + > org.eclipse.jubula.rc.rcp.e3/.gitignore | 3 + > org.eclipse.jubula.rc.rcp.e3/.project | 41 ++ > org.eclipse.jubula.rc.rcp.e3/META-INF/MANIFEST.MF | 30 + > org.eclipse.jubula.rc.rcp.e3/about.html | 28 + > org.eclipse.jubula.rc.rcp.e3/build.properties | 32 + > org.eclipse.jubula.rc.rcp.e3/genLib.xml | 111 +++ > org.eclipse.jubula.rc.rcp.e3/plugin.xml | 14 + > org.eclipse.jubula.rc.rcp.e3/pom.xml | 77 +++ > org.eclipse.jubula.rc.rcp.e3/resources/logback.xml | 20 + > .../eclipse/jubula/rc/rcp/e3/accessor/Startup.java | 694 +++++++++++++++++++ > .../gef/factory/DefaultEditPartAdapterFactory.java | 85 +++ > .../identifier/ClassCountEditPartIdentifier.java | 73 ++ > .../rcp/e3/gef/identifier/IEditPartIdentifier.java | 39 ++ > .../gef/identifier/StaticEditPartIdentifier.java | 53 ++ > .../e3/gef/implclasses/FigureCanvasImplClass.java | 763 +++++++++++++++++++++ > .../rc/rcp/e3/gef/inspector/FigureHighlighter.java | 196 ++++++ > .../inspector/GefInspectorListenerAppender.java | 440 ++++++++++++ > .../rc/rcp/e3/gef/listener/GefPartListener.java | 141 ++++ > .../rc/rcp/e3/gef/util/FigureCanvasUtil.java | 114 +++ > org.eclipse.jubula.rc.rcp.e4.compat/.checkstyle | 7 + > org.eclipse.jubula.rc.rcp.e4.compat/.classpath | 7 + > org.eclipse.jubula.rc.rcp.e4.compat/.gitignore | 2 + > org.eclipse.jubula.rc.rcp.e4.compat/.project | 41 ++ > .../META-INF/MANIFEST.MF | 12 + > org.eclipse.jubula.rc.rcp.e4.compat/about.html | 28 + > .../build.properties | 17 + > org.eclipse.jubula.rc.rcp.e4.compat/plugin.xml | 11 + > org.eclipse.jubula.rc.rcp.e4.compat/pom.xml | 20 + > org.eclipse.jubula.rc.rcp/.checkstyle | 7 - > org.eclipse.jubula.rc.rcp/.classpath | 24 - > org.eclipse.jubula.rc.rcp/.gitignore | 3 - > org.eclipse.jubula.rc.rcp/.project | 41 -- > org.eclipse.jubula.rc.rcp/META-INF/MANIFEST.MF | 30 - > org.eclipse.jubula.rc.rcp/about.html | 28 - > org.eclipse.jubula.rc.rcp/build.properties | 32 - > org.eclipse.jubula.rc.rcp/genLib.xml | 111 --- > org.eclipse.jubula.rc.rcp/plugin.xml | 14 - > org.eclipse.jubula.rc.rcp/pom.xml | 77 --- > org.eclipse.jubula.rc.rcp/resources/logback.xml | 20 - > .../eclipse/jubula/rc/rcp/accessor/Startup.java | 694 ------------------- > .../gef/factory/DefaultEditPartAdapterFactory.java | 85 --- > .../identifier/ClassCountEditPartIdentifier.java | 73 -- > .../rc/rcp/gef/identifier/IEditPartIdentifier.java | 39 -- > .../gef/identifier/StaticEditPartIdentifier.java | 53 -- > .../rcp/gef/implclasses/FigureCanvasImplClass.java | 763 --------------------- > .../rc/rcp/gef/inspector/FigureHighlighter.java | 196 ------ > .../inspector/GefInspectorListenerAppender.java | 440 ------------ > .../rc/rcp/gef/listener/GefPartListener.java | 141 ---- > .../jubula/rc/rcp/gef/util/FigureCanvasUtil.java | 114 --- > org.eclipse.jubula.releng.server/pom.xml | 4 +- > 64 Dateien geändert, 3281 Zeilen hinzugefügt(+), 2989 Zeilen entfernt(-) > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/.checkstyle > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/.classpath > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/.gitignore > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/.project > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/META-INF/MANIFEST.MF > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/about.html > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/build.properties > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/plugin.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/pom.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e3.specific/src/.keep > create mode 100644 org.eclipse.jubula.rc.rcp.e3/.checkstyle > create mode 100644 org.eclipse.jubula.rc.rcp.e3/.classpath > create mode 100644 org.eclipse.jubula.rc.rcp.e3/.gitignore > create mode 100644 org.eclipse.jubula.rc.rcp.e3/.project > create mode 100644 org.eclipse.jubula.rc.rcp.e3/META-INF/MANIFEST.MF > create mode 100644 org.eclipse.jubula.rc.rcp.e3/about.html > create mode 100644 org.eclipse.jubula.rc.rcp.e3/build.properties > create mode 100644 org.eclipse.jubula.rc.rcp.e3/genLib.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e3/plugin.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e3/pom.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e3/resources/logback.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/accessor/Startup.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/factory/DefaultEditPartAdapterFactory.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/ClassCountEditPartIdentifier.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/IEditPartIdentifier.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/StaticEditPartIdentifier.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/implclasses/FigureCanvasImplClass.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/FigureHighlighter.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/GefInspectorListenerAppender.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/listener/GefPartListener.java > create mode 100644 org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/util/FigureCanvasUtil.java > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/.checkstyle > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/.classpath > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/.gitignore > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/.project > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/META-INF/MANIFEST.MF > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/about.html > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/build.properties > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/plugin.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/pom.xml > create mode 100644 org.eclipse.jubula.rc.rcp.e4.compat/src/.keep > delete mode 100644 org.eclipse.jubula.rc.rcp/.checkstyle > delete mode 100644 org.eclipse.jubula.rc.rcp/.classpath > delete mode 100644 org.eclipse.jubula.rc.rcp/.gitignore > delete mode 100644 org.eclipse.jubula.rc.rcp/.project > delete mode 100644 org.eclipse.jubula.rc.rcp/META-INF/MANIFEST.MF > delete mode 100644 org.eclipse.jubula.rc.rcp/about.html > delete mode 100644 org.eclipse.jubula.rc.rcp/build.properties > delete mode 100644 org.eclipse.jubula.rc.rcp/genLib.xml > delete mode 100644 org.eclipse.jubula.rc.rcp/plugin.xml > delete mode 100644 org.eclipse.jubula.rc.rcp/pom.xml > delete mode 100644 org.eclipse.jubula.rc.rcp/resources/logback.xml > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/accessor/Startup.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/factory/DefaultEditPartAdapterFactory.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/ClassCountEditPartIdentifier.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/IEditPartIdentifier.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/StaticEditPartIdentifier.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/implclasses/FigureCanvasImplClass.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/FigureHighlighter.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/GefInspectorListenerAppender.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/listener/GefPartListener.java > delete mode 100644 org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/util/FigureCanvasUtil.java > >diff --git a/org.eclipse.jubula.documentation/gefapi/javadoc/javadoc.xml b/org.eclipse.jubula.documentation/gefapi/javadoc/javadoc.xml >index da38974..addc522 100644 >--- a/org.eclipse.jubula.documentation/gefapi/javadoc/javadoc.xml >+++ b/org.eclipse.jubula.documentation/gefapi/javadoc/javadoc.xml >@@ -20,7 +20,7 @@ > noindex="false" > nonavbar="false" > notree="false" >- packagenames="org.eclipse.jubula.rc.rcp.gef.identifier" >+ packagenames="org.eclipse.jubula.rc.rcp.e3.gef.identifier" > sourcepathref="rc.gef.extension.sourcepath" > splitindex="true" > use="true" >diff --git a/org.eclipse.jubula.feature.source/feature.xml b/org.eclipse.jubula.feature.source/feature.xml >index bbff633..752a27d 100644 >--- a/org.eclipse.jubula.feature.source/feature.xml >+++ b/org.eclipse.jubula.feature.source/feature.xml >@@ -194,7 +194,7 @@ BREDEX GmbH - initial API and implementation and/or initial documentation > unpack="false"/> > > <plugin >- id="org.eclipse.jubula.rc.rcp.source" >+ id="org.eclipse.jubula.rc.rcp.e3.source" > download-size="0" > install-size="0" > version="0.0.0" >diff --git a/org.eclipse.jubula.feature/feature.xml b/org.eclipse.jubula.feature/feature.xml >index 611128f..52bcfac 100644 >--- a/org.eclipse.jubula.feature/feature.xml >+++ b/org.eclipse.jubula.feature/feature.xml >@@ -327,7 +327,7 @@ BREDEX GmbH - initial API and implementation and/or initial documentation > unpack="false"/> > > <plugin >- id="org.eclipse.jubula.rc.rcp" >+ id="org.eclipse.jubula.rc.rcp.e3" > download-size="0" > install-size="0" > version="0.0.0" >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/.checkstyle b/org.eclipse.jubula.rc.rcp.e3.specific/.checkstyle >new file mode 100644 >index 0000000..0afff86 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/.checkstyle >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+ >+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> >+ <fileset name="all" enabled="true" check-config-name="Jubula" local="false"> >+ <file-match-pattern match-pattern="." include-pattern="true"/> >+ </fileset> >+</fileset-config> >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/.classpath b/org.eclipse.jubula.rc.rcp.e3.specific/.classpath >new file mode 100644 >index 0000000..2fbb7a2 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/.classpath >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<classpath> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >+ <classpathentry kind="src" path="src"/> >+ <classpathentry kind="output" path="bin"/> >+</classpath> >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/.gitignore b/org.eclipse.jubula.rc.rcp.e3.specific/.gitignore >new file mode 100644 >index 0000000..934e0e0 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/.gitignore >@@ -0,0 +1,2 @@ >+/bin >+/target >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/.project b/org.eclipse.jubula.rc.rcp.e3.specific/.project >new file mode 100644 >index 0000000..be803cb >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/.project >@@ -0,0 +1,41 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<projectDescription> >+ <name>org.eclipse.jubula.rc.rcp.e3.specific</name> >+ <comment></comment> >+ <projects> >+ </projects> >+ <buildSpec> >+ <buildCommand> >+ <name>org.eclipse.jdt.core.javabuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.ManifestBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.SchemaBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ </buildSpec> >+ <natures> >+ <nature>org.eclipse.pde.PluginNature</nature> >+ <nature>org.eclipse.jdt.core.javanature</nature> >+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> >+ </natures> >+ <linkedResources> >+ <link> >+ <name>.settings</name> >+ <type>2</type> >+ <locationURI>WORKSPACE_LOC/jubula/org.eclipse.jubula.project.configuration/settings/1.4</locationURI> >+ </link> >+ </linkedResources> >+</projectDescription> >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/META-INF/MANIFEST.MF b/org.eclipse.jubula.rc.rcp.e3.specific/META-INF/MANIFEST.MF >new file mode 100644 >index 0000000..6ba04c9 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/META-INF/MANIFEST.MF >@@ -0,0 +1,12 @@ >+Manifest-Version: 1.0 >+Bundle-ManifestVersion: 2 >+Bundle-Name: Jubula Remote Control - RCP e3 specific >+Bundle-SymbolicName: org.eclipse.jubula.rc.rcp.e3.specific;singleton:=true >+Bundle-Version: 2.0.0.qualifier >+Bundle-ClassPath: . >+Bundle-Vendor: Eclipse Jubula >+Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >+ org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)" >+Bundle-ActivationPolicy: lazy >+Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+ >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/about.html b/org.eclipse.jubula.rc.rcp.e3.specific/about.html >new file mode 100644 >index 0000000..f1be810 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/about.html >@@ -0,0 +1,28 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> >+<title>About</title> >+</head> >+<body lang="EN-US"> >+<h2>About This Content</h2> >+ >+<p>June 22, 2011</p> >+<h3>License</h3> >+ >+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise >+indicated below, the Content is provided to you under the terms and conditions of the >+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available >+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. >+For purposes of the EPL, "Program" will mean the Content.</p> >+ >+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is >+being redistributed by another party ("Redistributor") and different terms and conditions may >+apply to your use of any object code in the Content. Check the Redistributor's license that was >+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise >+indicated below, the terms and conditions of the EPL still apply to any source code in the Content >+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> >+ >+</body> >+</html> >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/build.properties b/org.eclipse.jubula.rc.rcp.e3.specific/build.properties >new file mode 100644 >index 0000000..7643e7c >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/build.properties >@@ -0,0 +1,17 @@ >+############################################################################### >+# Copyright (c) 2004, 2011 BREDEX GmbH. >+# 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 >+############################################################################### >+bin.includes = about.html,\ >+ META-INF/,\ >+ plugin.xml,\ >+ . >+jars.compile.order = . >+source.. = src/ >+output.. = bin/ >+javacSource = 1.4 >+javacTarget = 1.4 >+javacErrors.. = -assertIdentifier >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/plugin.xml b/org.eclipse.jubula.rc.rcp.e3.specific/plugin.xml >new file mode 100644 >index 0000000..cba6b0b >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/plugin.xml >@@ -0,0 +1,11 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?><!-- >+ Copyright (c) 2004, 2010 BREDEX GmbH. >+ 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 >+ --> >+ >+<plugin> >+</plugin> >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/pom.xml b/org.eclipse.jubula.rc.rcp.e3.specific/pom.xml >new file mode 100644 >index 0000000..8dd95bc >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3.specific/pom.xml >@@ -0,0 +1,20 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!-- Copyright (c) 2004, 2011 BREDEX GmbH. 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 --> >+<project >+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >+ <modelVersion>4.0.0</modelVersion> >+ <parent> >+ <artifactId>org.eclipse.jubula.releng.client</artifactId> >+ <groupId>org.eclipse.jubula</groupId> >+ <version>2.0.0-SNAPSHOT</version> >+ <relativePath>../org.eclipse.jubula.releng.client</relativePath> >+ </parent> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.rc.rcp.e3.specific</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ <packaging>eclipse-plugin</packaging> >+</project> >diff --git a/org.eclipse.jubula.rc.rcp.e3.specific/src/.keep b/org.eclipse.jubula.rc.rcp.e3.specific/src/.keep >new file mode 100644 >index 0000000..e69de29 >diff --git a/org.eclipse.jubula.rc.rcp.e3/.checkstyle b/org.eclipse.jubula.rc.rcp.e3/.checkstyle >new file mode 100644 >index 0000000..0afff86 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/.checkstyle >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+ >+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> >+ <fileset name="all" enabled="true" check-config-name="Jubula" local="false"> >+ <file-match-pattern match-pattern="." include-pattern="true"/> >+ </fileset> >+</fileset-config> >diff --git a/org.eclipse.jubula.rc.rcp.e3/.classpath b/org.eclipse.jubula.rc.rcp.e3/.classpath >new file mode 100644 >index 0000000..ba35c19 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/.classpath >@@ -0,0 +1,24 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<classpath> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >+ <classpathentry kind="src" path="src"/> >+ <classpathentry kind="lib" path="lib/ch.qos.logback.classic.jar"/> >+ <classpathentry kind="lib" path="lib/ch.qos.logback.core.jar"/> >+ <classpathentry kind="lib" path="lib/ch.qos.logback.slf4j.jar"/> >+ <classpathentry kind="lib" path="lib/org.apache.commons.beanutils.jar"/> >+ <classpathentry kind="lib" path="lib/org.apache.commons.lang.jar"/> >+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.communication"/> >+ <classpathentry kind="lib" path="lib/org.eclipse.jubula.communication.jar"/> >+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.rc.common"/> >+ <classpathentry kind="lib" path="lib/org.eclipse.jubula.rc.common.jar"/> >+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.rc.swt"/> >+ <classpathentry kind="lib" path="lib/org.eclipse.jubula.rc.swt.jar"/> >+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.tools"/> >+ <classpathentry kind="lib" path="lib/org.eclipse.jubula.tools.jar"/> >+ <classpathentry kind="lib" path="lib/org.slf4j.api.jar"/> >+ <classpathentry kind="lib" path="lib/org.slf4j.jcl.jar"/> >+ <classpathentry kind="lib" path="lib/xpp3_min-1.1.3.4.O.jar"/> >+ <classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/> >+ <classpathentry kind="output" path="bin"/> >+</classpath> >diff --git a/org.eclipse.jubula.rc.rcp.e3/.gitignore b/org.eclipse.jubula.rc.rcp.e3/.gitignore >new file mode 100644 >index 0000000..61e26da >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/.gitignore >@@ -0,0 +1,3 @@ >+/bin >+/target >+/lib >diff --git a/org.eclipse.jubula.rc.rcp.e3/.project b/org.eclipse.jubula.rc.rcp.e3/.project >new file mode 100644 >index 0000000..0d0d70e >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/.project >@@ -0,0 +1,41 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<projectDescription> >+ <name>org.eclipse.jubula.rc.rcp.e3</name> >+ <comment></comment> >+ <projects> >+ </projects> >+ <buildSpec> >+ <buildCommand> >+ <name>org.eclipse.jdt.core.javabuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.ManifestBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.SchemaBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ </buildSpec> >+ <natures> >+ <nature>org.eclipse.pde.PluginNature</nature> >+ <nature>org.eclipse.jdt.core.javanature</nature> >+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> >+ </natures> >+ <linkedResources> >+ <link> >+ <name>.settings</name> >+ <type>2</type> >+ <locationURI>WORKSPACE_LOC/jubula/org.eclipse.jubula.project.configuration/settings/1.4</locationURI> >+ </link> >+ </linkedResources> >+</projectDescription> >diff --git a/org.eclipse.jubula.rc.rcp.e3/META-INF/MANIFEST.MF b/org.eclipse.jubula.rc.rcp.e3/META-INF/MANIFEST.MF >new file mode 100644 >index 0000000..0de7b5e >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/META-INF/MANIFEST.MF >@@ -0,0 +1,30 @@ >+Manifest-Version: 1.0 >+Bundle-ManifestVersion: 2 >+Bundle-Name: Jubula Remote Control - RCP e3 >+Bundle-SymbolicName: org.eclipse.jubula.rc.rcp.e3; singleton:=true >+Bundle-Version: 2.0.0.qualifier >+Bundle-ClassPath: ., >+ lib/org.eclipse.jubula.tools.jar, >+ lib/org.apache.commons.lang.jar, >+ lib/org.apache.oro.jar, >+ lib/org.apache.commons.beanutils.jar, >+ lib/org.eclipse.jubula.rc.common.jar, >+ lib/org.eclipse.jubula.rc.swt.jar, >+ lib/org.eclipse.jubula.communication.jar, >+ lib/org.slf4j.api.jar, >+ lib/org.slf4j.jcl.jar, >+ lib/ch.qos.logback.slf4j.jar, >+ lib/ch.qos.logback.core.jar, >+ lib/ch.qos.logback.classic.jar, >+ lib/xpp3_min-1.1.3.4.O.jar, >+ lib/xstream-1.3.1.jar, >+ resources/ >+Bundle-Vendor: Eclipse Jubula >+Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >+ org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >+ org.eclipse.draw2d;bundle-version="[3.0.0,4.0.0)";resolution:=optional, >+ org.eclipse.gef;bundle-version="[3.0.0,4.0.0)";resolution:=optional >+Bundle-ActivationPolicy: lazy >+Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Export-Package: org.eclipse.jubula.rc.rcp.e3.gef.factory, >+ org.eclipse.jubula.rc.rcp.e3.gef.identifier >diff --git a/org.eclipse.jubula.rc.rcp.e3/about.html b/org.eclipse.jubula.rc.rcp.e3/about.html >new file mode 100644 >index 0000000..f1be810 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/about.html >@@ -0,0 +1,28 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> >+<title>About</title> >+</head> >+<body lang="EN-US"> >+<h2>About This Content</h2> >+ >+<p>June 22, 2011</p> >+<h3>License</h3> >+ >+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise >+indicated below, the Content is provided to you under the terms and conditions of the >+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available >+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. >+For purposes of the EPL, "Program" will mean the Content.</p> >+ >+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is >+being redistributed by another party ("Redistributor") and different terms and conditions may >+apply to your use of any object code in the Content. Check the Redistributor's license that was >+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise >+indicated below, the terms and conditions of the EPL still apply to any source code in the Content >+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> >+ >+</body> >+</html> >diff --git a/org.eclipse.jubula.rc.rcp.e3/build.properties b/org.eclipse.jubula.rc.rcp.e3/build.properties >new file mode 100644 >index 0000000..784306e >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/build.properties >@@ -0,0 +1,32 @@ >+############################################################################### >+# Copyright (c) 2004, 2011 BREDEX GmbH. >+# 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 >+############################################################################### >+bin.includes = about.html,\ >+ resources/,\ >+ META-INF/,\ >+ plugin.xml,\ >+ .,\ >+ lib/org.eclipse.jubula.tools.jar,\ >+ lib/org.apache.commons.lang.jar,\ >+ lib/org.apache.commons.beanutils.jar,\ >+ lib/org.apache.oro.jar,\ >+ lib/org.eclipse.jubula.rc.common.jar,\ >+ lib/org.eclipse.jubula.rc.swt.jar,\ >+ lib/org.eclipse.jubula.communication.jar,\ >+ lib/org.slf4j.api.jar,\ >+ lib/org.slf4j.jcl.jar,\ >+ lib/ch.qos.logback.slf4j.jar,\ >+ lib/ch.qos.logback.core.jar,\ >+ lib/ch.qos.logback.classic.jar,\ >+ lib/xpp3_min-1.1.3.4.O.jar,\ >+ lib/xstream-1.3.1.jar >+jars.compile.order = . >+source.. = src/ >+output.. = bin/ >+javacSource = 1.4 >+javacTarget = 1.4 >+javacErrors.. = -assertIdentifier >diff --git a/org.eclipse.jubula.rc.rcp.e3/genLib.xml b/org.eclipse.jubula.rc.rcp.e3/genLib.xml >new file mode 100644 >index 0000000..b11aafb >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/genLib.xml >@@ -0,0 +1,111 @@ >+<!-- >+ Copyright (c) 2004, 2011 BREDEX GmbH. >+ 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 >+ --> >+<project name="org.eclipse.jubula.rc.rcp.e3" default="gen-lib" basedir="."> >+ >+ <property name="OrbitStorage" value="../org.eclipse.jubula.rc.common.orbit" /> >+ <property name="SiteStorage" value="../org.eclipse.jubula.site/target/site/plugins" /> >+ >+ <target name="gen-lib"> >+ >+ <mkdir dir="lib" /> >+ <delete> >+ <fileset dir="lib" includes="**/*"/> >+ </delete> >+ >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="ch.qos.logback.classic*.jar" /> >+ </fileset> >+ <mergemapper to="ch.qos.logback.classic.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="ch.qos.logback.core*.jar" /> >+ </fileset> >+ <mergemapper to="ch.qos.logback.core.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="ch.qos.logback.slf4j*.jar" /> >+ </fileset> >+ <mergemapper to="ch.qos.logback.slf4j.jar"/> >+ </copy> >+ >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="org.apache.commons.beanutils*.jar" /> >+ </fileset> >+ <mergemapper to="org.apache.commons.beanutils.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="org.apache.commons.lang*.jar" /> >+ </fileset> >+ <mergemapper to="org.apache.commons.lang.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="org.apache.oro*.jar" /> >+ </fileset> >+ <mergemapper to="org.apache.oro.jar"/> >+ </copy> >+ >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="org.slf4j.api*.jar" /> >+ </fileset> >+ <mergemapper to="org.slf4j.api.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="${OrbitStorage}"> >+ <include name="org.slf4j.jcl*.jar" /> >+ </fileset> >+ <mergemapper to="org.slf4j.jcl.jar"/> >+ </copy> >+ >+ <!-- >+ The "SNAPSHOT" in the include selector ensures that only the non-source >+ JAR is used. Without it, the corresponding source JAR was being used, >+ and it was either being used exclusively or was *overwriting* the content >+ provided by the non-source JAR. This caused compilation to fail when also >+ building source bundles. >+ --> >+ <copy todir="lib"> >+ <fileset dir="../org.eclipse.jubula.rc.common/target"> >+ <include name="org.eclipse.jubula.rc.common*SNAPSHOT.jar" /> >+ </fileset> >+ <mergemapper to="org.eclipse.jubula.rc.common.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="../org.eclipse.jubula.rc.swt/target"> >+ <include name="org.eclipse.jubula.rc.swt*SNAPSHOT.jar" /> >+ </fileset> >+ <mergemapper to="org.eclipse.jubula.rc.swt.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="../org.eclipse.jubula.tools/target"> >+ <include name="org.eclipse.jubula.tools*SNAPSHOT.jar" /> >+ </fileset> >+ <mergemapper to="org.eclipse.jubula.tools.jar"/> >+ </copy> >+ <copy todir="lib"> >+ <fileset dir="../org.eclipse.jubula.communication/target"> >+ <include name="org.eclipse.jubula.communication*SNAPSHOT.jar" /> >+ </fileset> >+ <mergemapper to="org.eclipse.jubula.communication.jar"/> >+ </copy> >+ >+ <copy todir="lib"> >+ <fileset dir="../org.eclipse.jubula.tools/lib"> >+ <include name="xpp3*.jar" /> >+ <include name="xstream*.jar" /> >+ </fileset> >+ </copy> >+ </target> >+ >+</project> >diff --git a/org.eclipse.jubula.rc.rcp.e3/plugin.xml b/org.eclipse.jubula.rc.rcp.e3/plugin.xml >new file mode 100644 >index 0000000..e6b7142 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/plugin.xml >@@ -0,0 +1,14 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?><!-- >+ Copyright (c) 2004, 2010 BREDEX GmbH. >+ 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 >+ --> >+ >+<plugin> >+ <extension point="org.eclipse.ui.startup"> >+ <startup class="org.eclipse.jubula.rc.rcp.e3.accessor.Startup"/> >+ </extension> >+</plugin> >diff --git a/org.eclipse.jubula.rc.rcp.e3/pom.xml b/org.eclipse.jubula.rc.rcp.e3/pom.xml >new file mode 100644 >index 0000000..9e9eee3 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/pom.xml >@@ -0,0 +1,77 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >+ <modelVersion>4.0.0</modelVersion> >+ <parent> >+ <artifactId>org.eclipse.jubula.releng.client</artifactId> >+ <groupId>org.eclipse.jubula</groupId> >+ <version>2.0.0-SNAPSHOT</version> >+ <relativePath>../org.eclipse.jubula.releng.client</relativePath> >+ </parent> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.rc.rcp.e3</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ <packaging>eclipse-plugin</packaging> >+ >+ <dependencies> >+ <dependency> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.tools</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ </dependency> >+ <dependency> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.communication</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ </dependency> >+ <dependency> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.rc.common</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ </dependency> >+ <dependency> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.rc.swt</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ </dependency> >+ </dependencies> >+ >+ <build> >+ <plugins> >+ <plugin> >+ <artifactId>maven-antrun-plugin</artifactId> >+ <version>1.6</version> >+ <executions> >+ <execution> >+ <id>gen-lib</id> >+ <phase>generate-resources</phase> >+ <configuration> >+ <target> >+ <ant antfile="genLib.xml" /> >+ </target> >+ </configuration> >+ <goals> >+ <goal>run</goal> >+ </goals> >+ </execution> >+ </executions> >+ </plugin> >+ <plugin> >+ <artifactId>maven-clean-plugin</artifactId> >+ <version>2.4.1</version> >+ <configuration> >+ <filesets> >+ <fileset> >+ <directory>lib</directory> >+ <includes> >+ <include>*.jar</include> >+ </includes> >+ <followSymlinks>false</followSymlinks> >+ </fileset> >+ </filesets> >+ </configuration> >+ </plugin> >+ </plugins> >+ </build> >+ >+</project> >diff --git a/org.eclipse.jubula.rc.rcp.e3/resources/logback.xml b/org.eclipse.jubula.rc.rcp.e3/resources/logback.xml >new file mode 100644 >index 0000000..79b623c >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/resources/logback.xml >@@ -0,0 +1,20 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<configuration scan="true"> >+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> >+ <!-- encoders are by default assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder --> >+ <encoder> >+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n >+ </pattern> >+ </encoder> >+ </appender> >+ <appender name="FILE" class="ch.qos.logback.core.FileAppender"> >+ <file>${user.home}/.jubula/logs/rc_rcp.log</file> >+ <encoder> >+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n >+ </pattern> >+ </encoder> >+ </appender> >+ <root level="warn"> >+ <appender-ref ref="FILE" /> >+ </root> >+</configuration> >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/accessor/Startup.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/accessor/Startup.java >new file mode 100644 >index 0000000..e34ab59 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/accessor/Startup.java >@@ -0,0 +1,694 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.accessor; >+ >+import java.lang.reflect.InvocationTargetException; >+import java.lang.reflect.Method; >+import java.util.ArrayList; >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+import java.util.Properties; >+ >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.jface.action.IContributionItem; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.IDialogConstants; >+import org.eclipse.jface.dialogs.IPageChangedListener; >+import org.eclipse.jface.dialogs.PageChangedEvent; >+import org.eclipse.jface.preference.IPreferenceNode; >+import org.eclipse.jface.preference.PreferenceDialog; >+import org.eclipse.jface.preference.PreferenceManager; >+import org.eclipse.jubula.rc.common.AUTServer; >+import org.eclipse.jubula.rc.rcp.e3.gef.inspector.GefInspectorListenerAppender; >+import org.eclipse.jubula.rc.rcp.e3.gef.listener.GefPartListener; >+import org.eclipse.jubula.rc.swt.SwtAUTServer; >+import org.eclipse.jubula.rc.swt.listener.ComponentHandler; >+import org.eclipse.jubula.tools.constants.AutConfigConstants; >+import org.eclipse.jubula.tools.constants.AutEnvironmentConstants; >+import org.eclipse.jubula.tools.constants.CommandConstants; >+import org.eclipse.jubula.tools.constants.SwtAUTHierarchyConstants; >+import org.eclipse.jubula.tools.utils.EnvironmentUtils; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.CoolBar; >+import org.eclipse.swt.widgets.CoolItem; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Event; >+import org.eclipse.swt.widgets.Item; >+import org.eclipse.swt.widgets.Listener; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.swt.widgets.ToolBar; >+import org.eclipse.swt.widgets.Widget; >+import org.eclipse.ui.IEditorReference; >+import org.eclipse.ui.IPartListener2; >+import org.eclipse.ui.IStartup; >+import org.eclipse.ui.IViewReference; >+import org.eclipse.ui.IWindowListener; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchPartReference; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.internal.WorkbenchPartReference; >+ >+ >+/** >+ * Initializes an AUT Server in a plug-in context. >+ * >+ * It is very important to avoid referencing GEF (org.eclipse.gef.*) classes >+ * directly from this class, as this will cause Class Not Found errors if the >+ * AUT does not contain the GEF plug-in. >+ * >+ * @author BREDEX GmbH >+ * @created Oct 5, 2007 >+ */ >+public class Startup implements IStartup { >+ /** Key for GEF Viewer in component data */ >+ public static final String TEST_GEF_VIEWER_DATA_KEY = "TEST_GEF_VIEWER"; //$NON-NLS-1$ >+ >+ /** bundle ID for Eclipse Graphical Editing Framework (GEF) */ >+ public static final String GEF_BUNDLE_ID = "org.eclipse.gef"; //$NON-NLS-1$ >+ >+ /** Key for RCP partId in component data */ >+ private static final String TEST_RCP_DATA_KEY = >+ SwtAUTHierarchyConstants.RCP_NAME; >+ >+ /** ID suffix for toolbars belonging to a part (view/editor) */ >+ private static final String TOOLBAR_ID_SUFFIX = ".toolbar"; //$NON-NLS-1$ >+ >+ /** Single listener instance */ >+ private static IPartListener2 partNamingListener = >+ new PartNamingListener(); >+ >+ /** >+ * This listener >+ */ >+ private IPartListener2 m_gefListener = null; >+ >+ /** >+ * This listener assigns names to components as they become visible. The >+ * assigned name is determined by supporting data of the component and its >+ * surroundings. >+ * >+ * @author BREDEX GmbH >+ * @created Oct 19, 2007 >+ */ >+ private static class ComponentNamer implements Listener { >+ >+ /** map for naming dialog buttons */ >+ private static Map componentNAMES = new HashMap(); >+ >+ /** is name generation enabled */ >+ private static boolean generateNames = false; >+ >+ static { >+ generateNames = Boolean.valueOf( >+ EnvironmentUtils.getProcessEnvironment() >+ .getProperty( >+ AutEnvironmentConstants >+ .GENERATE_COMPONENT_NAMES)) >+ .booleanValue(); >+ >+ addCompName(IDialogConstants.ABORT_ID, "abort"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.BACK_ID, "back"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.CANCEL_ID, "cancel"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.CLIENT_ID, "client"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.CLOSE_ID, "close"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.DESELECT_ALL_ID, "deselectAll"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.DETAILS_ID, "details"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.FINISH_ID, "finish"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.HELP_ID, "help"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.IGNORE_ID, "ignore"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.INTERNAL_ID, "internal"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.NEXT_ID, "next"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.NO_ID, "no"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.NO_TO_ALL_ID, "noToAll"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.OK_ID, "ok"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.OPEN_ID, "open"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.PROCEED_ID, "proceed"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.RETRY_ID, "retry"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.SELECT_ALL_ID, "selectAll"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.SELECT_TYPES_ID, "selectTypes"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.SKIP_ID, "skip"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.STOP_ID, "stop"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.YES_ID, "yes"); //$NON-NLS-1$ >+ addCompName(IDialogConstants.YES_TO_ALL_ID, "yesToAll"); //$NON-NLS-1$ >+ } >+ >+ /** >+ * add component id <-> name mapping >+ * @param compID the component identifier >+ * @param compName the component name >+ */ >+ private static void addCompName(int compID, String compName) { >+ String staticNamePreafix = "dialog.button."; //$NON-NLS-1$ >+ componentNAMES.put(new Integer(compID), >+ staticNamePreafix + compName); >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public void handleEvent(Event event) { >+ addNameData(event.widget); >+ Item [] items = new Item [] {}; >+ if (event.widget instanceof ToolBar) { >+ items = ((ToolBar)event.widget).getItems(); >+ } else if (event.widget instanceof CoolBar) { >+ items = ((CoolBar)event.widget).getItems(); >+ } >+ for (int i = 0; i < items.length; i++) { >+ addNameData(items[i]); >+ } >+ } >+ >+ /** >+ * Adds name information to the given widget, if necessary. >+ * >+ * @param widget The widget to name. >+ */ >+ private void addNameData(Widget widget) { >+ // Assign name >+ if (widget != null && !widget.isDisposed()) { >+ if (widget.getData(Startup.TEST_RCP_DATA_KEY) != null) { >+ // Component already has a name, so we don't need to >+ // assign a new one. >+ return; >+ } >+ Object data = getWidgetData(widget); >+ >+ if (data instanceof IContributionItem) { >+ // Name buttons and toolitems according to the action that >+ // they represent, if possible. >+ String actionId = ((IContributionItem)data).getId(); >+ if (actionId != null && actionId.trim().length() > 0) { >+ >+ widget.setData(Startup.TEST_RCP_DATA_KEY, actionId); >+ ComponentHandler.getAutHierarchy() >+ .refreshComponentName(widget); >+ >+ } >+ } else if (data instanceof PreferenceDialog) { >+ PreferenceDialog prefDialog = (PreferenceDialog)data; >+ >+ // Add a listener to add name data as pages are >+ // selected/created. >+ prefDialog.addPageChangedListener( >+ new IPageChangedListener() { >+ >+ public void pageChanged(PageChangedEvent event) { >+ addNameDataToPrefPage(event.getSelectedPage()); >+ } >+ >+ }); >+ >+ // The listener won't notice the initally selected page, >+ // so we have to add that name data here. >+ addNameDataToPrefPage(prefDialog.getSelectedPage()); >+ } >+ if (generateNames && data instanceof Dialog) { >+ Dialog dialog = (Dialog)data; >+ setNameForDialogButtonBarButtons(dialog); >+ } >+ } >+ } >+ >+ /** >+ * >+ * @param widget The widget for which to get the data. >+ * @return the data object corresponding to the given widget. >+ */ >+ private Object getWidgetData(Widget widget) { >+ Object data = widget.getData(); >+ >+ // Handle the case of CoolBar containing CoolItem containing ToolBar. >+ // The CoolItem is the widget that represents the toolbar >+ // contribution, but it (the CoolItem) is not in our AUT >+ // component hierarchy, due to the fact that the ToolBar's >+ // getParent() returns the CoolBar rather than the CoolItem. >+ // To resolve this discrepancy, we use the data from the >+ // coresponding CoolItem to generate a name for the ToolBar. >+ try { >+ if (widget instanceof ToolBar) { >+ Composite toolbarParent = ((ToolBar)widget).getParent(); >+ if (toolbarParent instanceof CoolBar) { >+ CoolItem [] coolItems = >+ ((CoolBar)toolbarParent).getItems(); >+ for (int i = 0; i < coolItems.length; i++) { >+ CoolItem item = coolItems[i]; >+ if (item != null >+ && item.getControl() == widget) { >+ data = item.getData(); >+ } >+ } >+ } >+ } >+ } catch (NoClassDefFoundError e) { >+ // we may be running in eRCP which doesn't know >+ // about >+ // toolbars, so we just ignore this >+ } >+ >+ return data; >+ } >+ >+ /** >+ * @param dialog the dialog >+ */ >+ private void setNameForDialogButtonBarButtons(Dialog dialog) { >+ try { >+ Method getButtonMethod = Dialog.class.getDeclaredMethod( >+ "getButton", new Class[] { int.class }); //$NON-NLS-1$ >+ getButtonMethod.setAccessible(true); >+ >+ Iterator components = componentNAMES.keySet().iterator(); >+ while (components.hasNext()) { >+ Integer componentID = (Integer)components.next(); >+ invokeNameSetting(dialog, getButtonMethod, componentID, >+ componentNAMES.get(componentID)); >+ } >+ } catch (SecurityException e) { >+ // ignore exceptions >+ } catch (NoSuchMethodException e) { >+ // ignore exceptions >+ } >+ } >+ >+ /** >+ * use this method to set a name on the given object >+ * @param useObject the object >+ * @param methodToInvoke the method to invoke >+ * @param buttonID the button id >+ * @param buttonName the button name >+ */ >+ private void invokeNameSetting(Object useObject, Method methodToInvoke, >+ Integer buttonID, Object buttonName) { >+ Object ret = null; >+ try { >+ ret = methodToInvoke.invoke(useObject, >+ new Object[] { buttonID }); >+ } catch (IllegalArgumentException e) { >+ // ignore exceptions >+ } catch (IllegalAccessException e) { >+ // ignore exceptions >+ } catch (InvocationTargetException e) { >+ // ignore exceptions >+ } >+ if (ret instanceof Button) { >+ Button button = (Button)ret; >+ if (button.getData(TEST_RCP_DATA_KEY) == null) { >+ button.setData(TEST_RCP_DATA_KEY, buttonName); >+ } >+ } >+ } >+ >+ /** >+ * Attaches name data to the given page appropriate. >+ * >+ * @param selectedPage The page to which we will try to attach the >+ * name data. >+ */ >+ private void addNameDataToPrefPage(Object selectedPage) { >+ if (selectedPage == null) { >+ return; >+ } >+ PreferenceManager prefMan = >+ PlatformUI.getWorkbench().getPreferenceManager(); >+ >+ Iterator iter = >+ prefMan.getElements(PreferenceManager.PRE_ORDER).iterator(); >+ while (iter.hasNext()) { >+ IPreferenceNode prefNode = >+ (IPreferenceNode)iter.next(); >+ if (selectedPage.equals(prefNode.getPage())) { >+ Control pageControl = >+ prefNode.getPage().getControl(); >+ String prefNodeId = prefNode.getId(); >+ >+ // Assign id to page composite only if the composite exists >+ // and if the id is usable >+ if (pageControl != null >+ && !pageControl.isDisposed() >+ && pageControl.getData( >+ Startup.TEST_RCP_DATA_KEY) == null >+ && prefNodeId != null >+ && prefNodeId.trim().length() > 0) { >+ >+ pageControl.setData( >+ Startup.TEST_RCP_DATA_KEY, prefNodeId); >+ >+ Shell prefShell = >+ pageControl.getDisplay().getActiveShell(); >+ Event activateEvent = new Event(); >+ activateEvent.time = (int)System.currentTimeMillis(); >+ activateEvent.type = SWT.Activate; >+ activateEvent.widget = prefShell; >+ prefShell.notifyListeners(SWT.Activate, activateEvent); >+ >+ } >+ >+ // We found the page we were looking for, so we can stop >+ // searching. >+ break; >+ } >+ } >+ } >+ } >+ >+ /** >+ * Assigns the controls (Composites) of Parts unique names based on >+ * their partId. >+ * >+ * @author BREDEX GmbH >+ * @created Oct 5, 2007 >+ */ >+ static class PartNamingListener implements IPartListener2 { >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partActivated(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partBroughtToTop(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partClosed(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partDeactivated(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partHidden(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partInputChanged(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partOpened(IWorkbenchPartReference partRef) { >+ if (partRef instanceof WorkbenchPartReference) { >+ WorkbenchPartReference workbenchPartRef = >+ (WorkbenchPartReference)partRef; >+ // Get pane contents and part id >+ Control partContent = >+ workbenchPartRef.getPane().getControl(); >+ >+ if (partContent != null >+ && !partContent.isDisposed() >+ && partContent.getData(TEST_RCP_DATA_KEY) == null) { >+ >+ // Name pane control based on part >+ String partId = workbenchPartRef.getId(); >+ >+ // Append secondary id, if necessary >+ if (partRef instanceof IViewReference) { >+ String secondaryId = >+ ((IViewReference)partRef).getSecondaryId(); >+ if (secondaryId != null) { >+ partId += "_" + secondaryId; //$NON-NLS-1$ >+ } >+ } >+ >+ if (partId == null || partId.trim().length() == 0) { >+ // Don't assign a name if the id is unusable >+ return; >+ } >+ partContent.setData(TEST_RCP_DATA_KEY, partId); >+ >+ // Assign a corresponding id to the part's toolbar, if >+ // possible/usable. >+ Control partToolbar = >+ workbenchPartRef.getPane().getToolBar(); >+ if (partToolbar != null) { >+ partToolbar.setData(TEST_RCP_DATA_KEY, >+ partId + TOOLBAR_ID_SUFFIX); >+ } >+ >+ // A repaint is required in order for the aut component >+ // hierarchy to notice the change. >+ Shell shell = PlatformUI.getWorkbench() >+ .getActiveWorkbenchWindow().getShell(); >+ repaintToolbars(shell); >+ } >+ } >+ >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partVisible(IWorkbenchPartReference partRef) { >+ partOpened(partRef); >+ } >+ >+ } >+ >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public void earlyStartup() { >+ final Properties envVars = >+ EnvironmentUtils.getProcessEnvironment(); >+ >+ if (getValue(AutConfigConstants.AUT_AGENT_HOST, envVars) != null) { >+ final IWorkbench workbench = PlatformUI.getWorkbench(); >+ final Display display = workbench.getDisplay(); >+ initAutServer(display, envVars); >+ >+ display.syncExec(new Runnable() { >+ public void run() { >+ // add GEF listeners (and listener appenders) for GEF, if available >+ if (Platform.getBundle(Startup.GEF_BUNDLE_ID) != null) { >+ m_gefListener = new GefPartListener(); >+ AUTServer.getInstance().addInspectorListenerAppender( >+ new GefInspectorListenerAppender()); >+ } >+ >+ // add naming listener >+ ComponentNamer namer = new ComponentNamer(); >+ display.addFilter(SWT.Paint, namer); >+ display.addFilter(SWT.Activate, namer); >+ >+ // Add window listener >+ addWindowListener(workbench); >+ >+ IWorkbenchWindow window = >+ workbench.getActiveWorkbenchWindow(); >+ if (window != null) { >+ // Add part listeners >+ addPartListeners(window); >+ >+ // Handle existing parts >+ IWorkbenchPage [] pages = window.getPages(); >+ for (int i = 0; i < pages.length; i++) { >+ IEditorReference[] editorRefs = >+ pages[i].getEditorReferences(); >+ IViewReference[] viewRefs = >+ pages[i].getViewReferences(); >+ for (int j = 0; j < editorRefs.length; j++) { >+ partNamingListener.partOpened(editorRefs[j]); >+ if (m_gefListener != null) { >+ m_gefListener.partOpened(editorRefs[j]); >+ } >+ } >+ for (int k = 0; k < viewRefs.length; k++) { >+ partNamingListener.partOpened(viewRefs[k]); >+ if (m_gefListener != null) { >+ m_gefListener.partOpened(viewRefs[k]); >+ } >+ } >+ } >+ >+ // If a shell already exists, make sure that we get another >+ // chance to immediately add/use our naming listeners. >+ Shell mainShell = window.getShell(); >+ if (mainShell != null && !mainShell.isDisposed()) { >+ repaintToolbars(mainShell); >+ } >+ } >+ } >+ >+ }); >+ >+ // add listener to AUT >+ AUTServer.getInstance().addToolKitEventListenerToAUT(); >+ >+ } >+ >+ } >+ >+ /** >+ * Initializes the AUT Server for the host application. >+ * >+ * @param display The Display to use for the AUT Server. >+ * @param envVars Environment variables to consult in configuring the >+ * AUT Server. >+ */ >+ private void initAutServer(Display display, Properties envVars) { >+ ((SwtAUTServer)AUTServer.getInstance(CommandConstants >+ .AUT_SWT_SERVER)).setDisplay(display); >+ AUTServer.getInstance().setAutAgentHost(getValue( >+ AutConfigConstants.AUT_AGENT_HOST, envVars)); >+ AUTServer.getInstance().setAutAgentPort(getValue( >+ AutConfigConstants.AUT_AGENT_PORT, envVars)); >+ AUTServer.getInstance().setAutID(getValue( >+ AutConfigConstants.AUT_NAME, envVars)); >+ >+ AUTServer.getInstance().start(true); >+ } >+ >+ /** >+ * Adds a window listener to the given workbench. This listener adds a >+ * part naming listener to opening windows. >+ * >+ * @param workbench The workbench to which the listener will be added. >+ */ >+ private void addWindowListener(IWorkbench workbench) { >+ workbench.addWindowListener(new IWindowListener() { >+ >+ public void windowActivated(IWorkbenchWindow window) { >+ addPartListeners(window); >+ } >+ >+ public void windowClosed(IWorkbenchWindow window) { >+ // Do nothing >+ } >+ >+ public void windowDeactivated(IWorkbenchWindow window) { >+ // Do nothing >+ } >+ >+ public void windowOpened(IWorkbenchWindow window) { >+ addPartListeners(window); >+ } >+ >+ }); >+ } >+ >+ /** >+ * Fires a paint event on all Toolbars and Coolbars within the given shell. >+ * >+ * @param mainShell The shell to search for Coolbars and Toolbars. >+ */ >+ public static void repaintToolbars(Shell mainShell) { >+ List toolbarList = new ArrayList(); >+ getToolbars(mainShell, toolbarList); >+ Iterator iter = toolbarList.iterator(); >+ while (iter.hasNext()) { >+ Control toolbar = (Control)iter.next(); >+ toolbar.update(); >+ toolbar.redraw(); >+ toolbar.update(); >+ } >+ } >+ >+ /** >+ * Adds all Coolbars and Toolbars within the given composite to the given >+ * list. The search is is also performed recursively on children of the >+ * given composite. >+ * >+ * @param composite The composite to search. >+ * @param toolbarList The list to which found Toolbars and Coolbars will >+ * be added. >+ */ >+ public static void getToolbars(Composite composite, >+ List toolbarList) { >+ >+ if (composite != null && !composite.isDisposed()) { >+ Control [] children = composite.getChildren(); >+ for (int i = 0; i < children.length; i++) { >+ if (children[i] instanceof Composite) { >+ getToolbars((Composite)children[i], toolbarList); >+ } >+ try { >+ if (children[i] instanceof ToolBar >+ || children[i] instanceof CoolBar) { >+ >+ toolbarList.add(children[i]); >+ } >+ } catch (NoClassDefFoundError e) { >+ // we may be running in eRCP which doesn't know about >+ // toolbars, so we just ignore this >+ } >+ } >+ } >+ } >+ >+ /** >+ * Add part listeners to the given window. >+ * >+ * @param window The window to which the listeners will be added. >+ */ >+ private void addPartListeners(IWorkbenchWindow window) { >+ window.getPartService().addPartListener(partNamingListener); >+ if (m_gefListener != null) { >+ window.getPartService().addPartListener(m_gefListener); >+ } >+ } >+ >+ /** >+ * Returns the value for a given property. First, <code>envVars</code> >+ * is checked for the given property. If this >+ * property cannot be found there, the >+ * Java System Properties will be checked. If the property is not >+ * found there, <code>null</code> will be returned. >+ * >+ * @param envVars The first source to check for the given property. >+ * @param propName The name of the property for which to find the value. >+ * @return The value for the given property name, or <code>null</code> if >+ * given property name cannot be found. >+ */ >+ private String getValue(String propName, Properties envVars) { >+ String value = >+ envVars.getProperty(propName); >+ if (value == null) { >+ value = System.getProperty(propName); >+ } >+ return value; >+ } >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/factory/DefaultEditPartAdapterFactory.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/factory/DefaultEditPartAdapterFactory.java >new file mode 100644 >index 0000000..f745925 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/factory/DefaultEditPartAdapterFactory.java >@@ -0,0 +1,85 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.factory; >+ >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.gef.EditPart; >+import org.eclipse.jubula.rc.rcp.e3.gef.identifier.ClassCountEditPartIdentifier; >+import org.eclipse.jubula.rc.rcp.e3.gef.identifier.IEditPartIdentifier; >+ >+ >+/** >+ * The default adapter factory for getting adapters from EditPart to >+ * IEditPartIdentifier. >+ * >+ * @author BREDEX GmbH >+ * @created May 13, 2009 >+ */ >+public class DefaultEditPartAdapterFactory implements IAdapterFactory { >+ >+ /** the types managed by this factory */ >+ private static final Class [] ADAPTABLE_TYPES = >+ new Class [] {EditPart.class}; >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public Object getAdapter(Object adaptableObject, Class adapterType) { >+ if (adaptableObject instanceof EditPart) { >+ if (adapterType == IEditPartIdentifier.class) { >+ return new ClassCountEditPartIdentifier( >+ (EditPart)adaptableObject); >+ } >+ } >+ return null; >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public Class[] getAdapterList() { >+ return ADAPTABLE_TYPES; >+ } >+ >+ /** >+ * >+ * @param editPart The EditPart for which to find the IEditPartIdentifier. >+ * @return the IEditPartIdentifier for the given EditPart. First, an attempt >+ * is made to load this from a registered adapter factory. If this >+ * does not provide an adapter, then this adapter factory is >+ * queried, providing a default implementation. >+ */ >+ public static IEditPartIdentifier loadFigureIdentifier(EditPart editPart) { >+ if (editPart == null) { >+ // null-safe >+ return null; >+ } >+ IEditPartIdentifier editPartIdentifier = >+ (IEditPartIdentifier)Platform.getAdapterManager().loadAdapter( >+ editPart, IEditPartIdentifier.class.getName()); >+// if (editPartIdentifier == null) { >+// AccessibleEditPart accessible = >+// (AccessibleEditPart)Platform.getAdapterManager().loadAdapter( >+// editPart, AccessibleEditPart.class.getName()); >+// AccessibleEvent e = new AccessibleEvent(IEditPartIdentifier.class); >+// accessible.getName(e); >+// if (e.result != null) { >+// editPartIdentifier = new StaticEditPartIdentifier(e.result); >+// } >+// } >+ if (editPartIdentifier == null) { >+ editPartIdentifier = new ClassCountEditPartIdentifier(editPart); >+ } >+ >+ return editPartIdentifier; >+ } >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/ClassCountEditPartIdentifier.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/ClassCountEditPartIdentifier.java >new file mode 100644 >index 0000000..bebfaff >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/ClassCountEditPartIdentifier.java >@@ -0,0 +1,73 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.identifier; >+ >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.Map; >+ >+import org.eclipse.gef.EditPart; >+ >+/** >+ * Default implementation of {@link IEditPartIdentifier}. The identifier is >+ * the name of the class of the {@link EditPart} plus a sequential number. >+ * >+ * @author BREDEX GmbH >+ * @created May 13, 2009 >+ */ >+public class ClassCountEditPartIdentifier implements IEditPartIdentifier { >+ >+ /** the EditPart for which identifiers can be generated */ >+ private EditPart m_editPart; >+ >+ /** >+ * Constructor >+ * >+ * @param editPart The EditPart for which identifiers can be generated. >+ */ >+ public ClassCountEditPartIdentifier(EditPart editPart) { >+ m_editPart = editPart; >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public String getIdentifier() { >+ EditPart parent = m_editPart.getParent(); >+ String className = m_editPart.getClass().getName(); >+ String id = className; >+ if (parent != null) { >+ id += "_"; //$NON-NLS-1$ >+ Iterator siblingIterator = parent.getChildren().iterator(); >+ boolean isFound = false; >+ int count = 0; >+ while (siblingIterator.hasNext() && !isFound) { >+ EditPart sibling = (EditPart)siblingIterator.next(); >+ if (sibling == m_editPart) { >+ isFound = true; >+ } >+ if (sibling.getClass().getName().equals(className)) { >+ count++; >+ } >+ } >+ id += count; >+ } >+ return id; >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public Map getConnectionAnchors() { >+ return new HashMap(); >+ } >+ >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/IEditPartIdentifier.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/IEditPartIdentifier.java >new file mode 100644 >index 0000000..ed2c6bd >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/IEditPartIdentifier.java >@@ -0,0 +1,39 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.identifier; >+ >+import java.util.Map; >+ >+ >+ >+/** >+ * Encapsulates the ability to generate unique IDs for a given >+ * {@link org.eclipse.gef.EditPart}. >+ * >+ * @author BREDEX GmbH >+ * @created May 13, 2009 >+ */ >+public interface IEditPartIdentifier { >+ >+ /** >+ * >+ * @return a String uniquely identifying the EditPart. >+ */ >+ public String getIdentifier(); >+ >+ /** >+ * >+ * @return a map that correlates identifiers (<code>String</code>s) with >+ * <code>ConnectionAnchor</code>s. >+ */ >+ public Map getConnectionAnchors(); >+ >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/StaticEditPartIdentifier.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/StaticEditPartIdentifier.java >new file mode 100644 >index 0000000..758f48f >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/identifier/StaticEditPartIdentifier.java >@@ -0,0 +1,53 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.identifier; >+ >+import java.util.Collections; >+import java.util.Map; >+ >+ >+/** >+ * Provides a static String as an identifier. This class does not take the >+ * state of the {@link org.eclipse.gef.EditPart} into account, so it is useful >+ * for stateless {@link org.eclipse.gef.EditPart}s (ex. containers). >+ * >+ * @author BREDEX GmbH >+ * @created May 19, 2009 >+ */ >+public class StaticEditPartIdentifier implements IEditPartIdentifier { >+ >+ /** the identifier that will always be returned */ >+ private String m_id; >+ >+ /** >+ * Constructor >+ * >+ * @param id The static identifier String that will always be returned. >+ */ >+ public StaticEditPartIdentifier(String id) { >+ m_id = id; >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public String getIdentifier() { >+ return m_id; >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public Map getConnectionAnchors() { >+ return Collections.EMPTY_MAP; >+ } >+ >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/implclasses/FigureCanvasImplClass.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/implclasses/FigureCanvasImplClass.java >new file mode 100644 >index 0000000..49ef7de >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/implclasses/FigureCanvasImplClass.java >@@ -0,0 +1,763 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.implclasses; >+ >+import java.lang.reflect.InvocationTargetException; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+ >+import org.apache.commons.beanutils.PropertyUtils; >+import org.apache.commons.lang.Validate; >+import org.eclipse.draw2d.Connection; >+import org.eclipse.draw2d.ConnectionAnchor; >+import org.eclipse.draw2d.FigureCanvas; >+import org.eclipse.draw2d.IFigure; >+import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.gef.ConnectionEditPart; >+import org.eclipse.gef.EditDomain; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gef.GraphicalEditPart; >+import org.eclipse.gef.GraphicalViewer; >+import org.eclipse.gef.RootEditPart; >+import org.eclipse.gef.palette.PaletteEntry; >+import org.eclipse.gef.ui.palette.PaletteViewer; >+import org.eclipse.jubula.rc.common.driver.ClickOptions; >+import org.eclipse.jubula.rc.common.driver.IRobot; >+import org.eclipse.jubula.rc.common.driver.IRunnable; >+import org.eclipse.jubula.rc.common.exception.StepExecutionException; >+import org.eclipse.jubula.rc.common.implclasses.MatchUtil; >+import org.eclipse.jubula.rc.common.implclasses.Verifier; >+import org.eclipse.jubula.rc.rcp.e3.accessor.Startup; >+import org.eclipse.jubula.rc.rcp.e3.gef.factory.DefaultEditPartAdapterFactory; >+import org.eclipse.jubula.rc.rcp.e3.gef.identifier.IEditPartIdentifier; >+import org.eclipse.jubula.rc.swt.driver.DragAndDropHelperSwt; >+import org.eclipse.jubula.rc.swt.implclasses.AbstractControlImplClass; >+import org.eclipse.jubula.rc.swt.implclasses.MenuUtil; >+import org.eclipse.jubula.tools.objects.event.EventFactory; >+import org.eclipse.jubula.tools.objects.event.TestErrorEvent; >+import org.eclipse.swt.graphics.Rectangle; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+ >+ >+/** >+ * Implementation class for Figure Canvas (Eclipse GEF). >+ * >+ * @author BREDEX GmbH >+ * @created May 13, 2009 >+ */ >+public class FigureCanvasImplClass extends AbstractControlImplClass { >+ >+ /** >+ * the viewer that contains the EditParts corresponding to the FigureCanvas >+ */ >+ private GraphicalViewer m_viewer = null; >+ >+ /** the composite in which the IFigures are displayed */ >+ private Composite m_composite = null; >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public Control getComponent() { >+ return m_composite; >+ } >+ >+ /** >+ * >+ * @return the viewer associated with the canvas to test. >+ */ >+ private GraphicalViewer getViewer() { >+ return m_viewer; >+ } >+ >+ /** >+ * >+ * @return the control for the canvas to test. >+ */ >+ private Control getViewerControl() { >+ return getViewer().getControl(); >+ } >+ >+ /** >+ * >+ * @return the root edit part of the viewer. >+ */ >+ private RootEditPart getRootEditPart() { >+ return getViewer().getRootEditPart(); >+ } >+ >+ /** >+ * >+ * @return the root of the palette viewer (tool palette). >+ */ >+ private RootEditPart getPaletteRoot() { >+ return getViewer().getEditDomain().getPaletteViewer().getRootEditPart(); >+ } >+ >+ /** >+ * >+ * @param textPath The path to the tool. >+ * @param operator The operator used for matching. >+ * @return the EditPart found at the end of the given path. Returns >+ * <code>null</code> if no EditPart can be found for the given path >+ * or if the EditPart found is not a GraphicalEditPart. >+ */ >+ private GraphicalEditPart findPaletteEditPart( >+ String textPath, String operator) { >+ >+ final String[] pathItems = MenuUtil.splitPath(textPath); >+ boolean isExisting = true; >+ >+ EditPart currentEditPart = getPaletteRoot().getContents(); >+ >+ for (int i = 0; i < pathItems.length && currentEditPart != null; i++) { >+ List effectiveChildren = currentEditPart.getChildren(); >+ >+ EditPart [] children = >+ (EditPart [])effectiveChildren.toArray( >+ new EditPart[effectiveChildren.size()]); >+ boolean itemFound = false; >+ for (int j = 0; j < children.length && !itemFound; j++) { >+ Object model = children[j].getModel(); >+ if (model instanceof PaletteEntry) { >+ String entryLabel = ((PaletteEntry)model).getLabel(); >+ if (entryLabel != null >+ && MatchUtil.getInstance().match( >+ entryLabel, pathItems[i], operator)) { >+ itemFound = true; >+ currentEditPart = children[j]; >+ } >+ } >+ } >+ if (!itemFound) { >+ isExisting = false; >+ break; >+ } >+ >+ } >+ >+ return isExisting && currentEditPart instanceof GraphicalEditPart >+ ? (GraphicalEditPart)currentEditPart : null; >+ >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public String[] getTextArrayFromComponent() { >+ return null; >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public void setComponent(final Object graphicsComponent) { >+ getEventThreadQueuer().invokeAndWait(getClass().getName() + ".setComponent", new IRunnable() { //$NON-NLS-1$ >+ >+ public Object run() throws StepExecutionException { >+ FigureCanvas figureCanvas = (FigureCanvas)graphicsComponent; >+ Composite parent = figureCanvas; >+ while (parent != null >+ && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) >+ instanceof GraphicalViewer)) { >+ parent = parent.getParent(); >+ } >+ >+ if (parent != null) { >+ m_composite = parent; >+ m_viewer = >+ (GraphicalViewer)parent.getData( >+ Startup.TEST_GEF_VIEWER_DATA_KEY); >+ } >+ return null; >+ } >+ >+ }); >+ } >+ >+ /** >+ * Checks whether the figure for the EditPart for the given path exists and >+ * is visible. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @param exists Whether the figure is expected to exist. >+ */ >+ public void gdCheckFigureExists( >+ String textPath, String operator, boolean exists) { >+ >+ boolean isExisting = >+ findFigure(findEditPart(textPath, operator)) != null; >+ if (!isExisting) { >+ // See if there's a connection anchor at the given path >+ isExisting = findConnectionAnchor(textPath, operator) != null; >+ } >+ >+ Verifier.equals(exists, isExisting); >+ >+ } >+ >+ /** >+ * Checks the given property of the figure at the given path. >+ * >+ * @param textPath The path to the figure. >+ * @param textPathOperator The operator used for matching the text path. >+ * @param propertyName The name of the property >+ * @param expectedPropValue The value of the property as a string >+ * @param valueOperator The operator used to verify >+ */ >+ public void gdVerifyFigureProperty(String textPath, >+ String textPathOperator, final String propertyName, >+ String expectedPropValue, String valueOperator) { >+ >+ final IFigure figure = >+ findFigure(findEditPart(textPath, textPathOperator)); >+ if (figure == null) { >+ throw new StepExecutionException( >+ "No figure could be found for the given text path.", //$NON-NLS-1$ >+ EventFactory.createActionError( >+ TestErrorEvent.NOT_FOUND)); >+ } >+ Object prop = getEventThreadQueuer().invokeAndWait("getProperty", //$NON-NLS-1$ >+ new IRunnable() { >+ >+ public Object run() throws StepExecutionException { >+ try { >+ return PropertyUtils.getProperty(figure, propertyName); >+ } catch (IllegalAccessException e) { >+ throw new StepExecutionException( >+ e.getMessage(), >+ EventFactory.createActionError( >+ TestErrorEvent.PROPERTY_NOT_ACCESSABLE)); >+ } catch (InvocationTargetException e) { >+ throw new StepExecutionException( >+ e.getMessage(), >+ EventFactory.createActionError( >+ TestErrorEvent.PROPERTY_NOT_ACCESSABLE)); >+ } catch (NoSuchMethodException e) { >+ throw new StepExecutionException( >+ e.getMessage(), >+ EventFactory.createActionError( >+ TestErrorEvent.PROPERTY_NOT_ACCESSABLE)); >+ } >+ } >+ >+ }); >+ final String propToStr = String.valueOf(prop); >+ Verifier.match(propToStr, expectedPropValue, valueOperator); >+ >+ } >+ >+ /** >+ * Checks whether the tool for the given path exists and >+ * is visible. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @param exists Whether the figure is expected to exist. >+ */ >+ public void gdCheckToolExists( >+ String textPath, String operator, boolean exists) { >+ >+ boolean isExisting = findPaletteFigure(textPath, operator) != null; >+ >+ Verifier.equals(exists, isExisting); >+ >+ } >+ >+ /** >+ * Finds and clicks the figure for the given path. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @param count The number of times to click. >+ * @param button The mouse button to use for the click. >+ */ >+ public void gdClickFigure(String textPath, String operator, >+ int count, int button) { >+ >+ getRobot().click(getViewerControl(), >+ getFigureBoundsChecked(textPath, operator), >+ ClickOptions.create().setScrollToVisible(false) >+ .setClickCount(count).setMouseButton(button)); >+ } >+ >+ /** >+ * Finds and clicks on a connection between a source figure and a >+ * target figure. >+ * >+ * @param sourceTextPath The path to the source figure. >+ * @param sourceOperator The operator to use for matching the source >+ * figure path. >+ * @param targetTextPath The path to the target figure. >+ * @param targetOperator The operator to use for matching the target >+ * figure path. >+ * @param count The number of times to click. >+ * @param button The mouse button to use for the click. >+ */ >+ public void gdClickConnection(String sourceTextPath, String sourceOperator, >+ String targetTextPath, String targetOperator, >+ int count, int button) { >+ >+ GraphicalEditPart sourceEditPart = >+ findEditPart(sourceTextPath, sourceOperator); >+ GraphicalEditPart targetEditPart = >+ findEditPart(targetTextPath, targetOperator); >+ >+ ConnectionEditPart connectionEditPart = null; >+ >+ if (sourceEditPart != null) { >+ List sourceConnectionList = sourceEditPart.getSourceConnections(); >+ ConnectionEditPart [] sourceConnections = >+ (ConnectionEditPart [])sourceConnectionList.toArray( >+ new ConnectionEditPart[sourceConnectionList.size()]); >+ for (int i = 0; i < sourceConnections.length >+ && connectionEditPart == null; i++) { >+ if (sourceConnections[i].getTarget() == targetEditPart) { >+ connectionEditPart = sourceConnections[i]; >+ } >+ } >+ } else if (targetEditPart != null) { >+ List targetConnectionList = targetEditPart.getTargetConnections(); >+ ConnectionEditPart [] targetConnections = >+ (ConnectionEditPart [])targetConnectionList.toArray( >+ new ConnectionEditPart[targetConnectionList.size()]); >+ for (int i = 0; i < targetConnections.length >+ && connectionEditPart == null; i++) { >+ if (targetConnections[i].getSource() == targetEditPart) { >+ connectionEditPart = targetConnections[i]; >+ } >+ } >+ } else { >+ throw new StepExecutionException( >+ "No figures could be found for the given text paths.", //$NON-NLS-1$ >+ EventFactory.createActionError(TestErrorEvent.NOT_FOUND)); >+ } >+ >+ IFigure connectionFigure = findFigure(connectionEditPart); >+ if (connectionFigure == null) { >+ String missingEnd = sourceEditPart == null ? "source" : "target"; //$NON-NLS-1$ //$NON-NLS-2$ >+ throw new StepExecutionException( >+ "No connection could be found for the given " + missingEnd + " figure.", //$NON-NLS-1$ //$NON-NLS-2$ >+ EventFactory.createActionError(TestErrorEvent.NOT_FOUND)); >+ } >+ >+ // Scrolling >+ revealEditPart(connectionEditPart); >+ >+ if (connectionFigure instanceof Connection) { >+ Point midpoint = >+ ((Connection)connectionFigure).getPoints().getMidpoint(); >+ connectionFigure.translateToAbsolute(midpoint); >+ getRobot().click(getViewerControl(), null, >+ ClickOptions.create().setScrollToVisible(false) >+ .setClickCount(count).setMouseButton(button), >+ midpoint.x, true, midpoint.y, true); >+ } else { >+ getRobot().click(getViewerControl(), >+ getBounds(connectionFigure), >+ ClickOptions.create().setScrollToVisible(false) >+ .setClickCount(count).setMouseButton(button)); >+ } >+ >+ } >+ >+ /** >+ * Clicks the specified position within the given figure. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @param count amount of clicks >+ * @param button what button should be clicked >+ * @param xPos what x position >+ * @param xUnits should x position be pixel or percent values >+ * @param yPos what y position >+ * @param yUnits should y position be pixel or percent values >+ * @throws StepExecutionException if step execution fails. >+ */ >+ public void gdClickInFigure(String textPath, String operator, >+ int count, int button, int xPos, String xUnits, >+ int yPos, String yUnits) throws StepExecutionException { >+ >+ getRobot().click(getViewerControl(), >+ getFigureBoundsChecked(textPath, operator), >+ ClickOptions.create().setScrollToVisible(false) >+ .setClickCount(count).setMouseButton(button), >+ xPos, xUnits.equalsIgnoreCase(POS_UNIT_PIXEL), >+ yPos, yUnits.equalsIgnoreCase(POS_UNIT_PIXEL)); >+ } >+ >+ /** >+ * Simulates the beginning of a Drag. Moves to the specified position >+ * within the given figure and stores information related to the drag to >+ * be used later by a Drop operation. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @param mouseButton the mouse button. >+ * @param modifier the modifier, e.g. shift, ctrl, etc. >+ * @param xPos what x position >+ * @param xUnits should x position be pixel or percent values >+ * @param yPos what y position >+ * @param yUnits should y position be pixel or percent values >+ */ >+ public void gdDragFigure(String textPath, String operator, >+ int mouseButton, String modifier, int xPos, >+ String xUnits, int yPos, String yUnits) { >+ // Only store the Drag-Information. Otherwise the GUI-Eventqueue >+ // blocks after performed Drag! >+ final DragAndDropHelperSwt dndHelper = DragAndDropHelperSwt >+ .getInstance(); >+ dndHelper.setMouseButton(mouseButton); >+ dndHelper.setModifier(modifier); >+ dndHelper.setDragComponent(null); >+ gdClickInFigure(textPath, operator, 0, mouseButton, >+ xPos, xUnits, yPos, yUnits); >+ } >+ >+ /** >+ * Performs a Drop. Moves to the specified location within the given figure >+ * and releases the modifier and mouse button pressed by the previous drag >+ * operation. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @param xPos what x position >+ * @param xUnits should x position be pixel or percent values >+ * @param yPos what y position >+ * @param yUnits should y position be pixel or percent values >+ * @param delayBeforeDrop the amount of time (in milliseconds) to wait >+ * between moving the mouse to the drop point and >+ * releasing the mouse button >+ */ >+ public void gdDropOnFigure(final String textPath, final String operator, >+ final int xPos, final String xUnits, final int yPos, >+ final String yUnits, int delayBeforeDrop) { >+ >+ final DragAndDropHelperSwt dndHelper = >+ DragAndDropHelperSwt.getInstance(); >+ final IRobot robot = getRobot(); >+ final String modifier = dndHelper.getModifier(); >+ final int mouseButton = dndHelper.getMouseButton(); >+ // Note: This method performs the drag AND drop action in one runnable >+ // in the GUI-Eventqueue because after the mousePress, the eventqueue >+ // blocks! >+ try { >+ pressOrReleaseModifiers(modifier, true); >+ >+ getEventThreadQueuer().invokeAndWait("gdStartDragFigure", new IRunnable() { //$NON-NLS-1$ >+ public Object run() throws StepExecutionException { >+ // drag >+ robot.mousePress(dndHelper.getDragComponent(), null, >+ mouseButton); >+ >+ shakeMouse(); >+ >+ // drop >+ gdClickInFigure(textPath, operator, 0, >+ mouseButton, xPos, xUnits, yPos, yUnits); >+ >+ return null; >+ } >+ }); >+ >+ waitBeforeDrop(delayBeforeDrop); >+ } finally { >+ getRobot().mouseRelease(null, null, mouseButton); >+ pressOrReleaseModifiers(modifier, false); >+ } >+ } >+ >+ /** >+ * Returns the bounds for the figure for the given path. If no such >+ * figure can be found, a {@link StepExecutionException} will be thrown. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @return the bounds of the figure for the given path. >+ */ >+ private Rectangle getFigureBoundsChecked(String textPath, String operator) { >+ GraphicalEditPart editPart = >+ findEditPart(textPath, operator); >+ IFigure figure = findFigure(editPart); >+ ConnectionAnchor anchor = null; >+ >+ if (figure == null) { >+ // Try to find a connection anchor instead >+ anchor = findConnectionAnchor(textPath, operator); >+ if (anchor != null) { >+ final String[] pathItems = MenuUtil.splitPath(textPath); >+ final String[] editPartPathItems = >+ new String[pathItems.length - 1]; >+ System.arraycopy( >+ pathItems, 0, editPartPathItems, 0, >+ editPartPathItems.length); >+ editPart = findEditPart(operator, editPartPathItems); >+ } >+ if (anchor == null || findFigure(editPart) == null) { >+ throw new StepExecutionException( >+ "No figure could be found for the given text path.", //$NON-NLS-1$ >+ EventFactory.createActionError( >+ TestErrorEvent.NOT_FOUND)); >+ } >+ >+ } >+ >+ // Scrolling >+ revealEditPart(editPart); >+ >+ return figure != null ? getBounds(figure) : getBounds(anchor); >+ } >+ >+ /** >+ * Clicks the tool found at the given path. >+ * >+ * @param textPath The path to the tool. >+ * @param operator The operator used for matching. >+ * @param count The number of times to click. >+ */ >+ public void gdSelectTool(String textPath, String operator, int count) { >+ Control paletteControl = getPaletteControl(); >+ IFigure figure = >+ findPaletteFigureChecked(textPath, operator); >+ getRobot().click(paletteControl, getBounds(figure), >+ ClickOptions.create().setScrollToVisible(false) >+ .setClickCount(count)); >+ } >+ >+ /** >+ * @return the control associated with the palette viewer. >+ */ >+ private Control getPaletteControl() { >+ EditDomain editDomain = getViewer().getEditDomain(); >+ if (editDomain == null) { >+ return null; >+ } >+ >+ PaletteViewer paletteViewer = editDomain.getPaletteViewer(); >+ if (paletteViewer == null) { >+ return null; >+ } >+ >+ return paletteViewer.getControl(); >+ } >+ >+ /** >+ * >+ * @param figure The figure for which to find the bounds. >+ * @return the bounds of the given figure. >+ */ >+ private Rectangle getBounds(IFigure figure) { >+ org.eclipse.draw2d.geometry.Rectangle figureBounds = >+ new org.eclipse.draw2d.geometry.Rectangle(figure.getBounds()); >+ >+ // Take scrolling and zooming into account >+ figure.translateToAbsolute(figureBounds); >+ >+ return new Rectangle( >+ figureBounds.x, figureBounds.y, >+ figureBounds.width, figureBounds.height); >+ } >+ >+ /** >+ * >+ * @param anchor The anchor for which to find the bounds. >+ * @return the "bounds" of the given anchor. Since the location of an >+ * anchor is defined as a single point, the bounds are a small >+ * rectangle with that point at the center. >+ */ >+ private Rectangle getBounds(ConnectionAnchor anchor) { >+ Validate.notNull(anchor); >+ Point refPoint = anchor.getReferencePoint(); >+ >+ return new Rectangle( >+ refPoint.x - 1, refPoint.y - 1, 3, 3); >+ } >+ >+ /** >+ * >+ * @param textPath The path to the GraphicalEditPart. >+ * @param operator The operator used for matching. >+ * @return the GraphicalEditPart for the given path. Returns >+ * <code>null</code> if no EditPart exists for the given path or if >+ * the found EditPart is not a GraphicalEditPart. >+ */ >+ private GraphicalEditPart findEditPart(String textPath, String operator) { >+ final String[] pathItems = MenuUtil.splitPath(textPath); >+ return findEditPart(operator, pathItems); >+ } >+ >+ /** >+ * @param operator The operator used for matching. >+ * @param pathItems The path to the GraphicalEditPart. Each element in the >+ * array represents a single segment of the path. >+ * @return the GraphicalEditPart for the given path. Returns >+ * <code>null</code> if no EditPart exists for the given path or if >+ * the found EditPart is not a GraphicalEditPart. >+ */ >+ private GraphicalEditPart findEditPart(String operator, >+ final String[] pathItems) { >+ boolean isExisting = true; >+ EditPart currentEditPart = getRootEditPart().getContents(); >+ >+ for (int i = 0; i < pathItems.length && currentEditPart != null; i++) { >+ List effectiveChildren = currentEditPart.getChildren(); >+ EditPart [] children = >+ (EditPart [])effectiveChildren.toArray( >+ new EditPart[effectiveChildren.size()]); >+ boolean itemFound = false; >+ for (int j = 0; j < children.length && !itemFound; j++) { >+ IEditPartIdentifier childFigureIdentifier = >+ DefaultEditPartAdapterFactory.loadFigureIdentifier( >+ children[j]); >+ if (childFigureIdentifier != null) { >+ String figureId = childFigureIdentifier.getIdentifier(); >+ if (figureId != null >+ && MatchUtil.getInstance().match( >+ figureId, pathItems[i], operator)) { >+ itemFound = true; >+ currentEditPart = children[j]; >+ } >+ } >+ } >+ if (!itemFound) { >+ isExisting = false; >+ break; >+ } >+ >+ } >+ >+ return isExisting && currentEditPart instanceof GraphicalEditPart >+ ? (GraphicalEditPart)currentEditPart : null; >+ } >+ >+ /** >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @return the figure for the GraphicalEditPart for the given path within >+ * the palette. Returns <code>null</code> if no EditPart exists >+ * for the given path or if the found EditPart does not have a >+ * figure. >+ */ >+ private IFigure findPaletteFigure(String textPath, String operator) { >+ GraphicalEditPart editPart = findPaletteEditPart(textPath, operator); >+ >+ // Scrolling >+ revealEditPart(editPart); >+ >+ return findFigure(editPart); >+ } >+ >+ /** >+ * Finds and returns the palette figure for the given path. If no such >+ * figure can be found, a {@link StepExecutionException} will be thrown. >+ * >+ * @param textPath The path to the figure. >+ * @param operator The operator used for matching. >+ * @return the figure for the GraphicalEditPart for the given path within >+ * the palette. >+ */ >+ private IFigure findPaletteFigureChecked(String textPath, String operator) { >+ IFigure figure = findPaletteFigure(textPath, operator); >+ if (figure == null) { >+ throw new StepExecutionException( >+ "No palette figure could be found for the given text path.", //$NON-NLS-1$ >+ EventFactory.createActionError(TestErrorEvent.NOT_FOUND)); >+ } >+ return figure; >+ >+ } >+ >+ /** >+ * >+ * @param editPart The EditPart for which to find the corresponding figure. >+ * @return the (visible) figure corresponding to the given EditPart, or >+ * <code>null</code> if no visible figure corresponds to the given >+ * EditPart. >+ */ >+ private IFigure findFigure(GraphicalEditPart editPart) { >+ if (editPart != null) { >+ IFigure figure = editPart.getFigure(); >+ if (figure.isShowing()) { >+ return figure; >+ } >+ } >+ >+ return null; >+ } >+ >+ /** >+ * Attempts to find a connection anchor at the given textpath. >+ * >+ * @param textPath The path to the anchor. >+ * @param operator The operator used for matching. >+ * @return the anchor found at the given text path, or <code>null</code> >+ * if no such anchor exists. >+ */ >+ private ConnectionAnchor findConnectionAnchor( >+ String textPath, String operator) { >+ >+ final String[] pathItems = MenuUtil.splitPath(textPath); >+ final String[] editPartPathItems = new String[pathItems.length - 1]; >+ System.arraycopy( >+ pathItems, 0, editPartPathItems, 0, editPartPathItems.length); >+ GraphicalEditPart editPart = findEditPart(operator, editPartPathItems); >+ if (editPart != null) { >+ String anchorPathItem = pathItems[pathItems.length - 1]; >+ IEditPartIdentifier editPartIdentifier = >+ DefaultEditPartAdapterFactory.loadFigureIdentifier(editPart); >+ if (editPartIdentifier != null) { >+ Map anchorMap = >+ editPartIdentifier.getConnectionAnchors(); >+ if (anchorMap != null) { >+ Iterator anchorMapIter = >+ anchorMap.keySet().iterator(); >+ while (anchorMapIter.hasNext()) { >+ Object anchorMapKey = anchorMapIter.next(); >+ Object anchorMapValue = >+ anchorMap.get(anchorMapKey); >+ if (anchorMapKey instanceof String >+ && anchorMapValue instanceof ConnectionAnchor >+ && MatchUtil.getInstance().match( >+ (String)anchorMapKey, anchorPathItem, >+ operator)) { >+ >+ return (ConnectionAnchor)anchorMapValue; >+ } >+ } >+ } >+ } >+ } >+ >+ return null; >+ } >+ >+ /** >+ * Reveals the given {@link EditPart} within its viewer. >+ * >+ * @param editPart the {@link EditPart} to reveal. >+ */ >+ private void revealEditPart(final EditPart editPart) { >+ if (editPart != null) { >+ getEventThreadQueuer().invokeAndWait(getClass().getName() + ".revealEditPart", new IRunnable() { //$NON-NLS-1$ >+ >+ public Object run() throws StepExecutionException { >+ editPart.getViewer().reveal(editPart); >+ return null; >+ } >+ >+ }); >+ } >+ } >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/FigureHighlighter.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/FigureHighlighter.java >new file mode 100644 >index 0000000..8c380a0 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/FigureHighlighter.java >@@ -0,0 +1,196 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.inspector; >+ >+import java.util.Iterator; >+import java.util.Map; >+ >+import org.eclipse.draw2d.ConnectionAnchor; >+import org.eclipse.draw2d.IFigure; >+import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.gef.ConnectionEditPart; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gef.GraphicalEditPart; >+import org.eclipse.gef.GraphicalViewer; >+import org.eclipse.jubula.rc.rcp.e3.gef.factory.DefaultEditPartAdapterFactory; >+import org.eclipse.jubula.rc.rcp.e3.gef.identifier.IEditPartIdentifier; >+import org.eclipse.jubula.rc.rcp.e3.gef.util.FigureCanvasUtil; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.MouseEvent; >+import org.eclipse.swt.events.MouseMoveListener; >+import org.eclipse.swt.events.PaintEvent; >+import org.eclipse.swt.events.PaintListener; >+import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.graphics.Rectangle; >+import org.eclipse.swt.widgets.Control; >+ >+ >+/** >+ * Highlights figures as the mouse moves over them. >+ * >+ * @author BREDEX GmbH >+ * @created Jun 26, 2009 >+ */ >+public class FigureHighlighter implements MouseMoveListener { >+ >+ /** the viewer containing figures that can be highlighted */ >+ private GraphicalViewer m_viewer; >+ >+ /** the color to use for highlighting */ >+ private Color m_highlightColor; >+ >+ /** transparency for highlighting */ >+ private int m_highlightAlpha; >+ >+ /** the current highlighted bounds */ >+ private Rectangle m_currentBounds; >+ >+ /** the pain listener that performs the actual highlighting */ >+ private PaintListener m_paintListener; >+ >+ /** >+ * Constructor >+ * >+ * @param viewer The viewer containing figures to highlight. >+ */ >+ public FigureHighlighter(GraphicalViewer viewer) { >+ m_viewer = viewer; >+ m_highlightColor = >+ viewer.getControl().getDisplay().getSystemColor(SWT.COLOR_BLUE); >+ m_highlightAlpha = 100; >+ m_currentBounds = null; >+ m_paintListener = new PaintListener() { >+ >+ public void paintControl(PaintEvent e) { >+ if (m_currentBounds != null) { >+ Color bgColor = e.gc.getBackground(); >+ int alpha = e.gc.getAlpha(); >+ e.gc.setAlpha(m_highlightAlpha); >+ e.gc.setBackground(m_highlightColor); >+ e.gc.fillRectangle(m_currentBounds); >+ e.gc.setAlpha(alpha); >+ e.gc.setBackground(bgColor); >+ } >+ } >+ >+ }; >+ viewer.getControl().addPaintListener(m_paintListener); >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public void mouseMove(MouseEvent e) { >+ Point cursorLocation = >+ new Point(e.x, e.y); >+ EditPart editPart = >+ FigureCanvasUtil.findAtCurrentMousePosition(e.display, m_viewer); >+ if (editPart == m_viewer.getContents().getRoot() >+ || editPart == null) { >+ if (m_currentBounds != null) { >+ m_currentBounds = null; >+ m_viewer.getControl().redraw(); >+ } >+ >+ return; >+ } >+ >+ // Check for connection anchor >+ Rectangle anchorBounds = >+ getConnectionAnchorBounds( >+ DefaultEditPartAdapterFactory.loadFigureIdentifier( >+ editPart), cursorLocation); >+ >+ if (anchorBounds == null >+ && editPart instanceof ConnectionEditPart) { >+ >+ ConnectionEditPart connEditPart = >+ (ConnectionEditPart)editPart; >+ EditPart srcEditPart = connEditPart.getSource(); >+ EditPart targetEditPart = connEditPart.getTarget(); >+ anchorBounds = getConnectionAnchorBounds( >+ DefaultEditPartAdapterFactory.loadFigureIdentifier(srcEditPart), >+ cursorLocation); >+ if (anchorBounds == null) { >+ anchorBounds = getConnectionAnchorBounds( >+ DefaultEditPartAdapterFactory >+ .loadFigureIdentifier(targetEditPart), >+ cursorLocation); >+ } >+ } >+ >+ Rectangle bounds = anchorBounds; >+ if (bounds == null >+ && editPart != m_viewer.getContents().getRoot() >+ && !(editPart instanceof ConnectionEditPart) >+ && editPart instanceof GraphicalEditPart) { >+ IFigure figure = ((GraphicalEditPart)editPart).getFigure(); >+ org.eclipse.draw2d.geometry.Rectangle figureBounds = >+ new org.eclipse.draw2d.geometry.Rectangle(figure.getBounds()); >+ figure.translateToAbsolute(figureBounds); >+ bounds = new Rectangle(figureBounds.x, figureBounds.y, >+ figureBounds.width, figureBounds.height); >+ } >+ m_currentBounds = bounds; >+ m_viewer.getControl().redraw(); >+ >+ } >+ >+ /** >+ * >+ * @param editPartIdentifier Provides a list of possible anchors. >+ * @param cursorLocation The location at which to look for the anchor. >+ * @return the bounds for the connection anchor at the given location, or >+ * <code>null</code> if no such anchor can be found. >+ */ >+ private Rectangle getConnectionAnchorBounds( >+ IEditPartIdentifier editPartIdentifier, Point cursorLocation) { >+ >+ if (editPartIdentifier != null) { >+ Map anchorMap = >+ editPartIdentifier.getConnectionAnchors(); >+ if (anchorMap != null) { >+ Iterator iter = anchorMap.keySet().iterator(); >+ while (iter.hasNext()) { >+ Object key = iter.next(); >+ Object value = anchorMap.get(key); >+ if (key instanceof String >+ && value instanceof ConnectionAnchor) { >+ Point refPoint = >+ ((ConnectionAnchor)value).getReferencePoint(); >+ >+ // The "bounds" of an anchor is considered to be >+ // 3 pixels in all directions. >+ Rectangle refBounds = new Rectangle( >+ refPoint.x - 3, refPoint.y - 3, 7, 7); >+ if (refBounds.contains(cursorLocation.getSWTPoint())) { >+ return refBounds; >+ } >+ } >+ } >+ } >+ } >+ >+ return null; >+ } >+ >+ /** >+ * Removes all listeners added by this highlighter. >+ */ >+ public void removeAddedListeners() { >+ Control control = m_viewer.getControl(); >+ if (!control.isDisposed()) { >+ control.removePaintListener(m_paintListener); >+ control.redraw(); >+ } >+ } >+ >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/GefInspectorListenerAppender.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/GefInspectorListenerAppender.java >new file mode 100644 >index 0000000..2d4ebd9 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/inspector/GefInspectorListenerAppender.java >@@ -0,0 +1,440 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.inspector; >+ >+import java.util.ArrayList; >+import java.util.Collections; >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+ >+import org.eclipse.draw2d.ConnectionAnchor; >+import org.eclipse.draw2d.FigureCanvas; >+import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.draw2d.geometry.Rectangle; >+import org.eclipse.gef.ConnectionEditPart; >+import org.eclipse.gef.EditDomain; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gef.EditPartViewer; >+import org.eclipse.gef.GraphicalEditPart; >+import org.eclipse.gef.GraphicalViewer; >+import org.eclipse.gef.RootEditPart; >+import org.eclipse.gef.palette.PaletteEntry; >+import org.eclipse.gef.ui.palette.PaletteViewer; >+import org.eclipse.jubula.communication.message.InspectorComponentSelectedMessage; >+import org.eclipse.jubula.rc.common.AUTServer; >+import org.eclipse.jubula.rc.common.listener.IAutListenerAppender; >+import org.eclipse.jubula.rc.common.logger.AutServerLogger; >+import org.eclipse.jubula.rc.rcp.e3.accessor.Startup; >+import org.eclipse.jubula.rc.rcp.e3.gef.factory.DefaultEditPartAdapterFactory; >+import org.eclipse.jubula.rc.rcp.e3.gef.identifier.IEditPartIdentifier; >+import org.eclipse.jubula.rc.rcp.e3.gef.util.FigureCanvasUtil; >+import org.eclipse.jubula.tools.exception.CommunicationException; >+import org.eclipse.jubula.tools.objects.ComponentIdentifier; >+import org.eclipse.jubula.tools.objects.IComponentIdentifier; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Event; >+import org.eclipse.swt.widgets.Listener; >+import org.eclipse.swt.widgets.Widget; >+import org.eclipse.ui.PlatformUI; >+ >+ >+/** >+ * Adds listeners for the Inspector function. These listeners will only >+ * interact with GEF components. >+ * >+ * @author BREDEX GmbH >+ * @created Jun 11, 2009 >+ */ >+public class GefInspectorListenerAppender implements IAutListenerAppender { >+ >+ /** the logger */ >+ private static final AutServerLogger LOG = >+ new AutServerLogger(GefInspectorListenerAppender.class); >+ >+ /** >+ * Responsible for adding highlighters to controls and managing those >+ * highlighters. >+ * >+ * @author BREDEX GmbH >+ * @created Jun 29, 2009 >+ */ >+ private static class FigureHighlightAppender implements Listener { >+ >+ /** mapping from control to figure highlighter */ >+ private Map m_canvasToListener = new HashMap(); >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public void handleEvent(Event event) { >+ if (event.widget instanceof FigureCanvas) { >+ FigureCanvas canvas = (FigureCanvas)event.widget; >+ if (event.type == SWT.MouseEnter) { >+ handleMouseEnter(canvas); >+ } >+ } >+ } >+ >+ /** >+ * Removes all listeners added by this appender. >+ */ >+ public void removeAddedListeners() { >+ Iterator iter = m_canvasToListener.keySet().iterator(); >+ while (iter.hasNext()) { >+ Control control = (Control)iter.next(); >+ if (!control.isDisposed()) { >+ FigureHighlighter highlighter = >+ (FigureHighlighter)m_canvasToListener.get(control); >+ highlighter.removeAddedListeners(); >+ control.removeMouseMoveListener(highlighter); >+ } >+ } >+ m_canvasToListener.clear(); >+ } >+ >+ /** >+ * Adds a figure highlighter to the given canvas. >+ * >+ * @param canvas The figure canvas entered by the mouse. >+ */ >+ private void handleMouseEnter(final FigureCanvas canvas) { >+ if (m_canvasToListener.containsKey(canvas)) { >+ // Highlighter already registered. >+ return; >+ } >+ >+ GraphicalViewer viewer = FigureCanvasUtil.getViewer(canvas); >+ if (viewer != null) { >+ if (viewer.getContents() instanceof GraphicalEditPart) { >+ FigureHighlighter highlighter = >+ new FigureHighlighter(viewer); >+ m_canvasToListener.put(canvas, highlighter); >+ canvas.addMouseMoveListener(highlighter); >+ } >+ } >+ } >+ >+ } >+ >+ /** >+ * Listens for a mouse click and: >+ * 1. deregisters itself and any other provider listeners, and >+ * 2. sends a "component selected" message >+ * >+ * if that mouse click was over a GEF component. >+ * >+ * @author BREDEX GmbH >+ * @created Jun 11, 2009 >+ */ >+ private static class GefInspectorComponentSelectedListener >+ implements Listener { >+ >+ /** the appender */ >+ private FigureHighlightAppender m_highlightAppender; >+ >+ /** >+ * Constructor >+ * >+ * @param highlightAppender The appender to use. >+ */ >+ public GefInspectorComponentSelectedListener( >+ FigureHighlightAppender highlightAppender) { >+ m_highlightAppender = highlightAppender; >+ } >+ >+ /** >+ * >+ * @param editPartIdentifier Provides connection anchor IDs and >+ * locations. >+ * @param cursorLocation The location at which to search for an >+ * anchor point. >+ * @return the ID of the connection anchor at the given location, or >+ * <code>null</code> if there is no connection anchor at the >+ * given location. >+ */ >+ private String getConnectionAnchorId( >+ IEditPartIdentifier editPartIdentifier, Point cursorLocation) { >+ >+ if (editPartIdentifier != null) { >+ Map anchorMap = >+ editPartIdentifier.getConnectionAnchors(); >+ if (anchorMap != null) { >+ Iterator iter = anchorMap.keySet().iterator(); >+ while (iter.hasNext()) { >+ Object key = iter.next(); >+ Object value = anchorMap.get(key); >+ if (key instanceof String >+ && value instanceof ConnectionAnchor) { >+ Point refPoint = >+ ((ConnectionAnchor)value).getReferencePoint(); >+ >+ // A click is recognized as being "within the >+ // bounds" of an anchor if it is within 3 pixels >+ // in any direction. >+ Rectangle refBounds = new Rectangle( >+ refPoint.x - 3, refPoint.y - 3, 7, 7); >+ if (refBounds.contains(cursorLocation)) { >+ return (String)key; >+ } >+ } >+ } >+ } >+ } >+ >+ return null; >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void handleEvent(Event event) { >+ Display display = event.display; >+ display.removeFilter(SWT.MouseDown, this); >+ display.removeFilter(SWT.MouseEnter, m_highlightAppender); >+ m_highlightAppender.removeAddedListeners(); >+ event.doit = false; >+ event.type = SWT.None; >+ Widget selectedWidget = event.widget; >+ IComponentIdentifier compId = null; >+ >+ if (!(selectedWidget instanceof FigureCanvas)) { >+ sendIdInfo(compId); >+ return; >+ } >+ >+ FigureCanvas figureCanvas = >+ (FigureCanvas)selectedWidget; >+ Composite parent = figureCanvas; >+ while (parent != null >+ && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) >+ instanceof GraphicalViewer)) { >+ parent = parent.getParent(); >+ } >+ >+ if (parent == null) { >+ sendIdInfo(compId); >+ return; >+ } >+ >+ Object gefData = >+ parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY); >+ >+ if (gefData instanceof EditPartViewer) { >+ EditPartViewer viewer = (EditPartViewer)gefData; >+ Point cursorLocation = new Point(display.map(null, >+ viewer.getControl(), >+ display.getCursorLocation())); >+ EditPart editPart = viewer.findObjectAt(cursorLocation); >+ EditPart primaryEditPart = FigureCanvasUtil.getPrimaryEditPart( >+ editPart, viewer.getRootEditPart()); >+ List idStringList = Collections.EMPTY_LIST; >+ >+ if (primaryEditPart != null) { >+ idStringList = getPathToRoot(viewer.getRootEditPart(), >+ cursorLocation, primaryEditPart); >+ >+ } else { >+ // No primary figure found. >+ // Check whether a tool was selected. >+ EditDomain editDomain = viewer.getEditDomain(); >+ if (editDomain != null) { >+ PaletteViewer paletteViewer = >+ editDomain.getPaletteViewer(); >+ if (paletteViewer != null) { >+ EditPart paletteEditPart = >+ paletteViewer.findObjectAt(new Point( >+ display.map(viewer.getControl(), >+ paletteViewer.getControl(), >+ cursorLocation.getSWTPoint()))); >+ if (paletteEditPart != null) { >+ idStringList = getToolPathToRoot( >+ paletteViewer.getRootEditPart(), >+ paletteEditPart); >+ } >+ } >+ } >+ } >+ >+ compId = createCompId(idStringList); >+ } >+ sendIdInfo(compId); >+ } >+ >+ /** >+ * >+ * @param editPart The edit part for which to find the path. >+ * @param root The root for <code>editPart</code>. This is used to >+ * avoid adding the root identifier to the returned list. >+ * @param cursorLocation The location to check for nearby connection >+ * anchors. >+ * @return a list containing the identifier of each edit part between >+ * <code>editPart</code> and its root. The first element in the >+ * list will be the identifier for a connection anchor if >+ * <code>cursorLocation</code> is near such an anchor. >+ */ >+ private List getPathToRoot(RootEditPart root, Point cursorLocation, >+ EditPart editPart) { >+ >+ List idStringList = new ArrayList(); >+ EditPart currentEditPart = editPart; >+ >+ // Check for connection anchor >+ String connectionId = >+ getConnectionAnchorId( >+ DefaultEditPartAdapterFactory.loadFigureIdentifier( >+ currentEditPart), >+ cursorLocation); >+ >+ if (connectionId == null >+ && currentEditPart instanceof ConnectionEditPart) { >+ >+ ConnectionEditPart connEditPart = >+ (ConnectionEditPart)editPart; >+ EditPart srcEditPart = connEditPart.getSource(); >+ EditPart targetEditPart = connEditPart.getTarget(); >+ connectionId = getConnectionAnchorId( >+ DefaultEditPartAdapterFactory >+ .loadFigureIdentifier(srcEditPart), >+ cursorLocation); >+ if (connectionId != null) { >+ currentEditPart = srcEditPart; >+ } else { >+ connectionId = getConnectionAnchorId( >+ DefaultEditPartAdapterFactory >+ .loadFigureIdentifier(targetEditPart), >+ cursorLocation); >+ if (connectionId != null) { >+ currentEditPart = targetEditPart; >+ } >+ } >+ } >+ >+ if (connectionId != null) { >+ idStringList.add(connectionId); >+ } >+ >+ while (currentEditPart != root.getContents() >+ && currentEditPart != null) { >+ IEditPartIdentifier identifier = >+ DefaultEditPartAdapterFactory.loadFigureIdentifier( >+ currentEditPart); >+ if (identifier != null) { >+ idStringList.add(identifier.getIdentifier()); >+ } >+ currentEditPart = currentEditPart.getParent(); >+ } >+ >+ return idStringList; >+ >+ } >+ >+ /** >+ * >+ * @param editPart The edit part for which to find the path. >+ * @param root The root for <code>editPart</code>. This is used to >+ * avoid adding the root identifier to the returned list. >+ * @return a list containing the identifier of each edit part between >+ * <code>editPart</code> and its root. >+ */ >+ private List getToolPathToRoot(RootEditPart root, EditPart editPart) { >+ >+ List idStringList = new ArrayList(); >+ EditPart currentEditPart = editPart; >+ >+ if (currentEditPart != null) { >+ Object model = currentEditPart.getModel(); >+ while (model instanceof PaletteEntry >+ && currentEditPart != root.getContents()) { >+ idStringList.add(((PaletteEntry)model).getLabel()); >+ currentEditPart = >+ currentEditPart.getParent(); >+ model = currentEditPart.getModel(); >+ } >+ } >+ >+ return idStringList; >+ } >+ >+ /** >+ * Sends the given ID information to the client. >+ * >+ * @param compId The component identifier to send. May be >+ * <code>null</code>. >+ */ >+ private void sendIdInfo(IComponentIdentifier compId) { >+ InspectorComponentSelectedMessage message = >+ new InspectorComponentSelectedMessage(); >+ message.setComponentIdentifier(compId); >+ try { >+ AUTServer.getInstance().getCommunicator().send(message); >+ } catch (CommunicationException e) { >+ LOG.error("Error occurred while trying to send message to Client.", e); //$NON-NLS-1$ >+ } >+ } >+ >+ /** >+ * >+ * @param idStringList The path to root for a specific edit part or >+ * connection anchor. >+ * @return a component identifier for the given path, or >+ * <code>null</code> if no valid component identifier can be >+ * generated. >+ */ >+ private IComponentIdentifier createCompId(List idStringList) { >+ IComponentIdentifier compId = null; >+ if (!idStringList.isEmpty()) { >+ Collections.reverse(idStringList); >+ compId = new ComponentIdentifier(); >+ compId.setHierarchyNames(idStringList); >+ } >+ >+ return compId; >+ } >+ } >+ >+ /** the listener responsible for appending highlight listeners */ >+ private FigureHighlightAppender m_highlightAppender; >+ >+ /** the listener responsible for handling mouse clicks */ >+ private GefInspectorComponentSelectedListener m_componentSelectedListener; >+ >+ /** >+ * Constructor >+ */ >+ public GefInspectorListenerAppender() { >+ m_highlightAppender = new FigureHighlightAppender(); >+ m_componentSelectedListener = >+ new GefInspectorComponentSelectedListener(m_highlightAppender); >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public void addAutListener() { >+ final Display display = PlatformUI.getWorkbench().getDisplay(); >+ >+ display.syncExec(new Runnable() { >+ >+ public void run() { >+ display.addFilter(SWT.MouseEnter, m_highlightAppender); >+ display.addFilter(SWT.MouseDown, m_componentSelectedListener); >+ } >+ >+ }); >+ } >+ >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/listener/GefPartListener.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/listener/GefPartListener.java >new file mode 100644 >index 0000000..828e3d0 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/listener/GefPartListener.java >@@ -0,0 +1,141 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.listener; >+ >+import org.eclipse.gef.GraphicalViewer; >+import org.eclipse.jface.viewers.ISelectionChangedListener; >+import org.eclipse.jface.viewers.SelectionChangedEvent; >+import org.eclipse.jubula.rc.rcp.e3.accessor.Startup; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.ui.IPartListener2; >+import org.eclipse.ui.IWorkbenchPart; >+import org.eclipse.ui.IWorkbenchPartReference; >+import org.eclipse.ui.internal.WorkbenchPartReference; >+import org.eclipse.ui.part.MultiPageEditorPart; >+ >+ >+/** >+ * @author BREDEX GmbH >+ * @created Dec 17, 2009 >+ */ >+public class GefPartListener implements IPartListener2 { >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partActivated(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partBroughtToTop(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partClosed(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partDeactivated(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partHidden(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partInputChanged(IWorkbenchPartReference partRef) { >+ // Do nothing >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partOpened(final IWorkbenchPartReference partRef) { >+ IWorkbenchPart part = partRef.getPart(false); >+ >+ if (part instanceof MultiPageEditorPart) { >+ ((MultiPageEditorPart)part).getSite().getSelectionProvider() >+ .addSelectionChangedListener(new ISelectionChangedListener() { >+ >+ public void selectionChanged(SelectionChangedEvent event) { >+ if (event.getSource() instanceof GraphicalViewer) { >+ registerGraphicalViewer( >+ (GraphicalViewer)event.getSource(), partRef); >+ } >+ } >+ }); >+ } >+ >+ if (part != null >+ && partRef instanceof WorkbenchPartReference) { >+ GraphicalViewer viewer = >+ (GraphicalViewer)part.getAdapter( >+ GraphicalViewer.class); >+ registerGraphicalViewer(viewer, partRef); >+ } >+ } >+ >+ /** >+ * >+ * {@inheritDoc} >+ */ >+ public void partVisible(IWorkbenchPartReference partRef) { >+ partOpened(partRef); >+ } >+ >+ /** >+ * Registers a {@link GraphicalViewer} with the given >+ * {@link IWorkbenchPartReference}. >+ * >+ * @param viewer The viewer to register. >+ * @param partRef The reference to the part that (indirectly) contains the >+ * viewer. >+ */ >+ private void registerGraphicalViewer(GraphicalViewer viewer, >+ IWorkbenchPartReference partRef) { >+ >+ IWorkbenchPart part = partRef.getPart(false); >+ if (part != null && partRef instanceof WorkbenchPartReference) { >+ if (viewer != null) { >+ // Note the viewer on the component >+ Control partContent = >+ ((WorkbenchPartReference)partRef).getPane().getControl(); >+ >+ if (partContent != null && !partContent.isDisposed()) { >+ partContent.setData(Startup.TEST_GEF_VIEWER_DATA_KEY, >+ viewer); >+ } >+ } >+ } >+ } >+} >diff --git a/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/util/FigureCanvasUtil.java b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/util/FigureCanvasUtil.java >new file mode 100644 >index 0000000..0ff39de >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e3/src/org/eclipse/jubula/rc/rcp/e3/gef/util/FigureCanvasUtil.java >@@ -0,0 +1,114 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 BREDEX GmbH. >+ * 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 >+ * >+ * Contributors: >+ * BREDEX GmbH - initial API and implementation and/or initial documentation >+ *******************************************************************************/ >+package org.eclipse.jubula.rc.rcp.e3.gef.util; >+ >+import org.eclipse.draw2d.FigureCanvas; >+import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gef.EditPartViewer; >+import org.eclipse.gef.GraphicalViewer; >+import org.eclipse.gef.RootEditPart; >+import org.eclipse.jubula.rc.rcp.e3.accessor.Startup; >+import org.eclipse.jubula.rc.rcp.e3.gef.factory.DefaultEditPartAdapterFactory; >+import org.eclipse.jubula.rc.rcp.e3.gef.identifier.IEditPartIdentifier; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Display; >+ >+ >+/** >+ * Utility class for interacting with a FigureCanvas. >+ * >+ * @author BREDEX GmbH >+ * @created Jun 26, 2009 >+ */ >+public class FigureCanvasUtil { >+ >+ /** >+ * Private constructor >+ */ >+ private FigureCanvasUtil() { >+ // Nothing to initialize >+ } >+ >+ /** >+ * >+ * @param figureCanvas >+ * The canvas for which to find the viewer. >+ * @return the graphical viewer associated with the given canvas, or >+ * <code>null</code> if no such viewer could be found. >+ */ >+ public static GraphicalViewer getViewer(FigureCanvas figureCanvas) { >+ Composite parent = figureCanvas; >+ while (parent != null >+ && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) >+ instanceof GraphicalViewer)) { >+ parent = parent.getParent(); >+ } >+ >+ if (parent != null) { >+ >+ return (GraphicalViewer)parent >+ .getData(Startup.TEST_GEF_VIEWER_DATA_KEY); >+ } >+ >+ return null; >+ } >+ >+ /** >+ * >+ * @param display The display containing the edit part to find. >+ * @param viewer The viewer containing the edit part to find. >+ * @return the edit part for the viewer at the current mouse pointer >+ * coordinates, or <code>null</code> if no such edit part can be >+ * found. >+ */ >+ public static EditPart findAtCurrentMousePosition( >+ Display display, EditPartViewer viewer) { >+ Point cursorLocation = new Point(display.map(null, viewer.getControl(), >+ display.getCursorLocation())); >+ EditPart editPart = viewer.findObjectAt(cursorLocation); >+ EditPart primaryEditPart = getPrimaryEditPart(editPart, viewer >+ .getRootEditPart()); >+ >+ return primaryEditPart; >+ } >+ >+ /** >+ * Searches the path to root for the first element considered to be testable >+ * by Jubula. Testable in this case means that an ID can be acquired for >+ * the edit part. >+ * >+ * @param editPart >+ * The starting edit part. >+ * @param root >+ * The root for <code>editPart</code>. This is used to avoid >+ * identifying the root edit part as the primary edit part. >+ * @return the first edit part on the path to root that has an ID. >+ */ >+ public static EditPart getPrimaryEditPart(final EditPart editPart, >+ RootEditPart root) { >+ >+ EditPart currentEditPart = editPart; >+ >+ while (currentEditPart != root.getContents() >+ && currentEditPart != null) { >+ IEditPartIdentifier identifier = DefaultEditPartAdapterFactory >+ .loadFigureIdentifier(currentEditPart); >+ if (identifier != null) { >+ return currentEditPart; >+ } >+ currentEditPart = currentEditPart.getParent(); >+ } >+ >+ return null; >+ } >+ >+} >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/.checkstyle b/org.eclipse.jubula.rc.rcp.e4.compat/.checkstyle >new file mode 100644 >index 0000000..0afff86 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/.checkstyle >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+ >+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> >+ <fileset name="all" enabled="true" check-config-name="Jubula" local="false"> >+ <file-match-pattern match-pattern="." include-pattern="true"/> >+ </fileset> >+</fileset-config> >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/.classpath b/org.eclipse.jubula.rc.rcp.e4.compat/.classpath >new file mode 100644 >index 0000000..2fbb7a2 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/.classpath >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<classpath> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >+ <classpathentry kind="src" path="src"/> >+ <classpathentry kind="output" path="bin"/> >+</classpath> >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/.gitignore b/org.eclipse.jubula.rc.rcp.e4.compat/.gitignore >new file mode 100644 >index 0000000..934e0e0 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/.gitignore >@@ -0,0 +1,2 @@ >+/bin >+/target >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/.project b/org.eclipse.jubula.rc.rcp.e4.compat/.project >new file mode 100644 >index 0000000..e5ae231 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/.project >@@ -0,0 +1,41 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<projectDescription> >+ <name>org.eclipse.jubula.rc.rcp.e4.compat</name> >+ <comment></comment> >+ <projects> >+ </projects> >+ <buildSpec> >+ <buildCommand> >+ <name>org.eclipse.jdt.core.javabuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.ManifestBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.SchemaBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ <buildCommand> >+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ </buildSpec> >+ <natures> >+ <nature>org.eclipse.pde.PluginNature</nature> >+ <nature>org.eclipse.jdt.core.javanature</nature> >+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> >+ </natures> >+ <linkedResources> >+ <link> >+ <name>.settings</name> >+ <type>2</type> >+ <locationURI>WORKSPACE_LOC/jubula/org.eclipse.jubula.project.configuration/settings/1.4</locationURI> >+ </link> >+ </linkedResources> >+</projectDescription> >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/META-INF/MANIFEST.MF b/org.eclipse.jubula.rc.rcp.e4.compat/META-INF/MANIFEST.MF >new file mode 100644 >index 0000000..be00f0a >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/META-INF/MANIFEST.MF >@@ -0,0 +1,12 @@ >+Manifest-Version: 1.0 >+Bundle-ManifestVersion: 2 >+Bundle-Name: Jubula Remote Control - RCP e4 compat >+Bundle-SymbolicName: org.eclipse.jubula.rc.rcp.e4.compat; singleton:=true >+Bundle-Version: 2.0.0.qualifier >+Bundle-ClassPath: . >+Bundle-Vendor: Eclipse Jubula >+Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >+ org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)" >+Bundle-ActivationPolicy: lazy >+Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+ >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/about.html b/org.eclipse.jubula.rc.rcp.e4.compat/about.html >new file mode 100644 >index 0000000..f1be810 >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/about.html >@@ -0,0 +1,28 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> >+<title>About</title> >+</head> >+<body lang="EN-US"> >+<h2>About This Content</h2> >+ >+<p>June 22, 2011</p> >+<h3>License</h3> >+ >+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise >+indicated below, the Content is provided to you under the terms and conditions of the >+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available >+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. >+For purposes of the EPL, "Program" will mean the Content.</p> >+ >+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is >+being redistributed by another party ("Redistributor") and different terms and conditions may >+apply to your use of any object code in the Content. Check the Redistributor's license that was >+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise >+indicated below, the terms and conditions of the EPL still apply to any source code in the Content >+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> >+ >+</body> >+</html> >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/build.properties b/org.eclipse.jubula.rc.rcp.e4.compat/build.properties >new file mode 100644 >index 0000000..7643e7c >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/build.properties >@@ -0,0 +1,17 @@ >+############################################################################### >+# Copyright (c) 2004, 2011 BREDEX GmbH. >+# 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 >+############################################################################### >+bin.includes = about.html,\ >+ META-INF/,\ >+ plugin.xml,\ >+ . >+jars.compile.order = . >+source.. = src/ >+output.. = bin/ >+javacSource = 1.4 >+javacTarget = 1.4 >+javacErrors.. = -assertIdentifier >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/plugin.xml b/org.eclipse.jubula.rc.rcp.e4.compat/plugin.xml >new file mode 100644 >index 0000000..cba6b0b >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/plugin.xml >@@ -0,0 +1,11 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?><!-- >+ Copyright (c) 2004, 2010 BREDEX GmbH. >+ 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 >+ --> >+ >+<plugin> >+</plugin> >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/pom.xml b/org.eclipse.jubula.rc.rcp.e4.compat/pom.xml >new file mode 100644 >index 0000000..f644f9b >--- /dev/null >+++ b/org.eclipse.jubula.rc.rcp.e4.compat/pom.xml >@@ -0,0 +1,20 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!-- Copyright (c) 2004, 2011 BREDEX GmbH. 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 --> >+<project >+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >+ <modelVersion>4.0.0</modelVersion> >+ <parent> >+ <artifactId>org.eclipse.jubula.releng.client</artifactId> >+ <groupId>org.eclipse.jubula</groupId> >+ <version>2.0.0-SNAPSHOT</version> >+ <relativePath>../org.eclipse.jubula.releng.client</relativePath> >+ </parent> >+ <groupId>org.eclipse.jubula</groupId> >+ <artifactId>org.eclipse.jubula.rc.rcp.e4.compat</artifactId> >+ <version>2.0.0-SNAPSHOT</version> >+ <packaging>eclipse-plugin</packaging> >+</project> >diff --git a/org.eclipse.jubula.rc.rcp.e4.compat/src/.keep b/org.eclipse.jubula.rc.rcp.e4.compat/src/.keep >new file mode 100644 >index 0000000..e69de29 >diff --git a/org.eclipse.jubula.rc.rcp/.checkstyle b/org.eclipse.jubula.rc.rcp/.checkstyle >deleted file mode 100644 >index 0afff86..0000000 >--- a/org.eclipse.jubula.rc.rcp/.checkstyle >+++ /dev/null >@@ -1,7 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >- >-<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> >- <fileset name="all" enabled="true" check-config-name="Jubula" local="false"> >- <file-match-pattern match-pattern="." include-pattern="true"/> >- </fileset> >-</fileset-config> >diff --git a/org.eclipse.jubula.rc.rcp/.classpath b/org.eclipse.jubula.rc.rcp/.classpath >deleted file mode 100644 >index ba35c19..0000000 >--- a/org.eclipse.jubula.rc.rcp/.classpath >+++ /dev/null >@@ -1,24 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<classpath> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >- <classpathentry kind="src" path="src"/> >- <classpathentry kind="lib" path="lib/ch.qos.logback.classic.jar"/> >- <classpathentry kind="lib" path="lib/ch.qos.logback.core.jar"/> >- <classpathentry kind="lib" path="lib/ch.qos.logback.slf4j.jar"/> >- <classpathentry kind="lib" path="lib/org.apache.commons.beanutils.jar"/> >- <classpathentry kind="lib" path="lib/org.apache.commons.lang.jar"/> >- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.communication"/> >- <classpathentry kind="lib" path="lib/org.eclipse.jubula.communication.jar"/> >- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.rc.common"/> >- <classpathentry kind="lib" path="lib/org.eclipse.jubula.rc.common.jar"/> >- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.rc.swt"/> >- <classpathentry kind="lib" path="lib/org.eclipse.jubula.rc.swt.jar"/> >- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.jubula.tools"/> >- <classpathentry kind="lib" path="lib/org.eclipse.jubula.tools.jar"/> >- <classpathentry kind="lib" path="lib/org.slf4j.api.jar"/> >- <classpathentry kind="lib" path="lib/org.slf4j.jcl.jar"/> >- <classpathentry kind="lib" path="lib/xpp3_min-1.1.3.4.O.jar"/> >- <classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/> >- <classpathentry kind="output" path="bin"/> >-</classpath> >diff --git a/org.eclipse.jubula.rc.rcp/.gitignore b/org.eclipse.jubula.rc.rcp/.gitignore >deleted file mode 100644 >index 61e26da..0000000 >--- a/org.eclipse.jubula.rc.rcp/.gitignore >+++ /dev/null >@@ -1,3 +0,0 @@ >-/bin >-/target >-/lib >diff --git a/org.eclipse.jubula.rc.rcp/.project b/org.eclipse.jubula.rc.rcp/.project >deleted file mode 100644 >index 20fa1e4..0000000 >--- a/org.eclipse.jubula.rc.rcp/.project >+++ /dev/null >@@ -1,41 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<projectDescription> >- <name>org.eclipse.jubula.rc.rcp</name> >- <comment></comment> >- <projects> >- </projects> >- <buildSpec> >- <buildCommand> >- <name>org.eclipse.jdt.core.javabuilder</name> >- <arguments> >- </arguments> >- </buildCommand> >- <buildCommand> >- <name>org.eclipse.pde.ManifestBuilder</name> >- <arguments> >- </arguments> >- </buildCommand> >- <buildCommand> >- <name>org.eclipse.pde.SchemaBuilder</name> >- <arguments> >- </arguments> >- </buildCommand> >- <buildCommand> >- <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> >- <arguments> >- </arguments> >- </buildCommand> >- </buildSpec> >- <natures> >- <nature>org.eclipse.pde.PluginNature</nature> >- <nature>org.eclipse.jdt.core.javanature</nature> >- <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> >- </natures> >- <linkedResources> >- <link> >- <name>.settings</name> >- <type>2</type> >- <locationURI>WORKSPACE_LOC/jubula/org.eclipse.jubula.project.configuration/settings/1.4</locationURI> >- </link> >- </linkedResources> >-</projectDescription> >diff --git a/org.eclipse.jubula.rc.rcp/META-INF/MANIFEST.MF b/org.eclipse.jubula.rc.rcp/META-INF/MANIFEST.MF >deleted file mode 100644 >index d056c5b..0000000 >--- a/org.eclipse.jubula.rc.rcp/META-INF/MANIFEST.MF >+++ /dev/null >@@ -1,30 +0,0 @@ >-Manifest-Version: 1.0 >-Bundle-ManifestVersion: 2 >-Bundle-Name: Jubula Remote Control - RCP >-Bundle-SymbolicName: org.eclipse.jubula.rc.rcp; singleton:=true >-Bundle-Version: 2.0.0.qualifier >-Bundle-ClassPath: ., >- lib/org.eclipse.jubula.tools.jar, >- lib/org.apache.commons.lang.jar, >- lib/org.apache.oro.jar, >- lib/org.apache.commons.beanutils.jar, >- lib/org.eclipse.jubula.rc.common.jar, >- lib/org.eclipse.jubula.rc.swt.jar, >- lib/org.eclipse.jubula.communication.jar, >- lib/org.slf4j.api.jar, >- lib/org.slf4j.jcl.jar, >- lib/ch.qos.logback.slf4j.jar, >- lib/ch.qos.logback.core.jar, >- lib/ch.qos.logback.classic.jar, >- lib/xpp3_min-1.1.3.4.O.jar, >- lib/xstream-1.3.1.jar, >- resources/ >-Bundle-Vendor: Eclipse Jubula >-Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.draw2d;bundle-version="[3.0.0,4.0.0)";resolution:=optional, >- org.eclipse.gef;bundle-version="[3.0.0,4.0.0)";resolution:=optional >-Bundle-ActivationPolicy: lazy >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >-Export-Package: org.eclipse.jubula.rc.rcp.gef.factory, >- org.eclipse.jubula.rc.rcp.gef.identifier >diff --git a/org.eclipse.jubula.rc.rcp/about.html b/org.eclipse.jubula.rc.rcp/about.html >deleted file mode 100644 >index f1be810..0000000 >--- a/org.eclipse.jubula.rc.rcp/about.html >+++ /dev/null >@@ -1,28 +0,0 @@ >-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >-<html xmlns="http://www.w3.org/1999/xhtml"> >-<head> >-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> >-<title>About</title> >-</head> >-<body lang="EN-US"> >-<h2>About This Content</h2> >- >-<p>June 22, 2011</p> >-<h3>License</h3> >- >-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise >-indicated below, the Content is provided to you under the terms and conditions of the >-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available >-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. >-For purposes of the EPL, "Program" will mean the Content.</p> >- >-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is >-being redistributed by another party ("Redistributor") and different terms and conditions may >-apply to your use of any object code in the Content. Check the Redistributor's license that was >-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise >-indicated below, the terms and conditions of the EPL still apply to any source code in the Content >-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> >- >-</body> >-</html> >diff --git a/org.eclipse.jubula.rc.rcp/build.properties b/org.eclipse.jubula.rc.rcp/build.properties >deleted file mode 100644 >index 784306e..0000000 >--- a/org.eclipse.jubula.rc.rcp/build.properties >+++ /dev/null >@@ -1,32 +0,0 @@ >-############################################################################### >-# Copyright (c) 2004, 2011 BREDEX GmbH. >-# 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 >-############################################################################### >-bin.includes = about.html,\ >- resources/,\ >- META-INF/,\ >- plugin.xml,\ >- .,\ >- lib/org.eclipse.jubula.tools.jar,\ >- lib/org.apache.commons.lang.jar,\ >- lib/org.apache.commons.beanutils.jar,\ >- lib/org.apache.oro.jar,\ >- lib/org.eclipse.jubula.rc.common.jar,\ >- lib/org.eclipse.jubula.rc.swt.jar,\ >- lib/org.eclipse.jubula.communication.jar,\ >- lib/org.slf4j.api.jar,\ >- lib/org.slf4j.jcl.jar,\ >- lib/ch.qos.logback.slf4j.jar,\ >- lib/ch.qos.logback.core.jar,\ >- lib/ch.qos.logback.classic.jar,\ >- lib/xpp3_min-1.1.3.4.O.jar,\ >- lib/xstream-1.3.1.jar >-jars.compile.order = . >-source.. = src/ >-output.. = bin/ >-javacSource = 1.4 >-javacTarget = 1.4 >-javacErrors.. = -assertIdentifier >diff --git a/org.eclipse.jubula.rc.rcp/genLib.xml b/org.eclipse.jubula.rc.rcp/genLib.xml >deleted file mode 100644 >index ef8215b..0000000 >--- a/org.eclipse.jubula.rc.rcp/genLib.xml >+++ /dev/null >@@ -1,111 +0,0 @@ >-<!-- >- Copyright (c) 2004, 2011 BREDEX GmbH. >- 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 >- --> >-<project name="org.eclipse.jubula.rc.rcp" default="gen-lib" basedir="."> >- >- <property name="OrbitStorage" value="../org.eclipse.jubula.rc.common.orbit" /> >- <property name="SiteStorage" value="../org.eclipse.jubula.site/target/site/plugins" /> >- >- <target name="gen-lib"> >- >- <mkdir dir="lib" /> >- <delete> >- <fileset dir="lib" includes="**/*"/> >- </delete> >- >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="ch.qos.logback.classic*.jar" /> >- </fileset> >- <mergemapper to="ch.qos.logback.classic.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="ch.qos.logback.core*.jar" /> >- </fileset> >- <mergemapper to="ch.qos.logback.core.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="ch.qos.logback.slf4j*.jar" /> >- </fileset> >- <mergemapper to="ch.qos.logback.slf4j.jar"/> >- </copy> >- >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="org.apache.commons.beanutils*.jar" /> >- </fileset> >- <mergemapper to="org.apache.commons.beanutils.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="org.apache.commons.lang*.jar" /> >- </fileset> >- <mergemapper to="org.apache.commons.lang.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="org.apache.oro*.jar" /> >- </fileset> >- <mergemapper to="org.apache.oro.jar"/> >- </copy> >- >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="org.slf4j.api*.jar" /> >- </fileset> >- <mergemapper to="org.slf4j.api.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="${OrbitStorage}"> >- <include name="org.slf4j.jcl*.jar" /> >- </fileset> >- <mergemapper to="org.slf4j.jcl.jar"/> >- </copy> >- >- <!-- >- The "SNAPSHOT" in the include selector ensures that only the non-source >- JAR is used. Without it, the corresponding source JAR was being used, >- and it was either being used exclusively or was *overwriting* the content >- provided by the non-source JAR. This caused compilation to fail when also >- building source bundles. >- --> >- <copy todir="lib"> >- <fileset dir="../org.eclipse.jubula.rc.common/target"> >- <include name="org.eclipse.jubula.rc.common*SNAPSHOT.jar" /> >- </fileset> >- <mergemapper to="org.eclipse.jubula.rc.common.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="../org.eclipse.jubula.rc.swt/target"> >- <include name="org.eclipse.jubula.rc.swt*SNAPSHOT.jar" /> >- </fileset> >- <mergemapper to="org.eclipse.jubula.rc.swt.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="../org.eclipse.jubula.tools/target"> >- <include name="org.eclipse.jubula.tools*SNAPSHOT.jar" /> >- </fileset> >- <mergemapper to="org.eclipse.jubula.tools.jar"/> >- </copy> >- <copy todir="lib"> >- <fileset dir="../org.eclipse.jubula.communication/target"> >- <include name="org.eclipse.jubula.communication*SNAPSHOT.jar" /> >- </fileset> >- <mergemapper to="org.eclipse.jubula.communication.jar"/> >- </copy> >- >- <copy todir="lib"> >- <fileset dir="../org.eclipse.jubula.tools/lib"> >- <include name="xpp3*.jar" /> >- <include name="xstream*.jar" /> >- </fileset> >- </copy> >- </target> >- >-</project> >diff --git a/org.eclipse.jubula.rc.rcp/plugin.xml b/org.eclipse.jubula.rc.rcp/plugin.xml >deleted file mode 100644 >index e9c7167..0000000 >--- a/org.eclipse.jubula.rc.rcp/plugin.xml >+++ /dev/null >@@ -1,14 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<?eclipse version="3.2"?><!-- >- Copyright (c) 2004, 2010 BREDEX GmbH. >- 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 >- --> >- >-<plugin> >- <extension point="org.eclipse.ui.startup"> >- <startup class="org.eclipse.jubula.rc.rcp.accessor.Startup"/> >- </extension> >-</plugin> >diff --git a/org.eclipse.jubula.rc.rcp/pom.xml b/org.eclipse.jubula.rc.rcp/pom.xml >deleted file mode 100644 >index e321dd8..0000000 >--- a/org.eclipse.jubula.rc.rcp/pom.xml >+++ /dev/null >@@ -1,77 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >- <modelVersion>4.0.0</modelVersion> >- <parent> >- <artifactId>org.eclipse.jubula.releng.client</artifactId> >- <groupId>org.eclipse.jubula</groupId> >- <version>2.0.0-SNAPSHOT</version> >- <relativePath>../org.eclipse.jubula.releng.client</relativePath> >- </parent> >- <groupId>org.eclipse.jubula</groupId> >- <artifactId>org.eclipse.jubula.rc.rcp</artifactId> >- <version>2.0.0-SNAPSHOT</version> >- <packaging>eclipse-plugin</packaging> >- >- <dependencies> >- <dependency> >- <groupId>org.eclipse.jubula</groupId> >- <artifactId>org.eclipse.jubula.tools</artifactId> >- <version>2.0.0-SNAPSHOT</version> >- </dependency> >- <dependency> >- <groupId>org.eclipse.jubula</groupId> >- <artifactId>org.eclipse.jubula.communication</artifactId> >- <version>2.0.0-SNAPSHOT</version> >- </dependency> >- <dependency> >- <groupId>org.eclipse.jubula</groupId> >- <artifactId>org.eclipse.jubula.rc.common</artifactId> >- <version>2.0.0-SNAPSHOT</version> >- </dependency> >- <dependency> >- <groupId>org.eclipse.jubula</groupId> >- <artifactId>org.eclipse.jubula.rc.swt</artifactId> >- <version>2.0.0-SNAPSHOT</version> >- </dependency> >- </dependencies> >- >- <build> >- <plugins> >- <plugin> >- <artifactId>maven-antrun-plugin</artifactId> >- <version>1.6</version> >- <executions> >- <execution> >- <id>gen-lib</id> >- <phase>generate-resources</phase> >- <configuration> >- <target> >- <ant antfile="genLib.xml" /> >- </target> >- </configuration> >- <goals> >- <goal>run</goal> >- </goals> >- </execution> >- </executions> >- </plugin> >- <plugin> >- <artifactId>maven-clean-plugin</artifactId> >- <version>2.4.1</version> >- <configuration> >- <filesets> >- <fileset> >- <directory>lib</directory> >- <includes> >- <include>*.jar</include> >- </includes> >- <followSymlinks>false</followSymlinks> >- </fileset> >- </filesets> >- </configuration> >- </plugin> >- </plugins> >- </build> >- >-</project> >diff --git a/org.eclipse.jubula.rc.rcp/resources/logback.xml b/org.eclipse.jubula.rc.rcp/resources/logback.xml >deleted file mode 100644 >index 79b623c..0000000 >--- a/org.eclipse.jubula.rc.rcp/resources/logback.xml >+++ /dev/null >@@ -1,20 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<configuration scan="true"> >- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> >- <!-- encoders are by default assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder --> >- <encoder> >- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n >- </pattern> >- </encoder> >- </appender> >- <appender name="FILE" class="ch.qos.logback.core.FileAppender"> >- <file>${user.home}/.jubula/logs/rc_rcp.log</file> >- <encoder> >- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n >- </pattern> >- </encoder> >- </appender> >- <root level="warn"> >- <appender-ref ref="FILE" /> >- </root> >-</configuration> >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/accessor/Startup.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/accessor/Startup.java >deleted file mode 100644 >index 57489df..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/accessor/Startup.java >+++ /dev/null >@@ -1,694 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.accessor; >- >-import java.lang.reflect.InvocationTargetException; >-import java.lang.reflect.Method; >-import java.util.ArrayList; >-import java.util.HashMap; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >-import java.util.Properties; >- >-import org.eclipse.core.runtime.Platform; >-import org.eclipse.jface.action.IContributionItem; >-import org.eclipse.jface.dialogs.Dialog; >-import org.eclipse.jface.dialogs.IDialogConstants; >-import org.eclipse.jface.dialogs.IPageChangedListener; >-import org.eclipse.jface.dialogs.PageChangedEvent; >-import org.eclipse.jface.preference.IPreferenceNode; >-import org.eclipse.jface.preference.PreferenceDialog; >-import org.eclipse.jface.preference.PreferenceManager; >-import org.eclipse.jubula.rc.common.AUTServer; >-import org.eclipse.jubula.rc.rcp.gef.inspector.GefInspectorListenerAppender; >-import org.eclipse.jubula.rc.rcp.gef.listener.GefPartListener; >-import org.eclipse.jubula.rc.swt.SwtAUTServer; >-import org.eclipse.jubula.rc.swt.listener.ComponentHandler; >-import org.eclipse.jubula.tools.constants.AutConfigConstants; >-import org.eclipse.jubula.tools.constants.AutEnvironmentConstants; >-import org.eclipse.jubula.tools.constants.CommandConstants; >-import org.eclipse.jubula.tools.constants.SwtAUTHierarchyConstants; >-import org.eclipse.jubula.tools.utils.EnvironmentUtils; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.CoolBar; >-import org.eclipse.swt.widgets.CoolItem; >-import org.eclipse.swt.widgets.Display; >-import org.eclipse.swt.widgets.Event; >-import org.eclipse.swt.widgets.Item; >-import org.eclipse.swt.widgets.Listener; >-import org.eclipse.swt.widgets.Shell; >-import org.eclipse.swt.widgets.ToolBar; >-import org.eclipse.swt.widgets.Widget; >-import org.eclipse.ui.IEditorReference; >-import org.eclipse.ui.IPartListener2; >-import org.eclipse.ui.IStartup; >-import org.eclipse.ui.IViewReference; >-import org.eclipse.ui.IWindowListener; >-import org.eclipse.ui.IWorkbench; >-import org.eclipse.ui.IWorkbenchPage; >-import org.eclipse.ui.IWorkbenchPartReference; >-import org.eclipse.ui.IWorkbenchWindow; >-import org.eclipse.ui.PlatformUI; >-import org.eclipse.ui.internal.WorkbenchPartReference; >- >- >-/** >- * Initializes an AUT Server in a plug-in context. >- * >- * It is very important to avoid referencing GEF (org.eclipse.gef.*) classes >- * directly from this class, as this will cause Class Not Found errors if the >- * AUT does not contain the GEF plug-in. >- * >- * @author BREDEX GmbH >- * @created Oct 5, 2007 >- */ >-public class Startup implements IStartup { >- /** Key for GEF Viewer in component data */ >- public static final String TEST_GEF_VIEWER_DATA_KEY = "TEST_GEF_VIEWER"; //$NON-NLS-1$ >- >- /** bundle ID for Eclipse Graphical Editing Framework (GEF) */ >- public static final String GEF_BUNDLE_ID = "org.eclipse.gef"; //$NON-NLS-1$ >- >- /** Key for RCP partId in component data */ >- private static final String TEST_RCP_DATA_KEY = >- SwtAUTHierarchyConstants.RCP_NAME; >- >- /** ID suffix for toolbars belonging to a part (view/editor) */ >- private static final String TOOLBAR_ID_SUFFIX = ".toolbar"; //$NON-NLS-1$ >- >- /** Single listener instance */ >- private static IPartListener2 partNamingListener = >- new PartNamingListener(); >- >- /** >- * This listener >- */ >- private IPartListener2 m_gefListener = null; >- >- /** >- * This listener assigns names to components as they become visible. The >- * assigned name is determined by supporting data of the component and its >- * surroundings. >- * >- * @author BREDEX GmbH >- * @created Oct 19, 2007 >- */ >- private static class ComponentNamer implements Listener { >- >- /** map for naming dialog buttons */ >- private static Map componentNAMES = new HashMap(); >- >- /** is name generation enabled */ >- private static boolean generateNames = false; >- >- static { >- generateNames = Boolean.valueOf( >- EnvironmentUtils.getProcessEnvironment() >- .getProperty( >- AutEnvironmentConstants >- .GENERATE_COMPONENT_NAMES)) >- .booleanValue(); >- >- addCompName(IDialogConstants.ABORT_ID, "abort"); //$NON-NLS-1$ >- addCompName(IDialogConstants.BACK_ID, "back"); //$NON-NLS-1$ >- addCompName(IDialogConstants.CANCEL_ID, "cancel"); //$NON-NLS-1$ >- addCompName(IDialogConstants.CLIENT_ID, "client"); //$NON-NLS-1$ >- addCompName(IDialogConstants.CLOSE_ID, "close"); //$NON-NLS-1$ >- addCompName(IDialogConstants.DESELECT_ALL_ID, "deselectAll"); //$NON-NLS-1$ >- addCompName(IDialogConstants.DETAILS_ID, "details"); //$NON-NLS-1$ >- addCompName(IDialogConstants.FINISH_ID, "finish"); //$NON-NLS-1$ >- addCompName(IDialogConstants.HELP_ID, "help"); //$NON-NLS-1$ >- addCompName(IDialogConstants.IGNORE_ID, "ignore"); //$NON-NLS-1$ >- addCompName(IDialogConstants.INTERNAL_ID, "internal"); //$NON-NLS-1$ >- addCompName(IDialogConstants.NEXT_ID, "next"); //$NON-NLS-1$ >- addCompName(IDialogConstants.NO_ID, "no"); //$NON-NLS-1$ >- addCompName(IDialogConstants.NO_TO_ALL_ID, "noToAll"); //$NON-NLS-1$ >- addCompName(IDialogConstants.OK_ID, "ok"); //$NON-NLS-1$ >- addCompName(IDialogConstants.OPEN_ID, "open"); //$NON-NLS-1$ >- addCompName(IDialogConstants.PROCEED_ID, "proceed"); //$NON-NLS-1$ >- addCompName(IDialogConstants.RETRY_ID, "retry"); //$NON-NLS-1$ >- addCompName(IDialogConstants.SELECT_ALL_ID, "selectAll"); //$NON-NLS-1$ >- addCompName(IDialogConstants.SELECT_TYPES_ID, "selectTypes"); //$NON-NLS-1$ >- addCompName(IDialogConstants.SKIP_ID, "skip"); //$NON-NLS-1$ >- addCompName(IDialogConstants.STOP_ID, "stop"); //$NON-NLS-1$ >- addCompName(IDialogConstants.YES_ID, "yes"); //$NON-NLS-1$ >- addCompName(IDialogConstants.YES_TO_ALL_ID, "yesToAll"); //$NON-NLS-1$ >- } >- >- /** >- * add component id <-> name mapping >- * @param compID the component identifier >- * @param compName the component name >- */ >- private static void addCompName(int compID, String compName) { >- String staticNamePreafix = "dialog.button."; //$NON-NLS-1$ >- componentNAMES.put(new Integer(compID), >- staticNamePreafix + compName); >- } >- >- /** >- * {@inheritDoc} >- */ >- public void handleEvent(Event event) { >- addNameData(event.widget); >- Item [] items = new Item [] {}; >- if (event.widget instanceof ToolBar) { >- items = ((ToolBar)event.widget).getItems(); >- } else if (event.widget instanceof CoolBar) { >- items = ((CoolBar)event.widget).getItems(); >- } >- for (int i = 0; i < items.length; i++) { >- addNameData(items[i]); >- } >- } >- >- /** >- * Adds name information to the given widget, if necessary. >- * >- * @param widget The widget to name. >- */ >- private void addNameData(Widget widget) { >- // Assign name >- if (widget != null && !widget.isDisposed()) { >- if (widget.getData(Startup.TEST_RCP_DATA_KEY) != null) { >- // Component already has a name, so we don't need to >- // assign a new one. >- return; >- } >- Object data = getWidgetData(widget); >- >- if (data instanceof IContributionItem) { >- // Name buttons and toolitems according to the action that >- // they represent, if possible. >- String actionId = ((IContributionItem)data).getId(); >- if (actionId != null && actionId.trim().length() > 0) { >- >- widget.setData(Startup.TEST_RCP_DATA_KEY, actionId); >- ComponentHandler.getAutHierarchy() >- .refreshComponentName(widget); >- >- } >- } else if (data instanceof PreferenceDialog) { >- PreferenceDialog prefDialog = (PreferenceDialog)data; >- >- // Add a listener to add name data as pages are >- // selected/created. >- prefDialog.addPageChangedListener( >- new IPageChangedListener() { >- >- public void pageChanged(PageChangedEvent event) { >- addNameDataToPrefPage(event.getSelectedPage()); >- } >- >- }); >- >- // The listener won't notice the initally selected page, >- // so we have to add that name data here. >- addNameDataToPrefPage(prefDialog.getSelectedPage()); >- } >- if (generateNames && data instanceof Dialog) { >- Dialog dialog = (Dialog)data; >- setNameForDialogButtonBarButtons(dialog); >- } >- } >- } >- >- /** >- * >- * @param widget The widget for which to get the data. >- * @return the data object corresponding to the given widget. >- */ >- private Object getWidgetData(Widget widget) { >- Object data = widget.getData(); >- >- // Handle the case of CoolBar containing CoolItem containing ToolBar. >- // The CoolItem is the widget that represents the toolbar >- // contribution, but it (the CoolItem) is not in our AUT >- // component hierarchy, due to the fact that the ToolBar's >- // getParent() returns the CoolBar rather than the CoolItem. >- // To resolve this discrepancy, we use the data from the >- // coresponding CoolItem to generate a name for the ToolBar. >- try { >- if (widget instanceof ToolBar) { >- Composite toolbarParent = ((ToolBar)widget).getParent(); >- if (toolbarParent instanceof CoolBar) { >- CoolItem [] coolItems = >- ((CoolBar)toolbarParent).getItems(); >- for (int i = 0; i < coolItems.length; i++) { >- CoolItem item = coolItems[i]; >- if (item != null >- && item.getControl() == widget) { >- data = item.getData(); >- } >- } >- } >- } >- } catch (NoClassDefFoundError e) { >- // we may be running in eRCP which doesn't know >- // about >- // toolbars, so we just ignore this >- } >- >- return data; >- } >- >- /** >- * @param dialog the dialog >- */ >- private void setNameForDialogButtonBarButtons(Dialog dialog) { >- try { >- Method getButtonMethod = Dialog.class.getDeclaredMethod( >- "getButton", new Class[] { int.class }); //$NON-NLS-1$ >- getButtonMethod.setAccessible(true); >- >- Iterator components = componentNAMES.keySet().iterator(); >- while (components.hasNext()) { >- Integer componentID = (Integer)components.next(); >- invokeNameSetting(dialog, getButtonMethod, componentID, >- componentNAMES.get(componentID)); >- } >- } catch (SecurityException e) { >- // ignore exceptions >- } catch (NoSuchMethodException e) { >- // ignore exceptions >- } >- } >- >- /** >- * use this method to set a name on the given object >- * @param useObject the object >- * @param methodToInvoke the method to invoke >- * @param buttonID the button id >- * @param buttonName the button name >- */ >- private void invokeNameSetting(Object useObject, Method methodToInvoke, >- Integer buttonID, Object buttonName) { >- Object ret = null; >- try { >- ret = methodToInvoke.invoke(useObject, >- new Object[] { buttonID }); >- } catch (IllegalArgumentException e) { >- // ignore exceptions >- } catch (IllegalAccessException e) { >- // ignore exceptions >- } catch (InvocationTargetException e) { >- // ignore exceptions >- } >- if (ret instanceof Button) { >- Button button = (Button)ret; >- if (button.getData(TEST_RCP_DATA_KEY) == null) { >- button.setData(TEST_RCP_DATA_KEY, buttonName); >- } >- } >- } >- >- /** >- * Attaches name data to the given page appropriate. >- * >- * @param selectedPage The page to which we will try to attach the >- * name data. >- */ >- private void addNameDataToPrefPage(Object selectedPage) { >- if (selectedPage == null) { >- return; >- } >- PreferenceManager prefMan = >- PlatformUI.getWorkbench().getPreferenceManager(); >- >- Iterator iter = >- prefMan.getElements(PreferenceManager.PRE_ORDER).iterator(); >- while (iter.hasNext()) { >- IPreferenceNode prefNode = >- (IPreferenceNode)iter.next(); >- if (selectedPage.equals(prefNode.getPage())) { >- Control pageControl = >- prefNode.getPage().getControl(); >- String prefNodeId = prefNode.getId(); >- >- // Assign id to page composite only if the composite exists >- // and if the id is usable >- if (pageControl != null >- && !pageControl.isDisposed() >- && pageControl.getData( >- Startup.TEST_RCP_DATA_KEY) == null >- && prefNodeId != null >- && prefNodeId.trim().length() > 0) { >- >- pageControl.setData( >- Startup.TEST_RCP_DATA_KEY, prefNodeId); >- >- Shell prefShell = >- pageControl.getDisplay().getActiveShell(); >- Event activateEvent = new Event(); >- activateEvent.time = (int)System.currentTimeMillis(); >- activateEvent.type = SWT.Activate; >- activateEvent.widget = prefShell; >- prefShell.notifyListeners(SWT.Activate, activateEvent); >- >- } >- >- // We found the page we were looking for, so we can stop >- // searching. >- break; >- } >- } >- } >- } >- >- /** >- * Assigns the controls (Composites) of Parts unique names based on >- * their partId. >- * >- * @author BREDEX GmbH >- * @created Oct 5, 2007 >- */ >- static class PartNamingListener implements IPartListener2 { >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partActivated(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partBroughtToTop(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partClosed(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partDeactivated(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partHidden(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partInputChanged(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partOpened(IWorkbenchPartReference partRef) { >- if (partRef instanceof WorkbenchPartReference) { >- WorkbenchPartReference workbenchPartRef = >- (WorkbenchPartReference)partRef; >- // Get pane contents and part id >- Control partContent = >- workbenchPartRef.getPane().getControl(); >- >- if (partContent != null >- && !partContent.isDisposed() >- && partContent.getData(TEST_RCP_DATA_KEY) == null) { >- >- // Name pane control based on part >- String partId = workbenchPartRef.getId(); >- >- // Append secondary id, if necessary >- if (partRef instanceof IViewReference) { >- String secondaryId = >- ((IViewReference)partRef).getSecondaryId(); >- if (secondaryId != null) { >- partId += "_" + secondaryId; //$NON-NLS-1$ >- } >- } >- >- if (partId == null || partId.trim().length() == 0) { >- // Don't assign a name if the id is unusable >- return; >- } >- partContent.setData(TEST_RCP_DATA_KEY, partId); >- >- // Assign a corresponding id to the part's toolbar, if >- // possible/usable. >- Control partToolbar = >- workbenchPartRef.getPane().getToolBar(); >- if (partToolbar != null) { >- partToolbar.setData(TEST_RCP_DATA_KEY, >- partId + TOOLBAR_ID_SUFFIX); >- } >- >- // A repaint is required in order for the aut component >- // hierarchy to notice the change. >- Shell shell = PlatformUI.getWorkbench() >- .getActiveWorkbenchWindow().getShell(); >- repaintToolbars(shell); >- } >- } >- >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partVisible(IWorkbenchPartReference partRef) { >- partOpened(partRef); >- } >- >- } >- >- >- /** >- * {@inheritDoc} >- */ >- public void earlyStartup() { >- final Properties envVars = >- EnvironmentUtils.getProcessEnvironment(); >- >- if (getValue(AutConfigConstants.AUT_AGENT_HOST, envVars) != null) { >- final IWorkbench workbench = PlatformUI.getWorkbench(); >- final Display display = workbench.getDisplay(); >- initAutServer(display, envVars); >- >- display.syncExec(new Runnable() { >- public void run() { >- // add GEF listeners (and listener appenders) for GEF, if available >- if (Platform.getBundle(Startup.GEF_BUNDLE_ID) != null) { >- m_gefListener = new GefPartListener(); >- AUTServer.getInstance().addInspectorListenerAppender( >- new GefInspectorListenerAppender()); >- } >- >- // add naming listener >- ComponentNamer namer = new ComponentNamer(); >- display.addFilter(SWT.Paint, namer); >- display.addFilter(SWT.Activate, namer); >- >- // Add window listener >- addWindowListener(workbench); >- >- IWorkbenchWindow window = >- workbench.getActiveWorkbenchWindow(); >- if (window != null) { >- // Add part listeners >- addPartListeners(window); >- >- // Handle existing parts >- IWorkbenchPage [] pages = window.getPages(); >- for (int i = 0; i < pages.length; i++) { >- IEditorReference[] editorRefs = >- pages[i].getEditorReferences(); >- IViewReference[] viewRefs = >- pages[i].getViewReferences(); >- for (int j = 0; j < editorRefs.length; j++) { >- partNamingListener.partOpened(editorRefs[j]); >- if (m_gefListener != null) { >- m_gefListener.partOpened(editorRefs[j]); >- } >- } >- for (int k = 0; k < viewRefs.length; k++) { >- partNamingListener.partOpened(viewRefs[k]); >- if (m_gefListener != null) { >- m_gefListener.partOpened(viewRefs[k]); >- } >- } >- } >- >- // If a shell already exists, make sure that we get another >- // chance to immediately add/use our naming listeners. >- Shell mainShell = window.getShell(); >- if (mainShell != null && !mainShell.isDisposed()) { >- repaintToolbars(mainShell); >- } >- } >- } >- >- }); >- >- // add listener to AUT >- AUTServer.getInstance().addToolKitEventListenerToAUT(); >- >- } >- >- } >- >- /** >- * Initializes the AUT Server for the host application. >- * >- * @param display The Display to use for the AUT Server. >- * @param envVars Environment variables to consult in configuring the >- * AUT Server. >- */ >- private void initAutServer(Display display, Properties envVars) { >- ((SwtAUTServer)AUTServer.getInstance(CommandConstants >- .AUT_SWT_SERVER)).setDisplay(display); >- AUTServer.getInstance().setAutAgentHost(getValue( >- AutConfigConstants.AUT_AGENT_HOST, envVars)); >- AUTServer.getInstance().setAutAgentPort(getValue( >- AutConfigConstants.AUT_AGENT_PORT, envVars)); >- AUTServer.getInstance().setAutID(getValue( >- AutConfigConstants.AUT_NAME, envVars)); >- >- AUTServer.getInstance().start(true); >- } >- >- /** >- * Adds a window listener to the given workbench. This listener adds a >- * part naming listener to opening windows. >- * >- * @param workbench The workbench to which the listener will be added. >- */ >- private void addWindowListener(IWorkbench workbench) { >- workbench.addWindowListener(new IWindowListener() { >- >- public void windowActivated(IWorkbenchWindow window) { >- addPartListeners(window); >- } >- >- public void windowClosed(IWorkbenchWindow window) { >- // Do nothing >- } >- >- public void windowDeactivated(IWorkbenchWindow window) { >- // Do nothing >- } >- >- public void windowOpened(IWorkbenchWindow window) { >- addPartListeners(window); >- } >- >- }); >- } >- >- /** >- * Fires a paint event on all Toolbars and Coolbars within the given shell. >- * >- * @param mainShell The shell to search for Coolbars and Toolbars. >- */ >- public static void repaintToolbars(Shell mainShell) { >- List toolbarList = new ArrayList(); >- getToolbars(mainShell, toolbarList); >- Iterator iter = toolbarList.iterator(); >- while (iter.hasNext()) { >- Control toolbar = (Control)iter.next(); >- toolbar.update(); >- toolbar.redraw(); >- toolbar.update(); >- } >- } >- >- /** >- * Adds all Coolbars and Toolbars within the given composite to the given >- * list. The search is is also performed recursively on children of the >- * given composite. >- * >- * @param composite The composite to search. >- * @param toolbarList The list to which found Toolbars and Coolbars will >- * be added. >- */ >- public static void getToolbars(Composite composite, >- List toolbarList) { >- >- if (composite != null && !composite.isDisposed()) { >- Control [] children = composite.getChildren(); >- for (int i = 0; i < children.length; i++) { >- if (children[i] instanceof Composite) { >- getToolbars((Composite)children[i], toolbarList); >- } >- try { >- if (children[i] instanceof ToolBar >- || children[i] instanceof CoolBar) { >- >- toolbarList.add(children[i]); >- } >- } catch (NoClassDefFoundError e) { >- // we may be running in eRCP which doesn't know about >- // toolbars, so we just ignore this >- } >- } >- } >- } >- >- /** >- * Add part listeners to the given window. >- * >- * @param window The window to which the listeners will be added. >- */ >- private void addPartListeners(IWorkbenchWindow window) { >- window.getPartService().addPartListener(partNamingListener); >- if (m_gefListener != null) { >- window.getPartService().addPartListener(m_gefListener); >- } >- } >- >- /** >- * Returns the value for a given property. First, <code>envVars</code> >- * is checked for the given property. If this >- * property cannot be found there, the >- * Java System Properties will be checked. If the property is not >- * found there, <code>null</code> will be returned. >- * >- * @param envVars The first source to check for the given property. >- * @param propName The name of the property for which to find the value. >- * @return The value for the given property name, or <code>null</code> if >- * given property name cannot be found. >- */ >- private String getValue(String propName, Properties envVars) { >- String value = >- envVars.getProperty(propName); >- if (value == null) { >- value = System.getProperty(propName); >- } >- return value; >- } >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/factory/DefaultEditPartAdapterFactory.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/factory/DefaultEditPartAdapterFactory.java >deleted file mode 100644 >index 6f046e2..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/factory/DefaultEditPartAdapterFactory.java >+++ /dev/null >@@ -1,85 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.factory; >- >-import org.eclipse.core.runtime.IAdapterFactory; >-import org.eclipse.core.runtime.Platform; >-import org.eclipse.gef.EditPart; >-import org.eclipse.jubula.rc.rcp.gef.identifier.ClassCountEditPartIdentifier; >-import org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier; >- >- >-/** >- * The default adapter factory for getting adapters from EditPart to >- * IEditPartIdentifier. >- * >- * @author BREDEX GmbH >- * @created May 13, 2009 >- */ >-public class DefaultEditPartAdapterFactory implements IAdapterFactory { >- >- /** the types managed by this factory */ >- private static final Class [] ADAPTABLE_TYPES = >- new Class [] {EditPart.class}; >- >- /** >- * {@inheritDoc} >- */ >- public Object getAdapter(Object adaptableObject, Class adapterType) { >- if (adaptableObject instanceof EditPart) { >- if (adapterType == IEditPartIdentifier.class) { >- return new ClassCountEditPartIdentifier( >- (EditPart)adaptableObject); >- } >- } >- return null; >- } >- >- /** >- * {@inheritDoc} >- */ >- public Class[] getAdapterList() { >- return ADAPTABLE_TYPES; >- } >- >- /** >- * >- * @param editPart The EditPart for which to find the IEditPartIdentifier. >- * @return the IEditPartIdentifier for the given EditPart. First, an attempt >- * is made to load this from a registered adapter factory. If this >- * does not provide an adapter, then this adapter factory is >- * queried, providing a default implementation. >- */ >- public static IEditPartIdentifier loadFigureIdentifier(EditPart editPart) { >- if (editPart == null) { >- // null-safe >- return null; >- } >- IEditPartIdentifier editPartIdentifier = >- (IEditPartIdentifier)Platform.getAdapterManager().loadAdapter( >- editPart, IEditPartIdentifier.class.getName()); >-// if (editPartIdentifier == null) { >-// AccessibleEditPart accessible = >-// (AccessibleEditPart)Platform.getAdapterManager().loadAdapter( >-// editPart, AccessibleEditPart.class.getName()); >-// AccessibleEvent e = new AccessibleEvent(IEditPartIdentifier.class); >-// accessible.getName(e); >-// if (e.result != null) { >-// editPartIdentifier = new StaticEditPartIdentifier(e.result); >-// } >-// } >- if (editPartIdentifier == null) { >- editPartIdentifier = new ClassCountEditPartIdentifier(editPart); >- } >- >- return editPartIdentifier; >- } >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/ClassCountEditPartIdentifier.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/ClassCountEditPartIdentifier.java >deleted file mode 100644 >index 6570f42..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/ClassCountEditPartIdentifier.java >+++ /dev/null >@@ -1,73 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.identifier; >- >-import java.util.HashMap; >-import java.util.Iterator; >-import java.util.Map; >- >-import org.eclipse.gef.EditPart; >- >-/** >- * Default implementation of {@link IEditPartIdentifier}. The identifier is >- * the name of the class of the {@link EditPart} plus a sequential number. >- * >- * @author BREDEX GmbH >- * @created May 13, 2009 >- */ >-public class ClassCountEditPartIdentifier implements IEditPartIdentifier { >- >- /** the EditPart for which identifiers can be generated */ >- private EditPart m_editPart; >- >- /** >- * Constructor >- * >- * @param editPart The EditPart for which identifiers can be generated. >- */ >- public ClassCountEditPartIdentifier(EditPart editPart) { >- m_editPart = editPart; >- } >- >- /** >- * {@inheritDoc} >- */ >- public String getIdentifier() { >- EditPart parent = m_editPart.getParent(); >- String className = m_editPart.getClass().getName(); >- String id = className; >- if (parent != null) { >- id += "_"; //$NON-NLS-1$ >- Iterator siblingIterator = parent.getChildren().iterator(); >- boolean isFound = false; >- int count = 0; >- while (siblingIterator.hasNext() && !isFound) { >- EditPart sibling = (EditPart)siblingIterator.next(); >- if (sibling == m_editPart) { >- isFound = true; >- } >- if (sibling.getClass().getName().equals(className)) { >- count++; >- } >- } >- id += count; >- } >- return id; >- } >- >- /** >- * {@inheritDoc} >- */ >- public Map getConnectionAnchors() { >- return new HashMap(); >- } >- >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/IEditPartIdentifier.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/IEditPartIdentifier.java >deleted file mode 100644 >index f19049d..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/IEditPartIdentifier.java >+++ /dev/null >@@ -1,39 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.identifier; >- >-import java.util.Map; >- >- >- >-/** >- * Encapsulates the ability to generate unique IDs for a given >- * {@link org.eclipse.gef.EditPart}. >- * >- * @author BREDEX GmbH >- * @created May 13, 2009 >- */ >-public interface IEditPartIdentifier { >- >- /** >- * >- * @return a String uniquely identifying the EditPart. >- */ >- public String getIdentifier(); >- >- /** >- * >- * @return a map that correlates identifiers (<code>String</code>s) with >- * <code>ConnectionAnchor</code>s. >- */ >- public Map getConnectionAnchors(); >- >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/StaticEditPartIdentifier.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/StaticEditPartIdentifier.java >deleted file mode 100644 >index 6aa8fea..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/identifier/StaticEditPartIdentifier.java >+++ /dev/null >@@ -1,53 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.identifier; >- >-import java.util.Collections; >-import java.util.Map; >- >- >-/** >- * Provides a static String as an identifier. This class does not take the >- * state of the {@link org.eclipse.gef.EditPart} into account, so it is useful >- * for stateless {@link org.eclipse.gef.EditPart}s (ex. containers). >- * >- * @author BREDEX GmbH >- * @created May 19, 2009 >- */ >-public class StaticEditPartIdentifier implements IEditPartIdentifier { >- >- /** the identifier that will always be returned */ >- private String m_id; >- >- /** >- * Constructor >- * >- * @param id The static identifier String that will always be returned. >- */ >- public StaticEditPartIdentifier(String id) { >- m_id = id; >- } >- >- /** >- * {@inheritDoc} >- */ >- public String getIdentifier() { >- return m_id; >- } >- >- /** >- * {@inheritDoc} >- */ >- public Map getConnectionAnchors() { >- return Collections.EMPTY_MAP; >- } >- >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/implclasses/FigureCanvasImplClass.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/implclasses/FigureCanvasImplClass.java >deleted file mode 100644 >index 03ac4d4..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/implclasses/FigureCanvasImplClass.java >+++ /dev/null >@@ -1,763 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.implclasses; >- >-import java.lang.reflect.InvocationTargetException; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >- >-import org.apache.commons.beanutils.PropertyUtils; >-import org.apache.commons.lang.Validate; >-import org.eclipse.draw2d.Connection; >-import org.eclipse.draw2d.ConnectionAnchor; >-import org.eclipse.draw2d.FigureCanvas; >-import org.eclipse.draw2d.IFigure; >-import org.eclipse.draw2d.geometry.Point; >-import org.eclipse.gef.ConnectionEditPart; >-import org.eclipse.gef.EditDomain; >-import org.eclipse.gef.EditPart; >-import org.eclipse.gef.GraphicalEditPart; >-import org.eclipse.gef.GraphicalViewer; >-import org.eclipse.gef.RootEditPart; >-import org.eclipse.gef.palette.PaletteEntry; >-import org.eclipse.gef.ui.palette.PaletteViewer; >-import org.eclipse.jubula.rc.common.driver.ClickOptions; >-import org.eclipse.jubula.rc.common.driver.IRobot; >-import org.eclipse.jubula.rc.common.driver.IRunnable; >-import org.eclipse.jubula.rc.common.exception.StepExecutionException; >-import org.eclipse.jubula.rc.common.implclasses.MatchUtil; >-import org.eclipse.jubula.rc.common.implclasses.Verifier; >-import org.eclipse.jubula.rc.rcp.accessor.Startup; >-import org.eclipse.jubula.rc.rcp.gef.factory.DefaultEditPartAdapterFactory; >-import org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier; >-import org.eclipse.jubula.rc.swt.driver.DragAndDropHelperSwt; >-import org.eclipse.jubula.rc.swt.implclasses.AbstractControlImplClass; >-import org.eclipse.jubula.rc.swt.implclasses.MenuUtil; >-import org.eclipse.jubula.tools.objects.event.EventFactory; >-import org.eclipse.jubula.tools.objects.event.TestErrorEvent; >-import org.eclipse.swt.graphics.Rectangle; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; >- >- >-/** >- * Implementation class for Figure Canvas (Eclipse GEF). >- * >- * @author BREDEX GmbH >- * @created May 13, 2009 >- */ >-public class FigureCanvasImplClass extends AbstractControlImplClass { >- >- /** >- * the viewer that contains the EditParts corresponding to the FigureCanvas >- */ >- private GraphicalViewer m_viewer = null; >- >- /** the composite in which the IFigures are displayed */ >- private Composite m_composite = null; >- >- /** >- * {@inheritDoc} >- */ >- public Control getComponent() { >- return m_composite; >- } >- >- /** >- * >- * @return the viewer associated with the canvas to test. >- */ >- private GraphicalViewer getViewer() { >- return m_viewer; >- } >- >- /** >- * >- * @return the control for the canvas to test. >- */ >- private Control getViewerControl() { >- return getViewer().getControl(); >- } >- >- /** >- * >- * @return the root edit part of the viewer. >- */ >- private RootEditPart getRootEditPart() { >- return getViewer().getRootEditPart(); >- } >- >- /** >- * >- * @return the root of the palette viewer (tool palette). >- */ >- private RootEditPart getPaletteRoot() { >- return getViewer().getEditDomain().getPaletteViewer().getRootEditPart(); >- } >- >- /** >- * >- * @param textPath The path to the tool. >- * @param operator The operator used for matching. >- * @return the EditPart found at the end of the given path. Returns >- * <code>null</code> if no EditPart can be found for the given path >- * or if the EditPart found is not a GraphicalEditPart. >- */ >- private GraphicalEditPart findPaletteEditPart( >- String textPath, String operator) { >- >- final String[] pathItems = MenuUtil.splitPath(textPath); >- boolean isExisting = true; >- >- EditPart currentEditPart = getPaletteRoot().getContents(); >- >- for (int i = 0; i < pathItems.length && currentEditPart != null; i++) { >- List effectiveChildren = currentEditPart.getChildren(); >- >- EditPart [] children = >- (EditPart [])effectiveChildren.toArray( >- new EditPart[effectiveChildren.size()]); >- boolean itemFound = false; >- for (int j = 0; j < children.length && !itemFound; j++) { >- Object model = children[j].getModel(); >- if (model instanceof PaletteEntry) { >- String entryLabel = ((PaletteEntry)model).getLabel(); >- if (entryLabel != null >- && MatchUtil.getInstance().match( >- entryLabel, pathItems[i], operator)) { >- itemFound = true; >- currentEditPart = children[j]; >- } >- } >- } >- if (!itemFound) { >- isExisting = false; >- break; >- } >- >- } >- >- return isExisting && currentEditPart instanceof GraphicalEditPart >- ? (GraphicalEditPart)currentEditPart : null; >- >- } >- >- /** >- * {@inheritDoc} >- */ >- public String[] getTextArrayFromComponent() { >- return null; >- } >- >- /** >- * {@inheritDoc} >- */ >- public void setComponent(final Object graphicsComponent) { >- getEventThreadQueuer().invokeAndWait(getClass().getName() + ".setComponent", new IRunnable() { //$NON-NLS-1$ >- >- public Object run() throws StepExecutionException { >- FigureCanvas figureCanvas = (FigureCanvas)graphicsComponent; >- Composite parent = figureCanvas; >- while (parent != null >- && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) >- instanceof GraphicalViewer)) { >- parent = parent.getParent(); >- } >- >- if (parent != null) { >- m_composite = parent; >- m_viewer = >- (GraphicalViewer)parent.getData( >- Startup.TEST_GEF_VIEWER_DATA_KEY); >- } >- return null; >- } >- >- }); >- } >- >- /** >- * Checks whether the figure for the EditPart for the given path exists and >- * is visible. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @param exists Whether the figure is expected to exist. >- */ >- public void gdCheckFigureExists( >- String textPath, String operator, boolean exists) { >- >- boolean isExisting = >- findFigure(findEditPart(textPath, operator)) != null; >- if (!isExisting) { >- // See if there's a connection anchor at the given path >- isExisting = findConnectionAnchor(textPath, operator) != null; >- } >- >- Verifier.equals(exists, isExisting); >- >- } >- >- /** >- * Checks the given property of the figure at the given path. >- * >- * @param textPath The path to the figure. >- * @param textPathOperator The operator used for matching the text path. >- * @param propertyName The name of the property >- * @param expectedPropValue The value of the property as a string >- * @param valueOperator The operator used to verify >- */ >- public void gdVerifyFigureProperty(String textPath, >- String textPathOperator, final String propertyName, >- String expectedPropValue, String valueOperator) { >- >- final IFigure figure = >- findFigure(findEditPart(textPath, textPathOperator)); >- if (figure == null) { >- throw new StepExecutionException( >- "No figure could be found for the given text path.", //$NON-NLS-1$ >- EventFactory.createActionError( >- TestErrorEvent.NOT_FOUND)); >- } >- Object prop = getEventThreadQueuer().invokeAndWait("getProperty", //$NON-NLS-1$ >- new IRunnable() { >- >- public Object run() throws StepExecutionException { >- try { >- return PropertyUtils.getProperty(figure, propertyName); >- } catch (IllegalAccessException e) { >- throw new StepExecutionException( >- e.getMessage(), >- EventFactory.createActionError( >- TestErrorEvent.PROPERTY_NOT_ACCESSABLE)); >- } catch (InvocationTargetException e) { >- throw new StepExecutionException( >- e.getMessage(), >- EventFactory.createActionError( >- TestErrorEvent.PROPERTY_NOT_ACCESSABLE)); >- } catch (NoSuchMethodException e) { >- throw new StepExecutionException( >- e.getMessage(), >- EventFactory.createActionError( >- TestErrorEvent.PROPERTY_NOT_ACCESSABLE)); >- } >- } >- >- }); >- final String propToStr = String.valueOf(prop); >- Verifier.match(propToStr, expectedPropValue, valueOperator); >- >- } >- >- /** >- * Checks whether the tool for the given path exists and >- * is visible. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @param exists Whether the figure is expected to exist. >- */ >- public void gdCheckToolExists( >- String textPath, String operator, boolean exists) { >- >- boolean isExisting = findPaletteFigure(textPath, operator) != null; >- >- Verifier.equals(exists, isExisting); >- >- } >- >- /** >- * Finds and clicks the figure for the given path. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @param count The number of times to click. >- * @param button The mouse button to use for the click. >- */ >- public void gdClickFigure(String textPath, String operator, >- int count, int button) { >- >- getRobot().click(getViewerControl(), >- getFigureBoundsChecked(textPath, operator), >- ClickOptions.create().setScrollToVisible(false) >- .setClickCount(count).setMouseButton(button)); >- } >- >- /** >- * Finds and clicks on a connection between a source figure and a >- * target figure. >- * >- * @param sourceTextPath The path to the source figure. >- * @param sourceOperator The operator to use for matching the source >- * figure path. >- * @param targetTextPath The path to the target figure. >- * @param targetOperator The operator to use for matching the target >- * figure path. >- * @param count The number of times to click. >- * @param button The mouse button to use for the click. >- */ >- public void gdClickConnection(String sourceTextPath, String sourceOperator, >- String targetTextPath, String targetOperator, >- int count, int button) { >- >- GraphicalEditPart sourceEditPart = >- findEditPart(sourceTextPath, sourceOperator); >- GraphicalEditPart targetEditPart = >- findEditPart(targetTextPath, targetOperator); >- >- ConnectionEditPart connectionEditPart = null; >- >- if (sourceEditPart != null) { >- List sourceConnectionList = sourceEditPart.getSourceConnections(); >- ConnectionEditPart [] sourceConnections = >- (ConnectionEditPart [])sourceConnectionList.toArray( >- new ConnectionEditPart[sourceConnectionList.size()]); >- for (int i = 0; i < sourceConnections.length >- && connectionEditPart == null; i++) { >- if (sourceConnections[i].getTarget() == targetEditPart) { >- connectionEditPart = sourceConnections[i]; >- } >- } >- } else if (targetEditPart != null) { >- List targetConnectionList = targetEditPart.getTargetConnections(); >- ConnectionEditPart [] targetConnections = >- (ConnectionEditPart [])targetConnectionList.toArray( >- new ConnectionEditPart[targetConnectionList.size()]); >- for (int i = 0; i < targetConnections.length >- && connectionEditPart == null; i++) { >- if (targetConnections[i].getSource() == targetEditPart) { >- connectionEditPart = targetConnections[i]; >- } >- } >- } else { >- throw new StepExecutionException( >- "No figures could be found for the given text paths.", //$NON-NLS-1$ >- EventFactory.createActionError(TestErrorEvent.NOT_FOUND)); >- } >- >- IFigure connectionFigure = findFigure(connectionEditPart); >- if (connectionFigure == null) { >- String missingEnd = sourceEditPart == null ? "source" : "target"; //$NON-NLS-1$ //$NON-NLS-2$ >- throw new StepExecutionException( >- "No connection could be found for the given " + missingEnd + " figure.", //$NON-NLS-1$ //$NON-NLS-2$ >- EventFactory.createActionError(TestErrorEvent.NOT_FOUND)); >- } >- >- // Scrolling >- revealEditPart(connectionEditPart); >- >- if (connectionFigure instanceof Connection) { >- Point midpoint = >- ((Connection)connectionFigure).getPoints().getMidpoint(); >- connectionFigure.translateToAbsolute(midpoint); >- getRobot().click(getViewerControl(), null, >- ClickOptions.create().setScrollToVisible(false) >- .setClickCount(count).setMouseButton(button), >- midpoint.x, true, midpoint.y, true); >- } else { >- getRobot().click(getViewerControl(), >- getBounds(connectionFigure), >- ClickOptions.create().setScrollToVisible(false) >- .setClickCount(count).setMouseButton(button)); >- } >- >- } >- >- /** >- * Clicks the specified position within the given figure. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @param count amount of clicks >- * @param button what button should be clicked >- * @param xPos what x position >- * @param xUnits should x position be pixel or percent values >- * @param yPos what y position >- * @param yUnits should y position be pixel or percent values >- * @throws StepExecutionException if step execution fails. >- */ >- public void gdClickInFigure(String textPath, String operator, >- int count, int button, int xPos, String xUnits, >- int yPos, String yUnits) throws StepExecutionException { >- >- getRobot().click(getViewerControl(), >- getFigureBoundsChecked(textPath, operator), >- ClickOptions.create().setScrollToVisible(false) >- .setClickCount(count).setMouseButton(button), >- xPos, xUnits.equalsIgnoreCase(POS_UNIT_PIXEL), >- yPos, yUnits.equalsIgnoreCase(POS_UNIT_PIXEL)); >- } >- >- /** >- * Simulates the beginning of a Drag. Moves to the specified position >- * within the given figure and stores information related to the drag to >- * be used later by a Drop operation. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @param mouseButton the mouse button. >- * @param modifier the modifier, e.g. shift, ctrl, etc. >- * @param xPos what x position >- * @param xUnits should x position be pixel or percent values >- * @param yPos what y position >- * @param yUnits should y position be pixel or percent values >- */ >- public void gdDragFigure(String textPath, String operator, >- int mouseButton, String modifier, int xPos, >- String xUnits, int yPos, String yUnits) { >- // Only store the Drag-Information. Otherwise the GUI-Eventqueue >- // blocks after performed Drag! >- final DragAndDropHelperSwt dndHelper = DragAndDropHelperSwt >- .getInstance(); >- dndHelper.setMouseButton(mouseButton); >- dndHelper.setModifier(modifier); >- dndHelper.setDragComponent(null); >- gdClickInFigure(textPath, operator, 0, mouseButton, >- xPos, xUnits, yPos, yUnits); >- } >- >- /** >- * Performs a Drop. Moves to the specified location within the given figure >- * and releases the modifier and mouse button pressed by the previous drag >- * operation. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @param xPos what x position >- * @param xUnits should x position be pixel or percent values >- * @param yPos what y position >- * @param yUnits should y position be pixel or percent values >- * @param delayBeforeDrop the amount of time (in milliseconds) to wait >- * between moving the mouse to the drop point and >- * releasing the mouse button >- */ >- public void gdDropOnFigure(final String textPath, final String operator, >- final int xPos, final String xUnits, final int yPos, >- final String yUnits, int delayBeforeDrop) { >- >- final DragAndDropHelperSwt dndHelper = >- DragAndDropHelperSwt.getInstance(); >- final IRobot robot = getRobot(); >- final String modifier = dndHelper.getModifier(); >- final int mouseButton = dndHelper.getMouseButton(); >- // Note: This method performs the drag AND drop action in one runnable >- // in the GUI-Eventqueue because after the mousePress, the eventqueue >- // blocks! >- try { >- pressOrReleaseModifiers(modifier, true); >- >- getEventThreadQueuer().invokeAndWait("gdStartDragFigure", new IRunnable() { //$NON-NLS-1$ >- public Object run() throws StepExecutionException { >- // drag >- robot.mousePress(dndHelper.getDragComponent(), null, >- mouseButton); >- >- shakeMouse(); >- >- // drop >- gdClickInFigure(textPath, operator, 0, >- mouseButton, xPos, xUnits, yPos, yUnits); >- >- return null; >- } >- }); >- >- waitBeforeDrop(delayBeforeDrop); >- } finally { >- getRobot().mouseRelease(null, null, mouseButton); >- pressOrReleaseModifiers(modifier, false); >- } >- } >- >- /** >- * Returns the bounds for the figure for the given path. If no such >- * figure can be found, a {@link StepExecutionException} will be thrown. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @return the bounds of the figure for the given path. >- */ >- private Rectangle getFigureBoundsChecked(String textPath, String operator) { >- GraphicalEditPart editPart = >- findEditPart(textPath, operator); >- IFigure figure = findFigure(editPart); >- ConnectionAnchor anchor = null; >- >- if (figure == null) { >- // Try to find a connection anchor instead >- anchor = findConnectionAnchor(textPath, operator); >- if (anchor != null) { >- final String[] pathItems = MenuUtil.splitPath(textPath); >- final String[] editPartPathItems = >- new String[pathItems.length - 1]; >- System.arraycopy( >- pathItems, 0, editPartPathItems, 0, >- editPartPathItems.length); >- editPart = findEditPart(operator, editPartPathItems); >- } >- if (anchor == null || findFigure(editPart) == null) { >- throw new StepExecutionException( >- "No figure could be found for the given text path.", //$NON-NLS-1$ >- EventFactory.createActionError( >- TestErrorEvent.NOT_FOUND)); >- } >- >- } >- >- // Scrolling >- revealEditPart(editPart); >- >- return figure != null ? getBounds(figure) : getBounds(anchor); >- } >- >- /** >- * Clicks the tool found at the given path. >- * >- * @param textPath The path to the tool. >- * @param operator The operator used for matching. >- * @param count The number of times to click. >- */ >- public void gdSelectTool(String textPath, String operator, int count) { >- Control paletteControl = getPaletteControl(); >- IFigure figure = >- findPaletteFigureChecked(textPath, operator); >- getRobot().click(paletteControl, getBounds(figure), >- ClickOptions.create().setScrollToVisible(false) >- .setClickCount(count)); >- } >- >- /** >- * @return the control associated with the palette viewer. >- */ >- private Control getPaletteControl() { >- EditDomain editDomain = getViewer().getEditDomain(); >- if (editDomain == null) { >- return null; >- } >- >- PaletteViewer paletteViewer = editDomain.getPaletteViewer(); >- if (paletteViewer == null) { >- return null; >- } >- >- return paletteViewer.getControl(); >- } >- >- /** >- * >- * @param figure The figure for which to find the bounds. >- * @return the bounds of the given figure. >- */ >- private Rectangle getBounds(IFigure figure) { >- org.eclipse.draw2d.geometry.Rectangle figureBounds = >- new org.eclipse.draw2d.geometry.Rectangle(figure.getBounds()); >- >- // Take scrolling and zooming into account >- figure.translateToAbsolute(figureBounds); >- >- return new Rectangle( >- figureBounds.x, figureBounds.y, >- figureBounds.width, figureBounds.height); >- } >- >- /** >- * >- * @param anchor The anchor for which to find the bounds. >- * @return the "bounds" of the given anchor. Since the location of an >- * anchor is defined as a single point, the bounds are a small >- * rectangle with that point at the center. >- */ >- private Rectangle getBounds(ConnectionAnchor anchor) { >- Validate.notNull(anchor); >- Point refPoint = anchor.getReferencePoint(); >- >- return new Rectangle( >- refPoint.x - 1, refPoint.y - 1, 3, 3); >- } >- >- /** >- * >- * @param textPath The path to the GraphicalEditPart. >- * @param operator The operator used for matching. >- * @return the GraphicalEditPart for the given path. Returns >- * <code>null</code> if no EditPart exists for the given path or if >- * the found EditPart is not a GraphicalEditPart. >- */ >- private GraphicalEditPart findEditPart(String textPath, String operator) { >- final String[] pathItems = MenuUtil.splitPath(textPath); >- return findEditPart(operator, pathItems); >- } >- >- /** >- * @param operator The operator used for matching. >- * @param pathItems The path to the GraphicalEditPart. Each element in the >- * array represents a single segment of the path. >- * @return the GraphicalEditPart for the given path. Returns >- * <code>null</code> if no EditPart exists for the given path or if >- * the found EditPart is not a GraphicalEditPart. >- */ >- private GraphicalEditPart findEditPart(String operator, >- final String[] pathItems) { >- boolean isExisting = true; >- EditPart currentEditPart = getRootEditPart().getContents(); >- >- for (int i = 0; i < pathItems.length && currentEditPart != null; i++) { >- List effectiveChildren = currentEditPart.getChildren(); >- EditPart [] children = >- (EditPart [])effectiveChildren.toArray( >- new EditPart[effectiveChildren.size()]); >- boolean itemFound = false; >- for (int j = 0; j < children.length && !itemFound; j++) { >- IEditPartIdentifier childFigureIdentifier = >- DefaultEditPartAdapterFactory.loadFigureIdentifier( >- children[j]); >- if (childFigureIdentifier != null) { >- String figureId = childFigureIdentifier.getIdentifier(); >- if (figureId != null >- && MatchUtil.getInstance().match( >- figureId, pathItems[i], operator)) { >- itemFound = true; >- currentEditPart = children[j]; >- } >- } >- } >- if (!itemFound) { >- isExisting = false; >- break; >- } >- >- } >- >- return isExisting && currentEditPart instanceof GraphicalEditPart >- ? (GraphicalEditPart)currentEditPart : null; >- } >- >- /** >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @return the figure for the GraphicalEditPart for the given path within >- * the palette. Returns <code>null</code> if no EditPart exists >- * for the given path or if the found EditPart does not have a >- * figure. >- */ >- private IFigure findPaletteFigure(String textPath, String operator) { >- GraphicalEditPart editPart = findPaletteEditPart(textPath, operator); >- >- // Scrolling >- revealEditPart(editPart); >- >- return findFigure(editPart); >- } >- >- /** >- * Finds and returns the palette figure for the given path. If no such >- * figure can be found, a {@link StepExecutionException} will be thrown. >- * >- * @param textPath The path to the figure. >- * @param operator The operator used for matching. >- * @return the figure for the GraphicalEditPart for the given path within >- * the palette. >- */ >- private IFigure findPaletteFigureChecked(String textPath, String operator) { >- IFigure figure = findPaletteFigure(textPath, operator); >- if (figure == null) { >- throw new StepExecutionException( >- "No palette figure could be found for the given text path.", //$NON-NLS-1$ >- EventFactory.createActionError(TestErrorEvent.NOT_FOUND)); >- } >- return figure; >- >- } >- >- /** >- * >- * @param editPart The EditPart for which to find the corresponding figure. >- * @return the (visible) figure corresponding to the given EditPart, or >- * <code>null</code> if no visible figure corresponds to the given >- * EditPart. >- */ >- private IFigure findFigure(GraphicalEditPart editPart) { >- if (editPart != null) { >- IFigure figure = editPart.getFigure(); >- if (figure.isShowing()) { >- return figure; >- } >- } >- >- return null; >- } >- >- /** >- * Attempts to find a connection anchor at the given textpath. >- * >- * @param textPath The path to the anchor. >- * @param operator The operator used for matching. >- * @return the anchor found at the given text path, or <code>null</code> >- * if no such anchor exists. >- */ >- private ConnectionAnchor findConnectionAnchor( >- String textPath, String operator) { >- >- final String[] pathItems = MenuUtil.splitPath(textPath); >- final String[] editPartPathItems = new String[pathItems.length - 1]; >- System.arraycopy( >- pathItems, 0, editPartPathItems, 0, editPartPathItems.length); >- GraphicalEditPart editPart = findEditPart(operator, editPartPathItems); >- if (editPart != null) { >- String anchorPathItem = pathItems[pathItems.length - 1]; >- IEditPartIdentifier editPartIdentifier = >- DefaultEditPartAdapterFactory.loadFigureIdentifier(editPart); >- if (editPartIdentifier != null) { >- Map anchorMap = >- editPartIdentifier.getConnectionAnchors(); >- if (anchorMap != null) { >- Iterator anchorMapIter = >- anchorMap.keySet().iterator(); >- while (anchorMapIter.hasNext()) { >- Object anchorMapKey = anchorMapIter.next(); >- Object anchorMapValue = >- anchorMap.get(anchorMapKey); >- if (anchorMapKey instanceof String >- && anchorMapValue instanceof ConnectionAnchor >- && MatchUtil.getInstance().match( >- (String)anchorMapKey, anchorPathItem, >- operator)) { >- >- return (ConnectionAnchor)anchorMapValue; >- } >- } >- } >- } >- } >- >- return null; >- } >- >- /** >- * Reveals the given {@link EditPart} within its viewer. >- * >- * @param editPart the {@link EditPart} to reveal. >- */ >- private void revealEditPart(final EditPart editPart) { >- if (editPart != null) { >- getEventThreadQueuer().invokeAndWait(getClass().getName() + ".revealEditPart", new IRunnable() { //$NON-NLS-1$ >- >- public Object run() throws StepExecutionException { >- editPart.getViewer().reveal(editPart); >- return null; >- } >- >- }); >- } >- } >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/FigureHighlighter.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/FigureHighlighter.java >deleted file mode 100644 >index 25cff10..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/FigureHighlighter.java >+++ /dev/null >@@ -1,196 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.inspector; >- >-import java.util.Iterator; >-import java.util.Map; >- >-import org.eclipse.draw2d.ConnectionAnchor; >-import org.eclipse.draw2d.IFigure; >-import org.eclipse.draw2d.geometry.Point; >-import org.eclipse.gef.ConnectionEditPart; >-import org.eclipse.gef.EditPart; >-import org.eclipse.gef.GraphicalEditPart; >-import org.eclipse.gef.GraphicalViewer; >-import org.eclipse.jubula.rc.rcp.gef.factory.DefaultEditPartAdapterFactory; >-import org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier; >-import org.eclipse.jubula.rc.rcp.gef.util.FigureCanvasUtil; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.events.MouseEvent; >-import org.eclipse.swt.events.MouseMoveListener; >-import org.eclipse.swt.events.PaintEvent; >-import org.eclipse.swt.events.PaintListener; >-import org.eclipse.swt.graphics.Color; >-import org.eclipse.swt.graphics.Rectangle; >-import org.eclipse.swt.widgets.Control; >- >- >-/** >- * Highlights figures as the mouse moves over them. >- * >- * @author BREDEX GmbH >- * @created Jun 26, 2009 >- */ >-public class FigureHighlighter implements MouseMoveListener { >- >- /** the viewer containing figures that can be highlighted */ >- private GraphicalViewer m_viewer; >- >- /** the color to use for highlighting */ >- private Color m_highlightColor; >- >- /** transparency for highlighting */ >- private int m_highlightAlpha; >- >- /** the current highlighted bounds */ >- private Rectangle m_currentBounds; >- >- /** the pain listener that performs the actual highlighting */ >- private PaintListener m_paintListener; >- >- /** >- * Constructor >- * >- * @param viewer The viewer containing figures to highlight. >- */ >- public FigureHighlighter(GraphicalViewer viewer) { >- m_viewer = viewer; >- m_highlightColor = >- viewer.getControl().getDisplay().getSystemColor(SWT.COLOR_BLUE); >- m_highlightAlpha = 100; >- m_currentBounds = null; >- m_paintListener = new PaintListener() { >- >- public void paintControl(PaintEvent e) { >- if (m_currentBounds != null) { >- Color bgColor = e.gc.getBackground(); >- int alpha = e.gc.getAlpha(); >- e.gc.setAlpha(m_highlightAlpha); >- e.gc.setBackground(m_highlightColor); >- e.gc.fillRectangle(m_currentBounds); >- e.gc.setAlpha(alpha); >- e.gc.setBackground(bgColor); >- } >- } >- >- }; >- viewer.getControl().addPaintListener(m_paintListener); >- } >- >- /** >- * {@inheritDoc} >- */ >- public void mouseMove(MouseEvent e) { >- Point cursorLocation = >- new Point(e.x, e.y); >- EditPart editPart = >- FigureCanvasUtil.findAtCurrentMousePosition(e.display, m_viewer); >- if (editPart == m_viewer.getContents().getRoot() >- || editPart == null) { >- if (m_currentBounds != null) { >- m_currentBounds = null; >- m_viewer.getControl().redraw(); >- } >- >- return; >- } >- >- // Check for connection anchor >- Rectangle anchorBounds = >- getConnectionAnchorBounds( >- DefaultEditPartAdapterFactory.loadFigureIdentifier( >- editPart), cursorLocation); >- >- if (anchorBounds == null >- && editPart instanceof ConnectionEditPart) { >- >- ConnectionEditPart connEditPart = >- (ConnectionEditPart)editPart; >- EditPart srcEditPart = connEditPart.getSource(); >- EditPart targetEditPart = connEditPart.getTarget(); >- anchorBounds = getConnectionAnchorBounds( >- DefaultEditPartAdapterFactory.loadFigureIdentifier(srcEditPart), >- cursorLocation); >- if (anchorBounds == null) { >- anchorBounds = getConnectionAnchorBounds( >- DefaultEditPartAdapterFactory >- .loadFigureIdentifier(targetEditPart), >- cursorLocation); >- } >- } >- >- Rectangle bounds = anchorBounds; >- if (bounds == null >- && editPart != m_viewer.getContents().getRoot() >- && !(editPart instanceof ConnectionEditPart) >- && editPart instanceof GraphicalEditPart) { >- IFigure figure = ((GraphicalEditPart)editPart).getFigure(); >- org.eclipse.draw2d.geometry.Rectangle figureBounds = >- new org.eclipse.draw2d.geometry.Rectangle(figure.getBounds()); >- figure.translateToAbsolute(figureBounds); >- bounds = new Rectangle(figureBounds.x, figureBounds.y, >- figureBounds.width, figureBounds.height); >- } >- m_currentBounds = bounds; >- m_viewer.getControl().redraw(); >- >- } >- >- /** >- * >- * @param editPartIdentifier Provides a list of possible anchors. >- * @param cursorLocation The location at which to look for the anchor. >- * @return the bounds for the connection anchor at the given location, or >- * <code>null</code> if no such anchor can be found. >- */ >- private Rectangle getConnectionAnchorBounds( >- IEditPartIdentifier editPartIdentifier, Point cursorLocation) { >- >- if (editPartIdentifier != null) { >- Map anchorMap = >- editPartIdentifier.getConnectionAnchors(); >- if (anchorMap != null) { >- Iterator iter = anchorMap.keySet().iterator(); >- while (iter.hasNext()) { >- Object key = iter.next(); >- Object value = anchorMap.get(key); >- if (key instanceof String >- && value instanceof ConnectionAnchor) { >- Point refPoint = >- ((ConnectionAnchor)value).getReferencePoint(); >- >- // The "bounds" of an anchor is considered to be >- // 3 pixels in all directions. >- Rectangle refBounds = new Rectangle( >- refPoint.x - 3, refPoint.y - 3, 7, 7); >- if (refBounds.contains(cursorLocation.getSWTPoint())) { >- return refBounds; >- } >- } >- } >- } >- } >- >- return null; >- } >- >- /** >- * Removes all listeners added by this highlighter. >- */ >- public void removeAddedListeners() { >- Control control = m_viewer.getControl(); >- if (!control.isDisposed()) { >- control.removePaintListener(m_paintListener); >- control.redraw(); >- } >- } >- >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/GefInspectorListenerAppender.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/GefInspectorListenerAppender.java >deleted file mode 100644 >index d5eb443..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/inspector/GefInspectorListenerAppender.java >+++ /dev/null >@@ -1,440 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.inspector; >- >-import java.util.ArrayList; >-import java.util.Collections; >-import java.util.HashMap; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >- >-import org.eclipse.draw2d.ConnectionAnchor; >-import org.eclipse.draw2d.FigureCanvas; >-import org.eclipse.draw2d.geometry.Point; >-import org.eclipse.draw2d.geometry.Rectangle; >-import org.eclipse.gef.ConnectionEditPart; >-import org.eclipse.gef.EditDomain; >-import org.eclipse.gef.EditPart; >-import org.eclipse.gef.EditPartViewer; >-import org.eclipse.gef.GraphicalEditPart; >-import org.eclipse.gef.GraphicalViewer; >-import org.eclipse.gef.RootEditPart; >-import org.eclipse.gef.palette.PaletteEntry; >-import org.eclipse.gef.ui.palette.PaletteViewer; >-import org.eclipse.jubula.communication.message.InspectorComponentSelectedMessage; >-import org.eclipse.jubula.rc.common.AUTServer; >-import org.eclipse.jubula.rc.common.listener.IAutListenerAppender; >-import org.eclipse.jubula.rc.common.logger.AutServerLogger; >-import org.eclipse.jubula.rc.rcp.accessor.Startup; >-import org.eclipse.jubula.rc.rcp.gef.factory.DefaultEditPartAdapterFactory; >-import org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier; >-import org.eclipse.jubula.rc.rcp.gef.util.FigureCanvasUtil; >-import org.eclipse.jubula.tools.exception.CommunicationException; >-import org.eclipse.jubula.tools.objects.ComponentIdentifier; >-import org.eclipse.jubula.tools.objects.IComponentIdentifier; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.Display; >-import org.eclipse.swt.widgets.Event; >-import org.eclipse.swt.widgets.Listener; >-import org.eclipse.swt.widgets.Widget; >-import org.eclipse.ui.PlatformUI; >- >- >-/** >- * Adds listeners for the Inspector function. These listeners will only >- * interact with GEF components. >- * >- * @author BREDEX GmbH >- * @created Jun 11, 2009 >- */ >-public class GefInspectorListenerAppender implements IAutListenerAppender { >- >- /** the logger */ >- private static final AutServerLogger LOG = >- new AutServerLogger(GefInspectorListenerAppender.class); >- >- /** >- * Responsible for adding highlighters to controls and managing those >- * highlighters. >- * >- * @author BREDEX GmbH >- * @created Jun 29, 2009 >- */ >- private static class FigureHighlightAppender implements Listener { >- >- /** mapping from control to figure highlighter */ >- private Map m_canvasToListener = new HashMap(); >- >- /** >- * {@inheritDoc} >- */ >- public void handleEvent(Event event) { >- if (event.widget instanceof FigureCanvas) { >- FigureCanvas canvas = (FigureCanvas)event.widget; >- if (event.type == SWT.MouseEnter) { >- handleMouseEnter(canvas); >- } >- } >- } >- >- /** >- * Removes all listeners added by this appender. >- */ >- public void removeAddedListeners() { >- Iterator iter = m_canvasToListener.keySet().iterator(); >- while (iter.hasNext()) { >- Control control = (Control)iter.next(); >- if (!control.isDisposed()) { >- FigureHighlighter highlighter = >- (FigureHighlighter)m_canvasToListener.get(control); >- highlighter.removeAddedListeners(); >- control.removeMouseMoveListener(highlighter); >- } >- } >- m_canvasToListener.clear(); >- } >- >- /** >- * Adds a figure highlighter to the given canvas. >- * >- * @param canvas The figure canvas entered by the mouse. >- */ >- private void handleMouseEnter(final FigureCanvas canvas) { >- if (m_canvasToListener.containsKey(canvas)) { >- // Highlighter already registered. >- return; >- } >- >- GraphicalViewer viewer = FigureCanvasUtil.getViewer(canvas); >- if (viewer != null) { >- if (viewer.getContents() instanceof GraphicalEditPart) { >- FigureHighlighter highlighter = >- new FigureHighlighter(viewer); >- m_canvasToListener.put(canvas, highlighter); >- canvas.addMouseMoveListener(highlighter); >- } >- } >- } >- >- } >- >- /** >- * Listens for a mouse click and: >- * 1. deregisters itself and any other provider listeners, and >- * 2. sends a "component selected" message >- * >- * if that mouse click was over a GEF component. >- * >- * @author BREDEX GmbH >- * @created Jun 11, 2009 >- */ >- private static class GefInspectorComponentSelectedListener >- implements Listener { >- >- /** the appender */ >- private FigureHighlightAppender m_highlightAppender; >- >- /** >- * Constructor >- * >- * @param highlightAppender The appender to use. >- */ >- public GefInspectorComponentSelectedListener( >- FigureHighlightAppender highlightAppender) { >- m_highlightAppender = highlightAppender; >- } >- >- /** >- * >- * @param editPartIdentifier Provides connection anchor IDs and >- * locations. >- * @param cursorLocation The location at which to search for an >- * anchor point. >- * @return the ID of the connection anchor at the given location, or >- * <code>null</code> if there is no connection anchor at the >- * given location. >- */ >- private String getConnectionAnchorId( >- IEditPartIdentifier editPartIdentifier, Point cursorLocation) { >- >- if (editPartIdentifier != null) { >- Map anchorMap = >- editPartIdentifier.getConnectionAnchors(); >- if (anchorMap != null) { >- Iterator iter = anchorMap.keySet().iterator(); >- while (iter.hasNext()) { >- Object key = iter.next(); >- Object value = anchorMap.get(key); >- if (key instanceof String >- && value instanceof ConnectionAnchor) { >- Point refPoint = >- ((ConnectionAnchor)value).getReferencePoint(); >- >- // A click is recognized as being "within the >- // bounds" of an anchor if it is within 3 pixels >- // in any direction. >- Rectangle refBounds = new Rectangle( >- refPoint.x - 3, refPoint.y - 3, 7, 7); >- if (refBounds.contains(cursorLocation)) { >- return (String)key; >- } >- } >- } >- } >- } >- >- return null; >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void handleEvent(Event event) { >- Display display = event.display; >- display.removeFilter(SWT.MouseDown, this); >- display.removeFilter(SWT.MouseEnter, m_highlightAppender); >- m_highlightAppender.removeAddedListeners(); >- event.doit = false; >- event.type = SWT.None; >- Widget selectedWidget = event.widget; >- IComponentIdentifier compId = null; >- >- if (!(selectedWidget instanceof FigureCanvas)) { >- sendIdInfo(compId); >- return; >- } >- >- FigureCanvas figureCanvas = >- (FigureCanvas)selectedWidget; >- Composite parent = figureCanvas; >- while (parent != null >- && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) >- instanceof GraphicalViewer)) { >- parent = parent.getParent(); >- } >- >- if (parent == null) { >- sendIdInfo(compId); >- return; >- } >- >- Object gefData = >- parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY); >- >- if (gefData instanceof EditPartViewer) { >- EditPartViewer viewer = (EditPartViewer)gefData; >- Point cursorLocation = new Point(display.map(null, >- viewer.getControl(), >- display.getCursorLocation())); >- EditPart editPart = viewer.findObjectAt(cursorLocation); >- EditPart primaryEditPart = FigureCanvasUtil.getPrimaryEditPart( >- editPart, viewer.getRootEditPart()); >- List idStringList = Collections.EMPTY_LIST; >- >- if (primaryEditPart != null) { >- idStringList = getPathToRoot(viewer.getRootEditPart(), >- cursorLocation, primaryEditPart); >- >- } else { >- // No primary figure found. >- // Check whether a tool was selected. >- EditDomain editDomain = viewer.getEditDomain(); >- if (editDomain != null) { >- PaletteViewer paletteViewer = >- editDomain.getPaletteViewer(); >- if (paletteViewer != null) { >- EditPart paletteEditPart = >- paletteViewer.findObjectAt(new Point( >- display.map(viewer.getControl(), >- paletteViewer.getControl(), >- cursorLocation.getSWTPoint()))); >- if (paletteEditPart != null) { >- idStringList = getToolPathToRoot( >- paletteViewer.getRootEditPart(), >- paletteEditPart); >- } >- } >- } >- } >- >- compId = createCompId(idStringList); >- } >- sendIdInfo(compId); >- } >- >- /** >- * >- * @param editPart The edit part for which to find the path. >- * @param root The root for <code>editPart</code>. This is used to >- * avoid adding the root identifier to the returned list. >- * @param cursorLocation The location to check for nearby connection >- * anchors. >- * @return a list containing the identifier of each edit part between >- * <code>editPart</code> and its root. The first element in the >- * list will be the identifier for a connection anchor if >- * <code>cursorLocation</code> is near such an anchor. >- */ >- private List getPathToRoot(RootEditPart root, Point cursorLocation, >- EditPart editPart) { >- >- List idStringList = new ArrayList(); >- EditPart currentEditPart = editPart; >- >- // Check for connection anchor >- String connectionId = >- getConnectionAnchorId( >- DefaultEditPartAdapterFactory.loadFigureIdentifier( >- currentEditPart), >- cursorLocation); >- >- if (connectionId == null >- && currentEditPart instanceof ConnectionEditPart) { >- >- ConnectionEditPart connEditPart = >- (ConnectionEditPart)editPart; >- EditPart srcEditPart = connEditPart.getSource(); >- EditPart targetEditPart = connEditPart.getTarget(); >- connectionId = getConnectionAnchorId( >- DefaultEditPartAdapterFactory >- .loadFigureIdentifier(srcEditPart), >- cursorLocation); >- if (connectionId != null) { >- currentEditPart = srcEditPart; >- } else { >- connectionId = getConnectionAnchorId( >- DefaultEditPartAdapterFactory >- .loadFigureIdentifier(targetEditPart), >- cursorLocation); >- if (connectionId != null) { >- currentEditPart = targetEditPart; >- } >- } >- } >- >- if (connectionId != null) { >- idStringList.add(connectionId); >- } >- >- while (currentEditPart != root.getContents() >- && currentEditPart != null) { >- IEditPartIdentifier identifier = >- DefaultEditPartAdapterFactory.loadFigureIdentifier( >- currentEditPart); >- if (identifier != null) { >- idStringList.add(identifier.getIdentifier()); >- } >- currentEditPart = currentEditPart.getParent(); >- } >- >- return idStringList; >- >- } >- >- /** >- * >- * @param editPart The edit part for which to find the path. >- * @param root The root for <code>editPart</code>. This is used to >- * avoid adding the root identifier to the returned list. >- * @return a list containing the identifier of each edit part between >- * <code>editPart</code> and its root. >- */ >- private List getToolPathToRoot(RootEditPart root, EditPart editPart) { >- >- List idStringList = new ArrayList(); >- EditPart currentEditPart = editPart; >- >- if (currentEditPart != null) { >- Object model = currentEditPart.getModel(); >- while (model instanceof PaletteEntry >- && currentEditPart != root.getContents()) { >- idStringList.add(((PaletteEntry)model).getLabel()); >- currentEditPart = >- currentEditPart.getParent(); >- model = currentEditPart.getModel(); >- } >- } >- >- return idStringList; >- } >- >- /** >- * Sends the given ID information to the client. >- * >- * @param compId The component identifier to send. May be >- * <code>null</code>. >- */ >- private void sendIdInfo(IComponentIdentifier compId) { >- InspectorComponentSelectedMessage message = >- new InspectorComponentSelectedMessage(); >- message.setComponentIdentifier(compId); >- try { >- AUTServer.getInstance().getCommunicator().send(message); >- } catch (CommunicationException e) { >- LOG.error("Error occurred while trying to send message to Client.", e); //$NON-NLS-1$ >- } >- } >- >- /** >- * >- * @param idStringList The path to root for a specific edit part or >- * connection anchor. >- * @return a component identifier for the given path, or >- * <code>null</code> if no valid component identifier can be >- * generated. >- */ >- private IComponentIdentifier createCompId(List idStringList) { >- IComponentIdentifier compId = null; >- if (!idStringList.isEmpty()) { >- Collections.reverse(idStringList); >- compId = new ComponentIdentifier(); >- compId.setHierarchyNames(idStringList); >- } >- >- return compId; >- } >- } >- >- /** the listener responsible for appending highlight listeners */ >- private FigureHighlightAppender m_highlightAppender; >- >- /** the listener responsible for handling mouse clicks */ >- private GefInspectorComponentSelectedListener m_componentSelectedListener; >- >- /** >- * Constructor >- */ >- public GefInspectorListenerAppender() { >- m_highlightAppender = new FigureHighlightAppender(); >- m_componentSelectedListener = >- new GefInspectorComponentSelectedListener(m_highlightAppender); >- } >- >- /** >- * {@inheritDoc} >- */ >- public void addAutListener() { >- final Display display = PlatformUI.getWorkbench().getDisplay(); >- >- display.syncExec(new Runnable() { >- >- public void run() { >- display.addFilter(SWT.MouseEnter, m_highlightAppender); >- display.addFilter(SWT.MouseDown, m_componentSelectedListener); >- } >- >- }); >- } >- >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/listener/GefPartListener.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/listener/GefPartListener.java >deleted file mode 100644 >index 91de9b8..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/listener/GefPartListener.java >+++ /dev/null >@@ -1,141 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.listener; >- >-import org.eclipse.gef.GraphicalViewer; >-import org.eclipse.jface.viewers.ISelectionChangedListener; >-import org.eclipse.jface.viewers.SelectionChangedEvent; >-import org.eclipse.jubula.rc.rcp.accessor.Startup; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.ui.IPartListener2; >-import org.eclipse.ui.IWorkbenchPart; >-import org.eclipse.ui.IWorkbenchPartReference; >-import org.eclipse.ui.internal.WorkbenchPartReference; >-import org.eclipse.ui.part.MultiPageEditorPart; >- >- >-/** >- * @author BREDEX GmbH >- * @created Dec 17, 2009 >- */ >-public class GefPartListener implements IPartListener2 { >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partActivated(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partBroughtToTop(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partClosed(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partDeactivated(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partHidden(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partInputChanged(IWorkbenchPartReference partRef) { >- // Do nothing >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partOpened(final IWorkbenchPartReference partRef) { >- IWorkbenchPart part = partRef.getPart(false); >- >- if (part instanceof MultiPageEditorPart) { >- ((MultiPageEditorPart)part).getSite().getSelectionProvider() >- .addSelectionChangedListener(new ISelectionChangedListener() { >- >- public void selectionChanged(SelectionChangedEvent event) { >- if (event.getSource() instanceof GraphicalViewer) { >- registerGraphicalViewer( >- (GraphicalViewer)event.getSource(), partRef); >- } >- } >- }); >- } >- >- if (part != null >- && partRef instanceof WorkbenchPartReference) { >- GraphicalViewer viewer = >- (GraphicalViewer)part.getAdapter( >- GraphicalViewer.class); >- registerGraphicalViewer(viewer, partRef); >- } >- } >- >- /** >- * >- * {@inheritDoc} >- */ >- public void partVisible(IWorkbenchPartReference partRef) { >- partOpened(partRef); >- } >- >- /** >- * Registers a {@link GraphicalViewer} with the given >- * {@link IWorkbenchPartReference}. >- * >- * @param viewer The viewer to register. >- * @param partRef The reference to the part that (indirectly) contains the >- * viewer. >- */ >- private void registerGraphicalViewer(GraphicalViewer viewer, >- IWorkbenchPartReference partRef) { >- >- IWorkbenchPart part = partRef.getPart(false); >- if (part != null && partRef instanceof WorkbenchPartReference) { >- if (viewer != null) { >- // Note the viewer on the component >- Control partContent = >- ((WorkbenchPartReference)partRef).getPane().getControl(); >- >- if (partContent != null && !partContent.isDisposed()) { >- partContent.setData(Startup.TEST_GEF_VIEWER_DATA_KEY, >- viewer); >- } >- } >- } >- } >-} >diff --git a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/util/FigureCanvasUtil.java b/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/util/FigureCanvasUtil.java >deleted file mode 100644 >index 021395e..0000000 >--- a/org.eclipse.jubula.rc.rcp/src/org/eclipse/jubula/rc/rcp/gef/util/FigureCanvasUtil.java >+++ /dev/null >@@ -1,114 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2010 BREDEX GmbH. >- * 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 >- * >- * Contributors: >- * BREDEX GmbH - initial API and implementation and/or initial documentation >- *******************************************************************************/ >-package org.eclipse.jubula.rc.rcp.gef.util; >- >-import org.eclipse.draw2d.FigureCanvas; >-import org.eclipse.draw2d.geometry.Point; >-import org.eclipse.gef.EditPart; >-import org.eclipse.gef.EditPartViewer; >-import org.eclipse.gef.GraphicalViewer; >-import org.eclipse.gef.RootEditPart; >-import org.eclipse.jubula.rc.rcp.accessor.Startup; >-import org.eclipse.jubula.rc.rcp.gef.factory.DefaultEditPartAdapterFactory; >-import org.eclipse.jubula.rc.rcp.gef.identifier.IEditPartIdentifier; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Display; >- >- >-/** >- * Utility class for interacting with a FigureCanvas. >- * >- * @author BREDEX GmbH >- * @created Jun 26, 2009 >- */ >-public class FigureCanvasUtil { >- >- /** >- * Private constructor >- */ >- private FigureCanvasUtil() { >- // Nothing to initialize >- } >- >- /** >- * >- * @param figureCanvas >- * The canvas for which to find the viewer. >- * @return the graphical viewer associated with the given canvas, or >- * <code>null</code> if no such viewer could be found. >- */ >- public static GraphicalViewer getViewer(FigureCanvas figureCanvas) { >- Composite parent = figureCanvas; >- while (parent != null >- && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) >- instanceof GraphicalViewer)) { >- parent = parent.getParent(); >- } >- >- if (parent != null) { >- >- return (GraphicalViewer)parent >- .getData(Startup.TEST_GEF_VIEWER_DATA_KEY); >- } >- >- return null; >- } >- >- /** >- * >- * @param display The display containing the edit part to find. >- * @param viewer The viewer containing the edit part to find. >- * @return the edit part for the viewer at the current mouse pointer >- * coordinates, or <code>null</code> if no such edit part can be >- * found. >- */ >- public static EditPart findAtCurrentMousePosition( >- Display display, EditPartViewer viewer) { >- Point cursorLocation = new Point(display.map(null, viewer.getControl(), >- display.getCursorLocation())); >- EditPart editPart = viewer.findObjectAt(cursorLocation); >- EditPart primaryEditPart = getPrimaryEditPart(editPart, viewer >- .getRootEditPart()); >- >- return primaryEditPart; >- } >- >- /** >- * Searches the path to root for the first element considered to be testable >- * by Jubula. Testable in this case means that an ID can be acquired for >- * the edit part. >- * >- * @param editPart >- * The starting edit part. >- * @param root >- * The root for <code>editPart</code>. This is used to avoid >- * identifying the root edit part as the primary edit part. >- * @return the first edit part on the path to root that has an ID. >- */ >- public static EditPart getPrimaryEditPart(final EditPart editPart, >- RootEditPart root) { >- >- EditPart currentEditPart = editPart; >- >- while (currentEditPart != root.getContents() >- && currentEditPart != null) { >- IEditPartIdentifier identifier = DefaultEditPartAdapterFactory >- .loadFigureIdentifier(currentEditPart); >- if (identifier != null) { >- return currentEditPart; >- } >- currentEditPart = currentEditPart.getParent(); >- } >- >- return null; >- } >- >-} >diff --git a/org.eclipse.jubula.releng.server/pom.xml b/org.eclipse.jubula.releng.server/pom.xml >index a2d9f2d..f0874dc 100644 >--- a/org.eclipse.jubula.releng.server/pom.xml >+++ b/org.eclipse.jubula.releng.server/pom.xml >@@ -23,7 +23,9 @@ > <module>../org.eclipse.jubula.rc.common.agent</module> > <module>../org.eclipse.jubula.rc.swing</module> > <module>../org.eclipse.jubula.rc.swt</module> >- <module>../org.eclipse.jubula.rc.rcp</module> >+ <module>../org.eclipse.jubula.rc.rcp.e3</module> >+ <module>../org.eclipse.jubula.rc.rcp.e3.specific</module> >+ <module>../org.eclipse.jubula.rc.rcp.e4.compat</module> > <module>../org.eclipse.jubula.app.autrun</module> > <module>../org.eclipse.jubula.app.autagent</module> > <module>../org.eclipse.jubula.product.autagent.start</module> >-- >1.7.11 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 379217
:
224561
|
224867