[bug 217977] initial commit
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.classpath b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.cvsignore b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.project b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.project
new file mode 100644
index 0000000..23bf47d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.engines.voicebrowser</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..6925476
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF Voice Browser Engine Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.engines.voicebrowser
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.engines.voicebrowser.JwatPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.actf.ai.voice
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.actf.visualization.engines.voicebrowser
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/about.html b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/build.properties b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/build.properties
new file mode 100644
index 0000000..a3c4161
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ about.html,\
+ .
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/Context.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/Context.java
new file mode 100644
index 0000000..70f9096
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/Context.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+public class Context {
+ private boolean insideForm = false;
+ private boolean linkTag = false;
+ private boolean insideAnchor = false;
+ private boolean startSelect = false;
+ private boolean stringOutput = true;
+ private boolean lineDelimiter = false;
+ private boolean goChild = true;
+
+ /**
+ * Constructor for Context.
+ */
+ public Context() {
+ }
+
+ /**
+ * Constructor for Context.
+ * @param ctx source context instance to be copied.s
+ */
+ public Context(Context ctx) {
+ insideForm = ctx.isInsideForm();
+ insideAnchor = ctx.isInsideAnchor();
+ lineDelimiter = ctx.isLineDelimiter();
+ startSelect = ctx.isStartSelect();
+ stringOutput = ctx.isStringOutput();
+ linkTag = ctx.isLinkTag();
+ goChild = ctx.isGoChild();
+ }
+
+ /**
+ * Returns the insideForm.
+ * @return boolean
+ */
+ public boolean isInsideForm() {
+ return insideForm;
+ }
+
+ /**
+ * Sets the insideForm.
+ * @param i The insideForm to set
+ */
+ public void setInsideForm(boolean i) {
+ insideForm = i;
+ }
+
+ /**
+ * Returns the goChild.
+ * @return boolean
+ */
+ public boolean isGoChild() {
+ return goChild;
+ }
+
+ /**
+ * Sets the goChild.
+ * @param goChild The goChild to set
+ */
+ public void setGoChild(boolean goChild) {
+ this.goChild = goChild;
+ }
+
+ /**
+ * Returns the lineDelimiter.
+ * @return boolean
+ */
+ public boolean isLineDelimiter() {
+ return lineDelimiter;
+ }
+
+ /**
+ * Sets the lineDelimiter.
+ * @param lineDelimiter The lineDelimiter to set
+ */
+ public void setLineDelimiter(boolean lineDelimiter) {
+ this.lineDelimiter = lineDelimiter;
+ }
+
+ /**
+ * Returns the linkTag.
+ * @return boolean
+ */
+ public boolean isLinkTag() {
+ return linkTag;
+ }
+
+ /**
+ * Sets the linkTag.
+ * @param linkTag The linkTag to set
+ */
+ public void setLinkTag(boolean linkTag) {
+ this.linkTag = linkTag;
+ }
+
+ /**
+ * Returns the insideAnchor.
+ * @return boolean
+ */
+ public boolean isInsideAnchor() {
+ return insideAnchor;
+ }
+
+ /**
+ * Sets the insideAnchor.
+ * @param insideAnchor The insideAnchor to set
+ */
+ public void setInsideAnchor(boolean insideAnchor) {
+ this.insideAnchor = insideAnchor;
+ }
+
+ /**
+ * Returns the startSelect.
+ * @return boolean
+ */
+ public boolean isStartSelect() {
+ return startSelect;
+ }
+
+ /**
+ * Sets the startSelect.
+ * @param startSelect The startSelect to set
+ */
+ public void setStartSelect(boolean startSelect) {
+ this.startSelect = startSelect;
+ }
+
+ /**
+ * Returns the stringOutput.
+ * @return boolean
+ */
+ public boolean isStringOutput() {
+ return stringOutput;
+ }
+
+ /**
+ * Sets the stringOutput.
+ * @param stringOutput The stringOutput to set
+ */
+ public void setStringOutput(boolean stringOutput) {
+ this.stringOutput = stringOutput;
+ }
+
+ /**
+ * Convert object into a string
+ * @return converted string
+ */
+ public String toString() {
+ StringBuffer sbuf = new StringBuffer();
+
+ sbuf.append("goChild=");
+ sbuf.append(goChild);
+ sbuf.append(", ");
+
+ sbuf.append("insideForm=");
+ sbuf.append(insideForm);
+ sbuf.append(", ");
+
+ sbuf.append("insideAnchor=");
+ sbuf.append(insideAnchor);
+ sbuf.append(", ");
+
+ sbuf.append("startSelect=");
+ sbuf.append(startSelect);
+ sbuf.append(", ");
+
+ sbuf.append("stringOutput=");
+ sbuf.append(stringOutput);
+ sbuf.append(", ");
+
+ sbuf.append("linkTag=");
+ sbuf.append(linkTag);
+ sbuf.append(", ");
+
+ sbuf.append("lineDelimiter=");
+ sbuf.append(lineDelimiter);
+
+ return sbuf.toString();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/CursorListener.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/CursorListener.java
new file mode 100644
index 0000000..77c47e5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/CursorListener.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Hironobu TAKAGI - initial API and implementation
+ *******************************************************************************/
+ package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import java.util.EventListener;
+
+public interface CursorListener extends EventListener {
+ public void doCursorMoved(CursorMovedEvent event);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/CursorMovedEvent.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/CursorMovedEvent.java
new file mode 100644
index 0000000..f935fb7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/CursorMovedEvent.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Hironobu TAKAGI - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import java.util.EventObject;
+
+public class CursorMovedEvent extends EventObject {
+
+ private int cCursorPos;
+
+ /**
+ * Constructor for CursorChangedEvent.
+ * @param source
+ */
+ public CursorMovedEvent(Object source, int pos) {
+ super(source);
+ cCursorPos = pos;
+ }
+
+ /**
+ * Returns the cCursorPos.
+ * @return int
+ */
+ public int getCCursorPos() {
+ return cCursorPos;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return (getClass().getName() +
+ "[source=" + getSource() + ",cCursorPos=" + cCursorPos + "]");
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JWAT.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JWAT.java
new file mode 100644
index 0000000..fc25f78
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JWAT.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.internal.JWATControllerImpl;
+
+public class JWAT {
+
+ /**
+ * Method createJWATController.
+ *
+ * @return JWATController
+ */
+ static public JWATController createJWATController() {
+ return new JWATControllerImpl();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JWATController.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JWATController.java
new file mode 100644
index 0000000..0680096
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JWATController.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import org.eclipse.actf.ai.tts.ITTSEngine;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+
+public interface JWATController {
+ static final int DO_PREV_LINE = 1,
+ DO_CURR_LINE = 2,
+ DO_NEXT_LINE = 3,
+ DO_PREV_LINK = 4,
+ DO_CURR_LINK = 5,
+ DO_NEXT_LINK = 6,
+ DO_PREV_10LINE = 7,
+ DO_NEXT_10LINE = 8,
+ DO_CURR_ELEMENT = 9,
+ DO_TOP_OF_PAGE = 10,
+ DO_BOTTOM_OF_PAGE = 11,
+ DO_PLAY = 12,
+ DO_STOP = 13,
+ DO_LINK_JUMP = 14;
+
+ static final int HPR_MODE = 1, JAWS_MODE = 2;
+
+ /**
+ * Method setJwatMode.
+ * @param mode
+ */
+ void setJwatMode(int mode);
+
+ /**
+ * Method setJwatMode.
+ * @param mode
+ * @param xmlpath
+ */
+ void setJwatMode(int mode, String xmlpath);
+
+ /**
+ * Method setNode.
+ * @param node
+ */
+ void setNode(Node node);
+
+ /**
+ * Method setDocument.
+ * @param document
+ */
+ void setDocument(Document document);
+
+ /**
+ * Method setNode.
+ * @param node
+ */
+ void setNode(Node node, String uri, String anchorName);
+
+ /**
+ * Method setDocument.
+ * @param document
+ */
+ void setDocument(Document document, String uri, String anchorName);
+
+ /**
+ * Method doCommandJWAT.
+ * @param type
+ * @return String
+ */
+ String doCommandJWAT(int type);
+
+ /**
+ * Method getPacketCollection.
+ * @return PacketCollection
+ */
+ PacketCollection getPacketCollection();
+
+ /**
+ * Method addView.
+ * @param view
+ */
+ void addView(View view);
+
+ /**
+ * Method removeView.
+ * @param view
+ */
+ void removeView(View view);
+
+ /**
+ * Method addSelectionObserver.
+ * @param view
+ */
+
+ void addSelectionObserver(SelectionObserver view);
+
+ /**
+ * Method removeSelectionObserver.
+ * @param view
+ */
+ void removeSelectionObserver(SelectionObserver view);
+
+
+ /**
+ * Method addCursorListener.
+ * @param listener
+ */
+ public void addCursorListener(CursorListener listener);
+
+
+ /**
+ * Method removeActionListener.
+ * @param listener
+ */
+ public void removeCursorListener(CursorListener listener);
+
+
+ /**
+ * Method setNode.
+ * @param node
+ */
+ void setSpeechControl(ITTSEngine ttsEngine);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JwatPlugin.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JwatPlugin.java
new file mode 100644
index 0000000..30f5f2b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/JwatPlugin.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class JwatPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.actf.visualization.engines.voicebrowser";
+
+ // The shared instance
+ private static JwatPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public JwatPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static JwatPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/Packet.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/Packet.java
new file mode 100644
index 0000000..0ad9703
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/Packet.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+import org.w3c.dom.Node;
+
+public class Packet {
+ private Node node;
+ private String text;
+ private Context context;
+ private boolean isStartTag;
+
+ /**
+ * Constructor for RenderedText.
+ * @param ctx packet's context
+ * @param curNode node
+ * @param curText default text for this packet
+ */
+ public Packet(
+ Node curNode,
+ String curText,
+ Context ctx,
+ boolean isstarttag) {
+ context = new Context(ctx);
+ node = curNode;
+ text = curText;
+ isStartTag = isstarttag;
+ }
+
+ /**
+ * Returns the text.
+ * @return String
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * Sets the text.
+ * @param text The text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * Returns the context.
+ * @return Context
+ */
+ public Context getContext() {
+ return context;
+ }
+
+ /**
+ * Sets the context.
+ * @param context The context to set
+ */
+ public void setContext(Context context) {
+ this.context = context;
+ }
+
+ /**
+ * Returns the node.
+ * @return Node
+ */
+ public Node getNode() {
+ return node;
+ }
+
+ /**
+ * Sets the node.
+ * @param node The node to set
+ */
+ public void setNode(Node node) {
+ this.node = node;
+ }
+
+ /**
+ * Returns the isStartTag.
+ * @return boolean
+ */
+ public boolean isStartTag() {
+ return isStartTag;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer sbuf = new StringBuffer();
+
+ try {
+ sbuf.append(getNode().getNodeName());
+ sbuf.append("\n");
+ sbuf.append("\t");
+ sbuf.append(getText());
+ sbuf.append("\n");
+ sbuf.append("\t");
+ sbuf.append(getContext().toString());
+ sbuf.append("\n");
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ }
+
+ return sbuf.toString();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/PacketCollection.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/PacketCollection.java
new file mode 100644
index 0000000..c920f45
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/PacketCollection.java
@@ -0,0 +1,312 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import java.util.ArrayList;
+
+import org.w3c.dom.Node;
+
+
+public class PacketCollection extends ArrayList<Packet> {
+
+ /**
+ * Method PacketCollection.
+ * @param text
+ */
+ public PacketCollection(Packet text) {
+ super();
+ add(text);
+ }
+
+ /**
+ * @see java.lang.Object#Object()
+ */
+ public PacketCollection() {
+ super();
+ }
+
+ /**
+ * Method getText.
+ * @return String
+ */
+ public String getText() {
+ return "";
+ }
+
+ /**
+ * Method add.
+ * @param p
+ * @return boolean
+ */
+ public boolean add(Packet p) {
+ return super.add(p);
+ }
+
+ /**
+ * Method addAll.
+ * @param c
+ * @return boolean
+ */
+ public boolean addAll(PacketCollection c) {
+ return super.addAll(c);
+ }
+
+ /**
+ * Method isLineDelimiter.
+ * @param i
+ * @return boolean
+ */
+ public boolean isLineDelimiter(int i) {
+ try {
+ if (i < this.size())
+ return ((Packet) get(i)).getContext().isLineDelimiter();
+ else
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Method isLinkTag.
+ * @param i
+ * @return boolean
+ */
+ public boolean isLinkTag(int i) {
+ try {
+ if (i < this.size())
+ return ((Packet) get(i)).getContext().isLinkTag();
+ else
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Method isInsideForm.
+ * @param i
+ * @return boolean
+ */
+ public boolean isInsideForm(int i) {
+ try {
+ if (i < this.size())
+ return ((Packet) get(i)).getContext().isInsideForm();
+ else
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Method isInsideAnchor.
+ * @param i
+ * @return boolean
+ */
+ public boolean isInsideAnchor(int i) {
+ try {
+ if (i < this.size())
+ return ((Packet) get(i)).getContext().isInsideAnchor();
+ else
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Method isStartSelect.
+ * @param i
+ * @return boolean
+ */
+ public boolean isStartSelect(int i) {
+ try {
+ if (i < this.size())
+ return ((Packet) get(i)).getContext().isStartSelect();
+ else
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Method isStringOutput.
+ * @param i
+ * @return boolean
+ */
+ public boolean isStringOutput(int i) {
+ try {
+ if (i < this.size())
+ return ((Packet) get(i)).getContext().isStringOutput();
+ else
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Method getFirstNode.
+ * @return Node
+ */
+ public Node getFirstNode() {
+ try {
+ int size = this.size();
+ for (int i = 0; i < size; i++) {
+ if (((Packet) this.get(i)).isStartTag()) {
+ return ((Packet) this.get(i)).getNode();
+ }
+ }
+ return null;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return null;
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Method getLastNode.
+ * @return Node
+ */
+ public Node getLastNode() {
+ try {
+ int size = this.size();
+ for (int i = size - 1; i >= 0; i--) {
+ if (((Packet) this.get(i)).isStartTag()) {
+ return ((Packet) this.get(i)).getNode();
+ }
+ }
+ return null;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return null;
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Method getTopNodePosition.
+ * @return int
+ */
+ public int getTopNodePosition() {
+ try {
+ int size = this.size();
+ for (int i = 0; i < size; i++) {
+ String str = ((Packet) this.get(i)).getText();
+ if (str != null && str.length() > 0) {
+ if (this.isInsideAnchor(i)) {
+ for (int j = i; j >= 0; j--)
+ if (this.isLinkTag(j))
+ return j;
+ }
+ return i;
+ }
+ }
+ return -1;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return -1;
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ return -1;
+ }
+ }
+
+ /**
+ * Method getBottomNodePosition.
+ * @return int
+ */
+ public int getBottomNodePosition() {
+ try {
+ int size = this.size();
+ boolean found = false;
+ for (int i = size - 1; i >= 0; i--) {
+ String str = ((Packet) this.get(i)).getText();
+ if (((str != null) && (str.length() > 0)))
+ found = true;
+ if (found) {
+ if (this.isLineDelimiter(i)) {
+ if (i == size - 1)
+ return i;
+ else {
+ if (this.isLinkTag(i + 1)
+ && (i + 2 < size && this.isLinkTag(i + 2)))
+ return i + 2;
+ else
+ return i + 1;
+ }
+ }
+ }
+ }
+ return -1;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return -1;
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ return -1;
+ }
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer sbuf = new StringBuffer();
+ int size = this.size();
+ for (int i = 0; i < size; i++) {
+ try {
+ sbuf.append(((Packet) this.get(i)).toString());
+ sbuf.append("\n");
+ } catch (ClassCastException cce) {
+ sbuf.append("error: " + i + "the object is not a packet.\n");
+ }
+ }
+ return sbuf.toString();
+ }
+
+ /**
+ * Method getNodePosition.
+ * @param node
+ * @return int
+ */
+ public int getNodePosition(Node node) {
+ try {
+ int size = this.size();
+ for (int i = 0; i < size; i++) {
+ if (node == ((Packet) this.get(i)).getNode()) {
+ // System.out.println ("found: " + i + "/" + size);
+ return i;
+ }
+ }
+ return 0;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return 0;
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ return 0;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/SelectionObserver.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/SelectionObserver.java
new file mode 100644
index 0000000..6fff927
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/SelectionObserver.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+import org.w3c.dom.Node;
+
+public interface SelectionObserver {
+
+ /**
+ * Method setRange.
+ * @param firstNode
+ * @param lastNode
+ */
+ void setRange(Node firstNode, Node lastNode);
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/View.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/View.java
new file mode 100644
index 0000000..11b9d6a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/View.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser;
+
+public interface View {
+
+ /**
+ * Method drawText.
+ * @param text
+ */
+ void drawText(String text);
+
+ /**
+ * Method drawAppendText.
+ * @param text
+ */
+ void drawAppendText(String text);
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/CurrentCursor.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/CurrentCursor.java
new file mode 100644
index 0000000..6ff595b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/CurrentCursor.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class CurrentCursor {
+ private Node topNode = null;
+
+ private Node ownerDocumentNode = null;
+
+ private PacketCollection pc;
+
+ private int curPos = 0;
+
+ /**
+ * Constructor for CurrentCursor.
+ */
+ public CurrentCursor() {
+ super();
+ }
+
+ /**
+ * Returns the curPos.
+ *
+ * @return int
+ */
+ public int getCurPos() {
+ return curPos;
+ }
+
+ /**
+ * Returns the pc.
+ *
+ * @return PacketCollection
+ */
+ public PacketCollection getPc() {
+ return pc;
+ }
+
+ /**
+ * Sets the curPos.
+ *
+ * @param curPos
+ * The curPos to set
+ */
+ public void setCurPos(int curPos) {
+ this.curPos = curPos;
+ }
+
+ /**
+ * Sets the pc.
+ *
+ * @param pc
+ * The pc to set
+ */
+ public void setPc(PacketCollection pc) {
+ this.pc = pc;
+ }
+
+ /**
+ * Method getNode.
+ *
+ * @param pos
+ * @return Node
+ */
+ public Node getNode(int pos) {
+ if (pos < pc.size()) {
+ return ((Packet) pc.get(pos)).getNode();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the topNode.
+ *
+ * @return Node
+ */
+ public Node getTopNode() {
+ return this.topNode;
+ }
+
+ /**
+ * Returns the ownerDocumentNode.
+ *
+ * @return Node
+ */
+ public Node getOwnerDocumentNode() {
+ return ownerDocumentNode;
+ }
+
+ /**
+ * Sets the ownerDocumentNode.
+ *
+ * @param ownerDocumentNode
+ * The ownerDocumentNode to set
+ */
+ public void setOwnerDocumentNode(Node ownerDocumentNode) {
+ this.ownerDocumentNode = ownerDocumentNode;
+
+ if (this.ownerDocumentNode != null) {
+ NodeList children = ((Document) this.ownerDocumentNode)
+ .getElementsByTagName("body");
+ if (children.getLength() > 0) {
+ this.topNode = children.item(0);
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/DomUtil.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/DomUtil.java
new file mode 100644
index 0000000..bf2a587
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/DomUtil.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class DomUtil {
+
+ protected static int tab, cnt;
+ private static NodeList FormChildren = null;
+
+ /**
+ * @see java.lang.Object#Object()
+ */
+ public DomUtil() {
+ tab = 0;
+ cnt = 0;
+ FormChildren = null;
+ }
+
+ /**
+ * Method recursiveWalk.
+ * @param node
+ * @param num
+ */
+ public static void recursiveWalk(Node node, int num) {
+ getNodeInfo(node, num);
+ tab++;
+ cnt = 0;
+ for (Node child = node.getFirstChild();
+ child != null;
+ child = child.getNextSibling(), cnt++) {
+ recursiveWalk(child, cnt);
+ }
+ tab--;
+ }
+
+ /**
+ * Method getString.
+ * @param node
+ * @return String
+ */
+ public static String getString(Node node) {
+ String str = null;
+
+ if (node != null)
+ str = "[" + node.getNodeName() + "] [" + node.getNodeValue() + "]";
+ return str;
+ }
+
+ /**
+ * Method getNodeInfo.
+ * @param node
+ * @param num
+ */
+ private static void getNodeInfo(Node node, int num) {
+ tabbing();
+ String nodeName = node.getNodeName();
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ NamedNodeMap attList = ((Element) node).getAttributes();
+ Attr att;
+ if (attList.getLength() > 0) {
+ String str = "<" + nodeName + ":" + node.getNodeValue();
+ for (int i = 0; i < attList.getLength(); i++) {
+ att = (Attr) attList.item(i);
+ str += "," + att.getName() + "=" + att.getValue();
+ }
+ str += ">";
+ System.out.println(str);
+ } else {
+ System.out.println(
+ "<" + nodeName + ":" + node.getNodeValue() + ">");
+ }
+ } else {
+ System.out.println(
+ "<" + nodeName + ":" + node.getNodeValue() + ">");
+ }
+ }
+
+ /**
+ * Method tabbing.
+ */
+ private static void tabbing() {
+ for (int i = 0; i < tab; i++) {
+ System.out.print("\t");
+ }
+ }
+
+ /**
+ * Method isNameAttr.
+ * @param node
+ * @return boolean
+ */
+ public static boolean isNameAttr(Node node) {
+ if (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("a")) {
+ NamedNodeMap attrs = node.getAttributes();
+ Node altNode = attrs.getNamedItem("name");
+ if (altNode != null)
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Method dumpPC.
+ * @param pc
+ */
+ public static void dumpPC(PacketCollection pc) {
+ if (pc == null)
+ return;
+ if (pc != null && pc.size() > 0) {
+ for (int i = 0; i < pc.size(); i++) {
+ Packet p = (Packet) pc.get(i);
+ String str = p.getText();
+ System.out.println("[" + i + "] <" + str + ">");
+ }
+ }
+ }
+
+ /**
+ * Method setFormList.
+ * @param node
+ */
+ public static void setFormList(Node node) {
+ if (node != null) {
+ FormChildren = ((Element) node).getElementsByTagName("form");
+ }
+ }
+
+ /**
+ * Method getFormNum.
+ * @param element
+ * @return int
+ */
+ public static int getFormNum(Element element) {
+ if (FormChildren != null) {
+ if (FormChildren.getLength() > 0) {
+ for (int i = 0; i < FormChildren.getLength(); i++) {
+ if (element == (Element) FormChildren.item(i))
+ return i + 1;
+ }
+ }
+ }
+ return 0;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/DummyTTSEngine.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/DummyTTSEngine.java
new file mode 100644
index 0000000..68cb339
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/DummyTTSEngine.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.ai.tts.ITTSEngine;
+import org.eclipse.actf.ai.voice.IVoiceEventListener;
+
+public class DummyTTSEngine implements ITTSEngine {
+
+ public void dispose() {
+ }
+
+ public int getSpeed() {
+ return 0;
+ }
+
+ public void setEventListener(IVoiceEventListener eventListener) {
+ }
+
+ public void setGender(String gender) {
+ }
+
+ public void setLanguage(String language) {
+ }
+
+ public void setSpeed(int speed) {
+ }
+
+ public void speak(String text, int flags, int index) {
+ }
+
+ public void stop() {
+ }
+
+ public boolean isAvailable() {
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/IElementRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/IElementRenderer.java
new file mode 100644
index 0000000..8c4909a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/IElementRenderer.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+
+public interface IElementRenderer {
+
+ /**
+ * Method getPacketCollectionIn.
+ * @param element
+ * @param ctx
+ * @return PacketCollection
+ */
+ PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc);
+
+ /**
+ * Method getPacketCollectionOut.
+ * @param element
+ * @param ctx
+ * @return PacketCollection
+ */
+ PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc);
+
+ /**
+ * Method setContextIn.
+ * @param curContext
+ */
+ void setContextIn(Element element, Context curContext);
+
+ /**
+ * Method setContextOut.
+ * @param curContext
+ */
+ void setContextOut(Element element, Context curContext);
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/JWATControllerImpl.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/JWATControllerImpl.java
new file mode 100644
index 0000000..2c037df
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/JWATControllerImpl.java
@@ -0,0 +1,1260 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+
+import org.eclipse.actf.ai.tts.ITTSEngine;
+import org.eclipse.actf.visualization.engines.voicebrowser.CursorListener;
+import org.eclipse.actf.visualization.engines.voicebrowser.CursorMovedEvent;
+import org.eclipse.actf.visualization.engines.voicebrowser.JWATController;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.eclipse.actf.visualization.engines.voicebrowser.SelectionObserver;
+import org.eclipse.actf.visualization.engines.voicebrowser.View;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class JWATControllerImpl implements JWATController {
+
+ private static List<View> views = new ArrayList<View>();
+
+ private static List<SelectionObserver> selObservers = new ArrayList<SelectionObserver>();
+
+ @SuppressWarnings("unused")
+ private static MessageCollection mc = null;
+
+ private JWATCore core = new JWATCore();
+
+ private CurrentCursor ccursor = new CurrentCursor();
+
+ private ITTSEngine speech = new DummyTTSEngine();
+
+ /**
+ * @see java.lang.Object#Object()
+ */
+ public JWATControllerImpl() {
+ setJwatMode(HPR_MODE);
+ }
+
+ /**
+ * Method JWATControllerImpl.
+ *
+ * @param mode
+ */
+ public JWATControllerImpl(int mode) {
+ setJwatMode(mode);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#setJwatMode(int)
+ */
+ public void setJwatMode(int mode) {
+ setJwatMode(mode, ""); // xmlpath is not set by defalt
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#setJwatMode(int, String)
+ */
+ public void setJwatMode(int mode, String xmlpath) {
+ // System.out.println ("setJwatMode [" + mode + "]");
+ mc = core.setJwatMode(mode, xmlpath);
+ doTopOfPage();
+ // OutLoud.dumpMessages(mc);
+
+ String s = OutLoud.name + " mode";
+ speech.stop();
+ speech.speak(s, ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#setDocument(Document)
+ */
+ public void setDocument(Document document) {
+ setDocument(document, null, null);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#setDocument(Document)
+ */
+ public void setDocument(Document document, String uri, String anchorName) {
+ Node node = document;
+ JWATCore.setUriPrefix(uri);
+ if (node != null) {
+ NodeList children = document.getElementsByTagName("body");
+ if (children != null && children.getLength() > 0) {
+ node = children.item(0);
+ DomUtil.setFormList(node);
+ ccursor.setPc(core.getPacketCollection(node));
+ ccursor.setOwnerDocumentNode(document);
+ if (ccursor.getPc() != null && ccursor.getPc().size() > 0 && ccursor.getCurPos() == 0) {
+ int pos = 0;
+ if (anchorName != null && anchorName.length() > 0) {
+ pos = core.getAnchorPosition(anchorName, ccursor.getTopNode(), ccursor.getPc());
+ ccursor.setCurPos(pos);
+ doCurLine();
+ } else {
+ pos = core.getNodePosition(node, ccursor.getPc());
+ ccursor.setCurPos(pos);
+ }
+ }
+ // DomUtil.recursiveWalk(node,0);
+ // System.out.println("JWATControlImpl: 62:\n" + ccursor.getPc().toString());
+ }
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#setNode(Node)
+ */
+ public void setNode(Node node) {
+ setNode(node, null, null);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#setNode(Node)
+ */
+ public void setNode(Node node, String uri, String anchorName) {
+ JWATCore.setUriPrefix(uri);
+ if (node != null) {
+ Node ownerNode = node.getOwnerDocument();
+ if (ownerNode != null) {
+ if (ccursor.getPc() == null || ccursor.getPc().size() == 0
+ || ccursor.getOwnerDocumentNode() != ownerNode) {
+ setDocument((Document) ownerNode);
+ }
+ }
+ int pos = 0;
+ if (anchorName != null && anchorName.length() > 0) {
+ pos = core.getAnchorPosition(anchorName, ccursor.getTopNode(), ccursor.getPc());
+ ccursor.setCurPos(pos);
+ doCurLine();
+ } else {
+ pos = core.getNodePosition(node, ccursor.getPc());
+ ccursor.setCurPos(pos);
+ }
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#doCommandJWAT(int)
+ */
+ public String doCommandJWAT(int type) {
+ int prevPos = ccursor.getCurPos();
+ switch (type) {
+ case DO_PREV_LINE:
+ doPrevLine();
+ break;
+ case DO_CURR_LINE:
+ doCurLine();
+ break;
+ case DO_NEXT_LINE:
+ doNextLine();
+ break;
+ case DO_PREV_LINK:
+ doPrevLink();
+ break;
+ case DO_CURR_LINK:
+ doCurLink();
+ break;
+ case DO_NEXT_LINK:
+ doNextLink();
+ break;
+ case DO_PREV_10LINE:
+ for (int i = 0; i < 10; i++)
+ doPrevLine();
+ break;
+ case DO_NEXT_10LINE:
+ for (int i = 0; i < 10; i++)
+ doNextLine();
+ break;
+ case DO_CURR_ELEMENT:
+ doCurLine();
+ break;
+ case DO_TOP_OF_PAGE:
+ doTopOfPage();
+ break;
+ case DO_BOTTOM_OF_PAGE:
+ doBottomOfPage();
+ break;
+ case DO_LINK_JUMP:
+ String s = doLinkJump();
+ if (s != null && s.length() > 0)
+ return s;
+ break;
+ case DO_PLAY:
+ doPlay();
+ break;
+ case DO_STOP:
+ doStop();
+ break;
+ }
+ if (ccursor.getCurPos() != prevPos) {
+ sendCursorEvent(new CursorMovedEvent(this, ccursor.getCurPos()));
+ }
+
+ return null;
+ }
+
+ /**
+ * Method doCurLine.
+ */
+ private void doCurLine() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection lpc = getCurLine(true);
+ if (lpc != null && lpc.size() > 0)
+ speakWithVisual(lpc);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doPrevLine.
+ */
+ private void doPrevLine() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection lpc = getPrevLine(true);
+ if (lpc != null && lpc.size() > 0) {
+ speakWithVisual(lpc);
+ } else {
+ speech.stop();
+ if (OutLoud.topofpage != null && OutLoud.topofpage.length() > 0)
+ speech.speak(OutLoud.topofpage, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("Top of page.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doNextLine.
+ */
+ private void doNextLine() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection lpc = getNextLine(true);
+ if (lpc != null && lpc.size() > 0) {
+ speakWithVisual(lpc);
+ } else {
+ speech.stop();
+ if (OutLoud.endofpage != null && OutLoud.endofpage.length() > 0)
+ speech.speak(OutLoud.endofpage, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("End of page.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doCurLink.
+ */
+ private void doCurLink() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection lpc = getCurLink();
+ if (lpc != null && lpc.size() > 0) {
+ speakWithVisual(lpc);
+ } else {
+ speech.stop();
+ if (OutLoud.nocurlink != null && OutLoud.nocurlink.length() > 0)
+ speech.speak(OutLoud.nocurlink, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("No Current Link.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doPrevLink.
+ */
+ private void doPrevLink() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection lpc = getPrevLink();
+ if (lpc != null && lpc.size() > 0) {
+ speakWithVisual(lpc);
+ } else {
+ speech.stop();
+ if (OutLoud.noprevlink != null && OutLoud.noprevlink.length() > 0)
+ speech.speak(OutLoud.noprevlink, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("No Previous Link.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doNextLine.
+ */
+ private void doNextLink() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection lpc = getNextLink();
+ if (lpc != null && lpc.size() > 0) {
+ speakWithVisual(lpc);
+ } else {
+ speech.stop();
+ if (OutLoud.nonextlink != null && OutLoud.nonextlink.length() > 0)
+ speech.speak(OutLoud.nonextlink, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("No Next Link.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doTopOfPage.
+ */
+ private void doTopOfPage() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection tpc = getTopLine();
+ if (tpc != null && tpc.size() > 0) {
+ speakWithVisual(tpc);
+ } else {
+ speech.stop();
+ if (OutLoud.topofpage != null && OutLoud.topofpage.length() > 0)
+ speech.speak(OutLoud.topofpage, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("Top of page.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doBottomOfPage.
+ */
+ private void doBottomOfPage() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ PacketCollection bpc = getBottomLine();
+ if (bpc != null && bpc.size() > 0) {
+ speakWithVisual(bpc);
+ } else {
+ speech.stop();
+ if (OutLoud.endofpage != null && OutLoud.endofpage.length() > 0)
+ speech.speak(OutLoud.endofpage, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("End of page.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doPlay.
+ */
+ private void doPlay() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ // speech
+ String str = render(pc, ccursor.getCurPos());
+ speech.stop();
+ speech.speak(str, ITTSEngine.TTSFLAG_FLUSH, -1);
+ // visual
+ drawText(str);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Method doStop.
+ */
+ private void doStop() {
+ // System.out.println("346: doStop()");
+ speech.stop();
+ }
+
+ /**
+ * Method doLinkJump.
+ */
+ private String doLinkJump() {
+ try {
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null) {
+
+ int curpos = ccursor.getCurPos();
+ Node node = null;
+ // check if it's on a link tag
+ node = ((Packet) pc.get(curpos)).getNode();
+ if (!pc.isLinkTag(curpos) && node != null) {
+ Node pnode = node.getParentNode();
+ boolean link = false;
+ for (;;) {
+ if (pnode == null)
+ break;
+ //String n = pnode.getNodeName();
+ if (pnode.getNodeType() == Node.ELEMENT_NODE
+ && pnode.getNodeName().toLowerCase().equals("body"))
+ break;
+ if (pnode.getNodeType() == Node.ELEMENT_NODE && pnode.getNodeName().toLowerCase().equals("a")) {
+ node = pnode;
+ link = true;
+ break;
+ }
+ pnode = pnode.getParentNode();
+ }
+ if (link == false) {
+ speech.stop();
+ if (OutLoud.notonalink != null && OutLoud.notonalink.length() > 0)
+ speech.speak(OutLoud.notonalink, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("Not on a link.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ return null;
+ }
+ }
+
+ // get target position
+ if (ccursor.getTopNode() != null) {
+ Node targetNode = null;
+ String href = core.getHrefString(node);
+ if (href != null && href.length() > 0) {
+ if (href.charAt(0) == '#') {
+ targetNode = core.getTargetNode(node, ccursor.getTopNode());
+
+ int targetpos = curpos;
+ if (targetNode != null)
+ targetpos = core.getNodePosition(targetNode, ccursor.getPc());
+ if (curpos != targetpos) {
+ boolean hasstr = false;
+ int pos;
+ for (pos = targetpos; pos < pc.size(); pos++) {
+ String str = ((Packet) pc.get(pos)).getText();
+ if (str != null && str.length() > 0) {
+ hasstr = true;
+ break;
+ }
+ }
+ if (hasstr) {
+ ccursor.setCurPos(pos);
+ doCurLine();
+ } else {
+ ccursor.setCurPos(curpos);
+ speech.stop();
+ if (OutLoud.nostring != null && OutLoud.nostring.length() > 0)
+ speech.speak(OutLoud.nostring, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("Target has no strings.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ }
+ }
+ return null;
+ } else if (!href.toLowerCase().startsWith("javascript:")) {
+ return href;
+ }
+ }
+ }
+ }
+ speech.stop();
+ if (OutLoud.notonalink != null && OutLoud.notonalink.length() > 0)
+ speech.speak(OutLoud.notonalink, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("Not on a link.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ return null;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * Method getPrevLink.
+ *
+ * @return PacketCollection
+ */
+ private PacketCollection getPrevLink() {
+ PacketCollection pc = ccursor.getPc();
+ PacketCollection lpc = new PacketCollection();
+ if (pc != null && pc.size() > 0) {
+ int curpos = ccursor.getCurPos();
+ int newpos = curpos;
+ int endpos;
+ boolean hasstr = false;
+
+ if (curpos > 0) {
+ for (int i = curpos - 1; i >= 0; i--) {
+ if (i < pc.size()) {
+ String str = ((Packet) pc.get(i)).getText();
+ if (str != null && str.length() > 0 && pc.isInsideAnchor(i)) {
+ hasstr = true;
+ }
+
+ if (pc.isLinkTag(i) && hasstr) {
+ newpos = i;
+ break;
+ } else if (pc.isLinkTag(i)) {
+ hasstr = false;
+ }
+ }
+ }
+ }
+ if (curpos != newpos) {
+ ccursor.setCurPos(newpos);
+ endpos = getEndPositionOfCurLine();
+ if (newpos == endpos && endpos < (pc.size() - 1))
+ endpos++;
+ lpc.addAll(pc.subList(newpos, endpos));
+ if (lpc != null && lpc.size() > 0) {
+ int linkcnt = 0;
+ for (int j = 0; j < lpc.size(); j++)
+ if (lpc.isLinkTag(j))
+ linkcnt++;
+ if (linkcnt > 1)
+ lpc = getCurLinkPC(true);
+ else if (linkcnt == 0)
+ lpc = null;
+ }
+ }
+ }
+ return lpc;
+ }
+
+ /**
+ * Method getCurLink.
+ *
+ * @return PacketCollection
+ */
+ private PacketCollection getCurLink() {
+ PacketCollection pc = ccursor.getPc();
+ PacketCollection lpc = null;
+ if (pc != null && pc.size() > 0) {
+ lpc = getCurLine(false);
+ if (lpc != null && lpc.size() > 0) {
+ int linkcnt = 0;
+ for (int j = 0; j < lpc.size(); j++)
+ if (lpc.isLinkTag(j))
+ linkcnt++;
+ if (linkcnt > 1)
+ lpc = getCurLinkPC(true);
+ else if (linkcnt == 0)
+ lpc = null;
+ }
+ }
+ return lpc;
+ }
+
+ /**
+ * Method getNextLink.
+ *
+ * @return PacketCollection
+ */
+ private PacketCollection getNextLink() {
+ PacketCollection pc = ccursor.getPc();
+ PacketCollection lpc = new PacketCollection();
+ if (pc != null && pc.size() > 0) {
+ int curpos = ccursor.getCurPos();
+ int newpos = curpos;
+ int endpos;
+ boolean found = false;
+ for (int i = curpos + 1; i < pc.size(); i++) {
+ if (pc.isLinkTag(i)) {
+ int k = i;
+ if (pc.isInsideAnchor(i)) {
+ for (k = i; k < pc.size(); k++)
+ if (!pc.isInsideAnchor(k))
+ break;
+ }
+ for (int j = i; j <= k; j++) {
+ String str = ((Packet) pc.get(j)).getText();
+ if (((str != null) && (str.length() > 0))) {
+ found = true;
+ break;
+ }
+ }
+ if (found) {
+ newpos = i;
+ break;
+ }
+ }
+ }
+
+ if (curpos != newpos) {
+ ccursor.setCurPos(newpos);
+ endpos = getEndPositionOfCurLine();
+ if (newpos == endpos && endpos < (pc.size() - 1))
+ endpos++;
+ lpc.addAll(pc.subList(newpos, endpos));
+
+ if (lpc != null && lpc.size() > 0) {
+ int linkcnt = 0;
+ for (int j = 0; j < lpc.size(); j++)
+ if (lpc.isLinkTag(j))
+ linkcnt++;
+ if (linkcnt > 1) {
+ lpc = getCurLinkPC(true);
+ return lpc;
+ } else if (linkcnt == 0)
+ lpc = null;
+ }
+ }
+ }
+ return lpc;
+ }
+
+ /**
+ * Method getCurLine.
+ *
+ * @param pc
+ * @return PacketCollection
+ */
+ private PacketCollection getCurLine(boolean setpos) {
+ PacketCollection newPc = new PacketCollection();
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int endIndex = 0;
+ int pos = 0;
+ int headPos = 0;
+ int i = 0;
+ int j = 0;
+
+ // get position (current/head)
+ pos = ccursor.getCurPos();
+ headPos = pc.getTopNodePosition();
+
+ // startIndex
+ startIndex = pos;
+ if (headPos >= pos) {
+ startIndex = headPos;
+ } else {
+ if (pos > 0) {
+ if (pc.isLinkTag(pos) && pc.isLinkTag(pos - 1))
+ i = pos - 1;
+ else {
+ for (i = pos - 1; i >= 0; i--) {
+ if (pc.isLineDelimiter(i))
+ break;
+ }
+ }
+ }
+
+ // check its node has string
+ for (j = i + 1; j < pc.size(); j++) {
+ String str = ((Packet) pc.get(j)).getText();
+ if (((str != null) && (str.length() > 0))) {
+ pos = j;
+ break;
+ }
+ }
+ if (pc.isInsideAnchor(j)) {
+ for (int k = j; k >= 0; k--) {
+ if (pc.isLinkTag(k)) {
+ startIndex = k;
+ break;
+ }
+ }
+ } else
+ startIndex = j;
+
+ if (pos < j)
+ startIndex = pos;
+ }
+
+ // endIndex
+ endIndex = searchEndPosition(startIndex);
+ if (startIndex == endIndex)
+ endIndex += 1;
+
+ // set start position to CurrentCursor
+ if (setpos)
+ ccursor.setCurPos(startIndex);
+
+ // build line PacketCollection
+ newPc.addAll(pc.subList(startIndex, endIndex));
+ }
+ return newPc;
+ }
+
+ private int getEndPositionOfCurLine() {
+ int endIndex = 0;
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int pos = 0;
+ int headPos = 0;
+ int i = 0;
+ int j = 0;
+
+ // get position (current/head)
+ pos = ccursor.getCurPos();
+ headPos = pc.getTopNodePosition();
+
+ // startIndex
+ startIndex = pos;
+ if (headPos >= pos) {
+ startIndex = headPos;
+ } else {
+ if (pos > 0) {
+ if (pc.isLinkTag(pos) && pc.isLinkTag(pos - 1))
+ i = pos - 1;
+ else {
+ for (i = pos - 1; i >= 0; i--) {
+ if (pc.isLineDelimiter(i))
+ break;
+ }
+ }
+ }
+
+ // check its node has string
+ for (j = i + 1; j < pc.size(); j++) {
+ String str = ((Packet) pc.get(j)).getText();
+ if (((str != null) && (str.length() > 0))) {
+ pos = j;
+ break;
+ }
+ }
+ if (pc.isInsideAnchor(j)) {
+ for (int k = j; k >= 0; k--) {
+ if (pc.isLinkTag(k)) {
+ startIndex = k;
+ break;
+ }
+ }
+ } else
+ startIndex = j;
+
+ if (pos < j)
+ startIndex = pos;
+ }
+
+ // endIndex
+ endIndex = searchEndPosition(startIndex);
+ if (startIndex == endIndex)
+ endIndex += 1;
+ }
+ return endIndex;
+ }
+
+ /**
+ * Method searchEndPosition.
+ *
+ * @param startPos
+ * @return int
+ */
+ private int searchEndPosition(int startPos) {
+ int endPos = startPos;
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ if (pc.isStartSelect(startPos)
+ || (pc.isLinkTag(startPos) && (startPos + 1 < pc.size() && pc.isLinkTag(startPos + 1)))) {
+ endPos = startPos + 1;
+ } else {
+ boolean insideForm = pc.isInsideForm(startPos);
+ while ((startPos < pc.size()) && (!pc.isLineDelimiter(startPos))) {
+ if (insideForm && !pc.isInsideForm(startPos))
+ break;
+ startPos++;
+ }
+ endPos = startPos;
+ }
+ }
+ return endPos;
+ }
+
+ /**
+ * Method getPrevLine.
+ *
+ * @param pc
+ * @return PacketCollection
+ */
+ private PacketCollection getPrevLine(boolean setpos) {
+ PacketCollection newPc = new PacketCollection();
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int endIndex = 0;
+ int pos = 0;
+ int headPos = 0;
+
+ // get position (current/head)
+ pos = ccursor.getCurPos();
+ headPos = pc.getTopNodePosition();
+
+ if (headPos >= pos) {
+ ccursor.setCurPos(headPos);
+ return null;
+ }
+
+ // startIndex
+ int curpos = ccursor.getCurPos();
+ boolean strfound = false;
+ if (curpos - 1 >= 0) {
+ for (int i = curpos - 1; i >= 0; i--) {
+ String str = ((Packet) pc.get(i)).getText();
+ if (!strfound && ((str != null) && (str.length() > 0))) {
+ strfound = true;
+ if (strfound) {
+ if (pc.isLineDelimiter(i)) {
+ pos = i;
+ break;
+ }
+ }
+ } else if (strfound && pc.isLineDelimiter(i)) {
+ pos = i + 1;
+ if (pc.isLinkTag(pos) && pc.isLinkTag(pos + 1))
+ pos += 1;
+ break;
+ }
+ }
+ }
+ if (pos == curpos)
+ startIndex = pos - 1;
+ else
+ startIndex = pos;
+
+ // endIndex
+ endIndex = searchEndPosition(startIndex);
+ if (startIndex == endIndex)
+ endIndex += 1;
+
+ // set start position to CurrentCursor
+ if (setpos)
+ ccursor.setCurPos(startIndex);
+
+ // build line PacketCollection
+ newPc.addAll(pc.subList(startIndex, endIndex));
+ }
+ return newPc;
+ }
+
+ /**
+ * Method getNextLine.
+ *
+ * @param pc
+ * @return PacketCollection
+ */
+ private PacketCollection getNextLine(boolean setpos) {
+ PacketCollection newPc = new PacketCollection();
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int endIndex = 0;
+ int pos = 0;
+
+ // check last position
+ int curpos = ccursor.getCurPos();
+ int bottompos = pc.getBottomNodePosition();
+ if (curpos >= bottompos)
+ return null;
+
+ // skip current line
+ int i = curpos;
+ boolean insideForm = pc.isInsideForm(i);
+ if (pc.isStartSelect(i) || (pc.isLinkTag(i) && (i + 1 < pc.size() && pc.isLinkTag(i + 1)))) {
+ pos = i + 1;
+ } else {
+ while ((i < pc.size()) && (!pc.isLineDelimiter(i))) {
+ if ((insideForm && !pc.isInsideForm(i)) || pc.isStartSelect(i))
+ break;
+ i++;
+ }
+ if ((insideForm && !pc.isInsideForm(i)) || pc.isStartSelect(i))
+ pos = i;
+ else
+ pos = i + 1;
+ }
+
+ // check its node has string
+ if (pos <= pc.size()) {
+ for (i = pos; i < pc.size(); i++) {
+ String str = ((Packet) pc.get(i)).getText();
+ if (((str != null) && (str.length() > 0))) {
+ pos = i;
+ break;
+ }
+ }
+ }
+ startIndex = pos;
+
+ // endIndex
+ endIndex = searchEndPosition(startIndex);
+ if (startIndex == endIndex)
+ endIndex += 1;
+
+ // set start position to CurrentCursor
+ if (setpos)
+ ccursor.setCurPos(startIndex);
+
+ // build line PacketCollection
+ newPc.addAll(pc.subList(startIndex, endIndex));
+ }
+ return newPc;
+ }
+
+ /**
+ * Method getTopLine.
+ *
+ * @param pc
+ * @return PacketCollection
+ */
+ private PacketCollection getTopLine() {
+ PacketCollection newPc = new PacketCollection();
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int endIndex = 0;
+
+ // startIndex
+ startIndex = pc.getTopNodePosition();
+
+ // endIndex
+ int i = startIndex;
+ while ((i < pc.size()) && (!pc.isLineDelimiter(i))) {
+ i++;
+ }
+ endIndex = i;
+ if (startIndex == endIndex)
+ endIndex += 1;
+ ccursor.setCurPos(startIndex);
+ // if (startIndex < pc.size() && endIndex < pc.size())
+ newPc.addAll(pc.subList(startIndex, endIndex));
+ }
+ return newPc;
+ }
+
+ /**
+ * Method getBottomLine.
+ *
+ * @param pc
+ * @return PacketCollection
+ */
+ private PacketCollection getBottomLine() {
+ PacketCollection newPc = new PacketCollection();
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int endIndex = 0;
+ int pos = 0;
+
+ // startIndex
+ pos = pc.getBottomNodePosition();
+ int i = pos;
+ if (!pc.isLineDelimiter(i)) {
+ while ((i < pc.size()) && (pc.isLineDelimiter(i)))
+ i++;
+ }
+ startIndex = i;
+
+ // endIndex
+ i = startIndex;
+ while ((i < pc.size() - 1) && (!pc.isLineDelimiter(i))) {
+ i++;
+ }
+ endIndex = i;
+ if (startIndex == endIndex)
+ endIndex += 1;
+
+ ccursor.setCurPos(startIndex);
+ newPc.addAll(pc.subList(startIndex, endIndex));
+ }
+ return newPc;
+ }
+
+ private PacketCollection getCurLinkPC(boolean setpos) {
+ PacketCollection newPc = new PacketCollection();
+ PacketCollection pc = ccursor.getPc();
+ if (pc != null && pc.size() > 0) {
+ int startIndex = 0;
+ int endIndex = 0;
+
+ // startIndex
+ startIndex = ccursor.getCurPos();
+ for (int i = startIndex; i < pc.size(); i++) {
+ if (pc.isLinkTag(i)) {
+ startIndex = i;
+ break;
+ }
+ }
+
+ // endIndex
+ endIndex = startIndex + 1;
+ if (pc.isInsideAnchor(startIndex)) {
+ for (int i = startIndex; i < pc.size(); i++) {
+ if (!pc.isInsideAnchor(i)) {
+ endIndex = i;
+ break;
+ }
+ }
+ }
+
+ if (setpos)
+ ccursor.setCurPos(startIndex);
+ newPc.addAll(pc.subList(startIndex, endIndex));
+ }
+ return newPc;
+ }
+
+ /**
+ * Method setRange.
+ *
+ * @param firstNode
+ * @param lastNode
+ */
+ private void setRange(Node firstNode, Node lastNode) {
+ if (firstNode != null && lastNode != null) {
+ int numSelObservers = selObservers.size();
+ if (firstNode != null && lastNode != null)
+ for (int i = 0; i < numSelObservers; i++) {
+ ((SelectionObserver) selObservers.get(i)).setRange(firstNode, lastNode);
+ }
+ }
+ }
+
+ /**
+ * Method speakWithVisual.
+ *
+ * @param pc
+ */
+ private void speakWithVisual(PacketCollection pc) {
+ String str;
+ Node firstNode, lastNode;
+ try {
+ firstNode = pc.getFirstNode();
+ lastNode = pc.getLastNode();
+ str = render(pc);
+
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return;
+ } catch (NoSuchElementException nse) {
+ speech.stop();
+ if (OutLoud.endofpage != null && OutLoud.endofpage.length() > 0)
+ speech.speak(OutLoud.endofpage, ITTSEngine.TTSFLAG_FLUSH, -1);
+ else
+ speech.speak("End of page.", ITTSEngine.TTSFLAG_FLUSH, -1);
+ return;
+ }
+
+ if ((str != null) && (str.length() > 0)) {
+ speech.stop();
+ speech.speak(str, ITTSEngine.TTSFLAG_FLUSH, -1);
+ setRange(firstNode, lastNode);
+ drawText(str);
+ }
+ }
+
+ /**
+ * Method render.
+ *
+ * @param pc
+ * @return String
+ */
+ public String render(PacketCollection pc) {
+ int startPos = 0;
+ try {
+ int size = pc.size();
+ StringBuffer result = new StringBuffer();
+ for (int i = startPos; i < size; i++) {
+ Packet p = (Packet) pc.get(i);
+ String str = p.getText();
+
+ if ((str != null) && (str.length() > 0)) {
+ if (result.length() > 0) {
+ char lastChar = result.charAt(result.length() - 1);
+ if (lastChar != '\n')
+ if (p.getContext().isStartSelect())
+ result.append("\n");
+ }
+ result.append(" ");
+ result.append(str);
+ }
+
+ if (result.length() > 0) {
+ char lastChar = result.charAt(result.length() - 1);
+ if (lastChar != '\n')
+ if (p.getContext().isLineDelimiter()
+ || (pc.isLinkTag(i) && (i + 1 < pc.size() && pc.isLinkTag(i + 1))))
+ result.append("\n");
+ }
+ }
+ return result.toString();
+ } catch (NullPointerException npe) {
+ return null;
+ }
+ }
+
+ /**
+ * Method render.
+ *
+ * @param pc
+ * @param startPos
+ * @return String
+ */
+ public String render(PacketCollection pc, int startPos) {
+ try {
+ int size = pc.size();
+ StringBuffer result = new StringBuffer();
+ for (int i = startPos; i < size; i++) {
+ Packet p = (Packet) pc.get(i);
+ String str = p.getText();
+
+ if ((str != null) && (str.length() > 0) && p.getContext().isStringOutput()) {
+ if (result.length() > 0) {
+ char lastChar = result.charAt(result.length() - 1);
+ if (lastChar != '\n')
+ if (p.getContext().isStartSelect())
+ result.append("\n");
+ }
+ result.append(" ");
+ result.append(str);
+ }
+
+ if (result.length() > 0) {
+ char lastChar = result.charAt(result.length() - 1);
+ if (lastChar != '\n')
+ if (p.getContext().isLineDelimiter()
+ || (pc.isLinkTag(i) && (i + 1 < pc.size() && pc.isLinkTag(i + 1))))
+ result.append("\n");
+ }
+ }
+ return result.toString();
+ } catch (NullPointerException npe) {
+ return null;
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#addView(View)
+ */
+ public void addView(View view) {
+ views.add(view);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#removeView(View)
+ */
+ public void removeView(View view) {
+ views.remove(view);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#addSelectionObserver(SelectionObserver)
+ */
+ public void addSelectionObserver(SelectionObserver view) {
+ selObservers.add(view);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#removeSelectionObserver(SelectionObserver)
+ */
+ public void removeSelectionObserver(SelectionObserver view) {
+ selObservers.remove(view);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#getPacketCollection()
+ */
+ public PacketCollection getPacketCollection() {
+ return ccursor.getPc();
+ }
+
+ /**
+ * Method drawText.
+ *
+ * @param text
+ */
+ void drawText(String text) {
+ if (views == null)
+ return;
+ int numViews = views.size();
+ for (int i = 0; i < numViews; i++) {
+ View tv = (View) views.get(i);
+ tv.drawText(text);
+ }
+ }
+
+ /**
+ * Method drawAppendText.
+ *
+ * @param text
+ */
+ void drawAppendText(String text) {
+ if (views == null)
+ return;
+ int numViews = views.size();
+ for (int i = 0; i < numViews; i++) {
+ View tv = (View) views.get(i);
+ tv.drawAppendText(text);
+ }
+ }
+
+ private Vector<CursorListener> cursorListeners = new Vector<CursorListener>();
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#addCursorListener(CursorListener)
+ */
+ public void addCursorListener(CursorListener listener) {
+ cursorListeners.addElement(listener);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.JWATController#removeCursorListener(CursorListener)
+ */
+ public void removeCursorListener(CursorListener listener) {
+ cursorListeners.removeElement(listener);
+ }
+
+ public void sendCursorEvent(CursorMovedEvent event) {
+ Vector listeners = (Vector) cursorListeners.clone();
+ Enumeration enums = listeners.elements();
+ while (enums.hasMoreElements()) {
+ CursorListener listener = (CursorListener) enums.nextElement();
+ listener.doCursorMoved(event);
+ }
+ }
+
+ public void setSpeechControl(ITTSEngine speech) {
+ if (speech != null) {
+ this.speech = speech;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/JWATCore.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/JWATCore.java
new file mode 100644
index 0000000..0018f39
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/JWATCore.java
@@ -0,0 +1,448 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Stack;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class JWATCore {
+ private static MessageCollection mc = null;
+
+ private static String uriPrefix = null;
+
+ /**
+ * Method setJwatMode.
+ *
+ * @param mode
+ * @param xmlpath
+ * @return MessageCollection
+ */
+ public MessageCollection setJwatMode(int mode, String xmlpath) {
+ try {
+ if (mc != null && mc.size() > 0)
+ mc.clear();
+ mc = OutLoud.createMessageCollection(mode, xmlpath);
+ return mc;
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ return null;
+ }
+ }
+
+ /**
+ * Method getPacketCollection.
+ *
+ * @param node
+ * @return PacketCollection
+ */
+ public PacketCollection getPacketCollection(Node node) {
+ // put parent nodes on the stack;
+ try {
+ // traverse
+ PacketCollection result = getPacketCollectionTraversely(node,
+ getCurrentParentsStack(node));
+ return result;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Method getCurrentParentsStack.
+ *
+ * @param node
+ * @return Stack
+ */
+ private static Stack<Node> getCurrentParentsStack(Node node) {
+ try {
+ Stack<Node> parentsStack = new Stack<Node>();
+ Stack<Node> tempStack = new Stack<Node>();
+ Node tempNode = node;
+ while (tempNode != null) {
+ tempStack.push(tempNode);
+ tempNode = tempNode.getParentNode();
+ }
+
+ while (tempStack.size() > 1) {
+ // Node curNode = (Node) tempStack.peek();
+ parentsStack.push(tempStack.pop());
+ }
+ return parentsStack;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Method getPacketCollectionTraversely.
+ *
+ * @param node
+ * @param elementStack
+ * @return PacketCollection
+ */
+ private PacketCollection getPacketCollectionTraversely(Node node,
+ Stack<Node> elementStack) {
+
+ Context curContext = new Context();
+ PacketCollection result = new PacketCollection();
+ Node curReadNode = node;
+ while (curReadNode != null) {
+
+ PacketCollection tmp = getPacketCollectionOneNode(curReadNode,
+ curContext);
+
+ if (tmp != null) {
+ result.addAll(tmp);
+ }
+ curReadNode = goNext(curReadNode, curContext, elementStack, result);
+ }
+ return result;
+ }
+
+ /**
+ * Method goNext.
+ *
+ * @param curReadNode
+ * @param elementStack
+ * @param result
+ * @return Node
+ */
+ private Node goNext(Node curReadNode, Context curContext,
+ Stack<Node> elementStack, PacketCollection result) {
+
+ PacketCollection tmp = null;
+
+ if (curReadNode == null)
+ return null;
+
+ if ((curContext.isGoChild()) && curReadNode.hasChildNodes()) {
+ // Has Child
+ elementStack.push(curReadNode);
+ return curReadNode.getFirstChild();
+
+ } else if (curReadNode.getNextSibling() != null) {
+ // Has Brother
+ if ((result != null)
+ && (curReadNode.getNodeType() == Node.ELEMENT_NODE)) {
+ IElementRenderer renderer = getElementRenderer((Element) curReadNode);
+ if (renderer != null) {
+ tmp = renderer.getPacketCollectionOut(
+ (Element) curReadNode, curContext, uriPrefix, mc);
+
+ if (tmp != null) {
+ result.addAll(tmp);
+ }
+ }
+ }
+ return curReadNode.getNextSibling();
+ } else {
+ // Check Parent
+ curReadNode = null;
+ while (curReadNode == null) {
+ if (elementStack.size() == 0) {
+ break;
+ }
+ curReadNode = (Node) elementStack.pop();
+
+ if ((result != null)
+ && (curReadNode.getNodeType() == Node.ELEMENT_NODE)) {
+ IElementRenderer renderer = getElementRenderer((Element) curReadNode);
+ if (renderer != null) {
+ tmp = renderer.getPacketCollectionOut(
+ (Element) curReadNode, curContext, uriPrefix,
+ mc);
+
+ if (tmp != null) {
+ result.addAll(tmp);
+ }
+ }
+ }
+ curReadNode = curReadNode.getNextSibling();
+ }
+ return curReadNode;
+ }
+ }
+
+ /**
+ * Method getPacketCollectionOneNode.
+ *
+ * @param node
+ * @param curContext
+ * @return PacketCollection
+ */
+ private static PacketCollection getPacketCollectionOneNode(Node node,
+ Context curContext) {
+
+ curContext.setLinkTag(false);
+ curContext.setStartSelect(false);
+ curContext.setStringOutput(true);
+ switch (node.getNodeType()) {
+ case Node.ELEMENT_NODE:
+ // String n = node.getNodeName();
+ PacketCollection result = getPacketCollectionOneElement(
+ (Element) node, curContext);
+ return result;
+
+ case Node.TEXT_NODE:
+ try {
+ String curNodeValue = node.getNodeValue();
+ curNodeValue = TextUtil.trim(curNodeValue);
+ curNodeValue = TextUtil.replace(new StringBuffer(curNodeValue))
+ .toString();
+ curNodeValue = TextUtil.substitute(curNodeValue, " ", " ");
+ if (curNodeValue.indexOf("<!") >= 0
+ || curNodeValue.indexOf("<%") >= 0
+ || curNodeValue.length() == 0) {
+ return null;
+ } else {
+ curContext.setLineDelimiter(false);
+ return new PacketCollection(new Packet(node, curNodeValue,
+ curContext, true));
+ }
+ } catch (NullPointerException npe) {
+ return null;
+ }
+ default:
+ break;
+ }
+ return null;
+ }
+
+ // renderers for every Tag
+ private static Map<String, IElementRenderer> elementMap = new HashMap<String, IElementRenderer>();
+
+ static final int IMG_ELEMENT = 0;
+
+ static final int A_ELEMENT = 1;
+
+ private static IElementRenderer defaultRenderer = new StaticDefaultRenderer();
+ static {
+ elementMap.put("img", new StaticIMGRenderer());
+ elementMap.put("a", new StaticARenderer());
+ elementMap.put("td", new StaticTDRenderer());
+ elementMap.put("form", new StaticFORMRenderer());
+ elementMap.put("select", new StaticSELECTRenderer());
+ elementMap.put("input", new StaticINPUTRenderer());
+ elementMap.put("br", new StaticBRRenderer());
+ elementMap.put("table", new StaticTABLERenderer());
+ elementMap.put("area", new StaticAREARenderer());
+ elementMap.put("map", new StaticMAPRenderer());
+ elementMap.put("head", new StaticNoRenderer());
+ elementMap.put("script", new StaticNoRenderer());
+ elementMap.put("noscript", new StaticNoRenderer());
+ elementMap.put("tr", new StaticTRRenderer());
+ elementMap.put("tbody", new StaticTRRenderer());
+ elementMap.put("p", new StaticPRenderer());
+ elementMap.put("th", new StaticTDRenderer());
+ elementMap.put("div", new StaticTDRenderer());
+ elementMap.put("li", new StaticTDRenderer());
+ elementMap.put("h1", new StaticHRenderer());
+ elementMap.put("h2", new StaticHRenderer());
+ elementMap.put("h3", new StaticHRenderer());
+ elementMap.put("h4", new StaticHRenderer());
+ elementMap.put("h5", new StaticHRenderer());
+ elementMap.put("h6", new StaticHRenderer());
+ elementMap.put("abbr", new StaticABBRRenderer());
+ elementMap.put("acronym", new StaticABBRRenderer());
+ elementMap.put("option", new StaticOPTIONRenderer());
+ elementMap.put("textarea", new StaticTEXTAREARenderer());
+ }
+
+ /**
+ * Method getPacketCollectionOneElement.
+ *
+ * @param element
+ * @param curContext
+ * @return PacketCollection
+ */
+ private static PacketCollection getPacketCollectionOneElement(
+ Element element, Context curContext) {
+ PacketCollection result = null;
+ try {
+ result = getElementRenderer(element).getPacketCollectionIn(element,
+ curContext, uriPrefix, mc);
+ return result;
+ } catch (NullPointerException npe) {
+ return null;
+ }
+ }
+
+ /**
+ * Method getElementRenderer.
+ *
+ * @param element
+ * @return AbstractElementRenderer
+ */
+ private static IElementRenderer getElementRenderer(Element element) {
+ String nodeName = element.getNodeName().toLowerCase();
+ IElementRenderer renderer = null;
+ renderer = (IElementRenderer) elementMap.get(nodeName);
+ if (renderer == null)
+ renderer = defaultRenderer;
+ return renderer;
+ }
+
+ /**
+ * Method getNodePosition.
+ *
+ * @param node
+ * @param pc
+ * @return int
+ */
+ public int getNodePosition(Node node, PacketCollection pc) {
+ if (pc == null)
+ return 0;
+
+ try {
+ Context curContext = new Context();
+ PacketCollection p = new PacketCollection();
+ Node curReadNode = node;
+ Stack<Node> parentsStack = getCurrentParentsStack(node);
+ while (curReadNode != null) {
+ PacketCollection tmp = getPacketCollectionOneNode(curReadNode,
+ curContext);
+ if (tmp != null) {
+ p.addAll(tmp);
+ break;
+ }
+ curReadNode = goNext(curReadNode, curContext, parentsStack, p);
+ }
+
+ int size = pc.size();
+ Node n = ((Packet) p.get(0)).getNode();
+ for (int i = 0; i < size; i++) {
+ if (n == ((Packet) pc.get(i)).getNode()) {
+ return i;
+ }
+ }
+ return 0;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return 0;
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ return 0;
+ }
+ }
+
+ /**
+ * Method getAnchorPosition.
+ *
+ * @param anchorName
+ * @param pc
+ * @return int
+ */
+ public int getAnchorPosition(String anchorName, Node topNode,
+ PacketCollection pc) {
+ if (pc == null)
+ return 0;
+
+ try {
+ int pos = 0;
+ Node node = null;
+ NodeList aTags = ((Element) topNode).getElementsByTagName("a");
+ for (int i = 0; i < aTags.getLength(); i++) {
+ node = aTags.item(i);
+ NamedNodeMap attrs = node.getAttributes();
+ Node typeNode = attrs.getNamedItem("name");
+ if (typeNode != null) {
+ String name = typeNode.getNodeValue();
+ if (anchorName.equals(name)) {
+ break;
+ }
+ }
+ }
+
+ if (node != null)
+ pos = getNodePosition(node, pc);
+
+ return pos;
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ return 0;
+ }
+ }
+
+ /**
+ * Method getHrefString.
+ *
+ * @param node
+ * @return String
+ */
+ public String getHrefString(Node node) {
+ String href = null;
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && (node.getNodeName().toLowerCase().equals("a") || node
+ .getNodeName().toLowerCase().equals("area"))) {
+ NamedNodeMap attrs = node.getAttributes();
+ Node typeNode = attrs.getNamedItem("href");
+ if (typeNode != null) {
+ href = typeNode.getNodeValue();
+ }
+ }
+ return href;
+ }
+
+ /**
+ * Method getJumpTargetNode.
+ *
+ * @param node
+ * @return Node
+ */
+ public Node getTargetNode(Node node, Node topNode) {
+ String href = getHrefString(node);
+ if (href != null && href.length() > 0) {
+ if (href.charAt(0) == '#') {
+ String targetStr = href.substring(1, href.length());
+ if (node != null) {
+ NodeList aTags = ((Element) topNode)
+ .getElementsByTagName("a");
+ for (int i = 0; i < aTags.getLength(); i++) {
+ Node n = aTags.item(i);
+ NamedNodeMap attrs = n.getAttributes();
+ Node typeNode = attrs.getNamedItem("name");
+ if (typeNode != null) {
+ String name = typeNode.getNodeValue();
+ if (targetStr.equals(name))
+ return n;
+ }
+ }
+ }
+ return node;
+ }
+ return null;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Sets the uriPrefix.
+ *
+ * @param uriPrefix
+ * The uriPrefix to set
+ */
+ public static void setUriPrefix(String uriPrefix) {
+ JWATCore.uriPrefix = uriPrefix;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/Message.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/Message.java
new file mode 100644
index 0000000..ead3dff
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/Message.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import java.util.ArrayList;
+
+public class Message {
+
+ private String tagName;
+ private ArrayList conditions = new ArrayList();
+ private String tagType;
+ private String tagState;
+ private ArrayList messages = new ArrayList();
+
+ public Message(
+ String curTagName,
+ ArrayList curConditions,
+ String curTagType,
+ String curTagState,
+ ArrayList curMessages) {
+ tagName = curTagName;
+ conditions = curConditions;
+ tagType = curTagType;
+ tagState = curTagState;
+ messages = curMessages;
+ }
+ /**
+ * Returns the tagName.
+ * @return String
+ */
+ public String getTagName() {
+ return tagName;
+ }
+
+ /**
+ * Returns the tagState.
+ * @return String
+ */
+ public String getTagState() {
+ return tagState;
+ }
+
+ /**
+ * Returns the tagType.
+ * @return String
+ */
+ public String getTagType() {
+ return tagType;
+ }
+
+ /**
+ * Sets the tagName.
+ * @param tagName The tagName to set
+ */
+ public void setTagName(String tagName) {
+ this.tagName = tagName;
+ }
+
+ /**
+ * Sets the tagState.
+ * @param tagState The tagState to set
+ */
+ public void setTagState(String tagState) {
+ this.tagState = tagState;
+ }
+
+ /**
+ * Sets the tagType.
+ * @param tagType The tagType to set
+ */
+ public void setTagType(String tagType) {
+ this.tagType = tagType;
+ }
+
+ /**
+ * Returns the messages.
+ * @return ArrayList
+ */
+ public ArrayList getMessages() {
+ return messages;
+ }
+
+ /**
+ * Sets the messages.
+ * @param messages The messages to set
+ */
+ public void setMessages(ArrayList messages) {
+ this.messages = messages;
+ }
+
+ /**
+ * Returns the conditions.
+ * @return ArrayList
+ */
+ public ArrayList getConditions() {
+ return conditions;
+ }
+
+ /**
+ * Sets the conditions.
+ * @param conditions The conditions to set
+ */
+ public void setConditions(ArrayList conditions) {
+ this.conditions = conditions;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/MessageCollection.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/MessageCollection.java
new file mode 100644
index 0000000..a74d794
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/MessageCollection.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import java.util.ArrayList;
+
+public class MessageCollection extends ArrayList<Message> {
+ /**
+ * Method MessageCollection.
+ * @param text
+ */
+ public MessageCollection(Message text) {
+ super();
+ add(text);
+ }
+
+ /**
+ * @see java.lang.Object#Object()
+ */
+ public MessageCollection() {
+ super();
+ }
+
+ /**
+ * Method getText.
+ * @return String
+ */
+ public String getText() {
+ return "";
+ }
+
+ /**
+ * Method add.
+ * @param p
+ * @return boolean
+ */
+ public boolean add(Message p) {
+ return super.add(p);
+ }
+
+ /**
+ * Method addAll.
+ * @param c
+ * @return boolean
+ */
+ public boolean addAll(MessageCollection c) {
+ return super.addAll(c);
+ }
+
+ /**
+ * Method getMessage.
+ * @param mc
+ * @param nodename
+ * @param type
+ * @param state
+ * @return Message
+ */
+ public Message getMessage(
+ MessageCollection mc,
+ String nodename,
+ String type,
+ String state) {
+ Message msg = null;
+ if (mc != null && mc.size() > 0) {
+ for (int i = 0; i < mc.size(); i++) {
+ msg = (Message) mc.get(i);
+ if (nodename.toLowerCase().equals(msg.getTagName())) {
+ if ((type == null && msg.getTagType() == null)
+ || (type != null
+ && type.toLowerCase().equals(msg.getTagType()))) {
+ if ((state == null && msg.getTagState() == null)
+ || (state != null
+ && state.toLowerCase().equals(
+ msg.getTagState()))) {
+ return msg;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/OutLoud.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/OutLoud.java
new file mode 100644
index 0000000..535838a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/OutLoud.java
@@ -0,0 +1,850 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.JWATController;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
+
+public class OutLoud {
+
+ public static int jwat_mode = JWATController.HPR_MODE;
+ public static boolean hprDefltMsg = true;
+ public static String name = "default";
+ public static String description = null;
+ public static String topofpage = null;
+ public static String endofpage = null;
+ public static String nocurlink = null;
+ public static String noprevlink = null;
+ public static String nonextlink = null;
+ public static String nostring = null;
+ public static String notonalink = null;
+
+ /**
+ * Method createMessageCollection.
+ * @param mode
+ * @param xmlpath
+ * @return MessageCollection
+ */
+ public static MessageCollection createMessageCollection(
+ int mode,
+ String xmlpath) {
+ MessageCollection mc = null;
+ if (xmlpath != null && xmlpath.length() > 0) {
+ mc = createSiteMessageCollection(xmlpath);
+ mc = createApplMessageCollection(mc, mode, xmlpath);
+ }
+ return mc;
+ }
+
+ /**
+ * Method createSiteMessageCollection.
+ * @param xmlpath
+ * @return MessageCollection
+ */
+ private static MessageCollection createSiteMessageCollection(String xmlpath) {
+ MessageCollection mc = new MessageCollection();
+
+ String path = xmlpath + File.separator;
+ String uriPrefix = null;
+ try {
+ File dir = new File(xmlpath);
+ String ls[] = dir.list();
+ for (int i = 0; i < ls.length; i++) {
+ if (ls[i].toLowerCase().startsWith("jwat_site_")
+ && ls[i].toLowerCase().endsWith(".xml")) {
+ String f = path + ls[i];
+
+ InputSource inputSource = new InputSource(new FileReader(f));
+ DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = dbfactory.newDocumentBuilder();
+ Document document = builder.parse(inputSource);
+
+ Node curReadNode = document;
+
+ while (curReadNode != null) {
+ if (curReadNode.getNodeType() == Node.ELEMENT_NODE) {
+ if (curReadNode
+ .getNodeName()
+ .toLowerCase()
+ .equals("outloud-message")) {
+ int num =
+ curReadNode.getAttributes().getLength();
+ if (num > 0) {
+ Attr attribute =
+ (Attr) curReadNode
+ .getAttributes()
+ .item(
+ 0);
+ uriPrefix = attribute.getNodeValue();
+ }
+
+ } else if (
+ curReadNode.getNodeName().toLowerCase().equals(
+ "tag")) {
+ if (curReadNode.getAttributes() != null
+ && curReadNode.getAttributes().getLength()
+ > 0) {
+ int num =
+ curReadNode.getAttributes().getLength();
+ for (int j = 0; j < num; j++) {
+ Attr attribute =
+ (Attr) curReadNode
+ .getAttributes()
+ .item(
+ j);
+ if (attribute
+ .getNodeName()
+ .toLowerCase()
+ .equals("name")) {
+ MessageCollection tmp =
+ buildMessageCollection(
+ curReadNode,
+ uriPrefix);
+ if (tmp != null)
+ mc.addAll(tmp);
+ break;
+ }
+ }
+ }
+ }
+ }
+ curReadNode = goNext(curReadNode);
+ }
+
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ return null;
+ }
+
+ return mc;
+ }
+
+ /**
+ * Method createMessageCollection.
+ * @param filename
+ * @return MessageCollection
+ */
+ private static MessageCollection createApplMessageCollection(
+ MessageCollection result,
+ int mode,
+ String xmlpath) {
+
+ String path = xmlpath + File.separator;
+ Document document;
+ try {
+ String dtdpath = path + "jwat.dtd";
+ if (mode == JWATController.HPR_MODE) {
+ path += "jwat_hpr.xml";
+ } else if (mode == JWATController.JAWS_MODE) {
+ path += "jwat_jaws.xml";
+ }
+ File f = new File(path);
+ File d = new File(dtdpath);
+ if (f.exists() && d.exists()) {
+ InputSource inputSource = new InputSource(new FileReader(path));
+ DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = dbfactory.newDocumentBuilder();
+ document = builder.parse(inputSource);
+ } else {
+ name = "default";
+ return null;
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ name = "default";
+ return null;
+ }
+
+ jwat_mode = mode;
+ Node curReadNode = document;
+ hprDefltMsg = true;
+
+ while (curReadNode != null) {
+ if (curReadNode.getNodeType() == Node.ELEMENT_NODE) {
+ if (curReadNode.getNodeName().toLowerCase().equals("name")) {
+ curReadNode = goNext(curReadNode);
+ name = getString(curReadNode);
+ } else if (
+ curReadNode.getNodeName().toLowerCase().equals(
+ "description")) {
+ curReadNode = goNext(curReadNode);
+ description = getString(curReadNode);
+ } else if (
+ curReadNode.getNodeName().equals(
+ "disableDefaultMessage")) {
+ hprDefltMsg = false;
+ } else if (curReadNode.getNodeName().equals("TopOfPage")) {
+ curReadNode = goNext(curReadNode);
+ topofpage = getString(curReadNode);
+ } else if (curReadNode.getNodeName().equals("EndOfPage")) {
+ curReadNode = goNext(curReadNode);
+ endofpage = getString(curReadNode);
+ } else if (curReadNode.getNodeName().equals("NoCurLink")) {
+ curReadNode = goNext(curReadNode);
+ nocurlink = getString(curReadNode);
+ } else if (curReadNode.getNodeName().equals("NoPrevLink")) {
+ curReadNode = goNext(curReadNode);
+ noprevlink = getString(curReadNode);
+ } else if (curReadNode.getNodeName().equals("NoNextLink")) {
+ curReadNode = goNext(curReadNode);
+ nonextlink = getString(curReadNode);
+ } else if (curReadNode.getNodeName().equals("NoString")) {
+ curReadNode = goNext(curReadNode);
+ nostring = getString(curReadNode);
+ } else if (curReadNode.getNodeName().equals("NotOnALink")) {
+ curReadNode = goNext(curReadNode);
+ notonalink = getString(curReadNode);
+ } else if (
+ curReadNode.getNodeName().toLowerCase().equals("tag")) {
+ if (curReadNode.getAttributes() != null
+ && curReadNode.getAttributes().getLength() > 0) {
+ int num = curReadNode.getAttributes().getLength();
+ for (int i = 0; i < num; i++) {
+ Attr attribute =
+ (Attr) curReadNode.getAttributes().item(i);
+ if (attribute
+ .getNodeName()
+ .toLowerCase()
+ .equals("name")) {
+ MessageCollection tmp =
+ buildMessageCollection(curReadNode, null);
+ if (tmp != null)
+ result.addAll(tmp);
+ break;
+ }
+ }
+ }
+ }
+ }
+ curReadNode = goNext(curReadNode);
+ }
+ return result;
+ }
+
+ /**
+ * Method getString.
+ * @param node
+ * @return String
+ */
+ private static String getString(Node node) {
+ String str = null;
+ if (node.getNodeType() == Node.TEXT_NODE)
+ str = node.getNodeValue();
+ return str;
+ }
+
+ /**
+ * Method buildMessageCollection.
+ * @param node
+ * @return MessageCollection
+ */
+ private static MessageCollection buildMessageCollection(
+ Node node,
+ String uri) {
+ String tagName = null;
+ String tagType = null;
+ String tagState = null;
+ int num = node.getAttributes().getLength();
+ for (int i = 0; i < num; i++) {
+ Attr attribute = (Attr) node.getAttributes().item(i);
+ if (attribute.getNodeName().toLowerCase().equals("name")) {
+ tagName = attribute.getNodeValue();
+ } else if (attribute.getNodeName().toLowerCase().equals("type")) {
+ tagType = attribute.getNodeValue();
+ } else if (attribute.getNodeName().toLowerCase().equals("state")) {
+ tagState = attribute.getNodeValue();
+ }
+ }
+
+ ArrayList<String> msgs = new ArrayList<String>();
+ ArrayList<String> conditions = new ArrayList<String>();
+
+ if (msgs != null)
+ msgs.clear();
+
+ if (conditions != null)
+ conditions.clear();
+
+ node = goNext(node);
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ if (node.getNodeName().toLowerCase().equals("condition")) {
+ conditions.add(uri);
+ node = goNext(node);
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("msg")) {
+ break;
+ } else if (
+ node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals(
+ "attribute")) {
+ num = node.getAttributes().getLength();
+ if (num == 1) {
+ Attr attribute =
+ (Attr) node.getAttributes().item(0);
+ String s = attribute.getNodeValue();
+ if (s != null && s.length() > 0) {
+ node = goNext(node);
+ if (node.getNodeType() == Node.TEXT_NODE) {
+ String t = node.getNodeValue().trim();
+ if (t != null && t.length() > 0) {
+ String r = s + "=" + t;
+ conditions.add(r);
+ }
+ }
+ }
+ }
+ }
+ node = goNext(node);
+ }
+ } else if (node.getNodeName().toLowerCase().equals("msg")) {
+ // msgs
+ node = goNext(node);
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ if (node.getNodeName().toLowerCase().equals("msg"))
+ break;
+ else if (
+ node.getNodeName().toLowerCase().equals(
+ "var")) {
+ String s = "<var>";
+ num = node.getAttributes().getLength();
+ for (int i = 0; i < num; i++) {
+ Attr attribute =
+ (Attr) node.getAttributes().item(i);
+ String value = attribute.getNodeValue();
+ s += ",<"
+ + attribute.getNodeName().toLowerCase()
+ + "="
+ + value
+ + ">";
+ }
+ if (s.length() > 0) {
+ msgs.add(s);
+ }
+ }
+ } else if (node.getNodeType() == Node.TEXT_NODE) {
+ // String t = node.getNodeValue().trim();
+ String t = node.getNodeValue();
+ if (t.length() > 0) {
+ msgs.add(t);
+ }
+ if (node.getNextSibling() == null)
+ break;
+ }
+ node = goNext(node);
+ }
+ } else if (node.getNodeName().toLowerCase().equals("tag")) {
+ break;
+ }
+ }
+ if (!node.getNodeName().toLowerCase().equals("msg"))
+ node = goNext(node);
+ }
+ return new MessageCollection(
+ new Message(tagName, conditions, tagType, tagState, msgs));
+ }
+
+ /**
+ * Method goNext.
+ * @param curReadNode
+ * @return Node
+ */
+ private static Node goNext(Node curReadNode) {
+ if (curReadNode == null)
+ return null;
+
+ if (curReadNode.hasChildNodes()) {
+ // Has Child
+ return curReadNode.getFirstChild();
+
+ } else if (curReadNode.getNextSibling() != null) {
+ // Has Brother
+ return curReadNode.getNextSibling();
+ } else {
+ // Check Parent
+ if (curReadNode.getParentNode() != null) {
+ Node node = curReadNode.getParentNode();
+ curReadNode = node.getNextSibling();
+ } else
+ curReadNode = null;
+ return curReadNode;
+ }
+ }
+
+ /**
+ * Method dumpMessages.
+ * @param mc
+ */
+ public static void dumpMessages(MessageCollection mc) {
+ if (mc == null)
+ return;
+
+ System.out.println("Mode name is [" + OutLoud.name + "]");
+ System.out.println("Mode description [" + OutLoud.description + "]");
+ System.out.println(" TopOfPage is [" + OutLoud.topofpage + "]");
+ System.out.println(" EndOfPage is [" + OutLoud.endofpage + "]");
+ System.out.println(" NoCurLink is [" + OutLoud.nocurlink + "]");
+ System.out.println(" NoPrevLink is [" + OutLoud.noprevlink + "]");
+ System.out.println(" NoNextLink is [" + OutLoud.nonextlink + "]");
+ System.out.println(" NoString is [" + OutLoud.nostring + "]");
+ System.out.println(" NotOnALink is [" + OutLoud.notonalink + "]");
+
+ if (mc != null && mc.size() > 0) {
+ for (int i = 0; i < mc.size(); i++) {
+ String n = ((Message) mc.get(i)).getTagName();
+ String t = ((Message) mc.get(i)).getTagType();
+ String s = ((Message) mc.get(i)).getTagState();
+ System.out.println(
+ "tag[" + n + "] - type[" + t + "] - state[" + s + "]");
+ ArrayList conditions = ((Message) mc.get(i)).getConditions();
+ for (int j = 0; j < conditions.size(); j++) {
+ System.out.println(" C[" + conditions.get(j) + "]");
+ }
+ ArrayList msgs = ((Message) mc.get(i)).getMessages();
+ for (int j = 0; j < msgs.size(); j++) {
+ System.out.println(" T[" + msgs.get(j) + "]");
+ }
+ }
+ }
+ }
+
+ /**
+ * Method buildResultString.
+ * @param mc
+ * @param element
+ * @param type
+ * @param state
+ * @return String
+ */
+ public static String buildResultString(
+ MessageCollection mc,
+ String url,
+ Element element,
+ String type,
+ String state) {
+ String nodeName = element.getNodeName().toLowerCase();
+ String result = null;
+ ArrayList msgs = null;
+ ArrayList conditions = null;
+
+ if (mc == null)
+ return null;
+
+ result = getSiteSpecificMessage(mc, element, url);
+ if (result != null && result.length() > 0)
+ return result;
+
+ Message msg = mc.getMessage(mc, nodeName, type, state);
+
+ if (msg != null) {
+ msgs = msg.getMessages();
+ conditions = msg.getConditions();
+ }
+ if (msg != null) {
+ String s = null;
+ for (int i = 0; i < msgs.size(); i++) {
+ if (conditions.size() > 0)
+ continue;
+ s = (String) msgs.get(i);
+ if (s.startsWith("<var>")) {
+ String pattern0 = "<attribute=";
+ int pos = s.lastIndexOf(pattern0);
+ if (pos > 0) {
+ s = s.substring(pos + pattern0.length());
+ s = s.substring(0, s.indexOf(">"));
+ if (s.length() > 0) {
+ NamedNodeMap attrs = element.getAttributes();
+ String value = null;
+ Node altNode = attrs.getNamedItem(s);
+ value = altNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ if (result == null)
+ result = value;
+ else
+ result += value;
+ }
+ }
+ }
+ } else {
+ if (result == null)
+ result = s;
+ else
+ result += s;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Method buildResultString.
+ * @param mc
+ * @param element
+ * @param type
+ * @param state
+ * @param pattern1
+ * @param replstr1
+ * @return String
+ */
+ public static String buildResultString(
+ MessageCollection mc,
+ String url,
+ Element element,
+ String type,
+ String state,
+ String pattern1,
+ String replstr1) {
+ String nodeName = element.getNodeName().toLowerCase();
+ String result = null;
+ ArrayList msgs = null;
+ ArrayList conditions = null;
+
+ if (mc == null)
+ return null;
+
+ result = getSiteSpecificMessage(mc, element, url);
+ if (result != null && result.length() > 0)
+ return result;
+
+ Message msg = mc.getMessage(mc, nodeName, type, state);
+
+ if (msg != null) {
+ msgs = msg.getMessages();
+ conditions = msg.getConditions();
+ }
+ if (msg != null) {
+ String s = null;
+ for (int i = 0; i < msgs.size(); i++) {
+ if (conditions.size() > 0)
+ continue;
+ s = (String) msgs.get(i);
+ if (s.startsWith("<var>")) {
+ String pattern0 = "<attribute=";
+ int pos = s.lastIndexOf(pattern0);
+ if (pos > 0) {
+ s = s.substring(pos + pattern0.length());
+ s = s.substring(0, s.indexOf(">"));
+ if (s.length() > 0) {
+ NamedNodeMap attrs = element.getAttributes();
+ String value = null;
+ Node altNode = attrs.getNamedItem(s);
+ value = altNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ if (result == null)
+ result = value;
+ else
+ result += value;
+ }
+ }
+ }
+ pos = s.lastIndexOf(pattern1);
+ if (pos > 0) {
+ if (result == null)
+ result = replstr1;
+ else
+ result += replstr1;
+ }
+ } else {
+ if (result == null)
+ result = s;
+ else
+ result += s;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Method buildResultString.
+ * @param mc
+ * @param element
+ * @param type
+ * @param state
+ * @param pattern1
+ * @param replstr1
+ * @param pattern2
+ * @param replstr2
+ * @return String
+ */
+ public static String buildResultString(
+ MessageCollection mc,
+ String url,
+ Element element,
+ String type,
+ String state,
+ String pattern1,
+ String replstr1,
+ String pattern2,
+ String replstr2) {
+ String nodeName = element.getNodeName().toLowerCase();
+ String result = null;
+ ArrayList msgs = null;
+ ArrayList conditions = null;
+
+ if (mc == null)
+ return null;
+
+ result = getSiteSpecificMessage(mc, element, url);
+ if (result != null && result.length() > 0)
+ return result;
+
+ Message msg = mc.getMessage(mc, nodeName, type, state);
+
+ if (msg != null) {
+ msgs = msg.getMessages();
+ conditions = msg.getConditions();
+ }
+ if (msg != null) {
+ String s = null;
+ for (int i = 0; i < msgs.size(); i++) {
+ if (conditions.size() > 0)
+ continue;
+ s = (String) msgs.get(i);
+ if (s.startsWith("<var>")) {
+ String pattern0 = "<attribute=";
+ int pos = s.lastIndexOf(pattern0);
+ if (pos > 0) {
+ s = s.substring(pos + pattern0.length());
+ s = s.substring(0, s.indexOf(">"));
+ if (s.length() > 0) {
+ NamedNodeMap attrs = element.getAttributes();
+ String value = null;
+ Node altNode = attrs.getNamedItem(s);
+ value = altNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ if (result == null)
+ result = value;
+ else
+ result += value;
+ }
+ }
+ }
+ pos = s.lastIndexOf(pattern1);
+ if (pos > 0) {
+ if (result == null)
+ result = replstr1;
+ else
+ result += replstr1;
+ }
+ pos = s.lastIndexOf(pattern2);
+ if (pos > 0) {
+ if (result == null)
+ result = replstr2;
+ else
+ result += replstr2;
+ }
+ } else {
+ if (result == null)
+ result = s;
+ else
+ result += s;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Method buildResultString.
+ * @param mc
+ * @param element
+ * @param type
+ * @param state
+ * @param pattern1
+ * @param replstr1
+ * @param pattern2
+ * @param replstr2
+ * @param pattern3
+ * @param replstr3
+ * @return String
+ */
+ public static String buildResultString(
+ MessageCollection mc,
+ String url,
+ Element element,
+ String type,
+ String state,
+ String pattern1,
+ String replstr1,
+ String pattern2,
+ String replstr2,
+ String pattern3,
+ String replstr3) {
+ String nodeName = element.getNodeName().toLowerCase();
+ String result = null;
+ ArrayList msgs = null;
+ ArrayList conditions = null;
+
+ if (mc == null)
+ return null;
+
+ result = getSiteSpecificMessage(mc, element, url);
+ if (result != null && result.length() > 0)
+ return result;
+
+ Message msg = mc.getMessage(mc, nodeName, type, state);
+
+ if (msg != null) {
+ msgs = msg.getMessages();
+ conditions = msg.getConditions();
+ }
+ if (msg != null) {
+ String s = null;
+ for (int i = 0; i < msgs.size(); i++) {
+ if (conditions.size() > 0)
+ continue;
+ s = (String) msgs.get(i);
+ if (s.startsWith("<var>")) {
+ String pattern0 = "<attribute=";
+ int pos = s.lastIndexOf(pattern0);
+ if (pos > 0) {
+ s = s.substring(pos + pattern0.length());
+ s = s.substring(0, s.indexOf(">"));
+ if (s.length() > 0) {
+ NamedNodeMap attrs = element.getAttributes();
+ String value = null;
+ Node altNode = attrs.getNamedItem(s);
+ value = altNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ if (result == null)
+ result = value;
+ else
+ result += value;
+ }
+ }
+ }
+ pos = s.lastIndexOf(pattern1);
+ if (pos > 0) {
+ if (result == null)
+ result = replstr1;
+ else
+ result += replstr1;
+ }
+ pos = s.lastIndexOf(pattern2);
+ if (pos > 0) {
+ if (result == null)
+ result = replstr2;
+ else
+ result += replstr2;
+ }
+ pos = s.lastIndexOf(pattern3);
+ if (pos > 0) {
+ if (result == null)
+ result = replstr3;
+ else
+ result += replstr3;
+ }
+ } else {
+ if (result == null)
+ result = s;
+ else
+ result += s;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Method getSiteSpecificMessage.
+ * @param mc
+ * @param element
+ * @param url
+ * @return String
+ */
+ private static String getSiteSpecificMessage(
+ MessageCollection mc,
+ Element element,
+ String url) {
+ String result = null;
+ Message msg = null;
+
+ if (mc != null && mc.size() > 0) {
+ for (int i = 0; i < mc.size(); i++) {
+ msg = (Message) mc.get(i);
+ String nodename = null;
+ if (element != null
+ && element.getNodeType() == Node.ELEMENT_NODE)
+ nodename = element.getNodeName().toLowerCase();
+
+ if (nodename != null && nodename.equals(msg.getTagName())) {
+ ArrayList conditions = msg.getConditions();
+ ArrayList msgs = msg.getMessages();
+
+ // check url condition
+ if (conditions != null && conditions.size() > 0) {
+ boolean found = false;
+ if (url.equals((String) conditions.get(0))) {
+ for (int k = 1; k < conditions.size(); k++) {
+ String attname = null;
+ String value = null;
+ String a = null;
+ String v = null;
+ found = false;
+
+ String s = (String) conditions.get(k);
+ attname = s.substring(0, s.indexOf("="));
+ value =
+ s.substring(s.indexOf("=") + 1, s.length());
+
+ int num = element.getAttributes().getLength();
+ if (num > 0) {
+ for (int m = 0; m < num; m++) {
+ Attr attribute =
+ (Attr) element
+ .getAttributes()
+ .item(
+ m);
+ v = attribute.getNodeValue();
+ a = attribute.getNodeName();
+ if (attname.equals(a)
+ && value.equals(v)) {
+ found = true;
+ break;
+ }
+ }
+ }
+ }
+ if (found == true) {
+ for (int j = 0; j < msgs.size(); j++) {
+ if (j == 0)
+ result = (String) msgs.get(j);
+ else
+ result += (String) msgs.get(j);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticABBRRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticABBRRenderer.java
new file mode 100644
index 0000000..6cdcf52
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticABBRRenderer.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+public class StaticABBRRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, CurrentCursor, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, curContext);
+
+ // get alt attribute
+ NamedNodeMap attrs = element.getAttributes();
+ Node node = attrs.getNamedItem("title");
+ if (node == null)
+ return null;
+
+ // get title string
+ String str = node.getNodeValue();
+ str = TextUtil.trim(str);
+ if (str.length() == 0)
+ return null;
+
+ // build result string
+ String result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ null,
+ null,
+ "<name=str1>",
+ str);
+ if (result == null && OutLoud.hprDefltMsg) {
+ if (element.getNodeName().toLowerCase().equals("abbr"))
+ result = "(Abbreviation: " + str + ".)";
+ else
+ result = "(Acronym: " + str + ".)";
+ }
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, CurrentCursor, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ setContextOut(element, curContext);
+
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticAREARenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticAREARenderer.java
new file mode 100644
index 0000000..7d19e30
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticAREARenderer.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.JWATController;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+
+public class StaticAREARenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, ctx);
+ ctx.setStringOutput(false);
+ if (OutLoud.jwat_mode == JWATController.JAWS_MODE)
+ ctx.setStringOutput(true);
+
+ // get alt attribute
+ NamedNodeMap attrs = element.getAttributes();
+ Node altNode = attrs.getNamedItem("alt");
+ if (altNode == null)
+ return null;
+
+ // get alt string
+ String altstr = altNode.getNodeValue();
+ altstr = TextUtil.trim(altstr);
+ if (altstr.length() == 0)
+ return null;
+
+ // build result string
+ String result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ null,
+ null,
+ "<name=str1>",
+ altstr);
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "[" + altstr + ".]";
+
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(new Packet(element, result, ctx, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, ctx);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context ctx) {
+ ctx.setGoChild(true);
+ ctx.setLineDelimiter(true);
+ ctx.setLinkTag(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context ctx) {
+ ctx.setGoChild(true);
+ ctx.setLineDelimiter(false);
+ ctx.setLinkTag(false);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticARenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticARenderer.java
new file mode 100644
index 0000000..1ae603f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticARenderer.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+public class StaticARenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ setContextIn(element, curContext);
+ try {
+ // check if `a' element has `href' attribute
+ NamedNodeMap attrs = element.getAttributes();
+ Node hrefNode = attrs.getNamedItem("href");
+ String result = null;
+ if (hrefNode == null) {
+ curContext.setLinkTag(false);
+ } else {
+ String link = hrefNode.getNodeValue();
+ if (link != null
+ && link.length() > 0
+ && link.charAt(0) == '#') {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "internallink",
+ null);
+ } else {
+ result =
+ OutLoud.buildResultString(mc, url, element, null, null);
+ }
+ if (result != null)
+ result = result.trim();
+ }
+
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ } catch (NullPointerException npe) {
+ return null;
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+ return new PacketCollection(new Packet(element, "", curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setInsideAnchor(true);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setInsideAnchor(false);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticBRRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticBRRenderer.java
new file mode 100644
index 0000000..485cff8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticBRRenderer.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+public class StaticBRRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ if (curContext.isLineDelimiter()) {
+ setContextIn(element, curContext);
+ return null;
+ } else {
+ setContextIn(element, curContext);
+ Packet newPacket = new Packet(element, "", curContext, true);
+ return new PacketCollection(newPacket);
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticDefaultRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticDefaultRenderer.java
new file mode 100644
index 0000000..690fda7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticDefaultRenderer.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+
+public class StaticDefaultRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context, MessageCollection)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+
+ String result = OutLoud.buildResultString(mc, url, element, null, null);
+ if (result != null)
+ result = result.trim();
+ if (result != null && result.length() > 0)
+ return new PacketCollection(new Packet(element, result, ctx, true));
+ else
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context, MessageCollection)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticFORMRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticFORMRenderer.java
new file mode 100644
index 0000000..fd338f0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticFORMRenderer.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+public class StaticFORMRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, curContext);
+
+ // get the form number
+ int num = DomUtil.getFormNum(element);
+
+ // build result string
+ String result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "in",
+ null,
+ "name=num1",
+ Integer.toString(num));
+
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(Start of form " + num + ".)";
+
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context out' flags
+ setContextOut(element, curContext);
+
+ // get the form number
+ int num = DomUtil.getFormNum(element);
+
+ // build result string
+ String result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "out",
+ null,
+ "name=num1",
+ Integer.toString(num));
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(End of form " + num + ".)";
+
+ if (result != null)
+ result = result.trim();
+
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setStartSelect(true);
+ curContext.setGoChild(true);
+ curContext.setInsideForm(true);
+ curContext.setLineDelimiter(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setStartSelect(true);
+ curContext.setGoChild(true);
+ curContext.setInsideForm(false);
+ // curContext.setLineDelimiter(false);
+ curContext.setLineDelimiter(true);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticHRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticHRenderer.java
new file mode 100644
index 0000000..78c8494
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticHRenderer.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+
+public class StaticHRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+
+ setContextIn(element, ctx);
+ Packet newPacket = new Packet(element, "", ctx, true);
+ return new PacketCollection(newPacket);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ if (ctx.isLineDelimiter()) {
+ return null;
+ } else {
+ setContextOut(element, ctx);
+ Packet newPacket = new Packet(element, "", ctx, false);
+ return new PacketCollection(newPacket);
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticIMGRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticIMGRenderer.java
new file mode 100644
index 0000000..8f6f935
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticIMGRenderer.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.JWATController;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+
+public class StaticIMGRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ setContextIn(element, curContext);
+
+ // get alt attribute
+ NamedNodeMap attrs = element.getAttributes();
+ Node altNode = attrs.getNamedItem("alt");
+ String altstr = null;
+ if (altNode == null)
+ return null;
+
+ // get alt string
+ altstr = altNode.getNodeValue();
+ altstr = TextUtil.trim(altstr);
+ if (altstr.length() == 0) {
+ if (OutLoud.jwat_mode == JWATController.JAWS_MODE) {
+
+ Node node = element.getParentNode();
+ for (;;) {
+ if (node == null)
+ return null;
+
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("body"))
+ return null;
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("a"))
+ break;
+ node = node.getParentNode();
+ }
+
+ Node srcNode = attrs.getNamedItem("src");
+ if (srcNode != null) {
+ String srcstr = srcNode.getNodeValue();
+ srcstr = TextUtil.trim(srcstr);
+ altstr = srcstr;
+ } else
+ return null;
+ } else
+ return null;
+ }
+
+ // build result string
+ String result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ null,
+ null,
+ "<name=str1>",
+ altstr);
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "[" + altstr + ".]";
+
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticINPUTRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticINPUTRenderer.java
new file mode 100644
index 0000000..4a08df1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticINPUTRenderer.java
@@ -0,0 +1,448 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.JWATController;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+public class StaticINPUTRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ try {
+ setContextIn(element, curContext);
+ NamedNodeMap attrs = element.getAttributes();
+
+ String type = null, result = null;
+ Node typeNode = attrs.getNamedItem("type");
+ if (typeNode != null) {
+ type = typeNode.getNodeValue();
+ if (type.length() > 0) {
+ if (type.equals("image")) {
+ result = inputTypeImage(element, attrs, mc, url);
+ } else if (type.equals("text")) {
+ result = inputTypeText(element, attrs, mc, url);
+ } else if (type.equals("submit")) {
+ result = inputTypeSubmit(element, attrs, mc, url);
+ } else if (type.equals("reset")) {
+ result = inputTypeReset(element, attrs, mc, url);
+ } else if (type.equals("button")) {
+ result = inputTypeButton(element, attrs, mc, url);
+ } else if (type.equals("password")) {
+ result = inputTypePassword(element, attrs, mc, url);
+ } else if (type.equals("checkbox")) {
+ result = inputTypeCheckbox(element, attrs, mc, url);
+ } else if (type.equals("radio")) {
+ result = inputTypeRadio(element, attrs, mc, url);
+ } else if (type.equals("file")) {
+ result = inputTypeFile(element, attrs, mc, url);
+ } else if (type.equals("hidden")) {
+ result = inputTypeHidden(element, attrs, mc, url);
+ }
+ }
+ } else {
+ result = inputTypeText(element, attrs, mc, url);
+ }
+ if (OutLoud.jwat_mode == JWATController.JAWS_MODE) {
+ curContext.setLineDelimiter(true);
+ curContext.setStartSelect(true);
+ }
+ if (result != null) {
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ } else {
+ return null;
+ }
+ } catch (NullPointerException npe) {
+ return null;
+ }
+ }
+
+ /**
+ * Method inputTypeImage.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeImage(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result = null;
+ String value = null;
+ Node valueNode = attrs.getNamedItem("alt");
+ if (valueNode != null) {
+ value = valueNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "image",
+ "hasstr",
+ "name=str1",
+ value);
+ if (result == null)
+ result = "[" + value + ": Image button.]";
+ }
+ }
+ if (value == null) {
+ valueNode = attrs.getNamedItem("src");
+ if (valueNode != null) {
+ value = valueNode.getNodeValue();
+ int scount = 0;
+ for (int j = 0; j < value.length(); j++)
+ if (value.charAt(j) == '/')
+ scount++;
+ if (scount >= 2) {
+ for (int j = 0, cnt = 0; j < value.length(); j++) {
+ if (value.charAt(j) == '/') {
+ cnt++;
+ if (cnt == scount - 1)
+ value = value.substring(j + 1, value.length());
+ }
+ }
+ }
+ }
+ if (value != null && value.length() > 0) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "image",
+ "hasstr",
+ "name=str",
+ value);
+ if (result == null)
+ result = "[" + value + ": Image button.]";
+ } else {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "image",
+ "nostr");
+ if (result == null)
+ result = "[Image button.]";
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Method inputTypeText.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeText(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result =
+ OutLoud.buildResultString(mc, url, element, "text", null);
+ if (result == null)
+ result = "[Text.]";
+ return result;
+ }
+
+ /**
+ * Method inputTypeSubmit.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeSubmit(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result = null;
+ String value = null;
+ Node valueNode = attrs.getNamedItem("VALUE");
+ if (valueNode != null)
+ value = valueNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "submit",
+ "hasstr",
+ "name=str1",
+ value);
+ if (result == null)
+ result = "[" + value + ": Submit button.]";
+ } else {
+ result =
+ OutLoud.buildResultString(mc, url, element, "submit", "nostr");
+ if (result == null)
+ result = "[Submit button.]";
+ }
+ return result;
+ }
+
+ /**
+ * Method inputTypeReset.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeReset(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result = null;
+ String value = null;
+ Node valueNode = attrs.getNamedItem("VALUE");
+ if (valueNode != null)
+ value = valueNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "reset",
+ "hasstr",
+ "name=str1",
+ value);
+ if (result == null)
+ result = "[" + value + ": Reset button.]";
+ } else {
+ result =
+ OutLoud.buildResultString(mc, url, element, "reset", "nostr");
+ if (result == null)
+ result = "[Reset button.]";
+ }
+ return result;
+ }
+
+ /**
+ * Method inputTypeButton.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeButton(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result = null;
+ String value = null;
+ Node valueNode = attrs.getNamedItem("VALUE");
+ if (valueNode != null)
+ value = valueNode.getNodeValue();
+ if (value != null && value.length() > 0) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "button",
+ "hasstr",
+ "name=str1",
+ value);
+ if (result == null)
+ result = "[" + value + ": Button.]";
+ } else {
+ result =
+ OutLoud.buildResultString(mc, url, element, "button", "nostr");
+ if (result == null)
+ result = "[Button.]";
+ }
+ return result;
+ }
+
+ /**
+ * Method inputTypePassword.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypePassword(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result =
+ OutLoud.buildResultString(mc, url, element, "password", null);
+ if (result == null)
+ result = "[Password.]";
+ return result;
+ }
+
+ /**
+ * Method inputTypeCheckbox.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeCheckbox(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result = null;
+ Node cnode = attrs.getNamedItem("checked");
+ if (cnode == null) {
+ result =
+ OutLoud.buildResultString(mc, url, element, "checkbox", "off");
+ if (result == null)
+ result = "[Not Checked.]";
+ } else {
+ result =
+ OutLoud.buildResultString(mc, url, element, "checkbox", "on");
+ if (result == null)
+ result = "[Checked.]";
+ }
+ return result;
+ }
+
+ /**
+ * Method inputTypeRadio.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeRadio(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result = null;
+ Node cnode = attrs.getNamedItem("checked");
+ if (cnode == null) {
+ result =
+ OutLoud.buildResultString(mc, url, element, "radio", "off");
+ if (result == null)
+ result = "[Not Pressed.]";
+ } else {
+ result = OutLoud.buildResultString(mc, url, element, "radio", "on");
+ if (result == null)
+ result = "[Pressed.]";
+ }
+ return result;
+ }
+
+ /**
+ * Method inputTypeFile.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeFile(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ String result =
+ OutLoud.buildResultString(mc, url, element, "file", null);
+ if (result == null)
+ result = "[Browse button.]";
+ return result;
+ }
+
+ /**
+ * Method inputTypeHidden.
+ * @param nodeName
+ * @param attrs
+ * @param mc
+ * @return String
+ */
+ private String inputTypeHidden(
+ Element element,
+ NamedNodeMap attrs,
+ MessageCollection mc,
+ String url) {
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ try {
+ NamedNodeMap attrs = element.getAttributes();
+
+ String type = null;
+ Node typeNode = attrs.getNamedItem("type");
+ if (typeNode != null) {
+ type = typeNode.getNodeValue();
+ if (type.length() > 0) {
+ if (type.equals("submit") || type.equals("reset")) {
+ curContext.setLineDelimiter(true);
+ } else {
+ curContext.setLineDelimiter(false);
+ }
+ } else {
+ curContext.setLineDelimiter(false);
+ }
+ } else {
+ curContext.setLineDelimiter(false);
+ }
+ } catch (NullPointerException npe) {
+ npe.printStackTrace();
+ }
+ curContext.setLinkTag(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticMAPRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticMAPRenderer.java
new file mode 100644
index 0000000..a86bec1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticMAPRenderer.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class StaticMAPRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, ctx);
+
+ // get number of options
+ NodeList children = element.getChildNodes();
+ int num = 0;
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ String nodeName = node.getNodeName().toLowerCase();
+ if (nodeName.equals("area")) {
+ num++;
+ }
+ }
+
+ // select type
+ //String nodeName = element.getNodeName().toLowerCase();
+ String result = null;
+ if (num > 1) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "in",
+ "plural",
+ "<name=num1>",
+ Integer.toString(num));
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(Start of map with " + num + " items.)";
+ } else {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "in",
+ "singular",
+ "<name=num1>",
+ Integer.toString(num));
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(Start of map with 1 item.)";
+ }
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(new Packet(element, result, ctx, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, ctx);
+
+ String result =
+ OutLoud.buildResultString(mc, url, element, "out", null);
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(End of Map.)";
+
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(new Packet(element, result, ctx, false));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context ctx) {
+ ctx.setStartSelect(true);
+ ctx.setGoChild(true);
+ ctx.setLineDelimiter(true);
+ ctx.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context ctx) {
+ ctx.setStartSelect(false);
+ ctx.setGoChild(true);
+ // ctx.setLineDelimiter(false);
+ ctx.setLineDelimiter(true);
+ ctx.setLinkTag(false);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticNoRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticNoRenderer.java
new file mode 100644
index 0000000..aafd123
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticNoRenderer.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+
+public class StaticNoRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextIn(element, curContext);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticOPTIONRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticOPTIONRenderer.java
new file mode 100644
index 0000000..6fce944
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticOPTIONRenderer.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.*;
+
+
+public class StaticOPTIONRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, curContext);
+
+ // build result string
+ String result = null;
+ String selstr = null;
+
+ Node node = element.getFirstChild();
+ if (node != null && node.getNodeType() == Node.TEXT_NODE) {
+ selstr = node.getNodeValue();
+ if (selstr.length() > 0) {
+ selstr = TextUtil.substitute(selstr, "\n", "");
+ selstr = TextUtil.trim(selstr);
+ }
+
+ int selected = 0;
+ NamedNodeMap attList = element.getAttributes();
+ for (int j = 0; j < attList.getLength(); j++) {
+ Attr att = (Attr) attList.item(j);
+ if (att.getName().equals("selected")) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ null,
+ "on",
+ "name=str1",
+ selstr);
+ if (result == null && OutLoud.hprDefltMsg) {
+ result = selstr + " [Selected.]";
+ }
+ selected++;
+ break;
+ }
+ }
+ if (selected == 0) {
+ curContext.setStringOutput(false);
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ null,
+ "off",
+ "name=str1",
+ selstr);
+ if (result == null && OutLoud.hprDefltMsg) {
+ result = selstr + " [Off.]";
+ }
+ }
+ }
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(false);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticPRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticPRenderer.java
new file mode 100644
index 0000000..857ceaa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticPRenderer.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+
+public class StaticPRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ setContextIn(element, ctx);
+ Packet newPacket = new Packet(element, "", ctx, true);
+ return new PacketCollection(newPacket);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+
+ if (ctx.isLineDelimiter()) {
+ return null;
+ } else {
+ setContextOut(element, ctx);
+ Packet newPacket = new Packet(element, "", ctx, false);
+ return new PacketCollection(newPacket);
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticSELECTRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticSELECTRenderer.java
new file mode 100644
index 0000000..9950da5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticSELECTRenderer.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.NamedNodeMap;
+
+public class StaticSELECTRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, curContext);
+
+ // get number of options
+ NodeList children = element.getChildNodes();
+ int num = 0;
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ String nodeName = node.getNodeName().toLowerCase();
+ if (nodeName.equals("option")) {
+ num++;
+ }
+ }
+
+ // check if multiple attribute is set (select type)
+ NamedNodeMap attrs = element.getAttributes();
+ Node multiNode = attrs.getNamedItem("multiple");
+ String type = "select";
+ if (multiNode != null)
+ type = "multi-select";
+
+ // build result string
+
+ String result;
+ if (num > 1) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "in",
+ "plural",
+ "name=str1",
+ type,
+ "name=num1",
+ Integer.toString(num));
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(Start of " + type + " menu with " + num + " items.)";
+ } else {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "in",
+ "singular",
+ "name=str1",
+ type);
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(Start of " + type + " menu with 1 item.)";
+ }
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextOut(element, curContext);
+
+ // build result string
+ String result =
+ OutLoud.buildResultString(mc, url, element, "out", null);
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "(End of select menu.)";
+
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, false));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setStartSelect(true);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setStartSelect(false);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTABLERenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTABLERenderer.java
new file mode 100644
index 0000000..1698d09
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTABLERenderer.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+public class StaticTABLERenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context, MessageCollection)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+
+ // Jaws mode : ex) table with 3 columns and 7 rows
+ // tr - rows count
+ // td - columns count
+ int rcnt = getRowsCount(element);
+ int ccnt = getColumnsCount(element);
+ String result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ "in",
+ null,
+ "name=num1",
+ Integer.toString(ccnt),
+ "name=num2",
+ Integer.toString(rcnt));
+ setContextIn(element, ctx);
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(new Packet(element, result, ctx, true));
+ }
+
+ /**
+ * Method getRowsCount.
+ * @param element
+ * @return int
+ */
+ private static int getRowsCount(Element element) {
+ Node startNode = element;
+ Node node = startNode;
+ int rowscount = 0;
+ while (node != null) {
+
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("tr")) {
+ rowscount++;
+ }
+ node = goNext(node, startNode);
+ }
+ return rowscount;
+ }
+
+ /**
+ * Method getColumnsCount.
+ * @param element
+ * @return int
+ */
+ private static int getColumnsCount(Element element) {
+ Node startNode = element;
+ Node node = startNode;
+ int ccnt = 0;
+ int maxcnt = 0;
+ while (node != null) {
+
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("tr")) {
+ if (maxcnt < ccnt)
+ maxcnt = ccnt;
+ ccnt = 0;
+ }
+ if (node.getNodeType() == Node.ELEMENT_NODE
+ && node.getNodeName().toLowerCase().equals("td")) {
+ ccnt++;
+ }
+ node = goNext(node, startNode);
+ if (node == null) {
+ if (maxcnt < ccnt)
+ maxcnt = ccnt;
+ }
+ }
+ return maxcnt;
+ }
+
+ /**
+ * Method goNext.
+ * @param node
+ * @param sNode
+ * @return Node
+ */
+ private static Node goNext(Node node, Node sNode) {
+ if (node == null)
+ return null;
+ // get next node
+ if (node.hasChildNodes()) {
+ // Has Child
+ node = node.getFirstChild();
+ } else if (node.getNextSibling() != null) {
+ // Has Brother
+ node = node.getNextSibling();
+ } else { // Check Parent
+ for (;;) {
+ Node pnode = node.getParentNode();
+ if (pnode == null || pnode == sNode) {
+ node = null;
+ break;
+ } else {
+ node = pnode.getNextSibling();
+ if (node == null)
+ node = pnode;
+ else
+ break;
+ }
+ }
+ }
+ return node;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context, MessageCollection)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ // set `context out' flags
+ setContextOut(element, ctx);
+ // build result string
+ String result =
+ OutLoud.buildResultString(mc, url, element, "out", null);
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(new Packet(element, result, ctx, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setStartSelect(true);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setStartSelect(true);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTDRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTDRenderer.java
new file mode 100644
index 0000000..85fef3f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTDRenderer.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+public class StaticTDRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextIn(element, curContext);
+
+ String result = null;
+ result = OutLoud.buildResultString(mc, url, element, null, null);
+ if (result != null) {
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ } else
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ if (curContext.isLineDelimiter()) {
+ return null;
+ } else {
+ setContextOut(element, curContext);
+ Packet newPacket = new Packet(element, "", curContext, false);
+ return new PacketCollection(newPacket);
+ }
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTEXTAREARenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTEXTAREARenderer.java
new file mode 100644
index 0000000..5c3774b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTEXTAREARenderer.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.*;
+
+
+public class StaticTEXTAREARenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+
+ // set `context in' flags
+ setContextIn(element, curContext);
+
+ // build result string
+ String result = null;
+
+ Node node = element.getFirstChild();
+ if (node != null && node.getNodeType() == Node.TEXT_NODE) {
+ String nodeValue = node.getNodeValue();
+ nodeValue = nodeValue.trim();
+ if (nodeValue.length() > 0) {
+ result =
+ OutLoud.buildResultString(
+ mc,
+ url,
+ element,
+ null,
+ "hasstr",
+ "name=str1",
+ nodeValue);
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "[TextArea: " + nodeValue + "]";
+ }
+ }
+ if (result == null) {
+ result = OutLoud.buildResultString(mc, url, element, null, "nostr");
+ if (result == null && OutLoud.hprDefltMsg)
+ result = "[TextArea.]";
+ }
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, curContext, true));
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context curContext,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, curContext);
+
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(true);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ // curContext.setLineDelimiter(false);
+ // curContext.setLinkTag(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTRRenderer.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTRRenderer.java
new file mode 100644
index 0000000..474edd4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/StaticTRRenderer.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import org.eclipse.actf.visualization.engines.voicebrowser.Context;
+import org.eclipse.actf.visualization.engines.voicebrowser.JWATController;
+import org.eclipse.actf.visualization.engines.voicebrowser.Packet;
+import org.eclipse.actf.visualization.engines.voicebrowser.PacketCollection;
+import org.w3c.dom.Element;
+
+
+public class StaticTRRenderer implements IElementRenderer {
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionIn(Element, Context)
+ */
+ public PacketCollection getPacketCollectionIn(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ setContextIn(element, ctx);
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#getPacketCollectionOut(Element, Context)
+ */
+ public PacketCollection getPacketCollectionOut(
+ Element element,
+ Context ctx,
+ String url,
+ MessageCollection mc) {
+ setContextOut(element, ctx);
+
+ if (element.getNodeName().toLowerCase().equals("tr")
+ && OutLoud.jwat_mode == JWATController.JAWS_MODE) {
+ String result =
+ OutLoud.buildResultString(mc, url, element, "out", null);
+
+ if (result != null)
+ result = result.trim();
+ return new PacketCollection(
+ new Packet(element, result, ctx, false));
+ } else
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextIn(Context)
+ */
+ public void setContextIn(Element element, Context curContext) {
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(false);
+ curContext.setLinkTag(false);
+ }
+
+ /**
+ * @see org.eclipse.actf.visualization.engines.voicebrowser.internal.IElementRenderer#setContextOut(Context)
+ */
+ public void setContextOut(Element element, Context curContext) {
+ curContext.setStartSelect(true);
+ curContext.setGoChild(true);
+ curContext.setLineDelimiter(true);
+ curContext.setLinkTag(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/TextUtil.java b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/TextUtil.java
new file mode 100644
index 0000000..469a400
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.voicebrowser/src/org/eclipse/actf/visualization/engines/voicebrowser/internal/TextUtil.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Masahide WASHIZAWA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.voicebrowser.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class TextUtil {
+
+ private static Map<Character, String> replaceMap = new HashMap<Character, String>();
+
+ static {
+ replaceMap.put(new Character('\u2122'), "trade mark");
+ replaceMap.put(new Character('\u00A9'), "copyright mark");
+ replaceMap.put(new Character('\u00AE'), "registered mark");
+ }
+
+ /**
+ * Method replace.
+ * @param s
+ * @return StringBuffer
+ */
+ public static StringBuffer replace(StringBuffer s) {
+ //StringBuffer tmp = new StringBuffer(s.toString());
+ int length = s.length();
+ for (int i = 0; i < length; i++) {
+ String insert = replaceMap.get(new Character(s.charAt(i)));
+
+ if (insert != null) {
+ s.deleteCharAt(i);
+ s.insert(i, " " + insert);
+ i = i + insert.length();
+ length = length + insert.length();
+ }
+ }
+ return s;
+ }
+
+ /**
+ * Method substitute.
+ * @param input
+ * @param pattern
+ * @param replacement
+ * @return String
+ */
+ public static String substitute(
+ String input,
+ String pattern,
+ String replacement) {
+ int index = input.indexOf(pattern.toLowerCase());
+
+ if (index == -1) {
+ return input;
+ }
+
+ StringBuffer buffer = new StringBuffer();
+
+ buffer.append(input.substring(0, index) + replacement);
+
+ if (index + pattern.length() < input.length()) {
+ String rest =
+ input.substring(index + pattern.length(), input.length());
+ buffer.append(substitute(rest, pattern, replacement));
+ }
+ return buffer.toString();
+ }
+
+ /**
+ * Method trim.
+ * @param s
+ * @return String
+ */
+ public static String trim(String s) {
+ int from = 0, to = s.length();
+ if (to == 0)
+ return "";
+ try {
+ char c;
+ for (c = s.charAt(from);
+ (from < to)
+ && (Character.isWhitespace(c)
+ || Character.isSpaceChar(c)
+ || isReturn(c));
+ ) {
+ from++;
+ if (from == to) {
+ return "";
+ }
+ c = s.charAt(from);
+ }
+
+ if (from != 0 && (to - from) == 1) {
+ return s.substring(from, to + 1);
+ }
+
+ to = to - 1;
+ for (c = s.charAt(to);
+ (from < to)
+ && (Character.isWhitespace(c)
+ || Character.isSpaceChar(c)
+ || isReturn(c));
+ ) {
+
+ to--;
+ c = s.charAt(to);
+ }
+ return s.substring(from, to + 1);
+ } catch (StringIndexOutOfBoundsException sioobe) {
+ //sioobe.printStackTrace();
+ //System.out.println("TextUtil: 74: Error: trim: [" + s + "]");
+ return s;
+ }
+ }
+
+ /**
+ * Method isReturn.
+ * @param c
+ * @return boolean
+ */
+ private static boolean isReturn(char c) {
+ if (c == '\n') {
+ return true;
+ } else if (c == '\r') {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/.classpath b/plugins/org.eclipse.actf.visualization.eval/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.eval/.cvsignore b/plugins/org.eclipse.actf.visualization.eval/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.actf.visualization.eval/.project b/plugins/org.eclipse.actf.visualization.eval/.project
new file mode 100644
index 0000000..373935b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.eval</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.eval/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.eval/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4d3f509
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF Usability Evaluator Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.eval;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.eval.EvaluationPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.actf.common
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.actf.visualization,
+ org.eclipse.actf.visualization.eval,
+ org.eclipse.actf.visualization.eval.extensions,
+ org.eclipse.actf.visualization.eval.guideline,
+ org.eclipse.actf.visualization.eval.html,
+ org.eclipse.actf.visualization.eval.html.statistics,
+ org.eclipse.actf.visualization.eval.problem
+Bundle-ClassPath: runtimes/checker.jar
diff --git a/plugins/org.eclipse.actf.visualization.eval/about.html b/plugins/org.eclipse.actf.visualization.eval/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.eval/build.properties b/plugins/org.eclipse.actf.visualization.eval/build.properties
new file mode 100644
index 0000000..2e41be7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+output.. = bin/
+bin.includes = META-INF/,\
+ about.html,\
+ icons/,\
+ plugin.xml,\
+ runtimes/checker.jar,\
+ plugin.properties,\
+ plugin_ja.properties
+source.runtimes/checker.jar = src/
+jars.compile.order = .
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/Err.png b/plugins/org.eclipse.actf.visualization.eval/icons/Err.png
new file mode 100644
index 0000000..e42fbee
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/Err.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/ErrC.png b/plugins/org.eclipse.actf.visualization.eval/icons/ErrC.png
new file mode 100644
index 0000000..af0db41
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/ErrC.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/ErrL.png b/plugins/org.eclipse.actf.visualization.eval/icons/ErrL.png
new file mode 100644
index 0000000..657fdff
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/ErrL.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/ErrN.png b/plugins/org.eclipse.actf.visualization.eval/icons/ErrN.png
new file mode 100644
index 0000000..1234091
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/ErrN.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/Info.png b/plugins/org.eclipse.actf.visualization.eval/icons/Info.png
new file mode 100644
index 0000000..a889bfd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/Info.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/InfoC.png b/plugins/org.eclipse.actf.visualization.eval/icons/InfoC.png
new file mode 100644
index 0000000..832a5c1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/InfoC.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/InfoL.png b/plugins/org.eclipse.actf.visualization.eval/icons/InfoL.png
new file mode 100644
index 0000000..8cdacdd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/InfoL.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/InfoN.png b/plugins/org.eclipse.actf.visualization.eval/icons/InfoN.png
new file mode 100644
index 0000000..d31c980
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/InfoN.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/Warn.png b/plugins/org.eclipse.actf.visualization.eval/icons/Warn.png
new file mode 100644
index 0000000..bdac9c3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/Warn.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/WarnC.png b/plugins/org.eclipse.actf.visualization.eval/icons/WarnC.png
new file mode 100644
index 0000000..c1efa5e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/WarnC.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/WarnL.png b/plugins/org.eclipse.actf.visualization.eval/icons/WarnL.png
new file mode 100644
index 0000000..2b76433
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/WarnL.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/WarnN.png b/plugins/org.eclipse.actf.visualization.eval/icons/WarnN.png
new file mode 100644
index 0000000..c64dc9f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/WarnN.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/ErrBoke21.gif b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/ErrBoke21.gif
new file mode 100644
index 0000000..a7e7f0c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/ErrBoke21.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/ErrIro21.gif b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/ErrIro21.gif
new file mode 100644
index 0000000..0d242b8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/ErrIro21.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/HiBoke21.gif b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/HiBoke21.gif
new file mode 100644
index 0000000..9eac46c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/HiBoke21.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/HiIro21.gif b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/HiIro21.gif
new file mode 100644
index 0000000..83a0340
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/lowvision/HiIro21.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/.cvsignore b/plugins/org.eclipse.actf.visualization.eval/icons/media/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/508.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/508.png
new file mode 100644
index 0000000..d99f658
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/508.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/adobe.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/adobe.png
new file mode 100644
index 0000000..bef35fd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/adobe.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/flash.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/flash.png
new file mode 100644
index 0000000..1d11c96
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/flash.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/ibm.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/ibm.png
new file mode 100644
index 0000000..8253d93
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/ibm.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/jsa.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/jsa.png
new file mode 100644
index 0000000..862d942
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/jsa.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/oasis.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/oasis.png
new file mode 100644
index 0000000..15b64d5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/oasis.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/odf.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/odf.png
new file mode 100644
index 0000000..68aa818
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/odf.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/pdf.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/pdf.png
new file mode 100644
index 0000000..20d54f5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/pdf.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/media/w3c.png b/plugins/org.eclipse.actf.visualization.eval/icons/media/w3c.png
new file mode 100644
index 0000000..93b4884
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/media/w3c.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/rating/Bad.png b/plugins/org.eclipse.actf.visualization.eval/icons/rating/Bad.png
new file mode 100644
index 0000000..314f0e1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/rating/Bad.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/rating/Good.png b/plugins/org.eclipse.actf.visualization.eval/icons/rating/Good.png
new file mode 100644
index 0000000..3a412d4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/rating/Good.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/rating/Poor.png b/plugins/org.eclipse.actf.visualization.eval/icons/rating/Poor.png
new file mode 100644
index 0000000..2905038
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/rating/Poor.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/rating/VeryGood.png b/plugins/org.eclipse.actf.visualization.eval/icons/rating/VeryGood.png
new file mode 100644
index 0000000..12072a3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/rating/VeryGood.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/icons/star.gif b/plugins/org.eclipse.actf.visualization.eval/icons/star.gif
new file mode 100644
index 0000000..7413972
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/icons/star.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.eval/plugin.properties b/plugins/org.eclipse.actf.visualization.eval/plugin.properties
new file mode 100644
index 0000000..5756f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/plugin.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+preferences.guideline.title=Guideline Checker
diff --git a/plugins/org.eclipse.actf.visualization.eval/plugin.xml b/plugins/org.eclipse.actf.visualization.eval/plugin.xml
new file mode 100644
index 0000000..e7b6541
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="checkers" name="checkers" schema="schema/checkers.exsd"/>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.actf.visualization.eval.preferences.GuidelinePreferencePage"
+ id="org.eclipse.actf.visualization.eval.preferences.GuidelinePreferencePage"
+ name="%preferences.guideline.title"/>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.actf.visualization.eval.preferences.PreferenceInitializer"/>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.actf.visualization.eval/plugin_ja.properties b/plugins/org.eclipse.actf.visualization.eval/plugin_ja.properties
new file mode 100644
index 0000000..3b6bb95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/plugin_ja.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+preferences.guideline.title=\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u30c1\u30a7\u30c3\u30ab\u30fc
+
diff --git a/plugins/org.eclipse.actf.visualization.eval/schema/checkers.exsd b/plugins/org.eclipse.actf.visualization.eval/schema/checkers.exsd
new file mode 100644
index 0000000..bee8ca2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/schema/checkers.exsd
@@ -0,0 +1,120 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.actf.visualization.eval">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.actf.visualization.eval" id="checkers" name="checkers"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="checker" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="checker">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="infoprovider" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007, 2008 IBM Corporation and others.<br>
+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 <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/VisualizationStatusLineContributionItem.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/VisualizationStatusLineContributionItem.java
new file mode 100644
index 0000000..9f2c354
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/VisualizationStatusLineContributionItem.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization;
+
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.jface.action.StatusLineLayoutData;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class VisualizationStatusLineContributionItem extends ContributionItem {
+
+ public static final String ID = "org.eclipse.actf.visualization.VisualizationStatusLineContributionItem";
+
+ private final int MSGLABEL_WIDTHHINT = 300;
+
+ CLabel _statusMessageLabel;
+
+ CLabel _infoMessageLabel;
+
+ //TODO move to common
+
+ public VisualizationStatusLineContributionItem(String id) {
+ super(ID + id);
+ }
+
+ public void fill(Composite parent) {
+
+ Label leftSeparator = new Label(parent, SWT.SEPARATOR);
+
+ this._statusMessageLabel = new CLabel(parent, SWT.NONE);
+
+ Label centerSeparator = new Label(parent, SWT.SEPARATOR);
+
+ this._infoMessageLabel = new CLabel(parent, SWT.NONE);
+
+ Label rightSeparator = new Label(parent, SWT.SEPARATOR);
+
+ StatusLineLayoutData msgLabelLayoutData = new StatusLineLayoutData();
+ msgLabelLayoutData.widthHint = MSGLABEL_WIDTHHINT;
+ this._statusMessageLabel.setLayoutData(msgLabelLayoutData);
+ msgLabelLayoutData = new StatusLineLayoutData();
+ msgLabelLayoutData.widthHint = MSGLABEL_WIDTHHINT+80;
+ this._infoMessageLabel.setLayoutData(msgLabelLayoutData);
+
+ GC gc = new GC(parent);
+ gc.setFont(parent.getFont());
+ FontMetrics fm = gc.getFontMetrics();
+ int heightHint = fm.getHeight();
+ gc.dispose();
+
+ StatusLineLayoutData separatorLayoutData = new StatusLineLayoutData();
+ separatorLayoutData.heightHint = heightHint;
+
+ leftSeparator.setLayoutData(separatorLayoutData);
+ centerSeparator.setLayoutData(separatorLayoutData);
+ rightSeparator.setLayoutData(separatorLayoutData);
+ }
+
+ public void setStatusMessage(String statusMessage) {
+ if (null != this._statusMessageLabel && !this._statusMessageLabel.isDisposed()) {
+ this._statusMessageLabel.setText(statusMessage);
+ this._statusMessageLabel.update();
+ }
+ }
+
+ public void setInfoMessage(String infoMessage) {
+ if (null != this._infoMessageLabel && !this._infoMessageLabel.isDisposed()) {
+ this._infoMessageLabel.setText(infoMessage);
+ this._infoMessageLabel.update();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/CheckTargetImpl.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/CheckTargetImpl.java
new file mode 100644
index 0000000..c0ffd82
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/CheckTargetImpl.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval;
+
+import java.util.HashMap;
+
+import org.w3c.dom.Document;
+
+public class CheckTargetImpl implements ICheckTarget {
+
+ private HashMap<String, Document> documentMap = new HashMap<String, Document>();
+
+ private Document target;
+
+ private String targetUrl;
+
+ public CheckTargetImpl(Document target, String targetUrl) {
+ this.target = target;
+ this.targetUrl = targetUrl;
+ }
+
+ public Document getTargetDocument() {
+ return target;
+ }
+
+ public String getTargetUrl() {
+ return targetUrl;
+ }
+
+ public void setAdditionalDocument(String key, Document document) {
+ documentMap.put(key, document);
+ }
+
+ public Document getAdditionalDocument(String key) {
+ if (documentMap.containsKey(key)) {
+ return documentMap.get(key);
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/EvaluationPlugin.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/EvaluationPlugin.java
new file mode 100644
index 0000000..e848758
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/EvaluationPlugin.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class EvaluationPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.actf.visualization.eval";
+
+ // The shared instance
+ private static EvaluationPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public EvaluationPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static EvaluationPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/EvaluationPreferencesUtil.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/EvaluationPreferencesUtil.java
new file mode 100644
index 0000000..0f0f998
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/EvaluationPreferencesUtil.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval;
+
+import org.eclipse.actf.visualization.eval.preferences.IPreferenceConstants;
+
+public class EvaluationPreferencesUtil {
+
+ /**
+ * @return
+ */
+ public static boolean isOriginalDOM() {
+ return IPreferenceConstants.CHECKER_ORG_DOM.equals(EvaluationPlugin
+ .getDefault().getPluginPreferences().getString(
+ IPreferenceConstants.CHECKER_TARGET));
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/HtmlCheckTargetImpl.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/HtmlCheckTargetImpl.java
new file mode 100644
index 0000000..9742b4f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/HtmlCheckTargetImpl.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval;
+
+import org.eclipse.actf.model.ui.editor.browser.BrowserAndStyleInfo;
+import org.eclipse.actf.visualization.eval.html.HtmlEvalUtil;
+import org.w3c.dom.Document;
+
+public class HtmlCheckTargetImpl extends CheckTargetImpl implements
+ IHtmlCheckTarget {
+
+ private BrowserAndStyleInfo browserStyleInfo;
+
+ private HtmlEvalUtil htmlEvalUtil;
+
+ public HtmlCheckTargetImpl(Document target, String targetUrl,
+ BrowserAndStyleInfo browserStyleInfo, HtmlEvalUtil htmlEvalUtil) {
+ super(target, targetUrl);
+ this.browserStyleInfo = browserStyleInfo;
+ this.htmlEvalUtil = htmlEvalUtil;
+ }
+
+ public HtmlEvalUtil getHtmlEvalUtil() {
+ return htmlEvalUtil;
+ }
+
+ public BrowserAndStyleInfo getBrowserAndStyleInfo() {
+ return browserStyleInfo;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/ICheckTarget.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/ICheckTarget.java
new file mode 100644
index 0000000..a5414c3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/ICheckTarget.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval;
+
+import org.w3c.dom.Document;
+
+public interface ICheckTarget {
+
+ Document getTargetDocument(); // for all
+
+ String getTargetUrl(); // for all
+
+ void setAdditionalDocument(String key, Document document);
+
+ Document getAdditionalDocument(String key);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IChecker.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IChecker.java
new file mode 100644
index 0000000..dd2e6e8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IChecker.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval;
+
+import java.util.List;
+
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+
+public interface IChecker {
+ List<IProblemItem> check(ICheckTarget checkTarget);
+
+ boolean isTargetFormat(String mimeType);
+
+ boolean isEnabled();
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/ICheckerInfoProvider.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/ICheckerInfoProvider.java
new file mode 100644
index 0000000..50aa310
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/ICheckerInfoProvider.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval;
+
+import java.io.InputStream;
+import java.util.ResourceBundle;
+
+public interface ICheckerInfoProvider {
+
+ InputStream[] getGuidelineInputStreams();
+
+ InputStream[] getCheckItemInputStreams();
+
+ ResourceBundle getDescriptionRB();
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IHtmlCheckTarget.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IHtmlCheckTarget.java
new file mode 100644
index 0000000..cbe210e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IHtmlCheckTarget.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval;
+
+import org.eclipse.actf.model.ui.editor.browser.BrowserAndStyleInfo;
+import org.eclipse.actf.visualization.eval.html.HtmlEvalUtil;
+
+public interface IHtmlCheckTarget extends ICheckTarget {
+
+ BrowserAndStyleInfo getBrowserAndStyleInfo();
+
+ HtmlEvalUtil getHtmlEvalUtil();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IHtmlChecker.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IHtmlChecker.java
new file mode 100644
index 0000000..067b3b8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/IHtmlChecker.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval;
+
+import java.util.List;
+
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+
+public interface IHtmlChecker extends IChecker {
+
+ List<IProblemItem> checkHtml(IHtmlCheckTarget checkTarget);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/extensions/CheckerExtension.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/extensions/CheckerExtension.java
new file mode 100644
index 0000000..edbdbbd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/extensions/CheckerExtension.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.eval.IChecker;
+import org.eclipse.actf.visualization.eval.ICheckerInfoProvider;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Platform;
+
+public class CheckerExtension {
+ private static final String EXTENSION_NAME = "checkers";
+
+ private static final String CHECKER = "checker";
+
+ private static final String ATTR_CLASS = "class";
+
+ private static final String ATTR_INFO_PROVIDER = "infoprovider";
+
+ private static CheckerExtension[] extensions;
+
+ private static IChecker[] checkers = null;
+
+ private static ICheckerInfoProvider[] infoProviders = null;
+
+ public static IChecker[] getCheckers() {
+ if (checkers != null) {
+ return checkers;
+ }
+
+ CheckerExtension[] tmpExtensions = getExtensions();
+ ArrayList<IChecker> tmpList = new ArrayList<IChecker>();
+ if (tmpExtensions != null) {
+ for (int i = 0; i < tmpExtensions.length; i++) {
+ IChecker tmpChecker = tmpExtensions[i].getChecker();
+ if (tmpChecker != null) {
+ tmpList.add(tmpChecker);
+ }
+ }
+ }
+ checkers = new IChecker[tmpList.size()];
+ tmpList.toArray(checkers);
+ return checkers;
+ }
+
+ public static ICheckerInfoProvider[] getCheckerInfoProviders() {
+ if (infoProviders != null) {
+ return infoProviders;
+ }
+
+ CheckerExtension[] tmpExtensions = getExtensions();
+ ArrayList<ICheckerInfoProvider> tmpList = new ArrayList<ICheckerInfoProvider>();
+ if (tmpExtensions != null) {
+ for (int i = 0; i < tmpExtensions.length; i++) {
+ ICheckerInfoProvider tmpInfo = tmpExtensions[i]
+ .getCheckerInfoProvider();
+ if (tmpInfo != null) {
+ tmpList.add(tmpInfo);
+ }
+ }
+ }
+ infoProviders = new ICheckerInfoProvider[tmpList.size()];
+ tmpList.toArray(infoProviders);
+ return infoProviders;
+ }
+
+ private static CheckerExtension[] getExtensions() {
+ if (extensions != null)
+ return extensions;
+
+ IExtension[] tmpExtensions = Platform.getExtensionRegistry()
+ .getExtensionPoint(EvaluationPlugin.PLUGIN_ID, EXTENSION_NAME)
+ .getExtensions();
+
+ DebugPrintUtil.devOrDebugPrintln("Checker extensions:"
+ + tmpExtensions.length);
+
+ List<CheckerExtension> l = new ArrayList<CheckerExtension>();
+ for (int i = 0; i < tmpExtensions.length; i++) {
+ IConfigurationElement[] configElements = tmpExtensions[i]
+ .getConfigurationElements();
+ for (int j = 0; j < configElements.length; j++) {
+ CheckerExtension ex = parseExtension(configElements[j]);
+ if (ex != null) {
+ l.add(ex);
+ }
+ }
+ }
+ extensions = l.toArray(new CheckerExtension[l.size()]);
+ return extensions;
+ }
+
+ private static CheckerExtension parseExtension(
+ IConfigurationElement configElement) {
+ if (!configElement.getName().equals(CHECKER)) {
+ return null;
+ }
+ try {
+ return new CheckerExtension(configElement);
+ } catch (Exception e) {
+ }
+ return null;
+ }
+
+ private IChecker checker = null;
+
+ private ICheckerInfoProvider infoProvider = null;
+
+ private IConfigurationElement configElement = null;
+
+ private CheckerExtension(IConfigurationElement configElement) {
+ this.configElement = configElement;
+ try {
+ this.infoProvider = (ICheckerInfoProvider) configElement
+ .createExecutableExtension(ATTR_INFO_PROVIDER);
+ } catch (Exception e) {
+ }
+
+ }
+
+ private IChecker getChecker() {
+ //to avoide loop
+ if (this.checker == null) {
+ try {
+ this.checker = (IChecker) configElement
+ .createExecutableExtension(ATTR_CLASS);
+ } catch (Exception e) {
+ }
+ }
+ return this.checker;
+ }
+
+ private ICheckerInfoProvider getCheckerInfoProvider() {
+ return this.infoProvider;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/CheckItemReader.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/CheckItemReader.java
new file mode 100644
index 0000000..e8ed29c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/CheckItemReader.java
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Stack;
+import java.util.TreeSet;
+import java.util.Vector;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.actf.visualization.eval.IEvaluationItem;
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+
+
+
+public class CheckItemReader extends DefaultHandler {
+ private static final String CHECKER_CONFIG = "checker-config";
+
+ private static final String CHECK_ITEM = "checkitem";
+
+ private static final String GUIDELINE = "guideline";
+
+ private static final String GITEM = "gItem";
+
+ private static final String MITEM = "mItem";
+
+ private static final String DESC = "desc";
+
+ private static final String ID = "id";
+
+ private static final String NAME = "name";
+
+ private static final String TYPE = "type";
+
+ private static final String METRICS = "metrics";
+
+ private static final String SCORE = "score";
+
+ private static final String DESCRIPTION = "description";
+
+// private static final String LANG = "lang";
+
+ private static final short IN_DEFAULT = 0;
+
+ private static final short IN_GUIDELINE = 1;
+
+ private static final short IN_METRICS = 2;
+
+ private static final short IN_DESCRIPTION = 3;
+
+ public static CheckItemReader parse(InputStream is, GuidelineHolder gh) {
+ CheckItemReader cir = new CheckItemReader(gh);
+ try {
+ SAXParserFactory spfactory = SAXParserFactory.newInstance();
+ SAXParser parser = spfactory.newSAXParser();
+ parser.parse(is, cir);
+ } catch (Exception e) {
+ }
+
+ return (cir);
+ }
+
+ private HashMap<String, IEvaluationItem> checkItemMap = new HashMap<String, IEvaluationItem>();
+
+ private Stack<Short> statusStack = new Stack<Short>();
+
+ private String curValue = "";
+
+ private EvaluationItem curItem = new EvaluationItem("", "");
+
+ private short status = -1;
+
+ private boolean succeed = false;
+
+ private GuidelineHolder guidelineHolder;
+
+ private Vector<IGuidelineItem> guidelineV = new Vector<IGuidelineItem>();
+
+ private Set<String> metricsSet = new TreeSet<String>(new MetricsNameComparator());
+
+ // comparator
+ // &
+ // metrics.xml
+
+ private Vector<MetricsItem> metricsV = new Vector<MetricsItem>();
+
+ /**
+ *
+ */
+ public CheckItemReader(GuidelineHolder guidelineHolder) {
+ this.guidelineHolder = guidelineHolder;
+ }
+
+ /**
+ *
+ */
+ public void characters(char[] ch, int offset, int length) {
+
+ if (length > 0) {
+ curValue += (new String(ch, offset, length));
+ }
+ }
+
+ /**
+ *
+ */
+ public void endDocument() {
+ // need validation
+ succeed = true;
+ }
+
+ /**
+ *
+ */
+ public void endElement(String uri, String localName, String qName) {
+
+ if (qName.equals(GITEM)) {
+ } else if (qName.equals(MITEM)) {
+ } else if (qName.equals(DESC)) {
+ } else if (qName.equals(CHECK_ITEM)) {
+ checkItemMap.put(curItem.getId(), curItem);
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equals(GUIDELINE)) {
+
+ GuidelineItem[] gis = new GuidelineItem[guidelineV.size()];
+ guidelineV.toArray(gis);
+ curItem.setGuidelines(gis);
+
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equals(METRICS)) {
+
+ MetricsItem[] mis = new MetricsItem[metricsV.size()];
+ metricsV.toArray(mis);
+ curItem.setMetrics(mis);
+
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equals(DESCRIPTION)) {
+ // TODO
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equals(CHECKER_CONFIG)) {
+
+ } else {
+
+ // in metrics
+ System.out.println("unknown element(end): " + qName);
+ }
+ }
+
+ /**
+ *
+ */
+ public void startDocument() {
+ }
+
+ /**
+ *
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) {
+
+ curValue = "";
+ if (qName.equals(GITEM)) {
+ IGuidelineItem gi = guidelineHolder.getGuidelineItem(getValue(NAME, attributes, true), getValue(ID, attributes, true));
+ // System.out.println(getValue(NAME,attributes)+"
+ // "+getValue(ID,attributes)+" : "+gi);
+ if (gi != null) {
+ guidelineV.add(gi);
+ }
+ } else if (qName.equals(MITEM)) {
+ String metrics = getValue(NAME, attributes, true);
+ String scoreS = getValue(SCORE, attributes, true);
+
+ if (metrics.length() > 0) {
+ metricsSet.add(metrics);
+ metricsV.add(new MetricsItem(metrics, scoreS));
+ }
+ } else if (qName.equals(CHECK_ITEM)) {
+
+ curItem = new EvaluationItem(getValue(ID, attributes), getValue(TYPE, attributes));
+
+ statusStack.push(new Short(status));
+ status = IN_DEFAULT;
+ } else if (qName.equals(GUIDELINE)) {
+
+ guidelineV = new Vector<IGuidelineItem>();
+
+ statusStack.push(new Short(status));
+ status = IN_GUIDELINE;
+ } else if (qName.equals(METRICS)) {
+
+ metricsV = new Vector<MetricsItem>();
+
+ statusStack.push(new Short(status));
+ status = IN_METRICS;
+ } else if (qName.equals(DESCRIPTION)) {
+ statusStack.push(new Short(status));
+ status = IN_DESCRIPTION;
+ } else if (qName.equals(CHECKER_CONFIG)) {
+ } else {
+ }
+ }
+
+ private String getValue(String target, Attributes attrs) {
+ return (getValue(target, attrs, false));
+ }
+
+ private String getValue(String target, Attributes attrs, boolean trim) {
+ String result = attrs.getValue(target);
+ if (result == null) {
+ result = "";
+ }
+ if (trim) {
+ return (result.trim());
+ }
+ return (result);
+ }
+
+ public boolean isSucceed() {
+ return succeed;
+ }
+
+ public HashMap<String, IEvaluationItem> getCheckItemMap() {
+ return checkItemMap;
+ }
+
+ public Set<String> getMetricsSet() {
+ return metricsSet;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/EvaluationItem.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/EvaluationItem.java
new file mode 100644
index 0000000..48dc08e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/EvaluationItem.java
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.text.MessageFormat;
+
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.eval.IEvaluationItem;
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class EvaluationItem implements IEvaluationItem{
+
+ private String id = "";
+
+ private GuidelineItem[] guidelines = new GuidelineItem[0];
+
+ private MetricsItem[] metrics = new MetricsItem[0];
+
+ private String description;
+
+ private String[] tableDataMetrics = new String[0];
+
+ private String[] tableDataGuideline = new String[0];
+
+ private Image[] metricsIcons = new Image[0];
+
+ private int[] metricsScores = new int[0];
+
+ private short severity = SEV_INFO;
+
+ private String severityStr = SEV_INFO_STR;
+
+ /**
+ * @param id
+ */
+ public EvaluationItem(String id, String severity) {
+ this.id = id;
+ setSeverity(severity);
+ description = GuidelineItemDescription.getDescription(id);
+ }
+
+ public String createDescription(String targetString) {
+ return MessageFormat.format(description, new Object[] {targetString});
+ }
+
+ public String createDescription() {
+ return (description);
+ }
+
+ public GuidelineItem[] getGuidelines() {
+ return guidelines;
+ }
+
+ protected void setGuidelines(GuidelineItem[] guidelines) {
+ this.guidelines = guidelines;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public int getSeverity() {
+ return severity;
+ }
+
+ public String getSeverityStr(){
+ return severityStr;
+ }
+
+ private void setSeverity(String _severityStr) {
+ severity = SEV_INFO;
+ severityStr = SEV_INFO_STR;
+ if (_severityStr != null) {
+ _severityStr = _severityStr.trim();
+ if (SEV_ERROR_STR.equalsIgnoreCase(_severityStr)) {
+ severity = SEV_ERROR;
+ severityStr = SEV_ERROR_STR;
+ } else if (SEV_WARNING_STR.equalsIgnoreCase(_severityStr)) {
+ severity = SEV_WARNING;
+ severityStr = SEV_WARNING_STR;
+ }
+ //else{
+ //severity = SEV_INFO;
+ //}
+ }
+ }
+
+ public MetricsItem[] getMetricsItems() {
+ return metrics;
+ }
+
+ protected void setMetrics(MetricsItem[] metrics) {
+ this.metrics = metrics;
+ }
+
+ protected void initTableData(String[] guidelineNames, String[] metricsNames) {
+ tableDataGuideline = new String[guidelineNames.length];
+ tableDataMetrics = new String[metricsNames.length];
+ metricsScores = new int[metricsNames.length];
+ metricsIcons = new Image[metricsNames.length];
+ for (int i = 0; i < guidelineNames.length; i++) {
+ StringBuffer tmpSB = new StringBuffer();
+ boolean notFirst = false;
+ for (int j = 0; j < guidelines.length; j++) {
+ IGuidelineItem tmpItem = guidelines[j];
+ if (guidelineNames[i].equalsIgnoreCase(tmpItem.getGuidelineName())) {
+ if (notFirst) {
+ tmpSB.append(", ");
+ } else {
+ notFirst = true;
+ }
+ if (tmpItem.getLevel().length() > 0) {
+ tmpSB.append(tmpItem.getLevel() + ": " + tmpItem.getId());
+ } else {
+ tmpSB.append(tmpItem.getId());
+ }
+ }
+ }
+ tableDataGuideline[i] = tmpSB.toString();
+ }
+
+ for (int i = 0; i < metricsNames.length; i++) {
+ String curName = metricsNames[i];
+ tableDataMetrics[i] = "";
+ metricsScores[i] = 0;
+ metricsIcons[i] = null;
+ for (int j = 0; j < metrics.length; j++) {
+ MetricsItem tmpItem = metrics[j];
+ if (curName.equalsIgnoreCase(tmpItem.getMetricsName())) {
+ metricsScores[i] = tmpItem.getScore();
+ if (tmpItem.getScore() != 0) {
+ tableDataMetrics[i] = Integer.toString(-tmpItem.getScore());
+ }
+
+ //TODO reuse
+ switch (this.severity) {
+ case SEV_ERROR:
+ if (curName.equalsIgnoreCase("compliance")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/ErrC.png").createImage();
+ } else if (curName.equalsIgnoreCase("navigability")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/ErrN.png").createImage();
+ } else if (curName.equalsIgnoreCase("listenability")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/ErrL.png").createImage();
+ } else {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/Err.png").createImage();
+ }
+ break;
+ case SEV_WARNING:
+ if (curName.equalsIgnoreCase("compliance")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/WarnC.png").createImage();
+ } else if (curName.equalsIgnoreCase("navigability")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/WarnN.png").createImage();
+ } else if (curName.equalsIgnoreCase("listenability")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/WarnL.png").createImage();
+ } else {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/Warn.png").createImage();
+ }
+ break;
+ case SEV_INFO:
+ if (curName.equalsIgnoreCase("compliance")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/InfoC.png").createImage();
+ } else if (curName.equalsIgnoreCase("navigability")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/InfoN.png").createImage();
+ } else if (curName.equalsIgnoreCase("listenability")) {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/InfoL.png").createImage();
+ } else {
+ metricsIcons[i] = EvaluationPlugin.getImageDescriptor("icons/Info.png").createImage();
+ }
+ break;
+ }
+
+ }
+ }
+ }
+
+ }
+
+ public String toString() {
+ StringBuffer tmpSB = new StringBuffer();
+ tmpSB.append(id + " " + severity + " : " + Constants.LINE_SEP);
+ for (int i = 0; i < guidelines.length; i++) {
+ tmpSB.append(" " + guidelines[i] + Constants.LINE_SEP);
+ }
+
+ for (int i = 0; i < tableDataGuideline.length; i++) {
+ tmpSB.append(" " + tableDataGuideline[i] + Constants.LINE_SEP);
+ }
+
+ for (int i = 0; i < metrics.length; i++) {
+ tmpSB.append(" " + metrics[i] + Constants.LINE_SEP);
+ }
+
+ for (int i = 0; i < tableDataMetrics.length; i++) {
+ tmpSB.append(" " + tableDataMetrics[i] + Constants.LINE_SEP);
+ }
+
+ return (tmpSB.toString());
+ }
+
+ public int[] getMetricsScores() {
+ return metricsScores;
+ }
+
+ public String[] getTableDataGuideline() {
+ return tableDataGuideline;
+ }
+
+ public String[] getTableDataMetrics() {
+ return tableDataMetrics;
+ }
+
+ public Image[] getMetricsIcons() {
+ return metricsIcons;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineData.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineData.java
new file mode 100644
index 0000000..f453e34
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineData.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class GuidelineData {
+
+ private String guidelineName;
+
+ private int id; // define sort order
+
+ //TODO nest
+ private String levelStr = null;
+
+ private String[] levels;
+
+ private String[] mimetypes;
+
+ private String description;
+
+ private String category;
+
+ private boolean isEnabled = false;
+
+ private GuidelineData[] subLevelDataArray = new GuidelineData[0];
+
+ private boolean[] hasMetrics;
+
+ private HashSet<EvaluationItem> checkItemSet = new HashSet<EvaluationItem>();
+
+ private Map<String, IGuidelineItem> guidelineItemMap = new HashMap<String, IGuidelineItem>();
+
+ private String currentMIMEtype = "text/html";
+
+ /**
+ * @param guidelineName
+ * @param levels
+ * @param guidelineItemMap
+ */
+ public GuidelineData(String guidelineName, int id, String category, String description, String[] levels,
+ String[] categories, String[] descriptions, String[] mimetypes, Map<String, IGuidelineItem> guidelineItemMap) {
+ this.guidelineName = guidelineName;
+ this.guidelineItemMap = guidelineItemMap;
+ this.levels = levels;
+ this.mimetypes = mimetypes;
+ this.id = id;
+ this.category = category;
+ this.description = description;
+
+ subLevelDataArray = new GuidelineData[levels.length];
+ for (int i = 0; i < levels.length; i++) {
+ subLevelDataArray[i] = new GuidelineData(guidelineName, id, levels[i], categories[i], descriptions[i],
+ mimetypes, guidelineItemMap);
+ }
+
+ // for(int i=0;i<levels.length;i++){
+ // System.out.println(guidelineName+"("+levels[i]+"):"+guidelineItems[i].size());
+ // }
+ }
+
+ private GuidelineData(String guidelineName, int id, String levelStr, String categoryStr, String descriptionStr,
+ String[] mimetypes, Map guidelineItemMap) {
+ this.guidelineName = guidelineName;
+ this.id = id;
+ this.mimetypes = mimetypes;
+ this.category = categoryStr;
+ this.description = descriptionStr;
+
+ // TODO
+ if (levelStr == null) {
+ this.levelStr = "";
+ } else {
+ this.levelStr = levelStr;
+ }
+
+ for (Iterator it = guidelineItemMap.values().iterator(); it.hasNext();) {
+ IGuidelineItem item = (IGuidelineItem) it.next();
+ if (item.getLevel().equals(levelStr)) {
+ this.guidelineItemMap.put(item.getId(), item);
+ }
+ }
+ }
+
+ public IGuidelineItem getGuidelineItem(String id) {
+ return ((IGuidelineItem) guidelineItemMap.get(id));
+ }
+
+ public Map<String, IGuidelineItem> getGuidelineItemMap() {
+ return guidelineItemMap;
+ }
+
+ public String getGuidelineName() {
+ return guidelineName;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ // TODO
+ public String[] getLevels() {
+ return levels;
+ }
+
+ // TODO
+ public boolean hasLevel() {
+ return (0 != levels.length);
+ }
+
+ public String[] getMIMEtypes() {
+ return mimetypes;
+ }
+
+ public boolean isEnabled() {
+ if (subLevelDataArray.length > 0) {
+ for (int i = 0; i < subLevelDataArray.length; i++) {
+ if (subLevelDataArray[i].isEnabled()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ return isEnabled;
+ }
+
+ public boolean isMatched() {
+ return (isEnabled() && isTargetMIMEtype(currentMIMEtype));
+ }
+
+ protected void setEnabled(boolean isEnabled) {
+ this.isEnabled = isEnabled;
+ }
+
+ public GuidelineData getSubLevelData(String levelStr) {
+ for (int i = 0; i < subLevelDataArray.length; i++) {
+ if (subLevelDataArray[i].getLevelStr().equalsIgnoreCase(levelStr)) {
+ return (subLevelDataArray[i]);
+ }
+ }
+ return (null);
+ }
+
+ protected void setCheckItems(Collection checkItemCollection, String[] metrics) {
+ hasMetrics = new boolean[metrics.length];
+ Arrays.fill(hasMetrics, false);
+
+ for (Iterator i = checkItemCollection.iterator(); i.hasNext();) {
+ try {
+ EvaluationItem item = (EvaluationItem) i.next();
+ IGuidelineItem[] guidelineArray = item.getGuidelines();
+ for (int j = 0; j < guidelineArray.length; j++) {
+ if (this.guidelineName.equals(guidelineArray[j].getGuidelineName())) {
+ if (levelStr == null || levelStr.equals(guidelineArray[j].getLevel())) {
+ Image[] icons = item.getMetricsIcons();
+ for (int l = 0; l < metrics.length; l++) {
+ if (icons[l] != null) {
+ hasMetrics[l] = true;
+ }
+ }
+ checkItemSet.add(item);
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ for (int i = 0; i < subLevelDataArray.length; i++) {
+ subLevelDataArray[i].setCheckItems(checkItemCollection, metrics);
+ }
+
+ // System.out.println(guidelineName + " " + levelStr + ":" +
+ // checkItemSet.size());
+ // for (int i = 0; i < metrics.length; i++) {
+ // System.out.println(guidelineName + " " + levelStr + ":" + metrics[i]
+ // + "\t" + hasMetrics[i]);
+ // }
+
+ }
+
+ public String getLevelStr() {
+ return levelStr;
+ }
+
+ /**
+ * @return Returns the checkItemSet.
+ */
+ public HashSet<EvaluationItem> getCheckItemSet() {
+ return checkItemSet;
+ }
+
+ /**
+ * @return Returns the hasMetrics.
+ */
+ public boolean[] getCorrespondingMetrics() {
+ return hasMetrics;
+ }
+
+ public boolean isTargetMIMEtype(String mimetype) {
+ for (int i = 0; i < mimetypes.length; i++) {
+ if (mimetypes[i].equals(mimetype)) {
+ return (true);
+ }
+ }
+ return (false);
+ }
+
+ protected void setCurrentMIMEtype(String currentMIMEtype) {
+ this.currentMIMEtype = currentMIMEtype;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineDataComparator.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineDataComparator.java
new file mode 100644
index 0000000..22202d6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineDataComparator.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.util.Comparator;
+
+
+
+public class GuidelineDataComparator implements Comparator<GuidelineData> {
+
+ public int compare(GuidelineData o1, GuidelineData o2) {
+ int result = 0;
+ try{
+ result = o1.getId() - o2.getId();
+
+ if(result==0){
+ return o1.getGuidelineName().compareTo(o2.getGuidelineName());
+ }
+ return result;
+ }catch (Exception e){
+ return(result);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineHolder.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineHolder.java
new file mode 100644
index 0000000..93bda5f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineHolder.java
@@ -0,0 +1,569 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Vector;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.eval.ICheckerInfoProvider;
+import org.eclipse.actf.visualization.eval.IEvaluationItem;
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.actf.visualization.eval.extensions.CheckerExtension;
+import org.eclipse.actf.visualization.eval.preferences.ICheckerPreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class GuidelineHolder {
+
+ private static GuidelineHolder INSTANCE = null;
+
+ private IPreferenceStore preferenceStore = EvaluationPlugin.getDefault()
+ .getPreferenceStore();
+
+ private ICheckerInfoProvider[] checkerInfos = CheckerExtension.getCheckerInfoProviders();
+
+ public static void main(String args[]) {
+ GuidelineHolder gh = getInstance();
+
+ for (Iterator i = gh.checkitemMap.keySet().iterator(); i.hasNext();) {
+ IEvaluationItem tmpCI = (IEvaluationItem) gh.checkitemMap.get(i
+ .next());
+ if (!gh.enabledCheckitemSet.contains(tmpCI)) {
+ System.out.println(tmpCI);
+ }
+ }
+
+ }
+
+ public static GuidelineHolder getInstance() {
+ if (INSTANCE == null) {
+ INSTANCE = new GuidelineHolder();
+ }
+ return (INSTANCE);
+ }
+
+ private Map<String, GuidelineData> guidelineMaps = new HashMap<String, GuidelineData>();
+
+ private Set<GuidelineData> guidelineSet = new TreeSet<GuidelineData>(
+ new GuidelineDataComparator());
+
+ private GuidelineData[] guidelineArray;
+
+ private GuidelineData[] leafGuidelineArray;
+
+ private String[] guidelineNamesWithLevels;
+
+ private String[] guidelineNames;
+
+ private Map<String, IEvaluationItem> checkitemMap = new HashMap<String, IEvaluationItem>();
+
+ private String[] metricsNames = new String[0];
+
+ private boolean[][] correspondingMetricsOfLeafGuideline;
+
+ private boolean[] enabledMetrics;
+
+ private Set<IEvaluationItem> enabledCheckitemSet = new HashSet<IEvaluationItem>();
+
+ private Set<IGuidelineItem> enabledGuidelineitemSet = new HashSet<IGuidelineItem>();
+
+ private boolean[] matchedMetrics;
+
+ private Set<IEvaluationItem> matchedCheckitemSet = new HashSet<IEvaluationItem>();
+
+ private Set<IGuidelineItem> matchedGuidelineitemSet = new HashSet<IGuidelineItem>();
+
+ private Set<IGuidelineSlectionChangedListener> guidelineSelectionChangedListenerSet = new HashSet<IGuidelineSlectionChangedListener>();
+
+ private String currentMimeType = "text/html";
+
+ // TODO guideline base -> check item base On/Off
+
+ /**
+ *
+ */
+ private GuidelineHolder() {
+
+ InputStream is = GuidelineItem.class
+ .getResourceAsStream("resource/wcag10.xml");
+ readGuidelines(is);
+ is = GuidelineItem.class.getResourceAsStream("resource/section508.xml");
+ readGuidelines(is);
+ is = GuidelineItem.class.getResourceAsStream("resource/jis.xml");
+ readGuidelines(is);
+ is = GuidelineItem.class
+ .getResourceAsStream("resource/IBMGuideline.xml");
+ readGuidelines(is);
+
+ for (ICheckerInfoProvider checkerInfo : checkerInfos) {
+ InputStream[] iss = checkerInfo.getGuidelineInputStreams();
+ if (null != iss) {
+ DebugPrintUtil.devOrDebugPrintln(checkerInfo.getClass().getName()
+ + ":" + iss.length);
+ for (InputStream tmpIs : iss) {
+ readGuidelines(tmpIs);
+ }
+ }
+ }
+
+ guidelineNames = new String[guidelineSet.size()];
+ guidelineArray = new GuidelineData[guidelineSet.size()];
+ guidelineSet.toArray(guidelineArray);
+ Vector<GuidelineData> tmpV = new Vector<GuidelineData>();
+ Vector<String> tmpV2 = new Vector<String>();
+ for (int i = 0; i < guidelineArray.length; i++) {
+ GuidelineData data = guidelineArray[i];
+ guidelineNames[i] = data.getGuidelineName();
+ String[] levels = data.getLevels();
+ if (levels.length > 0) {
+ for (int j = 0; j < levels.length; j++) {
+ GuidelineData subData = data.getSubLevelData(levels[j]);
+ tmpV.add(subData);
+ String name = subData.getGuidelineName() + " ("
+ + subData.getLevelStr() + ")";
+ tmpV2.add(name);
+ }
+ } else {
+ tmpV.add(data);
+ tmpV2.add(data.getGuidelineName());
+ }
+ }
+ leafGuidelineArray = new GuidelineData[tmpV.size()];
+ tmpV.toArray(leafGuidelineArray);
+ guidelineNamesWithLevels = new String[tmpV2.size()];
+ tmpV2.toArray(guidelineNamesWithLevels);
+
+ // check item config
+
+ is = GuidelineItem.class.getResourceAsStream("resource/checkitem.xml");
+
+ CheckItemReader cir = CheckItemReader.parse(is, this);
+ Set<String> metricsNameSet = new HashSet<String>();
+ if (cir.isSucceed()) {
+ checkitemMap = cir.getCheckItemMap();
+ metricsNameSet = cir.getMetricsSet();
+
+ for (ICheckerInfoProvider checkerInfo : checkerInfos) {
+ InputStream[] iss = checkerInfo.getCheckItemInputStreams();
+ if (null != iss) {
+ System.out.println(checkerInfo.getClass().getName() + ":"
+ + iss.length);
+ for (InputStream tmpIs : iss) {
+ try {
+ cir = CheckItemReader.parse(tmpIs, this);
+ } catch (Exception e) {
+ System.out.println("can't parse: "
+ + checkerInfo.getClass().getName());
+ }
+ if (cir.isSucceed()) {
+ checkitemMap.putAll(cir.getCheckItemMap());
+ metricsNameSet.addAll(cir.getMetricsSet());
+ }
+ }
+ }
+ }
+
+ } else {
+ // TODO error report
+ }
+
+ metricsNames = new String[metricsNameSet.size()];
+ metricsNameSet.toArray(metricsNames);
+
+ enabledMetrics = new boolean[metricsNameSet.size()];
+ Arrays.fill(enabledMetrics, true);
+
+ for (Iterator i = checkitemMap.values().iterator(); i.hasNext();) {
+ EvaluationItem tmpItem = (EvaluationItem) i.next();
+ tmpItem.initTableData(guidelineNames, metricsNames);
+ }
+
+ initGuidelineNameLevel2checkItem();
+ initDisabledGuideline();
+ initDisabledMetrics();
+ initCorrespondingMetrics();
+ resetMatchedItems();
+ }
+
+ public GuidelineData[] getLeafGuidelineData() {
+ return (leafGuidelineArray);
+ }
+
+ public GuidelineData[] getGuidelineData() {
+ return (guidelineArray);
+ }
+
+ public String[] getGuidelineNamesWithLevels() {
+ return (guidelineNamesWithLevels);
+ }
+
+ public IGuidelineItem getGuidelineItem(String guidelineName, String id) {
+ if (guidelineMaps.containsKey(guidelineName)) {
+ GuidelineData data = (GuidelineData) guidelineMaps
+ .get(guidelineName);
+ return (data.getGuidelineItem(id));
+ }
+ return (null);
+ }
+
+ public EvaluationItem getCheckItem(String id) {
+ if (checkitemMap.containsKey(id)) {
+ return ((EvaluationItem) checkitemMap.get(id));
+ }
+ return (null);
+ }
+
+ public boolean setEnabledGuidelineWithLevels(boolean[] enabledItems) {
+ if (enabledItems.length != leafGuidelineArray.length) {
+ return false;
+ }
+
+ enabledCheckitemSet.clear();
+ enabledGuidelineitemSet.clear();
+
+ for (int i = 0; i < enabledItems.length; i++) {
+ GuidelineData data = leafGuidelineArray[i];
+ data.setEnabled(enabledItems[i]);
+ if (enabledItems[i]) {
+ addEnabledItems(data);
+ }
+ }
+
+ storeDisabledGuideline();
+ resetMatchedItems();
+ notifyGuidelineSelectionChange();
+ return true;
+ }
+
+ public void setEnabledGuidelines(String[] guidelineNameArray,
+ String[] levelArray) {
+
+ for (int i = 0; i < leafGuidelineArray.length; i++) {
+ leafGuidelineArray[i].setEnabled(false);
+ }
+
+ if (guidelineNameArray != null && levelArray != null
+ && guidelineNameArray.length == levelArray.length) {
+ enabledCheckitemSet.clear();
+ enabledGuidelineitemSet.clear();
+
+ for (int i = 0; i < guidelineNameArray.length; i++) {
+ if (guidelineMaps.containsKey(guidelineNameArray[i])) {
+ GuidelineData data = (GuidelineData) guidelineMaps
+ .get(guidelineNameArray[i]);
+ if (levelArray[i] == null) {
+ data.setEnabled(true);
+ addEnabledItems(data);
+ } else {
+ data = data.getSubLevelData(levelArray[i]);
+ if (data != null) {
+ data.setEnabled(true);
+ addEnabledItems(data);
+ }
+ }
+
+ }
+ }
+
+ storeDisabledGuideline();
+ resetMatchedItems();
+ notifyGuidelineSelectionChange();
+ }
+
+ }
+
+ private void addEnabledItems(GuidelineData data) {
+ if (data.isEnabled()) {
+ enabledCheckitemSet.addAll(data.getCheckItemSet());
+ enabledGuidelineitemSet.addAll(data.getGuidelineItemMap().values());
+ }
+ }
+
+ private void resetMatchedItems() {
+ matchedCheckitemSet.clear();
+ matchedGuidelineitemSet.clear();
+ matchedMetrics = new boolean[metricsNames.length];
+ Arrays.fill(matchedMetrics, false);
+
+ for (int i = 0; i < leafGuidelineArray.length; i++) {
+ GuidelineData data = leafGuidelineArray[i];
+ data.setCurrentMIMEtype(currentMimeType);
+ if (data.isMatched()) {
+ matchedCheckitemSet.addAll(data.getCheckItemSet());
+ matchedGuidelineitemSet.addAll(data.getGuidelineItemMap()
+ .values());
+ for (int j = 0; j < metricsNames.length; j++) {
+ matchedMetrics[j] = (enabledMetrics[j] && (matchedMetrics[j] | correspondingMetricsOfLeafGuideline[i][j]));
+ }
+ }
+ }
+
+ for (int i = 0; i < guidelineArray.length; i++) {
+ guidelineArray[i].setCurrentMIMEtype(currentMimeType);
+ }
+
+ // System.out.println(matchedCheckitemSet.size() + " " +
+ // matchedGuidelineitemSet.size());
+
+ }
+
+ public boolean setEnabledMetrics(boolean[] enabledMetrics) {
+ if (enabledMetrics == null
+ || enabledMetrics.length != this.enabledMetrics.length) {
+ return false;
+ }
+ this.enabledMetrics = enabledMetrics;
+ storeDisabledMetrics();
+ resetMatchedItems();
+ notifyGuidelineSelectionChange();
+ return true;
+ }
+
+ public void setEnabledMetrics(String[] enabledMetricsStringArray) {
+ if (enabledMetricsStringArray != null) {
+ Arrays.fill(enabledMetrics, false);
+
+ for (int i = 0; i < metricsNames.length; i++) {
+ for (int j = 0; j < enabledMetricsStringArray.length; j++) {
+ if (metricsNames[i]
+ .equalsIgnoreCase(enabledMetricsStringArray[j])) {
+ enabledMetrics[i] = true;
+ break;
+ }
+ }
+ }
+
+ storeDisabledMetrics();
+ resetMatchedItems();
+ notifyGuidelineSelectionChange();
+ }
+ }
+
+ public Set getMatchedCheckitemSet() {
+ // 061018 kf
+ // return enabledCheckitemSet;
+ return matchedCheckitemSet;
+ }
+
+ public String[] getMetricsNames() {
+ return metricsNames;
+ }
+
+ private void initGuidelineNameLevel2checkItem() {
+ for (Iterator i = guidelineMaps.values().iterator(); i.hasNext();) {
+ ((GuidelineData) i.next()).setCheckItems(checkitemMap.values(),
+ metricsNames);
+ }
+
+ }
+
+ private void initDisabledGuideline() {
+
+ try {
+
+ for (int i = 0; i < guidelineArray.length; i++) {
+ GuidelineData data = guidelineArray[i];
+ String[] subLevels = data.getLevels();
+ if (subLevels.length == 0) {
+ String tmpS = ICheckerPreferenceConstants.GUIDELINE_PREFIX
+ + data.getGuidelineName() + "_";
+ if (preferenceStore.contains(tmpS)
+ && preferenceStore.getBoolean(tmpS)) {
+ data.setEnabled(false);
+ } else {
+ data.setEnabled(true);
+ }
+ } else {
+ for (int j = 0; j < subLevels.length; j++) {
+ GuidelineData subData = data
+ .getSubLevelData(subLevels[j]);
+ String tmpS = ICheckerPreferenceConstants.GUIDELINE_PREFIX
+ + subData.getGuidelineName() + "_" + j;
+ if (preferenceStore.contains(tmpS)
+ || preferenceStore.getBoolean(tmpS)) {
+ subData.setEnabled(false);
+ } else {
+ subData.setEnabled(true);
+ }
+ }
+ }
+
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ private void storeDisabledGuideline() {
+ try {
+ for (int i = 0; i < guidelineArray.length; i++) {
+ GuidelineData data = guidelineArray[i];
+ String[] subLevels = data.getLevels();
+ if (subLevels.length == 0) {
+ preferenceStore.setValue(
+ ICheckerPreferenceConstants.GUIDELINE_PREFIX
+ + data.getGuidelineName() + "_", !data
+ .isEnabled());
+ } else {
+ for (int j = 0; j < subLevels.length; j++) {
+ GuidelineData subData = data
+ .getSubLevelData(subLevels[j]);
+ preferenceStore.setValue(
+ ICheckerPreferenceConstants.GUIDELINE_PREFIX
+ + subData.getGuidelineName() + "_" + j,
+ !subData.isEnabled());
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void initDisabledMetrics() {
+ try {
+ for (int j = 0; j < metricsNames.length; j++) {
+ String tmpS = ICheckerPreferenceConstants.METRICS_PREFIX
+ + metricsNames[j];
+ if (preferenceStore.contains(tmpS)
+ && preferenceStore.getBoolean(tmpS)) {
+ enabledMetrics[j] = false;
+ }
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ private void initCorrespondingMetrics() {
+ correspondingMetricsOfLeafGuideline = new boolean[leafGuidelineArray.length][metricsNames.length];
+
+ for (int i = 0; i < leafGuidelineArray.length; i++) {
+ correspondingMetricsOfLeafGuideline[i] = leafGuidelineArray[i]
+ .getCorrespondingMetrics();
+ }
+ }
+
+ private void storeDisabledMetrics() {
+ try {
+ for (int i = 0; i < enabledMetrics.length; i++) {
+ if (!enabledMetrics[i]) {
+ preferenceStore.setValue(
+ ICheckerPreferenceConstants.METRICS_PREFIX
+ + metricsNames[i], true);
+ }
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ public boolean isMatchedCheckItem(IEvaluationItem target) {
+ return (matchedCheckitemSet.contains(target));
+ }
+
+ public boolean isMatchedGuidelineItem(IGuidelineItem target) {
+ return (matchedGuidelineitemSet.contains(target));
+ }
+
+ public boolean isMatchedInTopLevel(IGuidelineItem target) {
+ if (guidelineMaps.containsKey(target.getGuidelineName())) {
+ GuidelineData data = (GuidelineData) guidelineMaps.get(target
+ .getGuidelineName());
+ return (data.isEnabled() && data.isTargetMIMEtype(currentMimeType));
+ }
+ return (false);
+ }
+
+ public boolean isEnabledMetric(String metricName) {
+ for (int i = 0; i < metricsNames.length; i++) {
+ if (metricsNames[i].equalsIgnoreCase(metricName)) {
+ return (enabledMetrics[i]);
+ }
+ }
+ return (false);
+ }
+
+ public boolean isMatchedMetric(String metricName) {
+ for (int i = 0; i < metricsNames.length; i++) {
+ if (metricsNames[i].equalsIgnoreCase(metricName)) {
+ return (matchedMetrics[i]);
+ }
+ }
+ return (false);
+ }
+
+ private void readGuidelines(InputStream is) {
+ GuidelineData data = GuidelineItemReader.getGuidelineData(is);
+ if (data != null) {
+ guidelineMaps.put(data.getGuidelineName(), data);
+ if (!guidelineSet.add(data)) {
+ guidelineSet.remove(data);
+ guidelineSet.add(data);
+ }
+ }
+ }
+
+ public boolean[] getEnabledMetrics() {
+ return enabledMetrics;
+ }
+
+ public boolean[] getMatchedMetrics() {
+ return matchedMetrics;
+ }
+
+ public void addGuidelineSelectionChangedListener(
+ IGuidelineSlectionChangedListener listener) {
+ guidelineSelectionChangedListenerSet.add(listener);
+ }
+
+ public void removeGuidelineSelectionChangedListener(
+ IGuidelineSlectionChangedListener listener) {
+ guidelineSelectionChangedListenerSet.remove(listener);
+ }
+
+ private void notifyGuidelineSelectionChange() {
+ GuidelineSelectionChangedEvent event = new GuidelineSelectionChangedEvent();
+ for (Iterator i = guidelineSelectionChangedListenerSet.iterator(); i
+ .hasNext();) {
+ ((IGuidelineSlectionChangedListener) i.next())
+ .selectionChanged(event);
+ }
+ }
+
+ public String getTargetMimeType() {
+ return currentMimeType;
+ }
+
+ public void setTargetMimeType(String currentMimeType) {
+ if (currentMimeType != null
+ && !currentMimeType.equals(this.currentMimeType)) {
+ this.currentMimeType = currentMimeType;
+ resetMatchedItems();
+ notifyGuidelineSelectionChange();
+ }
+ }
+
+ public boolean[][] getCorrespondingMetricsOfLeafGuideline() {
+ return correspondingMetricsOfLeafGuideline;
+ }
+
+ public String[] getGuidelineNames() {
+ return guidelineNames;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItem.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItem.java
new file mode 100644
index 0000000..08abcf6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItem.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+
+
+public class GuidelineItem implements IGuidelineItem {
+
+ private String guidelineName;
+
+ private String level;
+
+ private String id;
+
+ private String url;
+
+ /**
+ * @param id
+ * @param guidelineName
+ */
+ public GuidelineItem(String guidelineName) {
+ this.guidelineName = guidelineName;
+ this.id = "";
+ this.level = "";
+ this.url = "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#getGuidelineName()
+ */
+ public String getGuidelineName() {
+ return guidelineName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#getLevel()
+ */
+ public String getLevel() {
+ return level;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#getId()
+ */
+ public String getId() {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#getUrl()
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#setLevel(java.lang.String)
+ */
+ public void setLevel(String level) {
+ this.level = level;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#setId(java.lang.String)
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineItem#setUrl(java.lang.String)
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String toString() {
+ return (guidelineName + ": " + id + ",\t" + level + ",\t" + url);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItemDescription.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItemDescription.java
new file mode 100644
index 0000000..3d1ff03
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItemDescription.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.actf.visualization.eval.ICheckerInfoProvider;
+import org.eclipse.actf.visualization.eval.extensions.CheckerExtension;
+
+public class GuidelineItemDescription {
+
+ private static final String BUNDLE_NAME = "org.eclipse.actf.visualization.eval.guideline.resource.description"; //$NON-NLS-1$
+
+ private static final String EMPTY_STRING = "";
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private static GuidelineItemDescription instance;
+
+ private static ICheckerInfoProvider[] checkerInfos = CheckerExtension.getCheckerInfoProviders();
+
+ private GuidelineItemDescription() {
+ }
+
+ public static String getDescription(String key) {
+ if (instance == null) {
+ instance = new GuidelineItemDescription();
+ }
+
+ String result = getString(RESOURCE_BUNDLE, key);
+
+ if (EMPTY_STRING.equals(result)) {
+ for (ICheckerInfoProvider checkerInfo : checkerInfos) {
+ result = getString(checkerInfo.getDescriptionRB(), key);
+ if(!EMPTY_STRING.equals(result)){
+ return result;
+ }
+ }
+ DebugPrintUtil.devOrDebugPrintln("Can't find description: " + '!' + key + '!');
+ }
+ return (result);
+ }
+
+ private static String getString(ResourceBundle bundle, String key) {
+ if (null != bundle) {
+ try {
+ return bundle.getString(key);
+ } catch (MissingResourceException e) {
+ // DebugPrintUtil.devOrDebugPrintln('!' + key + '!');
+ }
+ }
+ return EMPTY_STRING;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItemReader.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItemReader.java
new file mode 100644
index 0000000..3b9cfe8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineItemReader.java
@@ -0,0 +1,321 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Stack;
+import java.util.Vector;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.ui.PlatformUI;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+
+
+
+public class GuidelineItemReader extends DefaultHandler {
+ private static final String GUIDELINE = "guideline";
+
+ private static final String MIMETYPES = "mimetypes";
+
+ private static final String MIMETYPE = "mimetype";
+
+ private static final String ITEMS = "items";
+
+ private static final String GITEM = "gItem";
+
+ private static final String LEVELS = "levels";
+
+ private static final String LEVEL = "level";
+
+ private static final String NAME = "name";
+
+ private static final String ID = "id";
+
+ private static final String HELP_URL = "helpUrl";
+
+ private static final String ORDER = "order";
+
+ private static final String DESCRIPTION = "description";
+
+ private static final String CATEGORY = "category";
+
+ // TODO id,level-> attribute url -> lang
+
+ private static final short IN_GUIDELINE = 0;
+
+ private static final short IN_LEVELS = 1;
+
+ private static final short IN_ITEMS = 2;
+
+ private static final short IN_ITEM = 3;
+
+ private static final short IN_MIMETYPES = 4;
+
+ private static final short IN_LEVEL = 5;
+
+ public static GuidelineData getGuidelineData(InputStream is) {
+ GuidelineItemReader glir = new GuidelineItemReader();
+ try {
+ SAXParserFactory spfactory = SAXParserFactory.newInstance();
+ SAXParser parser = spfactory.newSAXParser();
+ parser.parse(is, glir);
+ } catch (Exception e) {
+ }
+ if (glir.isSucceed() && glir.guidelineName.length() > 0) {
+ return (new GuidelineData(glir.guidelineName, glir.order, glir.category, glir.description, glir.levels,
+ glir.categories, glir.descriptions, glir.mimetypes, glir.itemMap));
+ } else {
+ // TODO dialog
+ return (null);
+ }
+ }
+
+ private Vector<String> levelsV = new Vector<String>();
+
+ private Vector<String> descriptionsV = new Vector<String>();
+
+ private Vector<String> categoriesV = new Vector<String>();
+
+ private Vector<String> mimeV = new Vector<String>();
+
+ private IGuidelineItem curItem = new GuidelineItem("");
+
+ private Stack<Short> statusStack = new Stack<Short>();
+
+ private String curValue;
+
+ private HashMap<String, IGuidelineItem> itemMap;
+
+ private String guidelineName;
+
+ private int order;
+
+ // for sub-levels
+ private String levels[] = new String[0];
+
+ private String descriptions[] = new String[0];
+
+ private String categories[] = new String[0];
+
+ // for root-level guideline
+ private String description = "";
+
+ private String category = "";
+
+ private String mimetypes[] = new String[0];
+
+ private short status = IN_GUIDELINE;
+
+ private boolean succeed = false;
+
+ /**
+ *
+ */
+ public GuidelineItemReader() {
+ itemMap = new HashMap<String, IGuidelineItem>();
+ }
+
+ /**
+ *
+ */
+ public void characters(char[] ch, int offset, int length) {
+
+ if (length > 0) {
+ curValue += (new String(ch, offset, length));
+ }
+ }
+
+ /**
+ *
+ */
+ public void endDocument() {
+ levels = new String[levelsV.size()];
+ levelsV.toArray(levels);
+
+ categories = new String[categoriesV.size()];
+ categoriesV.toArray(categories);
+
+ descriptions = new String[descriptionsV.size()];
+ descriptionsV.toArray(descriptions);
+
+ mimetypes = new String[mimeV.size()];
+ mimeV.toArray(mimetypes);
+
+ // TODO validation
+ succeed = true;
+ }
+
+ private String getLocalGuidelineURL(String url) {
+ if (url.startsWith("${")) {
+ int bundleNameEnd = url.indexOf("}");
+ if (bundleNameEnd==-1) return null;
+ String bundleName = url.substring(2, bundleNameEnd);
+ String href = "/" + bundleName + "/" + url.substring(bundleNameEnd+2);
+ return PlatformUI.getWorkbench().getHelpSystem().resolve(href, true).toString();
+ }
+ return null;
+ }
+
+ /**
+ *
+ */
+ public void endElement(String uri, String localName, String qName) {
+
+ // TODO
+ if (qName.equalsIgnoreCase(GITEM)) {
+ itemMap.put(curItem.getId(), curItem);
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equalsIgnoreCase(HELP_URL)) {
+ switch (status) {
+ case IN_ITEM:
+ String localUrl = getLocalGuidelineURL(curValue);
+ if (localUrl!=null) curItem.setUrl(localUrl);
+ else curItem.setUrl(curValue);
+ break;
+ default:
+ }
+ ;
+ } else if (qName.equalsIgnoreCase(DESCRIPTION)) {
+ switch (status) {
+ case IN_LEVEL:
+ descriptionsV.add(curValue);
+ break;
+ case IN_GUIDELINE:
+ description = curValue;
+ break;
+ default:
+ }
+ ;
+
+ } else if (qName.equalsIgnoreCase(CATEGORY)) {
+ switch (status) {
+ case IN_LEVEL:
+ categoriesV.add(curValue);
+ break;
+ case IN_GUIDELINE:
+ category = curValue;
+ break;
+ default:
+ }
+ ;
+ } else if (qName.equalsIgnoreCase(GUIDELINE)) {
+
+ } else if (qName.equalsIgnoreCase(MIMETYPES)) {
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equalsIgnoreCase(ITEMS)) {
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equalsIgnoreCase(LEVELS)) {
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ } else if (qName.equalsIgnoreCase(MIMETYPE)) {
+ switch (status) {
+ case IN_MIMETYPES:
+ mimeV.add(curValue);
+ break;
+ default:
+ }
+ ;
+ } else if (qName.equalsIgnoreCase(LEVEL)) {
+ if (!statusStack.isEmpty()) {
+ status = ((Short) statusStack.pop()).shortValue();
+ }
+ if (levelsV.size() > descriptionsV.size()) {
+ descriptionsV.add("");
+ }
+ if (levelsV.size() > categoriesV.size()) {
+ categoriesV.add("");
+ }
+
+ } else {
+ System.out.println("unknown element(end): " + qName);
+ }
+ }
+
+ /**
+ *
+ */
+ public void startDocument() {
+ }
+
+ /**
+ *
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) {
+
+ curValue = "";
+ if (qName.equalsIgnoreCase(GITEM)) {
+ statusStack.push(new Short(status));
+ status = IN_ITEM;
+ curItem = new GuidelineItem(guidelineName);
+ curItem.setLevel(getAttribute(attributes, LEVEL));
+ curItem.setId(getAttribute(attributes, ID));
+ } else if (qName.equalsIgnoreCase(HELP_URL)) {
+
+ } else if (qName.equalsIgnoreCase(GUIDELINE)) {
+ guidelineName = getAttribute(attributes, NAME);
+ getGuidelineOrder(attributes);
+ } else if (qName.equalsIgnoreCase(MIMETYPES)) {
+ statusStack.push(new Short(status));
+ status = IN_MIMETYPES;
+ } else if (qName.equalsIgnoreCase(LEVELS)) {
+ statusStack.push(new Short(status));
+ status = IN_LEVELS;
+ } else if (qName.equalsIgnoreCase(LEVEL)) {
+ statusStack.push(new Short(status));
+ status = IN_LEVEL;
+ levelsV.add(getAttribute(attributes, ID));
+ } else if (qName.equalsIgnoreCase(ITEMS)) {
+ statusStack.push(new Short(status));
+ status = IN_ITEMS;
+ } else {
+
+ }
+
+ }
+
+ public boolean isSucceed() {
+ return succeed;
+ }
+
+ private String getAttribute(Attributes attr, String target) {
+ String result = attr.getValue(target);
+ if (result == null) {
+ result = "";
+ }
+ return result;
+ }
+
+ private void getGuidelineOrder(Attributes attr) {
+ String idS = attr.getValue(ORDER);
+ order = Integer.MAX_VALUE;
+
+ if (guidelineName != null) {
+ try {
+ order = Integer.parseInt(idS);
+ } catch (Exception e) {
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineSelectionChangedEvent.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineSelectionChangedEvent.java
new file mode 100644
index 0000000..cbfd1dd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/GuidelineSelectionChangedEvent.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+
+public class GuidelineSelectionChangedEvent {
+
+ /**
+ *
+ */
+ public GuidelineSelectionChangedEvent() {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/IGuidelineSlectionChangedListener.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/IGuidelineSlectionChangedListener.java
new file mode 100644
index 0000000..9b5af1f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/IGuidelineSlectionChangedListener.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.util.EventListener;
+
+
+public interface IGuidelineSlectionChangedListener extends EventListener {
+ public void selectionChanged(GuidelineSelectionChangedEvent e);
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/MetricsItem.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/MetricsItem.java
new file mode 100644
index 0000000..113ce1e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/MetricsItem.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+
+public class MetricsItem {
+ private String metricsName = "";
+
+ private int score = 0;
+
+ /**
+ * @param metrics
+ * @param score
+ */
+ public MetricsItem(String metricsName, int score) {
+ this.metricsName = metricsName;
+ this.score = score;
+ }
+
+ /**
+ * @param metrics
+ * @param score
+ */
+ public MetricsItem(String metricsName, String scoreStr) {
+ this.metricsName = metricsName;
+ try{
+ int tmpScore = Integer.parseInt(scoreStr);
+ if(tmpScore>-1&&tmpScore<=100){
+ this.score = tmpScore;
+ }
+ }catch(Exception e){
+ }
+ }
+
+
+
+ public String getMetricsName() {
+ return metricsName;
+ }
+ public void setMetricsName(String metricsName) {
+ this.metricsName = metricsName;
+ }
+ public int getScore() {
+ return score;
+ }
+ public void setScore(int score) {
+ this.score = score;
+ }
+
+ public String toString(){
+ return(metricsName+" : "+score);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/MetricsNameComparator.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/MetricsNameComparator.java
new file mode 100644
index 0000000..8164db1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/MetricsNameComparator.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.guideline;
+
+import java.util.Comparator;
+
+
+
+public class MetricsNameComparator implements Comparator<String> {
+
+ public int compare(String s1, String s2) {
+
+ if(s1.equalsIgnoreCase(s2)){
+ return(0);
+ }
+
+ if(s1.equalsIgnoreCase("compliance")){
+ return(-1);
+ }
+ if(s2.equalsIgnoreCase("compliance")){
+ return(1);
+ }
+
+ if(s1.equalsIgnoreCase("listenability")){
+ return(-1);
+ }
+ if(s2.equalsIgnoreCase("listenability")){
+ return(1);
+ }
+
+ if(s1.equalsIgnoreCase("navigability")){
+ return(-1);
+ }
+ if(s2.equalsIgnoreCase("navigability")){
+ return(1);
+ }
+
+ return(s1.compareTo(s2));
+
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/IBMGuideline.xml b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/IBMGuideline.xml
new file mode 100644
index 0000000..6655d07
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/IBMGuideline.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (c) 2005, 2008 IBM Corporation and others.
+ 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:
+ IBM Corporation - initial API and implementation
+-->
+<guideline name="IBMGuideline" order="4">
+<category>Accessibility</category>
+<description>IBM Web Accessibility Checklist</description>
+<mimetypes>
+ <mimetype>text/html</mimetype>
+ <mimetype>application/xhtml+xml</mimetype>
+</mimetypes>
+<items>
+<gItem id="1">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webimages.html</helpUrl>
+</gItem>
+<gItem id="2">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webmaps.html</helpUrl>
+</gItem>
+<gItem id="3">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webgraphs.html</helpUrl>
+</gItem>
+<gItem id="4">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webmultimedia.html</helpUrl>
+</gItem>
+<gItem id="5">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webscripts.html</helpUrl>
+</gItem>
+<gItem id="6">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webapplets.html</helpUrl>
+</gItem>
+<gItem id="7">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webforms.html</helpUrl>
+</gItem>
+<gItem id="8">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webskip.html</helpUrl>
+</gItem>
+<gItem id="9">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webframes.html</helpUrl>
+</gItem>
+<gItem id="10">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webtableheaders.html</helpUrl>
+</gItem>
+<gItem id="11">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webcss.html</helpUrl>
+</gItem>
+<gItem id="12">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webcolor.html</helpUrl>
+</gItem>
+<gItem id="13">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webblinking.html</helpUrl>
+</gItem>
+<gItem id="14">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webtiming.html</helpUrl>
+</gItem>
+<gItem id="15">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webtext.html</helpUrl>
+</gItem>
+<gItem id="16">
+ <helpUrl>http://www-306.ibm.com/able/guidelines/web/webverify.html</helpUrl>
+</gItem>
+</items>
+</guideline>
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/checkitem.xml b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/checkitem.xml
new file mode 100644
index 0000000..3080134
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/checkitem.xml
@@ -0,0 +1,622 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (c) 2005, 2008 IBM Corporation and others.
+ 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:
+ IBM Corporation - initial API and implementation
+-->
+<checker-config>
+ <checkitem id="C_1000.0" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="100" />
+ </metrics>
+ <description>
+ <desc>This page seems to have several BODY elements. Please correct html.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.1" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="100" />
+ </metrics>
+ <description>
+ <desc>This page seems to have HEAD element under BODY element. Please correct html.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.2" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="100" />
+ </metrics>
+ <description>
+ <desc>This page seems to have several HTML elements. Please correct html.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.3" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="100" />
+ </metrics>
+ <description>
+ <desc>BODY elements seems to be not properly placed. Please correct html.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.4" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="100" />
+ </metrics>
+ <description>
+ <desc>This page seems to have no BODY element, or position of BODY is wrong. Please correct html.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.5" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" />
+ </metrics>
+ <description>
+ <desc>This page seems to have no BODY (or HEAD) element, or position of BODY is wrong. Please correct html.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.6" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" />
+ </metrics>
+ <description>
+ <desc>Make sure to use a public text identifier in a &lt;!DOCTYPE&gt; statement.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="C_1000.7" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="3.2" />
+ <gItem name="JIS" id="5.1(a)" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" />
+ </metrics>
+ <description>
+ <desc>Please provide &lt;!DOCTYPE&gt; statement.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_0" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="Section508" id="a" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="1" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>No alternative text for an image (If the image has no information to read out, please provide alt="".): src="".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_1" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="Section508" id="a" />
+ <gItem name="Section508" id="n" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="JIS" id="5.4(b)" />
+ <gItem name="IBMGuideline" id="7" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>No alternative text for an image button.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_2" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="Section508" id="a" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="2" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>No alternative text for an AREA: map name="".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_4" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="1" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2"/>
+ <mItem name="Listenability" score="5" />
+ </metrics>
+ <description>
+ <desc>"" is not appropriate as an ALT attribute for an image.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_5" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="7" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="5" />
+ </metrics>
+ <description>
+ <desc>"" is not appropriate as an ALT attribute for an image button.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_6" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="2" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="5" />
+ </metrics>
+ <description>
+ <desc>"" is not appropriate as an ALT attribute for an AREA.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_8" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="5" />
+ </metrics>
+ <description>
+ <desc>This intra-page link is broken because of a missing destination anchor "".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_9" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="1" />
+ <gItem name="IBMGuideline" id="2" />
+ <gItem name="IBMGuideline" id="7" />
+ </guideline>
+ <metrics>
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>Redundant text information: .</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_10" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="20" />
+ </metrics>
+ <description>
+ <desc>Provide skip-links such as "skip to main".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_12" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.2(a)" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="50" />
+ </metrics>
+ <description>
+ <desc>Provide intra-page links or use headings. Because there are no effective intra-page links or headings, arrival time to some content is over 120 seconds.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_14" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.1" />
+ <gItem name="JIS" id="5.3(g)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="5" />
+ <mItem name="Listenability" score="5" />
+ <mItem name="Navigability" score="5" />
+ </metrics>
+ <description>
+ <desc>This intra-page link, "", is not accessible, since there is no readable text.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_15" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="14.1" />
+ <gItem name="JIS" id="5.9(e)" />
+ </guideline>
+ <metrics>
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>"", is inappropriate text.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_16" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="10.2" />
+ <gItem name="WCAG" id="12.4" />
+ <gItem name="Section508" id="n" />
+ <gItem name="JIS" id="5.3(b)" />
+ <gItem name="IBMGuideline" id="7" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="2" />
+ </metrics>
+ <description>
+ <desc>No ID attribute for an input element.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_17" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="5" />
+ </metrics>
+ <description>
+ <desc>seconds is too long to get to the "skip to main" link</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_18" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="5" />
+ </metrics>
+ <description>
+ <desc>This skip-link is broken because of a missing destination anchor "".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_19" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" />
+ </metrics>
+ <description>
+ <desc>"" is not appropriate for a skip-link. It should start with "skip to ..." or "jump to ...".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_20" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="30" />
+ </metrics>
+ <description>
+ <desc>Consider providing skip-links (such as "skip to main").</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_21" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" />
+ </metrics>
+ <description>
+ <desc>There is no skip-link (such as "skip to main") in this page, but the transit time is short, seconds. Make sure of the necessity of the skip-link.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_22" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.2(a)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="10" />
+ </metrics>
+ <description>
+ <desc>Consider providing more intra-page links or using headings. Though there are some intra-page links, the arrival time to some content is over 120 seconds.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_23" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.2(a)" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="10" />
+ </metrics>
+ <description>
+ <desc>Consider providing more headings or using intra-page links. Though there are some headings, the arrival time to some content is over 120 seconds.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_24" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.2(a)" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="5" />
+ </metrics>
+ <description>
+ <desc>Consider using intra-page links or providing more headings. Though there are intra-page links and headings, the arrival time to some content is over 120 seconds.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_25" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="13.1" />
+ <gItem name="JIS" id="5.3(g)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Listenability" />
+ <mItem name="Navigability" />
+ </metrics>
+ <description>
+ <desc>This intra-page link, "", has only TITLE attribute to read out. Consider providing text in this link.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_26" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="3" />
+ </metrics>
+ <description>
+ <desc>"" is not appropriate TITLE attribute for a skip-link. It should start with "skip to ..." or "jump to ...".</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_27" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="Section508" id="a" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="1" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>"" might contain inappropriate text for ALT. (If the image has no information to read out, please provide alt="".)</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_29" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="WCAG" id="14.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="JIS" id="5.9(e)" />
+ <gItem name="IBMGuideline" id="1" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>ALT attribute "" has inappropriate space within a word (IMAGE).</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_30" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="WCAG" id="14.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="JIS" id="5.9(e)" />
+ <gItem name="IBMGuideline" id="7" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>ALT attribute "" has inappropriate space within a word (INPUT).</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_31" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="WCAG" id="14.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="JIS" id="5.9(e)" />
+ <gItem name="IBMGuideline" id="2" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>ALT attribute "" has inappropriate space within a word (AREA).</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_33" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="13.6" />
+ <gItem name="Section508" id="o" />
+ <gItem name="JIS" id="5.3(h)" />
+ <gItem name="IBMGuideline" id="8" />
+ </guideline>
+ <metrics>
+ <mItem name="Navigability" score="1" />
+ </metrics>
+ <description>
+ <desc>This intra-page link does not have destination anchor "". Please insert target anchor. (This link might work as intra-page link to page top.)</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_34" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="1.1" />
+ <gItem name="JIS" id="5.4(a)" />
+ <gItem name="IBMGuideline" id="1" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="1" />
+ <mItem name="Listenability" score="1" />
+ </metrics>
+ <description>
+ <desc>Please don't separate characters except when you want to spell out the word. (ALT attribute " ").</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_35" type="error" >
+ <metrics>
+ <mItem name="Navigability" score="5" />
+ </metrics>
+ <description>
+ <desc>This intra-page link, , might not be able to use. (Please use a small image with ALT instead of display:none or visibility:hidden)</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_36" type="error" >
+ <metrics>
+ <mItem name="Compliance" score="1" />
+ <mItem name="Listenability" score="1" />
+ </metrics>
+ <guideline>
+ <gItem name="JIS" id="5.3(g)" />
+ </guideline>
+ <description>
+ <desc>Please provide VALUE attribute for INPUT button.</desc>
+ </description>
+ </checkitem>
+ <checkitem id="B_37" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="14.1" />
+ <gItem name="JIS" id="5.9(e)" />
+ <gItem name="IBMGuideline" id="7" />
+ </guideline>
+ <metrics>
+ <mItem name="Compliance" score="2" />
+ <mItem name="Listenability" score="2" />
+ </metrics>
+ <description>
+ <desc>VALUE attribute "" has inappropriate space within a word (INPUT).</desc>
+ </description>
+ </checkitem>
+ <checkitem id="L_1" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="2.2" />
+ <gItem name="JIS" id="5.5(c)" />
+ <gItem name="JIS" id="5.6(c)" />
+ </guideline>
+ <description>
+ <desc></desc>
+ </description>
+ </checkitem>
+ <checkitem id="L_2" type="warning" >
+ <guideline>
+ <gItem name="JIS" id="5.6(b)" />
+ </guideline>
+ <description>
+ <desc></desc>
+ </description>
+ </checkitem>
+ <checkitem id="L_3" type="warning" >
+ <guideline>
+ <gItem name="WCAG" id="2.1" />
+ <gItem name="WCAG" id="2.2" />
+ <gItem name="Section508" id="c" />
+ <gItem name="JIS" id="5.5(a)" />
+ <gItem name="JIS" id="5.5(c)" />
+ <gItem name="IBMGuideline" id="12" />
+ </guideline>
+ <description>
+ <desc></desc>
+ </description>
+ </checkitem>
+ <checkitem id="L_4" type="error" >
+ <guideline>
+ <gItem name="WCAG" id="3.4" />
+ <gItem name="JIS" id="5.6(a)" />
+ </guideline>
+ <description>
+ <desc></desc>
+ </description>
+ </checkitem>
+ <checkitem id="L_5" type="error" >
+ <guideline>
+ <gItem name="JIS" id="5.6(b)" />
+ </guideline>
+ <description>
+ <desc></desc>
+ </description>
+ </checkitem>
+ <checkitem id="L_6" type="error" >
+ <guideline>
+ <gItem name="JIS" id="5.6(a)" />
+ <gItem name="JIS" id="5.6(b)" />
+ </guideline>
+ <description>
+ <desc></desc>
+ </description>
+ </checkitem>
+</checker-config>
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/description.properties b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/description.properties
new file mode 100644
index 0000000..06bcfbb
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/description.properties
@@ -0,0 +1,51 @@
+###############################################################################
+# Copyright (c) 2005, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+B_0 = No alternative text for an image (If the image has no information to read out, please provide alt="".): src="{0}".
+B_1 = No alternative text for an image button.
+B_2 = No alternative text for an AREA: map name="{0}".
+B_4 = "{0}" is not appropriate as an ALT attribute for an image.
+B_5 = "{0}" is not appropriate as an ALT attribute for an image button.
+B_6 = "{0}" is not appropriate as an ALT attribute for an AREA.
+B_8 = This intra-page link is broken because of a missing destination anchor "{0}".
+B_9 = Redundant text information: {0}
+B_10 = Provide skip-links such as "skip to main".
+B_12 = Provide intra-page links or use headings. Because there are no effective intra-page links or headings, arrival time to some content is over 120 seconds.
+B_14 = This intra-page link, "{0}", is not accessible, since there is no readable text.
+B_15 = "{0}", is inappropriate text.
+B_16 = No ID attribute for an input element.
+B_17 = {0} seconds is too long to get to the "skip to main" link
+B_18 = This skip-link is broken because of a missing destination anchor "{0}".
+B_19 = "{0}" is not appropriate for a skip-link. It should start with "skip to ..." or "jump to ...".
+B_20 = Consider providing skip-links (such as "skip to main").
+B_21 = There is no skip-link (such as "skip to main") in this page, but the transit time is short, {0} seconds. Make sure of the necessity of the skip-link.
+B_22 = Consider providing more intra-page links or using headings. Though there are some intra-page links, the arrival time to some content is over 120 seconds.
+B_23 = Consider providing more headings or using intra-page links. Though there are some headings, the arrival time to some content is over 120 seconds.
+B_24 = Consider using intra-page links or providing more headings. Though there are intra-page links and headings, the arrival time to some content is over 120 seconds.
+B_25 = This intra-page link, "{0}", has only TITLE attribute to read out. Consider providing text in this link.
+B_26 = "{0}" is not appropriate TITLE attribute for a skip-link. It should start with "skip to ..." or "jump to ...".
+B_27 = "{0}" might contain inappropriate text for ALT. (If the image has no information to read out, please provide alt="".)
+B_29 = ALT attribute "{0}" has inappropriate space within a word (IMAGE).
+B_30 = ALT attribute "{0}" has inappropriate space within a word (INPUT).
+B_31 = ALT attribute "{0}" has inappropriate space within a word (AREA).
+B_33 = This intra-page link does not have destination anchor "{0}". Please insert target anchor. (This link might work as intra-page link to page top.)
+B_34 = Please don't separate characters except when you want to spell out the word. (ALT attribute "{0}").
+B_35 = This intra-page link, {0} , might not be able to use. (Please use a small image with ALT instead of display:none or visibility:hidden)
+B_36 = Please provide VALUE attribute for INPUT button.
+B_37 = VALUE attribute "{0}" has inappropriate space within a word (INPUT).
+
+C_1000.0 = This page seems to have several BODY elements. Please correct html.
+C_1000.1 = This page seems to have HEAD element under BODY element. Please correct html.
+C_1000.2 = This page seems to have several HTML elements. Please correct html.
+C_1000.3 = BODY elements seems to be not properly placed. Please correct html.
+C_1000.4 = This page seems to have no BODY element, or position of BODY is wrong. Please correct html.
+C_1000.5 = This page seems to have no BODY (or HEAD) element, or position of BODY is wrong. Please correct html.
+C_1000.6 = Make sure to use a public text identifier in a <!DOCTYPE> statement.
+C_1000.7 = Please provide <!DOCTYPE> statement.
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/description_ja.properties b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/description_ja.properties
new file mode 100644
index 0000000..7605129
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/description_ja.properties
@@ -0,0 +1,51 @@
+###############################################################################
+# Copyright (c) 2005, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+B_0 = \u753b\u50cf\u306bALT\u5c5e\u6027\u304c\u6709\u308a\u307e\u305b\u3093 (\u3082\u3057\u8aad\u307f\u4e0a\u3052\u308b\u5fc5\u8981\u304c\u306a\u3044\u753b\u50cf\u306e\u5834\u5408\u306f alt="" \u3068\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044)\uff1a src="{0}"
+B_1 = \u753b\u50cf\u30dc\u30bf\u30f3\u306b\u4ee3\u66ff\u30c6\u30ad\u30b9\u30c8\u304c\u6709\u308a\u307e\u305b\u3093
+B_2 = AREA\u306bALT\u5c5e\u6027\u304c\u6709\u308a\u307e\u305b\u3093\uff1a map name="{0}"
+B_4 = "{0}"\u306f\u753b\u50cf\u306eALT\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u3067\u3059
+B_5 = "{0}"\u306f\u753b\u50cf\u30dc\u30bf\u30f3\u306eALT\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u3067\u3059
+B_6 = "{0}"\u306fAREA\u306eALT\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u3067\u3059
+B_8 = \u3053\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u306f\u3001\u30b8\u30e3\u30f3\u30d7\u5148\u306e\u30a2\u30f3\u30ab\u30fc"{0}"\u304c\u5b58\u5728\u3057\u306a\u3044\u305f\u3081\u5229\u7528\u3067\u304d\u307e\u305b\u3093
+B_9 = \u540c\u4e00\u30c6\u30ad\u30b9\u30c8\u306e\u7e70\u308a\u8fd4\u3057\u304c\u3042\u308a\u307e\u3059\uff1a {0}
+B_10 = "\u672c\u6587\u3078\u79fb\u52d5"\u306a\u3069\u306e\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u3092\u63d0\u4f9b\u3057\u3066\u304f\u3060\u3055\u3044\u3000\uff08\u672c\u6587\u3078\u30b8\u30e3\u30f3\u30d7\u3001\u672c\u6587\u3078\u306e\u30ea\u30f3\u30af\u7b49\uff09
+B_12 = \u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u3082\u3057\u304f\u306f\u898b\u51fa\u3057\uff08H1\u3001H2\u2026\uff09\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3000(\u52b9\u679c\u7684\u306a\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u30fb\u898b\u51fa\u3057\u304c\u7121\u3044\u305f\u3081\u3001\u5230\u7740\u306b2\u5206\u4ee5\u4e0a\u304b\u304b\u308b\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059)
+B_14 = \u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af "{0}"\u3000\u306f\u3001\u8aad\u307f\u4e0a\u3052\u53ef\u80fd\u306a\u30c6\u30ad\u30b9\u30c8\u3092\u6301\u305f\u306a\u3044\u305f\u3081\u3001\u97f3\u58f0\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093
+B_15 = "{0}"\u3000\u306f\u8aad\u307f\u4e0a\u3052\u306b\u9069\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3000(\u6587\u5b57\u9593\u306e\u7a7a\u767d\u3092\u8a70\u3081\u3066\u4e0b\u3055\u3044)
+B_16 = INPUT\u306bID\u5c5e\u6027\u304c\u6709\u308a\u307e\u305b\u3093
+B_17 = "\u672c\u6587\u3078\u79fb\u52d5"\u306a\u3069\u306e\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u3078\u306e\u5230\u9054\u306b{0}\u79d2\u3082\u304b\u304b\u308a\u307e\u3059\u3000(\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306e\u633f\u5165\u4f4d\u7f6e\u3092\u898b\u76f4\u3057\u3066\u304f\u3060\u3055\u3044)
+B_18 = \u3053\u306e\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306f\u30b8\u30e3\u30f3\u30d7\u5148\u306e\u30a2\u30f3\u30ab\u30fc"{0}"\u304c\u5b58\u5728\u3057\u306a\u3044\u305f\u3081\u5229\u7528\u3067\u304d\u307e\u305b\u3093
+B_19 = \u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306f"\u672c\u6587\u3078\u79fb\u52d5"\u3001"\u672c\u6587\u3078\u306e\u30ea\u30f3\u30af"\u7b49\u3001\u306a\u308b\u3079\u304f\u7c21\u6613\u306a\u30c6\u30ad\u30b9\u30c8\u3092\u7528\u3044\u3066\u4e0b\u3055\u3044\u3000"{0}"\u3000\u306f\u5c11\u3057\u5197\u9577\u3067\u3059
+B_20 = "\u672c\u6587\u3078\u79fb\u52d5"\u306a\u3069\u306e\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306e\u63d0\u4f9b\u3092\u691c\u8a0e\u3057\u3066\u4e0b\u3055\u3044
+B_21 = \u3053\u306e\u30da\u30fc\u30b8\u306b\u306f"\u672c\u6587\u3078\u79fb\u52d5"\u306a\u3069\u306e\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306f\u6709\u308a\u307e\u305b\u3093\u304c\u3001\u5404\u30b3\u30f3\u30c6\u30f3\u30c4\u3078\u306e\u5230\u9054\u6642\u9593\u306f\u6700\u5927\u3067\u3082{0}\u79d2\u3067\u3059\u3000(\u5fc5\u8981\u304c\u3042\u308c\u3070\u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306e\u63d0\u4f9b\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044)
+B_22 = \u3088\u308a\u591a\u304f\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u306e\u63d0\u4f9b\u3084\u3001\u898b\u51fa\u3057\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3000(\u65e2\u306b\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u304c\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5230\u9054\u306b2\u5206\u4ee5\u4e0a\u5fc5\u8981\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059)
+B_23 = \u3088\u308a\u591a\u304f\u306e\u898b\u51fa\u3057\u3092\u63d0\u4f9b\u3059\u308b\u304b\u3001\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3000(\u3053\u306e\u30da\u30fc\u30b8\u306b\u306f\u898b\u51fa\u3057\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5230\u9054\u306b2\u5206\u4ee5\u4e0a\u5fc5\u8981\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059)
+B_24 = \u3088\u308a\u591a\u304f\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u30fb\u898b\u51fa\u3057\u306e\u5229\u7528\u3092\u8003\u616e\u3057\u3066\u304f\u3060\u3055\u3044\u3000(\u65e2\u306b\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u30fb\u898b\u51fa\u3057\u304c\u7528\u3044\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5230\u9054\u306b2\u5206\u4ee5\u4e0a\u5fc5\u8981\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059)
+B_25 = \u3053\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af"{0}"\u306b\u306f\u3001\u8aad\u307f\u4e0a\u3052\u53ef\u80fd\u306a\u60c5\u5831\u3068\u3057\u3066TITLE\u5c5e\u6027\u306e\u307f\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002\u30ea\u30f3\u30af\u5185\u306b\u4f55\u3089\u304b\u306e\u30c6\u30ad\u30b9\u30c8\u60c5\u5831\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044
+B_26 = \u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306f"\u672c\u6587\u3078\u306e\u79fb\u52d5"\u3001"\u672c\u6587\u3078\u306e\u30ea\u30f3\u30af"\u7b49\u306a\u308b\u3079\u304f\u7c21\u6613\u306a\u30c6\u30ad\u30b9\u30c8\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002"{0}"\u306f\u5c11\u3057\u5197\u9577\u3067\u3059
+B_27 = "{0}"\u306f\u753b\u50cf\u306eALT\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u306a\u6587\u5b57\u3092\u542b\u3093\u3067\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\uff08\u3082\u3057\u8aad\u307f\u4e0a\u3052\u308b\u5fc5\u8981\u304c\u7121\u3044\u753b\u50cf\u306e\u5834\u5408\u306f\u3001alt=""\u3068\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\uff09
+B_29 = \u753b\u50cf\u306eALT\u5c5e\u6027\u201d{0}\u201d\u306f\u5358\u8a9e\u4e2d\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u30d6\u30e9\u30a6\u30b6\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093
+B_30 = \u753b\u50cf\u30dc\u30bf\u30f3\u306eALT\u5c5e\u6027\u201d{0}\u201d\u306f\u5358\u8a9e\u4e2d\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u30d6\u30e9\u30a6\u30b6\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093
+B_31 = AREA\u306eALT\u5c5e\u6027\u201d{0}\u201d\u306f\u5358\u8a9e\u4e2d\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u30d6\u30e9\u30a6\u30b6\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093
+B_33 = \u3053\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u306f\u30b8\u30e3\u30f3\u30d7\u5148\u306e\u30a2\u30f3\u30ab\u30fc"{0}"\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\uff0e\u30b8\u30e3\u30f3\u30d7\u5148\u306e\u30a2\u30f3\u30ab\u30fc\u3092\u633f\u5165\u3057\u3066\u304f\u3060\u3055\u3044 (\u30da\u30fc\u30b8\u306e\u5148\u982d\u3078\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u3068\u3057\u3066\u52d5\u4f5c\u3059\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059)
+B_34 = \u5358\u8a9e\u306e\u3064\u3065\u308a\u3092\u8a18\u8ff0\u3057\u305f\u3044\u5834\u5408\u4ee5\u5916\u306f\uff0c\u6587\u5b57\u3092\u7a7a\u767d\u3067\u533a\u5207\u3063\u3066\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306f\u907f\u3051\u3066\u304f\u3060\u3055\u3044 (ALT\u5c5e\u6027 "{0}")
+B_35 = \u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\uff0c {0} \uff0c\u306f\u5229\u7528\u3067\u304d\u306a\u3044\u3068\u601d\u308f\u308c\u307e\u3059\uff0e\uff08display:none\u3084display:hidden\u306e\u4ee3\u308f\u308a\u306b\uff0c\u30ea\u30f3\u30af\u5185\u306bALT\u5c5e\u6027\u3092\u4ed8\u3051\u305f\u5c0f\u3055\u306a\u753b\u50cf\u3092\u914d\u7f6e\u3059\u308b\u306a\u3069\u3057\u3066\u4e0b\u3055\u3044\uff09
+B_36 = \u30dc\u30bf\u30f3(INPUT)\u306b\u306fVALUE\u5c5e\u6027\u3092\u63d0\u4f9b\u3057\u3066\u304f\u3060\u3055\u3044
+B_37 = \u201d{0}\u201d\u30dc\u30bf\u30f3\uff08INPUT\u306eVALUE\u5c5e\u6027\uff09\u306f\u5358\u8a9e\u4e2d\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u30d6\u30e9\u30a6\u30b6\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093
+
+C_1000.0 = \u3053\u306e\u30da\u30fc\u30b8\u306b\u306f\u8907\u6570\u306eBODY\u8981\u7d20\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.1 = BODY\u8981\u7d20\u306e\u4e2d\u306bHEAD\u8981\u7d20\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.2 = \u3053\u306e\u30da\u30fc\u30b8\u306b\u306f\u8907\u6570\u306eHTML\u8981\u7d20\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.3 = BODY\u8981\u7d20\u306e\u4f4d\u7f6e\u304c\u6b63\u3057\u304f\u306a\u3044\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.4 = \u3053\u306e\u30da\u30fc\u30b8\u306b\u306fBODY\u8981\u7d20\u304c\u7121\u3044\u304b\uff0c\u8aa4\u3063\u305f\u4f4d\u7f6e\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.5 = \u3053\u306e\u30da\u30fc\u30b8\u306b\u306fBODY\u8981\u7d20\u3082\u3057\u304f\u306fHEAD\u8981\u7d20\u304c\u7121\u3044\u304b\uff0c\u8aa4\u3063\u305f\u4f4d\u7f6e\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.6 = <!DOCTYPE> \u5ba3\u8a00\u3067\u306f\u3001\u4e00\u822c\u306b\u516c\u958b\u3055\u308c\u305fDTD\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044
+C_1000.7 = <!DOCTYPE> \u5ba3\u8a00\u3092\u63d0\u4f9b\u3057\u3066\u304f\u3060\u3055\u3044
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/jis.xml b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/jis.xml
new file mode 100644
index 0000000..0b29c40
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/jis.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (c) 2005, 2008 IBM Corporation and others.
+ 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:
+ IBM Corporation - initial API and implementation
+-->
+<guideline name="JIS" order="3">
+<category>Accessibility</category>
+<description>Japanese Industrial Standard (JIS X 8341-3)</description>
+<mimetypes>
+ <mimetype>text/html</mimetype>
+ <mimetype>application/xhtml+xml</mimetype>
+</mimetypes>
+<items>
+<gItem id="5.1(a)">
+</gItem>
+<gItem id="5.1(b)">
+</gItem>
+<gItem id="5.2(a)">
+</gItem>
+<gItem id="5.2(b)">
+</gItem>
+<gItem id="5.2(c)">
+</gItem>
+<gItem id="5.2(d)">
+</gItem>
+<gItem id="5.2(e)">
+</gItem>
+<gItem id="5.2(f)">
+</gItem>
+<gItem id="5.2(g)">
+</gItem>
+<gItem id="5.3(a)">
+</gItem>
+<gItem id="5.3(b)">
+</gItem>
+<gItem id="5.3(c)">
+</gItem>
+<gItem id="5.3(d)">
+</gItem>
+<gItem id="5.3(e)">
+</gItem>
+<gItem id="5.3(f)">
+</gItem>
+<gItem id="5.3(g)">
+</gItem>
+<gItem id="5.3(h)">
+</gItem>
+<gItem id="5.3(i)">
+</gItem>
+<gItem id="5.4(a)">
+</gItem>
+<gItem id="5.4(b)">
+</gItem>
+<gItem id="5.4(c)">
+</gItem>
+<gItem id="5.4(d)">
+</gItem>
+<gItem id="5.4(e)">
+</gItem>
+<gItem id="5.5(a)">
+</gItem>
+<gItem id="5.5(b)">
+</gItem>
+<gItem id="5.5(c)">
+</gItem>
+<gItem id="5.6(a)">
+</gItem>
+<gItem id="5.6(b)">
+</gItem>
+<gItem id="5.6(c)">
+</gItem>
+<gItem id="5.7(a)">
+</gItem>
+<gItem id="5.7(b)">
+</gItem>
+<gItem id="5.8(a)">
+</gItem>
+<gItem id="5.8(b)">
+</gItem>
+<gItem id="5.9(a)">
+</gItem>
+<gItem id="5.9(b)">
+</gItem>
+<gItem id="5.9(c)">
+</gItem>
+<gItem id="5.9(d)">
+</gItem>
+<gItem id="5.9(e)">
+</gItem>
+<gItem id="5.9(f)">
+</gItem>
+</items>
+</guideline>
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/section508.xml b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/section508.xml
new file mode 100644
index 0000000..fdff663
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/section508.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (c) 2005, 2008 IBM Corporation and others.
+ 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:
+ IBM Corporation - initial API and implementation
+-->
+<guideline name="Section508" order="2">
+<category>Accessibility</category>
+<description>US Section 508 of the Rehabilitation Act</description>
+<mimetypes>
+ <mimetype>text/html</mimetype>
+ <mimetype>application/xhtml+xml</mimetype>
+</mimetypes>
+<items>
+<gItem id="a">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(a)</helpUrl>
+</gItem>
+<gItem id="b">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(b)</helpUrl>
+</gItem>
+<gItem id="c">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(c)</helpUrl>
+</gItem>
+<gItem id="d">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(d)</helpUrl>
+</gItem>
+<gItem id="e">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(e)</helpUrl>
+</gItem>
+<gItem id="f">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(f)</helpUrl>
+</gItem>
+<gItem id="g">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(g)</helpUrl>
+</gItem>
+<gItem id="h">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(h)</helpUrl>
+</gItem>
+<gItem id="i">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(i)</helpUrl>
+</gItem>
+<gItem id="j">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(j)</helpUrl>
+</gItem>
+<gItem id="k">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(k)</helpUrl>
+</gItem>
+<gItem id="l">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(l)</helpUrl>
+</gItem>
+<gItem id="m">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(m)</helpUrl>
+</gItem>
+<gItem id="n">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(n)</helpUrl>
+</gItem>
+<gItem id="o">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(o)</helpUrl>
+</gItem>
+<gItem id="p">
+ <helpUrl>http://www.access-board.gov/sec508/guide/1194.22.htm#(p)</helpUrl>
+</gItem>
+</items>
+</guideline>
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/wcag10.xml b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/wcag10.xml
new file mode 100644
index 0000000..9a55647
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/guideline/resource/wcag10.xml
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (c) 2005, 2008 IBM Corporation and others.
+ 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:
+ IBM Corporation - initial API and implementation
+-->
+<guideline name="WCAG" order="1">
+<category>Accessibility</category>
+<description>W3C Web Content Accessibility Guidelines (WCAG) 1.0</description>
+<levels>
+ <level id="P1">
+ <category>Accessibility</category>
+ <description>W3C Web Content Accessibility Guidelines (WCAG) 1.0 (P1) </description>
+ </level>
+ <level id="P2">
+ <category>Accessibility</category>
+ <description>W3C Web Content Accessibility Guidelines (WCAG) 1.0 (P2) </description>
+ </level>
+ <level id="P3">
+ <category>Accessibility</category>
+ <description>W3C Web Content Accessibility Guidelines (WCAG) 1.0 (P3) </description>
+ </level>
+</levels>
+<mimetypes>
+ <mimetype>text/html</mimetype>
+ <mimetype>application/xhtml+xml</mimetype>
+</mimetypes>
+<items>
+<gItem id="1.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-text-equivalent</helpUrl>
+</gItem>
+<gItem id="2.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-color-convey</helpUrl>
+</gItem>
+<gItem id="4.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-identify-changes</helpUrl>
+</gItem>
+<gItem id="6.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-order-style-sheets</helpUrl>
+</gItem>
+<gItem id="6.2" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-dynamic-source</helpUrl>
+</gItem>
+<gItem id="7.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-avoid-flicker</helpUrl>
+</gItem>
+<gItem id="14.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-simple-and-straightforward</helpUrl>
+</gItem>
+<gItem id="1.2" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-redundant-server-links</helpUrl>
+</gItem>
+<gItem id="9.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-client-side-maps</helpUrl>
+</gItem>
+<gItem id="5.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-table-headers</helpUrl>
+</gItem>
+<gItem id="5.2" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-table-structure</helpUrl>
+</gItem>
+<gItem id="12.1" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-frame-titles</helpUrl>
+</gItem>
+<gItem id="6.3" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-scripts</helpUrl>
+</gItem>
+<gItem id="1.3" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-auditory-descriptions</helpUrl>
+</gItem>
+<gItem id="1.4" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-synchronize-equivalents</helpUrl>
+</gItem>
+<gItem id="11.4" level="P1">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-alt-pages</helpUrl>
+</gItem>
+<gItem id="2.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-color-contrast</helpUrl>
+</gItem>
+<gItem id="3.1" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-use-markup</helpUrl>
+</gItem>
+<gItem id="3.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-identify-grammar</helpUrl>
+</gItem>
+<gItem id="3.3" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-style-sheets</helpUrl>
+</gItem>
+<gItem id="3.4" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-relative-units</helpUrl>
+</gItem>
+<gItem id="3.5" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-logical-headings</helpUrl>
+</gItem>
+<gItem id="3.6" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-list-structure</helpUrl>
+</gItem>
+<gItem id="3.7" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-quotes</helpUrl>
+</gItem>
+<gItem id="6.5" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-fallback-page</helpUrl>
+</gItem>
+<gItem id="7.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-avoid-blinking</helpUrl>
+</gItem>
+<gItem id="7.4" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-no-periodic-refresh</helpUrl>
+</gItem>
+<gItem id="7.5" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-no-auto-forward</helpUrl>
+</gItem>
+<gItem id="10.1" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-avoid-pop-ups</helpUrl>
+</gItem>
+<gItem id="11.1" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-latest-w3c-specs</helpUrl>
+</gItem>
+<gItem id="11.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-avoid-deprecated</helpUrl>
+</gItem>
+<gItem id="12.3" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-group-information</helpUrl>
+</gItem>
+<gItem id="13.1" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-meaningful-links</helpUrl>
+</gItem>
+<gItem id="13.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-use-metadata</helpUrl>
+</gItem>
+<gItem id="13.3" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-site-description</helpUrl>
+</gItem>
+<gItem id="13.4" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-clear-nav-mechanism</helpUrl>
+</gItem>
+<gItem id="5.3" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-avoid-table-for-layout</helpUrl>
+</gItem>
+<gItem id="5.4" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-table-layout</helpUrl>
+</gItem>
+<gItem id="12.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-frame-longdesc</helpUrl>
+</gItem>
+<gItem id="10.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-unassociated-labels</helpUrl>
+</gItem>
+<gItem id="12.4" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-associate-labels</helpUrl>
+</gItem>
+<gItem id="6.4" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-keyboard-operable-scripts</helpUrl>
+</gItem>
+<gItem id="7.3" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-avoid-movement</helpUrl>
+</gItem>
+<gItem id="8.1" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-directly-accessible</helpUrl>
+</gItem>
+<gItem id="9.2" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-keyboard-operable</helpUrl>
+</gItem>
+<gItem id="9.3" level="P2">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-device-independent-events</helpUrl>
+</gItem>
+<gItem id="4.2" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-expand-abbr</helpUrl>
+</gItem>
+<gItem id="4.3" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-identify-lang</helpUrl>
+</gItem>
+<gItem id="9.4" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-tab-order</helpUrl>
+</gItem>
+<gItem id="9.5" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-keyboard-shortcuts</helpUrl>
+</gItem>
+<gItem id="10.5" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-divide-links</helpUrl>
+</gItem>
+<gItem id="11.3" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-content-preferences</helpUrl>
+</gItem>
+<gItem id="13.5" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-nav-bar</helpUrl>
+</gItem>
+<gItem id="13.6" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-group-links</helpUrl>
+</gItem>
+<gItem id="13.7" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-searches</helpUrl>
+</gItem>
+<gItem id="13.8" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-front-loading</helpUrl>
+</gItem>
+<gItem id="13.9" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-bundled-version</helpUrl>
+</gItem>
+<gItem id="13.10" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-skip-over-ascii</helpUrl>
+</gItem>
+<gItem id="14.2" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-icons</helpUrl>
+</gItem>
+<gItem id="14.3" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-consistent-style</helpUrl>
+</gItem>
+<gItem id="1.5" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-redundant-client-links</helpUrl>
+</gItem>
+<gItem id="5.5" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-table-summaries</helpUrl>
+</gItem>
+<gItem id="5.6" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-abbreviate-labels</helpUrl>
+</gItem>
+<gItem id="10.3" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-linear-tables</helpUrl>
+</gItem>
+<gItem id="10.4" level="P3">
+ <helpUrl>http://www.w3.org/TR/WAI-WEBCONTENT/wai-pageauth.html#tech-place-holders</helpUrl>
+</gItem>
+</items>
+</guideline>
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/HtmlEvalUtil.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/HtmlEvalUtil.java
new file mode 100644
index 0000000..1477b55
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/HtmlEvalUtil.java
@@ -0,0 +1,747 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Vector;
+
+import org.eclipse.actf.util.xpath.XPathUtil;
+import org.eclipse.actf.visualization.eval.EvaluationPreferencesUtil;
+import org.eclipse.actf.visualization.eval.html.statistics.FlashData;
+import org.eclipse.actf.visualization.eval.html.statistics.HeadingsData;
+import org.eclipse.actf.visualization.eval.html.statistics.IPageStatisticsTag;
+import org.eclipse.actf.visualization.eval.html.statistics.ImageStatData;
+import org.eclipse.actf.visualization.eval.html.statistics.PageData;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.html.HTMLImageElement;
+
+public class HtmlEvalUtil extends HtmlTagUtil {
+
+ private static final int LONG_TEXT_NUM = 200; // TODO check
+
+ private static final String[] HEADING_LEVEL = {
+ "h1", "h2", "h3", "h4", "h5", "h6" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+
+ public static final String[] EVENT_MOUSE_BUTTON = { ATTR_ONCLICK,
+ ATTR_ONDBLCLICK, ATTR_ONMOUSEUP, ATTR_ONMOUSEDOWN };
+
+ public static final String[] EVENT_MOUSE_FOCUS = { ATTR_ONMOUSEOVER,
+ ATTR_ONMOUSEOUT, ATTR_ONMOUSEMOVE };
+
+ public static final String[] EVENT_ON_KEY = { ATTR_ONKEYDOWN,
+ ATTR_ONKEYPRESS, ATTR_ONKEYUP };
+
+ public static final String[] EVENT_LOAD = { ATTR_ONLOAD, ATTR_ONUNLOAD,
+ ATTR_ONABORT, ATTR_ONERROR };
+
+ public static final String[] EVENT_WINDOW = { ATTR_ONRESIZE, ATTR_ONMOVE,
+ ATTR_ONDRAGDROP };
+
+ public static final String[] EVENT_FOCUS = { ATTR_ONFOCUS, ATTR_ONBLUR,
+ ATTR_ONSELECT };
+
+ private Document target;
+
+ private Document resultDoc;
+
+ private Document origDom;
+
+ private Document ieDom;
+
+ private URL baseUrl;
+
+ private Map document2IdMap;
+
+ private boolean isDBCS;
+
+ private boolean isIEDom;
+
+ private boolean hasAwithHref = false;
+
+ private boolean hasJavascript = false;
+
+ private Element[] aWithHref_elements;
+
+ private String[] aWithHref_hrefs;
+
+ private String[] aWithHref_strings;
+
+ private HTMLImageElement[] img_elements;
+
+ private Element[] table_elements;
+
+ private Element[] body_elements;
+
+ private Element[] frame_elements;
+
+ private Element[] iframe_elements;
+
+ private Element[] object_elements;
+
+ private Element[] parent_table_elements;
+
+ private Element[] bottom_data_tables;
+
+ private Element[] bottom_1row1col_tables;
+
+ private Element[] bottom_notdata_tables;
+
+ private Element[] headings;
+
+ private Element[] embed_elements;
+
+ private Element[] script_elements;
+
+ private Element[] javascript_elements;
+
+ private Element[] eventMouseButtonElements; // on Click/Dblclick, onMouse
+
+ // up/down
+
+ private Element[] eventMouseFocusElements; // onMouse over/out/move
+
+ private Element[] eventOnKeyElements; // onKey Down/up/press
+
+ private Element[] eventLoadElements; // on load/unload/abort/error
+
+ private Element[] eventWindowElements; // on Resize/Mode/DragDrop
+
+ private Element[] eventFocusElements; // on Focus/Blur/Select
+
+ private Element[] javascriptHref_elements;
+
+ private String[] javascriptHref_hrefs;
+
+ private String[] javascriptHref_strings;
+
+ private Set blockEleSet;
+
+ private String curUrl;
+
+ private double invalidLinkRatio;
+
+ private PageData pageData;
+
+ private int invisibleElementCount = 0;
+
+ private String[] invisibleLinkStrings = new String[0];
+
+ private HashSet<String> notExistHrefSet = new HashSet<String>();
+
+ public HtmlEvalUtil(Document target, Document resultDoc, String curUrl,
+ Map document2IdMap, Document origDom, Document ieDom,
+ PageData pageData, boolean isDBCS, boolean isIEDom) {
+ this(target, resultDoc, curUrl, document2IdMap, origDom, ieDom,
+ pageData, 0, null, isDBCS, isIEDom);
+ }
+
+ /**
+ *
+ */
+ public HtmlEvalUtil(Document target, Document resultDoc, String curUrl,
+ Map document2IdMap, Document origDom, Document ieDom,
+ PageData pageData, int invisibleElementCount,
+ String[] invisibleLinkStrings, boolean isDBCS, boolean isIEDom) {
+ this.target = target;
+ this.resultDoc = resultDoc;
+
+ this.origDom = origDom;
+ this.ieDom = ieDom;
+ this.isIEDom = isIEDom;
+
+ this.pageData = pageData;
+
+ this.curUrl = curUrl;
+ baseUrl = null;
+ try {
+ baseUrl = new URL(curUrl); // ToDo handle base
+ } catch (MalformedURLException e) {
+ // e.printStackTrace();
+ }
+
+ this.invalidLinkRatio = 0;
+ this.invisibleElementCount = invisibleElementCount;
+ if (invisibleLinkStrings != null) {
+ this.invisibleLinkStrings = invisibleLinkStrings;
+ }
+
+ this.document2IdMap = document2IdMap;
+ // this.html2ViewMapData = html2ViewMapData;
+
+ this.isDBCS = isDBCS;
+
+ // prepare freq use elements
+ // System.out.println(df.format(new Date(System.currentTimeMillis()))
+ // + ": checker engine init");
+
+ NodeList tmpNL = XPathUtil.evalXPathNodeList(target, ".//" + "a"
+ + XPathUtil.predAttExists(ATTR_HREF));
+ int length = tmpNL.getLength();
+
+ if (length > 0) {
+ hasAwithHref = true;
+ }
+
+ aWithHref_elements = new Element[length];
+ aWithHref_hrefs = new String[length];
+ aWithHref_strings = new String[length];
+
+ for (int i = 0; i < length; i++) {
+ Element tmpE = (Element) tmpNL.item(i);
+ aWithHref_elements[i] = tmpE;
+ aWithHref_hrefs[i] = tmpE.getAttribute(ATTR_HREF);
+ aWithHref_strings[i] = getTextAltDescendant(tmpE);
+ }
+
+ // System.out.println(df.format(new Date(System.currentTimeMillis()))
+ // + ": href fin");
+
+ tmpNL = target.getElementsByTagName("img"); //$NON-NLS-1$
+ length = tmpNL.getLength();
+ img_elements = new HTMLImageElement[length];
+ Vector<IPageStatisticsTag> tmpV = new Vector<IPageStatisticsTag>();
+ HashMap<HTMLImageElement, ImageStatData> tmpMap = new HashMap<HTMLImageElement, ImageStatData>();
+ HashMap<Element, ImageStatData> linkImgMap = new HashMap<Element, ImageStatData>();
+ for (int i = 0; i < length; i++) {
+ img_elements[i] = (HTMLImageElement) tmpNL.item(i);
+ ImageStatData isd = new ImageStatData(img_elements[i], baseUrl);
+ tmpV.add(isd);
+ tmpMap.put(img_elements[i], isd);
+ if (isd.getAncestorLink() != null) {
+ linkImgMap.put(isd.getAncestorLink(), isd);
+ }
+ }
+ pageData.setImageDataV(tmpV);
+ pageData.setImageDataMap(tmpMap);
+ pageData.setLinkImageDataMap(linkImgMap);
+
+ // TODO use XPath
+ tmpNL = target.getElementsByTagName("table"); //$NON-NLS-1$
+ length = tmpNL.getLength();
+ table_elements = new Element[length];
+ Vector<Element> bottomV = new Vector<Element>();
+ Vector<Element> parentV = new Vector<Element>();
+ Vector<Element> b1row1colV = new Vector<Element>();
+ Vector<Element> bNotDataV = new Vector<Element>();
+ for (int i = 0; i < length; i++) {
+ table_elements[i] = (Element) tmpNL.item(i);
+ if (table_elements[i].getElementsByTagName("table").getLength() //$NON-NLS-1$
+ == 0) {
+ if (is1Row1ColTable(table_elements[i])) {
+ b1row1colV.add(table_elements[i]);
+ } else if (isDataTable(table_elements[i])) {
+ bottomV.add(table_elements[i]);
+ } else {
+ bNotDataV.add(table_elements[i]);
+ }
+ } else {
+ parentV.add(table_elements[i]);
+ }
+ }
+ bottom_data_tables = new Element[bottomV.size()];
+ bottom_1row1col_tables = new Element[b1row1colV.size()];
+ bottom_notdata_tables = new Element[bNotDataV.size()];
+ parent_table_elements = new Element[parentV.size()];
+ bottomV.toArray(bottom_data_tables);
+ b1row1colV.toArray(bottom_1row1col_tables);
+ bNotDataV.toArray(bottom_notdata_tables);
+ parentV.toArray(parent_table_elements);
+
+ body_elements = getElementsArray(target, "body");
+ frame_elements = getElementsArray(target, "frame");
+ iframe_elements = getElementsArray(target, "iframe");
+
+ HashSet<Element> embedInObjectSet = new HashSet<Element>();
+
+ // TODO ieDOM
+ tmpNL = target.getElementsByTagName("object"); //$NON-NLS-1$
+ length = tmpNL.getLength();
+ object_elements = new Element[length];
+ for (int i = 0; i < length; i++) {
+ object_elements[i] = (Element) tmpNL.item(i);
+ if (FLASH_OBJECT.equalsIgnoreCase(object_elements[i]
+ .getAttribute("classid"))) {
+ // TODO check codebase
+ // TODO get width hight align ... loop quality...
+ NodeList paramNL = object_elements[i]
+ .getElementsByTagName("param");
+ String src = "";
+ for (int j = 0; j < paramNL.getLength(); j++) {
+ try {
+ Element tmpE = (Element) paramNL.item(j);
+ String name = tmpE.getAttribute("name");
+ String value = tmpE.getAttribute("value");
+ if (name.equalsIgnoreCase("movie")) {
+ src = value;
+ }
+ } catch (Exception e) {
+
+ }
+ }
+ if (src != null && src.length() > 0) {
+ FlashData flashD = new FlashData(src, true);
+ pageData.addFlashData(flashD);
+
+ NodeList embedNL = object_elements[i]
+ .getElementsByTagName("embed");
+ for (int j = 0; j < embedNL.getLength(); j++) {
+ Element tmpE = (Element) embedNL.item(j);
+ if (FLASH_TYPE.equalsIgnoreCase(tmpE
+ .getAttribute("type"))) {
+ // TODO check PLUGINSPAGE
+ // TODO get width hight align ... loop quality...
+
+ String src2 = tmpE.getAttribute("src");
+ if (src2 != null && src2.length() > 0) {
+ if (src.equalsIgnoreCase(src2)) {
+ embedInObjectSet.add(tmpE);
+ flashD.setWithEmbed(true);
+ } else {
+ pageData.addFlashData(new FlashData(src,
+ false));
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+ }
+
+ blockEleSet = getBlockElementSet();
+
+ embed_elements = getElementsArray(target, "embed");
+ for (int i = 0; i < embed_elements.length; i++) {
+ Element tmpE = embed_elements[i];
+ if (!embedInObjectSet.contains(tmpE)
+ && FLASH_TYPE.equals(tmpE.getAttribute("type"))) {
+ // TODO check PLUGINSPAGE
+ // TODO get width hight align ... loop quality...
+ String src = tmpE.getAttribute("src");
+ if (src != null && src.length() > 0) {
+ pageData.addFlashData(new FlashData(src, false));
+ }
+ }
+ }
+
+ NodeList headingsNL = XPathUtil.evalXPathNodeList(target,
+ "//h1|//h2|//h3|//h4|//h5|//h6");
+ length = headingsNL.getLength();
+ tmpV = new Vector<IPageStatisticsTag>();
+ headings = new Element[headingsNL.getLength()];
+ for (int i = 0; i < length; i++) {
+ Element tmpE = (Element) headingsNL.item(i);
+ headings[i] = tmpE;
+ tmpV.add(new HeadingsData(tmpE, getTextAltDescendant(tmpE)));
+ }
+ pageData.setHeadingsV(tmpV);
+
+ collectScriptElements();
+ calcDomDifference();
+ }
+
+ private Element[] getElementsArray(Document target, String tagName) {
+ NodeList tmpNL = target.getElementsByTagName(tagName);
+ int length = tmpNL.getLength();
+ Element[] result = new Element[length];
+ for (int i = 0; i < length; i++) {
+ result[i] = (Element) tmpNL.item(i);
+ }
+ return (result);
+ }
+
+ private Element[] getElementsArrayByXPath(Document target, String xpath) {
+ NodeList tmpNL = XPathUtil.evalXPathNodeList(target, xpath);
+ int length = tmpNL.getLength();
+ Element[] result = new Element[length];
+ for (int i = 0; i < length; i++) {
+ Element tmpE = (Element) tmpNL.item(i);
+ result[i] = tmpE;
+ }
+ return result;
+ }
+
+ private void collectScriptElements() {
+ script_elements = getElementsArray(target, "script");
+
+ javascript_elements = getElementsArrayByXPath(target,
+ "//script[@type=\"text/javascript\"]");
+
+ // allEventElements = getElementsArrayByXPath(
+ // target,
+ // "//*[@onclick or @ondblclick or @onmouseup or @onmousedown or
+ // @onmouseover or @onmouseout or @onmousemove or
+ // @onkeydown or @onkeyup or @onkeypress or @onload or @onunload or
+ // @onabort or @onerror or @onresize or @onmove
+ // or @ondragdrop or @onfocus or @onblur or @onselect]");
+
+ eventMouseButtonElements = getElementsArrayByXPath(target,
+ "//*[@onclick or @ondblclick or @onmouseup or @onmousedown]");
+ eventMouseFocusElements = getElementsArrayByXPath(target,
+ "//*[@onmouseover or @onmouseout or @onmousemove]");
+ eventOnKeyElements = getElementsArrayByXPath(target,
+ "//*[@onkeydown or @onkeyup or @onkeypress]");
+ eventLoadElements = getElementsArrayByXPath(target,
+ "//*[@onload or @onunload or @onabort or @onerror]");
+ eventWindowElements = getElementsArrayByXPath(target,
+ "//*[@onresize or @onmove or @ondragdrop]");
+ eventFocusElements = getElementsArrayByXPath(target,
+ "//*[@onfocus or @onblur or @onselect]");
+
+ Vector<Element> tmpV1 = new Vector<Element>();
+ Vector<String> tmpV2 = new Vector<String>();
+ Vector<String> tmpV3 = new Vector<String>();
+ for (int i = 0; i < aWithHref_hrefs.length; i++) {
+ if (aWithHref_hrefs[i].startsWith("javascript:")) {
+ tmpV1.add(aWithHref_elements[i]);
+ tmpV2.add(aWithHref_hrefs[i]);
+ tmpV3.add(aWithHref_strings[i]);
+ }
+ }
+
+ int size = tmpV1.size();
+ javascriptHref_elements = new Element[size];
+ javascriptHref_hrefs = new String[size];
+ javascriptHref_strings = new String[size];
+ tmpV1.toArray(javascriptHref_elements);
+ tmpV2.toArray(javascriptHref_hrefs);
+ tmpV3.toArray(javascriptHref_strings);
+
+ int javascriptNum = javascript_elements.length
+ + eventFocusElements.length + eventLoadElements.length
+ + eventMouseButtonElements.length
+ + eventMouseFocusElements.length + eventOnKeyElements.length
+ + eventWindowElements.length + javascriptHref_hrefs.length;
+
+ hasJavascript = (javascriptNum > 0);
+ pageData.setHasJavascript(hasJavascript);
+ }
+
+ private void calcDomDifference() {
+
+ if (EvaluationPreferencesUtil.isOriginalDOM()) {
+ // target = orig DOM
+ if (isIEDom||null==ieDom) {
+ // parse error
+ return;
+ }
+
+ TreeSet<String> existSet = new TreeSet<String>(Arrays
+ .asList(aWithHref_hrefs));
+ // trim()?
+
+ NodeList ieNL = XPathUtil.evalXPathNodeList(ieDom, ".//" + "a"
+ + XPathUtil.predAttExists(ATTR_HREF));
+ int size = ieNL.getLength();
+ for (int i = 0; i < size; i++) {
+ Element tmpE = (Element) ieNL.item(i);
+ String tmpS = tmpE.getAttribute(ATTR_HREF);
+ if (!existSet.contains(tmpS)) {
+ notExistHrefSet.add(tmpS);
+ }
+ }
+ } else {
+ // target = IE DOM
+ NodeList orgNL = XPathUtil.evalXPathNodeList(origDom, ".//" + "a"
+ + XPathUtil.predAttExists(ATTR_HREF));
+ int size = orgNL.getLength();
+ TreeSet<String> existSet = new TreeSet<String>();
+ for (int i = 0; i < size; i++) {
+ existSet.add(((Element) orgNL.item(i)).getAttribute(ATTR_HREF));
+ }
+
+ size = aWithHref_hrefs.length;
+ for (int i = 0; i < size; i++) {
+ if (!existSet.contains(aWithHref_hrefs[i])) {
+ notExistHrefSet.add(aWithHref_hrefs[i]);
+ }
+ }
+
+ }
+
+ }
+
+ private boolean is1Row1ColTable(Element el) {
+ NodeList cellNl = el.getElementsByTagName("tr"); //$NON-NLS-1$
+ if (cellNl.getLength() <= 1) {
+ return true;
+ } else {
+ boolean bMultiCol = false;
+ int length = cellNl.getLength();
+ for (int i = 0; i < length; i++) {
+ NodeList thNl = ((Element) cellNl.item(i))
+ .getElementsByTagName("th"); //$NON-NLS-1$
+ NodeList tdNl = ((Element) cellNl.item(i))
+ .getElementsByTagName("td"); //$NON-NLS-1$
+ if ((thNl.getLength() + tdNl.getLength()) > 1) {
+ bMultiCol = true;
+ break;
+ }
+ }
+ if (!bMultiCol) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isDataTable(Element el) {
+ if (hasFormControl(el)) {
+ return false;
+ }
+
+ NodeList cellNl = el.getElementsByTagName("td"); //$NON-NLS-1$
+ if (cellNl.getLength() == 0) {
+ return false;
+ } else {
+ int length = cellNl.getLength();
+ for (int j = 0; j < length; j++) {
+ if (!isDataCell((Element) cellNl.item(j))) {
+ return false;
+ }
+ }
+
+ cellNl = el.getElementsByTagName("th"); //$NON-NLS-1$
+ length = cellNl.getLength();
+ for (int j = 0; j < length; j++) {
+ if (!isDataCell((Element) cellNl.item(j))) {
+ return false;
+ }
+ } // image?
+ }
+
+ return true;
+ }
+
+ private boolean hasFormControl(Element formEl) {
+ NodeList nl = formEl.getElementsByTagName("form"); //$NON-NLS-1$
+ if (nl.getLength() > 0)
+ return true;
+ nl = formEl.getElementsByTagName("input"); //$NON-NLS-1$
+ if (nl.getLength() > 0)
+ return true;
+ nl = formEl.getElementsByTagName("select"); //$NON-NLS-1$
+ if (nl.getLength() > 0)
+ return true;
+ nl = formEl.getElementsByTagName("textarea"); //$NON-NLS-1$
+ if (nl.getLength() > 0)
+ return true;
+ nl = formEl.getElementsByTagName("html:text"); //$NON-NLS-1$
+ if (nl.getLength() > 0)
+ return true;
+ nl = formEl.getElementsByTagName("html:radio"); //$NON-NLS-1$
+ if (nl.getLength() > 0)
+ return true;
+ return false;
+ }
+
+ private boolean isDataCell(Element el) {
+ if (getTextAltDescendant(el).length() > LONG_TEXT_NUM) {
+ return false;
+ }
+ NodeList aNl = el.getElementsByTagName("a"); //$NON-NLS-1$
+ NodeList liNl = el.getElementsByTagName("li"); //$NON-NLS-1$
+ NodeList imgNl = el.getElementsByTagName("img"); //$NON-NLS-1$
+ if ((aNl.getLength() + liNl.getLength() + imgNl.getLength()) > 3) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int getHeadingLevel(String strNodeName) {
+ for (int i = 0; i < HEADING_LEVEL.length; i++) {
+ if (strNodeName.equalsIgnoreCase(HEADING_LEVEL[i])) {
+ return Integer.valueOf(strNodeName.substring(1)).intValue();
+ }
+ }
+ return 0;
+ }
+
+ public Element[] getAWithHref_elements() {
+ return aWithHref_elements;
+ }
+
+ public String[] getAWithHref_hrefs() {
+ return aWithHref_hrefs;
+ }
+
+ public String[] getAWithHref_strings() {
+ return aWithHref_strings;
+ }
+
+ public URL getBaseUrl() {
+ return baseUrl;
+ }
+
+ public Set getBlockEleSet() {
+ return blockEleSet;
+ }
+
+ public Element[] getBody_elements() {
+ return body_elements;
+ }
+
+ public Element[] getBottom_1row1col_tables() {
+ return bottom_1row1col_tables;
+ }
+
+ public Element[] getBottom_data_tables() {
+ return bottom_data_tables;
+ }
+
+ public Element[] getBottom_notdata_tables() {
+ return bottom_notdata_tables;
+ }
+
+ public String getCurUrl() {
+ return curUrl;
+ }
+
+ public Map getDocument2IdMap() {
+ return document2IdMap;
+ }
+
+ public Element[] getFrame_elements() {
+ return frame_elements;
+ }
+
+ public boolean isHasAwithHref() {
+ return hasAwithHref;
+ }
+
+ public boolean isHasJavascript() {
+ return hasJavascript;
+ }
+
+ public Element[] getHeadings() {
+ return headings;
+ }
+
+ public Document getIeDom() {
+ return ieDom;
+ }
+
+ public Element[] getIframe_elements() {
+ return iframe_elements;
+ }
+
+ public HTMLImageElement[] getImg_elements() {
+ return img_elements;
+ }
+
+ public double getInvalidLinkRatio() {
+ return invalidLinkRatio;
+ }
+
+ public int getInvisibleElementCount() {
+ return invisibleElementCount;
+ }
+
+ public String[] getInvisibleLinkStrings() {
+ return invisibleLinkStrings;
+ }
+
+ public boolean isDBCS() {
+ return isDBCS;
+ }
+
+ public boolean isIEDom() {
+ return isIEDom;
+ }
+
+ public HashSet getNotExistHrefSet() {
+ return notExistHrefSet;
+ }
+
+ public Element[] getObject_elements() {
+ return object_elements;
+ }
+
+ public Document getOrigDom() {
+ return origDom;
+ }
+
+ public PageData getPageData() {
+ return pageData;
+ }
+
+ public Element[] getParent_table_elements() {
+ return parent_table_elements;
+ }
+
+ public Document getResultDoc() {
+ return resultDoc;
+ }
+
+ public Element[] getTable_elements() {
+ return table_elements;
+ }
+
+ public Document getTarget() {
+ return target;
+ }
+
+ public Element[] getEmbed_elements() {
+ return embed_elements;
+ }
+
+ public Element[] getJavascriptHref_elements() {
+ return javascriptHref_elements;
+ }
+
+ public String[] getJavascriptHref_hrefs() {
+ return javascriptHref_hrefs;
+ }
+
+ public String[] getJavascriptHref_strings() {
+ return javascriptHref_strings;
+ }
+
+ public Element[] getEventLoadElements() {
+ return eventLoadElements;
+ }
+
+ public Element[] getEventMouseButtonElements() {
+ return eventMouseButtonElements;
+ }
+
+ public Element[] getEventMouseFocusElements() {
+ return eventMouseFocusElements;
+ }
+
+ public Element[] getEventOnKeyElements() {
+ return eventOnKeyElements;
+ }
+
+ public Element[] getScript_elements() {
+ return script_elements;
+ }
+
+ public Element[] getEventWindowElements() {
+ return eventWindowElements;
+ }
+
+ public Element[] getEventFocusElements() {
+ return eventFocusElements;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/HtmlTagUtil.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/HtmlTagUtil.java
new file mode 100644
index 0000000..ddfe0f5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/HtmlTagUtil.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Stack;
+
+import org.eclipse.actf.util.IHtmlEventHandlerAttributes;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class HtmlTagUtil implements IHtmlEventHandlerAttributes {
+
+ public static final String ATTR_HREF = "href";
+
+ public static final String ATTR_ALT = "alt";
+
+ public static final String ATTR_SRC = "src";
+
+
+ public static final String FLASH_OBJECT = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
+
+ public static final String FLASH_CODEBASE = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab";
+
+ public static final String FLASH_TYPE = "application/x-shockwave-flash";
+
+ public static final String FLASH_PLUGINSPAGE = "http://www.macromedia.com/go/getflashplayer";
+
+ private static final String[] BLOCK_ELEMENT = { "address", "blockquote", "center", "dir", "div", "dl", "fieldset",
+ "form", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "isindex", "menu", "noframes", "noscript", "ol", "p",
+ "pre", "table", "ul", "dd",
+ //inline? "dt",
+ "frameset", "li", "tbody", "td", "tfoot", "th", "thead", "tr" };
+
+ public static Set<String> getBlockElementSet() {
+ Set<String> blockEleSet = new HashSet<String>();
+ for (int i = 0; i < BLOCK_ELEMENT.length; i++) {
+ blockEleSet.add(BLOCK_ELEMENT[i]);
+ }
+ return (blockEleSet);
+ }
+
+ // move from checkers
+ //TODO use xpath
+ public static boolean hasAncestor(Node target, String ancesterName) {
+ boolean result = false;
+ Node tmpNode = target;
+ while (tmpNode != null) {
+ if (tmpNode.getNodeName().equals(ancesterName)) {
+ result = true;
+ break;
+ }
+ tmpNode = tmpNode.getParentNode();
+ }
+ return (result);
+ }
+
+ public static String getNoScriptText(Node target) {
+ StringBuffer tmpSB = new StringBuffer();
+ if (target.getNodeType() == Node.ELEMENT_NODE) {
+ Element tmpE = (Element) target;
+ //TBD check neighbor?
+ if (tmpE.getElementsByTagName("script").getLength() > 0) {
+ NodeList tmpNL = tmpE.getElementsByTagName("noscript");
+ for (int i = 0; i < tmpNL.getLength(); i++) {
+ tmpSB.append(getTextAltDescendant(tmpNL.item(i)));
+ }
+ }
+ }
+ return tmpSB.toString();
+ }
+
+ public static String getTextAltDescendant(Node target) {
+ Node curNode = target.getFirstChild();
+ StringBuffer strBuf = new StringBuffer(512);
+ Stack<Node> stack = new Stack<Node>();
+ while (curNode != null) {
+ if (curNode.getNodeType() == Node.TEXT_NODE) {
+ strBuf.append(curNode.getNodeValue().trim() + " ");
+ } else if (curNode.getNodeName().equalsIgnoreCase("img")) { //$NON-NLS-1$
+ strBuf.append(((Element) curNode).getAttribute(ATTR_ALT).trim() + " "); //$NON-NLS-1$
+ }
+
+ if (curNode.hasChildNodes()) {
+ stack.push(curNode);
+ curNode = curNode.getFirstChild();
+ } else if (curNode.getNextSibling() != null) {
+ curNode = curNode.getNextSibling();
+ } else {
+ curNode = null;
+ while ((curNode == null) && (stack.size() > 0)) {
+ curNode = (Node) stack.pop();
+ curNode = curNode.getNextSibling();
+ }
+ }
+ }
+
+ return strBuf.toString();
+ }
+
+ public static String getTextDescendant(Node target) {
+ Node curNode = target.getFirstChild();
+ StringBuffer strBuf = new StringBuffer(512);
+ Stack<Node> stack = new Stack<Node>();
+ while (curNode != null) {
+ if (curNode.getNodeType() == Node.TEXT_NODE) {
+ strBuf.append(curNode.getNodeValue());
+ }
+
+ if (curNode.hasChildNodes()) {
+ stack.push(curNode);
+ curNode = curNode.getFirstChild();
+ } else if (curNode.getNextSibling() != null) {
+ curNode = curNode.getNextSibling();
+ } else {
+ curNode = null;
+ while ((curNode == null) && (stack.size() > 0)) {
+ curNode = (Node) stack.pop();
+ curNode = curNode.getNextSibling();
+ }
+ }
+ }
+
+ return strBuf.toString();
+ }
+
+ // move from checkers
+ //TODO use xpath
+
+ public static boolean hasTextDescendant(Node target) {
+ Node curNode = target.getFirstChild();
+ Stack<Node> stack = new Stack<Node>();
+ while (curNode != null) {
+ if (curNode.getNodeType() == Node.TEXT_NODE) {
+ return (true);
+ }
+
+ if (curNode.hasChildNodes()) {
+ stack.push(curNode);
+ curNode = curNode.getFirstChild();
+ } else if (curNode.getNextSibling() != null) {
+ curNode = curNode.getNextSibling();
+ } else {
+ curNode = null;
+ while ((curNode == null) && (stack.size() > 0)) {
+ curNode = (Node) stack.pop();
+ curNode = curNode.getNextSibling();
+ }
+ }
+ }
+ return (false);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/FlashData.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/FlashData.java
new file mode 100644
index 0000000..d447a8f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/FlashData.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+import org.eclipse.actf.util.xpath.XPathUtil;
+
+public class FlashData implements IPageStatisticsTag, IFlashTag {
+
+ private String src = "";// movie
+
+ // private String codebase="";
+ // private String id="";
+
+ private String width = "";
+
+ private String height = "";
+
+ private String quality = "";
+
+ private String bgcolor = "";
+
+ private String align = "";
+
+ private String salign = "";
+
+ private String wmode = "";
+
+ private String base = "";
+
+ private String menu = "";
+
+ private String loop = "";
+
+ private String play = "";
+
+ private String swliveconnect = "";
+
+ private boolean isObject = false;
+
+ private boolean withEmbed = false;
+
+ /**
+ *
+ */
+ public FlashData(String src, boolean isObject) {
+ this.src = src;
+ this.isObject = isObject;
+ }
+
+ public String getAlign() {
+ return align;
+ }
+
+ public String getBase() {
+ return base;
+ }
+
+ public String getBgcolor() {
+ return bgcolor;
+ }
+
+ public String getHeight() {
+ return height;
+ }
+
+ public String getLoop() {
+ return loop;
+ }
+
+ public String getMenu() {
+ return menu;
+ }
+
+ public String getPlay() {
+ return play;
+ }
+
+ public String getQuality() {
+ return quality;
+ }
+
+ public String getSalign() {
+ return salign;
+ }
+
+ public String getSrc() {
+ return src;
+ }
+
+ public String getSwliveconnect() {
+ return swliveconnect;
+ }
+
+ public String getWidth() {
+ return width;
+ }
+
+ public String getWmode() {
+ return wmode;
+ }
+
+ public boolean isWithEmbed() {
+ return withEmbed;
+ }
+
+ public void setWithEmbed(boolean withEmbed) {
+ this.withEmbed = withEmbed;
+ }
+
+ public boolean isObject() {
+ return isObject;
+ }
+
+ public void setObject(boolean isObject) {
+ this.isObject = isObject;
+ }
+
+ public void setAlign(String align) {
+ this.align = align;
+ }
+
+ public void setBase(String base) {
+ this.base = base;
+ }
+
+ public void setBgcolor(String bgcolor) {
+ this.bgcolor = bgcolor;
+ }
+
+ public void setHeight(String height) {
+ this.height = height;
+ }
+
+ public void setLoop(String loop) {
+ this.loop = loop;
+ }
+
+ public void setMenu(String menu) {
+ this.menu = menu;
+ }
+
+ public void setPlay(String play) {
+ this.play = play;
+ }
+
+ public void setQuality(String quality) {
+ this.quality = quality;
+ }
+
+ public void setSalign(String salign) {
+ this.salign = salign;
+ }
+
+ public void setSrc(String src) {
+ this.src = src;
+ }
+
+ public void setSwliveconnect(String swliveconnect) {
+ this.swliveconnect = swliveconnect;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+ public void setWmode(String wmode) {
+ this.wmode = wmode;
+ }
+
+ public String getItemXML() {
+ StringBuffer tmpSB = new StringBuffer("<" + FLASH + " " + SRC + "=\""
+ + XPathUtil.canonicalize(src) + "\" " + FLASH_IS_OBJECT + "=\""
+ + isObject + "\" ");
+ if (isObject && withEmbed) {
+ tmpSB.append(FLASH_WITHEMBED + "=\"true\" ");
+ }
+ // TODO
+ tmpSB.append("/>");
+ return (tmpSB.toString());
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/HeadingsData.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/HeadingsData.java
new file mode 100644
index 0000000..8d530aa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/HeadingsData.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+import org.eclipse.actf.util.xpath.XPathCreator;
+import org.eclipse.actf.util.xpath.XPathUtil;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+
+public class HeadingsData implements IPageStatisticsTag {
+
+ protected String tagName;
+
+ protected String text;
+
+ protected String xpath;
+
+ // TODO orgTime/curTime?
+
+ /**
+ * @param target
+ * Element
+ * @param text
+ */
+ public HeadingsData(Element targetE, String text) {
+ super();
+ this.tagName = targetE.getTagName();
+ this.xpath = XPathCreator.childPathSequence(targetE);
+ this.text = text;
+ }
+
+ /**
+ * @param tagName
+ * @param text
+ * @param xpath
+ */
+ public HeadingsData(String tagName, String text, String xpath) {
+ super();
+ this.tagName = tagName;
+ this.text = text;
+ this.xpath = xpath;
+ }
+
+ public String getXpath() {
+ return xpath;
+ }
+
+ public void setXpath(String xpath) {
+ this.xpath = xpath;
+ }
+
+ public String getTagName() {
+ return tagName;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setTagName(String tagName) {
+ this.tagName = tagName;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ private String getAttr(String name, String value) {
+ return ((name + "=\"" + XPathUtil.canonicalize(value) + "\" "));
+ }
+
+ public String getItemXML() {
+ return ("<" + HEADING + " " + getAttr(NAME, tagName)
+ + getAttr(VALUE, text) + getAttr(XPATH, xpath) + " />");
+ }
+
+ public static HeadingsData parseItem(Attributes atts)
+ throws StatisticsDataFormatException {
+ String tmpName = atts.getValue(NAME);
+ String tmpValue = atts.getValue(VALUE);
+ String tmpXPath = atts.getValue(XPATH);
+ if (tmpName != null && tmpValue != null) {
+ return (new HeadingsData(tmpName, tmpValue, tmpXPath));
+ }
+ throw (new StatisticsDataFormatException(
+ "Invalid item format: HeadingsData"));
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IFlashTag.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IFlashTag.java
new file mode 100644
index 0000000..5fb1bd3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IFlashTag.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+
+public interface IFlashTag {
+
+ String FLASH_IS_OBJECT = "isObject";
+
+ String FLASH_QUALITY = "quality";
+
+ String FLASH_SALIGN = "salign";
+
+ String FLASH_WMODE = "wmode";
+
+ String FLASH_MENU = "menu";
+
+ String FLASH_LOOP = "loop";
+
+ String FLASH_PLAY = "play";
+
+ String FLASH_SWLIVECONNECT = "swliveconnect";
+
+ String FLASH_WITHEMBED = "withEmbed";
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IIMageTag.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IIMageTag.java
new file mode 100644
index 0000000..6d69d71
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IIMageTag.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+
+public interface IIMageTag {
+ String ISMAP = "ismap";
+ String USEMAP ="usemap";
+ String LONGDESC = "longdesc";
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IPageStatisticsTag.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IPageStatisticsTag.java
new file mode 100644
index 0000000..8a740a1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/IPageStatisticsTag.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+
+public interface IPageStatisticsTag {
+
+ String IMAGES = "Images";
+
+ String IMAGE = "image";
+
+ String SKIPMAIN = "SkipMain";
+
+ String HEADINGS = "Headings";
+
+ String HEADING = "heading";
+
+ String REACHINGTIME = "ReachingTime";
+
+ String FLASH_INFO = "FlashInfo";
+
+ String FLASH = "flash";
+
+ String ITEM = "item";
+
+ String ERROR = "error";
+
+ String VALID = "valid";
+
+ String TOTAL = "total";
+
+ String MISSING = "missing";
+
+ String WRONG = "wrong";
+
+ String MAX = "max";
+
+ String MEAN = "mean";
+
+ String MIN = "min";
+
+ String ORG_MAX = "orgMax";
+
+ String ORG_MEAN = "orgMean";
+
+ String ORG_MIN = "orgMin";
+
+ String WIDTH = "width";
+
+ String HEIGHT = "height";
+
+ String BGCOLOR = "bgcolor";
+
+ String ALIGN = "align";
+
+ String SRC = "src";
+
+ String HREF = "href";
+
+ String DEST = "dest";
+
+ String URL = "url";
+
+ String BASE = "base";
+
+ String NAME = "name";
+
+ String VALUE = "value";
+
+ String ALT = "alt";
+
+ String XPATH = "xpath";
+
+ String ID = "id";
+
+ String TARGET_STRING = "targetStr";
+
+ String JAVASCRIPT = "javascript";
+
+ String EXISTENCE = "existence";
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/ImageStatData.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/ImageStatData.java
new file mode 100644
index 0000000..caac638
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/ImageStatData.java
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+import java.net.URL;
+import java.util.Vector;
+
+import org.eclipse.actf.util.xpath.XPathUtil;
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.ProblemItemImpl;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.html.HTMLAnchorElement;
+import org.w3c.dom.html.HTMLImageElement;
+import org.xml.sax.Attributes;
+
+
+
+public class ImageStatData implements IPageStatisticsTag, IIMageTag {
+
+ protected String altS = "";
+
+ protected Element ancestorLink = null;
+
+ protected String destUrlS = "";
+
+ protected boolean hasAlt = false;
+
+ protected boolean hasHeight = false;
+
+ protected boolean hasLongDesc = false;
+
+ protected boolean hasUseMap = false;
+
+ protected boolean hasWidth = false;
+
+ protected String heightS = "";
+
+ protected boolean isInLink = false;
+
+ protected boolean isMap = false;
+
+ protected String longDescS = "";
+
+ // for problem statistics
+ protected Vector<IProblemItem> problemV = new Vector<IProblemItem>();
+
+ protected String srcS = "";
+
+ protected String urlS = "";
+
+ protected String useMapS = "";
+
+ protected String widthS = "";
+
+
+ protected ImageStatData() {
+ }
+
+ /**
+ * @param tagName
+ * @param text
+ */
+ public ImageStatData(HTMLImageElement target, URL baseURL) {
+
+ srcS = target.getSrc();
+ urlS = srcS;
+ try {
+ urlS = new URL(baseURL, urlS).toString();
+ } catch (Exception e) {
+ }
+
+ //System.out.println(urlS);
+
+ if (hasAlt = target.hasAttribute(ALT)) {
+ altS = target.getAlt();
+ }
+ if (hasLongDesc = target.hasAttribute(LONGDESC)) {
+ longDescS = target.getLongDesc();
+ }
+ if (hasUseMap = target.hasAttribute(USEMAP)) {
+ useMapS = target.getUseMap();
+ }
+
+ if (hasWidth = target.hasAttribute(WIDTH)) {
+ widthS = target.getWidth();
+ }
+
+ if (hasHeight = target.hasAttribute(HEIGHT)) {
+ heightS = target.getHeight();
+ }
+
+ isMap = target.getIsMap();
+
+ NodeList tmpNL = XPathUtil.evalXPathNodeList(target, "ancestor::a");
+ //XPathUtil.showNodeList(tmpNL,true);
+ int len = tmpNL.getLength();
+ if (len > 0) {
+ HTMLAnchorElement tmpE = (HTMLAnchorElement) tmpNL.item(0);
+ if (isInLink = tmpE.hasAttribute(HREF)) {
+ destUrlS = tmpE.getHref();
+ ancestorLink = tmpE;
+ try {
+ destUrlS = new URL(baseURL, destUrlS).toString();
+ } catch (Exception e) {
+ }
+ }
+ }
+ }
+
+ public void addProblemItem(Attributes atts) throws StatisticsDataFormatException {
+ String idS = atts.getValue(ID);
+ String targetS = atts.getValue(TARGET_STRING);
+
+ if (idS != null) {
+ IProblemItem tmpItem = new ProblemItemImpl(idS);
+ if (!tmpItem.getId().equals("unknown")) {
+ if (targetS != null) {
+ tmpItem.setTargetStringForHPB(targetS);
+ }
+ addProblemItem(tmpItem);
+ return;
+ }
+ }
+ throw new StatisticsDataFormatException();
+ }
+
+ public void addProblemItem(IProblemItem problemItem) {
+ problemV.add(problemItem);
+ }
+
+ public String getAltS() {
+ return this.altS;
+ }
+
+ public Element getAncestorLink() {
+ return ancestorLink;
+ }
+
+ private String getAttr(String name, boolean value) {
+ return (getAttr(name, Boolean.toString(value)));
+ }
+
+ private String getAttr(String name, String value) {
+ return ((name + "=\"" + XPathUtil.canonicalize(value) + "\" "));
+ }
+
+ public String getDestUrlS() {
+ return destUrlS;
+ }
+
+ public String getHeightS() {
+ return heightS;
+ }
+
+ public String getItemXML() {
+ StringBuffer tmpSB = new StringBuffer("<" + IMAGE + " " + getAttr(SRC, srcS) + getAttr(URL, urlS)
+ + getAttr(ISMAP, isMap));
+ if (hasAlt) {
+ tmpSB.append(getAttr(ALT, altS));
+ }
+ if (hasWidth) {
+ tmpSB.append(getAttr(WIDTH, widthS));
+ }
+ if (hasHeight) {
+ tmpSB.append(getAttr(HEIGHT, heightS));
+ }
+ if (isInLink) {
+ tmpSB.append(getAttr(DEST, destUrlS));
+ }
+ if (hasLongDesc) {
+ tmpSB.append(getAttr(LONGDESC, longDescS));
+ }
+ if (hasUseMap) {
+ tmpSB.append(getAttr(USEMAP, useMapS));
+ }
+ int size = problemV.size();
+ if (size == 0) {
+ tmpSB.append(" />");
+ } else {
+ tmpSB.append(" >" + Constants.LINE_SEP);
+ for (int i = 0; i < size; i++) {
+ IProblemItem pItem = (IProblemItem) problemV.get(i);
+ tmpSB.append("<" + ERROR + " " + getAttr(ID, pItem.getId())
+ + getAttr(TARGET_STRING, pItem.getTargetStringForHPB()) + " />" + Constants.LINE_SEP);
+ }
+ tmpSB.append("</" + IMAGE + ">");
+ }
+ return (tmpSB.toString());
+ }
+
+ public String getLongDescS() {
+ return longDescS;
+ }
+
+ public Vector getProblemV() {
+ return this.problemV;
+ }
+
+ public String getSrcS() {
+ return srcS;
+ }
+
+ public String getUrlS() {
+ return this.urlS;
+ }
+
+ public String getUseMapS() {
+ return useMapS;
+ }
+
+ public String getWidthS() {
+ return widthS;
+ }
+
+ public boolean isHasAlt() {
+ return this.hasAlt;
+ }
+
+ public boolean isHasHeight() {
+ return hasHeight;
+ }
+
+ public boolean isHasLongDesc() {
+ return hasLongDesc;
+ }
+
+ public boolean isHasUseMap() {
+ return hasUseMap;
+ }
+
+ public boolean isHasWidth() {
+ return hasWidth;
+ }
+
+ public boolean isInLink() {
+ return isInLink;
+ }
+
+ public boolean isMap() {
+ return isMap;
+ }
+
+ public void setHasHeight(boolean hasHeight) {
+ this.hasHeight = hasHeight;
+ }
+
+ public void setHasWidth(boolean hasWidth) {
+ this.hasWidth = hasWidth;
+ }
+
+ public void setHeightS(String heightS) {
+ this.heightS = heightS;
+ }
+
+ public void setWidthS(String widthS) {
+ this.widthS = widthS;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/PageData.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/PageData.java
new file mode 100644
index 0000000..50c5787
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/PageData.java
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Vector;
+
+import org.eclipse.actf.util.xpath.XPathUtil;
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.IProblemItemVisitor;
+
+
+public class PageData implements IPageStatisticsTag, IProblemItemVisitor {
+
+ private int brokenIntraPageLinkNum = 0;
+
+ private int brokenSkipMainNum = 0;
+
+ private Vector<FlashData> flashV = new Vector<FlashData>();
+
+ private int forwardIntraPageLinkNum = 0;//TODO check if the link reduce reaching time?
+
+ private Vector headingsV = new Vector();
+
+ private Vector imageDataV = new Vector();
+
+ private Map imageDataMap = new HashMap();
+
+ private Map linkImageDataMap = new HashMap();
+
+ private int imageAltErrorNum = 0;
+
+ private double invalidLinkRatio = 0;
+
+ private int maxTime = 0;
+
+ private int orgMaxTime = 0;
+
+ // category(missing/wrong/...)
+ private int missingAltNum = 0;
+
+ private int skipMainNum = 0;
+
+ private int totalImageNumber = 0;
+
+ private int totalLinkNum = 0;
+
+ private int wrongAltNum = 0;
+
+ private boolean hasJavascript = false;
+
+ /**
+ *
+ */
+ public PageData() {
+ }
+
+ public void addFlashData(FlashData flashData) {
+ flashV.add(flashData);
+ }
+
+ public int getBrokenIntraPageLinkNum() {
+ return brokenIntraPageLinkNum;
+ }
+
+ public int getBrokenSkipMainNum() {
+ return brokenSkipMainNum;
+ }
+
+ public Vector getFlashV() {
+ return this.flashV;
+ }
+
+ public int getForwardIntraPageLinkNum() {
+ return forwardIntraPageLinkNum;
+ }
+
+ public int getHeadingCount() {
+ return headingsV.size();
+ }
+
+ public Vector getHeadingsV() {
+ return headingsV;
+ }
+
+ public int getImageAltErrorNum() {
+ return imageAltErrorNum;
+ }
+
+ public double getInvalidLinkRatio() {
+ return invalidLinkRatio;
+ }
+
+ public int getMaxTime() {
+ return maxTime;
+ }
+
+ public int getMissingAltNum() {
+ return missingAltNum;
+ }
+
+ public String getReportFragment() {
+ StringBuffer tmpSB = new StringBuffer();
+ tmpSB.append("<" + IMAGES + " " + TOTAL + "=\"" + totalImageNumber + "\" " + ERROR + "=\"" + imageAltErrorNum
+ + "\" " + MISSING + "=\"" + missingAltNum + "\" " + WRONG + "=\"" + wrongAltNum + "\" " + ">"
+ + Constants.LINE_SEP);
+ for (Iterator i = imageDataV.iterator();i.hasNext();){
+ tmpSB.append(((ImageStatData)i.next()).getItemXML() + Constants.LINE_SEP);
+ }
+ tmpSB.append("</"+IMAGES+">");
+
+ tmpSB.append("<" + SKIPMAIN + " " + VALID + "=\"" + skipMainNum + "\" " + ERROR + "=\"" + brokenSkipMainNum
+ + "\" />" + Constants.LINE_SEP);
+ tmpSB.append("<" + REACHINGTIME + " " + MAX + "=\"" + maxTime + "\" " + ORG_MAX + "=\"" + orgMaxTime + "\" />");
+
+ if (flashV.size() > 0) {
+ tmpSB.append("<" + FLASH_INFO + " " + TOTAL + "=\"" + flashV.size() + "\">" + Constants.LINE_SEP);
+ for (Iterator i = flashV.iterator(); i.hasNext();) {
+ tmpSB.append(((FlashData) i.next()).getItemXML() + Constants.LINE_SEP);
+ }
+ tmpSB.append("</" + FLASH_INFO + ">" + Constants.LINE_SEP);
+ }
+ tmpSB.append("<" + HEADINGS + " " + TOTAL + "=\"" + headingsV.size() + "\">" + Constants.LINE_SEP);
+ for (Iterator i = headingsV.iterator(); i.hasNext();) {
+ tmpSB.append(((HeadingsData) i.next()).getItemXML() + Constants.LINE_SEP);
+ }
+ tmpSB.append("</" + HEADINGS + ">" + Constants.LINE_SEP);
+ tmpSB.append("<"+JAVASCRIPT+" "+getAttr(EXISTENCE,hasJavascript)+"/>");
+ return (tmpSB.toString());
+ }
+
+ private String getAttr(String name, boolean value){
+ return(getAttr(name,Boolean.toString(value)));
+ }
+
+ private String getAttr(String name, String value) {
+ return ((name + "=\"" + XPathUtil.canonicalize(value) + "\" "));
+ }
+
+ public int getSkipMainNum() {
+ return skipMainNum;
+ }
+
+ public int getTotalImageNumber() {
+ return totalImageNumber;
+ }
+
+ public int getTotalLinkNum() {
+ return totalLinkNum;
+ }
+
+ public Vector getImageDataV() {
+ return imageDataV;
+ }
+ public void setImageDataV(Vector imageDataV) {
+ this.imageDataV = imageDataV;
+ }
+ public int getWrongAltNum() {
+ return wrongAltNum;
+ }
+
+ public int getOrgMaxTime() {
+ return orgMaxTime;
+ }
+ public Map getImageDataMap() {
+ return imageDataMap;
+ }
+ public Map getLinkImageDataMap() {
+ return linkImageDataMap;
+ }
+ public boolean isHasJavascript() {
+ return hasJavascript;
+ }
+ public void setHasJavascript(boolean hasJavascript) {
+ this.hasJavascript = hasJavascript;
+ }
+ public void setLinkImageDataMap(Map linkImageDataMap) {
+ this.linkImageDataMap = linkImageDataMap;
+ }
+ public void setImageDataMap(Map imageDataMap) {
+ this.imageDataMap = imageDataMap;
+ }
+ public void setOrgMaxTime(int orgMaxTime) {
+ this.orgMaxTime = orgMaxTime;
+ }
+
+ public void setBrokenIntraPageLinkNum(int brokenIntraPageLinkNum) {
+ this.brokenIntraPageLinkNum = brokenIntraPageLinkNum;
+ }
+
+ public void setBrokenSkipMainNum(int brokenSkipMainNum) {
+ this.brokenSkipMainNum = brokenSkipMainNum;
+ }
+
+ public void setFlashV(Vector<FlashData> flashV) {
+ this.flashV = flashV;
+ }
+
+ public void setForwardIntraPageLinkNum(int forwardIntraPageLinkNum) {
+ this.forwardIntraPageLinkNum = forwardIntraPageLinkNum;
+ }
+
+ public void setHeadingsV(Vector headings) {
+ this.headingsV = headings;
+ }
+
+ public void setImageAltErrorNum(int imageAltErrorNum) {
+ this.imageAltErrorNum = imageAltErrorNum;
+ }
+
+ public void setInvalidLinkRatio(double invalidLinkRatio) {
+ this.invalidLinkRatio = invalidLinkRatio;
+ }
+
+ public void setMaxTime(int maxTime) {
+ this.maxTime = maxTime;
+ }
+
+ public void setMissingAltNum(int missingAltNum) {
+ this.missingAltNum = missingAltNum;
+ }
+
+ public void setSkipMainNum(int skipMainNum) {
+ this.skipMainNum = skipMainNum;
+ }
+
+ public void setTotalImageNumber(int totalImageNumber) {
+ this.totalImageNumber = totalImageNumber;
+ }
+
+ public void setTotalLinkNum(int totalLinkNum) {
+ this.totalLinkNum = totalLinkNum;
+ }
+
+ public void setWrongAltNum(int wrongAltNum) {
+ this.wrongAltNum = wrongAltNum;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.visualization.eval.problem.IProblemItemVisitor#visit(org.eclipse.actf.visualization.eval.problem.IProblemItem)
+ */
+ public void visit(IProblemItem item) {
+ ImageStatData imageData = (ImageStatData)imageDataMap.get(item.getTargetNode());
+ if(imageData!=null){
+ imageData.addProblemItem(item);
+ }else{
+ imageData = (ImageStatData)linkImageDataMap.get(item.getTargetNode());
+ if(imageData!=null){//TODO check
+ imageData.addProblemItem(item);
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/StatisticsDataFormatException.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/StatisticsDataFormatException.java
new file mode 100644
index 0000000..94b655f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/html/statistics/StatisticsDataFormatException.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.html.statistics;
+
+
+public class StatisticsDataFormatException extends Exception {
+ private static final long serialVersionUID = -2899274818180627014L;
+
+ /**
+ *
+ */
+ public StatisticsDataFormatException() {
+ super();
+ }
+
+ /**
+ * @param message
+ */
+ public StatisticsDataFormatException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public StatisticsDataFormatException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param cause
+ */
+ public StatisticsDataFormatException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/Messages.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/Messages.java
new file mode 100644
index 0000000..c70bdf1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/Messages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "org.eclipse.actf.visualization.eval.internal.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/messages.properties b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/messages.properties
new file mode 100644
index 0000000..9b54491
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/messages.properties
@@ -0,0 +1,46 @@
+###############################################################################
+# Copyright (c) 2003, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#
+ProblemConst.All_Errors_1 = All Errors
+ProblemConst.Essential_2 = Error
+ProblemConst.Advanced_3 = Advanced
+ProblemConst.Basic_4 = Basic
+ProblemConst.User_Check_5 = User Check
+ProblemConst.Compliance_6 = Compliance
+ProblemConst.Trash_7 = Trash
+ProblemConst.Type_11 = Type
+ProblemConst.Line_12 = Line
+ProblemConst.Highlight = Highlight
+ProblemConst.Problem_Description_17 = Problem Description
+ProblemConst.Foreground_18 = Foreground Color
+ProblemConst.Background_19 = Background Color
+ProblemConst.Severity_20 = Severity
+ProblemConst.X_21 = X
+ProblemConst.Y_22 = Y
+ProblemConst.0 = Accessibility
+ProblemConst.Area_23 = Area
+ProblemConst.Detailed_report = Detailed report
+ProblemConst.Summary_report = Summary report
+ProblemConst.Info = Information
+
+NavigabilityWarningDialog.Message1 = To evaluate "Navigability", please enable all WCAG items
+NavigabilityWarningDialog.Message2 = or enable other guidelines, such as Section508, JIS or IBMGuideline.
+NavigabilityWarningDialog.EnableWCAG = Enable all WCAG items.
+NavigabilityWarningDialog.DisableNav = Disable Navigability.
+NavigabilityWarningDialog.Continue = Ignore this warning and continue.
+
+adesigner.preference.guideline.list.group.text=Guideline
+adesigner.preference.guideline.criteria.group.text=Criteria
+adesigner.preference.guideline.properties.group.text=Properties
+
+DialogCheckerOption.Line_Number_Information_19 = Check target
+DialogCheckerOption.Add_line_number_20 = Use HTML\u3000source file (with line number in error report)
+DialogCheckerOption.LIVE_DOM = Use parsed DOM in browser (without line number)
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/messages_ja.properties b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/messages_ja.properties
new file mode 100644
index 0000000..e76e07c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/internal/messages_ja.properties
@@ -0,0 +1,47 @@
+###############################################################################
+# Copyright (c) 2003, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#
+ProblemConst.All_Errors_1 = \u5168\u3066\u306e\u30a8\u30e9\u30fc
+ProblemConst.Essential_2 = \u8981\u4fee\u6b63
+ProblemConst.Advanced_3 = \u72ec\u81ea\u30c1\u30a7\u30c3\u30af\u9805\u76ee
+ProblemConst.Basic_4 = \u57fa\u672c\u30c1\u30a7\u30c3\u30af\u9805\u76ee
+ProblemConst.User_Check_5 = \u30e6\u30fc\u30b6\u30fc\u78ba\u8a8d
+ProblemConst.Compliance_6 = \u30b3\u30f3\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9
+ProblemConst.Trash_7 = \u30b4\u30df\u7bb1
+ProblemConst.Type_11 = \u7a2e\u985e
+ProblemConst.Line_12 = \u884c\u756a\u53f7
+ProblemConst.Highlight = \u30cf\u30a4\u30e9\u30a4\u30c8
+ProblemConst.Problem_Description_17 = \u30a8\u30e9\u30fc\u306e\u5185\u5bb9
+ProblemConst.Foreground_18 = \u524d\u666f\u8272
+ProblemConst.Background_19 = \u80cc\u666f\u8272
+ProblemConst.Severity_20 = \u6df1\u523b\u5ea6
+ProblemConst.X_21 = X\u5ea7\u6a19
+ProblemConst.Y_22 = Y\u5ea7\u6a19
+ProblemConst.0 = \u30a2\u30af\u30bb\u30b7\u30d3\u30ea\u30c6\u30a3
+ProblemConst.Area_23 = \u9762\u7a4d
+ProblemConst.Detailed_report = \u8a73\u7d30\u30ec\u30dd\u30fc\u30c8
+ProblemConst.Summary_report = \u6982\u8981\u30ec\u30dd\u30fc\u30c8
+ProblemConst.Info = \u60c5\u5831
+
+NavigabilityWarningDialog.Message1 = Navigability\u3092\u8a55\u4fa1\u3059\u308b\u969b\u306b\u306f\uff0cWCAG\u306e\u5168\u9805\u76ee\u3092\u9078\u629e\u3059\u308b\u304b
+NavigabilityWarningDialog.Message2 = Section508\uff0cJIS\uff0cIBMGuideline\u7b49\u306e\u4ed6\u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\uff0e
+NavigabilityWarningDialog.EnableWCAG = WCAG\u306e\u5168\u9805\u76ee\u3092\u9078\u629e\uff0e
+NavigabilityWarningDialog.DisableNav = Navigability\u3092\u8a55\u4fa1\u3057\u306a\u3044\uff0e
+NavigabilityWarningDialog.Continue = \u3053\u306e\u8b66\u544a\u3092\u7121\u8996\u3057\u3066\u4f5c\u696d\u3092\u7d9a\u3051\u308b\uff0e
+
+adesigner.preference.guideline.list.group.text=\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3
+adesigner.preference.guideline.criteria.group.text=\u8a55\u4fa1\u6307\u6a19
+adesigner.preference.guideline.properties.group.text=Properties
+
+DialogCheckerOption.Line_Number_Information_19 = \u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\uff1a
+DialogCheckerOption.Add_line_number_20 = HTML\u30d5\u30a1\u30a4\u30eb \uff08\u884c\u756a\u53f7\u3092\u30a8\u30e9\u30fc\u30ec\u30dd\u30fc\u30c8\u306b\u8ffd\u52a0\uff09
+DialogCheckerOption.LIVE_DOM = \u30d6\u30e9\u30a6\u30b6\u5185\u306eDOM \uff08\u884c\u756a\u53f7\u7121\u3057\uff09
+
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelinePreferencePage.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelinePreferencePage.java
new file mode 100644
index 0000000..2933365
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelinePreferencePage.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval.preferences;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.actf.util.ui.GroupFieldEditorPreferencePage;
+import org.eclipse.actf.util.ui.IDialogConstants;
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineData;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.internal.Messages;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+
+
+
+
+public class GuidelinePreferencePage extends GroupFieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ public static final String ID = GuidelinePreferencePage.class.getName();
+
+ private GuidelineHolder _guidelineHolder;
+
+ private String[] _checkerOptionNames;
+
+ private String[] _criteriaNames;
+
+ private Button[] _criteriaCheckButtons;
+
+ private CheckboxTreeViewer _guidelineTreeViewer;
+
+ private TreeItem[] _guidelineTreeItems = null;
+
+ public GuidelinePreferencePage() {
+ super();
+ setPreferenceStore(EvaluationPlugin.getDefault().getPreferenceStore());
+ }
+
+ public void init(IWorkbench workbench) {
+ this._guidelineHolder = GuidelineHolder.getInstance();
+ this._checkerOptionNames = this._guidelineHolder.getGuidelineNamesWithLevels();
+ this._criteriaNames = this._guidelineHolder.getMetricsNames();
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ Composite parent = getFieldEditorParent();
+
+ createGuidelineTreePart(parent);
+
+ // createPropertiesPart(parent);
+
+ createCriteriaOptionPart(parent);
+
+ createLineNumberInfoPart(parent);
+
+ updateSelectableMetricsButton();
+
+ Composite buttonComposite = new Composite(parent, SWT.NONE);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
+ gridData.verticalIndent = 5;
+ buttonComposite.setLayoutData(gridData);
+ buttonComposite.setLayout(new GridLayout());
+
+ Button helpButton = new Button(buttonComposite, SWT.PUSH);
+ helpButton.setText(IDialogConstants.HELP);
+ helpButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent se) {
+ openHelp();
+ }
+ });
+
+ Label spacer = new Label(parent, SWT.NONE);
+ gridData = new GridData();
+ gridData.verticalIndent = 10;
+ spacer.setLayoutData(gridData);
+
+ }
+
+ private void createGuidelineTreePart(Composite parent) {
+
+ final Group guidelineTreeGroup = new Group(parent, SWT.NONE);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.heightHint = 280;
+ guidelineTreeGroup.setLayoutData(gridData);
+ guidelineTreeGroup.setLayout(new GridLayout());
+
+ guidelineTreeGroup.setText(Messages.getString("adesigner.preference.guideline.list.group.text"));
+
+ this._guidelineTreeViewer = new CheckboxTreeViewer(guidelineTreeGroup, SWT.BORDER);
+ this._guidelineTreeViewer.setLabelProvider(new GuidelineTreeLabelProvider());
+ this._guidelineTreeViewer.setContentProvider(new GuidelineTreeContentProvider());
+
+ Tree guidelineTree = this._guidelineTreeViewer.getTree();
+ guidelineTree.setLinesVisible(true);
+ guidelineTree.setHeaderVisible(true);
+ guidelineTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ TreeColumn categoryColumn = new TreeColumn(guidelineTree, SWT.NONE);
+ categoryColumn.setWidth(220);
+ categoryColumn.setText("Category");
+
+ TreeColumn guidelineColumn = new TreeColumn(guidelineTree, SWT.NONE);
+ guidelineColumn.setWidth(350);
+ guidelineColumn.setText("Guideline");
+
+ GuidelineTreeItemData root = new GuidelineTreeItemData(null);
+ GuidelineTreeItemType htmlType = new GuidelineTreeItemType(GuidelineTreeItemType.TYPE_HTML);
+ GuidelineTreeItemType odfType = new GuidelineTreeItemType(GuidelineTreeItemType.TYPE_ODF);
+ root.add(htmlType);
+ root.add(odfType);
+
+ GuidelineData[] guidelineDataArray = this._guidelineHolder.getLeafGuidelineData();
+ this._checkerOptionNames = this._guidelineHolder.getGuidelineNamesWithLevels();
+
+ int guidelineNum = this._checkerOptionNames.length;
+
+ boolean[][] correspondingCriteria = this._guidelineHolder.getCorrespondingMetricsOfLeafGuideline();
+ for (int i = 0; i < guidelineNum; i++) {
+ boolean isHTMLType = false;
+ String[] mimeTypes = guidelineDataArray[i].getMIMEtypes();
+ for (int j = 0; j < mimeTypes.length; j++) {
+ if (mimeTypes[j].equals("text/html") || mimeTypes[j].equals("application/xhtml+xml")) {
+ isHTMLType = true;
+ break;
+ }
+ }
+ GuidelineTreeItemData guidelineData = new GuidelineTreeItemData(this._checkerOptionNames[i]);
+ guidelineData.setCorrespondingCriteria(correspondingCriteria[i]);
+ if (isHTMLType) {
+ htmlType.add(guidelineData);
+ } else {
+ odfType.add(guidelineData);
+ }
+
+ guidelineData.setIndex(i);
+ guidelineData.setEnabled(guidelineDataArray[i].isEnabled());
+ guidelineData.setCategory(guidelineDataArray[i].getCategory());
+ guidelineData.setDescription(guidelineDataArray[i].getDescription());
+ }
+
+ this._guidelineTreeViewer.setInput(root);
+ this._guidelineTreeViewer.expandAll();
+
+ this._guidelineTreeViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getElement() instanceof GuidelineTreeItemType) {
+ GuidelineTreeItemType guidelineType = (GuidelineTreeItemType) event.getElement();
+ List children = guidelineType.getChildren();
+ for (int i = 0; i < children.size(); i++) {
+ GuidelineTreeItemData guidelineData = (GuidelineTreeItemData) children.get(i);
+ boolean checkState = event.getChecked();
+ guidelineData.setEnabled(checkState);
+ _guidelineTreeItems[guidelineData.getIndex()].setChecked(checkState);
+ }
+ }
+
+ updateSelectableMetricsButton();
+ }
+ });
+
+ this._guidelineTreeItems = new TreeItem[guidelineNum];
+ TreeItem[] typeTreeItem = guidelineTree.getItems();
+ for (int i = 0; i < typeTreeItem.length; i++) {
+ boolean isAllEnabled = true;
+
+ TreeItem[] guidelineTreeItem = typeTreeItem[i].getItems();
+ for (int j = 0; j < guidelineTreeItem.length; j++) {
+ GuidelineTreeItemData guidelineData = (GuidelineTreeItemData) guidelineTreeItem[j].getData();
+
+ guidelineTreeItem[j]
+ .setText(new String[] { guidelineData.getCategory(), guidelineData.getDescription() });
+ guidelineTreeItem[j].setImage(new Image[] { null, guidelineData.getGuidelineImage() });
+
+ boolean isGuidelineEnabled = guidelineData.isEnabled();
+ guidelineTreeItem[j].setChecked(isGuidelineEnabled);
+ if (!isGuidelineEnabled) {
+ isAllEnabled = false;
+ }
+
+ this._guidelineTreeItems[guidelineData.getIndex()] = guidelineTreeItem[j];
+ }
+
+ typeTreeItem[i].setChecked(isAllEnabled);
+ }
+ }
+
+ private void createCriteriaOptionPart(Composite parent) {
+
+ int columnNum = 4;
+ Group criteriaGroup = new Group(parent, SWT.NONE);
+ criteriaGroup.setText(Messages.getString("adesigner.preference.guideline.criteria.group.text"));
+ criteriaGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = columnNum;
+ criteriaGroup.setLayout(gridLayout);
+
+ int length = this._criteriaNames.length;
+ this._criteriaCheckButtons = new Button[length];
+ boolean[] isOptionEnabled = this._guidelineHolder.getEnabledMetrics();
+
+ GridData gridData;
+ for (int i = 0; i < length; i++) {
+ this._criteriaCheckButtons[i] = new Button(criteriaGroup, SWT.CHECK);
+ this._criteriaCheckButtons[i].setText(this._criteriaNames[i]);
+ this._criteriaCheckButtons[i].setSelection(isOptionEnabled[i]);
+ if (i % columnNum != 0) {
+ gridData = new GridData();
+ gridData.horizontalIndent = 20;
+ this._criteriaCheckButtons[i].setLayoutData(gridData);
+ }
+ }
+ }
+
+ private void createLineNumberInfoPart(Composite parent) {
+
+ addField(new RadioGroupFieldEditor(IPreferenceConstants.CHECKER_TARGET, Messages.getString("DialogCheckerOption.Line_Number_Information_19"), 1, new String[][] {
+ { Messages.getString("DialogCheckerOption.Add_line_number_20"),
+ IPreferenceConstants.CHECKER_ORG_DOM },
+ { Messages.getString("DialogCheckerOption.LIVE_DOM"),
+ IPreferenceConstants.CHECKER_LIVE_DOM } }, parent));
+
+ }
+
+ public boolean performOk() {
+
+ boolean isOK = super.performOk();
+
+ setParameters();
+
+ if (this._guidelineHolder.isEnabledMetric("Navigability")) {
+
+ GuidelineData[] datas = this._guidelineHolder.getLeafGuidelineData();
+ boolean isWcagOn = false;
+ boolean isWcagOff = false;
+ boolean isOtherComp = false;
+
+ for (int i = 0; i < datas.length; i++) {
+ if (datas[i].isEnabled()) {
+ if (datas[i].getGuidelineName().matches("Section508|JIS|IBMGuideline")) {
+ isOtherComp = true;
+ } else if (datas[i].getGuidelineName().equals("WCAG")) {
+ isWcagOn = true;
+ }
+ } else {
+ if (datas[i].getGuidelineName().equals("WCAG")) {
+ isWcagOff = true;
+ }
+ }
+ }
+
+ if (!isOtherComp && isWcagOn && isWcagOff) {
+ NavigabilityWarningDialog nwd = new NavigabilityWarningDialog(getShell());
+ int result = nwd.open();
+ switch (result) {
+ case NavigabilityWarningDialog.ENABLE_ALL:
+ for (int i = 0; i < this._guidelineTreeItems.length; i++) {
+ if (this._guidelineTreeItems[i].getText().indexOf("WCAG") > -1) {
+ this._guidelineTreeItems[i].setChecked(true);
+ }
+ }
+ return true;
+ case NavigabilityWarningDialog.DISABLE_NAVIGABILITY:
+ for (int i = 0; i < this._criteriaCheckButtons.length; i++) {
+ if (this._criteriaCheckButtons[i].getText().indexOf("Navigability") > -1) {
+ this._criteriaCheckButtons[i].setSelection(false);
+ }
+ }
+ return true;
+ case NavigabilityWarningDialog.CONTINUE:
+ default:
+ // do nothing
+ }
+ }
+ }
+
+ return isOK;
+ }
+
+ private void setParameters() {
+
+ if (null != _criteriaCheckButtons) {
+ boolean[] result = new boolean[this._criteriaCheckButtons.length];
+ Arrays.fill(result, false);
+ for (int i = 0; i < _criteriaCheckButtons.length; i++) {
+ if (this._criteriaCheckButtons[i] != null && this._criteriaCheckButtons[i].isEnabled()
+ && this._criteriaCheckButtons[i].getSelection()) {
+ result[i] = true;
+ }
+ }
+ this._guidelineHolder.setEnabledMetrics(result);
+ }
+
+ if (null != this._guidelineTreeItems) {
+ boolean[] result = new boolean[this._guidelineTreeItems.length];
+ Arrays.fill(result, false);
+ for (int i = 0; i < this._guidelineTreeItems.length; i++) {
+ if (null != this._guidelineTreeItems[i] && this._guidelineTreeItems[i].getChecked()) {
+ result[i] = true;
+ }
+ }
+ this._guidelineHolder.setEnabledGuidelineWithLevels(result);
+ }
+ }
+
+ private void updateSelectableMetricsButton() {
+
+ boolean[] isSelectable = new boolean[this._criteriaCheckButtons.length];
+ Arrays.fill(isSelectable, false);
+
+ for (int i = 0; i < this._guidelineTreeItems.length; i++) {
+ if (this._guidelineTreeItems[i].getChecked()) {
+ GuidelineTreeItemData guidelineData = (GuidelineTreeItemData) this._guidelineTreeItems[i].getData();
+ for (int j = 0; j < this._criteriaCheckButtons.length; j++) {
+ isSelectable[j] = (isSelectable[j] | guidelineData.getCorrespondingCriteria()[j]);
+ }
+ }
+ }
+
+ for (int i = 0; i < this._criteriaCheckButtons.length; i++) {
+ this._criteriaCheckButtons[i].setEnabled(isSelectable[i]);
+ }
+ }
+
+ private void openHelp() {
+ PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(
+ "/org.eclipse.actf.examples.adesigner.doc/docs/compliance.html");
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeContentProvider.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeContentProvider.java
new file mode 100644
index 0000000..64b4515
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeContentProvider.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+
+
+
+public class GuidelineTreeContentProvider implements ITreeContentProvider {
+
+ public Object[] getChildren(Object parentElement) {
+ IGuidelineTreeItem parent = (IGuidelineTreeItem) parentElement;
+ return parent.getChildren().toArray();
+ }
+
+ public Object getParent(Object element) {
+ return ((IGuidelineTreeItem) element).getParent();
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeItemData.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeItemData.java
new file mode 100644
index 0000000..cf6c1c4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeItemData.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.swt.graphics.Image;
+
+
+
+
+public class GuidelineTreeItemData implements IGuidelineTreeItem {
+
+ public static final int GUIDELINE_WCAG_P1 = 30;
+
+ public static final int GUIDELINE_WCAG_P2 = 31;
+
+ public static final int GUIDELINE_WCAG_P3 = 32;
+
+ public static final int GUIDELINE_SECTION508 = 33;
+
+ public static final int GUIDELINE_JIS = 34;
+
+ public static final int GUIDELINE_IBMGUIDELINE = 35;
+
+ public static final int GUIDELINE_IBMW3V8 = 36;
+
+ public static final int GUIDELINE_ODF = 37;
+
+ public static final int GUIDELINE_PII = 38;
+
+ private int _guideline = -1;
+
+ private IGuidelineTreeItem _parent = null;
+
+ private List _children = null;
+
+ private boolean _isEnabled = false;
+
+ private boolean[] _correspondingCriteria;
+
+ private int _index;
+
+ private String _name = "";
+
+ private String _category = "";
+
+ private String _description = "";
+
+ //TODO use extension (CheckerInfoProvider)
+
+ public GuidelineTreeItemData(String name) {
+ setName(name);
+ this._children = new ArrayList();
+ }
+
+ public IGuidelineTreeItem getParent() {
+ return this._parent;
+ }
+
+ public void add(IGuidelineTreeItem guidelineTreeItem) {
+ this._children.add(guidelineTreeItem);
+ this._parent = this;
+ }
+
+ public List getChildren() {
+ return this._children;
+ }
+
+ public int getGuideline() {
+ return this._guideline;
+ }
+
+ public void setName(String name) {
+ this._name = name;
+
+ if (null != this._name) {
+ if (this._name.equals("WCAG (P1)")) {
+ this._guideline = GUIDELINE_WCAG_P1;
+ } else if (this._name.equals("WCAG (P2)")) {
+ this._guideline = GUIDELINE_WCAG_P2;
+ } else if (this._name.equals("WCAG (P3)")) {
+ this._guideline = GUIDELINE_WCAG_P3;
+ } else if (this._name.equals("Section508")) {
+ this._guideline = GUIDELINE_SECTION508;
+ } else if (this._name.equals("JIS")) {
+ this._guideline = GUIDELINE_JIS;
+ } else if (this._name.equals("IBMGuideline")) {
+ this._guideline = GUIDELINE_IBMGUIDELINE;
+ } else if (this._name.equals("IBM w3 v8")) {
+ this._guideline = GUIDELINE_IBMW3V8;
+ } else if (this._name.equals("ODF Guide")) {
+ this._guideline = GUIDELINE_ODF;
+ } else if (this._name.equals("PII")) {
+ this._guideline = GUIDELINE_PII;
+ }
+ }
+ }
+
+
+ public Image getGuidelineImage() {
+
+ switch (getGuideline()) {
+ case GUIDELINE_WCAG_P1:
+ case GUIDELINE_WCAG_P2:
+ case GUIDELINE_WCAG_P3:
+ return EvaluationPlugin.getImageDescriptor("icons/media/w3c.png").createImage();
+ case GUIDELINE_SECTION508:
+ return EvaluationPlugin.getImageDescriptor("icons/media/508.png").createImage();
+ case GUIDELINE_JIS:
+ return EvaluationPlugin.getImageDescriptor("icons/media/jsa.png").createImage();
+ case GUIDELINE_IBMGUIDELINE:
+ case GUIDELINE_IBMW3V8:
+ case GUIDELINE_PII:
+ return EvaluationPlugin.getImageDescriptor("icons/media/ibm.png").createImage();
+ case GUIDELINE_ODF:
+ return EvaluationPlugin.getImageDescriptor("icons/media/oasis.png").createImage();
+ }
+
+ return null;
+ }
+
+ public void setEnabled(boolean isEnabled) {
+ this._isEnabled = isEnabled;
+ }
+
+ public boolean isEnabled() {
+ return this._isEnabled;
+ }
+
+ public void setCorrespondingCriteria(boolean[] correspondingCriteria) {
+ this._correspondingCriteria = correspondingCriteria;
+ }
+
+ public boolean[] getCorrespondingCriteria() {
+ return this._correspondingCriteria;
+ }
+
+ public void setIndex(int index) {
+ this._index = index;
+ }
+
+ public int getIndex() {
+ return this._index;
+ }
+
+ public void setCategory(String category) {
+ this._category = category;
+ }
+
+ public String getCategory() {
+ return this._category;
+ }
+
+ public void setDescription(String description) {
+ this._description = description;
+ }
+
+ public String getDescription() {
+ return this._description;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeItemType.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeItemType.java
new file mode 100644
index 0000000..bd1c30f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeItemType.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.swt.graphics.Image;
+
+
+
+
+public class GuidelineTreeItemType implements IGuidelineTreeItem {
+
+ public static final int TYPE_HTML = 10;
+
+ public static final int TYPE_ODF = 11;
+
+ public static final int TYPE_FLASH = 12;
+
+ public int _type;
+
+ private IGuidelineTreeItem _parent = null;
+
+ private List _children = null;
+
+ GuidelineTreeItemType(int type) {
+ this._type = type;
+ this._children = new ArrayList();
+ }
+
+ public void add(IGuidelineTreeItem guidelineTreeItem) {
+ this._children.add(guidelineTreeItem);
+ this._parent = this;
+ }
+
+ public IGuidelineTreeItem getParent() {
+ return this._parent;
+ }
+
+ public List getChildren() {
+ return this._children;
+ }
+
+
+ public String getTypeStr() {
+
+ switch (this._type) {
+ case TYPE_HTML:
+ return "HTML";
+ case TYPE_ODF:
+ return "ODF";
+ case TYPE_FLASH:
+ return "FLASH";
+ }
+
+ return "";
+ }
+
+
+ public Image getTypeImage() {
+
+ switch (this._type) {
+ case TYPE_HTML:
+ return EvaluationPlugin.getImageDescriptor("icons/media/w3c.png").createImage();
+ case TYPE_ODF:
+ return EvaluationPlugin.getImageDescriptor("icons/media/odf.png").createImage();
+ case TYPE_FLASH:
+ return EvaluationPlugin.getImageDescriptor("icons/media/flash.png").createImage();
+ }
+
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeLabelProvider.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeLabelProvider.java
new file mode 100644
index 0000000..f2eb235
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/GuidelineTreeLabelProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class GuidelineTreeLabelProvider extends LabelProvider {
+
+ public String getText(Object element) {
+ if (element instanceof GuidelineTreeItemType) {
+ return ((GuidelineTreeItemType) element).getTypeStr();
+ }
+
+ return ((GuidelineTreeItemData) element).getCategory();
+ }
+
+ public Image getImage(Object element) {
+ if (element instanceof GuidelineTreeItemType) {
+ return ((GuidelineTreeItemType) element).getTypeImage();
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/ICheckerPreferenceConstants.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/ICheckerPreferenceConstants.java
new file mode 100644
index 0000000..a0c99aa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/ICheckerPreferenceConstants.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+
+public interface ICheckerPreferenceConstants {
+
+ String GUIDELINE_PREFIX = "GUIDELINE_";
+
+ String METRICS_PREFIX = "METRICS_";
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/IGuidelineTreeItem.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/IGuidelineTreeItem.java
new file mode 100644
index 0000000..2f52f6f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/IGuidelineTreeItem.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import java.util.List;
+
+
+
+public interface IGuidelineTreeItem {
+
+ public void add(IGuidelineTreeItem guidelineTreeItem);
+
+ public IGuidelineTreeItem getParent();
+
+ public List getChildren();
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/IPreferenceConstants.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/IPreferenceConstants.java
new file mode 100644
index 0000000..d016689
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/IPreferenceConstants.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+public interface IPreferenceConstants {
+
+ // Accessibility Check Properties
+
+ String CHECKER_TARGET = "checker.targetDOM";
+
+ String CHECKER_ORG_DOM = "checker.orgDOM";
+
+ String CHECKER_LIVE_DOM = "checker.liveDOM";
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/NavigabilityWarningDialog.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/NavigabilityWarningDialog.java
new file mode 100644
index 0000000..d5a50ff
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/NavigabilityWarningDialog.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.eval.internal.Messages;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class NavigabilityWarningDialog extends TitleAreaDialog {
+
+ public static final int ENABLE_ALL = 0;
+
+ public static final int DISABLE_NAVIGABILITY = 1;
+
+ public static final int CONTINUE = 2;
+
+ private Button buttonWCAGall;
+
+ private Button buttonNavOff;
+
+ private Button buttonGoAhead;
+
+ /**
+ * @param arg0
+ */
+ public NavigabilityWarningDialog(Shell arg0) {
+ super(arg0);
+ setShellStyle(SWT.PRIMARY_MODAL | SWT.SHELL_TRIM);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ protected void configureShell(Shell arg0) {
+ super.configureShell(arg0);
+ // arg0.setText("Checker Option Warning");
+ // arg0.setImage(Images.Excla);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.dialogs.TitleAreaDialog#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite arg0) {
+ Control contents = super.createContents(arg0);
+ setMessage(
+ Messages.getString("NavigabilityWarningDialog.Message1") + Constants.LINE_SEP + Messages.getString("NavigabilityWarningDialog.Message2"), IMessageProvider.WARNING); //$NON-NLS-1$ //$NON-NLS-2$
+ return contents;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite) super.createDialogArea(parent);
+ composite.setLayout(new GridLayout());
+
+ buttonWCAGall = new Button(composite, SWT.RADIO);
+ buttonWCAGall.setText(Messages.getString("NavigabilityWarningDialog.EnableWCAG")); //$NON-NLS-1$
+ buttonNavOff = new Button(composite, SWT.RADIO);
+ buttonNavOff.setText(Messages.getString("NavigabilityWarningDialog.DisableNav")); //$NON-NLS-1$
+ buttonGoAhead = new Button(composite, SWT.RADIO);
+ buttonGoAhead.setText(Messages.getString("NavigabilityWarningDialog.Continue")); //$NON-NLS-1$
+
+ return composite;
+ }
+
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == IDialogConstants.OK_ID) {
+ if (buttonWCAGall.getSelection()) {
+ setReturnCode(ENABLE_ALL);
+ } else if (buttonNavOff.getSelection()) {
+ setReturnCode(DISABLE_NAVIGABILITY);
+ } else {
+ setReturnCode(CONTINUE);
+ }
+
+ close();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/PreferenceInitializer.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000..d3b8a34
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/preferences/PreferenceInitializer.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.preferences;
+
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = EvaluationPlugin.getDefault()
+ .getPreferenceStore();
+
+ store.setDefault(IPreferenceConstants.CHECKER_TARGET,
+ IPreferenceConstants.CHECKER_ORG_DOM);
+
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ILowvisionProblemSubtype.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ILowvisionProblemSubtype.java
new file mode 100644
index 0000000..b6d50b3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ILowvisionProblemSubtype.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.problem;
+
+
+public interface ILowvisionProblemSubtype {
+ public static final short LOWVISION_COLOR_PROBLEM = 1;
+ public static final short LOWVISION_BLUR_PROBLEM = 2;
+ public static final short LOWVISION_IMAGE_COLOR_PROBLEM = 3;
+ public static final short LOWVISION_FIXED_SIZE_FONT_PROBLEM = 4;
+ public static final short LOWVISION_SMALL_FONT_PROBLEM = 5;
+ public static final short LOWVISION_FIXED_SMALL_FONT_PROBLEM = 6;
+ public static final short LOWVISION_PROHIBITED_BOTH_COLORS_PROBLEM = 7;
+ public static final short LOWVISION_PROHIBITED_FOREGROUND_COLOR_PROBLEM = 8;
+ public static final short LOWVISION_PROHIBITED_BACKGROUND_COLOR_PROBLEM = 9;
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/IPositionSize.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/IPositionSize.java
new file mode 100644
index 0000000..eb416cb
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/IPositionSize.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.problem;
+
+
+public interface IPositionSize {
+
+ /**
+ * @return size of Item
+ */
+ public int getArea();
+
+ /**
+ * @return height of Item
+ */
+ public int getHeight();
+
+ /**
+ * @return width of Item
+ */
+ public int getWidth();
+
+ /**
+ * @return X position of Item
+ */
+ public int getX();
+
+ /**
+ * @return Y position of Item
+ */
+ public int getY();
+
+ /**
+ * @param i
+ * height of Item
+ */
+ public void setHeight(int i);
+
+ /**
+ * @param i
+ * width of Item
+ */
+ public void setWidth(int i);
+
+ /**
+ * @param i
+ * X position of Item
+ */
+ public void setX(int i);
+
+ /**
+ * @param i
+ * Y position of Item
+ */
+ public void setY(int i);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemConst.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemConst.java
new file mode 100644
index 0000000..d321034
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemConst.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.problem;
+
+import org.eclipse.actf.visualization.eval.internal.Messages;
+
+
+public class ProblemConst {
+ public static final String ALL_ERRORS = Messages.getString("ProblemConst.All_Errors_1"); //$NON-NLS-1$
+
+ public static final String ESSENTIAL = Messages.getString("ProblemConst.Essential_2"); //$NON-NLS-1$
+
+ public static final String USER_CHECK = Messages.getString("ProblemConst.User_Check_5"); //$NON-NLS-1$
+
+ public static final String INFO = Messages.getString("ProblemConst.Info"); //$NON-NLS-1$
+
+ public static final String COMPLIANCE = Messages.getString("ProblemConst.Compliance_6"); //$NON-NLS-1$
+
+ public static final String ACCESSIBILITY = Messages.getString("ProblemConst.0"); //$NON-NLS-1$
+
+ //the titles of the Problem Table
+ public final static String TITLE_ICON = Messages.getString("ProblemConst.Type_11"); //$NON-NLS-1$
+
+ public final static String TITLE_LINE = Messages.getString("ProblemConst.Line_12"); //$NON-NLS-1$
+
+ public final static String TITLE_HIGHLIGHT = Messages.getString("ProblemConst.Highlight"); //$NON-NLS-1$
+
+ public final static String TITLE_DESCRIPTION = Messages.getString("ProblemConst.Problem_Description_17"); //$NON-NLS-1$
+
+ public final static String TITLE_FORECOLOR = Messages.getString("ProblemConst.Foreground_18"); //$NON-NLS-1$
+
+ public final static String TITLE_BACKCOLOR = Messages.getString("ProblemConst.Background_19"); //$NON-NLS-1$
+
+ public final static String TITLE_SEVERITY = Messages.getString("ProblemConst.Severity_20"); //$NON-NLS-1$
+
+ public final static String TITLE_X = Messages.getString("ProblemConst.X_21"); //$NON-NLS-1$
+
+ public final static String TITLE_Y = Messages.getString("ProblemConst.Y_22"); //$NON-NLS-1$
+
+ public final static String TITLE_AREA = Messages.getString("ProblemConst.Area_23"); //$NON-NLS-1$
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemException.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemException.java
new file mode 100644
index 0000000..0b944f0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemException.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Junji MAEDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.eval.problem;
+
+public class ProblemException extends Exception {
+
+ //TODO remove
+
+ private static final long serialVersionUID = 6679472433226946290L;
+
+ public ProblemException() {
+ super();
+ }
+
+ public ProblemException(String _s) {
+ super(_s);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemItemImpl.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemItemImpl.java
new file mode 100644
index 0000000..41e4507
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemItemImpl.java
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.problem;
+
+import org.eclipse.actf.util.html2view.Html2ViewMapData;
+import org.eclipse.actf.visualization.eval.IEvaluationItem;
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.actf.visualization.eval.guideline.EvaluationItem;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.HighlightTargetId;
+import org.eclipse.actf.visualization.eval.problem.HighlightTargetNodeInfo;
+import org.eclipse.actf.visualization.eval.problem.HighlightTargetSourceInfo;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.IProblemItemVisitor;
+import org.eclipse.swt.graphics.Image;
+import org.w3c.dom.Node;
+
+
+
+public class ProblemItemImpl implements IProblemItem {
+
+ private static GuidelineHolder GUIDELINE_HOLDER = GuidelineHolder.getInstance();
+
+ private boolean canHighlight = false;
+
+ private IEvaluationItem checkItem;
+
+ private String description = "";
+
+ private int serialNumber = -1;
+
+ private int line = -1;
+
+ private HighlightTargetNodeInfo highlightTargetNodeInfo;
+
+ private HighlightTargetId[] targetIds = new HighlightTargetId[0];
+
+ private HighlightTargetSourceInfo[] targetSources = new HighlightTargetSourceInfo[0];
+
+ private Node targetNode = null;
+
+ protected String targetStringForHPB = "";
+
+ protected String targetString = "";
+
+ // TODO add Icon(for Result doc) info
+
+ /**
+ *
+ */
+ public ProblemItemImpl(String id) {
+ checkItem = GUIDELINE_HOLDER.getCheckItem(id);
+
+ if (checkItem == null) {
+ checkItem = new EvaluationItem("unknown", EvaluationItem.SEV_INFO_STR);
+ System.err.println("Problem Item: unknown id \"" + id + "\"");
+
+ } else {
+ description = checkItem.createDescription();
+ }
+
+ }
+
+ public ProblemItemImpl(String id, Node targetNode) {
+ this(id);
+ setTargetNode(targetNode);
+ }
+
+ public IEvaluationItem getEvaluationItem() {
+ return checkItem;
+ }
+
+ public String getId() {
+ return checkItem.getId();
+ }
+
+ public String[] getTableDataGuideline() {
+ return checkItem.getTableDataGuideline();
+ }
+
+ public String[] getTableDataMetrics() {
+ return checkItem.getTableDataMetrics();
+ }
+
+ public int[] getMetricsScores() {
+ return checkItem.getMetricsScores();
+ }
+
+ public Image[] getMetricsIcons() {
+ return checkItem.getMetricsIcons();
+ }
+
+ public int getSeverity() {
+ return checkItem.getSeverity();
+ }
+
+ public String getSeverityStr() {
+ return checkItem.getSeverityStr();
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public int getSerialNumber() {
+ return serialNumber;
+ }
+
+ public Node getTargetNode() {
+ return targetNode;
+ }
+
+ public String getTargetStringForHPB() {
+ return targetStringForHPB;
+ }
+
+ public boolean isCanHighlight() {
+ return canHighlight;
+ }
+
+ public void setCanHighlight(boolean canHighlight) {
+ this.canHighlight = canHighlight;
+ }
+
+ public void setCheckItem(IEvaluationItem checkItem) {
+ this.checkItem = checkItem;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setSerialNumber(int serialNumber) {
+ this.serialNumber = serialNumber;
+ }
+
+ public void setHighlightTargetIds(HighlightTargetId[] targetIds) {
+ if (targetIds != null) {
+ this.targetIds = targetIds;
+ if (targetIds.length > 0) {
+ canHighlight = true;
+ }
+ }
+ }
+
+ public HighlightTargetId[] getHighlightTargetIds() {
+ return (targetIds);
+ }
+
+ public void setTargetNode(Node targetNode) {
+ this.targetNode = targetNode;
+ }
+
+ public void setTargetStringForHPB(String targetString) {
+ this.targetStringForHPB = targetString;
+ }
+
+ public String getTargetString() {
+ return targetString;
+ }
+
+ public void setTargetString(String targetString) {
+ this.targetString = targetString;
+ if (targetString != null && targetString.length() > 0) {
+ this.description = checkItem.createDescription(targetString);
+ }
+ }
+
+ public int getLine() {
+ return line;
+ }
+
+ public void setLine(int line) {
+ this.line = line;
+ }
+
+ public String getLineStr() {
+ int curLine = getLine();
+ if (curLine > -1) {
+ return (Integer.toString(curLine));
+ } else {
+ return ("");
+ }
+ }
+
+ public String getLineStrMulti() {
+ StringBuffer tmpSB = new StringBuffer();
+ // TODO check multiple same line number
+ if (targetSources.length > 0) {
+ for (int i = 0; i < targetSources.length; i++) {
+ int tmp = targetSources[i].getStartLine() + 1;
+ tmpSB.append(tmp);
+ tmpSB.append(", ");
+ }
+ String result = tmpSB.substring(0, tmpSB.length() - 2);
+ return result;
+ }
+ if (line > -1) {
+ return (Integer.toString(line));
+ } else {
+ return ("");
+ }
+ }
+
+ public void setHighlightTargetSourceInfo(HighlightTargetSourceInfo[] targetSourceInfo) {
+ if (targetSourceInfo != null) {
+ targetSources = targetSourceInfo;
+ int tmpLine = Integer.MAX_VALUE;
+ for (int i = 0; i < targetSources.length; i++) {
+ if (tmpLine > targetSources[i].getStartLine()) {
+ tmpLine = targetSources[i].getStartLine();
+ }
+ // TODO
+ if (tmpLine != Integer.MAX_VALUE) {
+ line = tmpLine;
+ }
+ }
+ }
+ }
+
+ public HighlightTargetSourceInfo[] getHighlightTargetSoruceInfo() {
+ if (targetSources.length == 0 && line > -1) {
+ Html2ViewMapData dummy = new Html2ViewMapData(new int[] { line, -1 }, new int[] { line, -1 });
+ return (new HighlightTargetSourceInfo[] { new HighlightTargetSourceInfo(dummy, dummy) });
+ }
+ return (targetSources);
+ }
+
+ public void accept(IProblemItemVisitor visitor) {
+ visitor.visit(this);
+ }
+
+ public HighlightTargetNodeInfo getHighlightTargetNodeInfo() {
+ return highlightTargetNodeInfo;
+ }
+
+
+ public void setHighlightTargetNodeInfo(HighlightTargetNodeInfo targetNodeInfo) {
+ this.highlightTargetNodeInfo = targetNodeInfo;
+ }
+
+ public void setHighlightTargetIds(HighlightTargetId targetId) {
+ if(targetId!=null){
+ this.setHighlightTargetIds(new HighlightTargetId[]{targetId});
+ }
+ }
+
+ public void setHighlightTargetSourceInfo(HighlightTargetSourceInfo targetSourceInfo) {
+ if(targetSourceInfo!=null){
+ this.setHighlightTargetSourceInfo(new HighlightTargetSourceInfo[]{targetSourceInfo});
+ }
+ }
+
+ public IGuidelineItem[] getGuidelines() {
+ if(checkItem!=null){
+ return checkItem.getGuidelines();
+ }
+ return new IGuidelineItem[0];
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemItemLV.java b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemItemLV.java
new file mode 100644
index 0000000..066529d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.eval/src/org/eclipse/actf/visualization/eval/problem/ProblemItemLV.java
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Junji MAEDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.eval.problem;
+
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.swt.graphics.Image;
+
+
+
+
+public class ProblemItemLV extends ProblemItemImpl implements IPositionSize, ILowvisionProblemSubtype {
+
+ public static final int ICON_BOKE = 3;
+
+ public static final int ICON_IRO = 1;
+
+ //TODO i18n, consider plugin
+ private static final String ERR_IRO = "Color problem";
+
+ private static final String ERR_COMPLIANCEALERT = "Compliance information";
+
+ private static final String ERR_BOKE = "Blur problem";
+
+ private static final String ERR_HIGHLIGHT = "(can highlight)";
+
+
+ private int area = 0;
+
+ private String backgroundS = "";
+
+ private String foregroundS = "";
+
+ private int frameId = -1;
+
+ private int frameOffset = 0;
+
+ private String frameUrlS = "";
+
+ private int height = 0;
+
+ private int iconId;
+
+ private int severityLV = 0;
+
+ private int width = 0;
+
+ private int x = 0;
+
+ private int y = 0;
+
+ private short subType;
+
+ //TODO recommendation
+
+
+ /**
+ * @param id
+ */
+ public ProblemItemLV(String id) {
+ super(id);
+ }
+
+ public int getArea() {
+ return area;
+ }
+
+ public String getBackgroundS() {
+ return backgroundS;
+ }
+
+ public String getForegroundS() {
+ return foregroundS;
+ }
+
+ public int getFrameId() {
+ return frameId;
+ }
+
+ public int getFrameOffset() {
+ return frameOffset;
+ }
+
+ public String getFrameUrlS() {
+ return frameUrlS;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public int getIconId() {
+ return iconId;
+ }
+
+ public Image getImageIcon() {
+ //return imageIcon;
+ if (isCanHighlight()) {
+ switch (iconId) {
+ case ICON_IRO:
+ return EvaluationPlugin.getImageDescriptor("icons/lowvision/HiIro21.gif").createImage();
+ case ICON_BOKE:
+ return EvaluationPlugin.getImageDescriptor("icons/lowvision/HiBoke21.gif").createImage();
+ default:
+ return null;
+ }
+ } else {
+ switch (iconId) {
+ case ICON_IRO:
+ return EvaluationPlugin.getImageDescriptor("icons/lowvision/ErrIro21.gif").createImage();
+ case ICON_BOKE:
+ return EvaluationPlugin.getImageDescriptor("icons/lowvision/ErrBoke21.gif").createImage();
+ default:
+ return null;
+ }
+ }
+ }
+
+ public String getImageIconTooltip() {
+ //return imageIcon;
+ if (isCanHighlight()) {
+ switch (iconId) {
+ case ICON_IRO:
+ return ERR_IRO + " " + ERR_HIGHLIGHT;
+ case ICON_BOKE:
+ return ERR_BOKE + " " + ERR_HIGHLIGHT;
+ default:
+ System.out.println("Icon not found: " + iconId);
+ return ERR_COMPLIANCEALERT + " " + ERR_HIGHLIGHT;
+
+ }
+ } else {
+ switch (iconId) {
+ case ICON_IRO:
+ return ERR_IRO;
+ case ICON_BOKE:
+ return ERR_BOKE;
+ default:
+ System.out.println("Icon not found: " + iconId);
+ return ERR_COMPLIANCEALERT;
+ }
+ }
+ }
+
+ public int getSeverityLV() {
+ return severityLV;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void setArea(int area) {
+ this.area = area;
+ }
+
+ public void setBackgroundS(String backgroundS) {
+ this.backgroundS = backgroundS;
+ }
+
+ public void setForegroundS(String foregroundS) {
+ this.foregroundS = foregroundS;
+ }
+
+ public void setFrameId(int frameId) {
+ this.frameId = frameId;
+ }
+
+ public void setFrameOffset(int frameOffset) {
+ this.frameOffset = frameOffset;
+ }
+
+ public void setFrameUrlS(String frameUrlS) {
+ this.frameUrlS = frameUrlS;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public void setSeverityLV(int severityLV) {
+ this.severityLV = severityLV;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ public short getSubType() {
+ return subType;
+ }
+
+ public void setSubType(short subType) {
+ this.subType = subType;
+ //TODO
+ if (subType == LOWVISION_COLOR_PROBLEM || subType == LOWVISION_IMAGE_COLOR_PROBLEM) {
+ iconId=ICON_IRO;
+ } else {
+ iconId=ICON_BOKE;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/.classpath b/plugins/org.eclipse.actf.visualization.flash/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.flash/.cvsignore b/plugins/org.eclipse.actf.visualization.flash/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.actf.visualization.flash/.project b/plugins/org.eclipse.actf.visualization.flash/.project
new file mode 100644
index 0000000..084b276
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.flash</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.flash/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.flash/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ca4b09a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF Flash Visualization Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.flash;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.flash.FlashPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.views,
+ org.eclipse.actf.model.flash.bridge,
+ org.eclipse.actf.common,
+ org.eclipse.actf.visualization.gui
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.actf.visualization.flash.ui.views
diff --git a/plugins/org.eclipse.actf.visualization.flash/about.html b/plugins/org.eclipse.actf.visualization.flash/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.flash/build.properties b/plugins/org.eclipse.actf.visualization.flash/build.properties
new file mode 100644
index 0000000..7f4a620
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/build.properties
@@ -0,0 +1,22 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ about.html,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ plugin_ja.properties,\
+ icons/
+bin.excludes = icons/view16/.cvsignore,\
+ icons/flash16/.cvsignore,\
+ icons/ovr16/.cvsignore
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/.cvsignore b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_accprops.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_accprops.gif
new file mode 100644
index 0000000..e615e2a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_accprops.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_button.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_button.gif
new file mode 100644
index 0000000..d143fcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_button.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_flash.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_flash.gif
new file mode 100644
index 0000000..94c466e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_flash.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_function.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_function.gif
new file mode 100644
index 0000000..1a03804
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_function.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_movieclip.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_movieclip.gif
new file mode 100644
index 0000000..9361d65
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_movieclip.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_object.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_object.gif
new file mode 100644
index 0000000..a92004b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_object.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_others.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_others.gif
new file mode 100644
index 0000000..48db418
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_others.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_string.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_string.gif
new file mode 100644
index 0000000..d4e280e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_string.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_text.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_text.gif
new file mode 100644
index 0000000..a3ced23
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_text.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_variable.gif b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_variable.gif
new file mode 100644
index 0000000..05adc8f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/flash16/type_variable.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/.cvsignore b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/black.gif b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/black.gif
new file mode 100644
index 0000000..9459ab6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/black.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/green.gif b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/green.gif
new file mode 100644
index 0000000..1e5bfd5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/green.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/red.gif b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/red.gif
new file mode 100644
index 0000000..308ce38
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/red.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/yellow.gif b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/yellow.gif
new file mode 100644
index 0000000..3f2fef4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/ovr16/yellow.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/view16/.cvsignore b/plugins/org.eclipse.actf.visualization.flash/icons/view16/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/view16/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.flash/icons/view16/domtreeview.gif b/plugins/org.eclipse.actf.visualization.flash/icons/view16/domtreeview.gif
new file mode 100644
index 0000000..34fb3c9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/icons/view16/domtreeview.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.flash/plugin.properties b/plugins/org.eclipse.actf.visualization.flash/plugin.properties
new file mode 100644
index 0000000..3b0a4a5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/plugin.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+FlashDOMView.name=Flash Outline
+FlashNode.properties=Flash Properties
+FlashPlayer.properties=Flash Error Properties
+FlashFind.menu=&Find Flash DOM
diff --git a/plugins/org.eclipse.actf.visualization.flash/plugin.xml b/plugins/org.eclipse.actf.visualization.flash/plugin.xml
new file mode 100644
index 0000000..1978c72
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/plugin.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ class="org.eclipse.actf.visualization.flash.ui.views.FlashDOMView"
+ icon="icons/view16/domtreeview.gif"
+ id="org.eclipse.actf.visualization.flash.ui.views.FlashDOMView"
+ name="%FlashDOMView.name"/>
+ </extension>
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory adaptableType="org.eclipse.actf.model.flash.FlashPlayer"
+ class="org.eclipse.actf.visualization.flash.ui.properties.FlashPropertySourceAdapterFactory">
+ <adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
+ </factory>
+ <factory adaptableType="org.eclipse.actf.model.flash.FlashNode"
+ class="org.eclipse.actf.visualization.flash.ui.properties.FlashPropertySourceAdapterFactory">
+ <adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
+ </factory>
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.actf.visualization.flash.objectContribution1"
+ objectClass="org.eclipse.actf.accservice.swtbridge.AccessibleObject">
+ <action
+ class="org.eclipse.actf.visualization.flash.ui.actions.FindFlashAction"
+ enablesFor="1"
+ icon="icons/flash16/type_flash.gif"
+ id="org.eclipse.actf.visualization.flash.action1"
+ label="%FlashFind.menu"
+ menubarPath="additions"/>
+ <visibility>
+ <objectState
+ name="findFlash"
+ value="valid"/>
+ </visibility>
+ </objectContribution>
+ </extension>
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory adaptableType="org.eclipse.actf.accservice.swtbridge.AccessibleObject"
+ class="org.eclipse.actf.visualization.flash.ui.actions.FlashFinderAdapterFactory">
+ <adapter type="org.eclipse.ui.IActionFilter"/>
+ </factory>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.actf.visualization.flash/plugin_ja.properties b/plugins/org.eclipse.actf.visualization.flash/plugin_ja.properties
new file mode 100644
index 0000000..be23bc9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/plugin_ja.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+FlashDOMView.name=Flash \u30a2\u30a6\u30c8\u30e9\u30a4\u30f3
+FlashNode.properties=Flash\u30d7\u30ed\u30d1\u30c6\u30a3
+FlashPlayer.properties=Flash\u30a8\u30e9\u30fc\u30d7\u30ed\u30d1\u30c6\u30a3
+FlashFind.menu=\u5bfe\u5fdc\u3059\u308bFlash DOM\u3092\u691c\u7d22\u3059\u308b(&F)
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/messages.properties b/plugins/org.eclipse.actf.visualization.flash/src/messages.properties
new file mode 100644
index 0000000..95abb70
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/messages.properties
@@ -0,0 +1,28 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#flash
+flash.element_found={0} item(s) found
+flash.error_no_element=No items found
+flash.filter_noninformative=&Filter Non-informative Items
+flash.flash_dom=Flash DOM
+flash.player_loading=Loading... (Please retry later)
+flash.player_no_dom=Flash DOM is not available
+flash.player_no_xcode=Flash DOM is not transcoded
+flash.player_unknown=Unexpected Flash item
+flash.show_visual=Show &Visuall Structure
+flash.bad_flash_version=Flash Player version {0} is currently installed.\n\nPlease install Flash Player version 8 or later.
+flash.debugMode=Show &All Information (Debug Mode)
+flash.scanWindowless=&Scan Windowless Flash (Debug Mode)
+flash.error_no_location=No Location
+flash.error_select_flash=Please select Flash Item
+#debug message : no need to translate
+flash.error_target_length=Error: target level {0}
+
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/messages_ja.properties b/plugins/org.eclipse.actf.visualization.flash/src/messages_ja.properties
new file mode 100644
index 0000000..8453964
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/messages_ja.properties
@@ -0,0 +1,25 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#flash
+flash.element_found={0} \u9805\u76ee\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f
+flash.error_no_element=\u9805\u76ee\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093
+flash.filter_noninformative=\u6709\u76ca\u306a\u60c5\u5831\u306e\u307f\u3092\u8868\u793a\u3059\u308b(&F)
+flash.flash_dom=Flash DOM
+flash.player_loading=\u30ed\u30fc\u30c9\u4e2d... (\u3042\u3068\u3067\u518d\u8a66\u884c\u3057\u3066\u304f\u3060\u3055\u3044)
+flash.player_no_dom=Flash DOM\u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093
+flash.player_no_xcode=Flash DOM\u304c\u5909\u63db\u3055\u308c\u3066\u3044\u307e\u305b\u3093
+flash.player_unknown=\u4e88\u671f\u305b\u306cFlash\u9805\u76ee\u3067\u3059
+flash.show_visual=\u8996\u899a\u69cb\u9020\u3092\u8868\u793a\u3059\u308b(&V)
+flash.bad_flash_version=Flash Player \u30d0\u30fc\u30b8\u30e7\u30f3 {0} \u304c\u73fe\u5728\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\nFlash Player \u30d0\u30fc\u30b8\u30e7\u30f3 8 \u4ee5\u4e0a\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+flash.debugMode=\u3059\u3079\u3066\u306e\u60c5\u5831\u3092\u8868\u793a\u3059\u308b (\u30c7\u30d0\u30c3\u30b0\u7528)(&A)
+flash.scanWindowless=Windowless\u30d5\u30e9\u30c3\u30b7\u30e5\u3092\u691c\u7d22\u3059\u308b (\u30c7\u30d0\u30c3\u30b0\u7528)(&S)
+flash.error_no_location=\u5834\u6240\u304c\u4e0d\u660e\u3067\u3059
+flash.error_select_flash=Flash\u9805\u76ee\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/ASBridge.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/ASBridge.java
new file mode 100644
index 0000000..42633f1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/ASBridge.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.model.flash;
+
+import org.eclipse.actf.model.flash.bridge.IWaXcoding;
+import org.eclipse.actf.model.flash.bridge.WaXcodingPlugin;
+import org.eclipse.actf.util.as.ASDeserializer;
+import org.eclipse.actf.util.as.ASSerializer;
+import org.eclipse.swt.widgets.Display;
+
+
+
+public class ASBridge {
+ public static final String ROOTLEVEL_PATH = "_level0"; //$NON-NLS-1$
+ public static final String BRIDGELEVEL_PATH = "_level53553"; //$NON-NLS-1$
+
+ private FlashPlayer player;
+ private String requestArgsPath;
+ private String responseValuePath;
+
+ private String contentId;
+ private String secret;
+
+ public static ASBridge getInstance(FlashPlayer player) {
+ if( "true".equals(player.getVariable(ROOTLEVEL_PATH+".Eclipse_ACTF_is_available")) ) { //$NON-NLS-1$ //$NON-NLS-2$
+ return new ASBridge(player,ROOTLEVEL_PATH);
+ }
+ else if( "true".equals(player.getVariable(BRIDGELEVEL_PATH+".Eclipse_ACTF_is_available")) ) { //$NON-NLS-1$ //$NON-NLS-2$
+ return new ASBridge(player,BRIDGELEVEL_PATH);
+ }
+ return null;
+ }
+
+ private ASBridge(FlashPlayer player, String rootPath) {
+ this.player = player;
+ this.requestArgsPath = rootPath + ".Eclipse_ACTF_request_args"; //$NON-NLS-1$
+ this.responseValuePath = rootPath + ".Eclipse_ACTF_response_value"; //$NON-NLS-1$
+ this.contentId = rootPath + ".Eclipse_ACTF_SWF_CONTENT_ID"; //$NON-NLS-1$
+ }
+
+ public Object invoke(Object[] args) {
+ int counter = 0;
+ try {
+ if (secret == null) {
+ initSecret();
+ if (secret == null) return null;
+ }
+ player.setVariable(responseValuePath, ""); //$NON-NLS-1$
+ String argsStr = ASSerializer.serialize(secret,args);
+ player.setVariable(requestArgsPath, argsStr);
+ while (++counter < 100) {
+ String value = player.getVariable(responseValuePath);
+ if( null==value ) return null;
+ if (value.length() > 0) {
+ ASDeserializer asd = new ASDeserializer(value);
+ return asd.deserialize();
+ }
+ Display.getCurrent().readAndDispatch();//Yield.once();
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ finally {
+ if( 1 != counter ) {
+ System.out.println("Warning: counter="+counter); //$NON-NLS-1$
+ for( int i=0; i<args.length; i++ ) {
+ System.out.println("args["+i+"]="+args[i]); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ return null;
+ }
+
+
+ private void initSecret() {
+ try {
+ String id = player.getVariable(contentId);
+ if (id.length() == 0) return;
+ IWaXcoding waxcoding = WaXcodingPlugin.getDefault().getIWaXcoding();
+ this.secret = waxcoding.getSecret(id,false);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashAccInfo.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashAccInfo.java
new file mode 100644
index 0000000..5d5a426
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashAccInfo.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.model.flash;
+
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+public class FlashAccInfo {
+
+ private FlashNode parent;
+ private Boolean hasOnRelease;
+ private Boolean isSilent;
+ private Integer accRole;
+
+ public FlashAccInfo(FlashNode parent) {
+ this.parent = parent;
+ }
+
+ public void dispose() {
+
+ }
+
+ public boolean hasOnRelease() {
+ if( null == hasOnRelease ) {
+ FlashNode onReleaseNode = parent.getNode("onRelease"); //$NON-NLS-1$
+ if( null != onReleaseNode ) {
+ hasOnRelease = Boolean.TRUE;
+ onReleaseNode.dispose();
+ }
+ else {
+ hasOnRelease = Boolean.FALSE;
+ }
+ }
+ return hasOnRelease.booleanValue();
+ }
+
+ public int getAccRole() {
+ if( null == accRole ) {
+ Variant varRole = parent.getPlayer().callMethod(parent.getTarget()+"._accImpl","get_accRole",new Variant(0)); //$NON-NLS-1$ //$NON-NLS-2$
+ if( null != varRole && OLE.VT_I4==varRole.getType() ) {
+ accRole = new Integer(varRole.getInt());
+ }
+ else {
+ accRole = new Integer(-1);
+ }
+ }
+ return accRole.intValue();
+ }
+
+ public boolean isSilent() {
+ if( null == isSilent ) {
+ FlashNode accSilentNode = parent.getNode("_accProps.silent"); //$NON-NLS-1$
+ if( null != accSilentNode ) {
+ isSilent = new Boolean("true".equals(accSilentNode.getValue())); //$NON-NLS-1$
+ accSilentNode.dispose();
+ }
+ else {
+ isSilent = Boolean.FALSE;
+ }
+ }
+ return isSilent.booleanValue();
+ }
+
+ public String getAccName() {
+ Variant varName = parent.getPlayer().callMethod(parent.getTarget()+"._accImpl","get_accName", new Variant(0)); //$NON-NLS-1$ //$NON-NLS-2$
+ if( null != varName && OLE.VT_BSTR==varName.getType() ) {
+ return varName.getString();
+ }
+ FlashNode accNameNode = parent.getNode("_accProps.name"); //$NON-NLS-1$
+ if( null != accNameNode ) {
+ try {
+ return accNameNode.getValue();
+ }
+ finally {
+ accNameNode.dispose();
+ }
+ }
+ return null;
+ }
+
+ public String getAccDescription() {
+ FlashNode accDescriptionNode = parent.getNode("_accProps.description"); //$NON-NLS-1$
+ if( null != accDescriptionNode ) {
+ try {
+ return accDescriptionNode.getValue();
+ }
+ finally {
+ accDescriptionNode.dispose();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashAdjust.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashAdjust.java
new file mode 100644
index 0000000..9717296
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashAdjust.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.model.flash;
+
+import org.eclipse.actf.visualization.gui.common.WebBrowserUtil;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+
+public class FlashAdjust {
+
+ public static final String ERROR_OK = "OK: "; //$NON-NLS-1$
+ public static final String ERROR_NG = "NG: "; //$NON-NLS-1$
+ public static final String ERROR_NA = "NA: "; //$NON-NLS-1$
+ public static final String ERROR_WAIT = "WAIT: "; //$NON-NLS-1$
+
+ private Variant varFlash = null;
+ private OleAutomation flashAutomation = null;
+
+ public FlashAdjust(Object flashObject/*, int validate*/) {
+ varFlash = WebBrowserUtil.getHTMLElementFromObject(flashObject);
+ if( null != varFlash && OLE.VT_DISPATCH==varFlash.getType() ) {
+ flashAutomation = varFlash.getAutomation();
+ }
+ }
+
+ public void dispose() {
+ if( null!=varFlash ) varFlash.dispose();
+ }
+
+ public void adjust(String newId) {
+ if( null==flashAutomation ) return;
+
+ int[] idGetVariable = flashAutomation.getIDsOfNames(new String[]{"GetVariable"}); //$NON-NLS-1$
+ if( null != flashAutomation.invoke(idGetVariable[0],new Variant[]{new Variant(ASBridge.ROOTLEVEL_PATH+".Eclipse_ACTF_is_available")}) || //$NON-NLS-1$
+ null != flashAutomation.invoke(idGetVariable[0],new Variant[]{new Variant(ASBridge.BRIDGELEVEL_PATH+".Eclipse_ACTF_is_available")})) { //$NON-NLS-1$
+ setErrorAttribute(ERROR_OK+"Flash DOM detected"); //$NON-NLS-1$
+ return;
+ }
+ int[] idTagName = flashAutomation.getIDsOfNames(new String[]{"tagName"}); //$NON-NLS-1$
+ if( null != idTagName ) {
+ Variant varTagName = flashAutomation.getProperty(idTagName[0]);
+ if( null!=varTagName && OLE.VT_BSTR==varTagName.getType() ) {
+ String strTagName = varTagName.getString();
+ if( !"OBJECT".equalsIgnoreCase(strTagName) ) { //$NON-NLS-1$
+ setErrorAttribute(ERROR_NG+strTagName+" tag is not supoported"); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ }
+ }
+ int[] idReadyState = flashAutomation.getIDsOfNames(new String[]{"ReadyState"}); //$NON-NLS-1$
+ if( null!=idReadyState ) {
+ Variant varReadyState = flashAutomation.getProperty(idReadyState[0]);
+ if( null!=varReadyState && OLE.VT_I4==varReadyState.getType() ) {
+ int readyState = varReadyState.getInt();
+ if( readyState < 4 ) {
+ setErrorAttribute(ERROR_WAIT+"Flash movie is not ready (ReadyState="+readyState+")"); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ }
+ }
+ setErrorAttribute(ERROR_NA+"Flash DOM is not available"); //$NON-NLS-1$
+ }
+
+ private void setErrorAttribute(String message) {
+ int[] idSetAttribute = flashAutomation.getIDsOfNames(new String[]{"setAttribute"}); //$NON-NLS-1$
+ if( null != idSetAttribute ) {
+ flashAutomation.invoke(idSetAttribute[0],new Variant[]{new Variant("aDesignerError"),new Variant(message)}); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashDetect.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashDetect.java
new file mode 100644
index 0000000..e821379
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashDetect.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.model.flash;
+
+import java.text.MessageFormat;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.actf.visualization.flash.Messages;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IDispatch;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.Variant;
+import org.eclipse.swt.widgets.Display;
+
+
+public class FlashDetect {
+
+ private static final GUID CLSID_FLASH = COMUtil.IIDFromString("{D27CDB6E-AE6D-11CF-96B8-444553540000}"); //$NON-NLS-1$
+
+ private static String strVersion = null;
+
+ static {
+ try {
+ int pv = COMUtil.createDispatch(CLSID_FLASH);
+ if( 0 != pv ) {
+ IDispatch dispFlash = new IDispatch(pv);
+ Variant varFlash = new Variant(dispFlash);
+ try {
+ OleAutomation auto = varFlash.getAutomation();
+ int[] idGetVersion = auto.getIDsOfNames(new String[]{"GetVariable"}); //$NON-NLS-1$
+ if( null != idGetVersion ) {
+ Variant varVersion = auto.invoke(idGetVersion[0],new Variant[]{new Variant("$version")}); //$NON-NLS-1$
+ if( null != varVersion && OLE.VT_BSTR == varVersion.getType() ) {
+ String rawVersion = varVersion.getString();
+ int sep = rawVersion.indexOf(' ');
+ if( sep > 0 ) {
+ strVersion = rawVersion.substring(sep+1);
+ }
+ }
+ }
+ }
+ finally {
+ varFlash.dispose();
+ }
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void showDialog() {
+ if( null == strVersion ) return;
+ int sep = strVersion.indexOf(',');
+ if( sep > 0 ) {
+ try {
+ if( Integer.parseInt(strVersion.substring(0,sep)) < 8 ) {
+ MessageDialog.openWarning(Display.getCurrent().getActiveShell(),
+ Messages.getString("msaa.warning"), //$NON-NLS-1$
+ MessageFormat.format(Messages.getString("flash.bad_flash_version"),new Object[]{strVersion})); //$NON-NLS-1$
+ }
+ }
+ catch( Exception e ) {
+ }
+ }
+ strVersion = null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashNode.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashNode.java
new file mode 100644
index 0000000..0634afd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashNode.java
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.model.flash;
+
+import java.net.URLDecoder;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.actf.util.as.ASObject;
+import org.eclipse.actf.visualization.flash.Messages;
+import org.eclipse.actf.visualization.gui.flash.FlashFinder;
+
+
+public class FlashNode {
+
+ private FlashPlayer player;
+ private ASObject asObject;
+ private FlashNode parent;
+ private int level;
+ private FlashAccInfo accInfo;
+ private boolean isReference = false;
+ private boolean skipChildren = false;
+ private boolean isAccProperties = false;
+
+ private String strType;
+ private String strClassName;
+ private String strObjectName;
+ private String strTarget;
+ private boolean isUIComponent;
+
+ private static final String
+ sidType = "type", //$NON-NLS-1$
+ sidClassName = "className", //$NON-NLS-1$
+ sidObjectName = "objectName", //$NON-NLS-1$
+ sidTarget = "target", //$NON-NLS-1$
+ sidValue = "value", //$NON-NLS-1$
+ sidText = "text", //$NON-NLS-1$
+ sidTitle = "title", //$NON-NLS-1$
+ sidIsUIComponent = "isUIComponent"; //$NON-NLS-1$
+
+ public FlashNode(FlashNode parent, FlashPlayer player,Object node) {
+ this.parent = parent;
+ this.level = null != parent ? parent.getLevel()+1 : 0;
+ this.player = player;
+
+ if( node instanceof ASObject ) {
+ asObject = (ASObject)node;
+ strType = getString(sidType);
+ strClassName = getString(sidClassName);
+ strObjectName = getString(sidObjectName);
+ strTarget = getString(sidTarget);
+ isUIComponent = "true".equals(getString(sidIsUIComponent)); //$NON-NLS-1$
+ }
+
+ if( null != parent ) {
+ String targetParent = parent.getTarget();
+ if( null != targetParent ) {
+ if( !strTarget.equals(targetParent+"."+strObjectName) ) { //$NON-NLS-1$
+ isReference = true;
+ }
+ }
+ String parentObjectName = parent.getObjectName();
+ if( "_accProps".equals(parentObjectName) || //$NON-NLS-1$
+ "_accImpl".equals(parentObjectName) ) { //$NON-NLS-1$
+ isAccProperties = true;
+ }
+ }
+ if( "number".equals(strType) || //$NON-NLS-1$
+ "null".equals(strType) || //$NON-NLS-1$
+ "boolean".equals(strType) || //$NON-NLS-1$
+ "string".equals(strType) || //$NON-NLS-1$
+ "undefined".equals(strType) ) { //$NON-NLS-1$
+ skipChildren = true;
+ }
+ else if( "object".equals(strType) ) { //$NON-NLS-1$
+ if( null == strClassName ||
+ "Array".equals(strClassName) ) { //$NON-NLS-1$
+ skipChildren = true;
+ }
+ }
+ else if( "movieclip".equals(strType) ) { //$NON-NLS-1$
+ if( "_level0.reserved".equals(strTarget) || //$NON-NLS-1$
+ "_level0.focusManager".equals(strTarget) ){ //$NON-NLS-1$
+ skipChildren = true;
+ }
+ }
+ this.accInfo = new FlashAccInfo(this);
+ }
+
+ public String getType() {
+ return strType;
+ }
+ public String getClassName() {
+ return strClassName;
+ }
+ public String getObjectName() {
+ return strObjectName;
+ }
+ public String getTarget() {
+ return strTarget;
+ }
+
+ public boolean isUIComponent() {
+ return isUIComponent;
+ }
+
+ public String getValue() {
+ if( null != asObject ) {
+ return decodeString(getString(sidValue));
+ }
+ return null;
+ }
+
+ public String getText() {
+ return getText(true);
+ }
+
+ public String getText(boolean useAccName) {
+ String text = null;
+ if( useAccName ) {
+ text = accInfo.getAccName();
+ }
+ if( null == text ) {
+ if( null != asObject ) {
+ text = getString(sidText);
+ }
+ }
+ else {
+ text = "["+text+"]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return decodeString(text);
+ }
+
+ public String getTitle() {
+ if( null != asObject ) {
+ return decodeString(getString(sidTitle));
+ }
+ return null;
+ }
+
+ public String getString(String name) {
+ if( null != asObject ) {
+ Object result = asObject.get(name);
+ return null==result ? null : result.toString();
+ }
+ return null;
+ }
+
+ public Object getObject(String name) {
+ if( null != asObject ) {
+ return asObject.get(name);
+ }
+ return null;
+ }
+
+ private static String decodeString(String input) {
+ if( null != input ) {
+ try {
+ return URLDecoder.decode(input,"UTF-8"); //$NON-NLS-1$
+ }
+ catch( Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return input;
+ }
+
+ public FlashNode getParent() {
+ return parent;
+ }
+
+ public int getLevel() {
+ return level;
+ }
+
+ protected boolean shouldSkip() {
+ return (skipChildren && !isAccProperties) || isReference;
+ }
+
+ protected boolean isAccProperties() {
+ return isAccProperties;
+ }
+
+ public boolean hasChild(boolean visual) {
+ if( level>=50 ) {
+ throw new Error(MessageFormat.format(Messages.getString("flash.error_target_length"),new Object[]{new Integer(level)})+"\n"+strTarget); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return player.hasChild(this,visual);
+ }
+
+ public Object[] getChildren(boolean visual, boolean informative/*, boolean debugMode*/ ) {
+ FlashNode[] children = player.getChildren(this,visual);
+ List<FlashNode> childList = new ArrayList<FlashNode>();
+ for( int i=0; i<children.length; i++ ) {
+ FlashNode node = children[i];
+ if( !FlashFinder.debugMode ) {
+ if( !visual && node.shouldSkip() ) {
+ continue;
+ }
+ if( informative && !node.isAccProperties() ) {
+ if( null == node.getText() &&
+ !"movieclip".equals(node.getType()) && //$NON-NLS-1$
+ !"Button".equals(node.getClassName()) && //$NON-NLS-1$
+ !"_accProps".equals(node.getObjectName()) && //$NON-NLS-1$
+ !"_accImpl".equals(node.getObjectName()) && //$NON-NLS-1$
+ !"onRelease".equals(node.getObjectName()) ) //$NON-NLS-1$
+ {
+ continue;
+ }
+ }
+ }
+ childList.add(node);
+ }
+ return childList.toArray();
+ }
+
+ public void dispose() {
+ }
+
+ public FlashNode getNode(String nodeName) {
+ return player.getNodeFromPath(getTarget()+"."+nodeName); //$NON-NLS-1$
+ }
+
+ public void setMarker() {
+ if( null != asObject ) {
+ player.setMarker(asObject.get("x"),asObject.get("y"),asObject.get("w"),asObject.get("h")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ }
+
+ public FlashPlayer getPlayer() {
+ return player;
+ }
+
+ public FlashAccInfo getAccInfo() {
+ return accInfo;
+ }
+
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public Set getKeys() {
+ if( null != asObject ) {
+ return asObject.getKeys();
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashPlayer.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashPlayer.java
new file mode 100644
index 0000000..bb9299b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/model/flash/FlashPlayer.java
@@ -0,0 +1,262 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.model.flash;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.util.as.ASObject;
+import org.eclipse.actf.visualization.flash.Messages;
+import org.eclipse.actf.visualization.gui.common.WebBrowserUtil;
+import org.eclipse.actf.visualization.gui.flash.FlashFinder;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+
+public class FlashPlayer {
+
+ private OleAutomation automation;
+ private Variant varMarker;
+ private int idGetAttribute;
+ private int idSetAttribute;
+ private int idWMode;
+ private int idGetVariable;
+ private int idSetVariable;
+ public boolean isVisible = true;
+ private static final String
+ sidGetRootNode = "getRootNode", //$NON-NLS-1$
+ sidGetNumDebugChildren = "getNumSuccessorNodes", //$NON-NLS-1$
+ sidGetDebugChildren = "getSuccessorNodes", //$NON-NLS-1$
+ sidGetNumChildren = "getNumChildNodes", //$NON-NLS-1$
+ sidGetChildren = "getChildNodes", //$NON-NLS-1$
+ sidGetInnerNodes = "getInnerNodes", //$NON-NLS-1$
+ sidNewMarker = "newMarker", //$NON-NLS-1$
+ sidSetMarker = "setMarker", //$NON-NLS-1$
+ sidGetNodeFromPath = "getNodeFromPath",//$NON-NLS-1$
+ sidCallMethod = "callMethodA"; //$NON-NLS-1$
+
+ private ASBridge bridge;
+
+ public FlashPlayer(Variant flash) {
+ automation = flash.getAutomation();
+ idWMode = getIDsOfNames("wmode"); //$NON-NLS-1$
+ idGetVariable = getIDsOfNames("GetVariable"); //$NON-NLS-1$
+ idSetVariable = getIDsOfNames("SetVariable"); //$NON-NLS-1$
+ idGetAttribute = getIDsOfNames("getAttribute"); //$NON-NLS-1$
+ idSetAttribute = getIDsOfNames("setAttribute"); //$NON-NLS-1$
+ bridge = ASBridge.getInstance(this);
+ }
+
+ public static FlashPlayer getPlayerFromObject(AccessibleObject accObject) {
+ Variant varFlash = WebBrowserUtil.getHTMLElementFromObject(accObject);
+ if( null != varFlash ) {
+ return new FlashPlayer(varFlash);
+ }
+ return null;
+ }
+
+ public FlashNode getRootNode() {
+ if( null != bridge ) {
+ Object result = invoke(sidGetRootNode);
+ if( result instanceof ASObject ) {
+ return new FlashNode(null,this,result);
+ }
+ }
+ return null;
+ }
+
+ public FlashNode getNodeFromPath(String path) {
+ if( null != bridge ) {
+ Object result = invoke(sidGetNodeFromPath,path);
+ if( result instanceof ASObject ) {
+ return new FlashNode(null,this,result);
+ }
+ }
+ return null;
+ }
+
+ public boolean hasChild(FlashNode parentNode, boolean visual) {
+ if( visual ) {
+ return true;
+ }
+ if( null != bridge ) {
+ String sidMethod;
+ if( visual ) {
+ sidMethod = sidGetNumDebugChildren;
+ }
+ else {
+ sidMethod = FlashFinder.debugMode ? sidGetNumDebugChildren : sidGetNumChildren;
+ }
+ Object result = invoke(sidMethod,parentNode.getTarget());
+ if( result instanceof Integer ) {
+ return ((Integer)result).intValue() > 0;
+ }
+ }
+ return false;
+ }
+
+ public FlashNode[] getChildren(FlashNode parentNode,boolean visual) {
+ List<FlashNode> children = new ArrayList<FlashNode>();
+ if( null != bridge ) {
+ String sidMethod;
+ if( visual ) {
+ sidMethod = sidGetInnerNodes;
+ }
+ else {
+ sidMethod = FlashFinder.debugMode ? sidGetDebugChildren : sidGetChildren;
+ }
+ Object result = invoke(sidMethod,parentNode.getTarget());
+ if( result instanceof Object[] ) {
+ Object[] objChildren = (Object[])result;
+ for( int i=0; i<objChildren.length; i++ ) {
+ if( objChildren[i] instanceof ASObject ) {
+ children.add(new FlashNode(parentNode,this,objChildren[i]));
+ }
+ }
+ }
+ }
+ return children.toArray(new FlashNode[children.size()]);
+ }
+
+ public void setMarker(Object objX, Object objY, Object objW, Object objH) {
+ if( null != objX && null != objY && null != objW && null != objH ) {
+ if( null == varMarker ) {
+ varMarker = automation.invoke(idGetAttribute,new Variant[]{new Variant("marker")}); //$NON-NLS-1$
+ if( null == varMarker || OLE.VT_I4 != varMarker.getType() ) {
+ Object objMarker = invoke(sidNewMarker);
+ if( !(objMarker instanceof Integer) ) {
+ return;
+ }
+ varMarker = new Variant(((Integer)objMarker).intValue());
+ automation.invoke(idSetAttribute,new Variant[]{new Variant("marker"),varMarker}); //$NON-NLS-1$
+ }
+ }
+ if( null != bridge && null != varMarker ) {
+ bridge.invoke(new Object[]{sidSetMarker,new Integer(varMarker.getInt()),objX,objY,objW,objH});
+ }
+ }
+ }
+
+ public Variant callMethod(String target,String method,Variant arg1) {
+ if( null != bridge ) {
+ Object result = null;
+ switch( arg1.getType() ) {
+ case OLE.VT_I4:
+ result = callMethod(target, method, new Integer(arg1.getInt()));
+ break;
+ case OLE.VT_BSTR:
+ result = callMethod(target, method, arg1.getString());
+ break;
+ }
+ if( result instanceof Integer ) {
+ return new Variant(((Integer)result).intValue());
+ }
+ else if( result instanceof Double ) {
+ return new Variant(((Double)result).doubleValue());
+ }
+ else if( result instanceof String ) {
+ return new Variant(result.toString());
+ }
+ }
+ return null;
+ }
+
+ private Object callMethod(String target,String method,Object arg1) {
+ return bridge.invoke(new Object[] {sidCallMethod,target,method,arg1});
+ }
+
+ private Object invoke(String method) {
+ return bridge.invoke(new Object[]{method});
+ }
+
+ private Object invoke(String method, Object arg1) {
+ return bridge.invoke(new Object[] {method,arg1});
+ }
+
+ private int getIDsOfNames(String name) {
+ try {
+ int dispid[] = automation.getIDsOfNames(new String[]{name});
+ if( null != dispid ) {
+ return dispid[0];
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ return 0;
+ }
+
+ public String getErrorText() {
+ Variant varError = automation.invoke(idGetAttribute,new Variant[]{new Variant("aDesignerError")}); //$NON-NLS-1$
+ if( null != varError && OLE.VT_BSTR == varError.getType() ) {
+ String strError = varError.getString();
+ if ( strError.startsWith(FlashAdjust.ERROR_WAIT) ) {
+ return Messages.getString("flash.player_loading"); //$NON-NLS-1$
+ }
+ if ( strError.startsWith(FlashAdjust.ERROR_NG) ) {
+ return Messages.getString("flash.player_no_dom"); //$NON-NLS-1$
+ }
+ if ( strError.startsWith(FlashAdjust.ERROR_NA) ) {
+ return Messages.getString("flash.player_no_xcode"); //$NON-NLS-1$
+ }
+ }
+// return Messages.getString("flash.player_unknown"); //$NON-NLS-1$
+ return Messages.getString("flash.player_no_xcode"); //$NON-NLS-1$
+ }
+
+ public OleAutomation getAutomation() {
+ return automation;
+ }
+
+ public void dispose() {
+ if( null != varMarker ) {
+ varMarker.dispose();
+ varMarker = null;
+ }
+ if( null != automation ) {
+ automation.dispose();
+ automation = null;
+ }
+ }
+
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public String getWMode() {
+ if( 0 != idWMode ) {
+ Variant varWMode = automation.getProperty(idWMode);
+ if( null!=varWMode && OLE.VT_BSTR==varWMode.getType() ) {
+ return varWMode.getString();
+ }
+ }
+ return null;
+ }
+
+ public void setVariable(String name, String value) {
+ if( 0 != idSetVariable ) {
+ automation.invoke(idSetVariable, new Variant[]{new Variant(name),new Variant(value)});
+ }
+ }
+ public String getVariable(String name) {
+ if( 0 != idGetVariable ) {
+ Variant varValue = automation.invoke(idGetVariable, new Variant[]{new Variant(name)});
+ if( null != varValue ) {
+ return varValue.getString();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/FlashImages.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/FlashImages.java
new file mode 100644
index 0000000..5840bfa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/FlashImages.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.actf.visualization.gui.GuiImages;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.OverlayIcon;
+
+
+
+public final class FlashImages {
+
+ public static final String OVER_RED = "icons/ovr16/red.gif"; //$NON-NLS-1$
+ public static final String OVER_YELLOW = "icons/ovr16/yellow.gif"; //$NON-NLS-1$
+ public static final String OVER_GREEN = "icons/ovr16/green.gif"; //$NON-NLS-1$
+ public static final String OVER_BLACK = "icons/ovr16/black.gif"; //$NON-NLS-1$
+
+ public static final String FLASH_TYPE = "icons/flash16/type_{0}.gif"; //$NON-NLS-1$
+
+ public static final String TYPE_accprops = "accprops"; //$NON-NLS-1$
+ public static final String TYPE_button = "button"; //$NON-NLS-1$
+ public static final String TYPE_flash = "flash"; //$NON-NLS-1$
+ public static final String TYPE_function = "function"; //$NON-NLS-1$
+ public static final String TYPE_movieclip = "movieclip"; //$NON-NLS-1$
+ public static final String TYPE_object = "object"; //$NON-NLS-1$
+ public static final String TYPE_others = "others"; //$NON-NLS-1$
+ public static final String TYPE_string = "string"; //$NON-NLS-1$
+ public static final String TYPE_text = "text"; //$NON-NLS-1$
+ public static final String TYPE_variable = "variable"; //$NON-NLS-1$
+
+ public static final ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ public static Map<String, Image> imageMap = new HashMap<String, Image>();
+
+ public static Image getImage(String path) {
+ if( null == path ) {
+ return null;
+ }
+ Image image = (Image)imageMap.get(path);
+ if( null == image) {
+ ImageDescriptor descriptor = getImageDescriptor(path);
+ if( null != descriptor ) {
+ image = descriptor.createImage(true);
+ imageMap.put(path,image);
+ }
+ }
+ return image;
+ }
+
+ public static Image getImage(String basePath, String overlayPath, Point size) {
+ if( null == basePath || null == overlayPath ) {
+ return null;
+ }
+ String totalPath = basePath+"|"+overlayPath; //$NON-NLS-1$
+ Image image = (Image)imageMap.get(totalPath);
+ if( null == image) {
+ ImageDescriptor descriptor = getImageDescriptor(basePath);
+ if( null != descriptor ) {
+ ImageDescriptor overlayDescriptor = getImageDescriptor(overlayPath);
+ if( null != overlayDescriptor ) {
+ descriptor = new OverlayIcon(descriptor, overlayDescriptor, size);
+ image = descriptor.createImage(true);
+ }
+ }
+ imageMap.put(totalPath,image);
+ }
+ return image;
+ }
+
+ public static ImageDescriptor getImageDescriptor(String path) {
+ ImageDescriptor descriptor = FlashPlugin.getImageDescriptor(path);
+ if( null != descriptor ) {
+ return descriptor;
+ }
+ return GuiImages.getImageDescriptor(path);
+ }
+
+ public static String flashIcon(String typeString) {
+ return getFilename(FLASH_TYPE, typeString);
+ }
+
+ public static String getFilename(String format, String name) {
+ String path = MessageFormat.format(format, new Object[]{name.toLowerCase()});
+ if( null != getImageDescriptor(path) ) {
+ return path;
+ }
+ DebugPrintUtil.devOrDebugPrintln("Missing Flash icon "+path); //$NON-NLS-1$
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/FlashPlugin.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/FlashPlugin.java
new file mode 100644
index 0000000..87465f8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/FlashPlugin.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class FlashPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static FlashPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public FlashPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static FlashPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.actf.visualization.flash", path); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/Messages.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/Messages.java
new file mode 100644
index 0000000..456c228
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/Messages.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.flash;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+public class Messages {
+ private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ if( key.startsWith("msaa.") ) {//$NON-NLS-1$
+ return org.eclipse.actf.visualization.gui.Messages.getString(key);
+ }
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FindFlashAction.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FindFlashAction.java
new file mode 100644
index 0000000..1736c37
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FindFlashAction.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.flash.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.actions.ActionDelegate;
+
+
+
+public class FindFlashAction extends ActionDelegate implements IObjectActionDelegate {
+
+ private IWorkbenchPart targetPart;
+
+ private ISelection selection;
+
+ // IObjectActionDelegate
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.targetPart = targetPart;
+ }
+
+ // ActionDelegate
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+
+ public void run(IAction action) {
+ if (selection instanceof IStructuredSelection) {
+ Object selectedObject = ((IStructuredSelection) selection).getFirstElement();
+ if (null != selectedObject) {
+ new FlashRectFinder(selectedObject).find(targetPart.getSite().getShell());
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FlashFinderAdapterFactory.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FlashFinderAdapterFactory.java
new file mode 100644
index 0000000..3213f28
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FlashFinderAdapterFactory.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash.ui.actions;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.IActionFilter;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+public class FlashFinderAdapterFactory implements IAdapterFactory, IActionFilter {
+
+ public Class[] getAdapterList() {
+ return new Class[] { IActionFilter.class };
+ }
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof AccessibleObject && IActionFilter.class == adapterType) {
+ return this;
+ }
+ return null;
+ }
+
+ public boolean testAttribute(Object target, String name, String value) {
+ if (target instanceof AccessibleObject && "findFlash".equals(name)) { //$NON-NLS-1$
+ return new FlashRectFinder(target).IsValid();
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FlashRectFinder.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FlashRectFinder.java
new file mode 100644
index 0000000..ae413d8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/actions/FlashRectFinder.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash.ui.actions;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.Variant;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.visualization.flash.Messages;
+import org.eclipse.actf.visualization.gui.common.WebBrowserUtil;
+import org.eclipse.actf.visualization.gui.flash.FlashUtil;
+import org.eclipse.actf.visualization.gui.ui.views.IFlashDOMView;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+
+public class FlashRectFinder {
+ private boolean viewVisible = false;
+ private AccessibleObject playerWindow = null;
+ private Rectangle msaaRect = null;
+ private AccessibleObject targetObject = null;
+
+ public FlashRectFinder(Object object) {
+ if (object instanceof AccessibleObject ) {
+ if( null != MSAAViewRegistory.findViewReference(MSAAViewRegistory.FlashDOMView_ID) ) {
+ viewVisible = null != MSAAViewRegistory.showView(MSAAViewRegistory.FlashDOMView_ID,false);
+ if( viewVisible ) {
+ for (AccessibleObject accObject = (AccessibleObject) object; null != accObject; accObject = accObject.getCachedParent()) {
+ if (FlashUtil.isFlash(accObject)) {
+ playerWindow = accObject;
+ }
+ if (null == msaaRect) {
+ msaaRect = accObject.getAccLocation();
+ targetObject = accObject;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void find(Shell shell) {
+ if (viewVisible) {
+ if (null == msaaRect) {
+ MessageDialog.openInformation(shell, Messages.getString("flash.flash_dom"), //$NON-NLS-1$
+ Messages.getString("flash.error_no_location")); //$NON-NLS-1$
+ }
+ else if (null == playerWindow) {
+ MessageDialog.openInformation(shell, Messages.getString("flash.flash_dom"), //$NON-NLS-1$
+ Messages.getString("flash.error_select_flash")); //$NON-NLS-1$
+ }
+ else {
+ reCalculateRect();
+ IFlashDOMView flashDOMView = (IFlashDOMView) MSAAViewRegistory.showView(MSAAViewRegistory.FlashDOMView_ID, true);
+ if( null != flashDOMView ) {
+ Rectangle playerRect = playerWindow.getAccLocation();
+ msaaRect.x -= playerRect.x;
+ msaaRect.y -= playerRect.y;
+ flashDOMView.findRectangle(msaaRect, playerWindow);
+ }
+ }
+ }
+ }
+
+ private void reCalculateRect() {
+ Variant varFlash = WebBrowserUtil.getHTMLElementFromObject(playerWindow);
+ if( null != varFlash ) {
+ OleAutomation automation = varFlash.getAutomation();
+ if( null != automation ) {
+ int idAlignMode[] = automation.getIDsOfNames(new String[]{"AlignMode"}); //$NON-NLS-1$
+ if( null != idAlignMode ) {
+ AccessibleObject[] siblings = targetObject.getCachedParent().getChildren();
+ Rectangle[] siblingRects = new Rectangle[siblings.length];
+ for( int i=0; i<siblings.length; i++ ) {
+ if( null != siblings[i] ) {
+ siblingRects[i] = siblings[i].getAccLocation();
+ }
+ }
+ Variant varAlignMode = automation.getProperty(idAlignMode[0]);
+ automation.setProperty(idAlignMode[0], new Variant(1+4));
+ wait(500,1000);
+ Rectangle rect = targetObject.getAccLocation();
+ if( rect.equals(msaaRect) ) {
+ for( int i=0; i<siblings.length; i++ ) {
+ if( null != siblingRects[i] ) {
+ rect = siblings[i].getAccLocation();
+ if( !rect.equals(siblingRects[i]) ) {
+ msaaRect.x += rect.x-siblingRects[i].x;
+ msaaRect.y += rect.y-siblingRects[i].y;
+ break;
+ }
+ }
+ }
+ }
+ else {
+ msaaRect = rect;
+ }
+ automation.setProperty(idAlignMode[0], varAlignMode);
+ wait(500,1000);
+ }
+ }
+ varFlash.dispose();
+ }
+ }
+ private static void wait(int min, int max) {
+ int count = 0;
+ int sleep = 1;
+ Display display = Display.getCurrent();
+ while( count++ < max ) {
+ if( !display.readAndDispatch() ) {
+ if( count >= min ) break;
+ if( sleep-- > 0 ) {
+ display.sleep();
+ }
+ }
+ }
+ if( count > min ) {
+ System.out.println("wait count="+count); //$NON-NLS-1$
+ }
+ }
+
+ public boolean IsValid() {
+ return viewVisible && null!=playerWindow && null != msaaRect;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashNodePropertySource.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashNodePropertySource.java
new file mode 100644
index 0000000..9256a4e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashNodePropertySource.java
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash.ui.properties;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.model.flash.FlashNode;
+import org.eclipse.actf.util.as.ASObject;
+import org.eclipse.actf.visualization.gui.flash.FlashFinder;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.Variant;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class FlashNodePropertySource implements IPropertySource {
+
+ private FlashNode flashNode;
+ private boolean isAccImpl;
+
+ public static final String
+ PID_OBJECTNAME = "OBJECTNAME", //$NON-NLS-1$
+ PID_TYPE = "TYPE", //$NON-NLS-1$
+ PID_VALUE = "VALUE", //$NON-NLS-1$
+ PID_TARGET = "TARGET", //$NON-NLS-1$
+ PID_DEPTH = "depth", //$NON-NLS-1$
+ PID_CURRENTFRAME = "currentFrame", //$NON-NLS-1$
+ PID_CLASSNAME = "CLASSNAME", //$NON-NLS-1$
+ PID_TEXT = "TEXT", //$NON-NLS-1$
+ PID_TITLE = "TITLE", //$NON-NLS-1$
+ PID_UICOMPONENT = "isUIComponent", //$NON-NLS-1$
+ PID_OPAQUE_OBJECT = "isOpaqueObject", //$NON-NLS-1$
+ PID_INPUTABLE = "isInputable", //$NON-NLS-1$
+ PID_LOCATION = "LOCATION", //$NON-NLS-1$
+ PID_ACC_ROLE = "ACC_ROLE", //$NON-NLS-1$
+ PID_ACC_NAME = "ACC_NAME", //$NON-NLS-1$
+ PID_ACC_STATE = "ACC_STATE", //$NON-NLS-1$
+ PID_ACC_ACTION = "ACC_ACTION", //$NON-NLS-1$
+ PID_ACC_INFO = "ACC_INFO", //$NON-NLS-1$
+ PID_TABINDEX = "tabIndex", //$NON-NLS-1$
+ PID_WMODE = "WMODE"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] DESCRIPTORS = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_OBJECTNAME,"objectName"), // 0 //$NON-NLS-1$
+ new PropertyDescriptor(PID_TYPE,"type"), // 1 //$NON-NLS-1$
+ new PropertyDescriptor(PID_VALUE,"value"), // 2 //$NON-NLS-1$
+ new PropertyDescriptor(PID_TARGET,"target"), // 3 //$NON-NLS-1$
+ new PropertyDescriptor(PID_DEPTH,PID_DEPTH),
+ new PropertyDescriptor(PID_CURRENTFRAME,PID_CURRENTFRAME),
+ new PropertyDescriptor(PID_CLASSNAME,"className"), // 6 //$NON-NLS-1$
+ new PropertyDescriptor(PID_TEXT,"text"), // 7 //$NON-NLS-1$
+ new PropertyDescriptor(PID_TITLE,"title"), // 8 //$NON-NLS-1$
+ new PropertyDescriptor(PID_LOCATION,"Location"), // 10 //$NON-NLS-1$
+ new PropertyDescriptor(PID_TABINDEX,PID_TABINDEX),
+ new PropertyDescriptor(PID_ACC_INFO,"accInfo"), // 11 //$NON-NLS-1$
+ new PropertyDescriptor(PID_ACC_ROLE,"accRole"), // 11 //$NON-NLS-1$
+ new PropertyDescriptor(PID_ACC_NAME,"accName"), // 12 //$NON-NLS-1$
+ new PropertyDescriptor(PID_ACC_STATE,"accState"), // 13 //$NON-NLS-1$
+ new PropertyDescriptor(PID_ACC_ACTION,"accDefaultAction"), // 14 //$NON-NLS-1$
+ new PropertyDescriptor(PID_UICOMPONENT,PID_UICOMPONENT),
+ new PropertyDescriptor(PID_OPAQUE_OBJECT,PID_OPAQUE_OBJECT),
+ new PropertyDescriptor(PID_INPUTABLE,PID_INPUTABLE),
+ new PropertyDescriptor(PID_WMODE,"wmode") // 15 //$NON-NLS-1$
+ };
+
+ public FlashNodePropertySource(FlashNode flashNode) {
+ this.flashNode = flashNode;
+ this.isAccImpl = "_accImpl".equals(flashNode.getObjectName()); //$NON-NLS-1$
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();
+ for( int i=0; i<DESCRIPTORS.length; i++ ) {
+ if( null != getPropertyValue(DESCRIPTORS[i].getId()) ) {
+ result.add(DESCRIPTORS[i]);
+ }
+ }
+ if( FlashFinder.debugMode ) {
+ Set keySet = flashNode.getKeys();
+ if( null != keySet ) {
+ for( Iterator it = keySet.iterator(); it.hasNext(); ) {
+ Object key = it.next();
+ result.add(new PropertyDescriptor(key,"["+key.toString()+"]")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ return result.toArray(new IPropertyDescriptor[result.size()]);
+ }
+
+ public Object getPropertyValue(Object id) {
+ String strValue = null;
+ if( PID_OBJECTNAME.equals(id) ) {
+ strValue = flashNode.getObjectName();
+ }
+ else if( PID_TYPE.equals(id) ) {
+ strValue = flashNode.getType();
+ }
+ else if( PID_VALUE.equals(id) ) {
+ strValue = flashNode.getValue();
+ }
+ else if( PID_TARGET.equals(id) ) {
+ strValue = flashNode.getTarget();
+// strValue += ", mName="+flashNode.getString("mName") + ", mTarget="+flashNode.getString("mTarget") + ", parentTarget="+flashNode.getString("parentTarget") + ", targetIsString="+flashNode.getString("targetIsString") + ", targetModified="+flashNode.getString("targetModified");
+ }
+ else if( PID_CLASSNAME.equals(id) ) {
+ strValue = flashNode.getClassName();
+ }
+ else if( PID_TEXT.equals(id) ) {
+ strValue = flashNode.getText(false);
+ }
+ else if( PID_TITLE.equals(id) ) {
+ strValue = flashNode.getTitle();
+ }
+// else if( PID_DEPTH.equals(id) ) {
+// strValue = flashNode.getString("depth"); //$NON-NLS-1$
+// }
+// else if( PID_CURRENTFRAME.equals(id) ) {
+// strValue = flashNode.getString("currentFrame"); //$NON-NLS-1$
+// }
+// else if( PID_UICOMPONENT.equals(id) ) {
+// strValue = flashNode.getString("isUIComponent"); //$NON-NLS-1$
+// }
+ else if( PID_LOCATION.equals(id) ) {
+ try {
+ int x = Float.valueOf(flashNode.getString("x")).intValue(); //$NON-NLS-1$
+ int y = Float.valueOf(flashNode.getString("y")).intValue(); //$NON-NLS-1$
+ int w = Float.valueOf(flashNode.getString("w")).intValue(); //$NON-NLS-1$
+ int h = Float.valueOf(flashNode.getString("h")).intValue(); //$NON-NLS-1$
+ strValue = x + ", " + y + ", " + (x + w) + ", " + (y + h) + " (width="+w+", height="+h+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ }
+ catch(Exception e) {
+ }
+ }
+ else if( PID_WMODE.equals(id) ) {
+ if( null == flashNode.getParent() ) {
+ strValue = flashNode.getPlayer().getWMode();
+ }
+ }
+ else if( PID_ACC_INFO.equals(id) ) {
+ Object accInfo = flashNode.getObject("accInfo"); //$NON-NLS-1$
+ if( accInfo instanceof ASObject ) {
+ ASObject accInfoObject = ((ASObject)accInfo);
+ Set accInfoSet = accInfoObject.getKeys();
+ if( null != accInfoSet ) {
+ AttributePropertySource attrSource = new AttributePropertySource(null,accInfoObject.toString());
+ for( Iterator it = accInfoSet.iterator(); it.hasNext(); ) {
+ Object key = it.next();
+ String keyName = key.toString();
+ Object keyValue = accInfoObject.get(keyName);
+ if( keyValue instanceof Integer ) {
+ int intValue = ((Integer)keyValue).intValue();
+ if( "role".equals(keyName) ) { //$NON-NLS-1$
+ keyValue = MSAA.getRoleText(intValue);
+ }
+ else if( "state".equals(keyName) ) { //$NON-NLS-1$
+ keyValue = MSAA.getStateText(intValue);
+ }
+ }
+ attrSource.put(keyName, keyValue);
+ }
+ return attrSource;
+ }
+ }
+ }
+ else if( isAccImpl ) {
+ String methodName = null;
+ if( PID_ACC_ROLE.equals(id) ) {
+ methodName = "get_accRole"; //$NON-NLS-1$
+ }
+ else if( PID_ACC_NAME.equals(id) ) {
+ methodName = "get_accName"; //$NON-NLS-1$
+ }
+ else if( PID_ACC_STATE.equals(id) ) {
+ methodName = "get_accState"; //$NON-NLS-1$
+ }
+ else if( PID_ACC_ACTION.equals(id) ) {
+ methodName = "get_accDefaultAction"; //$NON-NLS-1$
+ }
+ if( null != methodName ) {
+ Variant value = flashNode.getPlayer().callMethod(flashNode.getTarget(),methodName,new Variant(0)); //$NON-NLS-1$
+ if( null != value ) {
+ switch( value.getType() ) {
+ case OLE.VT_BSTR:
+ strValue = value.getString();
+ break;
+ case OLE.VT_I4:
+ int intValue = value.getInt();
+ if( PID_ACC_ROLE.equals(id) ) {
+ strValue = MSAA.getRoleText(intValue);
+ }
+ else if( PID_ACC_STATE.equals(id) ) {
+ strValue = MSAA.getStateText(intValue);
+ }
+ break;
+ }
+ }
+ }
+ }
+ if( null==strValue ) {
+ strValue = flashNode.getString(id.toString());
+ }
+ return strValue;
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashPlayerPropertySource.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashPlayerPropertySource.java
new file mode 100644
index 0000000..b869a12
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashPlayerPropertySource.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash.ui.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.model.flash.FlashPlayer;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.Variant;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class FlashPlayerPropertySource implements IPropertySource {
+
+ private OleAutomation automation;
+
+ public static final String
+ PID_VERSION = "VERSION", //$NON-NLS-1$
+ PID_AVAILABLE = "AVAILABLE", //$NON-NLS-1$
+ PID_DEBUG = "DEBUG", //$NON-NLS-1$
+ PID_ID = "ID", //$NON-NLS-1$
+ PID_ALLOW_ACCESS = "ALLOW_ACCESS", //$NON-NLS-1$
+ PID_TAGNAME = "TAGNAME", //$NON-NLS-1$
+ PID_CLASSID = "CLASSID", //$NON-NLS-1$
+ PID_CODEBASE = "CODEBASE", //$NON-NLS-1$
+ PID_TYPE = "TYPE", //$NON-NLS-1$
+ PID_MOVIE = "MOVIE", //$NON-NLS-1$
+ PID_READY_STATE = "READY_STATE", //$NON-NLS-1$
+ PID_WMODE = "WMODE"; //$NON-NLS-1$
+
+ public static final String
+ STR_VERSION = "$version", // 0 //$NON-NLS-1$
+ STR_AVAILABLE = "Eclipse_ACTF_is_available", // 1 //$NON-NLS-1$
+ STR_DEBUG = "aDesignerError", // 2 //$NON-NLS-1$
+ STR_ID = "id", // 3 //$NON-NLS-1$
+ STR_ALLOW_ACCESS = "AllowScriptAccess", // 4 //$NON-NLS-1$
+ STR_TAGNAME = "tagName", // 5 //$NON-NLS-1$
+ STR_CLASSID = "classid", // 6 //$NON-NLS-1$
+ STR_CODEBASE = "codeBase", // 7 //$NON-NLS-1$
+ STR_TYPE = "type", // 8 //$NON-NLS-1$
+ STR_MOVIE = "movie", // 9 //$NON-NLS-1$
+ STR_READY_STATE = "ReadyState", // 10 //$NON-NLS-1$
+ STR_WMODE = "wmode"; // 11 //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] DESCRIPTORS = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_VERSION,STR_VERSION),
+ new PropertyDescriptor(PID_AVAILABLE,STR_AVAILABLE),
+ new PropertyDescriptor(PID_DEBUG,STR_DEBUG),
+ new PropertyDescriptor(PID_ID,STR_ID),
+ new PropertyDescriptor(PID_ALLOW_ACCESS,STR_ALLOW_ACCESS),
+ new PropertyDescriptor(PID_TAGNAME,STR_TAGNAME),
+ new PropertyDescriptor(PID_CLASSID,STR_CLASSID),
+ new PropertyDescriptor(PID_CODEBASE,STR_CODEBASE),
+ new PropertyDescriptor(PID_TYPE,STR_TYPE),
+ new PropertyDescriptor(PID_MOVIE,STR_MOVIE),
+ new PropertyDescriptor(PID_READY_STATE,STR_READY_STATE),
+ new PropertyDescriptor(PID_WMODE,STR_WMODE)
+ };
+
+ public FlashPlayerPropertySource(FlashPlayer flashPlayer) {
+ this.automation = flashPlayer.getAutomation();
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();
+ for( int i=0; i<DESCRIPTORS.length; i++ ) {
+ if( null != getPropertyValue(DESCRIPTORS[i].getId()) ) {
+ result.add(DESCRIPTORS[i]);
+ }
+ }
+ return result.toArray(new IPropertyDescriptor[result.size()]);
+ }
+
+ public Object getPropertyValue(Object id) {
+ String strValue = null;
+ String variableName = null;
+ String propertyName = null;
+ if( PID_VERSION.equals(id) ) {
+ variableName = "$version"; //$NON-NLS-1$
+ }
+ else if( PID_AVAILABLE.equals(id) ) {
+ variableName = STR_AVAILABLE;
+ }
+ else if( PID_DEBUG.equals(id) ) {
+ propertyName = STR_DEBUG;
+ }
+ else if( PID_ID.equals(id) ) {
+ propertyName = STR_ID;
+ }
+ else if( PID_ALLOW_ACCESS.equals(id) ) {
+ propertyName = STR_ALLOW_ACCESS;
+ }
+ else if( PID_TAGNAME.equals(id) ) {
+ propertyName = STR_TAGNAME;
+ }
+ else if( PID_CLASSID.equals(id) ) {
+ propertyName = STR_CLASSID;
+ }
+ else if( PID_CODEBASE.equals(id) ) {
+ propertyName = STR_CODEBASE;
+ }
+ else if( PID_TYPE.equals(id) ) {
+ propertyName = STR_TYPE;
+ }
+ else if( PID_MOVIE.equals(id) ) {
+ propertyName = STR_MOVIE;
+ }
+ else if( PID_READY_STATE.equals(id) ) {
+ propertyName = STR_READY_STATE;
+ }
+ else if( PID_WMODE.equals(id) ) {
+ propertyName = STR_WMODE;
+ }
+ if( null != variableName ) {
+ int[] idGetVariable = automation.getIDsOfNames(new String[]{"GetVariable"}); //$NON-NLS-1$
+ if( null!=idGetVariable ) {
+ Variant varImposed = automation.invoke(idGetVariable[0],new Variant[]{new Variant(variableName)}); //$NON-NLS-1$
+ strValue = getVariantString(varImposed);
+ }
+ }
+ else if( null != propertyName ) {
+ int[] idProperty = automation.getIDsOfNames(new String[]{propertyName});
+ if( null != idProperty ) {
+ Variant varValue = automation.getProperty(idProperty[0]);
+ strValue = getVariantString(varValue);
+ }
+ }
+ return strValue;//null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+ private static String getVariantString(Variant var) {
+ if( null != var ) {
+ switch( var.getType() ) {
+ case OLE.VT_BSTR:
+ return var.getString();
+ case OLE.VT_EMPTY:
+ break;
+ case OLE.VT_I4:
+ return Integer.toString(var.getInt());
+ default:
+ return var.toString();
+ }
+ }
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashPropertySourceAdapterFactory.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashPropertySourceAdapterFactory.java
new file mode 100644
index 0000000..8fea9aa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/properties/FlashPropertySourceAdapterFactory.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash.ui.properties;
+
+import org.eclipse.actf.model.flash.FlashNode;
+import org.eclipse.actf.model.flash.FlashPlayer;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+
+
+public class FlashPropertySourceAdapterFactory implements IAdapterFactory {
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if( IPropertySource.class == adapterType ) {
+ if( adaptableObject instanceof FlashPlayer ) {
+ return new FlashPlayerPropertySource((FlashPlayer)adaptableObject);
+ }
+ if( adaptableObject instanceof FlashNode ) {
+ return new FlashNodePropertySource((FlashNode)adaptableObject);
+ }
+ }
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ return new Class[] {IPropertySource.class };
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/views/FlashDOMView.java b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/views/FlashDOMView.java
new file mode 100644
index 0000000..8d554e6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.flash/src/org/eclipse/actf/visualization/flash/ui/views/FlashDOMView.java
@@ -0,0 +1,630 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.flash.ui.views;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.part.ViewPart;
+
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.model.flash.FlashAdjust;
+import org.eclipse.actf.model.flash.FlashDetect;
+import org.eclipse.actf.model.flash.FlashNode;
+import org.eclipse.actf.model.flash.FlashPlayer;
+import org.eclipse.actf.visualization.flash.FlashImages;
+import org.eclipse.actf.visualization.flash.Messages;
+import org.eclipse.actf.visualization.gui.GuiImages;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.flash.FlashFinder;
+import org.eclipse.actf.visualization.gui.flash.FlashUtil;
+import org.eclipse.actf.visualization.gui.ui.actions.RefreshRootAction;
+import org.eclipse.actf.visualization.gui.ui.views.IFlashDOMView;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+
+
+public class FlashDOMView extends ViewPart implements IFlashDOMView {
+ public static final String ID = FlashDOMView.class.getName();
+
+ private TreeViewer viewer;
+ private Action expandAction;
+ private Action expandAllAction;
+ private Action collapseAllAction;
+ private RefreshRootAction refreshAction;
+ private Action informativeTreeAction;
+ private Action visualTreeAction;
+ private Action debugTreeAction;
+ private Action scanWindowlessAction;
+ private Color colorFound = Display.getCurrent().getSystemColor(SWT.COLOR_CYAN);
+
+ /**
+ * The constructor.
+ */
+ public FlashDOMView() {
+ }
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ viewer = new FlashTreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setContentProvider(new FlashDOMContentProvider());
+ viewer.setLabelProvider(new FlashDOMLabelProvider());
+ viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object selectedItem = ((IStructuredSelection) selection).getFirstElement();
+ if( selectedItem instanceof FlashNode ) {
+ ((FlashNode)selectedItem).setMarker();
+ }
+ else if( !(selectedItem instanceof FlashPlayer) ) {
+ return;
+ }
+ MSAAViewRegistory.showProperties(selectedItem);
+ }
+ }
+ });
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ MSAAViewRegistory.findView(MSAAViewRegistory.MSAAOutlineView_ID);
+ refresh();
+ }
+
+ public void adjustID() {
+ Object[] results = FlashUtil.getFlashElements(MSAAViewRegistory.rootObject);
+ for( int i=0; i<results.length; i++ ) {
+ FlashAdjust flashAdjust = new FlashAdjust(results[i]);
+ flashAdjust.adjust("adesigner_flash_object"+i); //$NON-NLS-1$
+ flashAdjust.dispose();
+ }
+ }
+
+ public void refresh() {
+ AccessibleObject rootObject = MSAAViewRegistory.getRootObject();
+ if( null != rootObject ) {
+ adjustID();
+ viewer.setInput(FlashUtil.getFlashElements(rootObject));
+ FlashDetect.showDialog();
+ }
+ }
+
+ public void findRectangle(Rectangle flashRect, Object objUnknown) {
+ viewer.setInput(new Object[]{objUnknown});
+ String strMessage = Messages.getString("flash.error_no_element"); //$NON-NLS-1$
+ RectangleFinder finder = new RectangleFinder(flashRect);
+ try {
+ finder.find(viewer.getTree().getItems());
+ }
+ catch( Error e ) {
+ e.printStackTrace();
+ }
+ if( finder.foundCount > 0 ) {
+ strMessage = MessageFormat.format(Messages.getString("flash.element_found"), new Object[]{new Integer(finder.foundCount)}); //$NON-NLS-1$
+ }
+ MessageDialog.openInformation(
+ viewer.getControl().getShell(),
+ Messages.getString("flash.flash_dom"), //$NON-NLS-1$
+ strMessage);
+ }
+
+ public void addWindowlessElement(final Object objUnknown) {
+ if( !scanWindowlessAction.isChecked() ) {
+ Display.getCurrent().asyncExec(new Runnable(){
+ public void run() {
+ Object currentInput = viewer.getInput();
+ if( currentInput instanceof Object[] ) {
+ List list = Arrays.asList((Object[])currentInput);
+ if( !list.contains(objUnknown) ) {
+ ArrayList newList = new ArrayList(list);
+ newList.add(objUnknown);
+ viewer.setInput(newList.toArray());
+ }
+ }
+ }
+ });
+ }
+ }
+
+ private class RectangleFinder {
+ private static final int MARGIN = 10;
+ public int foundCount = 0;
+ private int errorCount = 0;
+ private int flashLeft, flashTop, flashRight, flashBottom;
+ public RectangleFinder(Rectangle flashRect) {
+ flashLeft = flashRect.x;
+ flashTop = flashRect.y;
+ flashRight = flashRect.x+flashRect.width;
+ flashBottom = flashRect.y+flashRect.height;
+ }
+
+ public void find(TreeItem[] items) {
+ for( int i=0; i<items.length; i++ ) {
+ TreeItem item = items[i];
+ try {
+ FlashNode flashNode = (FlashNode)item.getData();
+ if( flashNode.getLevel()>=40 ) {
+ throw new Error(MessageFormat.format(Messages.getString("flash.error_target_length"),new Object[]{new Integer(flashNode.getLevel())})+"\n"+flashNode.getTarget()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String strX = flashNode.getString("x"); //$NON-NLS-1$
+ if( null == strX ) continue;
+ int x = Float.valueOf(strX).intValue(); //$NON-NLS-1$
+ if( x>=flashRight+MARGIN ) {
+ continue;
+ }
+ int y = Float.valueOf(flashNode.getString("y")).intValue(); //$NON-NLS-1$
+ if( y>=flashBottom+MARGIN ) {
+ continue;
+ }
+ int w = Float.valueOf(flashNode.getString("w")).intValue(); //$NON-NLS-1$
+ if( x+w<=flashLeft-MARGIN ) {
+ continue;
+ }
+ int h = Float.valueOf(flashNode.getString("h")).intValue(); //$NON-NLS-1$
+ if( y+h<=flashTop-MARGIN ) {
+ continue;
+ }
+ if( isMatch(x,y,w,h) ) {
+ item.setBackground(colorFound);
+ foundCount++;
+ viewer.reveal(flashNode);
+ }
+ if( Boolean.TRUE.equals(flashNode.getObject("isOpaqueObject")) ) { //$NON-NLS-1$
+// System.out.println("Skip Opaque Object "+flashNode.getTarget()); //$NON-NLS-1$
+ continue;
+ }
+ find(((FlashTreeViewer)viewer).getChildItems(item));
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ catch( FindError e ) {
+ throw e;
+ }
+ catch( Error e) {
+ System.err.println(e.getMessage());
+ if( ++errorCount >= 20 ) {
+ throw new FindError("Error count reached "+errorCount); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ private class FindError extends Error {
+ private static final long serialVersionUID = -7707451728015676479L;
+
+ public FindError(String message) {
+ super(message);
+ }
+ };
+
+ private boolean isMatch(int x, int y, int w, int h) {
+ return flashLeft-MARGIN<=x && x<flashLeft+MARGIN &&
+ flashTop-MARGIN<=y && y<flashTop+MARGIN &&
+ flashRight-MARGIN<=x+w && x+w<=flashRight+MARGIN &&
+ flashBottom-MARGIN<=y+h && y+h<=flashBottom+MARGIN;
+ }
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ FlashDOMView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(informativeTreeAction);
+ manager.add(visualTreeAction);
+ manager.add(scanWindowlessAction);
+ manager.add(debugTreeAction);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ Object selected = getSelectedItem();
+ if (null != selected) {
+ manager.add(expandAction);
+ }
+ manager.add(new Separator());
+ manager.add(refreshAction);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(expandAllAction);
+ manager.add(collapseAllAction);
+ manager.add(refreshAction);
+ }
+
+ private void makeActions() {
+ expandAction = new Action(Messages.getString("msaa.expand")) { //$NON-NLS-1$
+ public void run() {
+ try {
+ Object selected = getSelectedItem();
+ if (null != selected) {
+ viewer.expandToLevel(selected, AbstractTreeViewer.ALL_LEVELS);
+ }
+ }
+ catch (Error e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ expandAllAction = new Action(Messages.getString("msaa.expand_all")) { //$NON-NLS-1$
+ public void run() {
+ try {
+ viewer.expandAll();
+ }
+ catch (Error e) {
+ System.err.println(e.getMessage());
+ }
+ }
+ };
+ expandAllAction.setToolTipText(Messages.getString("msaa.expand_all")); //$NON-NLS-1$
+ expandAllAction.setImageDescriptor(GuiPlugin.IMAGE_EXPAND_ALL);
+
+ collapseAllAction = new Action(Messages.getString("msaa.collapse_all")) { //$NON-NLS-1$
+ public void run() {
+ try {
+ viewer.collapseAll();
+ }
+ catch (Error e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ collapseAllAction.setToolTipText(Messages.getString("msaa.collapse_all")); //$NON-NLS-1$
+ collapseAllAction.setImageDescriptor(GuiPlugin.IMAGE_COLLAPSE_ALL);
+
+ refreshAction = new RefreshRootAction();
+
+ informativeTreeAction = new Action(Messages.getString("flash.filter_noninformative"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ FlashDOMContentProvider provider = (FlashDOMContentProvider)viewer.getContentProvider();
+ provider.informativeTree = informativeTreeAction.isChecked();
+ MSAAViewRegistory.refreshRootObject();
+ }
+ };
+
+ visualTreeAction = new Action(Messages.getString("flash.show_visual"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ FlashDOMContentProvider provider = (FlashDOMContentProvider)viewer.getContentProvider();
+ provider.visualTree = visualTreeAction.isChecked();
+ MSAAViewRegistory.refreshRootObject();
+ }
+ };
+
+ debugTreeAction = new Action(Messages.getString("flash.debugMode"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ FlashFinder.debugMode = debugTreeAction.isChecked();
+ MSAAViewRegistory.refreshRootObject();
+ }
+ };
+
+ scanWindowlessAction = new Action(Messages.getString("flash.scanWindowless"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ FlashFinder.scanAll = scanWindowlessAction.isChecked();
+ MSAAViewRegistory.refreshRootObject();
+ }
+ };
+
+ }
+
+ private Object getSelectedItem() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ if (selection.size() == 1) {
+ return selection.getFirstElement();
+ }
+ return null;
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+
+ private class FlashDOMContentProvider implements ITreeContentProvider {
+
+ public boolean visualTree = false;
+ public boolean informativeTree = false;
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof FlashNode ) {
+ return ((FlashNode)parentElement).getChildren(visualTree,informativeTree/*,debugMode*/);
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ if( element instanceof FlashNode ) {
+ return ((FlashNode)element).getParent();
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if( element instanceof FlashNode ) {
+ return ((FlashNode)element).hasChild(visualTree);
+ }
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ List elements = new ArrayList();
+ if( inputElement instanceof Object[] ){
+ Object[] objects = (Object[])inputElement;
+ for( int i=0; i<objects.length; i++ ) {
+ if( objects[i] instanceof AccessibleObject ) {
+ AccessibleObject accObject= (AccessibleObject)objects[i];
+ FlashPlayer player = FlashPlayer.getPlayerFromObject(accObject);
+ if( null != player ) {
+ FlashNode rootNode = player.getRootNode();
+ if( null != rootNode ) {
+ if( FlashUtil.isInvisibleFlash(accObject) ) {
+ player.isVisible = false;
+ }
+ elements.add(rootNode);
+ }
+ else {
+ elements.add(player);
+ }
+ }
+ }
+ }
+ }
+ return elements.toArray();
+ }
+
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+ private static String getNodeImage(Object element) {
+ String iconType = null;
+ if( element instanceof FlashNode ) {
+ FlashNode flashNode = ((FlashNode)element);
+ String type = flashNode.getType();
+ if( "movieclip".equals(type) ) { //$NON-NLS-1$
+ iconType = type;
+ int accRole = flashNode.getAccInfo().getAccRole();
+ if( -1 != accRole ) {
+ return GuiImages.roleIcon(accRole);
+ }
+ else if( flashNode.getAccInfo().hasOnRelease() ) {
+ iconType = FlashImages.TYPE_button;
+ }
+ }
+ else if( "object".equals(type) ) { //$NON-NLS-1$
+ iconType = type;
+ String className = flashNode.getClassName();
+ if( "Button".equals(className) ) { //$NON-NLS-1$
+ iconType = FlashImages.TYPE_button;
+ }
+ else if( className.startsWith("TextField") ) { //$NON-NLS-1$
+ iconType = FlashImages.TYPE_text;
+ }
+ else {
+ String objectName = flashNode.getObjectName();
+ if( "_accProps".equals(objectName) || //$NON-NLS-1$
+ "_accImpl".equals(objectName) ) { //$NON-NLS-1$
+ iconType = FlashImages.TYPE_accprops;
+ }
+ }
+ }
+ else if( "function".equals(type) || //$NON-NLS-1$
+ "string".equals(type) ) { //$NON-NLS-1$
+ iconType = type;
+ }
+ else if( "number".equals(type) || //$NON-NLS-1$
+ "null".equals(type) || //$NON-NLS-1$
+ "boolean".equals(type) || //$NON-NLS-1$
+ "undefined".equals(type) ) { //$NON-NLS-1$
+ iconType = FlashImages.TYPE_variable;
+ }
+ else {
+ iconType = FlashImages.TYPE_others;
+ }
+ }
+ else if( element instanceof FlashPlayer ) {
+ iconType = FlashImages.TYPE_flash;
+ }
+ return null!=iconType ? FlashImages.flashIcon(iconType) : null;
+ }
+
+ private static String getNodeText(Object element) {
+ if( element instanceof FlashNode ) {
+ FlashNode flashNode = (FlashNode)element;
+ StringBuffer sb = new StringBuffer();
+ String text = flashNode.getText();
+ if( null !=text ) {
+ sb.append(text);
+ }
+ String title = flashNode.getTitle();
+ if( null != title ) {
+ if( sb.length()>0 ) {
+ sb.append(" "); //$NON-NLS-1$
+ }
+ sb.append(title);
+ }
+ String value = flashNode.getValue();
+ if( null != value ) {
+ if( sb.length()>0 ) {
+ sb.append(" "); //$NON-NLS-1$
+ }
+ sb.append(value);
+ }
+ if( sb.length()==0 ) {
+ sb.append(Messages.getString("msaa.NAMELESS")); //$NON-NLS-1$
+ }
+ String objectName = flashNode.getObjectName();
+ if( sb.length()>0 ) {
+ sb.append(" "); //$NON-NLS-1$
+ }
+ sb.append(objectName);
+ String type = flashNode.getType();
+ if( null != type ) {
+ sb.append("("); //$NON-NLS-1$
+ sb.append(type);
+ sb.append(")"); //$NON-NLS-1$
+ }
+ return sb.toString();
+ }
+ else if( element instanceof FlashPlayer ) {
+ return ((FlashPlayer)element).getErrorText();
+ }
+ if( null==element ) return "null"; //$NON-NLS-1$
+ return element.toString();
+ }
+
+ public String getNodeError(Object element) {
+ if( element instanceof FlashNode ) {
+ FlashNode flashNode = (FlashNode)element;
+ if( !flashNode.getPlayer().isVisible ) {
+ return FlashImages.OVER_BLACK;
+ }
+ if( flashNode.isUIComponent() ) {
+ if( -1 == flashNode.getAccInfo().getAccRole() ) {
+ return FlashImages.OVER_RED;
+ }
+ }
+ boolean shouldWarn = "movieclip".equals(flashNode.getType()) || //$NON-NLS-1$
+ "Button".equals(flashNode.getClassName()); //$NON-NLS-1$
+ if( shouldWarn && flashNode.getAccInfo().isSilent() ) {
+ return FlashImages.OVER_BLACK;
+ }
+ if( null != flashNode.getText() ) {
+ return FlashImages.OVER_GREEN;
+ }
+ if( shouldWarn && null == flashNode.getAccInfo().getAccName() ) {
+ return FlashImages.OVER_RED;
+ }
+ if( "Button".equals(flashNode.getClassName()) ) { //$NON-NLS-1$
+ return FlashImages.OVER_YELLOW;
+ }
+ String objectName = flashNode.getObjectName();
+ if( "onRelease".equals(objectName) ) { //$NON-NLS-1$
+ return FlashImages.OVER_YELLOW;
+ }
+ if( "_accProps".equals(objectName) || //$NON-NLS-1$
+ "_accImpl".equals(objectName) ) { //$NON-NLS-1$
+ return FlashImages.OVER_GREEN;
+ }
+ }
+ else if (element instanceof FlashPlayer) {
+ return FlashImages.OVER_BLACK;
+ }
+ return null;
+ }
+
+ private class FlashDOMLabelProvider extends LabelProvider implements IColorProvider {
+
+
+ public FlashDOMLabelProvider() {
+ super();
+ }
+
+ public Image getImage(Object element) {
+ String nodeImage = getNodeImage(element);
+ String nodeError = getNodeError(element);
+ if( null != nodeImage ) {
+ if( null != nodeError ) {
+ return FlashImages.getImage(nodeImage,nodeError, new Point(16,16)); }
+ return FlashImages.getImage(nodeImage);
+ }
+ else if( null != nodeError) {
+ return FlashImages.getImage(nodeError);
+ }
+ return null;
+ }
+
+ public String getText(Object element) {
+ return getNodeText(element);
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ return null;
+ }
+
+ }
+
+ private class FlashTreeViewer extends TreeViewer {
+
+ public FlashTreeViewer(Composite parent, int style) {
+ super(new Tree(parent, style));
+ }
+
+ public TreeItem[] getChildItems(TreeItem item) {
+ super.createChildren(item);
+ return item.getItems();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/.classpath b/plugins/org.eclipse.actf.visualization.gui/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.gui/.cvsignore b/plugins/org.eclipse.actf.visualization.gui/.cvsignore
new file mode 100644
index 0000000..ddb0a2d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/.cvsignore
@@ -0,0 +1,2 @@
+bin
+.settings
diff --git a/plugins/org.eclipse.actf.visualization.gui/.project b/plugins/org.eclipse.actf.visualization.gui/.project
new file mode 100644
index 0000000..23c9278
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.gui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1a73276
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF GUI Accessibility Visualization Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.gui;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.gui.GuiPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.views,
+ org.eclipse.core.runtime,
+ org.eclipse.actf.accservice.swtbridge;visibility:=reexport,
+ org.eclipse.actf.common,
+ org.eclipse.actf.ai.voice
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.actf.visualization.gui,
+ org.eclipse.actf.visualization.gui.common,
+ org.eclipse.actf.visualization.gui.flash,
+ org.eclipse.actf.visualization.gui.msaa.checker,
+ org.eclipse.actf.visualization.gui.msaa.properties,
+ org.eclipse.actf.visualization.gui.ui.actions,
+ org.eclipse.actf.visualization.gui.ui.views,
+ org.eclipse.actf.visualization.gui.util
diff --git a/plugins/org.eclipse.actf.visualization.gui/about.html b/plugins/org.eclipse.actf.visualization.gui/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.gui/build.properties b/plugins/org.eclipse.actf.visualization.gui/build.properties
new file mode 100644
index 0000000..ea41392
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = plugin.xml,\
+ about.html,\
+ META-INF/,\
+ icons/,\
+ plugin.properties,\
+ plugin_ja.properties,\
+ .
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/.cvsignore b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1.gif
new file mode 100644
index 0000000..9006b81
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x10.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x10.gif
new file mode 100644
index 0000000..3e53cbd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x10.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x11.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x11.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x11.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x12.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x12.gif
new file mode 100644
index 0000000..246a9f8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x12.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x13.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x13.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x13.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x14.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x14.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x14.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x15.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x15.gif
new file mode 100644
index 0000000..81d54f3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x15.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x16.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x16.gif
new file mode 100644
index 0000000..66e1b84
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x16.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x17.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x17.gif
new file mode 100644
index 0000000..001215b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x17.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x18.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x18.gif
new file mode 100644
index 0000000..b99b45c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x18.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x19.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x19.gif
new file mode 100644
index 0000000..a7df25c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x19.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1a.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1a.gif
new file mode 100644
index 0000000..a7df25c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1a.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1b.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1b.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1b.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1c.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1c.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1c.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1d.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1d.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1d.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1e.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1e.gif
new file mode 100644
index 0000000..5fd9c94
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1e.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1f.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1f.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x1f.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2.gif
new file mode 100644
index 0000000..6417328
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x20.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x20.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x20.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x21.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x21.gif
new file mode 100644
index 0000000..bf1274e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x21.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x22.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x22.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x22.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x23.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x23.gif
new file mode 100644
index 0000000..82b3bed
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x23.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x24.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x24.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x24.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x25.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x25.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x25.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x26.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x26.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x26.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x27.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x27.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x27.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x28.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x28.gif
new file mode 100644
index 0000000..5ba5b91
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x28.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x29.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x29.gif
new file mode 100644
index 0000000..cf00ad2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x29.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2a.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2a.gif
new file mode 100644
index 0000000..6538949
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2a.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2b.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2b.gif
new file mode 100644
index 0000000..d143fcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2b.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2c.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2c.gif
new file mode 100644
index 0000000..9cacb96
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2c.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2d.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2d.gif
new file mode 100644
index 0000000..3901d05
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2d.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2e.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2e.gif
new file mode 100644
index 0000000..176a18b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2e.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2f.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2f.gif
new file mode 100644
index 0000000..d93ffdf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x2f.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3.gif
new file mode 100644
index 0000000..4bf0a0a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x30.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x30.gif
new file mode 100644
index 0000000..af41a17
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x30.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x31.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x31.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x31.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x32.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x32.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x32.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x33.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x33.gif
new file mode 100644
index 0000000..3f683a9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x33.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x34.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x34.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x34.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x35.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x35.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x35.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x36.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x36.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x36.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x37.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x37.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x37.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x38.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x38.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x38.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x39.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x39.gif
new file mode 100644
index 0000000..d143fcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x39.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3a.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3a.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3a.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3b.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3b.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3b.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3c.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3c.gif
new file mode 100644
index 0000000..edd6060
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3c.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3d.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3d.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3d.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3e.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3e.gif
new file mode 100644
index 0000000..d143fcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3e.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3f.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3f.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x3f.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x4.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x4.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x4.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40.gif
new file mode 100644
index 0000000..d143fcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x401.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x401.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x401.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x402.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x402.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x402.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x403.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x403.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x403.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x404.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x404.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x404.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x405.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x405.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x405.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x406.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x406.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x406.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x407.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x407.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x407.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x408.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x408.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x408.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x409.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x409.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x409.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40a.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40a.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40a.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40b.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40b.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40b.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40c.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40c.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40c.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40d.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40d.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40d.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40e.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40e.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40e.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40f.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40f.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x40f.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x410.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x410.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x410.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x411.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x411.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x411.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x412.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x412.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x412.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x413.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x413.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x413.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x414.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x414.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x414.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x415.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x415.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x415.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x416.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x416.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x416.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x417.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x417.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x417.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x418.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x418.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x418.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x419.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x419.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x419.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41a.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41a.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41a.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41b.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41b.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41b.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41c.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41c.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41c.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41d.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41d.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41d.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41e.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41e.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41e.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41f.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41f.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x41f.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x420.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x420.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x420.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x421.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x421.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x421.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x422.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x422.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x422.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x423.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x423.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x423.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x424.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x424.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x424.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x425.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x425.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x425.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x426.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x426.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x426.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x427.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x427.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x427.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x428.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x428.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x428.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x429.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x429.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x429.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x42a.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x42a.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x42a.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x42b.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x42b.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x42b.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x5.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x5.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x5.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x6.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x6.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x6.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x7.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x7.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x7.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x8.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x8.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x8.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x9.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x9.gif
new file mode 100644
index 0000000..37aad78
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0x9.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xa.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xa.gif
new file mode 100644
index 0000000..3e53cbd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xa.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xb.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xb.gif
new file mode 100644
index 0000000..9235de5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xb.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xc.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xc.gif
new file mode 100644
index 0000000..07e7b95
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xc.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xd.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xd.gif
new file mode 100644
index 0000000..542dddc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xd.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xe.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xe.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xe.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xf.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xf.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_0xf.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_IA2_ROLE_UNKNOWN.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_IA2_ROLE_UNKNOWN.gif
new file mode 100644
index 0000000..e2edcfc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_IA2_ROLE_UNKNOWN.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_ROLE_UNKNOWN.gif b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_ROLE_UNKNOWN.gif
new file mode 100644
index 0000000..dd45f08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/acc16/role_ROLE_UNKNOWN.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/.cvsignore b/plugins/org.eclipse.actf.visualization.gui/icons/action16/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/checker.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/checker.gif
new file mode 100644
index 0000000..2ac8654
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/checker.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/clear.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/clear.gif
new file mode 100644
index 0000000..af30a42
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/clear.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/collapseall.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/collapseall.gif
new file mode 100644
index 0000000..dc923f5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/collapseall.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/expandall.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/expandall.gif
new file mode 100644
index 0000000..0205b29
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/expandall.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/overlay.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/overlay.gif
new file mode 100644
index 0000000..ff1ecb0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/overlay.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/refresh.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/refresh.gif
new file mode 100644
index 0000000..e383147
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/refresh.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/speak.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/speak.gif
new file mode 100644
index 0000000..16f4e25
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/speak.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/action16/stop.gif b/plugins/org.eclipse.actf.visualization.gui/icons/action16/stop.gif
new file mode 100644
index 0000000..dc47edf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/action16/stop.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/.cvsignore b/plugins/org.eclipse.actf.visualization.gui/icons/view16/.cvsignore
new file mode 100644
index 0000000..085e8ba
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/.cvsignore
@@ -0,0 +1 @@
+Thumbs.db
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/events.gif b/plugins/org.eclipse.actf.visualization.gui/icons/view16/events.gif
new file mode 100644
index 0000000..34fb3c9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/events.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/list.gif b/plugins/org.eclipse.actf.visualization.gui/icons/view16/list.gif
new file mode 100644
index 0000000..d11c996
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/list.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/outline.gif b/plugins/org.eclipse.actf.visualization.gui/icons/view16/outline.gif
new file mode 100644
index 0000000..4b98a62
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/outline.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/problems.gif b/plugins/org.eclipse.actf.visualization.gui/icons/view16/problems.gif
new file mode 100644
index 0000000..807b28a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/problems.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/properties.gif b/plugins/org.eclipse.actf.visualization.gui/icons/view16/properties.gif
new file mode 100644
index 0000000..d11c996
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/properties.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/icons/view16/reader.gif b/plugins/org.eclipse.actf.visualization.gui/icons/view16/reader.gif
new file mode 100644
index 0000000..55ca8f3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/icons/view16/reader.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/plugin.properties b/plugins/org.eclipse.actf.visualization.gui/plugin.properties
new file mode 100644
index 0000000..5c2bcca
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/plugin.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+Accessibility=Accessibility
+MSAAListView.name=GUI Siblings
+MSAAOutlineView.name=GUI Outline
+MSAAPropertiesView.name=GUI Properties
+JAWSTextView.name=GUI Summary
+MSAAEventView.name=GUI Event
+MSAAProblemsView.name=GUI Report
+MSAAPreferencePage.name=GUI Accessibility
+WindowListAction.label=Target W&indow
+WindowListAction.tooltip=Select Target Window
+AccessibleObject.properties=GUI Properties
diff --git a/plugins/org.eclipse.actf.visualization.gui/plugin.xml b/plugins/org.eclipse.actf.visualization.gui/plugin.xml
new file mode 100644
index 0000000..ae8413a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/plugin.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension-point id="targetWindowData" name="DataSource for Target Window" schema="schema/targetWindowData.exsd"/>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="%Accessibility"
+ id="org.eclipse.actf.visualization.gui.ui.views">
+ </category>
+ <view
+ class="org.eclipse.actf.visualization.gui.ui.views.MSAAListView"
+ icon="icons/view16/list.gif"
+ id="org.eclipse.actf.visualization.gui.ui.views.MSAAListView"
+ category="org.eclipse.actf.visualization.gui.ui.views"
+ name="%MSAAListView.name"/>
+ <view
+ class="org.eclipse.actf.visualization.gui.ui.views.MSAAOutlineView"
+ icon="icons/view16/outline.gif"
+ id="org.eclipse.actf.visualization.gui.ui.views.MSAAOutlineView"
+ category="org.eclipse.actf.visualization.gui.ui.views"
+ name="%MSAAOutlineView.name"/>
+ <view
+ class="org.eclipse.actf.visualization.gui.ui.views.MSAAPropertiesView"
+ icon="icons/view16/properties.gif"
+ id="org.eclipse.actf.visualization.gui.ui.views.MSAAPropertiesView"
+ category="org.eclipse.actf.visualization.gui.ui.views"
+ name="%MSAAPropertiesView.name"/>
+ <view
+ class="org.eclipse.actf.visualization.gui.ui.views.JAWSTextView"
+ icon="icons/view16/reader.gif"
+ id="org.eclipse.actf.visualization.gui.ui.views.JAWSTextView"
+ category="org.eclipse.actf.visualization.gui.ui.views"
+ name="%JAWSTextView.name"/>
+ <view
+ class="org.eclipse.actf.visualization.gui.ui.views.MSAAEventView"
+ icon="icons/view16/events.gif"
+ id="org.eclipse.actf.visualization.gui.ui.views.MSAAEventView"
+ category="org.eclipse.actf.visualization.gui.ui.views"
+ name="%MSAAEventView.name"/>
+ <view
+ class="org.eclipse.actf.visualization.gui.msaa.checker.MSAAProblemsView"
+ icon="icons/view16/problems.gif"
+ id="org.eclipse.actf.visualization.gui.msaa.checker.MSAAProblemsView"
+ category="org.eclipse.actf.visualization.gui.ui.views"
+ name="%MSAAProblemsView.name"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.actf.visualization.gui.preferences.GuiPreferencePage"
+ id="org.eclipse.actf.visualization.gui.preferences.GuiPreferencePage"
+ name="%MSAAPreferencePage.name"/>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.actf.visualization.gui.preferences.GuiPreferenceInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ id="org.eclipse.actf.visualization.gui.actionSet"
+ label="aDesigner Target Window">
+ <action
+ class="org.eclipse.actf.visualization.gui.ui.actions.WindowListAction"
+ id="org.eclipse.actf.visualization.gui.actions.WindowListAction"
+ label="%WindowListAction.label"
+ menubarPath="additions"
+ style="pulldown"
+ tooltip="%WindowListAction.tooltip"/>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ id="org.eclipse.actf.visualization.gui.accessibilityActionSet"
+ label="%Accessibility">
+ <menu
+ label="%Accessibility"
+ path="additions"
+ id="accessibilityMenu">
+ <separator name="group1"/>
+ </menu>
+ <action
+ class="org.eclipse.actf.visualization.gui.ui.actions.WindowListAction"
+ id="org.eclipse.actf.visualization.gui.actions.WindowListAction"
+ label="%WindowListAction.label"
+ menubarPath="accessibilityMenu/group1"
+ style="pulldown"
+ tooltip="%WindowListAction.tooltip"/>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup class="org.eclipse.actf.visualization.gui.Startup"/>
+ </extension>
+ <extension
+ point="org.eclipse.actf.visualization.gui.targetWindowData">
+ <dataSourceProvider class="org.eclipse.actf.visualization.gui.targetdata.GuiTargetWindowDataProvider"/>
+ </extension>
+
+<extension point="org.eclipse.core.runtime.adapters">
+ <factory adaptableType="org.eclipse.actf.accservice.swtbridge.AccessibleObject"
+ class="org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySourceAdapterFactory">
+ <adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
+ </factory>
+</extension>
+</plugin>
diff --git a/plugins/org.eclipse.actf.visualization.gui/plugin_ja.properties b/plugins/org.eclipse.actf.visualization.gui/plugin_ja.properties
new file mode 100644
index 0000000..0d61420
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/plugin_ja.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+Accessibility=\u30a2\u30af\u30bb\u30b7\u30d3\u30ea\u30c6\u30a3
+MSAAListView.name=GUI\u4e00\u89a7
+MSAAOutlineView.name=GUI\u30a2\u30a6\u30c8\u30e9\u30a4\u30f3
+MSAAPropertiesView.name=GUI\u30d7\u30ed\u30d1\u30c6\u30a3
+JAWSTextView.name=GUI\u30b5\u30de\u30ea\u30fc
+MSAAEventView.name=GUI\u30a4\u30d9\u30f3\u30c8
+MSAAProblemsView.name=GUI\u30ec\u30dd\u30fc\u30c8
+MSAAPreferencePage.name=GUI\u30a2\u30af\u30bb\u30b7\u30d3\u30ea\u30c6\u30a3
+WindowListAction.label=\u5bfe\u8c61\u30a6\u30a3\u30f3\u30c9\u30a6(&I)
+WindowListAction.tooltip=\u5bfe\u8c61\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044
+AccessibleObject.properties=GUI\u30d7\u30ed\u30d1\u30c6\u30a3
diff --git a/plugins/org.eclipse.actf.visualization.gui/schema/propertiesProvider.exsd b/plugins/org.eclipse.actf.visualization.gui/schema/propertiesProvider.exsd
new file mode 100644
index 0000000..7c247d5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/schema/propertiesProvider.exsd
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.actf.visualization.gui">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.actf.visualization.gui" id="propertiesProvider" name="Properties content provider"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="contentProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="contentProvider">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="sourceClass" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="title" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007, 2008 IBM Corporation and others.<br>
+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 <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.actf.visualization.gui/schema/targetWindowData.exsd b/plugins/org.eclipse.actf.visualization.gui/schema/targetWindowData.exsd
new file mode 100644
index 0000000..ccf3915
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/schema/targetWindowData.exsd
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.actf.visualization.gui">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.actf.visualization.gui" id="targetWindowData" name="DataSource for Target Window"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="dataSourceProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="dataSourceProvider">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007, 2008 IBM Corporation and others.<br>
+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 <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/messages.properties b/plugins/org.eclipse.actf.visualization.gui/src/messages.properties
new file mode 100644
index 0000000..b0a580e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/messages.properties
@@ -0,0 +1,128 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#msaa
+msaa.application=Application
+msaa.button=Button
+msaa.cell=cell
+msaa.checkbox=check box
+msaa.checked=checked
+msaa.checker_tip=Go to GUI Report
+msaa.checker=Go to &GUI Report
+msaa.clear_tip=Clear Event Logs
+msaa.clear=Clea&r
+msaa.collapse=Collapse
+msaa.collapse_all=Collapse All
+msaa.columnheader=Column header
+msaa.combobox=Combo box
+msaa.description=Description
+msaa.document=Document
+msaa.edit=Edit
+msaa.edit_readonly=Edit read only
+msaa.editspinbox=edit spin box
+msaa.expand=Expand &All Children
+msaa.expand_all=Expand All
+msaa.external_browsers=External &Browsers
+msaa.external_windows=External &Windows
+msaa.filter_html=Show &Flash Items Only
+msaa.flash_end=Flash movie end
+msaa.flash_start=Flash movie start
+msaa.flash_inaccessible=Inaccessible Flash movie
+msaa.font=Font:
+msaa.graphic=Graphic
+msaa.showTTSEvents=Show &On-Screen TTS Messages
+msaa.showNull=Show &null Properties
+msaa.indicator=Indicator
+msaa.jaws_simulation=GUI Summary
+msaa.link=Link
+msaa.listbox=List box
+msaa.menu=menu
+msaa.submenu=submenu
+msaa.menubar=Menu bar
+msaa.msaa_event=GUI Event
+msaa.name=Name
+msaa.value=Value
+msaa.NAMELESS=Nameless
+msaa.no_alt_for_button=No ALT text for button
+msaa.no_alt_for_clickable_object=No ALT text for clickable item
+msaa.no_alt_for_graphic=No ALT text for graphic
+msaa.no_alt_for_nonclickable_object=No ALT text for non-clickable item
+msaa.no_alt_for_form_control=No ALT text for form control
+msaa.no_title_for_table=No caption for table
+msaa.no_text_for_link=No text for hyperlink
+msaa.no_title_for_frame=No title for frame
+msaa.not_checked=not checked
+msaa.preference_description=GUI accessibility preferences
+msaa.progressbar=Progress bar
+msaa.radiobutton=radio button
+msaa.refresh=&Refresh
+msaa.role=Role
+msaa.rowheader=Row header
+msaa.scrollbar=Scroll bar
+msaa.selected=selected
+msaa.show_problem=Show Report I&cons on Screen
+msaa.show_tree=Show &Icons on Screen
+msaa.speak_event=Read &Event Messages
+msaa.speak_tip=Read Entire Text
+msaa.speak_here=Read from &Here
+msaa.speak=Read &All
+msaa.state=State
+msaa.statusbar=Status bar
+msaa.stop_tip=Stop reading
+msaa.stop=&Stop
+msaa.tab=Tab
+msaa.table=Table
+msaa.toolbar=Tool bar
+msaa.tree=tree
+msaa.treeview=Tree view
+msaa.unavailable=Unavailable
+msaa.updown_scrollbat=up down Scroll bar
+msaa.window=Window
+msaa.warning=Warning
+msaa.menu_start=menu
+msaa.menu_end=End menu
+msaa.popup_start=submenu
+msaa.popup_end=End submenu
+msaa.show_offscreen=Show &Off-screen Items
+msaa.no_flash=No Flash text in this page
+msaa.empty_page=This page is empty
+msaa.ns_passed=------ ({0,number,#.#} second passed)
+msaa.jaws.notarget=No target window is specified.\n\nPlease select an window in the "Target Window" menu.
+msaa.showError=Show &Error Report
+msaa.showWarning=Show &Warning Report
+msaa.showInformation=Show &Information Report
+msaa.preferences=&Preferences...
+msaa.bringToTop=Always on &Top
+msaa.switchPerspective=&Hide Embedded Browser Automatically
+msaa.changePropertiesColor=Show &Value Change with Color
+msaa.filters_menu=&Filters...
+msaa.filters_title=GUI Event Filters
+msaa.filters_message=S&elect the events to display
+msaa.filters_default=&Restore Defaults
+msaa.showRawEvents=S&how Event Details
+msaa.vis_label=Visualization Options
+msaa.vis_notice=We recommend that screen reader users turn off these options
+msaa.vis_use_overlay=&Use transparent window for visualization
+msaa.vis_always_top=Keep tool window on &top
+msaa.copy=&Copy
+msaa.invoke=&Invoke Method
+
+#msaa properties
+props.pressEnter=Press Enter to Invoke
+props.pressOK=Press OK to Invoke
+props.invalid=*Invalid value {0}
+props.range=*Valid range: {1} <= {0} <={2}
+props.success=Success
+props.fail=Fail
+
+#ia2
+ia2.shape=Shape
+ia2.style_shape={0} shape
+ia2.heading_level=Heading level {0}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/messages_ja.properties b/plugins/org.eclipse.actf.visualization.gui/src/messages_ja.properties
new file mode 100644
index 0000000..b343d53
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/messages_ja.properties
@@ -0,0 +1,128 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#msaa
+msaa.application=\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3
+msaa.button=\u30dc\u30bf\u30f3
+msaa.cell=\u30bb\u30eb
+msaa.checkbox=\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9
+msaa.checked=\u30c1\u30a7\u30c3\u30af
+msaa.checker_tip=GUI\u30ec\u30dd\u30fc\u30c8\u3078\u30b8\u30e3\u30f3\u30d7\u3059\u308b(&G)
+msaa.checker=GUI\u30ec\u30dd\u30fc\u30c8\u3078\u30b8\u30e3\u30f3\u30d7\u3059\u308b
+msaa.clear_tip=\u30a4\u30d9\u30f3\u30c8\u30ed\u30b0\u3092\u6d88\u53bb\u3059\u308b(&R)
+msaa.clear=\u30af\u30ea\u30a2
+msaa.collapse=\u7701\u7565
+msaa.collapse_all=\u3059\u3079\u3066\u7701\u7565\u3059\u308b
+msaa.columnheader=\u5217\u30d8\u30c3\u30c0
+msaa.combobox=\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9
+msaa.description=\u8aac\u660e
+msaa.document=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8
+msaa.edit=\u30a8\u30c7\u30a3\u30c3\u30c8
+msaa.edit_readonly=\u30a8\u30c7\u30a3\u30c3\u30c8\u30fb\u30ea\u30fc\u30c9\u30aa\u30f3\u30ea\u30fc
+msaa.editspinbox=\u30a8\u30c7\u30a3\u30c3\u30c8\u30fb\u30b9\u30d4\u30f3\u30dc\u30c3\u30af\u30b9
+msaa.expand=\u3053\u306e\u4e0b\u3092\u3059\u3079\u3066\u5c55\u958b\u3059\u308b(&A)
+msaa.expand_all=\u3059\u3079\u3066\u5c55\u958b\u3059\u308b
+msaa.external_browsers=\u5916\u90e8\u30d6\u30e9\u30a6\u30b6(&B)
+msaa.external_windows=\u5916\u90e8\u30a6\u30a3\u30f3\u30c9\u30a6(&W)
+msaa.filter_html=Flash\u9805\u76ee\u306e\u307f\u8868\u793a\u3059\u308b(&F)
+msaa.flash_end=\u30d5\u30e9\u30c3\u30b7\u30e5\u7d42\u4e86
+msaa.flash_start=\u30d5\u30e9\u30c3\u30b7\u30e5\u958b\u59cb
+msaa.flash_inaccessible=\u30a2\u30af\u30bb\u30b9\u4e0d\u80fd\u30d5\u30e9\u30c3\u30b7\u30e5
+msaa.font=\u30d5\u30a9\u30f3\u30c8:
+msaa.graphic=\u30b0\u30e9\u30d5\u30a3\u30c3\u30af
+msaa.showTTSEvents=\u30aa\u30f3\u30b9\u30af\u30ea\u30fc\u30f3TTS\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b(&O)
+msaa.showNull=null\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\u3059\u308b(&N)
+msaa.indicator=\u30a4\u30f3\u30b8\u30b1\u30fc\u30bf
+msaa.jaws_simulation=GUI\u30b5\u30de\u30ea\u30fc
+msaa.link=\u30ea\u30f3\u30af
+msaa.listbox=\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9
+msaa.menu=\u30e1\u30cb\u30e5\u30fc
+msaa.submenu=\u30b5\u30d6\u30e1\u30cb\u30e5\u30fc
+msaa.menubar=\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc
+msaa.msaa_event=GUI\u30a4\u30d9\u30f3\u30c8
+msaa.name=\u540d\u524d
+msaa.value=\u5024
+msaa.NAMELESS=\u540d\u524d\u306a\u3057
+msaa.no_alt_for_button=\u30dc\u30bf\u30f3\u306bALT\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_alt_for_clickable_object=\u30af\u30ea\u30c3\u30af\u53ef\u80fd\u306a\u9805\u76ee\u306bALT\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_alt_for_graphic=\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u306bALT\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_alt_for_nonclickable_object=\u30af\u30ea\u30c3\u30af\u4e0d\u80fd\u306a\u9805\u76ee\u306bALT\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_alt_for_form_control=\u30d5\u30a9\u30fc\u30e0\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306bALT\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_title_for_table=\u30c6\u30fc\u30d6\u30eb\u306b\u30ad\u30e3\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_text_for_link=\u30ea\u30f3\u30af\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.no_title_for_frame=\u30d5\u30ec\u30fc\u30e0\u306b\u30bf\u30a4\u30c8\u30eb\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.not_checked=\u30c1\u30a7\u30c3\u30af\u306a\u3057
+msaa.preference_description=GUI\u30a2\u30af\u30bb\u30b7\u30d3\u30ea\u30c6\u30a3\u95a2\u9023\u306e\u8a2d\u5b9a
+msaa.progressbar=\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc
+msaa.radiobutton=\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3
+msaa.refresh=\u6700\u65b0\u306e\u72b6\u614b\u306b\u66f4\u65b0\u3059\u308b(&R)
+msaa.role=\u30ed\u30fc\u30eb
+msaa.rowheader=\u884c\u30d8\u30c3\u30c0
+msaa.scrollbar=\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc
+msaa.selected=\u9078\u629e\u4e2d
+msaa.show_problem=\u30ec\u30dd\u30fc\u30c8\u30a2\u30a4\u30b3\u30f3\u3092\u753b\u9762\u4e0a\u306b\u8868\u793a\u3059\u308b(&C)
+msaa.show_tree=\u30a2\u30a4\u30b3\u30f3\u3092\u753b\u9762\u4e0a\u306b\u8868\u793a\u3059\u308b(&I)
+msaa.speak_event=\u30a4\u30d9\u30f3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8aad\u307f\u4e0a\u3052\u308b(&E)
+msaa.speak_tip=\u5168\u4f53\u3092\u8aad\u307f\u4e0a\u3052\u308b
+msaa.speak_here=\u3053\u306e\u884c\u304b\u3089\u8aad\u307f\u4e0a\u3052\u3092\u958b\u59cb\u3059\u308b(&H)
+msaa.speak=\u5168\u4f53\u3092\u8aad\u307f\u4e0a\u3052\u308b(&A)
+msaa.state=\u72b6\u614b
+msaa.statusbar=\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc
+msaa.stop_tip=\u8aad\u307f\u4e0a\u3052\u3092\u505c\u6b62\u3059\u308b(&S)
+msaa.stop=\u8aad\u307f\u4e0a\u3052\u3092\u505c\u6b62\u3059\u308b
+msaa.tab=\u30bf\u30d6
+msaa.table=\u30c6\u30fc\u30d6\u30eb
+msaa.toolbar=\u30c4\u30fc\u30eb\u30d0\u30fc
+msaa.tree=\u30c4\u30ea\u30fc
+msaa.treeview=\u30c4\u30ea\u30fc\u30d3\u30e5\u30fc
+msaa.unavailable=\u7121\u52b9
+msaa.updown_scrollbat=\u4e0a\u4e0b\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc
+msaa.window=\u30a6\u30a3\u30f3\u30c9\u30a6
+msaa.warning=\u8b66\u544a
+msaa.menu_start=\u30e1\u30cb\u30e5\u30fc
+msaa.menu_end=\u30e1\u30cb\u30e5\u30fc\u7d42\u4e86
+msaa.popup_start=\u30b5\u30d6\u30e1\u30cb\u30e5\u30fc
+msaa.popup_end=\u30b5\u30d6\u30e1\u30cb\u30e5\u30fc\u7d42\u4e86
+msaa.show_offscreen=\u9818\u57df\u5916\u9805\u76ee\u3092\u8868\u793a\u3059\u308b(&O)
+msaa.no_flash=\u3053\u306e\u30da\u30fc\u30b8\u306b\u306fFlash\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093
+msaa.empty_page=\u3053\u306e\u30da\u30fc\u30b8\u306f\u7a7a\u3067\u3059
+msaa.ns_passed=------ ({0,number,#.#}\u79d2\u7d4c\u904e)
+msaa.jaws.notarget=\u5bfe\u8c61\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\n\n"\u5bfe\u8c61\u30a6\u30a3\u30f3\u30c9\u30a6"\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002
+msaa.showError=\u30a8\u30e9\u30fc\u30ec\u30dd\u30fc\u30c8\u3092\u8868\u793a\u3059\u308b(&E)
+msaa.showWarning=\u8b66\u544a\u30ec\u30dd\u30fc\u30c8\u3092\u8868\u793a\u3059\u308b(&W)
+msaa.showInformation=\u60c5\u5831\u30ec\u30dd\u30fc\u30c8\u3092\u8868\u793a\u3059\u308b(&I)
+msaa.preferences=\u8a2d\u5b9a(&P)...
+msaa.bringToTop=\u5e38\u306b\u6700\u4e0a\u4f4d\u306b\u8868\u793a\u3059\u308b(&T)
+msaa.switchPerspective=\u81ea\u52d5\u7684\u306b\u5185\u90e8\u30d6\u30e9\u30a6\u30b6\u3092\u96a0\u3059(&H)
+msaa.changePropertiesColor=\u5024\u306e\u5909\u5316\u3092\u8272\u5206\u3051\u8868\u793a\u3059\u308b(&V)
+msaa.filters_menu=\u30d5\u30a3\u30eb\u30bf\u30fc(&F)...
+msaa.filters_title=GUI\u30a4\u30d9\u30f3\u30c8\u30d5\u30a3\u30eb\u30bf\u30fc
+msaa.filters_message=\u8868\u793a\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044(&E)
+msaa.filters_default=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u5fa9\u5143(&R)
+msaa.showRawEvents=\u30a4\u30d9\u30f3\u30c8\u306e\u8a73\u7d30\u3092\u8868\u793a\u3059\u308b(&H)
+msaa.vis_label=\u8996\u899a\u5316\u30aa\u30d7\u30b7\u30e7\u30f3
+msaa.vis_notice=\u30b9\u30af\u30ea\u30fc\u30f3\u30ea\u30fc\u30c0\u4f7f\u7528\u4e2d\u306f\u3053\u308c\u3089\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u7121\u52b9\u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059
+msaa.vis_use_overlay=\u900f\u660e\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f7f\u7528\u3057\u3066\u8996\u899a\u5316\u3092\u884c\u3046(&U)
+msaa.vis_always_top=\u30c4\u30fc\u30eb\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u5e38\u306b\u6700\u4e0a\u4f4d\u306b\u8868\u793a\u3059\u308b(&T)
+msaa.copy=\u30b3\u30d4\u30fc(&C)
+msaa.invoke=\u30e1\u30bd\u30c3\u30c9\u3092\u8d77\u52d5(&I)
+
+#msaa properties
+props.pressEnter=Enter\u30ad\u30fc\u3092\u62bc\u3059\u3068\u30e1\u30bd\u30c3\u30c9\u3092\u8d77\u52d5\u3057\u307e\u3059
+props.pressOK=OK\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u30e1\u30bd\u30c3\u30c9\u3092\u8d77\u52d5\u3057\u307e\u3059
+props.invalid=*{0} \u306f\u7121\u52b9\u3067\u3059
+props.range=*\u6709\u52b9\u7bc4\u56f2 {1} <= {0} <={2}
+props.success=\u6210\u529f
+props.fail=\u5931\u6557
+
+#ia2
+ia2.shape=Shape
+ia2.style_shape={0} shape
+ia2.heading_level=Heading level {0}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/GuiImages.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/GuiImages.java
new file mode 100644
index 0000000..246473c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/GuiImages.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+
+public final class GuiImages {
+
+ public static final String ACC_ROLE = "icons/acc16/role_{0}.gif"; //$NON-NLS-1$
+
+ public static final ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ public static Map<String, Image> imageMap = new HashMap<String, Image>();
+
+ public static Image getImage(String path) {
+ if( null == path ) {
+ return null;
+ }
+ Image image = (Image)imageMap.get(path);
+ if( null == image) {
+ ImageDescriptor descriptor = getImageDescriptor(path);
+ if( null != descriptor ) {
+ image = descriptor.createImage(true);
+ imageMap.put(path,image);
+ }
+ }
+ return image;
+ }
+
+ public static ImageDescriptor getImageDescriptor(String path) {
+ ImageDescriptor descriptor = GuiPlugin.getImageDescriptor(path);
+ if( null == descriptor ) {
+ descriptor = sharedImages.getImageDescriptor(path);
+ }
+ return descriptor;
+ }
+
+ public static String roleIcon(String roleString) {
+ return getFilename(ACC_ROLE, roleString);
+ }
+
+ public static String roleIcon(int roleNumber) {
+ return getFilename(ACC_ROLE, "0x"+Integer.toHexString(roleNumber)); //$NON-NLS-1$
+ }
+
+ public static String getFilename(String format, String name) {
+ String path = MessageFormat.format(format, new Object[]{name.toLowerCase()});
+ if( null != GuiPlugin.getImageDescriptor(path) ) {
+ return path;
+ }
+ DebugPrintUtil.devOrDebugPrintln("Missing MSAA icon "+path); //$NON-NLS-1$
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/GuiPlugin.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/GuiPlugin.java
new file mode 100644
index 0000000..6933404
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/GuiPlugin.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class GuiPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.actf.visualization.gui";
+
+ //The shared instance.
+ private static GuiPlugin plugin;
+
+ //Images
+ public static final ImageDescriptor IMAGE_OVERLAY = getImageDescriptor("icons/action16/overlay.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_REFRESH = getImageDescriptor("icons/action16/refresh.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_CLEAR = getImageDescriptor("icons/action16/clear.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_EXPAND_ALL = getImageDescriptor("icons/action16/expandall.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_COLLAPSE_ALL =getImageDescriptor("icons/action16/collapseall.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_SPEAK = getImageDescriptor("icons/action16/speak.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_STOP = getImageDescriptor("icons/action16/stop.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor IMAGE_CHECKER = getImageDescriptor("icons/action16/checker.gif"); //$NON-NLS-1$
+
+ /**
+ * The constructor.
+ */
+ public GuiPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static GuiPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/Messages.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/Messages.java
new file mode 100644
index 0000000..b2d0d3a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/Messages.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+
+public class Messages {
+ private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/Startup.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/Startup.java
new file mode 100644
index 0000000..f0f663e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/Startup.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui;
+
+import org.eclipse.actf.util.win32.HighlightComposite;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IStartup;
+
+
+
+public class Startup implements IStartup {
+
+ public void earlyStartup() {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ MSAAViewRegistory.refreshRootObject();
+ HighlightComposite.getOverlayWindow();
+ }
+ });
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindow.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindow.java
new file mode 100644
index 0000000..f2b7fce
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindow.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.common;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.IWebBrowserACTF;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.actf.visualization.gui.targetdata.GuiTargetWindowData;
+import org.eclipse.swt.widgets.Composite;
+
+
+
+
+public class TargetWindow {
+
+ private static Object currentElement = null;
+
+ public static void setCurrentElement(Object element) {
+ currentElement = element;
+ }
+
+ private static void update() {
+ if( null == currentElement ) {
+ setCurrentElement(TargetWindowDataCollector.getDefaultElement());
+ }
+ }
+
+ public static boolean isEmbeddedBrowser() {
+ update();
+ return isEmbeddedBrowser(currentElement);
+ }
+
+ public static int getWindowHandle() {
+ update();
+ return getWindowHandle(currentElement);
+ }
+
+ public static String getID() {
+ update();
+ return getID(currentElement);
+ }
+
+ public static int getRootWindow() {
+ update();
+ return getRootWindow(currentElement);
+ }
+
+ /*
+ * Utility functions
+ */
+ private static IModelService getModelService(Object element) {
+ if( element instanceof IModelService ) {
+ return (IModelService)element;
+ }
+ if( element instanceof TargetWindowDataProvider ) {
+ return ((TargetWindowDataProvider)element).getActiveModelService();
+ }
+ return null;
+ }
+
+ private static int getWindowHandle(Object element) {
+ IModelService modelService = getModelService(element);
+ if( null != modelService ) {
+ Composite composite = modelService.getTargetComposite();
+ if( null != composite ) {
+ return composite.handle;
+ }
+ Object objHandle = modelService.getAttribute(IModelService.ATTR_WINDOWHANDLE);
+ if( objHandle instanceof Integer ) {
+ return ((Integer)objHandle).intValue();
+ }
+ }
+ return 0;
+ }
+
+ public static boolean isEmbeddedBrowser(Object element) {
+ IModelService modelService = getModelService(element);
+ if( null != modelService ) {
+ return null != modelService.getTargetComposite();
+ }
+ return false;
+ }
+
+ private static boolean isBrowser(Object element) {
+ IModelService modelService = getModelService(element);
+ if( modelService instanceof GuiTargetWindowData ) {
+ return ((GuiTargetWindowData)modelService).isBrowser();
+ }
+ return modelService instanceof IWebBrowserACTF;
+ }
+
+ public static String getTitle(Object element) {
+ IModelService modelService = getModelService(element);
+ if( null != modelService ) {
+ return modelService.getTitle();
+ }
+ return null;
+ }
+
+ public static String getID(Object element) {
+ IModelService modelService = getModelService(element);
+ if( null != modelService ) {
+ return modelService.getID();
+ }
+ return null;
+ }
+
+ public static int getRootWindow(Object element) {
+ int hwnd = getWindowHandle(element);
+ if( isBrowser(element) ) {
+ int hwndChild = findBrowserChildren(hwnd);
+ if( 0 != hwndChild ) {
+ return hwndChild;
+ }
+ }
+ return hwnd;
+ }
+
+ private static int findBrowserChildren(int hwnd) {
+ if( 0 != hwnd ) {
+ String className = WindowUtil.GetWindowClassName(hwnd);
+ if( WebBrowserUtil.isBrowserClass(className) ) {
+ return hwnd;
+ }
+ for( int hwndChild=WindowUtil.GetChildWindow (hwnd); 0!=hwndChild;
+ hwndChild=WindowUtil.GetNextWindow (hwndChild) )
+ {
+ int hwndFound = findBrowserChildren(hwndChild);
+ if( 0 != hwndFound ) {
+ return hwndFound;
+ }
+ }
+ }
+ return 0;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindowDataCollector.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindowDataCollector.java
new file mode 100644
index 0000000..ad22344
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindowDataCollector.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.common;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.targetdata.GuiTargetWindowData;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+
+
+
+
+public class TargetWindowDataCollector {
+
+ private static final String TARGETDATA_EXTENSION = GuiPlugin.PLUGIN_ID+".targetWindowData"; //$NON-NLS-1$
+ private static TargetWindowDataProvider[] targetDataProviders = new TargetWindowDataProvider[0];
+
+ // Initialize TargetWindowDataProvider
+ static {
+ List<TargetWindowDataProvider> dspList = new ArrayList<TargetWindowDataProvider>();
+ IConfigurationElement[] targetDataElements = Platform.getExtensionRegistry().getConfigurationElementsFor(TARGETDATA_EXTENSION);
+ for( int i=0; i<targetDataElements.length; i++ ) {
+ try {
+ TargetWindowDataProvider provider = (TargetWindowDataProvider)targetDataElements[i].createExecutableExtension("class"); //$NON-NLS-1$
+ if( null != provider ) {
+ dspList.add(provider);
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+ targetDataProviders = dspList.toArray(new TargetWindowDataProvider[dspList.size()]);
+ }
+
+ public static Object[] getElements() {
+ List resultList = new ArrayList();
+ for( int i=0; i<targetDataProviders.length; i++ ) {
+ if( null != targetDataProviders[i] ) {
+ Object[] elements = targetDataProviders[i].getModelService();
+ if( null != elements ) {
+ resultList.addAll(Arrays.asList(elements));
+ }
+ else {
+ resultList.add(targetDataProviders[i]);
+ }
+ }
+ }
+ return resultList.toArray();
+ }
+
+ public static Object getDefaultElement() {
+ Object[] elements = getElements();
+ for( int i=0; i<elements.length; i++ ) {
+ if( TargetWindow.isEmbeddedBrowser(elements[i]) ) {
+ return elements[i];
+ }
+ }
+ return null;
+ }
+
+ private Map<String, List> categoryMap = new HashMap<String, List>();
+
+ public TargetWindowDataCollector() {
+ Object[] elements = getElements();
+ for( int i=0; i<elements.length; i++ ) {
+ String category = null;
+ if( elements[i] instanceof GuiTargetWindowData ) {
+ category = ((GuiTargetWindowData)elements[i]).getCategory();
+ }
+ List entry = (List)categoryMap.get(category);
+ if( null==entry ) {
+ entry = new ArrayList();
+ categoryMap.put(category,entry);
+ }
+ entry.add(elements[i]);
+ }
+ }
+
+ public String[] getCategories(Comparator comparator) {
+ List<String> resultList = new ArrayList<String>(categoryMap.keySet());
+ if( null != comparator ) {
+ Collections.sort(resultList, comparator);
+ }
+ return (String[])resultList.toArray(new String[resultList.size()]);
+ }
+
+ public Object[] getElements(String category) {
+ List resultList = (List)categoryMap.get(category);
+ if( null != resultList ) {
+ return resultList.toArray();
+ }
+ return new Object[0];
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindowDataProvider.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindowDataProvider.java
new file mode 100644
index 0000000..cc0495b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/TargetWindowDataProvider.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.common;
+
+import org.eclipse.actf.model.IModelService;
+
+
+
+public abstract class TargetWindowDataProvider {
+
+ /**
+ * Get all ModelService
+ * @return array of IModelService
+ * getActiveModelService is called if null is returned
+ */
+ public IModelService[] getModelService() {
+ return null;
+ }
+
+ /**
+ * Get current active Data source
+ * @return IModelService
+ */
+ public IModelService getActiveModelService() {
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/WebBrowserUtil.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/WebBrowserUtil.java
new file mode 100644
index 0000000..c767012
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/common/WebBrowserUtil.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.common;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.IServiceProvider;
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IDispatch;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+public class WebBrowserUtil {
+
+ private static final GUID IID_IHTMLElement = COMUtil.IIDFromString("{3050f1ff-98b5-11cf-bb82-00aa00bdce0b}"); //$NON-NLS-1$
+
+ private static final String[] BROWSER_CLASSNAMES = new String[] {
+ "Internet Explorer_Server", //$NON-NLS-1$
+ "MozillaContentWindowClass" //$NON-NLS-1$
+ };
+
+ public static boolean isBrowserFrame(int hwndFrame) {
+ String className = WindowUtil.GetWindowClassName(hwndFrame);
+ if( "MozillaUIWindowClass".equals(className) || //$NON-NLS-1$
+ "IEFrame".equals(className) ) { //$NON-NLS-1$
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isBrowser(AccessibleObject accObject) {
+ return isBrowserClass(accObject.getClassName());
+ }
+
+ public static boolean isBrowserClass(String className) {
+ for( int i=0; i<BROWSER_CLASSNAMES.length; i++ ) {
+ if( BROWSER_CLASSNAMES[i].equals(className) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static Variant getHTMLElementFromObject(Object objUnknown) {
+ if( objUnknown instanceof AccessibleObject ) {
+ objUnknown = ((AccessibleObject)objUnknown).getIAccessible();
+ }
+ if( objUnknown instanceof IUnknown ) {
+ int[] ppvServiceProvider = new int[1];
+ if( OLE.S_OK == ((IUnknown)objUnknown).QueryInterface(IServiceProvider.IID,ppvServiceProvider) ) {
+ IServiceProvider sp = new IServiceProvider(ppvServiceProvider[0]);
+ try {
+ int[] ppvObject = new int[1];
+ if( OLE.S_OK== sp.QueryService(IID_IHTMLElement,IID_IHTMLElement, ppvObject) ) {
+ return new Variant(new IDispatch(ppvObject[0]));
+ }
+ return null;
+ }
+ finally {
+ sp.Release();
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String getHtmlAttribute(Object objUnknown, String name) {
+ Variant varElement = getHTMLElementFromObject(objUnknown);
+ if( null != varElement && OLE.VT_DISPATCH==varElement.getType() ) {
+ try {
+ OleAutomation automation = varElement.getAutomation();
+ int[] idAttr = automation.getIDsOfNames(new String[]{name});
+ if( null != idAttr ) {
+ Variant varAttr = automation.getProperty(idAttr[0]);
+ if( null != varAttr ) {
+ if( null!=varAttr && OLE.VT_BSTR==varAttr.getType() ) {
+ return varAttr.getString();
+ }
+ }
+ }
+ }
+ finally {
+ varElement.dispose();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/flash/FlashFinder.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/flash/FlashFinder.java
new file mode 100644
index 0000000..23cce69
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/flash/FlashFinder.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.flash;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.actf.visualization.gui.ui.views.MSAATreeContentProvider;
+
+
+public class FlashFinder {
+ public static boolean debugMode = false;
+ public static boolean scanAll = false;
+ private List<AccessibleObject> result = new ArrayList<AccessibleObject>();
+
+ private boolean showOffScreen;
+
+ public void find(Object[] inputElements) {
+ showOffScreen = MSAATreeContentProvider.getDefault().showOffscreen;
+ for (int i = 0; i < inputElements.length; i++) {
+ if (inputElements[i] instanceof AccessibleObject) {
+ AccessibleObject accObject = (AccessibleObject)inputElements[i];
+ if( scanAll ||
+ 0 != findFlashWindow(accObject.getWindow()) ) {
+ findChildren(accObject);
+ }
+ }
+ }
+ }
+
+ private static int findFlashWindow(int hwnd) {
+ if( 0 != hwnd ) {
+ if( FlashUtil.isFlashClass(WindowUtil.GetWindowClassName(hwnd)) ) {
+ return hwnd;
+ }
+ for( int hwndChild=WindowUtil.GetChildWindow (hwnd); 0!=hwndChild;
+ hwndChild=WindowUtil.GetNextWindow (hwndChild) )
+ {
+ int hwndFound = findFlashWindow(hwndChild);
+ if( 0 != hwndFound ) {
+ return hwndFound;
+ }
+ }
+ }
+ return 0;
+ }
+
+ private void findChildren(Object[] inputElements) {
+ for (int i = 0; i < inputElements.length; i++) {
+ findChildren((AccessibleObject) inputElements[i]);
+ }
+ }
+
+ private void findChildren(AccessibleObject accObject) {
+ if (null != accObject) {
+ int role = accObject.getAccRole();
+ if ((MSAA.ROLE_SYSTEM_WINDOW==role||MSAA.ROLE_SYSTEM_CLIENT==role) && FlashUtil.isFlash(accObject)) {
+ result.add(accObject);
+ } else {
+ switch( accObject.getAccState() & (MSAA.STATE_INVISIBLE|MSAA.STATE_OFFSCREEN) ) {
+ case MSAA.STATE_INVISIBLE|MSAA.STATE_OFFSCREEN:
+ if( !showOffScreen ) break;
+ case 0:
+ findChildren(accObject.getChildren());
+ break;
+ }
+ }
+ }
+ }
+
+ public Object[] getResults() {
+ return result.toArray();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/flash/FlashUtil.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/flash/FlashUtil.java
new file mode 100644
index 0000000..025e833
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/flash/FlashUtil.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.flash;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.visualization.gui.common.WebBrowserUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+
+
+
+
+public class FlashUtil {
+
+ private static Color colorFlash = Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW);
+ private static Color colorInvisibleFlash = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
+
+ public static boolean isFlash(AccessibleObject accObject) {
+ return isFlashClass(accObject.getClassName()) || isInvisibleFlash(accObject);
+ }
+
+ public static boolean isInvisibleFlash(AccessibleObject accObject) {
+ if( MSAA.ROLE_SYSTEM_CLIENT == accObject.getAccRole() ) {
+ String description = accObject.getAccDescription();
+ if( null != description && description.startsWith("PLUGIN: type=") ) { //$NON-NLS-1$
+ return null != WebBrowserUtil.getHtmlAttribute(accObject,"WMode"); //$NON-NLS-1$
+ }
+ }
+ return false;
+ }
+
+ public static boolean isFlashClass(String className) {
+ return "MacromediaFlashPlayerActiveX".equals(className) || //$NON-NLS-1$
+ "ShockwaveFlashPlugin".equals(className); //$NON-NLS-1$
+ }
+
+ public static Object[] getFlashElements(Object inputElement) {
+ FlashFinder finder = new FlashFinder();
+ if (inputElement instanceof Object[]) {
+ finder.find((Object[]) inputElement);
+ } else {
+ finder.find(new Object[] { inputElement });
+ }
+ return finder.getResults();
+ }
+
+ public static Color getFlashBackground(AccessibleObject accObject) {
+ switch( accObject.getAccRole() ) {
+ case MSAA.ROLE_SYSTEM_WINDOW:
+ if( FlashUtil.isFlash(accObject) ) {
+ return colorFlash;
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_CLIENT:
+ if( FlashUtil.isInvisibleFlash(accObject) ) {
+ return colorInvisibleFlash;
+ }
+ break;
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblem.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblem.java
new file mode 100644
index 0000000..52a4b93
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblem.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.checker;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+public class MSAAProblem implements MSAAProblemConst {
+
+ /**
+ * One of ERROR, WARNING, or INFO.
+ */
+ private int errorCategory;
+
+ private int errorCode;
+
+ private String errorDescription;
+
+ private AccessibleObject errorObject;
+
+ public MSAAProblem(int errorCategory, int errorCode, AccessibleObject errorObject) {
+ this.errorCategory = errorCategory;
+ this.errorCode = errorCode;
+ this.errorDescription = DESCRIPTIONS[errorCode];
+ this.errorObject = errorObject;
+ }
+
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+ public int getErrorCategory() {
+ return this.errorCategory;
+ }
+
+ public String getErrorDescription() {
+ return errorDescription;
+ }
+
+ public AccessibleObject getErrorObject() {
+ return errorObject;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemChecker.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemChecker.java
new file mode 100644
index 0000000..20e9d67
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemChecker.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.checker;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.visualization.gui.ui.views.MSAATreeContentProvider;
+
+
+public class MSAAProblemChecker implements MSAAProblemConst {
+
+ private AccessibleObject rootObject;
+
+ private static final MSAATreeContentProvider provider = new MSAATreeContentProvider();
+
+ public MSAAProblemChecker(AccessibleObject accObject) {
+ this.rootObject = accObject;
+ }
+
+ public MSAAProblem[] getProblems() {
+ provider.showOffscreen = true;
+ provider.hideHtml = MSAATreeContentProvider.getDefault().hideHtml;
+ return getProblem(provider.getElements(rootObject));
+ }
+
+ public MSAAProblem[] getProblem(Object[] children) {
+ List<MSAAProblem> problems = new ArrayList<MSAAProblem>();
+
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ AccessibleObject ao = (AccessibleObject)children[i];
+ if (ao == null)
+ continue;
+ if (0 != (ao.getAccState() & MSAA.STATE_INVISIBLE))
+ continue;
+
+ String accName = null;
+
+ accName = ao.getAccName();
+
+ int role = ao.getAccRole();
+ switch( role ) {
+ case MSAA.ROLE_SYSTEM_WINDOW:
+ case MSAA.ROLE_SYSTEM_CLIENT:
+ case MSAA.ROLE_SYSTEM_CELL:
+ case MSAA.ROLE_SYSTEM_STATICTEXT:
+ case MSAA.ROLE_SYSTEM_SEPARATOR:
+ case IA2.IA2_ROLE_PARAGRAPH:
+ case MSAA.ROLE_SYSTEM_TEXT:
+ case MSAA.ROLE_SYSTEM_TITLEBAR: // Ignore
+ case MSAA.ROLE_SYSTEM_STATUSBAR:// Ignore
+ case MSAA.ROLE_SYSTEM_GRIP: // Ignore
+ case MSAA.ROLE_SYSTEM_TOOLBAR: // Ignore
+ case MSAA.ROLE_SYSTEM_PAGETABLIST: // Ignore
+ case MSAA.ROLE_SYSTEM_LIST: // Ignore
+ case MSAA.ROLE_SYSTEM_OUTLINE: // Ignore
+ break;
+ default:
+ {
+ if (null == accName || 0 == accName.length()) {
+ if (role == MSAA.ROLE_SYSTEM_PUSHBUTTON)
+ problems.add(new MSAAProblem(MSAA_ERROR, MSAA_PROB_NO_ALT_BUTTON, ao));
+ else if (role == MSAA.ROLE_SYSTEM_GRAPHIC)
+ problems.add(new MSAAProblem(MSAA_WARNING, MSAA_PROB_NO_ALT_GRAHPIC, ao));
+ else if (role == MSAA.ROLE_SYSTEM_COMBOBOX)
+ problems.add(new MSAAProblem(MSAA_ERROR, MSAA_PROB_NO_ALT_FORM_CONTROL, ao));
+ else if (role == MSAA.ROLE_SYSTEM_TABLE)
+ problems.add(new MSAAProblem(MSAA_INFORMATION, MSAA_PROB_NO_TITLE_TABLE, ao));
+ else if (role == MSAA.ROLE_SYSTEM_LINK) {
+ String value = ao.getAccValue();
+ if( null != value && value.length()>0 ) {
+ if (ao.getChildCount() == 0) {
+ problems.add(new MSAAProblem(MSAA_ERROR, MSAA_PROB_NO_TEXT_LINK, ao));
+ }
+ else {
+ AccessibleObject ao1 = ao.getChildren()[0];
+ if (ao1.getAccRole() == MSAA.ROLE_SYSTEM_GRAPHIC
+ && (ao1.getAccName() == null || ao1.getAccName().length() == 0))
+ problems.add(new MSAAProblem(MSAA_ERROR, MSAA_PROB_NO_TEXT_LINK, ao));
+ }
+ }
+ } else /*if (role != MSAA.ROLE_TEXT)*/ {
+ String defaultAction = ao.getAccDefaultAction();
+ if (null == defaultAction || 0 == defaultAction.length()) {
+ if (role == MSAA.ROLE_SYSTEM_PANE)
+ problems.add(new MSAAProblem(MSAA_WARNING, MSAA_PROB_NO_TITLE_FRAME, ao));
+ else
+ problems
+ .add(new MSAAProblem(MSAA_WARNING, MSAA_PROB_NO_ALT_NONCLICKABLE_OBJECT, ao));
+ } else {
+ problems.add(new MSAAProblem(MSAA_ERROR, MSAA_PROB_NO_ALT_CLICKABLE_OBJECT, ao));
+ }
+ }
+ }
+ }
+ }
+ problems.addAll(Arrays.asList(getProblem(provider.getChildren(ao))));
+ }
+ }
+ return (MSAAProblem[]) problems.toArray(new MSAAProblem[problems.size()]);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemConst.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemConst.java
new file mode 100644
index 0000000..6298bf5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemConst.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.checker;
+
+import org.eclipse.actf.visualization.gui.Messages;
+
+public interface MSAAProblemConst {
+ public static final int MSAA_ERROR = 1;
+
+ public static final int MSAA_WARNING = 2;
+
+ public static final int MSAA_INFORMATION = 3;
+
+ public static final int MSAA_PROB_NO_ALT_BUTTON = 0;
+
+ public static final int MSAA_PROB_NO_ALT_GRAHPIC = 1;
+
+ public static final int MSAA_PROB_NO_ALT_CLICKABLE_OBJECT = 2;
+
+ public static final int MSAA_PROB_NO_ALT_NONCLICKABLE_OBJECT = 3;
+
+ public static final int MSAA_PROB_NO_ALT_FORM_CONTROL = 4;
+
+ public static final int MSAA_PROB_NO_TITLE_TABLE = 5;
+
+ public static final int MSAA_PROB_NO_TEXT_LINK = 6;
+
+ public static final int MSAA_PROB_NO_TITLE_FRAME = 7;
+
+ public static final String[] DESCRIPTIONS = { Messages.getString("msaa.no_alt_for_button"), //$NON-NLS-1$
+ Messages.getString("msaa.no_alt_for_graphic"), //$NON-NLS-1$
+ Messages.getString("msaa.no_alt_for_clickable_object"), //$NON-NLS-1$
+ Messages.getString("msaa.no_alt_for_nonclickable_object"),//$NON-NLS-1$
+ Messages.getString("msaa.no_alt_for_form_control"), //$NON-NLS-1$
+ Messages.getString("msaa.no_title_for_table"), //$NON-NLS-1$
+ Messages.getString("msaa.no_text_for_link"), //$NON-NLS-1$
+ Messages.getString("msaa.no_title_for_frame") //$NON-NLS-1$
+ };
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemsView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemsView.java
new file mode 100644
index 0000000..96d9f72
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/MSAAProblemsView.java
@@ -0,0 +1,525 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.checker;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.util.win32.HighlightComposite;
+import org.eclipse.actf.util.win32.OverlayLabel;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceConstants;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceManager;
+import org.eclipse.actf.visualization.gui.ui.views.AccessibleObjectSelectionProvider;
+import org.eclipse.actf.visualization.gui.ui.views.IMSAAOutlineView;
+import org.eclipse.actf.visualization.gui.ui.views.IMSAAProblemsView;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAOutlineView;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.actf.visualization.gui.util.AccessiblePropertyUtil;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ArmEvent;
+import org.eclipse.swt.events.ArmListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+
+public class MSAAProblemsView extends ViewPart implements IMSAAProblemsView, MSAAProblemConst {
+ public static final String ID = MSAAProblemsView.class.getName();
+
+ private static final String[] HEADINGS = { "", Messages.getString("msaa.description"), "Name", "Role", "State", "X", "Y", "W", "H" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+
+ private static final int[] WEIGHTS = { 1, 10, 5, 5, 5, 1, 1, 1, 1 };
+
+ private static final int[] ALIGNMENTS = { SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.RIGHT, SWT.RIGHT,
+ SWT.RIGHT, SWT.RIGHT };
+
+ private TableViewer viewer;
+
+ private MSAAProblemsViewerSorter sorter = new MSAAProblemsViewerSorter();
+
+ private boolean suppressLabelAdjust = false;
+
+ private Action refreshAction;
+
+ private Action showLabelsAction;
+
+ private Action showErrorAction, showWarningAction, showInformationAction;
+
+ private ProblemFilter filter = new ProblemFilter();
+
+ /**
+ * The constructor.
+ */
+ public MSAAProblemsView() {
+ }
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ Table table = new Table(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ for (int i = 0; i < HEADINGS.length; i++) {
+ layout.addColumnData(new ColumnWeightData(WEIGHTS[i]));
+ TableColumn tc = new TableColumn(table, SWT.NONE);
+ tc.setText(HEADINGS[i]);
+ tc.setAlignment(ALIGNMENTS[i]);
+ tc.setResizable(true);
+ final int newSortingColumn = i + 1;
+ tc.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (newSortingColumn == sorter.sortingColumn) {
+ sorter.sortingColumn = -newSortingColumn;
+ } else {
+ sorter.sortingColumn = newSortingColumn;
+ }
+ viewer.refresh();
+ }
+ });
+ }
+
+ viewer = new TableViewer(table);
+ MSAAProblemsContentAndLabelProvider provider = new MSAAProblemsContentAndLabelProvider();
+ viewer.setContentProvider(provider);
+ viewer.setLabelProvider(provider);
+ viewer.setSorter(sorter);
+ viewer.addFilter(filter);
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedElement instanceof MSAAProblem) {
+ AccessibleObject object = ((MSAAProblem) selectedElement).getErrorObject();
+ if (null != object) {
+ IMSAAOutlineView outlineView = (IMSAAOutlineView)MSAAViewRegistory.findView(MSAAViewRegistory.MSAAOutlineView_ID);
+ if( null != outlineView ) {
+ outlineView.setSelection(object);
+ }
+ else {
+ HighlightComposite.flashRectangle(object.getAccLocation());
+ }
+ }
+ if (!suppressLabelAdjust) {
+ showOverlayLabels();
+ }
+ }
+ }
+
+ }
+ });
+
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ public void refresh() {
+ AccessibleObject rootObject = MSAAViewRegistory.getRootObject();
+ if (null != rootObject) {
+ viewer.setInput(new MSAAProblemChecker(rootObject));
+ showOverlayLabels();
+ }
+ }
+
+ private void showOverlayLabels() {
+ OverlayLabel.removeAll();
+ if( showLabelsAction.isChecked() ) {
+ TableItem[] items = viewer.getTable().getItems();
+ Object currentItem = ((StructuredSelection)viewer.getSelection()).getFirstElement();
+ for( int errorCode = MSAAProblemConst.MSAA_ERROR; errorCode<=MSAA_INFORMATION; errorCode++ ) {
+ createOverlayLabels(items, currentItem, errorCode);
+ }
+ OverlayLabel.setOwnerId(MSAAViewRegistory.MSAAProblemsView_ID);
+ }
+ }
+
+ private void createOverlayLabels(TableItem[] items, Object currentItem, int errorCategory ) {
+ for( int i=0; i<items.length; i++ ) {
+ MSAAProblem itemData = (MSAAProblem)items[i].getData();
+ if( errorCategory != itemData.getErrorCategory() ) continue;
+ AccessibleObject accObject = itemData.getErrorObject();
+ Rectangle location = accObject.getAccLocation();
+ if( null != location ) {
+ OverlayLabel label = OverlayLabel.create(itemData);
+ if( itemData.equals(currentItem) ) {
+ label.setForeground(label.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
+ label.setBackground(label.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));
+ }
+ MSAAProblemsContentAndLabelProvider labelProvider = (MSAAProblemsContentAndLabelProvider)viewer.getLabelProvider();
+ label.setImage(labelProvider.getColumnImage(itemData,0));
+ String text = labelProvider.getColumnText(itemData,1)+"\n"+MSAAOutlineView.getTreeText(accObject); //$NON-NLS-1$
+ String[][] properties = AccessiblePropertyUtil.getPropertyStrings(accObject);
+ label.setTooltop(text, properties);
+ label.pack();
+ label.setLocation(location.x,location.y);
+ label.addMouseListener(new MouseAdapter(){
+ public void mouseDown(MouseEvent e) {
+ if( e.widget instanceof OverlayLabel ) {
+ OverlayLabel[] labels = OverlayLabel.getLabelsAtPosition(e.display.getCursorLocation());
+ if( labels.length > 0 ) {
+ showSelectionMenu(labels,(OverlayLabel)e.widget);
+ }
+ else {
+ viewer.setSelection(new StructuredSelection(((OverlayLabel)e.widget).associatedObject));
+ }
+ }
+ }
+ });
+ label.addMouseTrackListener(new MouseTrackAdapter(){
+ public void mouseEnter(MouseEvent e) {
+ if( e.widget instanceof OverlayLabel ) {
+ MSAAProblem problem = (MSAAProblem)((OverlayLabel)e.widget).associatedObject;
+ AccessibleObject object = problem.getErrorObject();
+ if (null != object) {
+ HighlightComposite.flashRectangle(object.getAccLocation());
+ }
+ }
+ }
+ public void mouseExit(MouseEvent e) {
+ HighlightComposite.show(false);
+ }
+ });
+ }
+ }
+ }
+
+ private void showSelectionMenu(OverlayLabel[] labels, OverlayLabel parent) {
+ final Menu popupMenu = parent.createPopupMenu();
+ MenuItem[] menuItems = new MenuItem[labels.length];
+ for( int i=0; i<labels.length; i++ ) {
+ menuItems[i] = new MenuItem(popupMenu,SWT.PUSH);
+ menuItems[i].setText(labels[i].getMenuText());
+ menuItems[i].setImage(labels[i].getImage());
+ menuItems[i].setData(labels[i].associatedObject);
+ menuItems[i].addArmListener(new ArmListener() {
+ public void widgetArmed(ArmEvent e) {
+ Object data = ((MenuItem)e.getSource()).getData();
+ if( data instanceof MSAAProblem ) {
+ AccessibleObject object = ((MSAAProblem)data).getErrorObject();
+ if( null != object ) {
+ HighlightComposite.flashRectangle(object.getAccLocation());
+ }
+ }
+ }
+ });
+ menuItems[i].addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object data = ((MenuItem)e.getSource()).getData();
+ suppressLabelAdjust = true;
+ viewer.setSelection(new StructuredSelection(data));
+ suppressLabelAdjust = false;
+ }
+ });
+ }
+ popupMenu.setVisible(true);
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ MSAAProblemsView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ getSite().registerContextMenu(menuMgr, new AccessibleObjectSelectionProvider(){
+ public Object getSelectedAccessibleObject() {
+ return getSelectedItem();
+ }
+ });
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(showErrorAction);
+ manager.add(showWarningAction);
+ manager.add(showInformationAction);
+ manager.add(new Separator());
+ manager.add(showLabelsAction);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(refreshAction);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(refreshAction);
+ manager.add(showLabelsAction);
+ }
+
+ private void makeActions() {
+ final Shell shell = this.getViewSite().getShell();
+ refreshAction = new Action(Messages.getString("msaa.refresh")) { //$NON-NLS-1$
+ public void run() {
+ refresh();
+ }
+ };
+ refreshAction.setToolTipText(Messages.getString("msaa.refresh")); //$NON-NLS-1$
+ refreshAction.setImageDescriptor(GuiPlugin.IMAGE_REFRESH);
+
+ showLabelsAction = new Action(Messages.getString("msaa.show_problem"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ showOverlayLabels();
+ }
+ };
+ showLabelsAction.setToolTipText(Messages.getString("msaa.show_problem")); //$NON-NLS-1$
+ showLabelsAction.setImageDescriptor(GuiPlugin.IMAGE_OVERLAY);
+ shell.addShellListener(new ShellAdapter(){
+ public void shellActivated(ShellEvent e) {
+ if( MSAAViewRegistory.MSAAProblemsView_ID.equals(OverlayLabel.getOwnerId()) ) {
+ showOverlayLabels();
+ }
+ }
+ public void shellDeactivated(ShellEvent e) {
+ if( MSAAViewRegistory.MSAAProblemsView_ID.equals(OverlayLabel.getOwnerId()) ) {
+ OverlayLabel.removeAll(false);
+ }
+ }
+ });
+ showLabelsAction.setEnabled(GuiPreferenceManager.getPreferenceBoolean(GuiPreferenceConstants.UseOverlayWindow));
+ final IPreferenceStore store = GuiPreferenceManager.getPreferenceStore();
+ store.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if( GuiPreferenceConstants.UseOverlayWindow.equals(event.getProperty())) {
+ showLabelsAction.setEnabled(GuiPreferenceManager.getPreferenceBoolean(GuiPreferenceConstants.UseOverlayWindow));
+ }
+ }
+ });
+
+ showErrorAction = new Action(Messages.getString("msaa.showError"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ filter.categorySelect[MSAA_ERROR] = showErrorAction.isChecked();
+ refresh();
+ }
+ };
+ showErrorAction.setChecked(filter.categorySelect[MSAA_ERROR]);
+
+ showWarningAction = new Action(Messages.getString("msaa.showWarning"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ filter.categorySelect[MSAA_WARNING] = showWarningAction.isChecked();
+ refresh();
+ }
+ };
+ showWarningAction.setChecked(filter.categorySelect[MSAA_WARNING]);
+
+ showInformationAction = new Action(Messages.getString("msaa.showInformation"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ filter.categorySelect[MSAA_INFORMATION] = showInformationAction.isChecked();
+ refresh();
+ }
+ };
+ showInformationAction.setChecked(filter.categorySelect[MSAA_INFORMATION]);
+ }
+
+ private Object getSelectedItem() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ if (selection.size() == 1) {
+ Object element = selection.getFirstElement();
+ if( element instanceof MSAAProblem ) {
+ return ((MSAAProblem)element).getErrorObject();
+ }
+ }
+ return null;
+ }
+
+ private class MSAAProblemsContentAndLabelProvider extends LabelProvider implements IStructuredContentProvider,
+ IPropertyChangeListener, ITableLabelProvider {
+ ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof MSAAProblemChecker) {
+ return ((MSAAProblemChecker) inputElement).getProblems();
+ }
+ return new Object[0];
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (0 == columnIndex && element instanceof MSAAProblem) {
+ switch (((MSAAProblem) element).getErrorCategory()) {
+ case MSAA_ERROR:
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ case MSAA_WARNING:
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ case MSAA_INFORMATION:
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ }
+ }
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof MSAAProblem) {
+ MSAAProblem problem = (MSAAProblem) element;
+ AccessibleObject object = problem.getErrorObject();
+ switch (columnIndex) {
+ case 0:
+ return ""; //$NON-NLS-1$
+ case 1:
+ return ((MSAAProblem) element).getErrorDescription();
+ case 2:
+ if (null == object)
+ return ""; //$NON-NLS-1$
+ return object.getAccName();
+ case 3:
+ if (null == object)
+ return ""; //$NON-NLS-1$
+ return object.getRoleText();
+ case 4:
+ if (null == object)
+ return ""; //$NON-NLS-1$
+ return MSAA.getStateText(object.getAccState());
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ if (null == object)
+ return ""; //$NON-NLS-1$
+ Rectangle location = object.getAccLocation();
+ if (null == location)
+ return ""; //$NON-NLS-1$
+ switch (columnIndex - 5) {
+ case 0:
+ return Integer.toString(location.x);
+ case 1:
+ return Integer.toString(location.y);
+ case 2:
+ return Integer.toString(location.width);
+ case 3:
+ return Integer.toString(location.height);
+ }
+ default:
+ return "???"; //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+ }
+
+ private class MSAAProblemsViewerSorter extends ViewerSorter {
+ public int sortingColumn = 0;
+
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if (0 != sortingColumn && viewer instanceof TableViewer) {
+ IBaseLabelProvider labelProvider = ((TableViewer) viewer).getLabelProvider();
+ if (labelProvider instanceof ITableLabelProvider) {
+ int columnIndex = Math.abs(sortingColumn) - 1;
+ String s1 = ((ITableLabelProvider) labelProvider).getColumnText(e1, columnIndex);
+ String s2 = ((ITableLabelProvider) labelProvider).getColumnText(e2, columnIndex);
+ int result = 0;
+ switch (columnIndex) {
+ case 0:
+ result = ((MSAAProblem) e1).getErrorCategory() - ((MSAAProblem) e2).getErrorCategory();
+ break;
+ default:
+ try {
+ result = Integer.parseInt(s1) - Integer.parseInt(s2);
+ break;
+ } catch (Exception e) {
+ }
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ result = collator.compare(s1, s2);
+ break;
+ }
+ return sortingColumn > 0 ? result : -result;
+ }
+ }
+ return 0;
+ }
+
+ }
+
+ private class ProblemFilter extends ViewerFilter {
+
+ public boolean categorySelect[] = {false,true,false,false,false};
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if( element instanceof MSAAProblem ) {
+ int category = ((MSAAProblem)element).getErrorCategory();
+ if( category < categorySelect.length ) {
+ return categorySelect[category];
+ }
+ }
+ return true;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/Util.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/Util.java
new file mode 100644
index 0000000..addfd1e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/checker/Util.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.checker;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+
+public class Util {
+ public static String getRoleInfo(AccessibleObject ao) {
+ return ao.getAccRole() + " (" + ao.getRoleText() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public static AccessibleObject[] getVisibleChildren(AccessibleObject ao) {
+ if (ao == null)
+ return null;
+
+ AccessibleObject[] accChildren = ao.getChildren();
+ List<AccessibleObject> childList = new Vector<AccessibleObject>();
+ for (int i = 0; i < accChildren.length; i++) {
+ try {
+ int accState = accChildren[i].getAccState();
+ if (0 == (accState & MSAA.STATE_INVISIBLE)) {
+ childList.add(accChildren[i]);
+ }
+ } catch (Exception e) {
+ }
+ }
+ AccessibleObject[] vChildren = new AccessibleObject[childList.size()];
+ childList.toArray(vChildren);
+ return vChildren;
+ }
+
+ public static AccessibleObject getFirstVisibleChildren(AccessibleObject ao) {
+ if (ao == null)
+ return null;
+ AccessibleObject[] children = getVisibleChildren(ao);
+ if (children.length == 0)
+ return null;
+ return children[0];
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AbstractPropertyInvokeSource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AbstractPropertyInvokeSource.java
new file mode 100644
index 0000000..2f91337
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AbstractPropertyInvokeSource.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodInvokeDialog;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+
+public abstract class AbstractPropertyInvokeSource implements IPropertyInvoke {
+
+ private Map methodMap = new HashMap();
+
+ protected void addMethodData(Object id, MethodData methodData) {
+ methodMap.put(id, methodData);
+ }
+
+ private MethodData getMethodData(Object id) {
+ Object data = methodMap.get(id);
+ if( data instanceof MethodData ) {
+ return (MethodData)data;
+ }
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ MethodData methodData = getMethodData(id);
+ if( null != methodData ) {
+ return methodData.getResult();
+ }
+ return null;
+ }
+
+ public final boolean canInvoke(Object id) {
+ MethodData methodData = getMethodData(id);
+ if( null != methodData ) {
+ return methodData.canInvole();
+ }
+ return false;
+ }
+
+
+ public final boolean invoke(Object id, Shell shell) {
+ MethodData methodData = getMethodData(id);
+ if( null != methodData && methodData.canInvole() ) {
+ if( null != methodData.getTitle() ) {
+ Dialog dialog = new MethodInvokeDialog(shell,methodData);
+ if( Window.OK != dialog.open() ) {
+ return false;
+ }
+ }
+ methodData.invoke();
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/Accessible1PropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/Accessible1PropertySource.java
new file mode 100644
index 0000000..da74126
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/Accessible1PropertySource.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia1.MsaaDoDefaultActionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia1.MsaaSelectMethod;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class Accessible1PropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleObject accObject;
+
+ private static final String
+ PID_HANDLE = "HANDLE", //$NON-NLS-1$
+ PID_PARENT = "PARENT", //$NON-NLS-1$
+ PID_NAME = "NAME", //$NON-NLS-1$
+ PID_ROLE = "ROLE", //$NON-NLS-1$
+ PID_STATE = "STATE", //$NON-NLS-1$
+ PID_VALUE = "VALUE", //$NON-NLS-1$
+ PID_DESCRIPTION = "DESCRIPTION", //$NON-NLS-1$
+ PID_CHILDREN = "CHILDREN", //$NON-NLS-1$
+ PID_DEFAULTACTION = "DEFAULTACTION", //$NON-NLS-1$
+ PID_LOCATION = "LOCATION", //$NON-NLS-1$
+ PID_KEYBOARDSHORTCUT = "KEYBOARDSHORTCUT", //$NON-NLS-1$
+ PID_HELP ="HELP", //$NON-NLS-1$
+ PID_HELPTOPIC = "HELPTOPIC", //$NON-NLS-1$
+ PID_DO_DEFAULTACTION ="DO_DEFAULTACTION", //$NON-NLS-1$
+ PID_SELECT="SELECT"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_HANDLE,"Window Handle"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_PARENT,"Parent"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_NAME,"Name"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_ROLE,"Role"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_STATE,"State"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_VALUE,"Value"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_DESCRIPTION,"Description"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_CHILDREN,"Children"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_DEFAULTACTION,"DefaultAction"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_LOCATION,"Location"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_KEYBOARDSHORTCUT,"Keyboard Shortcut"),//$NON-NLS-1$
+ new PropertyDescriptor(PID_HELP,"Help"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_HELPTOPIC,"Help Topic") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_DO_DEFAULTACTION,"accDoDefaultAction"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_SELECT,"accSelect") //$NON-NLS-1$
+ };
+
+ public Accessible1PropertySource(AccessibleObject input) {
+ this.accObject = input;
+ addMethodData(PID_SELECT, new MsaaSelectMethod(accObject));
+ addMethodData(PID_DO_DEFAULTACTION, new MsaaDoDefaultActionMethod(accObject));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_HANDLE.equals(id) ) {
+ strValue = "0x"+Integer.toHexString(accObject.getWindow()); //$NON-NLS-1$
+ String wndClass = accObject.getClassName();
+ if (null!=wndClass && wndClass.length() > 0) {
+ strValue += " [" + wndClass + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ else if( PID_PARENT.equals(id) ) {
+ AccessibleObject pa = accObject.getCachedParent();
+ if (null != pa) {
+ strValue = pa.getAccName();
+ }
+ }
+ else if( PID_NAME.equals(id) ) {
+ strValue = accObject.getAccName();
+ }
+ else if( PID_ROLE.equals(id) ) {
+ int accRole = accObject.getRealAccRole();
+ strValue = accObject.getRealRoleText();
+ if( null != strValue ) {
+ strValue += " (0x"+Integer.toHexString(accRole)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ else if( PID_STATE.equals(id) ) {
+ int accState = accObject.getAccState();
+ strValue = MSAA.getStateText(accState);
+ if( null != strValue ) {
+ strValue += " (0x"+Integer.toHexString(accState)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ else if( PID_VALUE.equals(id) ) {
+ strValue = accObject.getAccValue();
+ }
+ else if( PID_DESCRIPTION.equals(id) ) {
+ strValue = accObject.getAccDescription();
+ }
+ else if( PID_CHILDREN.equals(id) ) {
+ strValue = Integer.toString(accObject.getChildCount());
+ }
+ else if( PID_DEFAULTACTION.equals(id) ) {
+ strValue = accObject.getAccDefaultAction();
+ }
+ else if( PID_LOCATION.equals(id) ) {
+ Rectangle rect = accObject.getAccLocation();
+ if( null!=rect ) {
+ strValue = rect.x + ", " + rect.y + ", " + (rect.x + rect.width) + ", " + (rect.y + rect.height) + " (width="+rect.width+", height="+rect.height+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ }
+ }
+ else if( PID_KEYBOARDSHORTCUT.equals(id) ) {
+ strValue = accObject.getAccKeyboardShortcut();
+ }
+ else if( PID_HELP.equals(id) ) {
+ strValue = accObject.getAccHelp();
+ }
+ else if( PID_HELPTOPIC.equals(id) ) {
+ int[] pIndex = new int[1];
+ String[] pFile = new String[1];
+ if (accObject.getAccHelpTopic(pIndex, pFile)) {
+ strValue = "Help Topic: Topic #" + pIndex[0]; //$NON-NLS-1$
+ if (null != pFile[0]) {
+ strValue += " in " + pFile[0]; //$NON-NLS-1$
+ }
+ }
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/Accessible2PropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/Accessible2PropertySource.java
new file mode 100644
index 0000000..e452e90
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/Accessible2PropertySource.java
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import java.util.Locale;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2.IA2ExtendedStatesMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2.IA2LocalizedExtendedStatesMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2.IA2RelationMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2.IA2RelationsMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2.IA2ScrollToMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2.IA2ScrollToPointMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class Accessible2PropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private Accessible2 accessible2;
+
+ private static final String
+ PID_IA2_nRelations = "nRelations", //$NON-NLS-1$
+ PID_IA2_relations = "relations", //$NON-NLS-1$
+ PID_IA2_relation = "relation", //$NON-NLS-1$
+ PID_IA2_role = "role", //$NON-NLS-1$
+ PID_IA2_groupPosition = "groupPosition", //$NON-NLS-1$
+ PID_IA2_states = "states", //$NON-NLS-1$
+ PID_IA2_extendedRole = "extendedRole", //$NON-NLS-1$
+ PID_IA2_localizedExtendedRole = "localizedExtendedRole", //$NON-NLS-1$
+ PID_IA2_nExtendedStates = "nExtendedStates", //$NON-NLS-1$
+ PID_IA2_extendedStates = "extendedStates", //$NON-NLS-1$
+ PID_IA2_localizedExtendedStates = "localizedExtendedStates", //$NON-NLS-1$
+ PID_IA2_uniqueID = "uniqueID", //$NON-NLS-1$
+ PID_IA2_windowHandle = "windowHandle", //$NON-NLS-1$
+ PID_IA2_indexInParent = "indexInParent", //$NON-NLS-1$
+ PID_IA2_locale = "locale", //$NON-NLS-1$
+ PID_IA2_attributes = "attributes", //$NON-NLS-1$
+ PID_IA2_scrollTo = "scrollTo", //$NON-NLS-1$
+ PID_IA2_scrollToPoint = "scrollToPoint"; //$NON-NLS-1$
+
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_nRelations,"nRelations"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_relations,"relations"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_role,"role"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_groupPosition,"groupPosition"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_states,"states"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_extendedRole,"extendedRole"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_localizedExtendedRole,"localizedExtendedRole"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_nExtendedStates,"nExtendedStates"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_extendedStates,"extendedStates"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_localizedExtendedStates,"localizedExtendedStates"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_uniqueID,"uniqueID"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_windowHandle,"windowHandle"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_indexInParent,"indexInParent"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_locale,"locale"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_attributes,"attributes") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_relation,"relation"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_scrollTo,"scrollTo"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_scrollToPoint,"scrollToPoint") //$NON-NLS-1$
+ };
+
+
+ public Accessible2PropertySource(Accessible2 input) {
+ this.accessible2 = input;
+ addMethodData(PID_IA2_scrollTo, new IA2ScrollToMethod(input));
+ addMethodData(PID_IA2_scrollToPoint, new IA2ScrollToPointMethod(input));
+ addMethodData(PID_IA2_relations, new IA2RelationsMethod(input));
+ addMethodData(PID_IA2_extendedStates, new IA2ExtendedStatesMethod(input));
+ addMethodData(PID_IA2_localizedExtendedStates, new IA2LocalizedExtendedStatesMethod(input));
+ addMethodData(PID_IA2_relation, new IA2RelationMethod(input));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_nRelations.equals(id) ) {
+ strValue = Integer.toString(accessible2.getAccessibleRelationCount());
+ }
+ else if( PID_IA2_role.equals(id) ) {
+ int ia2Role = accessible2.getAccessibleRole();
+ strValue = MSAA.getRoleText(ia2Role)+" (0x"+Integer.toHexString(ia2Role)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ else if( PID_IA2_groupPosition.equals(id) ) {
+ final int[] pos = accessible2.getGroupPosition();
+ if( null != pos ) {
+ AttributePropertySource attrSource = new AttributePropertySource(null,pos[0]+", "+pos[1]+" ,"+pos[2]); //$NON-NLS-1$ //$NON-NLS-2$
+ attrSource.put("GroupLevel", new Integer(pos[0])); //$NON-NLS-1$
+ attrSource.put("SimilarItemsInGroup", new Integer(pos[1])); //$NON-NLS-1$
+ attrSource.put("PositionInGroup", new Integer(pos[2])); //$NON-NLS-1$
+ return attrSource;
+ }
+ }
+ else if( PID_IA2_states.equals(id) ) {
+ int ia2States = accessible2.getStates();
+ strValue = "0x"+Integer.toHexString(ia2States); //$NON-NLS-1$
+ String[] strArray = IA2.getStateTextAsArray(ia2States);
+ if( strArray.length > 0 ) {
+ if( strArray.length > 1 ) {
+ return new ObjectArrayPropertySource(strArray,strValue);
+ }
+ strValue = strArray[0];
+ }
+ }
+ else if( PID_IA2_extendedRole.equals(id) ) {
+ strValue = accessible2.getExtendedRole();
+ }
+ else if( PID_IA2_localizedExtendedRole.equals(id) ) {
+ strValue = accessible2.getLocalizedExtendedRole();
+ }
+ else if( PID_IA2_nExtendedStates.equals(id) ) {
+ strValue = Integer.toString(accessible2.getExtendedStateCount());
+ }
+ else if( PID_IA2_uniqueID.equals(id) ) {
+ strValue = "0x"+Integer.toHexString(accessible2.getUniqueID()); //$NON-NLS-1$
+ }
+ else if( PID_IA2_windowHandle.equals(id) ) {
+ strValue = "0x"+Integer.toHexString(accessible2.getWindowHandle()); //$NON-NLS-1$
+ }
+ else if( PID_IA2_indexInParent.equals(id) ) {
+ strValue = Integer.toString(accessible2.getAccessibleIndexInParent());
+ }
+ else if( PID_IA2_locale.equals(id) ) {
+ Locale locale = accessible2.getLocale();
+ if( null != locale ) {
+ return new AttributePropertySource(
+ "Language:"+locale.getLanguage()+ //$NON-NLS-1$
+ ";Country:"+locale.getCountry()+ //$NON-NLS-1$
+ ";Variant:"+locale.getVariant(), //$NON-NLS-1$
+ locale.toString());
+ }
+ }
+ else if( PID_IA2_attributes.equals(id) ) {
+ strValue = accessible2.getAttributes();
+ if( null != strValue ) {
+ return new AttributePropertySource(strValue);
+ }
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleActionPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleActionPropertySource.java
new file mode 100644
index 0000000..d3df1b2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleActionPropertySource.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action.IA2ActionDescriptionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action.IA2ActionDoActionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action.IA2ActionKeybindingMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action.IA2ActionLocalizedNameMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action.IA2ActionNameMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleActionPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleAction accessibleAction;
+
+ private static final String
+ PID_IA2_ACTION_nAction = "nAction", //$NON-NLS-1$
+ PID_IA2_ACTION_doAction = "doAction", //$NON-NLS-1$
+ PID_IA2_ACTION_description = "description", //$NON-NLS-1$
+ PID_IA2_ACTION_keyBinding = "keyBinding", //$NON-NLS-1$
+ PID_IA2_ACTION_name = "name", //$NON-NLS-1$
+ PID_IA2_ACTION_localizedName = "localizedName"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_ACTION_nAction,"nAction"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_ACTION_description,"description"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_ACTION_keyBinding,"keyBinding"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_ACTION_name,"name"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_ACTION_localizedName,"localizedName") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_ACTION_doAction,"doAction"), //$NON-NLS-1$
+ };
+
+ public AccessibleActionPropertySource(AccessibleAction input) {
+ this.accessibleAction = input;
+ addMethodData(PID_IA2_ACTION_description, new IA2ActionDescriptionMethod(input));
+ addMethodData(PID_IA2_ACTION_keyBinding, new IA2ActionKeybindingMethod(input));
+ addMethodData(PID_IA2_ACTION_name, new IA2ActionNameMethod(input));
+ addMethodData(PID_IA2_ACTION_localizedName, new IA2ActionLocalizedNameMethod(input));
+ addMethodData(PID_IA2_ACTION_doAction, new IA2ActionDoActionMethod(input));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_ACTION_nAction.equals(id) ) {
+ strValue = Integer.toString(accessibleAction.getAccessibleActionCount());
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleApplicationPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleApplicationPropertySource.java
new file mode 100644
index 0000000..8591b7b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleApplicationPropertySource.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleApplication;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class AccessibleApplicationPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleApplication accessibleApplication;
+
+ private static final String
+ PID_IA2_APP_appName = "appName", //$NON-NLS-1$
+ PID_IA2_APP_appVersion = "appVersion", //$NON-NLS-1$
+ PID_IA2_APP_toolkitName = "toolkitName", //$NON-NLS-1$
+ PID_IA2_APP_toolkitVersion = "toolkitVersion"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_APP_appName,"appName"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_APP_appVersion,"appVersion"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_APP_toolkitName,"toolkitName"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_APP_toolkitVersion,"toolkitVersion") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleApplicationPropertySource(AccessibleApplication input) {
+ this.accessibleApplication = input;
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_APP_appName.equals(id) ) {
+ strValue = accessibleApplication.getApplicationName();
+ }
+ else if( PID_IA2_APP_appVersion.equals(id) ) {
+ strValue = accessibleApplication.getApplicationVersion();
+ }
+ else if( PID_IA2_APP_toolkitName.equals(id) ) {
+ strValue = accessibleApplication.getToolkitName();
+ }
+ else if( PID_IA2_APP_toolkitVersion.equals(id) ) {
+ strValue = accessibleApplication.getToolkitVersion();
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleComponentPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleComponentPropertySource.java
new file mode 100644
index 0000000..8e063e8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleComponentPropertySource.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleComponent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class AccessibleComponentPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleComponent accessibleComponent;
+
+ private static final String
+ PID_IA2_COMP_locationInParent = "locationInParent", //$NON-NLS-1$
+ PID_IA2_COMP_foreground = "foreground", //$NON-NLS-1$
+ PID_IA2_COMP_background = "background"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_COMP_locationInParent,"locationInParent"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_COMP_foreground,"foreground"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_COMP_background,"background") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleComponentPropertySource(AccessibleComponent input) {
+ this.accessibleComponent = input;
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_COMP_locationInParent.equals(id) ) {
+ Point location = accessibleComponent.getLocation();
+ if( null != location ) {
+ strValue = location.x +", "+location.y; //$NON-NLS-1$
+ }
+ }
+ else if( PID_IA2_COMP_foreground.equals(id) ) {
+ int value = accessibleComponent.getForeground();
+ strValue = value+" (0x"+Integer.toHexString(value)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ else if( PID_IA2_COMP_background.equals(id) ) {
+ int value = accessibleComponent.getBackground();
+ strValue = value+" (0x"+Integer.toHexString(value)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleEditableTextPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleEditableTextPropertySource.java
new file mode 100644
index 0000000..6e9a9e0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleEditableTextPropertySource.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextCopyTextMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextCutTextMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextDeleteTextMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextInsertTextMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextPasteTextMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextReplaceTextMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext.IA2EditableTextSetAttributesTextMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleEditableTextPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleEditableText accessibleEditableText;
+
+ private static final String
+ PID_IA2_EDITABLE_TEXT_copyText = "copyText", //$NON-NLS-1$
+ PID_IA2_EDITABLE_TEXT_deleteText = "deleteText", //$NON-NLS-1$
+ PID_IA2_EDITABLE_TEXT_insertText = "insertText", //$NON-NLS-1$
+ PID_IA2_EDITABLE_TEXT_cutText = "cutText", //$NON-NLS-1$
+ PID_IA2_EDITABLE_TEXT_pasteText = "pasteText", //$NON-NLS-1$
+ PID_IA2_EDITABLE_TEXT_replaceText = "replaceText", //$NON-NLS-1$
+ PID_IA2_EDITABLE_TEXT_setAttributes = "setAttributes"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_copyText,"copyText"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_deleteText,"deleteText"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_insertText,"insertText"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_cutText,"cutText"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_pasteText,"pasteText"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_replaceText,"replaceText"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_EDITABLE_TEXT_setAttributes,"setAttributes"), //$NON-NLS-1$
+ };
+
+ public AccessibleEditableTextPropertySource(AccessibleEditableText input, AccessibleText text) {
+ this.accessibleEditableText = input;
+ addMethodData(PID_IA2_EDITABLE_TEXT_copyText,new IA2EditableTextCopyTextMethod(input,text));
+ addMethodData(PID_IA2_EDITABLE_TEXT_deleteText,new IA2EditableTextDeleteTextMethod(input,text));
+ addMethodData(PID_IA2_EDITABLE_TEXT_insertText,new IA2EditableTextInsertTextMethod(input,text));
+ addMethodData(PID_IA2_EDITABLE_TEXT_cutText,new IA2EditableTextCutTextMethod(input,text));
+ addMethodData(PID_IA2_EDITABLE_TEXT_pasteText,new IA2EditableTextPasteTextMethod(input,text));
+ addMethodData(PID_IA2_EDITABLE_TEXT_replaceText,new IA2EditableTextReplaceTextMethod(input,text));
+ addMethodData(PID_IA2_EDITABLE_TEXT_setAttributes,new IA2EditableTextSetAttributesTextMethod(input,text));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleHyperlinkPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleHyperlinkPropertySource.java
new file mode 100644
index 0000000..f0c31a0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleHyperlinkPropertySource.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hyperlink.IA2HyperlinkAnchorMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hyperlink.IA2HyperlinkAnchorTargetMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleHyperlinkPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleHyperlink accessibleHyperlink;
+
+ private static final String
+ PID_IA2_HYPERLINK_anchor = "anchor", //$NON-NLS-1$
+ PID_IA2_HYPERLINK_anchorTarget = "anchorTarget", //$NON-NLS-1$
+ PID_IA2_HYPERLINK_startIndex = "startIndex", //$NON-NLS-1$
+ PID_IA2_HYPERLINK_endIndex = "endIndex", //$NON-NLS-1$
+ PID_IA2_HYPERLINK_valid = "valid"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_HYPERLINK_anchor,"anchor"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_HYPERLINK_anchorTarget,"anchorTarget"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_HYPERLINK_startIndex,"startIndex"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_HYPERLINK_endIndex,"endIndex"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_HYPERLINK_valid,"valid") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleHyperlinkPropertySource(AccessibleHyperlink input) {
+ this.accessibleHyperlink = input;
+ addMethodData(PID_IA2_HYPERLINK_anchor, new IA2HyperlinkAnchorMethod(input));
+ addMethodData(PID_IA2_HYPERLINK_anchorTarget, new IA2HyperlinkAnchorTargetMethod(input));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_HYPERLINK_startIndex.equals(id) ) {
+ strValue = Integer.toString(accessibleHyperlink.getStartIndex());
+ }
+ else if( PID_IA2_HYPERLINK_endIndex.equals(id) ) {
+ strValue = Integer.toString(accessibleHyperlink.getEndIndex());
+ }
+ else if( PID_IA2_HYPERLINK_valid.equals(id) ) {
+ strValue = Boolean.toString(accessibleHyperlink.isValid());
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleHypertextPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleHypertextPropertySource.java
new file mode 100644
index 0000000..7041345
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleHypertextPropertySource.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hypertext.IA2HypertextHyperlinkIndexMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hypertext.IA2HypertextHyperlinkMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleHypertextPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleHypertext accessibleHypertext;
+
+ private static final String
+ PID_IA2_HYPERTEXT_nHyperlinks = "nHyperlinks", //$NON-NLS-1$
+ PID_IA2_HYPERTEXT_hyperlink = "hyperlink", //$NON-NLS-1$
+ PID_IA2_HYPERTEXT_hyperlinkIndex = "hyperlinkIndex"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_HYPERTEXT_nHyperlinks,"nHyperlinks"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_HYPERTEXT_hyperlink,"hyperlink"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_HYPERTEXT_hyperlinkIndex,"hyperlinkIndex") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleHypertextPropertySource(AccessibleHypertext input, AccessibleText text) {
+ this.accessibleHypertext = input;
+ addMethodData(PID_IA2_HYPERTEXT_hyperlink, new IA2HypertextHyperlinkMethod(input));
+ addMethodData(PID_IA2_HYPERTEXT_hyperlinkIndex, new IA2HypertextHyperlinkIndexMethod(input,text));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_HYPERTEXT_nHyperlinks.equals(id) ) {
+ strValue = Integer.toString(accessibleHypertext.getHyperLinkCount());
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleImagePropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleImagePropertySource.java
new file mode 100644
index 0000000..783d754
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleImagePropertySource.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleImage;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2image.IA2ImagePositionMethod;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleImagePropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleImage accessibleImage;
+
+ private static final String
+ PID_IA2_IMAGE_description = "description", //$NON-NLS-1$
+ PID_IA2_IMAGE_imagePosition = "imagePosition", //$NON-NLS-1$
+ PID_IA2_IMAGE_imageSize = "imageSize"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_IMAGE_description,"description"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_IMAGE_imagePosition,"imagePosition"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_IMAGE_imageSize,"imageSize") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleImagePropertySource(AccessibleImage input) {
+ this.accessibleImage = input;
+ addMethodData(PID_IA2_IMAGE_imagePosition, new IA2ImagePositionMethod(input));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_IMAGE_description.equals(id) ) {
+ strValue = accessibleImage.getAccessibleImageDescription();
+ }
+ else if( PID_IA2_IMAGE_imageSize.equals(id) ) {
+ Point point = accessibleImage.getAccessibleImageSize();
+ if( null != point ) {
+ strValue = point.x+" x "+point.y; //$NON-NLS-1$
+ }
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleObjectPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleObjectPropertySource.java
new file mode 100644
index 0000000..d55414d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleObjectPropertySource.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleApplication;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleComponent;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleImage;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleValue;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class AccessibleObjectPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ public static final int MAX_CHILD_PROPERTIES = 100;
+
+ private List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
+
+ private Accessible1PropertySource accessible1PropertySource;
+ private Accessible2PropertySource accessible2PropertySource;
+ private AccessibleActionPropertySource accessibleActionPropertySource;
+ private AccessibleApplicationPropertySource accessibleApplicationPropertySource;
+ private AccessibleComponentPropertySource accessibleComponentPropertySource;
+ private AccessibleEditableTextPropertySource accessibleEditableTextPropertySource;
+ private AccessibleHyperlinkPropertySource accessibleHyperlinkPropertySource;
+ private AccessibleHypertextPropertySource accessibleHypertextPropertySource;
+ private AccessibleImagePropertySource accessibleImagePropertySource;
+ private AccessibleTablePropertySource accessibleTablePropertySource;
+ private AccessibleTextPropertySource accessibleTextPropertySource;
+ private AccessibleValuePropertySource accessibleValuePropertySource;
+
+ public static final String
+ PID_IA1 = "IA1", //$NON-NLS-1$
+ PID_IA2 = "IA2", //$NON-NLS-1$
+ PID_IA2Action = "IA2Action", //$NON-NLS-1$
+ PID_IA2Application = "IA2Application", //$NON-NLS-1$
+ PID_IA2Component = "IA2Component", //$NON-NLS-1$
+ PID_IA2EditableText = "IA2EditableText", //$NON-NLS-1$
+ PID_IA2Hyperlink = "IA2Hyperlink", //$NON-NLS-1$
+ PID_IA2Hypertext = "IA2Hypertext", //$NON-NLS-1$
+ PID_IA2Image = "IA2Image", //$NON-NLS-1$
+ PID_IA2Table = "IA2Table", //$NON-NLS-1$
+ PID_IA2Text = "IA2Text", //$NON-NLS-1$
+ PID_IA2Value = "IA2Value"; //$NON-NLS-1$
+
+ private static final String
+ STR_IA1 = "IAccessible", //$NON-NLS-1$
+ STR_IA2 = "IAccessible2", //$NON-NLS-1$
+ STR_IA2Action = "IAccessibleAction", //$NON-NLS-1$
+ STR_IA2Application = "IAccessibleApplication", //$NON-NLS-1$
+ STR_IA2Component = "IAccessibleComponent", //$NON-NLS-1$
+ STR_IA2EditableText = "IAccessibleEditableText", //$NON-NLS-1$
+ STR_IA2Hyperlink = "IAccessibleHyperlink", //$NON-NLS-1$
+ STR_IA2Hypertext = "IAccessibleHypertext", //$NON-NLS-1$
+ STR_IA2Image = "IAccessibleImage", //$NON-NLS-1$
+ STR_IA2Table = "IAccessibleTable", //$NON-NLS-1$
+ STR_IA2Text = "IAccessibleText", //$NON-NLS-1$
+ STR_IA2Value = "IAccessibleValue"; //$NON-NLS-1$
+
+ public AccessibleObjectPropertySource(AccessibleObject accObject) {
+ if( null != accObject) {
+ accessible1PropertySource = new Accessible1PropertySource(accObject);
+ descriptors.add(new PropertyDescriptor(PID_IA1,STR_IA1));
+ Accessible2 accessible2 = accObject.getAccessible2();
+ if( null != accessible2 ) {
+ accessible2PropertySource = new Accessible2PropertySource(accessible2);
+ descriptors.add(new PropertyDescriptor(PID_IA2,STR_IA2));
+ }
+ AccessibleAction accessibleAction = accObject.getAccessibleAction();
+ if( null != accessibleAction ) {
+ accessibleActionPropertySource = new AccessibleActionPropertySource(accessibleAction);
+ descriptors.add(new PropertyDescriptor(PID_IA2Action,STR_IA2Action));
+ }
+ AccessibleApplication accessibleApplication = accObject.getAccessibleApplication();
+ if( null != accessibleApplication ) {
+ accessibleApplicationPropertySource = new AccessibleApplicationPropertySource(accessibleApplication);
+ descriptors.add(new PropertyDescriptor(PID_IA2Application,STR_IA2Application));
+ }
+ AccessibleComponent accessibleComponent = accObject.getAccessibleComponent();
+ if( null != accessibleComponent ) {
+ accessibleComponentPropertySource = new AccessibleComponentPropertySource(accessibleComponent);
+ descriptors.add(new PropertyDescriptor(PID_IA2Component,STR_IA2Component));
+ }
+ AccessibleText accessibleText = accObject.getAccessibleText();
+ if( null != accessibleText ) {
+ accessibleTextPropertySource = new AccessibleTextPropertySource(accessibleText);
+ descriptors.add(new PropertyDescriptor(PID_IA2Text,STR_IA2Text));
+ }
+ AccessibleEditableText accessibleEditableText = accObject.getAccessibleEditableText();
+ if( null != accessibleEditableText ) {
+ accessibleEditableTextPropertySource = new AccessibleEditableTextPropertySource(accessibleEditableText,accessibleText);
+ descriptors.add(new PropertyDescriptor(PID_IA2EditableText,STR_IA2EditableText));
+ }
+ AccessibleHyperlink accessibleHyperlink = accObject.getAccessibleHyperlink();
+ if( null != accessibleHyperlink ) {
+ accessibleHyperlinkPropertySource = new AccessibleHyperlinkPropertySource(accessibleHyperlink);
+ descriptors.add(new PropertyDescriptor(PID_IA2Hyperlink,STR_IA2Hyperlink));
+ }
+ AccessibleHypertext accessibleHypertext = accObject.getAccessibleHypertext();
+ if( null != accessibleHypertext ) {
+ accessibleHypertextPropertySource = new AccessibleHypertextPropertySource(accessibleHypertext,accessibleText);
+ descriptors.add(new PropertyDescriptor(PID_IA2Hypertext,STR_IA2Hypertext));
+ }
+ AccessibleImage accessibleImage = accObject.getAccessibleImage();
+ if( null != accessibleImage ) {
+ accessibleImagePropertySource = new AccessibleImagePropertySource(accessibleImage);
+ descriptors.add(new PropertyDescriptor(PID_IA2Image,STR_IA2Image));
+ }
+ AccessibleTable accessibleTable = accObject.getAccessibleTable();
+ if( null != accessibleTable ) {
+ accessibleTablePropertySource = new AccessibleTablePropertySource(accessibleTable);
+ descriptors.add(new PropertyDescriptor(PID_IA2Table,STR_IA2Table));
+ }
+ AccessibleValue accessibleValue = accObject.getAccessibleValue();
+ if( null != accessibleValue ) {
+ accessibleValuePropertySource = new AccessibleValuePropertySource(accessibleValue);
+ descriptors.add(new PropertyDescriptor(PID_IA2Value,STR_IA2Value));
+ }
+ }
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return (IPropertyDescriptor[])descriptors.toArray(new IPropertyDescriptor[descriptors.size()]);
+ }
+
+ public Object getPropertyValue(Object id) {
+ if( PID_IA1.equals(id) ) {
+ return accessible1PropertySource;
+ }
+ else if( PID_IA2.equals(id) ) {
+ return accessible2PropertySource;
+ }
+ else if( PID_IA2Action.equals(id) ) {
+ return accessibleActionPropertySource;
+ }
+ else if( PID_IA2Application.equals(id) ) {
+ return accessibleApplicationPropertySource;
+ }
+ else if( PID_IA2Component.equals(id) ) {
+ return accessibleComponentPropertySource;
+ }
+ else if( PID_IA2EditableText.equals(id) ) {
+ return accessibleEditableTextPropertySource;
+ }
+ else if( PID_IA2Hyperlink.equals(id) ) {
+ return accessibleHyperlinkPropertySource;
+ }
+ else if( PID_IA2Hypertext.equals(id) ) {
+ return accessibleHypertextPropertySource;
+ }
+ else if( PID_IA2Image.equals(id) ) {
+ return accessibleImagePropertySource;
+ }
+ else if( PID_IA2Table.equals(id) ) {
+ return accessibleTablePropertySource;
+ }
+ else if( PID_IA2Text.equals(id) ) {
+ return accessibleTextPropertySource;
+ }
+ else if( PID_IA2Value.equals(id) ) {
+ return accessibleValuePropertySource;
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleObjectPropertySourceAdapterFactory.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleObjectPropertySourceAdapterFactory.java
new file mode 100644
index 0000000..18e036a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleObjectPropertySourceAdapterFactory.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+
+public class AccessibleObjectPropertySourceAdapterFactory implements IAdapterFactory {
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if( IPropertySource.class == adapterType ) {
+ if( adaptableObject instanceof AccessibleObject ) {
+ return new AccessibleObjectPropertySource((AccessibleObject)adaptableObject);
+ }
+ }
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ return new Class[] {IPropertySource.class };
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleRelationPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleRelationPropertySource.java
new file mode 100644
index 0000000..841f551
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleRelationPropertySource.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleRelation;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class AccessibleRelationPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleRelation accessibleRelation;
+
+ private static final String
+ PID_IA2_RELATION_relationType = "relationType", //$NON-NLS-1$
+ PID_IA2_RELATION_localizedRelationType = "localizedRelationType", //$NON-NLS-1$
+ PID_IA2_RELATION_nTarget = "nTarget", //$NON-NLS-1$
+ PID_IA2_RELATION_targets = "targets"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_RELATION_relationType,"relationType"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_RELATION_localizedRelationType,"localizedRelationType"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_RELATION_nTarget,"nTarget"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_RELATION_targets,"targets"), //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleRelationPropertySource(AccessibleRelation accessibleRelation) {
+ this.accessibleRelation = accessibleRelation;
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_RELATION_relationType.equals(id)) {
+ strValue = accessibleRelation.getRelationType();
+ }
+ else if( PID_IA2_RELATION_localizedRelationType.equals(id) ) {
+ strValue = accessibleRelation.getLocalizedRelationType();
+ }
+ else if( PID_IA2_RELATION_nTarget.equals(id) ) {
+ strValue = Integer.toString(accessibleRelation.getTargetCount());
+ }
+ else if( PID_IA2_RELATION_targets.equals(id) ) {
+ AccessibleObject[] targets = accessibleRelation.getTargets(AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES); // TODO: use MethodData
+ if( null != targets ) {
+ return new ObjectArrayPropertySource(targets);
+ }
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleTablePropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleTablePropertySource.java
new file mode 100644
index 0000000..3395d24
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleTablePropertySource.java
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableAccessibleAtMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableChildIndexMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableColumnDescriptionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableColumnExtentAtMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableColumnIndexMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableIsColumnSelectedMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableIsRowSelectedMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableIsSelectedMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableRowColumnExtentsAtIndexMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableRowDescriptionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableRowExtentAtMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableRowIndexMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableSelectColumnMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableSelectRowMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableSelectedChildrenMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableSelectedColumnsMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableSelectedRowsMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableUnselectColumnMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table.IA2TableUnselectRowMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleTablePropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleTable accessibleTable;
+
+ private static final String
+ PID_IA2_TABLE_nRows = "nRows", //$NON-NLS-1$
+ PID_IA2_TABLE_nColumns = "nColumns", //$NON-NLS-1$
+ PID_IA2_TABLE_nSelectedChildren = "nSelectedChildren", //$NON-NLS-1$
+ PID_IA2_TABLE_nSelectedRows = "nSelectedRows", //$NON-NLS-1$
+ PID_IA2_TABLE_nSelectedColumns = "nSelectedColumns", //$NON-NLS-1$
+ PID_IA2_TABLE_selectedChildren = "selectedChildren", //$NON-NLS-1$
+ PID_IA2_TABLE_selectedRows = "selectedRows", //$NON-NLS-1$
+ PID_IA2_TABLE_selectedColumns = "selectedColumns", //$NON-NLS-1$
+ PID_IA2_TABLE_caption = "caption", //$NON-NLS-1$
+ PID_IA2_TABLE_summary = "summary", //$NON-NLS-1$
+ PID_IA2_TABLE_accessibleAt = "accessibleAt", //$NON-NLS-1$
+ PID_IA2_TABLE_childIndex = "childIndex", //$NON-NLS-1$
+ PID_IA2_TABLE_columnDescription = "columnDescription", //$NON-NLS-1$
+ PID_IA2_TABLE_columnExtentAt = "columnExtentAt", //$NON-NLS-1$
+ PID_IA2_TABLE_columnHeader = "columnHeader", //$NON-NLS-1$
+ PID_IA2_TABLE_columnIndex = "columnIndex", //$NON-NLS-1$
+ PID_IA2_TABLE_rowDescription = "rowDescription", //$NON-NLS-1$
+ PID_IA2_TABLE_rowExtentAt = "rowExtentAt", //$NON-NLS-1$
+ PID_IA2_TABLE_rowHeader = "rowHeader", //$NON-NLS-1$
+ PID_IA2_TABLE_rowIndex = "rowIndex", //$NON-NLS-1$
+ PID_IA2_TABLE_isColumnSelected = "isColumnSelected", //$NON-NLS-1$
+ PID_IA2_TABLE_isRowSelected = "isRowSelected", //$NON-NLS-1$
+ PID_IA2_TABLE_isSelected = "isSelected", //$NON-NLS-1$
+ PID_IA2_TABLE_selectColumn = "selectColumn", //$NON-NLS-1$
+ PID_IA2_TABLE_unselectColumn = "unselectColumn", //$NON-NLS-1$
+ PID_IA2_TABLE_selectRow = "selectRow", //$NON-NLS-1$
+ PID_IA2_TABLE_unselectRow = "unselectRow", //$NON-NLS-1$
+ PID_IA2_TABLE_rowColumnExtentsAtIndex = "rowColumnExtentsAtIndex"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_TABLE_nRows,"nRows"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_nColumns,"nColumns"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_nSelectedChildren,"nSelectedChildren"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_nSelectedRows,"nSelectedRows"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_nSelectedColumns,"nSelectedColumns"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_selectedChildren,"selectedChildren"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_selectedRows,"selectedRows"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_selectedColumns,"selectedColumns"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_caption,"caption"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_summary,"summary"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_columnHeader,"columnHeader"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_rowHeader,"rowHeader"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_rowIndex,"rowIndex"), //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_TABLE_accessibleAt,"accessibleAt"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_childIndex,"childIndex"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_columnDescription,"columnDescription"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_columnExtentAt,"columnExtentAt"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_columnIndex,"columnIndex"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_rowDescription,"rowDescription"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_rowExtentAt,"rowExtentAt"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_rowColumnExtentsAtIndex,"rowColumnExtentsAtIndex"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_isColumnSelected,"isColumnSelected"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_isRowSelected,"isRowSelected"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_isSelected,"isSelected"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_selectRow,"selectRow"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_selectColumn,"selectColumn"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_unselectRow,"unselectRow"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TABLE_unselectColumn,"unselectColumn") //$NON-NLS-1$
+ };
+
+ public AccessibleTablePropertySource(AccessibleTable input) {
+ this.accessibleTable = input;
+ addMethodData(PID_IA2_TABLE_accessibleAt, new IA2TableAccessibleAtMethod(input));
+ addMethodData(PID_IA2_TABLE_childIndex, new IA2TableChildIndexMethod(input));
+ addMethodData(PID_IA2_TABLE_columnDescription, new IA2TableColumnDescriptionMethod(input));
+ addMethodData(PID_IA2_TABLE_columnExtentAt, new IA2TableColumnExtentAtMethod(input));
+ addMethodData(PID_IA2_TABLE_columnIndex, new IA2TableColumnIndexMethod(input));
+ addMethodData(PID_IA2_TABLE_rowDescription, new IA2TableRowDescriptionMethod(input));
+ addMethodData(PID_IA2_TABLE_rowExtentAt, new IA2TableRowExtentAtMethod(input));
+ addMethodData(PID_IA2_TABLE_rowIndex, new IA2TableRowIndexMethod(input));
+ addMethodData(PID_IA2_TABLE_isColumnSelected, new IA2TableIsColumnSelectedMethod(input));
+ addMethodData(PID_IA2_TABLE_isRowSelected, new IA2TableIsRowSelectedMethod(input));
+ addMethodData(PID_IA2_TABLE_isSelected, new IA2TableIsSelectedMethod(input));
+ addMethodData(PID_IA2_TABLE_rowColumnExtentsAtIndex, new IA2TableRowColumnExtentsAtIndexMethod(input));
+ addMethodData(PID_IA2_TABLE_selectRow, new IA2TableSelectRowMethod(input));
+ addMethodData(PID_IA2_TABLE_selectColumn, new IA2TableSelectColumnMethod(input));
+ addMethodData(PID_IA2_TABLE_unselectRow, new IA2TableUnselectRowMethod(input));
+ addMethodData(PID_IA2_TABLE_unselectColumn, new IA2TableUnselectColumnMethod(input));
+ addMethodData(PID_IA2_TABLE_selectedChildren, new IA2TableSelectedChildrenMethod(input));
+ addMethodData(PID_IA2_TABLE_selectedColumns, new IA2TableSelectedColumnsMethod(input));
+ addMethodData(PID_IA2_TABLE_selectedRows, new IA2TableSelectedRowsMethod(input));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_TABLE_nRows.equals(id) ) {
+ strValue = Integer.toString(accessibleTable.getAccessibleRowCount());
+ }
+ else if( PID_IA2_TABLE_nColumns.equals(id) ) {
+ strValue = Integer.toString(accessibleTable.getAccessibleColumnCount());
+ }
+ else if( PID_IA2_TABLE_nSelectedChildren.equals(id) ) {
+ strValue = Integer.toString(accessibleTable.getSelectedAccessibleChildCount());
+ }
+ else if( PID_IA2_TABLE_nSelectedRows.equals(id) ) {
+ strValue = Integer.toString(accessibleTable.getSelectedAccessibleRowCount());
+ }
+ else if( PID_IA2_TABLE_nSelectedColumns.equals(id) ) {
+ strValue = Integer.toString(accessibleTable.getSelectedAccessibleColumnCount());
+ }
+ else if( PID_IA2_TABLE_caption.equals(id) ) {
+ Object accObject = accessibleTable.getAccessibleCaption();
+ if( null != accObject ) {
+ strValue = accObject.toString();
+ if( accObject instanceof AccessibleObject ) {
+ try {
+ ((AccessibleObject)accObject).dispose();
+ }
+ catch(Exception e) {
+ }
+ }
+ }
+ }
+ else if( PID_IA2_TABLE_summary.equals(id) ) {
+ Object accObject = accessibleTable.getAccessibleSummary();
+ if( null != accObject ) {
+ strValue = accObject.toString();
+ if( accObject instanceof AccessibleObject ) {
+ try {
+ ((AccessibleObject)accObject).dispose();
+ }
+ catch(Exception e) {
+ }
+ }
+ }
+ }
+ else if( PID_IA2_TABLE_columnHeader.equals(id) ) {
+ final int startingRowIndex[] = new int[1];
+ AccessibleTable accTable = accessibleTable.getAccessibleColumnHeaders(startingRowIndex);
+ if( null != accTable ) {
+ return new AccessibleTablePropertySource(accTable){
+ public Object getEditableValue() {
+ return "startingRowIndex="+startingRowIndex[0]; //$NON-NLS-1$
+ }
+ };
+ }
+ }
+ else if( PID_IA2_TABLE_rowHeader.equals(id) ) {
+ final int startingColumnIndex[] = new int[1];
+ AccessibleTable accTable = accessibleTable.getAccessibleRowHeaders(startingColumnIndex);
+ if( null != accTable ) {
+ return new AccessibleTablePropertySource(accTable){
+ public Object getEditableValue() {
+ return "startingColumnIndex="+startingColumnIndex[0]; //$NON-NLS-1$
+ }
+ };
+ }
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleTextPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleTextPropertySource.java
new file mode 100644
index 0000000..6f6e32b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleTextPropertySource.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextAddSelectionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextAttributesMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextCharacterExtentsMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextOffsetAtPointMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextRemoveSelectionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextScrollSubstringToMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextScrollSubstringToPointMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextSelectionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextSetCaretOffsetMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextSetSelectionMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextTextAfterOffsetMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextTextAtOffsetMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextTextBeforeOffsetMethod;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text.IA2TextTextMethod;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+
+public class AccessibleTextPropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleText accessibleText;
+
+ private static final String
+ PID_IA2_TEXT_caretOffset = "caretOffset", //$NON-NLS-1$
+ PID_IA2_TEXT_characterExtents = "characterExtents", //$NON-NLS-1$
+ PID_IA2_TEXT_nSelections = "nSelections", //$NON-NLS-1$
+ PID_IA2_TEXT_nCharacters = "nCharacters", //$NON-NLS-1$
+ PID_IA2_TEXT_attributes = "attributes", //$NON-NLS-1$
+ PID_IA2_TEXT_addSelection = "addSelection", //$NON-NLS-1$
+ PID_IA2_TEXT_offsetAtPoint = "offsetAtPoint", //$NON-NLS-1$
+ PID_IA2_TEXT_selection = "selection", //$NON-NLS-1$
+ PID_IA2_TEXT_text = "text", //$NON-NLS-1$
+ PID_IA2_TEXT_textBeforeOffset = "textBeforeOffset", //$NON-NLS-1$
+ PID_IA2_TEXT_textAfterOffset = "textAfterOffset", //$NON-NLS-1$
+ PID_IA2_TEXT_textAtOffset = "textAtOffset", //$NON-NLS-1$
+ PID_IA2_TEXT_removeSelection = "removeSelection", //$NON-NLS-1$
+ PID_IA2_TEXT_setCaretOffset = "setCaretOffset", //$NON-NLS-1$
+ PID_IA2_TEXT_setSelection = "setSelection", //$NON-NLS-1$
+ PID_IA2_TEXT_scrollSubstringTo = "scrollSubstringTo", //$NON-NLS-1$
+ PID_IA2_TEXT_scrollSubstringToPoint = "scrollSubstringToPoint"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_TEXT_caretOffset,"caretOffset"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_characterExtents,"characterExtents"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_nSelections,"nSelections"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_nCharacters,"nCharacters"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_attributes,"attributes"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_text,"text"), //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_TEXT_addSelection,"addSelection"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_removeSelection,"removeSelection"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_setCaretOffset,"setCaretOffset"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_setSelection,"setSelection"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_offsetAtPoint,"offsetAtPoint"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_selection,"selection"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_textBeforeOffset,"textBeforeOffset"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_textAfterOffset,"textAfterOffset"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_textAtOffset,"textAtOffset"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_scrollSubstringTo,"scrollSubstringTo"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_TEXT_scrollSubstringToPoint,"scrollSubstringToPoint"), //$NON-NLS-1$
+ };
+
+ public AccessibleTextPropertySource(AccessibleText input) {
+ this.accessibleText = input;
+ addMethodData(PID_IA2_TEXT_attributes, new IA2TextAttributesMethod(input));
+ addMethodData(PID_IA2_TEXT_characterExtents, new IA2TextCharacterExtentsMethod(input));
+ addMethodData(PID_IA2_TEXT_addSelection, new IA2TextAddSelectionMethod(input));
+ addMethodData(PID_IA2_TEXT_offsetAtPoint, new IA2TextOffsetAtPointMethod(input));
+ addMethodData(PID_IA2_TEXT_removeSelection, new IA2TextRemoveSelectionMethod(input));
+ addMethodData(PID_IA2_TEXT_scrollSubstringTo, new IA2TextScrollSubstringToMethod(input));
+ addMethodData(PID_IA2_TEXT_scrollSubstringToPoint, new IA2TextScrollSubstringToPointMethod(input));
+ addMethodData(PID_IA2_TEXT_selection, new IA2TextSelectionMethod(input));
+ addMethodData(PID_IA2_TEXT_setCaretOffset, new IA2TextSetCaretOffsetMethod(input));
+ addMethodData(PID_IA2_TEXT_setSelection, new IA2TextSetSelectionMethod(input));
+ addMethodData(PID_IA2_TEXT_text, new IA2TextTextMethod(input));
+ addMethodData(PID_IA2_TEXT_textAfterOffset, new IA2TextTextAfterOffsetMethod(input));
+ addMethodData(PID_IA2_TEXT_textAtOffset, new IA2TextTextAtOffsetMethod(input));
+ addMethodData(PID_IA2_TEXT_textBeforeOffset, new IA2TextTextBeforeOffsetMethod(input));
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ String strValue = null;
+ if( PID_IA2_TEXT_caretOffset.equals(id) ) {
+ strValue = Integer.toString(accessibleText.getCaretPosition());
+ }
+ else if( PID_IA2_TEXT_nSelections.equals(id) ) {
+ strValue = Integer.toString(accessibleText.getSelectionCount());
+ }
+ else if( PID_IA2_TEXT_nCharacters.equals(id) ) {
+ strValue = Integer.toString(accessibleText.getCharacterCount());
+ }
+ return null==strValue ? "null" : strValue; //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleValuePropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleValuePropertySource.java
new file mode 100644
index 0000000..459fd14
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AccessibleValuePropertySource.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleValue;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class AccessibleValuePropertySource extends AbstractPropertyInvokeSource implements IPropertySource {
+
+ private AccessibleValue accessibleValue;
+
+ private static final String
+ PID_IA2_VALUE_currentValue = "currentValue", //$NON-NLS-1$
+ PID_IA2_VALUE_maximumValue = "maximumValue", //$NON-NLS-1$
+ PID_IA2_VALUE_minimumValue = "minimumValue"; //$NON-NLS-1$
+
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[]
+ {
+ new PropertyDescriptor(PID_IA2_VALUE_currentValue,"currentValue"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_VALUE_maximumValue,"maximumValue"), //$NON-NLS-1$
+ new PropertyDescriptor(PID_IA2_VALUE_minimumValue,"minimumValue") //$NON-NLS-1$
+ };
+ private static final IPropertyDescriptor[] descriptorsEx = new IPropertyDescriptor[] {};
+
+ public AccessibleValuePropertySource(AccessibleValue input) {
+ this.accessibleValue = input;
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra() {
+ return descriptorsEx;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object result = super.getPropertyValue(id);
+ if( null != result ) {
+ return result;
+ }
+ Object var = null;
+ if( PID_IA2_VALUE_currentValue.equals(id) ) {
+ var = accessibleValue.getCurrentValue();
+ }
+ else if( PID_IA2_VALUE_maximumValue.equals(id) ) {
+ var = accessibleValue.getMaximumValue();
+ }
+ else if( PID_IA2_VALUE_minimumValue.equals(id) ) {
+ var = accessibleValue.getMinimumValue();
+ }
+ return null==var ? "null" : var.toString(); //$NON-NLS-1$
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AttributePropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AttributePropertySource.java
new file mode 100644
index 0000000..d0f07b1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/AttributePropertySource.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class AttributePropertySource implements IPropertySource {
+
+ private Map attrMap = new LinkedHashMap();
+ private String attributes;
+ private String editableText;
+
+ public AttributePropertySource(String attributes) {
+ this.attributes = attributes;
+ if( null != attributes ) {
+ StringTokenizer st = new StringTokenizer(attributes,";"); //$NON-NLS-1$
+ while( st.hasMoreTokens() ) {
+ String name = st.nextToken();
+ String value = null;
+ int sep = name.indexOf(':');
+ if( sep > 0 ) {
+ value = name.substring(sep+1).trim();
+ name = name.substring(0,sep).trim();
+ }
+ put(name, value);
+ }
+ }
+ }
+ public AttributePropertySource(String attributes, String editableText) {
+ this(attributes);
+ this.editableText = editableText;
+ }
+
+ public void put(Object key, Object value) {
+ attrMap.put(key, value);
+ }
+
+ public Object getEditableValue() {
+ if( null != editableText ) {
+ return editableText;
+ }
+ return attributes;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
+ for( Iterator it = attrMap.keySet().iterator(); it.hasNext(); ) {
+ Object name = it.next();
+ descriptors.add(new PropertyDescriptor(name,(String)name));
+ }
+ return descriptors.toArray(new IPropertyDescriptor[descriptors.size()]);
+ }
+
+ public Object getPropertyValue(Object id) {
+ return attrMap.get(id);
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/IPropertyInvoke.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/IPropertyInvoke.java
new file mode 100644
index 0000000..c72515c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/IPropertyInvoke.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+public interface IPropertyInvoke {
+
+ public IPropertyDescriptor[] getPropertyDescriptorsExtra();
+
+ public boolean invoke(Object id, Shell shell);
+
+ public boolean canInvoke(Object id);
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/ObjectArrayPropertySource.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/ObjectArrayPropertySource.java
new file mode 100644
index 0000000..86bb22d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/ObjectArrayPropertySource.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleRelation;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class ObjectArrayPropertySource implements IPropertySource {
+
+ private Object[] objArray;
+ private String editableText;
+
+ public ObjectArrayPropertySource(Object[] strArray) {
+ objArray = strArray;
+ }
+
+ public ObjectArrayPropertySource(Object[] strArray, String editableText) {
+ this(strArray);
+ this.editableText = editableText;
+ }
+
+ public ObjectArrayPropertySource(int[] intArray) {
+ objArray = new Object[intArray.length];
+ for( int i=0; i<intArray.length; i++ ) {
+ objArray[i] = new Integer(intArray[i]);
+ }
+ }
+
+ public ObjectArrayPropertySource(int[] intArray, String editableText) {
+ this(intArray);
+ this.editableText = editableText;
+ }
+
+ public Object getEditableValue() {
+ if( null != editableText ) {
+ return editableText;
+ }
+ return objectArrayToString(objArray);
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ IPropertyDescriptor[] descriptors = new IPropertyDescriptor[objArray.length];
+ for( int i=0; i<objArray.length; i++ ) {
+ descriptors[i] = new PropertyDescriptor(new Integer(i),"["+i+"]"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return descriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if( id instanceof Integer ) {
+ Object obj = objArray[((Integer)id).intValue()];
+ if( obj instanceof AccessibleObject ) {
+ return new AccessibleObjectPropertySource((AccessibleObject)obj);
+ }
+ else if( obj instanceof AccessibleRelation ) {
+ return new AccessibleRelationPropertySource((AccessibleRelation)obj);
+ }
+ return obj.toString();
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+ private static String objectArrayToString(Object[] objArray) {
+ String strRet = null;
+ if( null != objArray ) {
+ for( int i=0; i<objArray.length; i++ ) {
+ if( i==0 ) {
+ strRet = ""; //$NON-NLS-1$
+ }
+ else {
+ strRet += "; "; //$NON-NLS-1$
+ }
+ strRet += /*"#"+i+": "+*/objArray[i]; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return strRet;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractEnumIntegerField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractEnumIntegerField.java
new file mode 100644
index 0000000..94662ca
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractEnumIntegerField.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+
+public abstract class AbstractEnumIntegerField extends AbstractInputField {
+
+ private int currValue;
+ private Combo comboField;
+ private Object[][] labelsAndValues = getLabelsAndValues();
+
+
+ public AbstractEnumIntegerField(String labelText, int initValue) {
+ super(labelText);
+ this.currValue = initValue;
+ }
+
+ public int getIntValue() {
+ return currValue;
+ }
+
+ protected void createControl(Composite parent) {
+ comboField = new Combo(parent,SWT.DROP_DOWN | SWT.SIMPLE | SWT.BORDER | SWT.READ_ONLY);
+ comboField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ comboField.setFont(parent.getFont());
+ Integer intVal = new Integer(currValue);
+ for( int i=0; i<labelsAndValues.length; i++ ) {
+ comboField.add(labelsAndValues[i][0].toString(), i);
+ if( intVal.equals(labelsAndValues[i][1]) ) {
+ comboField.select(i);
+ }
+ }
+ comboField.addModifyListener(this);
+ }
+
+ public boolean update() {
+ if( null != comboField ) {
+ int index = comboField.getSelectionIndex();
+ if( index >= 0 ) {
+ if( labelsAndValues[index][1] instanceof Integer ) {
+ currValue = ((Integer)labelsAndValues[index][1]).intValue();
+ }
+ }
+ }
+ return false;
+ }
+
+ protected abstract Object[][] getLabelsAndValues();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractFlagIntegerField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractFlagIntegerField.java
new file mode 100644
index 0000000..e3919e6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractFlagIntegerField.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+public abstract class AbstractFlagIntegerField extends AbstractInputField {
+
+ private int currValue;
+ CheckboxTableViewer viewer;
+
+ public AbstractFlagIntegerField(String labelText,int initValue) {
+ super(labelText);
+ this.currValue = initValue;
+ }
+
+ public int getIntValue() {
+ return currValue;
+ }
+
+ protected void createControl(Composite parent) {
+ viewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
+ viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.getTable().setFont(parent.getFont());
+ viewer.setContentProvider(new IStructuredContentProvider(){
+ public Object[] getElements(Object inputElement) {
+ if( inputElement instanceof Object[][] ) {
+ return (Object[])inputElement;
+ }
+ return null;
+ }
+ public void dispose() {
+ }
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ });
+ viewer.setLabelProvider(new LabelProvider(){
+ public String getText(Object element) {
+ if( element instanceof Object[] ) {
+ return ((Object[])element)[0].toString();
+ }
+ return super.getText(element);
+ }
+ });
+ Object[][] input = getLabelsAndValues();
+ viewer.setInput(input);
+ for( int i=0; i<input.length; i++ ) {
+ int flag = ((Integer)(input[i][1])).intValue();
+ boolean state = (flag==currValue) || (0 != (flag&currValue));
+ viewer.setChecked(input[i], state);
+ }
+ }
+
+ protected abstract Object[][] getLabelsAndValues();
+
+ public boolean update() {
+ if( null != viewer ) {
+ currValue = 0;
+ Object[] checked = viewer.getCheckedElements();
+ for( int i=0; i<checked.length; i++ ) {
+ currValue |= ((Integer)((Object[])(checked[i]))[1]).intValue();
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractInputField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractInputField.java
new file mode 100644
index 0000000..97454cf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractInputField.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+
+public abstract class AbstractInputField implements ModifyListener {
+
+ private ModifyListener listener;
+ private String labelText;
+ protected Label label;
+ public static final Color ERROR_COLOR = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
+ public static final Color NORMAL_COLOR = null;
+
+ public AbstractInputField(String labelText) {
+ this.labelText = labelText;
+ }
+
+ public void setModifyListener(ModifyListener listener) {
+ this.listener = listener;
+ }
+
+ public void modifyText(ModifyEvent e) {
+ if( null != listener ) {
+ listener.modifyText(e);
+ }
+ }
+
+ public final String getLabelText() {
+ return labelText;
+ }
+
+ public void createLabelAndControl(Composite parent) {
+ label = new Label(parent,SWT.NONE);
+ label.setText(labelText+":"); //$NON-NLS-1$
+ createControl(parent);
+ }
+
+ public boolean validate() {
+ boolean valid = validateControl();
+ if( null != label ) {
+ if( valid ) {
+ label.setForeground(NORMAL_COLOR);
+ label.setText(labelText+":"); //$NON-NLS-1$
+ }
+ else {
+ label.setForeground(ERROR_COLOR);
+ label.setText("*"+labelText+":"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ label.getParent().layout();
+ }
+ return valid;
+ }
+
+ public boolean update() {
+ return true;
+ }
+
+ protected boolean validateControl() {
+ return true;
+ }
+
+ abstract protected void createControl(Composite parent);
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractStringField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractStringField.java
new file mode 100644
index 0000000..a9ea859
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/AbstractStringField.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+public abstract class AbstractStringField extends AbstractInputField {
+
+ private Text textField;
+ private String curText;
+
+
+ public AbstractStringField(String labelText) {
+ this(labelText,null);
+ }
+
+ public AbstractStringField(String labelText,String initText) {
+ super(labelText);
+ this.curText = initText;
+ }
+
+ protected void createControl(Composite parent) {
+ textField = new Text(parent,SWT.SINGLE | SWT.BORDER);
+ textField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ textField.setFont(parent.getFont());
+ textField.setText(getStringValue());
+ textField.addModifyListener(this);
+ }
+
+ protected String getText() {
+ if( null != textField ) {
+ return textField.getText();
+ }
+ return null;
+ }
+
+ protected String getStringValue() {
+ return curText;
+ }
+
+ protected boolean validateControl() {
+ return null != getText();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/ActionIndexField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/ActionIndexField.java
new file mode 100644
index 0000000..553cddb
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/ActionIndexField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+
+
+
+public class ActionIndexField extends IntegerField {
+
+ private AccessibleAction accessibleAction;
+
+ public ActionIndexField(String labelText, int initValue,AccessibleAction accessibleACtion) {
+ super(labelText,initValue,0);
+ this.accessibleAction = accessibleACtion;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleAction ) {
+ maxValue = accessibleAction.getAccessibleActionCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/HypertextHyperlinkIndexField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/HypertextHyperlinkIndexField.java
new file mode 100644
index 0000000..ed150dc
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/HypertextHyperlinkIndexField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+
+
+
+public class HypertextHyperlinkIndexField extends IntegerField {
+
+ private AccessibleHypertext accessibleHypertext;
+
+ public HypertextHyperlinkIndexField(String labelText, int initValue,AccessibleHypertext accessibleHypertext) {
+ super(labelText,initValue,0);
+ this.accessibleHypertext = accessibleHypertext;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleHypertext ) {
+ maxValue = accessibleHypertext.getHyperLinkCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2CoordTypeField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2CoordTypeField.java
new file mode 100644
index 0000000..2c13cbf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2CoordTypeField.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+
+public class IA2CoordTypeField extends AbstractEnumIntegerField {
+
+ private static final Object[][] IA2_COORDTYPE = {
+ getLabelAndValue(IA2.IA2_COORDTYPE_SCREEN_RELATIVE),
+ getLabelAndValue(IA2.IA2_COORDTYPE_PARENT_RELATIVE),
+ };
+
+ private static final Object[] getLabelAndValue(int type) {
+ return new Object[] {IA2.getCoordTypeText(type),new Integer(type)};
+ }
+
+ public IA2CoordTypeField(String labelText, int initValue) {
+ super(labelText,initValue);
+ }
+
+ protected Object[][] getLabelsAndValues() {
+ return IA2_COORDTYPE;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2ScrollTypeField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2ScrollTypeField.java
new file mode 100644
index 0000000..f68146a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2ScrollTypeField.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+
+public class IA2ScrollTypeField extends AbstractEnumIntegerField {
+
+ private static final Object[][] IA2_SCROLL_TYPE = {
+ getLabelAndValue(IA2.IA2_SCROLL_TYPE_TOP_LEFT),
+ getLabelAndValue(IA2.IA2_SCROLL_TYPE_BOTTOM_RIGHT),
+ getLabelAndValue(IA2.IA2_SCROLL_TYPE_TOP_EDGE),
+ getLabelAndValue(IA2.IA2_SCROLL_TYPE_BOTTOM_EDGE),
+ getLabelAndValue(IA2.IA2_SCROLL_TYPE_LEFT_EDGE),
+ getLabelAndValue(IA2.IA2_SCROLL_TYPE_RIGHT_EDGE)
+ };
+
+ private static final Object[] getLabelAndValue(int type) {
+ return new Object[] {IA2.getScrollTypeText(type),new Integer(type)};
+ }
+
+ public IA2ScrollTypeField(String labelText, int initValue) {
+ super(labelText,initValue);
+ }
+
+ protected Object[][] getLabelsAndValues() {
+ return IA2_SCROLL_TYPE;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2TextBoundaryTypeField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2TextBoundaryTypeField.java
new file mode 100644
index 0000000..30176dd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IA2TextBoundaryTypeField.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+
+public class IA2TextBoundaryTypeField extends AbstractEnumIntegerField {
+
+ private static final Object[][] IA2_TEXT_BOUNDARY = {
+ getLabelAndValue(IA2.IA2_TEXT_BOUNDARY_CHAR),
+ getLabelAndValue(IA2.IA2_TEXT_BOUNDARY_WORD),
+ getLabelAndValue(IA2.IA2_TEXT_BOUNDARY_SENTENCE),
+ getLabelAndValue(IA2.IA2_TEXT_BOUNDARY_PARAGRAPH),
+ getLabelAndValue(IA2.IA2_TEXT_BOUNDARY_LINE),
+ getLabelAndValue(IA2.IA2_TEXT_BOUNDARY_ALL),
+ };
+
+ private static final Object[] getLabelAndValue(int type) {
+ return new Object[] {IA2.getTextBoundaryTypeText(type),new Integer(type)};
+ }
+
+ public IA2TextBoundaryTypeField(String labelText, int initValue) {
+ super(labelText,initValue);
+ }
+
+ protected Object[][] getLabelsAndValues() {
+ return IA2_TEXT_BOUNDARY;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IntegerField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IntegerField.java
new file mode 100644
index 0000000..0c6ea8a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/IntegerField.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+
+public class IntegerField extends AbstractStringField {
+
+ private int currValue;
+ public int minValue, maxValue;
+
+ public IntegerField(String labelText, int initValue, int minValue, int maxValue) {
+ super(labelText);
+ this.currValue = initValue;
+ this.minValue = minValue;
+ this.maxValue = maxValue;
+ }
+
+ public IntegerField(String labelText, int initValue, int minValue) {
+ this(labelText,initValue,minValue,Integer.MAX_VALUE);
+ }
+
+ public IntegerField(String labelText, int initValue) {
+ this(labelText,initValue,Integer.MIN_VALUE,Integer.MAX_VALUE);
+ }
+
+ public int getIntValue() {
+ return currValue;
+ }
+
+ protected String getStringValue() {
+ return Integer.toString(currValue);
+ }
+
+ protected boolean validateControl() {
+ String text = getText();
+ if( null != text ) {
+ try {
+ int value = Integer.parseInt(text);
+ return (value>=minValue) && (value <=maxValue);
+ }
+ catch( Exception e ) {
+ }
+ }
+ return false;
+ }
+
+ public boolean update() {
+ if( validateControl() ) {
+ try {
+ currValue = Integer.parseInt(getText());
+ return true;
+ }
+ catch( Exception e ) {
+ }
+ }
+ return false;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/MSAASELFLAGField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/MSAASELFLAGField.java
new file mode 100644
index 0000000..c765711
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/MSAASELFLAGField.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+
+public class MSAASELFLAGField extends AbstractFlagIntegerField {
+
+ private static final Object[][] SELFLAGS = {
+ {"SELFLAG_NONE",new Integer(MSAA.SELFLAG_NONE)}, //$NON-NLS-1$
+ {"SELFLAG_TAKEFOCUS",new Integer(MSAA.SELFLAG_TAKEFOCUS)}, //$NON-NLS-1$
+ {"SELFLAG_TAKESELECTION",new Integer(MSAA.SELFLAG_TAKESELECTION)}, //$NON-NLS-1$
+ {"SELFLAG_EXTENDSELECTION",new Integer(MSAA.SELFLAG_EXTENDSELECTION)}, //$NON-NLS-1$
+ {"SELFLAG_ADDSELECTION",new Integer(MSAA.SELFLAG_ADDSELECTION)}, //$NON-NLS-1$
+ {"SELFLAG_REMOVESELECTION",new Integer(MSAA.SELFLAG_REMOVESELECTION)} //$NON-NLS-1$
+ };
+
+ public MSAASELFLAGField(String labelText, int initValue) {
+ super(labelText,initValue);
+ }
+
+ protected Object[][] getLabelsAndValues() {
+ return SELFLAGS;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/RelationIndexField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/RelationIndexField.java
new file mode 100644
index 0000000..41d7ded
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/RelationIndexField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+
+
+
+public class RelationIndexField extends IntegerField {
+
+ private Accessible2 accessible2;
+
+ public RelationIndexField(String labelText, int initValue,Accessible2 accessible2) {
+ super(labelText,initValue,0);
+ this.accessible2 = accessible2;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessible2 ) {
+ maxValue = accessible2.getAccessibleRelationCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableColumnField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableColumnField.java
new file mode 100644
index 0000000..3695fb1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableColumnField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+
+
+
+public class TableColumnField extends IntegerField {
+
+ private AccessibleTable accessibleTable;
+
+ public TableColumnField(String labelText, int initValue,AccessibleTable accessibleTable) {
+ super(labelText,initValue,0);
+ this.accessibleTable = accessibleTable;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleTable ) {
+ maxValue = accessibleTable.getAccessibleColumnCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableIndexField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableIndexField.java
new file mode 100644
index 0000000..bf7a94d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableIndexField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+
+
+
+public class TableIndexField extends IntegerField {
+
+ private AccessibleTable accessibleTable;
+
+ public TableIndexField(String labelText, int initValue,AccessibleTable accessibleTable) {
+ super(labelText,initValue,0);
+ this.accessibleTable = accessibleTable;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleTable ) {
+ maxValue = accessibleTable.getAccessibleRowCount()*accessibleTable.getAccessibleColumnCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableRowField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableRowField.java
new file mode 100644
index 0000000..2dde19c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TableRowField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+
+
+
+public class TableRowField extends IntegerField {
+
+ private AccessibleTable accessibleTable;
+
+ public TableRowField(String labelText, int initValue,AccessibleTable accessibleTable) {
+ super(labelText,initValue,0);
+ this.accessibleTable = accessibleTable;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleTable ) {
+ maxValue = accessibleTable.getAccessibleRowCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextField.java
new file mode 100644
index 0000000..b40769c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextField.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+
+public class TextField extends AbstractStringField {
+
+ private String currValue;
+ public int miniLength, maxLength;
+
+ public TextField(String labelText, String initValue, int miniLength, int maxLength) {
+ super(labelText);
+ this.currValue = initValue;
+ this.miniLength = miniLength;
+ this.maxLength = maxLength;
+ }
+
+ public TextField(String labelText, String initValue, int miniLength) {
+ this(labelText,initValue,miniLength,Integer.MAX_VALUE);
+ }
+
+ public TextField(String labelText, String initValue) {
+ this(labelText, initValue,0,Integer.MAX_VALUE);
+ }
+
+ public String getStringValue() {
+ return currValue;
+ }
+
+ protected boolean validateControl() {
+ String text = getText();
+ if( null != text ) {
+ try {
+ int length = text.length();
+ return (length>=miniLength) && (length <=maxLength);
+ }
+ catch( Exception e ) {
+ }
+ }
+ return false;
+ }
+
+ public boolean update() {
+ if( validateControl() ) {
+ try {
+ currValue = getText();
+ return true;
+ }
+ catch( Exception e ) {
+ }
+ }
+ return false;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextOffsetField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextOffsetField.java
new file mode 100644
index 0000000..87035f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextOffsetField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+
+
+
+public class TextOffsetField extends IntegerField {
+
+ private AccessibleText accessibleText;
+
+ public TextOffsetField(String labelText, int initValue,AccessibleText accessibleText) {
+ super(labelText,initValue,0);
+ this.accessibleText = accessibleText;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleText ) {
+ maxValue = accessibleText.getCharacterCount();
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextSelectionField.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextSelectionField.java
new file mode 100644
index 0000000..d2192ab
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/fields/TextSelectionField.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.fields;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+
+
+
+public class TextSelectionField extends IntegerField {
+
+ private AccessibleText accessibleText;
+
+ public TextSelectionField(String labelText, int initValue,AccessibleText accessibleText) {
+ super(labelText,initValue,0);
+ this.accessibleText = accessibleText;
+ }
+
+ protected boolean validateControl() {
+ if( null != accessibleText ) {
+ maxValue = accessibleText.getSelectionCount()-1;
+ }
+ return super.validateControl();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/MethodData.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/MethodData.java
new file mode 100644
index 0000000..4618c66
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/MethodData.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods;
+
+import java.text.MessageFormat;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2CoordTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2ScrollTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2TextBoundaryTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.MSAASELFLAGField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextField;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Composite;
+
+
+
+public abstract class MethodData {
+
+ private String title;
+ private boolean supportInvoke;
+ private AbstractInputField[] inputFields = new AbstractInputField[0];
+ protected Object result = PRESS_ENTER_MSG;
+
+ private static final String PRESS_ENTER_MSG = Messages.getString("props.pressEnter"); //$NON-NLS-1$
+ private static final String PRESS_OK_MSG = Messages.getString("props.pressOK"); //$NON-NLS-1$
+ private static final String INVALID_FIELD_MSG = Messages.getString("props.invalid"); //$NON-NLS-1$
+ private static final String VALID_RANGE_MSG = Messages.getString("props.range"); //$NON-NLS-1$
+ private static final String SUCCESS_MSG = Messages.getString("props.success"); //$NON-NLS-1$
+ private static final String FAIL_MSG = Messages.getString("props.fail"); //$NON-NLS-1$
+
+ protected String getInvalidArgMessage(AbstractInputField field) {
+ String label = field.getLabelText();
+ if( field instanceof IntegerField ) {
+ int minValue = ((IntegerField)field).minValue;
+ int maxValue = ((IntegerField)field).maxValue;
+ if( minValue <= maxValue ) {
+ return MessageFormat.format(VALID_RANGE_MSG,new Object[]{label,new Integer(minValue),new Integer(maxValue)});
+ }
+ }
+ return MessageFormat.format(INVALID_FIELD_MSG,new Object[]{label});
+ }
+
+ public MethodData(String title, boolean supportInvoke) {
+ this.title = title;
+ this.supportInvoke = supportInvoke;
+ }
+
+ public void setInputFields(AbstractInputField[] inputFields) {
+ this.inputFields = inputFields;
+ }
+ public final String getTitle() {
+ return title;
+ }
+
+ public final boolean canInvole() {
+ return supportInvoke;
+ }
+
+ public boolean invoke() {
+ return supportInvoke;
+ }
+
+ public Object getResult() {
+ return result;
+ }
+
+ protected final void createControl(Composite parent) {
+ for( int i=0; i<inputFields.length; i++ ) {
+ inputFields[i].createLabelAndControl(parent);
+ }
+ }
+
+ protected final boolean validate() {
+ for( int i=0; i<inputFields.length; i++ ) {
+ AbstractInputField field = inputFields[i];
+ if( !field.validate() ) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected final String getMessage() {
+ for( int i=0; i<inputFields.length; i++ ) {
+ AbstractInputField field = inputFields[i];
+ if( !field.validate() ) {
+ return getInvalidArgMessage(field);
+ }
+ }
+ return PRESS_OK_MSG;
+ }
+
+ protected final void setModifyListener(ModifyListener listener) {
+ for( int i=0; i<inputFields.length; i++ ) {
+ AbstractInputField field = inputFields[i];
+ field.setModifyListener(listener);
+ }
+ }
+
+ protected final void update() {
+ for( int i=0; i<inputFields.length; i++ ) {
+ AbstractInputField field = inputFields[i];
+ field.update();
+ }
+ }
+
+ protected final String getParameters() {
+ StringBuffer sb = new StringBuffer();
+ for( int i=0; i<inputFields.length; i++ ) {
+ if( i > 0 ) {
+ sb.append(", "); //$NON-NLS-1$
+ }
+ AbstractInputField field = inputFields[i];
+ sb.append(field.getLabelText());
+ sb.append("="); //$NON-NLS-1$
+ if( field instanceof IA2CoordTypeField ) {
+ int coordType = ((IA2CoordTypeField)field).getIntValue();
+ sb.append(IA2.getCoordTypeText(coordType));
+ }
+ else if( field instanceof IA2ScrollTypeField ) {
+ int scrollType = ((IA2ScrollTypeField)field).getIntValue();
+ sb.append(IA2.getScrollTypeText(scrollType));
+ }
+ else if( field instanceof IA2TextBoundaryTypeField ) {
+ int textBoundaryType = ((IA2TextBoundaryTypeField)field).getIntValue();
+ sb.append(IA2.getTextBoundaryTypeText(textBoundaryType));
+ }
+ else if( field instanceof MSAASELFLAGField ) {
+ int flag = ((MSAASELFLAGField)field).getIntValue();
+ sb.append("0x"+Integer.toHexString(flag)); //$NON-NLS-1$
+ }
+ else if( field instanceof IntegerField ) {
+ int value = ((IntegerField)field).getIntValue();
+ sb.append(Integer.toString(value));
+ }
+ else if( field instanceof TextField ) {
+ String value = ((TextField)field).getStringValue();
+ sb.append(T(value));
+ }
+ }
+ return sb.toString();
+ }
+
+ protected final String formatResult(boolean success) {
+ return formatResult(success ? SUCCESS_MSG : FAIL_MSG);
+ }
+
+ protected final String formatResult(String rc) {
+ String param = getParameters();
+ if( param.length()>0 ) {
+ return rc + " ["+param+"]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return rc;
+ }
+
+ protected static String T(String str) {
+ if( null==str ) {
+ return "(null)"; //$NON-NLS-1$
+ }
+ return "\""+str+"\""; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/MethodInvokeDialog.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/MethodInvokeDialog.java
new file mode 100644
index 0000000..985fad5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/MethodInvokeDialog.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+
+public class MethodInvokeDialog extends Dialog {
+
+ private MethodData data;
+ private Text messages;
+
+ public MethodInvokeDialog(Shell parentShell, MethodData data) {
+ super(parentShell);
+ this.data = data;
+ }
+
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(data.getTitle());
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite comp = (Composite)super.createDialogArea(parent);
+ Composite inputArea = new Composite(comp,SWT.NONE);
+ inputArea.setLayout(new GridLayout(2,false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.minimumWidth = 300;
+ inputArea.setLayoutData(gd);
+ data.createControl(inputArea);
+ return comp;
+ }
+
+ protected Control createMessageArea(Composite parent) {
+ Composite messageArea = new Composite(parent,SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.marginWidth *= 2;
+ gl.marginHeight = 0;
+ messageArea.setLayout(gl);
+ messageArea.setLayoutData(new GridData(GridData.FILL_BOTH));
+ messages = new Text(messageArea,SWT.NONE|SWT.READ_ONLY);
+ messages.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return messageArea;
+ }
+
+ protected Control createButtonBar(Composite parent) {
+ createMessageArea(parent);
+ Control buttonBar = super.createButtonBar(parent);
+ data.setModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ updateMessage();
+ }
+ });
+ updateMessage();
+ return buttonBar;
+ }
+
+ protected void updateMessage() {
+ messages.setText(data.getMessage());
+ getButton(IDialogConstants.OK_ID).setEnabled(data.validate());
+ }
+
+ protected void okPressed() {
+ data.update();
+ super.okPressed();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia1/MsaaDoDefaultActionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia1/MsaaDoDefaultActionMethod.java
new file mode 100644
index 0000000..d2986fb
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia1/MsaaDoDefaultActionMethod.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia1;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class MsaaDoDefaultActionMethod extends MethodData {
+
+ private AccessibleObject accObject;
+
+ public MsaaDoDefaultActionMethod(AccessibleObject accObject) {
+ super(null/*"accDoDefaultAction()"*/,true);
+ this.accObject = accObject;
+ setInputFields(new AbstractInputField[]{});
+ }
+
+ public boolean invoke() {
+ boolean success = accObject.doDefaultAction();
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia1/MsaaSelectMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia1/MsaaSelectMethod.java
new file mode 100644
index 0000000..74a5b8b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia1/MsaaSelectMethod.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia1;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.MSAASELFLAGField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class MsaaSelectMethod extends MethodData {
+
+ private AccessibleObject accObject;
+ private MSAASELFLAGField selFlagField;
+
+ public MsaaSelectMethod(AccessibleObject accObject) {
+ super("accSelect",true); //$NON-NLS-1$
+ this.accObject = accObject;
+ selFlagField = new MSAASELFLAGField("flagSelect", MSAA.SELFLAG_TAKEFOCUS); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{selFlagField});
+ }
+
+ public boolean invoke() {
+ int flagSelect = selFlagField.getIntValue();
+ boolean success = accObject.select(flagSelect);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ExtendedStatesMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ExtendedStatesMethod.java
new file mode 100644
index 0000000..f7cb117
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ExtendedStatesMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2ExtendedStatesMethod extends MethodData {
+
+ private Accessible2 accessible2;
+ private IntegerField maxExtendedStatesField;
+
+ public IA2ExtendedStatesMethod(Accessible2 accessible2) {
+ super("extendedStates", true); //$NON-NLS-1$
+ this.accessible2 = accessible2;
+ maxExtendedStatesField = new IntegerField("maxExtendedStates",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{maxExtendedStatesField});
+ }
+
+ public Object getResult() {
+ int maxExtendedStates = maxExtendedStatesField.getIntValue();
+ String[] strArray = accessible2.getExtendedStates(maxExtendedStates);
+ if( null != strArray ) {
+ return new ObjectArrayPropertySource(strArray);
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2LocalizedExtendedStatesMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2LocalizedExtendedStatesMethod.java
new file mode 100644
index 0000000..1042124
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2LocalizedExtendedStatesMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2LocalizedExtendedStatesMethod extends MethodData {
+
+ private Accessible2 accessible2;
+ private IntegerField maxLocalizedExtendedStatesField;
+
+ public IA2LocalizedExtendedStatesMethod(Accessible2 accessible2) {
+ super("localizedExtendedStates", true); //$NON-NLS-1$
+ this.accessible2 = accessible2;
+ maxLocalizedExtendedStatesField = new IntegerField("maxLocalizedExtendedStates",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{maxLocalizedExtendedStatesField});
+ }
+
+ public Object getResult() {
+ int maxLocalizedExtendedStates = maxLocalizedExtendedStatesField.getIntValue();
+ String[] strArray = accessible2.getLocalizedExtendedStates(maxLocalizedExtendedStates);
+ if( null != strArray ) {
+ return new ObjectArrayPropertySource(strArray);
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2RelationMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2RelationMethod.java
new file mode 100644
index 0000000..8fc9744
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2RelationMethod.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleRelation;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleRelationPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.RelationIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2RelationMethod extends MethodData {
+
+ private Accessible2 accessible2;
+ private RelationIndexField relationIndexField;
+
+ public IA2RelationMethod(Accessible2 accessible2) {
+ super("relation", true); //$NON-NLS-1$
+ this.accessible2 = accessible2;
+ relationIndexField = new RelationIndexField("relationIndex",0,accessible2); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{relationIndexField});
+ }
+
+ public boolean invoke() {
+ int relationIndex = relationIndexField.getIntValue();
+ AccessibleRelation relations = accessible2.getAccessibleRelation(relationIndex);
+ if( null != relations ) {
+ result = new AccessibleRelationPropertySource(relations){
+ public Object getEditableValue() {
+ return formatResult(true);
+ }
+ };
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2RelationsMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2RelationsMethod.java
new file mode 100644
index 0000000..4596a9e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2RelationsMethod.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleRelation;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2RelationsMethod extends MethodData {
+
+ private Accessible2 accessible2;
+ private IntegerField maxRelationsField;
+
+ public IA2RelationsMethod(Accessible2 accessible2) {
+ super("relations", true); //$NON-NLS-1$
+ this.accessible2 = accessible2;
+ maxRelationsField = new IntegerField("maxRelations",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{maxRelationsField});
+ }
+
+ public Object getResult() {
+ int maxRelations = maxRelationsField.getIntValue();
+ AccessibleRelation[] relations = accessible2.getAccessibleRelations(maxRelations);
+ if( null != relations ) {
+ return new ObjectArrayPropertySource(relations,formatResult("nRelations="+relations.length)); //$NON-NLS-1$
+ }
+ return formatResult(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ScrollToMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ScrollToMethod.java
new file mode 100644
index 0000000..8bc9e0b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ScrollToMethod.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2ScrollTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2ScrollToMethod extends MethodData {
+
+ private Accessible2 accessible2;
+ private IA2ScrollTypeField scrollTypeField;
+
+ public IA2ScrollToMethod(Accessible2 accessible2) {
+ super("scrollTo", true); //$NON-NLS-1$
+ this.accessible2 = accessible2;
+ scrollTypeField = new IA2ScrollTypeField("scrollType", IA2.IA2_SCROLL_TYPE_TOP_LEFT); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{scrollTypeField});
+ }
+
+ public boolean invoke() {
+ int scrollType = scrollTypeField.getIntValue();
+ boolean success = accessible2.scrollTo(scrollType);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ScrollToPointMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ScrollToPointMethod.java
new file mode 100644
index 0000000..15a05f9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2/IA2ScrollToPointMethod.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2CoordTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2ScrollToPointMethod extends MethodData {
+
+ private Accessible2 accessible2;
+ private IA2CoordTypeField coordTypeField;
+ private IntegerField xField,yField;
+
+
+ public IA2ScrollToPointMethod(Accessible2 accessible2) {
+ super("scrollToPoint", true); //$NON-NLS-1$
+ this.accessible2 = accessible2;
+ coordTypeField = new IA2CoordTypeField("coordinateType",IA2.IA2_COORDTYPE_SCREEN_RELATIVE); //$NON-NLS-1$
+ xField = new IntegerField("x",0); //$NON-NLS-1$
+ yField = new IntegerField("y",0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{coordTypeField,xField,yField});
+ }
+
+ public boolean invoke() {
+ int coordType = coordTypeField.getIntValue();
+ int x = xField.getIntValue();
+ int y = yField.getIntValue();
+ boolean success = accessible2.scrollToPoint(coordType, x, y);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionDescriptionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionDescriptionMethod.java
new file mode 100644
index 0000000..22ce201
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionDescriptionMethod.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.ActionIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2ActionDescriptionMethod extends MethodData {
+
+ private AccessibleAction accessibleAction;
+ private ActionIndexField actionIndexField;
+
+ public IA2ActionDescriptionMethod(AccessibleAction accessibleAction) {
+ super("description",true); //$NON-NLS-1$
+ this.accessibleAction = accessibleAction;
+ actionIndexField = new ActionIndexField("actionIndex",0,accessibleAction); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{actionIndexField});
+ }
+
+ public Object getResult() {
+ int actionIndex = actionIndexField.getIntValue();
+ String description = accessibleAction.getAccessibleActionDescription(actionIndex);
+ return formatResult("description="+T(description)); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionDoActionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionDoActionMethod.java
new file mode 100644
index 0000000..bd2e061
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionDoActionMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.ActionIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2ActionDoActionMethod extends MethodData {
+
+ private AccessibleAction accessibleAction;
+ private ActionIndexField actionIndexField;
+
+ public IA2ActionDoActionMethod(AccessibleAction accessibleAction) {
+ super("doAction",true); //$NON-NLS-1$
+ this.accessibleAction = accessibleAction;
+ actionIndexField = new ActionIndexField("actionIndex",0,accessibleAction); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{actionIndexField});
+ }
+
+ public boolean invoke() {
+ int actionIndex = actionIndexField.getIntValue();
+ boolean success = accessibleAction.doAccessibleAction(actionIndex);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionKeybindingMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionKeybindingMethod.java
new file mode 100644
index 0000000..c168bc7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionKeybindingMethod.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.ActionIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2ActionKeybindingMethod extends MethodData {
+
+ private AccessibleAction accessibleAction;
+ private ActionIndexField actionIndexField;
+ private IntegerField nMaxBingingField;
+
+ public IA2ActionKeybindingMethod(AccessibleAction accessibleAction) {
+ super("keyBinding",true); //$NON-NLS-1$
+ this.accessibleAction = accessibleAction;
+ actionIndexField = new ActionIndexField("actionIndex",0,accessibleAction); //$NON-NLS-1$
+ nMaxBingingField = new IntegerField("nMaxBinding",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{actionIndexField,nMaxBingingField});
+ }
+
+ public Object getResult() {
+ int actionIndex = actionIndexField.getIntValue();
+ int nMaxBinding = nMaxBingingField.getIntValue();
+ String[] keyBinding = accessibleAction.getAccessibleActionKeyBinding(actionIndex, nMaxBinding);
+ if( null != keyBinding ) {
+ return new ObjectArrayPropertySource(keyBinding,formatResult("nBinding="+keyBinding.length)); //$NON-NLS-1$
+ }
+ return formatResult(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionLocalizedNameMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionLocalizedNameMethod.java
new file mode 100644
index 0000000..e993bbd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionLocalizedNameMethod.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.ActionIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2ActionLocalizedNameMethod extends MethodData {
+
+ private AccessibleAction accessibleAction;
+ private ActionIndexField actionIndexField;
+
+ public IA2ActionLocalizedNameMethod(AccessibleAction accessibleAction) {
+ super("localizedName",true); //$NON-NLS-1$
+ this.accessibleAction = accessibleAction;
+ actionIndexField = new ActionIndexField("actionIndex",0,accessibleAction); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{actionIndexField});
+ }
+
+ public Object getResult() {
+ int actionIndex = actionIndexField.getIntValue();
+ String localizedName = accessibleAction.getLocalizedAccessibleActionName(actionIndex);
+ return formatResult("localizedName="+T(localizedName)); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionNameMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionNameMethod.java
new file mode 100644
index 0000000..2617d27
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2action/IA2ActionNameMethod.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2action;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.ActionIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2ActionNameMethod extends MethodData {
+
+ private AccessibleAction accessibleAction;
+ private ActionIndexField actionIndexField;
+
+ public IA2ActionNameMethod(AccessibleAction accessibleAction) {
+ super("name",true); //$NON-NLS-1$
+ this.accessibleAction = accessibleAction;
+ actionIndexField = new ActionIndexField("actionIndex",0,accessibleAction); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{actionIndexField});
+ }
+
+ public Object getResult() {
+ int actionIndex = actionIndexField.getIntValue();
+ String name = accessibleAction.getAccessibleActionName(actionIndex);
+ return formatResult("name="+T(name)); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextCopyTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextCopyTextMethod.java
new file mode 100644
index 0000000..6f5f30e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextCopyTextMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextCopyTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField startOffsetField, endOffsetField;
+
+ public IA2EditableTextCopyTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("copyText",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ int max = null!=accessibleText ? accessibleText.getCharacterCount() : 0;
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",max,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField});
+ }
+
+ public boolean invoke() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ boolean success = editableText.copyText(startOffset, endOffset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextCutTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextCutTextMethod.java
new file mode 100644
index 0000000..0ebf38f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextCutTextMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextCutTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField startOffsetField, endOffsetField;
+
+ public IA2EditableTextCutTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("cutText",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ int max = null!=accessibleText ? accessibleText.getCharacterCount() : 0;
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",max,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField});
+ }
+
+ public boolean invoke() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ boolean success = editableText.cutText(startOffset, endOffset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextDeleteTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextDeleteTextMethod.java
new file mode 100644
index 0000000..7e6347a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextDeleteTextMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextDeleteTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField startOffsetField, endOffsetField;
+
+ public IA2EditableTextDeleteTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("deleteText",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ int max = null!=accessibleText ? accessibleText.getCharacterCount() : 0;
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",max,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField});
+ }
+
+ public boolean invoke() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ boolean success = editableText.deleteText(startOffset, endOffset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextInsertTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextInsertTextMethod.java
new file mode 100644
index 0000000..84a00ef
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextInsertTextMethod.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextInsertTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField offsetField;
+ private TextField textField;
+
+ public IA2EditableTextInsertTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("insertText",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ textField = new TextField("text",""); //$NON-NLS-1$ //$NON-NLS-2$
+ setInputFields(new AbstractInputField[]{offsetField,textField});
+ }
+
+ public boolean invoke() {
+ int offset = offsetField.getIntValue();
+ String text = textField.getStringValue();
+ boolean success = editableText.insertText(offset, text);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextPasteTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextPasteTextMethod.java
new file mode 100644
index 0000000..8fd90f6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextPasteTextMethod.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextPasteTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField offsetField;
+
+ public IA2EditableTextPasteTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("pasteText",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField});
+ }
+
+ public boolean invoke() {
+ int offset = offsetField.getIntValue();
+ boolean success = editableText.pasteText(offset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextReplaceTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextReplaceTextMethod.java
new file mode 100644
index 0000000..881bb9f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextReplaceTextMethod.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextReplaceTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField startOffsetField, endOffsetField;
+ private TextField textField;
+
+ public IA2EditableTextReplaceTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("replaceText",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ int max = null!=accessibleText ? accessibleText.getCharacterCount() : 0;
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",max,accessibleText); //$NON-NLS-1$
+ textField = new TextField("text",""); //$NON-NLS-1$ //$NON-NLS-2$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField,textField});
+ }
+
+ public boolean invoke() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ String text = textField.getStringValue();
+ boolean success = editableText.replaceText(startOffset, endOffset, text);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextSetAttributesTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextSetAttributesTextMethod.java
new file mode 100644
index 0000000..c92ccc5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2editabletext/IA2EditableTextSetAttributesTextMethod.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2editabletext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2EditableTextSetAttributesTextMethod extends MethodData {
+
+ private AccessibleEditableText editableText;
+ private TextOffsetField startOffsetField, endOffsetField;
+ private TextField attributesField;
+
+ public IA2EditableTextSetAttributesTextMethod(AccessibleEditableText editableText, AccessibleText accessibleText) {
+ super("setAttributes",true); //$NON-NLS-1$
+ this.editableText = editableText;
+ int max = null!=accessibleText ? accessibleText.getCharacterCount() : 0;
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",max,accessibleText); //$NON-NLS-1$
+ attributesField = new TextField("attributes",""); //$NON-NLS-1$ //$NON-NLS-2$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField,attributesField});
+ }
+
+ public boolean invoke() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ String attributes = attributesField.getStringValue();
+ boolean success = editableText.setAttributes(startOffset, endOffset, attributes);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hyperlink/IA2HyperlinkAnchorMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hyperlink/IA2HyperlinkAnchorMethod.java
new file mode 100644
index 0000000..bfdb010
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hyperlink/IA2HyperlinkAnchorMethod.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hyperlink;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+public class IA2HyperlinkAnchorMethod extends MethodData {
+
+ private AccessibleHyperlink accessibleHyperlink;
+ private IntegerField indexField;
+
+ public IA2HyperlinkAnchorMethod(AccessibleHyperlink accessibleHyperlink) {
+ super("anchor",true); //$NON-NLS-1$
+ this.accessibleHyperlink = accessibleHyperlink;
+ indexField = new IntegerField("index",0,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{indexField});
+ }
+
+ public Object getResult() {
+ int index = indexField.getIntValue();
+ Variant varAnchor = accessibleHyperlink.getAccessibleActionAnchor(index);
+ if( null != varAnchor ) {
+ try {
+ return varAnchor.toString();
+ }
+ finally {
+ varAnchor.dispose();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hyperlink/IA2HyperlinkAnchorTargetMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hyperlink/IA2HyperlinkAnchorTargetMethod.java
new file mode 100644
index 0000000..a0bb479
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hyperlink/IA2HyperlinkAnchorTargetMethod.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hyperlink;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+public class IA2HyperlinkAnchorTargetMethod extends MethodData {
+
+ private AccessibleHyperlink accessibleHyperlink;
+ private IntegerField indexField;
+
+ public IA2HyperlinkAnchorTargetMethod(AccessibleHyperlink accessibleHyperlink) {
+ super("anchorTarget",true); //$NON-NLS-1$
+ this.accessibleHyperlink = accessibleHyperlink;
+ indexField = new IntegerField("index",0,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{indexField});
+ }
+
+ public Object getResult() {
+ int index = indexField.getIntValue();
+ Variant varAnchor = accessibleHyperlink.getAccessibleActionObject(index);
+ if( null != varAnchor ) {
+ try {
+ return varAnchor.toString();
+ }
+ finally {
+ varAnchor.dispose();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hypertext/IA2HypertextHyperlinkIndexMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hypertext/IA2HypertextHyperlinkIndexMethod.java
new file mode 100644
index 0000000..f7e793e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hypertext/IA2HypertextHyperlinkIndexMethod.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hypertext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2HypertextHyperlinkIndexMethod extends MethodData {
+
+ private AccessibleHypertext accessibleHypertext;
+ private TextOffsetField charIndexField;
+
+ public IA2HypertextHyperlinkIndexMethod(AccessibleHypertext accessibleHyperext, AccessibleText accessibleText) {
+ super("hyperlinkIndex",true); //$NON-NLS-1$
+ this.accessibleHypertext = accessibleHyperext;
+ charIndexField = new TextOffsetField("charIndex",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{charIndexField});
+ }
+
+ public Object getResult() {
+ int charIndex = charIndexField.getIntValue();
+ int hyperlinkIndex = accessibleHypertext.getHyperLinkIndex(charIndex);
+ return formatResult("hyperlinkIndex="+hyperlinkIndex); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hypertext/IA2HypertextHyperlinkMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hypertext/IA2HypertextHyperlinkMethod.java
new file mode 100644
index 0000000..1344962
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2hypertext/IA2HypertextHyperlinkMethod.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2hypertext;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleHyperlinkPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.HypertextHyperlinkIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2HypertextHyperlinkMethod extends MethodData {
+
+ private AccessibleHypertext accessibleHypertext;
+ private HypertextHyperlinkIndexField indexField;
+
+ public IA2HypertextHyperlinkMethod(AccessibleHypertext accessibleHyperext) {
+ super("hyperlink",true); //$NON-NLS-1$
+ this.accessibleHypertext = accessibleHyperext;
+ indexField = new HypertextHyperlinkIndexField("index",0,accessibleHyperext); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{indexField});
+ }
+
+ public Object getResult() {
+ if( 0 == accessibleHypertext.getHyperLinkCount() ) {
+ return null;
+ }
+ int index = indexField.getIntValue();
+ AccessibleHyperlink hyperlink = accessibleHypertext.getHyperLink(index);
+ if( null != hyperlink ) {
+ return new AccessibleHyperlinkPropertySource(hyperlink){
+ public Object getEditableValue() {
+ return formatResult(true);
+ }
+ };
+ }
+ return formatResult(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2image/IA2ImagePositionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2image/IA2ImagePositionMethod.java
new file mode 100644
index 0000000..819e309
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2image/IA2ImagePositionMethod.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2image;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleImage;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2CoordTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.swt.graphics.Point;
+
+
+public class IA2ImagePositionMethod extends MethodData {
+
+ private AccessibleImage accessibleImage;
+ private IA2CoordTypeField coordTypeField;
+
+ public IA2ImagePositionMethod(AccessibleImage accessibleImage) {
+ super("imagePosition",true); //$NON-NLS-1$
+ this.accessibleImage = accessibleImage;
+ coordTypeField = new IA2CoordTypeField("coordType",IA2.IA2_COORDTYPE_SCREEN_RELATIVE); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{coordTypeField});
+ }
+
+ public Object getResult() {
+ int coordType = coordTypeField.getIntValue();
+ Point point = accessibleImage.getAccessibleImagePosition(coordType);
+ if( null != point ) {
+ return point.x+", "+point.y; //$NON-NLS-1$
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableAccessibleAtMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableAccessibleAtMethod.java
new file mode 100644
index 0000000..8fda332
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableAccessibleAtMethod.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableAccessibleAtMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+ private TableColumnField columnField;
+
+ public IA2TableAccessibleAtMethod(AccessibleTable accessibleTable) {
+ super("accessibleAt",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField,columnField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ int column = columnField.getIntValue();
+ AccessibleObject cell = accessibleTable.getAccessibleCellAt(row, column);
+ if( null != cell ) {
+ result = new AccessibleObjectPropertySource(cell){
+ public Object getEditableValue() {
+ return formatResult(true);
+ }
+ };
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableChildIndexMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableChildIndexMethod.java
new file mode 100644
index 0000000..7135c65
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableChildIndexMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableChildIndexMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowIndexField;
+ private TableColumnField columnIndexField;
+
+ public IA2TableChildIndexMethod(AccessibleTable accessibleTable) {
+ super("childIndex",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowIndexField = new TableRowField("rowIndex",0,accessibleTable); //$NON-NLS-1$
+ columnIndexField = new TableColumnField("columnIndex",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowIndexField,columnIndexField});
+ }
+
+ public boolean invoke() {
+ int rowIndex = rowIndexField.getIntValue();
+ int columnIndex = columnIndexField.getIntValue();
+ int childIndex = accessibleTable.getAccessibleIndex(rowIndex, columnIndex);
+ result = formatResult("childIndex="+childIndex); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnDescriptionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnDescriptionMethod.java
new file mode 100644
index 0000000..573f09b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnDescriptionMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableColumnDescriptionMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableColumnField columnField;
+
+ public IA2TableColumnDescriptionMethod(AccessibleTable accessibleTable) {
+ super("columnDescription",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{columnField});
+ }
+
+ public boolean invoke() {
+ int column = columnField.getIntValue();
+ String description = accessibleTable.getAccessibleColumnDescription(column);
+ result = formatResult("description="+description); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnExtentAtMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnExtentAtMethod.java
new file mode 100644
index 0000000..bb5b59f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnExtentAtMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableColumnExtentAtMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+ private TableColumnField columnField;
+
+ public IA2TableColumnExtentAtMethod(AccessibleTable accessibleTable) {
+ super("columnExtentAt",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField,columnField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ int column = columnField.getIntValue();
+ int nColumnsSpanned = accessibleTable.getAccessibleColumnExtentAt(row, column);
+ result = formatResult("nColumnsSpanned="+nColumnsSpanned); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnIndexMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnIndexMethod.java
new file mode 100644
index 0000000..153baa8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableColumnIndexMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableColumnIndexMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableIndexField childIndexField;
+
+ public IA2TableColumnIndexMethod(AccessibleTable accessibleTable) {
+ super("columnIndex",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ childIndexField = new TableIndexField("childIndex",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{childIndexField});
+ }
+
+ public boolean invoke() {
+ int childIndex = childIndexField.getIntValue();
+ int columnIndex = accessibleTable.getAccessibleColumnIndex(childIndex);
+ result = formatResult("columnIndex="+columnIndex); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsColumnSelectedMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsColumnSelectedMethod.java
new file mode 100644
index 0000000..40960db
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsColumnSelectedMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableIsColumnSelectedMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableColumnField columnField;
+
+ public IA2TableIsColumnSelectedMethod(AccessibleTable accessibleTable) {
+ super("isColumnSelected",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{columnField});
+ }
+
+ public boolean invoke() {
+ int column = columnField.getIntValue();
+ boolean isSelected = accessibleTable.isAccessibleColumnSelected(column);
+ result = formatResult("isSelected="+isSelected); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsRowSelectedMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsRowSelectedMethod.java
new file mode 100644
index 0000000..603089d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsRowSelectedMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableIsRowSelectedMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+
+ public IA2TableIsRowSelectedMethod(AccessibleTable accessibleTable) {
+ super("isRowSelected",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ boolean isSelected = accessibleTable.isAccessibleRowSelected(row);
+ result = formatResult("isSelected="+isSelected); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsSelectedMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsSelectedMethod.java
new file mode 100644
index 0000000..631f600
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableIsSelectedMethod.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableIsSelectedMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+ private TableColumnField columnField;
+
+ public IA2TableIsSelectedMethod(AccessibleTable accessibleTable) {
+ super("isSelected",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField,columnField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ int column = columnField.getIntValue();
+ boolean isSelected = accessibleTable.isAccessibleSelected(row,column);
+ result = formatResult("isSelected="+isSelected); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowColumnExtentsAtIndexMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowColumnExtentsAtIndexMethod.java
new file mode 100644
index 0000000..f836bcb
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowColumnExtentsAtIndexMethod.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.ia2.RowColumnExtents;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableRowColumnExtentsAtIndexMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableIndexField indexField;
+
+ public IA2TableRowColumnExtentsAtIndexMethod(AccessibleTable accessibleTable) {
+ super("rowColumnExtentsAtIndex",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ indexField = new TableIndexField("index",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{indexField});
+ }
+
+ public boolean invoke() {
+ int index = indexField.getIntValue();
+ RowColumnExtents extents = accessibleTable.getAccessibleRowColumnExtentAtIndex(index);
+ if( null != extents ) {
+ AttributePropertySource attSource = new AttributePropertySource(null, formatResult(true));
+ attSource.put("row", new Integer(extents.row)); //$NON-NLS-1$
+ attSource.put("column", new Integer(extents.column)); //$NON-NLS-1$
+ attSource.put("rowExtents", new Integer(extents.rowExtents)); //$NON-NLS-1$
+ attSource.put("columnExtents", new Integer(extents.columnExtents)); //$NON-NLS-1$
+ attSource.put("isSelected", new Boolean(extents.isSelected)); //$NON-NLS-1$
+ result = attSource;
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowDescriptionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowDescriptionMethod.java
new file mode 100644
index 0000000..9e6cb0e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowDescriptionMethod.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableRowDescriptionMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+
+ public IA2TableRowDescriptionMethod(AccessibleTable accessibleTable) {
+ super("rowDescription",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ String description = accessibleTable.getAccessibleRowDescription(row);
+ result = formatResult("description="+description); //$NON-NLS-1$
+ return true;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowExtentAtMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowExtentAtMethod.java
new file mode 100644
index 0000000..4632420
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowExtentAtMethod.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableRowExtentAtMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+ private TableColumnField columnField;
+
+ public IA2TableRowExtentAtMethod(AccessibleTable accessibleTable) {
+ super("rowExtentAt",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField,columnField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ int column = columnField.getIntValue();
+ int nRowsSpanned = accessibleTable.getAccessibleRowExtentAt(row, column);
+ result = formatResult("nRowsSpanned="+nRowsSpanned); //$NON-NLS-1$
+ return true;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowIndexMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowIndexMethod.java
new file mode 100644
index 0000000..679e244
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableRowIndexMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableIndexField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableRowIndexMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableIndexField childIndexField;
+
+ public IA2TableRowIndexMethod(AccessibleTable accessibleTable) {
+ super("rowIndex",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ childIndexField = new TableIndexField("childIndex",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{childIndexField});
+ }
+
+ public boolean invoke() {
+ int childIndex = childIndexField.getIntValue();
+ int rowIndex = accessibleTable.getAccessibleRowIndex(childIndex);
+ result = formatResult("rowIndex="+rowIndex); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectColumnMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectColumnMethod.java
new file mode 100644
index 0000000..9b73b0a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectColumnMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableSelectColumnMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableColumnField columnField;
+
+ public IA2TableSelectColumnMethod(AccessibleTable accessibleTable) {
+ super("selectColumn",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{columnField});
+ }
+
+ public boolean invoke() {
+ int column = columnField.getIntValue();
+ boolean success = accessibleTable.selectAccessibleColumn(column);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectRowMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectRowMethod.java
new file mode 100644
index 0000000..bde0ca3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectRowMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableSelectRowMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+
+ public IA2TableSelectRowMethod(AccessibleTable accessibleTable) {
+ super("selectRow",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ boolean success = accessibleTable.selectAccessibleRow(row);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedChildrenMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedChildrenMethod.java
new file mode 100644
index 0000000..42deb68
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedChildrenMethod.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2TableSelectedChildrenMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private IntegerField maxChildrenField;
+
+ public IA2TableSelectedChildrenMethod(AccessibleTable accessibleTable) {
+ super("selectedChildren", true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ maxChildrenField = new IntegerField("maxChildren",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{maxChildrenField});
+ }
+
+ public Object getResult() {
+ int maxChildren = maxChildrenField.getIntValue();
+ int[] children = accessibleTable.getSelectedAccessibleChildren(maxChildren);
+ if( null != children ) {
+ return new ObjectArrayPropertySource(children,formatResult("nChildren="+children.length)); //$NON-NLS-1$
+ }
+ return formatResult(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedColumnsMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedColumnsMethod.java
new file mode 100644
index 0000000..044aa42
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedColumnsMethod.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2TableSelectedColumnsMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private IntegerField maxColumnsField;
+
+ public IA2TableSelectedColumnsMethod(AccessibleTable accessibleTable) {
+ super("selectedColumns", true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ maxColumnsField = new IntegerField("maxColumns",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{maxColumnsField});
+ }
+
+ public Object getResult() {
+ int maxColumns = maxColumnsField.getIntValue();
+ int[] columns = accessibleTable.getSelectedAccessibleColumns(maxColumns);
+ if( null != columns ) {
+ return new ObjectArrayPropertySource(columns,formatResult("nColumns="+columns.length)); //$NON-NLS-1$
+ }
+ return formatResult(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedRowsMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedRowsMethod.java
new file mode 100644
index 0000000..483b19a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableSelectedRowsMethod.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.ObjectArrayPropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2TableSelectedRowsMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private IntegerField maxRowsField;
+
+ public IA2TableSelectedRowsMethod(AccessibleTable accessibleTable) {
+ super("selectedRows", true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ maxRowsField = new IntegerField("maxRows",AccessibleObjectPropertySource.MAX_CHILD_PROPERTIES,0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{maxRowsField});
+ }
+
+ public Object getResult() {
+ int maxRows = maxRowsField.getIntValue();
+ int[] rows = accessibleTable.getSelectedAccessibleRows(maxRows);
+ if( null != rows ) {
+ return new ObjectArrayPropertySource(rows,formatResult("nRows="+rows.length)); //$NON-NLS-1$
+ }
+ return formatResult(false);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableUnselectColumnMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableUnselectColumnMethod.java
new file mode 100644
index 0000000..eb51486
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableUnselectColumnMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableColumnField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableUnselectColumnMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableColumnField columnField;
+
+ public IA2TableUnselectColumnMethod(AccessibleTable accessibleTable) {
+ super("unselectColumn",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ columnField = new TableColumnField("column",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{columnField});
+ }
+
+ public boolean invoke() {
+ int column = columnField.getIntValue();
+ boolean success = accessibleTable.unselectAccessibleColumn(column);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableUnselectRowMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableUnselectRowMethod.java
new file mode 100644
index 0000000..79af00e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2table/IA2TableUnselectRowMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2table;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TableRowField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TableUnselectRowMethod extends MethodData {
+
+ private AccessibleTable accessibleTable;
+ private TableRowField rowField;
+
+ public IA2TableUnselectRowMethod(AccessibleTable accessibleTable) {
+ super("unselectRow",true); //$NON-NLS-1$
+ this.accessibleTable = accessibleTable;
+ rowField = new TableRowField("row",0,accessibleTable); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{rowField});
+ }
+
+ public boolean invoke() {
+ int row = rowField.getIntValue();
+ boolean success = accessibleTable.unselectAccessibleRow(row);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextAddSelectionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextAddSelectionMethod.java
new file mode 100644
index 0000000..464172e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextAddSelectionMethod.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextAddSelectionMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField startOffsetField, endOffsetField;
+
+ public IA2TextAddSelectionMethod(AccessibleText accessibleText) {
+ super("addSelection",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField});
+ }
+
+ public boolean invoke() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ boolean success = accessibleText.addSelection(startOffset, endOffset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextAttributesMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextAttributesMethod.java
new file mode 100644
index 0000000..ddecfde
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextAttributesMethod.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.TextSegment;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+public class IA2TextAttributesMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField offsetField;
+
+ public IA2TextAttributesMethod(AccessibleText accessibleText) {
+ super("attributes",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField});
+ }
+
+ public Object getResult() {
+ int offset = offsetField.getIntValue();
+ TextSegment segment = accessibleText.getCharacterAttributes(offset);
+ if( null != segment && null != segment.text ) {
+ return new AttributePropertySource(segment.text,formatResult("startOffset="+segment.start+", endOffset="+segment.end)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextCharacterExtentsMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextCharacterExtentsMethod.java
new file mode 100644
index 0000000..b628763
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextCharacterExtentsMethod.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2CoordTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.swt.graphics.Rectangle;
+
+
+public class IA2TextCharacterExtentsMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField offsetField;
+ private IA2CoordTypeField coordTypeField;
+
+ public IA2TextCharacterExtentsMethod(AccessibleText accessibleText) {
+ super("characterExtents",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ coordTypeField = new IA2CoordTypeField("coordType",IA2.IA2_COORDTYPE_SCREEN_RELATIVE); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField,coordTypeField});
+ }
+
+ public Object getResult() {
+ int offset = offsetField.getIntValue();
+ int coordType = coordTypeField.getIntValue();
+ Rectangle extents = accessibleText.getCharacterBounds(offset,coordType);
+ if( null != extents ) {
+ AttributePropertySource attrSource = new AttributePropertySource(null,formatResult(true));
+ attrSource.put("x", new Integer(extents.x)); //$NON-NLS-1$
+ attrSource.put("y", new Integer(extents.y)); //$NON-NLS-1$
+ attrSource.put("width", new Integer(extents.width)); //$NON-NLS-1$
+ attrSource.put("height", new Integer(extents.height)); //$NON-NLS-1$
+ return attrSource;
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextOffsetAtPointMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextOffsetAtPointMethod.java
new file mode 100644
index 0000000..a97ed49
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextOffsetAtPointMethod.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2CoordTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.swt.graphics.Point;
+
+
+
+
+public class IA2TextOffsetAtPointMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private IntegerField xField, yField;
+ private IA2CoordTypeField coordTypeField;
+
+ public IA2TextOffsetAtPointMethod(AccessibleText accessibleText) {
+ super("offsetAtPoint",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ xField = new IntegerField("x",0); //$NON-NLS-1$
+ yField = new IntegerField("y",0); //$NON-NLS-1$
+ coordTypeField = new IA2CoordTypeField("coordType",IA2.IA2_COORDTYPE_SCREEN_RELATIVE); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{xField,yField,coordTypeField});
+ }
+
+ public boolean invoke() {
+ int x = xField.getIntValue();
+ int y = yField.getIntValue();
+ int coordType = coordTypeField.getIntValue();
+ int offset = accessibleText.getIndexAtPoint(new Point(x,y), coordType);
+ result = formatResult("offset="+offset); //$NON-NLS-1$
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextRemoveSelectionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextRemoveSelectionMethod.java
new file mode 100644
index 0000000..a3f6a74
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextRemoveSelectionMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextSelectionField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextRemoveSelectionMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextSelectionField selectionIndexField;
+
+ public IA2TextRemoveSelectionMethod(AccessibleText accessibleText) {
+ super("removeSelection",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ selectionIndexField = new TextSelectionField("selectionIndex",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{selectionIndexField});
+ }
+
+ public boolean invoke() {
+ int selectionIndex = selectionIndexField.getIntValue();
+ boolean success = accessibleText.removeSelection(selectionIndex);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextScrollSubstringToMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextScrollSubstringToMethod.java
new file mode 100644
index 0000000..19884df
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextScrollSubstringToMethod.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2ScrollTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextScrollSubstringToMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField startIndexField, endIndexField;
+ private IA2ScrollTypeField scrollTypeField;
+
+ public IA2TextScrollSubstringToMethod(AccessibleText accessibleText) {
+ super("scrollSubstringTo",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ startIndexField = new TextOffsetField("startIndex",0,accessibleText); //$NON-NLS-1$
+ endIndexField = new TextOffsetField("endIndex",0,accessibleText); //$NON-NLS-1$
+ scrollTypeField = new IA2ScrollTypeField("scrollType",IA2.IA2_SCROLL_TYPE_TOP_LEFT); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startIndexField,endIndexField,scrollTypeField});
+ }
+
+ public boolean invoke() {
+ int startIndex = startIndexField.getIntValue();
+ int endIndex = endIndexField.getIntValue();
+ int scrollType = scrollTypeField.getIntValue();
+ boolean success = accessibleText.scrollSubstringTo(startIndex, endIndex, scrollType);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextScrollSubstringToPointMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextScrollSubstringToPointMethod.java
new file mode 100644
index 0000000..0a05f90
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextScrollSubstringToPointMethod.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2CoordTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IntegerField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextScrollSubstringToPointMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField startIndexField, endIndexField;
+ private IA2CoordTypeField coordinateTypeField;
+ private IntegerField xField,yField;
+
+ public IA2TextScrollSubstringToPointMethod(AccessibleText accessibleText) {
+ super("scrollSubstringToPoint",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ startIndexField = new TextOffsetField("startIndex",0,accessibleText); //$NON-NLS-1$
+ endIndexField = new TextOffsetField("endIndex",0,accessibleText); //$NON-NLS-1$
+ coordinateTypeField = new IA2CoordTypeField("coordinateType",IA2.IA2_COORDTYPE_SCREEN_RELATIVE); //$NON-NLS-1$
+ xField = new IntegerField("x",0); //$NON-NLS-1$
+ yField = new IntegerField("y",0); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startIndexField,endIndexField,coordinateTypeField,xField,yField});
+ }
+
+ public boolean invoke() {
+ int startIndex = startIndexField.getIntValue();
+ int endIndex = endIndexField.getIntValue();
+ int coordinateType = coordinateTypeField.getIntValue();
+ int x = xField.getIntValue();
+ int y = yField.getIntValue();
+ boolean success = accessibleText.scrollSubstringToPoint(startIndex, endIndex, coordinateType, x, y);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSelectionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSelectionMethod.java
new file mode 100644
index 0000000..9cca5b6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSelectionMethod.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextSelectionField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+import org.eclipse.swt.graphics.Point;
+
+
+
+
+public class IA2TextSelectionMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextSelectionField selectionIndexField;
+
+ public IA2TextSelectionMethod(AccessibleText accessibleText) {
+ super("selection",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ selectionIndexField = new TextSelectionField("selectionIndex",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{selectionIndexField});
+ }
+
+ public boolean invoke() {
+ int selectionIndex = selectionIndexField.getIntValue();
+ Point selection = accessibleText.getSelection(selectionIndex);
+ if( null != selection ) {
+ result = formatResult("startOffset="+selection.x+", endOffset="+selection.y); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSetCaretOffsetMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSetCaretOffsetMethod.java
new file mode 100644
index 0000000..4c6bc00
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSetCaretOffsetMethod.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextSetCaretOffsetMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField offsetField;
+
+ public IA2TextSetCaretOffsetMethod(AccessibleText accessibleText) {
+ super("setCaretOffset",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField});
+ }
+
+ public boolean invoke() {
+ int offset = offsetField.getIntValue();
+ boolean success = accessibleText.setCaretPosition(offset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSetSelectionMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSetSelectionMethod.java
new file mode 100644
index 0000000..74a777c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextSetSelectionMethod.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextSelectionField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextSetSelectionMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextSelectionField selectionIndexField;
+ private TextOffsetField startOffsetField, endOffsetField;
+
+ public IA2TextSetSelectionMethod(AccessibleText accessibleText) {
+ super("setSelection",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ selectionIndexField = new TextSelectionField("selectionIndex",0,accessibleText); //$NON-NLS-1$
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",0,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{selectionIndexField,startOffsetField,endOffsetField});
+ }
+
+ public boolean invoke() {
+ int selectionIndex = selectionIndexField.getIntValue();
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ boolean success = accessibleText.setSelection(selectionIndex, startOffset, endOffset);
+ result = formatResult(success);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextAfterOffsetMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextAfterOffsetMethod.java
new file mode 100644
index 0000000..a93531f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextAfterOffsetMethod.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.TextSegment;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2TextBoundaryTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextTextAfterOffsetMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField offsetField;
+ private IA2TextBoundaryTypeField boundaryTypeField;
+
+ public IA2TextTextAfterOffsetMethod(AccessibleText accessibleText) {
+ super("textAfterOffset",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ boundaryTypeField = new IA2TextBoundaryTypeField("boundaryType",IA2.IA2_TEXT_BOUNDARY_CHAR); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField,boundaryTypeField});
+ }
+
+ public boolean invoke() {
+ int offset = offsetField.getIntValue();
+ int boundaryType = boundaryTypeField.getIntValue();
+ TextSegment segment = accessibleText.getTextAfterIndex(offset, boundaryType);
+ if( null != segment ) {
+ AttributePropertySource attrSource = new AttributePropertySource(null,formatResult(true));
+ attrSource.put("startOffset", new Integer(segment.start)); //$NON-NLS-1$
+ attrSource.put("endOffset", new Integer(segment.end)); //$NON-NLS-1$
+ attrSource.put("text", segment.text); //$NON-NLS-1$
+ result = attrSource;
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextAtOffsetMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextAtOffsetMethod.java
new file mode 100644
index 0000000..4ab7be5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextAtOffsetMethod.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.TextSegment;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2TextBoundaryTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextTextAtOffsetMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField offsetField;
+ private IA2TextBoundaryTypeField boundaryTypeField;
+
+ public IA2TextTextAtOffsetMethod(AccessibleText accessibleText) {
+ super("textAtOffset",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ boundaryTypeField = new IA2TextBoundaryTypeField("boundaryType",IA2.IA2_TEXT_BOUNDARY_CHAR); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField,boundaryTypeField});
+ }
+
+ public boolean invoke() {
+ int offset = offsetField.getIntValue();
+ int boundaryType = boundaryTypeField.getIntValue();
+ TextSegment segment = accessibleText.getTextAtIndex(offset, boundaryType);
+ if( null != segment ) {
+ AttributePropertySource attrSource = new AttributePropertySource(null,formatResult(true));
+ attrSource.put("startOffset", new Integer(segment.start)); //$NON-NLS-1$
+ attrSource.put("endOffset", new Integer(segment.end)); //$NON-NLS-1$
+ attrSource.put("text", segment.text); //$NON-NLS-1$
+ result = attrSource;
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextBeforeOffsetMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextBeforeOffsetMethod.java
new file mode 100644
index 0000000..4de1b0d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextBeforeOffsetMethod.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.TextSegment;
+import org.eclipse.actf.visualization.gui.msaa.properties.AttributePropertySource;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.IA2TextBoundaryTypeField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextTextBeforeOffsetMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField offsetField;
+ private IA2TextBoundaryTypeField boundaryTypeField;
+
+ public IA2TextTextBeforeOffsetMethod(AccessibleText accessibleText) {
+ super("textBeforeOffset",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ offsetField = new TextOffsetField("offset",0,accessibleText); //$NON-NLS-1$
+ boundaryTypeField = new IA2TextBoundaryTypeField("boundaryType",IA2.IA2_TEXT_BOUNDARY_CHAR); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{offsetField,boundaryTypeField});
+ }
+
+ public boolean invoke() {
+ int offset = offsetField.getIntValue();
+ int boundaryType = boundaryTypeField.getIntValue();
+ TextSegment segment = accessibleText.getTextBeforeIndex(offset, boundaryType);
+ if( null != segment ) {
+ AttributePropertySource attrSource = new AttributePropertySource(null,formatResult(true));
+ attrSource.put("startOffset", new Integer(segment.start)); //$NON-NLS-1$
+ attrSource.put("endOffset", new Integer(segment.end)); //$NON-NLS-1$
+ attrSource.put("text", segment.text); //$NON-NLS-1$
+ result = attrSource;
+ }
+ else {
+ result = formatResult(false);
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextMethod.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextMethod.java
new file mode 100644
index 0000000..cf2ac29
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/msaa/properties/methods/ia2text/IA2TextTextMethod.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.msaa.properties.methods.ia2text;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.AbstractInputField;
+import org.eclipse.actf.visualization.gui.msaa.properties.fields.TextOffsetField;
+import org.eclipse.actf.visualization.gui.msaa.properties.methods.MethodData;
+
+
+
+
+public class IA2TextTextMethod extends MethodData {
+
+ private AccessibleText accessibleText;
+ private TextOffsetField startOffsetField, endOffsetField;
+
+ public IA2TextTextMethod(AccessibleText accessibleText) {
+ super("text",true); //$NON-NLS-1$
+ this.accessibleText = accessibleText;
+ int max = accessibleText.getCharacterCount();
+ startOffsetField = new TextOffsetField("startOffset",0,accessibleText); //$NON-NLS-1$
+ endOffsetField = new TextOffsetField("endOffset",max,accessibleText); //$NON-NLS-1$
+ setInputFields(new AbstractInputField[]{startOffsetField,endOffsetField});
+ }
+
+ public Object getResult() {
+ int startOffset = startOffsetField.getIntValue();
+ int endOffset = endOffsetField.getIntValue();
+ String text = accessibleText.getTextRange(startOffset, endOffset);
+ return formatResult("text="+T(text)); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceConstants.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceConstants.java
new file mode 100644
index 0000000..71775a5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceConstants.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class GuiPreferenceConstants {
+
+ public static final String JAWSTextView_Font = "JAWSTextView_Font"; //$NON-NLS-1$
+
+ public static final String MSAAEventView_Font = "MSAAEventView_Font"; //$NON-NLS-1$
+
+ public static final String AlwaysOnTop = "AlwaysOnTop"; //$NON-NLS-1$
+
+ public static final String UseOverlayWindow = "UseOverlayWindow"; //$NON-NLS-1$
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceInitializer.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceInitializer.java
new file mode 100644
index 0000000..2e29a1e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceInitializer.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.preferences;
+
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class GuiPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = GuiPlugin.getDefault().getPreferenceStore();
+ boolean isAT = MSAA.getScreenReader();
+ store.setDefault(GuiPreferenceConstants.AlwaysOnTop, false);
+ store.setDefault(GuiPreferenceConstants.UseOverlayWindow, !isAT);
+ if( isAT ) {
+ store.setValue(GuiPreferenceConstants.AlwaysOnTop, false);
+ store.setValue(GuiPreferenceConstants.UseOverlayWindow, false);
+ }
+ GuiPreferenceManager.init();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceManager.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceManager.java
new file mode 100644
index 0000000..cb3e18c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferenceManager.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.preferences;
+
+import org.eclipse.actf.util.win32.OverlayWindow;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.ui.actions.WindowListAction;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+
+public class GuiPreferenceManager {
+
+ private static IPreferenceStore preferenceStore = GuiPlugin.getDefault().getPreferenceStore();
+
+ public static void init() {
+ resetOverlayWindow();
+ resetAlwaysOnTop();
+ preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ String name = event.getProperty();
+ if( GuiPreferenceConstants.UseOverlayWindow.equals(name)) {
+ resetOverlayWindow();
+ }
+ else if( GuiPreferenceConstants.AlwaysOnTop.equals(name)) {
+ resetAlwaysOnTop();
+ }
+ }
+ });
+ }
+
+ private static void resetOverlayWindow() {
+ OverlayWindow.setVisible(getPreferenceBoolean(GuiPreferenceConstants.UseOverlayWindow));
+ }
+
+ private static void resetAlwaysOnTop() {
+ WindowListAction.setWindowOrder(getPreferenceBoolean(GuiPreferenceConstants.AlwaysOnTop));
+ }
+
+ public static IPreferenceStore getPreferenceStore() {
+ return preferenceStore;
+ }
+
+ public static String getPreferenceString(String name) {
+ return preferenceStore.getString(name);
+ }
+
+ public static boolean getPreferenceBoolean(String name) {
+ return preferenceStore.getBoolean(name);
+ }
+
+ public static void setPreference(String name, String value) {
+ preferenceStore.setValue(name,value);
+ }
+
+ public static void setPreference(String name, boolean value) {
+ preferenceStore.setValue(name,value);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferencePage.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferencePage.java
new file mode 100644
index 0000000..cc6e7d9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/preferences/GuiPreferencePage.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.preferences;
+
+
+import org.eclipse.actf.util.ui.GroupFieldEditorPreferencePage;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FontFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class GuiPreferencePage extends GroupFieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ private static final String SAMPLE_STRING = "Sample"; //$NON-NLS-1$
+ public GuiPreferencePage() {
+ super();
+ setPreferenceStore(GuiPlugin.getDefault().getPreferenceStore());
+ setDescription(Messages.getString("msaa.preference_description")); //$NON-NLS-1$
+ }
+
+ public void createFieldEditors() {
+ Group jawsGroup = createFieldGroup(Messages.getString("msaa.jaws_simulation")); //$NON-NLS-1$
+ addField(new FontFieldEditor(GuiPreferenceConstants.JAWSTextView_Font,Messages.getString("msaa.font"),SAMPLE_STRING,jawsGroup)); //$NON-NLS-1$
+ Group eventGroup = createFieldGroup(Messages.getString("msaa.msaa_event")); //$NON-NLS-1$
+ addField(new FontFieldEditor(GuiPreferenceConstants.MSAAEventView_Font,Messages.getString("msaa.font"),SAMPLE_STRING,eventGroup)); //$NON-NLS-1$
+ Group accGroup = createFieldGroup(Messages.getString("msaa.vis_label")); //$NON-NLS-1$
+ Label accNote = new Label(accGroup,SWT.NONE);
+ accNote.setText(Messages.getString("msaa.vis_notice") ); //$NON-NLS-1$
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ accNote.setLayoutData(gd);
+ addField(new BooleanFieldEditor(GuiPreferenceConstants.UseOverlayWindow,Messages.getString("msaa.vis_use_overlay"),accGroup)); //$NON-NLS-1$
+ addField(new BooleanFieldEditor(GuiPreferenceConstants.AlwaysOnTop,Messages.getString("msaa.vis_always_top"),accGroup)); //$NON-NLS-1$
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/targetdata/GuiTargetWindowData.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/targetdata/GuiTargetWindowData.java
new file mode 100644
index 0000000..88874a5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/targetdata/GuiTargetWindowData.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.targetdata;
+
+import java.io.File;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.IModelServiceScrollManager;
+import org.eclipse.actf.model.ui.editor.ImagePositionInfo;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.swt.widgets.Composite;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+
+
+
+public class GuiTargetWindowData implements IModelService {
+
+ private static final String categoryBrowser = Messages.getString("msaa.external_browsers"); //$NON-NLS-1$
+ private static final String categoryWindow = Messages.getString("msaa.external_windows"); //$NON-NLS-1$
+ private int hwnd;
+ private boolean isBrowser;
+
+ public GuiTargetWindowData(int hwnd, boolean isBrowser) {
+ this.hwnd = hwnd;
+ this.isBrowser = isBrowser;
+ }
+
+ /**
+ * Get category string for menu bar
+ * @return
+ */
+ public String getCategory() {
+ return isBrowser ? categoryBrowser : categoryWindow;
+ }
+
+ /**
+ * Check if this data source is Web browser
+ * @return
+ */
+ public boolean isBrowser() {
+ return isBrowser;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getTitle()
+ */
+ public String getTitle() {
+ if( 0 != hwnd ) {
+ String title = WindowUtil.GetWindowText(hwnd);
+ if( title.length()==0 ) {
+ title = Messages.getString("msaa.NAMELESS"); //$NON-NLS-1$
+ }
+ return title + " ("+WindowUtil.GetWindowClassName(hwnd)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getID()
+ */
+ public String getID() {
+ return getCategory()+"/"+Integer.toString(hwnd); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getAttribute(java.lang.String)
+ */
+ public Object getAttribute(String name) {
+ if( IModelService.ATTR_WINDOWHANDLE.equals(name) ) {
+ return new Integer(hwnd);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getCurrentMIMEType()
+ */
+ public String getCurrentMIMEType() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getDocument()
+ */
+ public Document getDocument() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getLiveDocument()
+ */
+ public Document getLiveDocument() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getScrollManager()
+ */
+ public IModelServiceScrollManager getScrollManager() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getSupportExtensions()
+ */
+ public String[] getSupportExtensions() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getSupportMIMETypes()
+ */
+ public String[] getSupportMIMETypes() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getTargetComposite()
+ */
+ public Composite getTargetComposite() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#getURL()
+ */
+ public String getURL() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#jumpToNode(org.w3c.dom.Node)
+ */
+ public void jumpToNode(Node target) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#open(java.io.File)
+ */
+ public void open(File target) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#open(java.lang.String)
+ */
+ public void open(String url) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#saveDocumentAsHTMLFile(java.lang.String)
+ */
+ public File saveDocumentAsHTMLFile(String file) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.model.IModelService#setScrollbarWidth(int)
+ */
+ public void setScrollbarWidth(int width) {
+ }
+
+ public File saveOriginalDocument(String file) {
+ return null;
+ }
+
+ public ImagePositionInfo[] getAllImagePosition() {
+ return new ImagePositionInfo[0];
+ }
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/targetdata/GuiTargetWindowDataProvider.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/targetdata/GuiTargetWindowDataProvider.java
new file mode 100644
index 0000000..171159f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/targetdata/GuiTargetWindowDataProvider.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.targetdata;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.util.win32.OverlayWindow;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.actf.visualization.gui.common.TargetWindowDataProvider;
+import org.eclipse.actf.visualization.gui.common.WebBrowserUtil;
+
+
+
+public class GuiTargetWindowDataProvider extends TargetWindowDataProvider {
+
+ public IModelService[] getModelService() {
+ List<GuiTargetWindowData> dsList = new ArrayList<GuiTargetWindowData>();
+ int hwnd = WindowUtil.GetChildWindow (WindowUtil.GetDesktopWindow());
+ while (hwnd != 0) {
+ if( WindowUtil.IsWindowVisible(hwnd) &&
+ !OverlayWindow.WINDOW_TEXT.equals(WindowUtil.GetWindowText(hwnd)) ) {
+ boolean isBrowser = WebBrowserUtil.isBrowserFrame(hwnd);
+ dsList.add(new GuiTargetWindowData(hwnd,isBrowser));
+// if( isBrowser ) {
+// dsList.add(new MSAATargetWindowData(hwnd,false));
+// }
+ }
+ hwnd = WindowUtil.GetNextWindow (hwnd);
+ }
+ return (IModelService[])dsList.toArray(new IModelService[dsList.size()]);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/HideHtmlAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/HideHtmlAction.java
new file mode 100644
index 0000000..ec3a7f9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/HideHtmlAction.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.actions;
+
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.ui.views.MSAATreeContentProvider;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.jface.action.Action;
+
+
+
+
+public class HideHtmlAction extends Action {
+
+ public HideHtmlAction() {
+ super(Messages.getString("msaa.filter_html"), Action.AS_CHECK_BOX); //$NON-NLS-1$
+ }
+
+ public void adjust() {
+ setChecked(MSAATreeContentProvider.getDefault().hideHtml);
+ }
+
+ public void run() {
+ MSAATreeContentProvider.getDefault().hideHtml = isChecked();
+ MSAAViewRegistory.refreshRootObject();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/RefreshRootAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/RefreshRootAction.java
new file mode 100644
index 0000000..101aef0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/RefreshRootAction.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.actions;
+
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.jface.action.Action;
+
+
+
+
+public class RefreshRootAction extends Action {
+
+ public RefreshRootAction() {
+ super(Messages.getString("msaa.refresh")); //$NON-NLS-1$
+ setToolTipText(Messages.getString("msaa.refresh")); //$NON-NLS-1$
+ setImageDescriptor(GuiPlugin.IMAGE_REFRESH);
+ }
+
+ public void run() {
+ MSAAViewRegistory.refreshRootObject();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/ShowOffscreenAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/ShowOffscreenAction.java
new file mode 100644
index 0000000..6815fbb
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/ShowOffscreenAction.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.actions;
+
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.ui.views.MSAATreeContentProvider;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.jface.action.Action;
+
+
+
+
+public class ShowOffscreenAction extends Action {
+
+ public ShowOffscreenAction() {
+ super(Messages.getString("msaa.show_offscreen"), Action.AS_CHECK_BOX); //$NON-NLS-1$
+ }
+
+ public void adjust() {
+ setChecked(MSAATreeContentProvider.getDefault().showOffscreen);
+ }
+
+ public void run() {
+ MSAATreeContentProvider.getDefault().showOffscreen = isChecked();
+ MSAAViewRegistory.refreshRootObject();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/WindowListAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/WindowListAction.java
new file mode 100644
index 0000000..57069f5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/actions/WindowListAction.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.actions;
+
+import java.text.Collator;
+import java.util.Comparator;
+
+import org.eclipse.actf.util.win32.HighlightComposite;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.common.TargetWindow;
+import org.eclipse.actf.visualization.gui.common.TargetWindowDataCollector;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceConstants;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceManager;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ArmEvent;
+import org.eclipse.swt.events.ArmListener;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.internal.win32.OS;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
+import org.eclipse.ui.PlatformUI;
+
+
+public class WindowListAction implements IWorkbenchWindowPulldownDelegate2 {
+
+ private boolean switchPerspective = true;
+
+ private IWorkbenchWindow window;
+
+ public void run(IAction action) {}
+
+ public void selectionChanged(IAction action, ISelection selection) {}
+
+ public void dispose() {}
+
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ public Menu getMenu(Control parent) {
+ return null;
+ }
+
+ public Menu getMenu(Menu parent) {
+ Menu menu = new Menu(parent);
+ menu.addMenuListener(menuListener);
+ return menu;
+ }
+
+ private MenuListener menuListener = new MenuAdapter() {
+ public void menuShown(MenuEvent e) {
+ Menu menu = (Menu)e.getSource();
+ MenuItem[] items = menu.getItems();
+ for( int i=0; i<items.length; i++ ) {
+ items[i].dispose();
+ }
+ String defaultID = TargetWindow.getID();
+ boolean hasEmbedBrowser = false;
+ TargetWindowDataCollector collector = new TargetWindowDataCollector();
+ String[] categories = collector.getCategories(new CategoryComparator());
+ for( int c=0; c<categories.length; c++ ) {
+ String category = categories[c];
+ Menu submenu = menu;
+ if( null != category ) {
+ MenuItem item = new MenuItem(menu,SWT.CASCADE);
+ item.setText(category);
+ submenu = new Menu(item);
+ item.setMenu(submenu);
+ }
+ Object[] elements = collector.getElements(category);
+ for( int i=0; i<elements.length; i++ ) {
+ Object element = elements[i];
+ String title = TargetWindow.getTitle(element);
+ if( null != title ) {
+ hasEmbedBrowser |= TargetWindow.isEmbeddedBrowser(element);
+ MenuItem item = new MenuItem(submenu,SWT.RADIO);
+ item.setText(title);
+ item.setData(element);
+ if( TargetWindow.getID(element).equals(defaultID) ) {
+ item.setSelection(true);
+ }
+ item.addArmListener(armListener);
+ item.addSelectionListener(selectionListener);
+ }
+ }
+ }
+ if( categories.length > 0 ) {
+ new MenuItem(menu,SWT.SEPARATOR);
+ }
+ final MenuItem bringTopItem = new MenuItem(menu,SWT.CHECK);
+ bringTopItem.setText(Messages.getString("msaa.bringToTop")); //$NON-NLS-1$
+ bringTopItem.setSelection(GuiPreferenceManager.getPreferenceBoolean(GuiPreferenceConstants.AlwaysOnTop));
+ if( TargetWindow.isEmbeddedBrowser() ) {
+ bringTopItem.setEnabled(false);
+ }
+ bringTopItem.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ GuiPreferenceManager.setPreference(GuiPreferenceConstants.AlwaysOnTop,bringTopItem.getSelection());
+ }
+ });
+ if( hasEmbedBrowser ) {
+ final MenuItem switchItem = new MenuItem(menu,SWT.CHECK);
+ switchItem.setText(Messages.getString("msaa.switchPerspective")); //$NON-NLS-1$
+ switchItem.setSelection(switchPerspective);
+ switchItem.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ switchPerspective = switchItem.getSelection();
+ if( !switchPerspective ) {
+ showInternalViewer(true);
+ }
+ }
+ });
+ }
+ }
+ };
+
+ private ArmListener armListener = new ArmListener() {
+ public void widgetArmed(ArmEvent e) {
+ Object element = ((MenuItem)e.getSource()).getData();
+ if( null != element ) {
+ int hwnd = TargetWindow.getRootWindow(element);
+ HighlightComposite.flashRectangle(WindowUtil.GetWindowRectangle(hwnd));
+ }
+ }
+ };
+
+ private SelectionListener selectionListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ TargetWindow.setCurrentElement(((MenuItem)event.getSource()).getData());
+ int hwnd = TargetWindow.getWindowHandle();
+ boolean isEmbedded = TargetWindow.isEmbeddedBrowser();
+ try {
+ if( setWindowOrder(GuiPreferenceManager.getPreferenceBoolean(GuiPreferenceConstants.AlwaysOnTop)) ) {
+ OS.BringWindowToTop(hwnd);
+ OS.BringWindowToTop(hwnd);
+ }
+ if( switchPerspective ) {
+ showInternalViewer(isEmbedded);
+ }
+ }
+ catch( Exception e) {
+ e.printStackTrace();
+ }
+ MSAAViewRegistory.refreshRootObject();
+ }
+ };
+
+ private void showInternalViewer(boolean bShow) {
+ try {
+ window.getActivePage().setEditorAreaVisible(bShow);
+ }
+ catch( Exception e ) {
+ }
+ }
+
+ public static boolean setWindowOrder(boolean topMost) {
+ if( topMost && TargetWindow.isEmbeddedBrowser() ) {
+ topMost = false;
+ }
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ OS.SetWindowPos( window.getShell().handle,
+ topMost ? OS.HWND_TOPMOST : OS.HWND_NOTOPMOST,
+ 0, 0, 0, 0, OS.SWP_NOSIZE | OS.SWP_NOMOVE );
+ return topMost;
+ }
+
+ private static final String CATEGORY_BROWSER = Messages.getString("msaa.external_browsers"); //$NON-NLS-1$
+ private static final String CATEGORY_WINDOW = Messages.getString("msaa.external_windows"); //$NON-NLS-1$
+ private class CategoryComparator implements Comparator {
+ private Collator collator = Collator.getInstance();
+ public int compare(Object o1, Object o2) {
+ int w = getWeight(o1);
+ int rc = w-getWeight(o2);
+ return (0==rc && 0==w) ? collator.compare(o1,o2) : rc;
+ }
+ public int getWeight(Object o) {
+ if( null == o ) {return -1;}
+ if( CATEGORY_BROWSER.equals(o) ) {return 1;}
+ if( CATEGORY_WINDOW.equals(o) ) {return 2;}
+ return 0;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/AccessibleObjectSelectionProvider.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/AccessibleObjectSelectionProvider.java
new file mode 100644
index 0000000..d47e350
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/AccessibleObjectSelectionProvider.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+
+
+public abstract class AccessibleObjectSelectionProvider implements ISelectionProvider {
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ public ISelection getSelection() {
+ Object selected = getSelectedAccessibleObject();
+ if( null != selected ) {
+
+ return new StructuredSelection(selected);
+ }
+ return StructuredSelection.EMPTY;
+ }
+
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ public void setSelection(ISelection selection) {
+ }
+
+ public abstract Object getSelectedAccessibleObject();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IFlashDOMView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IFlashDOMView.java
new file mode 100644
index 0000000..94dd9e3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IFlashDOMView.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.swt.graphics.Rectangle;
+
+
+
+public interface IFlashDOMView {
+
+ public void findRectangle(Rectangle flashRect, Object objUnknown);
+
+ public void adjustID();
+
+ public void refresh();
+
+ public void addWindowlessElement(Object objUnknown);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IJAWSTextView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IJAWSTextView.java
new file mode 100644
index 0000000..c67f4a0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IJAWSTextView.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+
+public interface IJAWSTextView {
+
+ public void refresh();
+
+ public void setSelection(AccessibleObject object);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAEventView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAEventView.java
new file mode 100644
index 0000000..92e556c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAEventView.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+public interface IMSAAEventView {
+
+ public void setTTSText(String speakText);
+
+ public void reset();
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAListView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAListView.java
new file mode 100644
index 0000000..0c489e9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAListView.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+
+
+public interface IMSAAListView {
+
+ public void setSelection(AccessibleObject object);
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAOutlineView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAOutlineView.java
new file mode 100644
index 0000000..96f8368
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAOutlineView.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+
+
+public interface IMSAAOutlineView {
+
+ public void refresh();
+
+ public void setSelection(Object element);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAProblemsView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAProblemsView.java
new file mode 100644
index 0000000..4110f9c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAProblemsView.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+public interface IMSAAProblemsView {
+
+ public void refresh();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAPropertiesView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAPropertiesView.java
new file mode 100644
index 0000000..7b03729
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/IMSAAPropertiesView.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.ui.views;
+
+public interface IMSAAPropertiesView {
+
+ public void setInput(Object input);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/JAWSTextView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/JAWSTextView.java
new file mode 100644
index 0000000..8ba8e1a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/JAWSTextView.java
@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.ai.voice.IVoice;
+import org.eclipse.actf.ai.voice.IVoiceEventListener;
+import org.eclipse.actf.ai.voice.VoicePlugin;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceConstants;
+import org.eclipse.actf.visualization.gui.ui.actions.HideHtmlAction;
+import org.eclipse.actf.visualization.gui.ui.actions.RefreshRootAction;
+import org.eclipse.actf.visualization.gui.ui.actions.ShowOffscreenAction;
+import org.eclipse.actf.visualization.gui.util.ScreenReaderRenderer;
+import org.eclipse.actf.visualization.gui.util.TextMap;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.part.ViewPart;
+
+
+public class JAWSTextView extends ViewPart implements IJAWSTextView {
+ public static final String ID = JAWSTextView.class.getName();
+
+ private StyledText text;
+ private RefreshRootAction refreshAction;
+ private ShowOffscreenAction showOffscreenAction;
+ private HideHtmlAction hideHtmlAction;
+ private Action speakAction;
+ private Action speakAllAction;
+ private Action stopAction;
+ private Action openPreferencesAction;
+
+ private IPreferenceStore preferenceStore = GuiPlugin.getDefault().getPreferenceStore();
+
+ private TextMap textMap = new TextMap();
+ private Point lastSelection = null;
+ private boolean ignoreSelection = false;
+
+ public void createPartControl(Composite parent) {
+ text = new StyledText(parent,SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL){
+ public void invokeAction(int action) {
+ super.invokeAction(action);
+ }
+ };
+ text.setEditable(false);
+ text.setLayout(new GridLayout());
+ text.setLayoutData(new GridData());
+ resetFont();
+ preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if( GuiPreferenceConstants.JAWSTextView_Font.equals(event.getProperty())) {
+ resetFont();
+ }
+ }
+ });
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ MSAAViewRegistory.findView(MSAAViewRegistory.MSAAOutlineView_ID);
+ refresh();
+ text.addKeyListener(new KeyAdapter(){
+ public void keyPressed(KeyEvent e) {
+ ScreenReaderRenderer.setBusy(true);
+ }
+ public void keyReleased(KeyEvent e) {
+ ScreenReaderRenderer.setBusy(true);
+ if( SWT.CR == e.keyCode ) {
+ doClick(e);
+ }
+ else if( ' ' == e.keyCode ) {
+ doSelect(e);
+ }
+ else {
+ checkSelection(e);
+ }
+ }
+ });
+ text.setDoubleClickEnabled(false);
+ text.addMouseListener(new MouseAdapter(){
+ public void mouseUp(MouseEvent e) {
+ if( 1 == e.button ) {
+ checkSelection(e);
+ }
+ }
+ public void mouseDoubleClick(MouseEvent e) {
+ if( 1 == e.button ) {
+ doClick(e);
+ }
+ }
+ });
+
+ VoicePlugin.getVoice().setEventListener(new IVoiceEventListener(){
+ public void indexReceived(final int index) {
+ text.getDisplay().asyncExec(new Runnable(){
+ public void run() {
+ selectLine(index);
+ }});
+ }
+ });
+ }
+
+ private void checkSelection(TypedEvent event) {
+ Point newSelection = text.getSelection();
+ if( !newSelection.equals(lastSelection) ) {
+ lastSelection = newSelection;
+ AccessibleObject accObject = textMap.getAccessibleObject(newSelection);
+ if( null != accObject ) {
+ IMSAAOutlineView outlineView = (IMSAAOutlineView)MSAAViewRegistory.findView(MSAAViewRegistory.MSAAOutlineView_ID);
+ if( null != outlineView ) {
+ ignoreSelection = true;
+ try {
+ outlineView.setSelection(accObject);
+ }
+ finally {
+ ignoreSelection = false;
+ }
+ }
+
+ }
+ }
+ }
+
+ private void doClick(TypedEvent event) {
+ AccessibleObject accObject = getSelectedItem();
+ if( null != accObject ) {
+ accObject.doDefaultAction();
+ }
+ }
+
+ private void doSelect(TypedEvent event) {
+ AccessibleObject accObject = getSelectedItem();
+ if( null != accObject ) {
+ accObject.select(MSAA.SELFLAG_TAKEFOCUS);
+ }
+ }
+
+ private AccessibleObject getSelectedItem() {
+ return textMap.getAccessibleObject(text.getSelection());
+ }
+
+ private void resetFont() {
+ FontData fontData = PreferenceConverter.getFontData(preferenceStore,GuiPreferenceConstants.JAWSTextView_Font);
+ text.setFont(new Font(text.getDisplay(), fontData));
+ }
+
+ public void setFocus() {
+ text.setFocus();
+ }
+
+ public void setSelection(AccessibleObject object) {
+ VoicePlugin.getVoice().stop();
+ if( ignoreSelection ) return;
+ object = MSAAViewRegistory.adjustSelection(object);
+ if( null != object ) {
+ Point point = textMap.getPoint(object);
+ if( null != point ) {
+ if( point.x == point.y ) {
+ if( point.x > 0 ) {
+ point.x--;
+ }
+ else if( point.y < text.getCharCount() ) {
+ point.y++;
+ }
+ }
+ text.setSelection(point.x,point.y);
+ }
+ }
+ }
+
+ public void refresh() {
+ AccessibleObject object = MSAAViewRegistory.adjustSelection(null);
+ VoicePlugin.getVoice().stop();
+ if( null == object ) {
+ setText(Messages.getString("msaa.jaws.notarget"),SWT.COLOR_DARK_GRAY); //$NON-NLS-1$
+ }
+ else {
+ new ScreenReaderRenderer(text,textMap).renderAll(object);
+ }
+ }
+
+ private void setText(String message, int color) {
+ text.setText(message);
+ StyleRange range = new StyleRange();
+ range.foreground = Display.getCurrent().getSystemColor(color);
+ range.start = 0;
+ range.length = text.getCharCount();
+ text.setStyleRange(range);
+ }
+
+ private void selectLine(int line) {
+ if( -1 == line ) {
+ Point selection = text.getSelection();
+ if( selection.x != selection.y ) {
+ text.setSelection(selection.y,selection.y);
+ }
+ return;
+ }
+ int start = text.getOffsetAtLine(line);
+ int end = start + text.getContent().getLine(line).length();
+ text.setSelection(start,end);
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ JAWSTextView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(text);
+ text.setMenu(menu);
+ getSite().registerContextMenu(menuMgr, new AccessibleObjectSelectionProvider(){
+ public Object getSelectedAccessibleObject() {
+ return getSelectedItem();
+ }
+ });
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(showOffscreenAction);
+ manager.add(new Separator());
+ manager.add(hideHtmlAction);
+ manager.addMenuListener(new IMenuListener(){
+ public void menuAboutToShow(IMenuManager manager) {
+ showOffscreenAction.adjust();
+ hideHtmlAction.adjust();
+ }
+ });
+ manager.add(new Separator());
+ manager.add(openPreferencesAction);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ // Other plug-ins can contribute there actions here
+ manager.add(speakAction);
+ manager.add(new Separator());
+ manager.add(speakAllAction);
+ manager.add(stopAction);
+ manager.add(new Separator());
+ manager.add(refreshAction);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(refreshAction);
+ manager.add(speakAllAction);
+ manager.add(stopAction);
+ }
+
+ private void makeActions() {
+ refreshAction = new RefreshRootAction();
+ showOffscreenAction = new ShowOffscreenAction();
+ hideHtmlAction = new HideHtmlAction();
+
+ speakAction = new Action(Messages.getString("msaa.speak_here")) { //$NON-NLS-1$
+ public void run() {
+ IVoice voice = VoicePlugin.getVoice();
+ try {
+ voice.stop();
+ int lineCount = text.getLineCount();
+ int offset = text.getSelection().x;
+ int startLine = text.getLineAtOffset(offset);
+ for( int line = startLine; line < lineCount ;line++ ) {
+ voice.speak(text.getContent().getLine(line),false,line);
+ }
+ }
+ catch( Exception e) {
+ }
+ }
+ };
+ speakAllAction = new Action(Messages.getString("msaa.speak")) { //$NON-NLS-1$
+ public void run() {
+ text.setCaretOffset(0);
+ speakAction.run();
+ }
+ };
+ speakAllAction.setToolTipText(Messages.getString("msaa.speak_tip")); //$NON-NLS-1$
+ speakAllAction.setImageDescriptor(GuiPlugin.IMAGE_SPEAK);
+
+ stopAction = new Action(Messages.getString("msaa.stop")) { //$NON-NLS-1$
+ public void run() {
+ VoicePlugin.getVoice().stop();
+ selectLine(-1);
+ }
+ };
+ stopAction.setToolTipText(Messages.getString("msaa.stop_tip")); //$NON-NLS-1$
+ stopAction.setImageDescriptor(GuiPlugin.IMAGE_STOP);
+
+ final Shell shell = this.getViewSite().getShell();
+ openPreferencesAction = new Action(Messages.getString("msaa.preferences")) { //$NON-NLS-1$
+ public void run() {
+ PreferencesUtil
+ .createPreferenceDialogOn(shell, "org.eclipse.actf.visualization.gui.preferences.GuiPreferencePage", null, null) //$NON-NLS-1$
+ .open();
+ }
+ };
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAEventView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAEventView.java
new file mode 100644
index 0000000..0196d98
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAEventView.java
@@ -0,0 +1,669 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.AccessibleObjectFactory;
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventListener;
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventMonitor;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.TextSegment;
+import org.eclipse.actf.ai.voice.VoicePlugin;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceConstants;
+import org.eclipse.actf.visualization.gui.util.ScreenReaderRenderer;
+import org.eclipse.actf.visualization.gui.util.TTSMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.dialogs.ListSelectionDialog;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+public class MSAAEventView extends ViewPart implements IMSAAEventView, IAccessibleEventListener {
+ public static final String ID = MSAAEventView.class.getName();
+
+ private StyledText text;
+ private Action clearAction;
+ private Action speakEventAction;
+ private Action openPreferencesAction;
+ private Action eventFilterAction;
+ private Action showTTSEventAction;
+
+ private boolean showRawEvent = false;
+
+ private IPreferenceStore preferenceStore = GuiPlugin.getDefault().getPreferenceStore();
+
+ private static final int[] SUPPORTED_EVENTS = new int[] {
+ 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, 0x008, 0x009, 0x00A, 0x00B, 0x00C, 0x00D, 0x00E, 0x00F,
+ 0x010, 0x011, 0x012, 0x013, 0x014, 0x015, 0x016, 0x017,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, 0x800C, 0x800D, 0x800E, 0x800F,
+ 0x8010, 0x8011, 0x8012,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10A, 0x10B, 0x10C, 0x10D, 0x10E, 0x10F,
+ 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11A, 0x11B, 0x11C, 0x11D, 0x11E, 0x11F,
+ 0x120, 0x121, 0x122
+ };
+
+ private static final int[] DEFAULT_EVENTS = new int[] {
+ MSAA.EVENT_OBJECT_FOCUS,
+ };
+
+ private IAccessibleEventMonitor monitor = null;
+
+ /**
+ * The constructor.
+ */
+ public MSAAEventView() {
+ }
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ text = new StyledText(parent,SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL);
+ text.setEditable(false);
+ text.setLayout(new GridLayout());
+ text.setLayoutData(new GridData());
+ resetFont();
+ preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if( GuiPreferenceConstants.MSAAEventView_Font.equals(event.getProperty())) {
+ resetFont();
+ }
+ }
+ });
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ reset();
+ TTSMonitor.startThread(this);
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ MSAAEventView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(text);
+ text.setMenu(menu);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(eventFilterAction);
+// manager.add(showTTSEventAction); // TODO: Tempolary disabled for alphaWorks. To be restored for ACTF
+ manager.add(new Separator());
+ manager.add(speakEventAction);
+ manager.add(new Separator());
+ manager.add(openPreferencesAction);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(clearAction);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(clearAction);
+ }
+
+ private void makeActions() {
+ clearAction = new Action() {
+ public void run() {
+ text.setText(""); //$NON-NLS-1$
+ }
+ };
+ clearAction.setText(Messages.getString("msaa.clear")); //$NON-NLS-1$
+ clearAction.setToolTipText(Messages.getString("msaa.clear_tip")); //$NON-NLS-1$
+ clearAction.setImageDescriptor(GuiPlugin.IMAGE_CLEAR);
+
+ speakEventAction = new Action(Messages.getString("msaa.speak_event"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ }
+ };
+
+ final Shell shell = this.getViewSite().getShell();
+ openPreferencesAction = new Action(Messages.getString("msaa.preferences")) { //$NON-NLS-1$
+ public void run() {
+ PreferencesUtil
+ .createPreferenceDialogOn(shell, "org.eclipse.actf.visualization.gui.preferences.GuiPreferencePage", null, null) //$NON-NLS-1$
+ .open();
+ }
+ };
+
+ showTTSEventAction = new Action(Messages.getString("msaa.showTTSEvents"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ }
+ };
+ showTTSEventAction.setChecked(true);
+
+ eventFilterAction = new Action(Messages.getString("msaa.filters_menu")) { //$NON-NLS-1$
+ public void run() {
+ EventFiltersDialog dialog = new EventFiltersDialog(shell,intArrayToObjectArray(SUPPORTED_EVENTS),showRawEvent);
+ if( Window.OK == dialog.open() ) {
+ filters.clear();
+ Object[] result= dialog.getResult();
+ for( int i=0; i<result.length; i++ ) {
+ filters.put(result[i],Boolean.TRUE);
+ }
+ showRawEvent = dialog.getShowDetails();
+ if( null != monitor ) {
+ monitor.installEventHook(MSAAEventView.this, getFilter());
+ }
+ }
+ }
+ };
+ }
+
+ class EventFiltersDialog extends ListSelectionDialog {
+ private boolean showDetails;
+ private Button showDetailsButton;
+
+ public EventFiltersDialog(Shell parentShell, Integer[] input, boolean showDetails) {
+ super(parentShell, input, new EventFiltersContentProvider(), new EventFiltersLabelProvider(), Messages.getString("msaa.filters_message")); //$NON-NLS-1$
+ setTitle(Messages.getString("msaa.filters_title")); //$NON-NLS-1$
+ List<Integer> initialSelection = new ArrayList<Integer>();
+ for( int i=0; i<input.length; i++ ) {
+ if( getFilterEnabled(input[i].intValue()) ) {
+ initialSelection.add(input[i]);
+ }
+ }
+ setInitialElementSelections(initialSelection);
+ this.showDetails = showDetails;
+ }
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite)super.createDialogArea(parent);
+ Control[] children = composite.getChildren();
+ Composite buttonComposite = (Composite)children[children.length-1];
+ Button defaultButton = new Button(buttonComposite,SWT.PUSH);
+ defaultButton.setText(Messages.getString("msaa.filters_default")); //$NON-NLS-1$
+ defaultButton.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ getViewer().setCheckedElements(intArrayToObjectArray(DEFAULT_EVENTS));
+ showDetailsButton.setSelection(false);
+ }
+ });
+ showDetailsButton = new Button(composite,SWT.CHECK);
+ showDetailsButton.setText(Messages.getString("msaa.showRawEvents")); //$NON-NLS-1$
+ showDetailsButton.setSelection(showDetails);
+ showDetailsButton.setFont(parent.getFont());
+ // Adjust button layout
+ showDetailsButton.moveAbove(buttonComposite);
+ ((GridLayout)buttonComposite.getLayout()).numColumns++;
+ defaultButton.moveAbove(null);
+ return composite;
+ }
+ protected void okPressed() {
+ showDetails = showDetailsButton.getSelection();
+ super.okPressed();
+ }
+ public boolean getShowDetails() {
+ return showDetails;
+ }
+ }
+
+ class EventFiltersContentProvider implements IStructuredContentProvider {
+ public Object[] getElements(Object input) {
+ if( input instanceof Integer[] ) {
+ return (Object[])input;
+ }
+ return new Object[0];
+ }
+ public void inputChanged(Viewer viewer, Object a, Object b) {}
+ public void dispose() {}
+ };
+
+ class EventFiltersLabelProvider extends LabelProvider {
+ public String getText(Object element) {
+ if( element instanceof Integer ) {
+ return MSAA.getEventTypeText(((Integer)element).intValue());
+ }
+ return null;
+ }
+ };
+
+ private Integer[] intArrayToObjectArray(int[] intArray) {
+ Integer[] objArray = new Integer[intArray.length];
+ for( int i=0; i<intArray.length; i++ ) {
+ objArray[i] = new Integer(intArray[i]);
+ }
+ return objArray;
+ }
+
+ private void resetFont() {
+ FontData fontData = PreferenceConverter.getFontData(preferenceStore,GuiPreferenceConstants.MSAAEventView_Font);
+ text.setFont(new Font(text.getDisplay(), fontData));
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ text.setFocus();
+ }
+
+ public void dispose() {
+ super.dispose();
+ TTSMonitor.stopThread();
+ if( null != monitor ) {
+ monitor.removeEventHook();
+ monitor = null;
+ }
+ }
+
+
+ private void showEventInfo(int event, int hwnd, int idObject, int idChild, AccessibleObject accObject) {
+ if( text.isDisposed() || text.isFocusControl() ) {
+ return;
+ }
+ boolean release = false;
+ if( null == accObject) {
+ accObject = AccessibleObjectFactory.getAccessibleObjectFromEvent(hwnd,idObject,idChild);
+ release = true;
+ }
+ if( null!=accObject ) {
+ int accRole = accObject.getAccRole();
+ int accState = accObject.getAccState();
+ boolean ignore = 0!=(accState & MSAA.STATE_INVISIBLE);
+ if( !ignore ) {
+ switch( event ) {
+ case MSAA.EVENT_OBJECT_FOCUS:
+ Accessible2 accExt = accObject.getAccessible2();
+ if( null != accExt ) {
+ IMSAAOutlineView outlineView = (IMSAAOutlineView)MSAAViewRegistory.findView(MSAAViewRegistory.MSAAOutlineView_ID);
+ if( null != outlineView ) {
+ AccessibleObject accTarget = getCachedChildFromUID(MSAAViewRegistory.rootObject,accExt.getUniqueID());
+ outlineView.setSelection(accTarget);
+ if( null == accTarget ) {
+ release = !MSAAViewRegistory.showProperties(accObject);
+ }
+ }
+ }
+ break;
+ case MSAA.EVENT_OBJECT_NAMECHANGE:
+ break;
+ case MSAA.EVENT_OBJECT_STATECHANGE:
+ case MSAA.EVENT_OBJECT_VALUECHANGE:
+ ignore = 0==(MSAA.STATE_FOCUSED&accState);
+ break;
+ case MSAA.EVENT_OBJECT_CREATE:
+ // For refresh IE
+ if( MSAA.ROLE_SYSTEM_PANE==accRole ) {
+ if( validate(MSAAViewRegistory.rootObject,5,10) ) {
+ break; // Skip banner window
+ }
+ if( delayedRefresh(2000) ) {
+ break;
+ }
+ }
+ ignore = true;
+ break;
+ }
+ }
+ if( !ignore && getFilterEnabled(event) ) {
+ checkInterval();
+ int buttonIndex = -1;
+ if( MSAA.ROLE_SYSTEM_PUSHBUTTON == accRole ) {
+ buttonIndex = getChildIndex(accObject);
+ }
+ if( showRawEvent/*Action.isChecked()*/ ) {
+ text.append("event="+MSAA.getEventTypeText(event) +", "+ //$NON-NLS-1$ //$NON-NLS-2$
+ "accName="+accObject.getAccName() +", "+ //$NON-NLS-1$ //$NON-NLS-2$
+ "accRole="+accObject.getRoleText() +", "+ //$NON-NLS-1$ //$NON-NLS-2$
+ "accState="+MSAA.getStateText(accState) +"(0x"+Integer.toHexString(accState)+")\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ String str = null;
+ boolean doRender = true;
+ switch( event ) {
+ case IA2.IA2_EVENT_TEXT_CARET_MOVED:
+ AccessibleText accText = accObject.getAccessibleText();
+ if( null != accText ) {
+ Point selection = accText.getSelection(0);
+ if( null != selection ) {
+ str = accText.getTextRange(selection.x,selection.y);
+ }
+ else {
+ TextSegment ts = accText.getTextAtIndex(accText.getCaretPosition(),IA2.IA2_TEXT_BOUNDARY_CHAR);
+ if( null != ts ) {
+ str = ts.text;
+ }
+ }
+ if( null != str ) {
+ text.append(" "); //$NON-NLS-1$
+ StyleRange range = new StyleRange();
+ range.background = Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW);
+ range.start = text.getCharCount();
+ range.length = str.length();
+ text.append(str);
+ text.setStyleRange(range);
+ }
+ }
+ doRender = false;
+ break;
+ case IA2.IA2_EVENT_TEXT_SELECTION_CHANGED:
+ doRender = false;
+ break;
+ }
+ if( doRender ) {
+ ScreenReaderRenderer renderer = new ScreenReaderRenderer(text,null);
+ str = renderer.renderEvent(event);
+ if( 0==str.length() ) {
+ str = renderer.renderItem(accObject,false,buttonIndex);
+ }
+ }
+ text.setSelection(text.getCharCount());
+ if( speakEventAction.isChecked() ) {
+ if( null != str && str.length() > 0 ) {
+ VoicePlugin.getVoice().speak(str,true);
+ }
+ }
+ }
+ if( release ) {
+ AccessibleObject parent = accObject.getCachedParent();
+ try {
+ if( null != parent ) {
+ parent.dispose();
+ }
+ else {
+ accObject.dispose();
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private boolean refreshing = false;
+ private boolean delayedRefresh(int delayMS) {
+ if( refreshing ) {
+ return false;
+ }
+ refreshing = true;
+ text.getDisplay().timerExec(delayMS,new Runnable(){
+ public void run() {
+ try {
+ if( !text.isDisposed() ) {
+ MSAAViewRegistory.refreshRootObject();
+ }
+ }
+ finally {
+ refreshing = false;
+ }
+ }
+ });
+ return true;
+ }
+
+ private Map filters = getDefaultFilters();
+
+ private Map getDefaultFilters() {
+ Map defaultFilters = new HashMap();
+ for( int i=0; i<DEFAULT_EVENTS.length; i++ ) {
+ defaultFilters.put(new Integer(DEFAULT_EVENTS[i]), Boolean.TRUE);
+ }
+ return defaultFilters;
+ }
+
+ public boolean getFilterEnabled(int event) {
+ Integer key = new Integer(event);
+
+ Boolean enabled = (Boolean)filters.get(key);
+ if( null == enabled ) {
+ enabled = Boolean.FALSE;
+ filters.put(key, enabled);
+ }
+ return enabled.booleanValue();
+ }
+
+ public void setTTSText(final String speakText) {
+ if( null != speakText && speakText.length() > 0 ) {
+ text.getDisplay().asyncExec(new Runnable(){
+ public void run() {
+ if( text.isFocusControl() || !showTTSEventAction.isChecked() ) {
+ return;
+ }
+ checkInterval();
+ StyleRange range = new StyleRange();
+ range.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN);
+ range.start = text.getCharCount();
+ range.length = speakText.length();
+ text.append(speakText);
+ text.setStyleRange(range);
+ text.setSelection(text.getCharCount());
+ if( speakEventAction.isChecked() ) {
+ VoicePlugin.getVoice().speak(speakText,true);
+ }
+ }
+ });
+ }
+ }
+
+ private long lastTime = 0;
+ private void checkInterval() {
+ long currentTime = System.currentTimeMillis();
+ if( 0 != lastTime ) {
+ try {
+ long passed = Math.abs(currentTime - lastTime);
+ if( passed > 1000 ) {
+ String separatorString = MessageFormat.format(Messages.getString("msaa.ns_passed"),new Object[]{new Float(((float)passed)/1000)}); //$NON-NLS-1$
+ StyleRange range = new StyleRange();
+ range.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
+ range.start = text.getCharCount();
+ int lastPos = range.start-1;
+ if( lastPos > 0 && !"\n".equals(text.getText(lastPos,lastPos)) ) { //$NON-NLS-1$
+ text.append("\n"); //$NON-NLS-1$
+ }
+ text.append(separatorString);
+ text.append("\n"); //$NON-NLS-1$
+ range.length = text.getCharCount()-range.start;
+ text.setStyleRange(range);
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+ lastTime = currentTime;
+ }
+
+ public void handleEvent(final int event, final int hwnd, final int idObject, final int idChild, final AccessibleObject accObject) {
+ if( checkShowInfo(event, hwnd) ) {
+ text.getDisplay().asyncExec(new Runnable(){
+ public void run() {
+ showEventInfo(event,hwnd,idObject,idChild,accObject);
+ }
+ });
+ }
+ }
+
+ private Set getFilter() {
+ Set enabledSet = new HashSet();
+ for( Iterator it = filters.keySet().iterator(); it.hasNext(); ) {
+ Object key = it.next();
+ Boolean enabled = (Boolean)filters.get(key);
+ if( null != enabled && enabled.booleanValue() ) {
+ enabledSet.add(key);
+ }
+ }
+ enabledSet.add(new Integer(MSAA.EVENT_OBJECT_CREATE)); // For refresh IE
+ return enabledSet;
+ }
+
+ private boolean checkShowInfo(int event, int hwnd) {
+ boolean showInfo = false;
+ if( 0 == MSAAViewRegistory.getUpdateRef() && null != MSAAViewRegistory.rootObject ) {
+ if( null != MSAA.getEventTypeText(event) ) {
+ int hwndRoot = MSAAViewRegistory.rootObject.getWindow();
+ if( 0 !=hwndRoot ) {
+ showInfo = MSAA.EVENT_OBJECT_FOCUS==event && WindowUtil.isPopupMenu(hwnd);
+ for( int hwndParent = hwnd; !(showInfo || 0==hwndParent); hwndParent = WindowUtil.GetParentWindow(hwndParent) ) {
+ showInfo = (hwndRoot == hwndParent);
+ }
+ }
+ }
+ }
+ return showInfo;
+ }
+
+ private static AccessibleObject getCachedChildFromUID(AccessibleObject root,int uid) {
+ Accessible2 accessible2 = root.getAccessible2();
+ if( null != accessible2 && uid == accessible2.getUniqueID() ) {
+ return root;
+ }
+ AccessibleObject cachedChildren[] = root.getCachedChildren();
+ for( int i=0; i<cachedChildren.length; i++ ) {
+ AccessibleObject accObj = getCachedChildFromUID(cachedChildren[i],uid);
+ if( null != accObj ) {
+ return accObj;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get index number (for JAWS simulation)
+ * @return
+ */
+ private static int getChildIndex(AccessibleObject accObject) {
+ AccessibleObject disposeLater = null;
+ try {
+ AccessibleObject parent = accObject.getCachedParent();
+ if( null==parent ) {
+ parent = disposeLater = accObject.getAccParent();
+ if( null==parent ) return 0;
+ }
+ AccessibleObject[] children = parent.getChildren();
+ Rectangle myRect = accObject.getAccLocation();
+ if( null != myRect ) {
+ for( int i=0; i<children.length; i++ ) {
+ if( accObject.equals(children[i]) ||
+ myRect.equals(children[i].getAccLocation()) ) {
+ return i;
+ }
+ }
+ }
+ }
+ finally {
+ if( null != disposeLater ) {
+ try {
+ disposeLater.dispose();
+ }
+ catch( Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return 0;
+ }
+
+ private static boolean validate(AccessibleObject accValidate, int depth, int bound) {
+ if (null == accValidate.getAccName() &&
+ null == accValidate.getAccLocation() &&
+ null == accValidate.getAccKeyboardShortcut()) {
+ return false;
+ }
+ AccessibleObject parent = accValidate.getCachedParent();
+ AccessibleObject[] children = accValidate.getCachedChildren();
+ if( null==parent && children.length==0 ) {
+ return false;
+ }
+ if (depth-- > 0) {
+ int max = children.length;
+ int len = Math.min(max,bound);
+ for (int i = 0; i < len; i++) {
+ AccessibleObject ao = children[i];
+ if (null!=ao && !validate(ao,depth,bound)) {
+ return false;
+ }
+ }
+ len = max - len;
+ if( len > 0 ) {
+ for (int i = 0; i < len; i++) {
+ AccessibleObject ao = children[max-1-i];
+ if (null!=ao && !validate(ao,depth,bound)) {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public void reset() {
+ if( null != monitor ) {
+ monitor.removeEventHook();
+ monitor = null;
+ }
+ monitor = AccessibleObjectFactory.getAccessibleEventMonitor();
+ if( null != monitor ) {
+ monitor.installEventHook(this, getFilter());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAListView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAListView.java
new file mode 100644
index 0000000..90e4a2a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAListView.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.util.win32.HighlightComposite;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableColorProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+
+public class MSAAListView extends ViewPart implements IMSAAListView {
+ public static final String ID = MSAAListView.class.getName();
+
+ private static final String[] HEADINGS = { "#", Messages.getString("msaa.name"), Messages.getString("msaa.role"), Messages.getString("msaa.state"), "X", "Y", "W", "H"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+ private static final int[] WEIGHTS = { 1,5,5,5,1,1,1,1 };
+ private static final int[] ALIGNMENTS = { SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.RIGHT, SWT.RIGHT, SWT.RIGHT, SWT.RIGHT };
+
+ private TableViewer viewer;
+
+ private MSAASiblingViewerSorter sorter = new MSAASiblingViewerSorter();
+ private boolean suppressHilight = false;
+
+ private Action refreshAction;
+ private AccessibleObject objectOnAppear = null;
+ private static final MSAATreeContentProvider provider = MSAATreeContentProvider.getDefault();
+
+ private static final Color GRAY_COLOR = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
+
+
+
+ /**
+ * The constructor.
+ */
+ public MSAAListView() {
+ }
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ Table table = new Table(parent,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ for( int i=0; i<HEADINGS.length; i++ ) {
+ layout.addColumnData(new ColumnWeightData(WEIGHTS[i]));
+ TableColumn tc = new TableColumn(table, SWT.NONE);
+ tc.setText(HEADINGS[i]);
+ tc.setAlignment(ALIGNMENTS[i]);
+ tc.setResizable(true);
+ final int newSortingColumn = i+1;
+ tc.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ if( newSortingColumn== sorter.sortingColumn ) {
+ sorter.sortingColumn = -newSortingColumn;
+ }
+ else {
+ sorter.sortingColumn = newSortingColumn;
+ }
+ viewer.refresh();
+ }
+ });
+ }
+
+ viewer = new TableViewer(table);
+ MSAASiblingContentAndLabelProvider provider = new MSAASiblingContentAndLabelProvider();
+ viewer.setContentProvider(provider);
+ viewer.setLabelProvider(provider);
+ viewer.setSorter(sorter);
+ viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+ public void selectionChanged(SelectionChangedEvent event) {
+ if( suppressHilight ) return;
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedElement instanceof AccessibleObject) {
+ AccessibleObject object = (AccessibleObject) selectedElement;
+ if (null != object) {
+ IMSAAOutlineView outlineView = (IMSAAOutlineView)MSAAViewRegistory.findView(MSAAViewRegistory.MSAAOutlineView_ID);
+ if( null != outlineView ) {
+ outlineView.setSelection(object);
+ }
+ else {
+ HighlightComposite.flashRectangle(object.getAccLocation());
+ }
+ }
+ }
+ }
+
+ }
+ });
+
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ if( null != MSAAViewRegistory.outlineObject ) {
+ setSelection(MSAAViewRegistory.outlineObject);
+ }
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ if( null != objectOnAppear ) {
+ setSelection(objectOnAppear);
+ }
+ }
+
+ public void setSelection(AccessibleObject object) {
+ if( !viewer.getControl().isVisible() ) {
+ objectOnAppear = object;
+ return;
+ }
+ objectOnAppear = null;
+ suppressHilight = true;
+ AccessibleObject newInput = object.getCachedParent();
+ if( null != newInput ) {
+ AccessibleObject oldInput = (AccessibleObject)viewer.getInput();
+ if( oldInput != newInput ) {
+ viewer.setInput(newInput);
+ }
+ }
+ viewer.setSelection(new StructuredSelection(object),true);
+ suppressHilight = false;
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ MSAAListView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(refreshAction);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(refreshAction);
+ }
+
+ private void makeActions() {
+ refreshAction = new Action(Messages.getString("msaa.refresh")) { //$NON-NLS-1$
+ public void run() {
+ viewer.refresh();
+ }
+ };
+ refreshAction.setToolTipText(Messages.getString("msaa.refresh")); //$NON-NLS-1$
+ refreshAction.setImageDescriptor(GuiPlugin.IMAGE_REFRESH);
+ }
+
+ private class MSAASiblingContentAndLabelProvider extends LabelProvider implements IStructuredContentProvider,
+ IPropertyChangeListener, ITableLabelProvider, ITableColorProvider {
+
+ private Object[] lastElements;
+
+ public MSAASiblingContentAndLabelProvider() {
+ super();
+ }
+
+ public Object[] getElements(Object inputElement) {
+ lastElements = null;
+ if( inputElement instanceof AccessibleObject ) {
+ Object[] accChildren = provider.getElements(inputElement);
+ List childList = new Vector();
+ for (int i = 0; i < accChildren.length; i++) {
+ try {
+ int visibleState = ((AccessibleObject)accChildren[i]).getAccState() & (MSAA.STATE_INVISIBLE|MSAA.STATE_OFFSCREEN);
+ if( MSAA.STATE_INVISIBLE != visibleState ) {
+ childList.add(accChildren[i]);
+ }
+ } catch (Exception e) {
+ }
+ ;
+ }
+ lastElements = childList.toArray();
+ }
+ return lastElements;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /*
+ * IPropertyChangeListener
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ }
+
+ /*
+ * ITableLabelProvider
+ */
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if( element instanceof AccessibleObject ) {
+ switch( columnIndex ) {
+ case 0:
+ if( null!=lastElements ) {
+ for( int i=0; i<lastElements.length; i++ ) {
+ if( element.equals(lastElements[i]) ) {
+ return Integer.toString(i+1);
+ }
+ }
+ }
+ return ""; //$NON-NLS-1$
+ case 1:
+ return ((AccessibleObject)element).getAccName();
+ case 2:
+ return ((AccessibleObject)element).getRoleText();
+ case 3:
+ return MSAA.getStateText(((AccessibleObject)element).getAccState());
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ Rectangle location = ((AccessibleObject)element).getAccLocation();
+ if( null==location ) return ""; //$NON-NLS-1$
+ switch( columnIndex-4 ) {
+ case 0: return Integer.toString(location.x);
+ case 1: return Integer.toString(location.y);
+ case 2: return Integer.toString(location.width);
+ case 3: return Integer.toString(location.height);
+ }
+ default:
+ return "?"; //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element, int columnIndex) {
+ return null;
+ }
+
+ public Color getForeground(Object element, int columnIndex) {
+ if( element instanceof AccessibleObject ) {
+ int accState = ((AccessibleObject)element).getAccState();
+ if( 0 != (accState & MSAA.STATE_INVISIBLE) ) {
+ return GRAY_COLOR;
+ }
+ }
+ return null;
+ }
+ }
+
+ private class MSAASiblingViewerSorter extends ViewerSorter {
+
+ public int sortingColumn = 0;
+
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if( 0 != sortingColumn && viewer instanceof TableViewer ) {
+ IBaseLabelProvider labelProvider = ((TableViewer)viewer).getLabelProvider();
+ if( labelProvider instanceof ITableLabelProvider ) {
+ int columnIndex = Math.abs(sortingColumn)-1;
+ String s1 = ((ITableLabelProvider)labelProvider).getColumnText(e1,columnIndex);
+ String s2 = ((ITableLabelProvider)labelProvider).getColumnText(e2,columnIndex);
+ int result = 0;
+ switch( columnIndex ) {
+ default:
+ try {
+ result = Integer.parseInt(s1)-Integer.parseInt(s2);
+ break;
+ }
+ catch( Exception e ) {
+ }
+ case 1:
+ case 2:
+ case 3:
+ result = collator.compare(s1,s2);
+ break;
+ }
+ return sortingColumn > 0 ? result : -result;
+ }
+ }
+ return 0;
+ }
+
+ }}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAOutlineView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAOutlineView.java
new file mode 100644
index 0000000..70b062d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAOutlineView.java
@@ -0,0 +1,538 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import java.util.Stack;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.util.win32.HighlightComposite;
+import org.eclipse.actf.util.win32.OverlayLabel;
+import org.eclipse.actf.visualization.gui.GuiImages;
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.flash.FlashUtil;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceConstants;
+import org.eclipse.actf.visualization.gui.preferences.GuiPreferenceManager;
+import org.eclipse.actf.visualization.gui.ui.actions.HideHtmlAction;
+import org.eclipse.actf.visualization.gui.ui.actions.RefreshRootAction;
+import org.eclipse.actf.visualization.gui.ui.actions.ShowOffscreenAction;
+import org.eclipse.actf.visualization.gui.util.AccessiblePropertyUtil;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeViewerListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeExpansionEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ArmEvent;
+import org.eclipse.swt.events.ArmListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.part.ViewPart;
+
+
+public class MSAAOutlineView extends ViewPart implements IMSAAOutlineView {
+ public static final String ID = MSAAOutlineView.class.getName();
+
+ private TreeViewer viewer;
+
+ private Action expandAction;
+ private Action expandAllAction;
+
+ private Action collapseAllAction;
+
+ private RefreshRootAction refreshAction;
+
+ private HideHtmlAction hideHtmlAction;
+
+ private ShowOffscreenAction showOffscreenAction;
+
+ private Action runCheckerAction;
+
+ private Action showLabelsAction;
+
+ private boolean suppressLabelAdjust = false;
+
+ private boolean ignoreSelection = false;
+
+ private boolean hideHtml = false;
+
+ /**
+ * The constructor.
+ */
+ public MSAAOutlineView() {
+ }
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setContentProvider(MSAATreeContentProvider.getDefault());
+ viewer.setLabelProvider(new MSAATreeLabelProvider());
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object selectedObject = ((IStructuredSelection) selection).getFirstElement();
+ if( null != selectedObject ) {
+ if( !ignoreSelection ) {
+ MSAAViewRegistory.outlineSelected(selectedObject);
+ }
+ if (!suppressLabelAdjust && showLabelsAction.isChecked()) {
+ showOverlayLabels();
+ }
+ }
+ else {
+ HighlightComposite.show(false);
+ }
+ }
+ }
+
+ });
+ viewer.addTreeListener(new ITreeViewerListener() {
+ public void treeCollapsed(TreeExpansionEvent event) {
+ refreshLabels();
+ }
+
+ public void treeExpanded(TreeExpansionEvent event) {
+ refreshLabels();
+ }
+ });
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ MSAAViewRegistory.refreshRootObject();
+ MSAAViewRegistory.showView(MSAAViewRegistory.MSAAEventView_ID, false); }
+
+ private void refreshLabels() {
+ if (showLabelsAction.isChecked()) {
+ viewer.getControl().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ showOverlayLabels();
+ }
+ });
+ }
+ }
+
+ public void refresh() {
+ hideHtml = MSAATreeContentProvider.getDefault().hideHtml;
+ OverlayLabel.removeAll();
+ AccessibleObject rootObject = MSAAViewRegistory.getRootObject();
+ if( null != rootObject ) {
+ ignoreSelection = true;
+ try {
+ viewer.setInput(rootObject);
+ AccessibleObject selection = MSAAViewRegistory.adjustSelection(rootObject);
+ if( null != selection ) {
+ viewer.setSelection(new StructuredSelection(selection));
+ if( selection.getChildCount() < 100 ) {
+ viewer.setExpandedState(selection,true);
+ }
+ }
+ }
+ finally {
+ ignoreSelection = false;
+ }
+ }
+ }
+
+ public void setSelection(Object element) {
+ ISelection selection = StructuredSelection.EMPTY;
+ if( element instanceof AccessibleObject ) {
+ Stack<AccessibleObject> stack = new Stack<AccessibleObject>();
+ for( AccessibleObject accParent = (AccessibleObject)element;
+ null != (accParent = accParent.getCachedParent()) && !viewer.getExpandedState(accParent);
+ stack.push(accParent) ) {
+ ;
+ }
+ while( !stack.isEmpty() ) {
+ viewer.setExpandedState(stack.pop(),true);
+ }
+ selection = new StructuredSelection(element);
+ }
+ viewer.setSelection(selection,true);
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ MSAAOutlineView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(showOffscreenAction);
+ manager.add(new Separator());
+ manager.add(hideHtmlAction);
+ manager.addMenuListener(new IMenuListener(){
+ public void menuAboutToShow(IMenuManager manager) {
+ showOffscreenAction.adjust();
+ hideHtmlAction.adjust();
+ }
+ });
+ manager.add(new Separator());
+ manager.add(showLabelsAction);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ Object selected = getSelectedItem();
+ if (null != selected) {
+ manager.add(expandAction);
+ }
+ manager.add(new Separator());
+ manager.add(runCheckerAction);
+ manager.add(refreshAction);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(expandAllAction);
+ manager.add(collapseAllAction);
+ manager.add(refreshAction);
+ manager.add(runCheckerAction);
+ manager.add(showLabelsAction);
+ }
+
+ private void makeActions() {
+ final Shell shell = this.getViewSite().getShell();
+
+ expandAction = new Action(Messages.getString("msaa.expand")) { //$NON-NLS-1$
+ public void run() {
+ try {
+ Object selected = getSelectedItem();
+ if (null != selected) {
+ viewer.expandToLevel(selected, AbstractTreeViewer.ALL_LEVELS);
+ }
+ } catch (Error e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ expandAllAction = new Action(Messages.getString("msaa.expand_all")) { //$NON-NLS-1$
+ public void run() {
+ try {
+ viewer.expandAll();
+ } catch (Error e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ expandAllAction.setToolTipText(Messages.getString("msaa.expand_all")); //$NON-NLS-1$
+ expandAllAction.setImageDescriptor(GuiPlugin.IMAGE_EXPAND_ALL);
+
+ collapseAllAction = new Action(Messages.getString("msaa.collapse_all")) { //$NON-NLS-1$
+ public void run() {
+ try {
+ viewer.collapseAll();
+ } catch (Error e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ collapseAllAction.setToolTipText(Messages.getString("msaa.collapse_all")); //$NON-NLS-1$
+ collapseAllAction.setImageDescriptor(GuiPlugin.IMAGE_COLLAPSE_ALL);
+
+ refreshAction = new RefreshRootAction();
+
+ hideHtmlAction = new HideHtmlAction();
+
+ showOffscreenAction = new ShowOffscreenAction();
+
+ runCheckerAction = new Action(Messages.getString("msaa.checker")) { //$NON-NLS-1$
+ public void run() {
+ IMSAAProblemsView problemsView = (IMSAAProblemsView) MSAAViewRegistory.showView(
+ MSAAViewRegistory.MSAAProblemsView_ID, true);
+ if (null != problemsView) {
+ problemsView.refresh();
+ }
+ }
+ };
+ runCheckerAction.setToolTipText(Messages.getString("msaa.checker_tip")); //$NON-NLS-1$
+ runCheckerAction.setImageDescriptor(GuiPlugin.IMAGE_CHECKER);
+
+ showLabelsAction = new Action(Messages.getString("msaa.show_tree"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ showOverlayLabels();
+ }
+ };
+ showLabelsAction.setToolTipText(Messages.getString("msaa.show_tree")); //$NON-NLS-1$
+ showLabelsAction.setImageDescriptor(GuiPlugin.IMAGE_OVERLAY);
+ shell.addShellListener(new ShellAdapter(){
+ public void shellActivated(ShellEvent e) {
+ if( MSAAViewRegistory.MSAAOutlineView_ID.equals(OverlayLabel.getOwnerId()) ) {
+ showOverlayLabels();
+ }
+ }
+ public void shellDeactivated(ShellEvent e) {
+ if( MSAAViewRegistory.MSAAOutlineView_ID.equals(OverlayLabel.getOwnerId()) ) {
+ OverlayLabel.removeAll(false);
+ }
+ }
+ });
+ showLabelsAction.setEnabled(GuiPreferenceManager.getPreferenceBoolean(GuiPreferenceConstants.UseOverlayWindow));
+ final IPreferenceStore store = GuiPreferenceManager.getPreferenceStore();
+ store.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if( GuiPreferenceConstants.UseOverlayWindow.equals(event.getProperty())) {
+ showLabelsAction.setEnabled(GuiPreferenceManager.getPreferenceBoolean(GuiPreferenceConstants.UseOverlayWindow));
+ }
+ }
+ });
+ }
+
+ private void showOverlayLabels() {
+ OverlayLabel.removeAll();
+ if (showLabelsAction.isChecked()) {
+ new LabelOverlay().showLabels(viewer.getTree().getSelection());
+ OverlayLabel.setOwnerId(MSAAViewRegistory.MSAAOutlineView_ID);
+ }
+ }
+
+ private class LabelOverlay {
+ int index = 0;
+
+ TreeItem currentItem = null;
+
+ public void showLabels(TreeItem[] items) {
+ if (items.length == 1) {
+ currentItem = items[0];
+ TreeItem parent = currentItem.getParentItem();
+ if (null != parent) {
+ items = parent.getItems();
+ }
+ }
+ renderLabels(items);
+ }
+
+ public void renderLabels(TreeItem[] items) {
+ for (int i = 0; i < items.length; i++) {
+ Object treeObject = items[i].getData();
+ if (treeObject instanceof AccessibleObject) {
+ Rectangle location = ((AccessibleObject) treeObject).getAccLocation();
+ if (null != location) {
+ OverlayLabel label = OverlayLabel.create(treeObject);
+ if (null != label) {
+ if (items[i].equals(currentItem)) {
+ label.setForeground(label.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
+ label.setBackground(label.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));
+ }
+ MSAATreeLabelProvider labelProvider = (MSAATreeLabelProvider) viewer.getLabelProvider();
+ label.setImage(labelProvider.getImage(treeObject));
+ label.setText("" + index); //$NON-NLS-1$
+ String text = "[" + index + "] " + labelProvider.getText(treeObject); //$NON-NLS-1$ //$NON-NLS-2$
+ String[][] properties = AccessiblePropertyUtil.getPropertyStrings(treeObject);
+ label.setTooltop(text, properties);
+ label.pack();
+ label.setLocation(location.x, location.y);
+ index++;
+ label.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ if (e.widget instanceof OverlayLabel) {
+ OverlayLabel[] labels = OverlayLabel.getLabelsAtPosition(e.display
+ .getCursorLocation());
+ if (labels.length > 0) {
+ showSelectionMenu(labels, (OverlayLabel) e.widget);
+ } else {
+ suppressLabelAdjust = true;
+ viewer.setSelection(new StructuredSelection(
+ ((OverlayLabel) e.widget).associatedObject));
+ suppressLabelAdjust = false;
+ }
+ }
+ }
+ });
+ label.addMouseTrackListener(new MouseTrackAdapter() {
+ public void mouseEnter(MouseEvent e) {
+ if (e.widget instanceof OverlayLabel) {
+ AccessibleObject object = (AccessibleObject) ((OverlayLabel) e.widget).associatedObject;
+ if (null != object) {
+ HighlightComposite.flashRectangle(object.getAccLocation());
+ }
+ }
+ }
+
+ public void mouseExit(MouseEvent e) {
+ HighlightComposite.show(false);
+ }
+ });
+ }
+ }
+ }
+ if (items[i].getExpanded()) {
+ renderLabels(items[i].getItems());
+ }
+ }
+ }
+ }
+
+ private void showSelectionMenu(OverlayLabel[] labels, OverlayLabel parent) {
+ final Menu popupMenu = parent.createPopupMenu();
+ MenuItem[] menuItems = new MenuItem[labels.length];
+ for (int i = 0; i < labels.length; i++) {
+ menuItems[i] = new MenuItem(popupMenu, SWT.PUSH);
+ menuItems[i].setText(labels[i].getMenuText());
+ menuItems[i].setImage(labels[i].getImage());
+ menuItems[i].setData(labels[i].associatedObject);
+ menuItems[i].addArmListener(new ArmListener() {
+ public void widgetArmed(ArmEvent e) {
+ Object data = ((MenuItem) e.getSource()).getData();
+ if (data instanceof AccessibleObject) {
+ HighlightComposite.flashRectangle(((AccessibleObject) data).getAccLocation());
+ }
+ }
+ });
+ menuItems[i].addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object data = ((MenuItem) e.getSource()).getData();
+ suppressLabelAdjust = true;
+ viewer.setSelection(new StructuredSelection(data));
+ suppressLabelAdjust = false;
+ }
+ });
+ }
+ popupMenu.setVisible(true);
+ }
+
+ private Object getSelectedItem() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ if (selection.size() == 1) {
+ return selection.getFirstElement();
+ }
+ return null;
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ private class MSAATreeLabelProvider extends LabelProvider implements IColorProvider {
+
+ private Color colorInvisible = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
+
+ public Image getImage(Object element) {
+ String imageKey = null;// Images.ELEMENT;
+ if (element instanceof AccessibleObject) {
+ imageKey = GuiImages.roleIcon(((AccessibleObject) element).getAccRole());
+ if( null == imageKey ) {
+ Accessible2 ac2 = ((AccessibleObject) element).getAccessible2();
+ if( null != ac2 ) {
+ imageKey = GuiImages.roleIcon("IA2_ROLE_UNKNOWN"); //$NON-NLS-1$
+ }
+ }
+ }
+ if( null == imageKey ) {
+ imageKey = GuiImages.roleIcon("ROLE_UNKNOWN"); //$NON-NLS-1$
+ }
+ return GuiImages.getImage(imageKey);
+ }
+
+ public String getText(Object element) {
+ return getTreeText(element);
+ }
+
+ public Color getBackground(Object element) {
+ if (!hideHtml && element instanceof AccessibleObject) {
+ return FlashUtil.getFlashBackground((AccessibleObject)element);
+ }
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ if (element instanceof AccessibleObject) {
+ int accState = ((AccessibleObject)element).getAccState();
+ if ( 0 != (accState & MSAA.STATE_INVISIBLE)) {
+ return colorInvisible;
+ }
+ }
+ return null;
+ }
+
+ }
+
+ public static String getTreeText(Object element) {
+ if (element instanceof AccessibleObject) {
+ AccessibleObject accObject = (AccessibleObject)element;
+ try {
+ String accText = accObject.getAccName();
+ if (null == accText || 0 == accText.length()) {
+ switch( accObject.getAccRole() ) {
+ case IA2.IA2_ROLE_PARAGRAPH:
+ case IA2.IA2_ROLE_HEADING:
+ accText = accObject.getAccValue();
+ break;
+ }
+ }
+ if (null == accText || 0 == accText.length()) {
+ accText = Messages.getString("msaa.NAMELESS"); //$NON-NLS-1$
+ String roleText = accObject.getRoleText();
+ if ( null != roleText ) {
+ accText += " ("+roleText+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return accText;
+ } catch (Exception e) {
+ return e.getMessage();
+ }
+ }
+ return element.toString();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAPropertiesView.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAPropertiesView.java
new file mode 100644
index 0000000..9798156
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAPropertiesView.java
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.actf.visualization.gui.GuiPlugin;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.ui.views.properties.IPropertySheetEntry;
+
+
+
+public class MSAAPropertiesView extends ViewPart implements IMSAAPropertiesView {
+ public static final String ID = MSAAPropertiesView.class.getName();
+
+ private PropertyTreeViewer viewer;
+ private Action refreshAction;
+ private Action showNullAction;
+ private Action changeColorAction;
+ private Action copyAction;
+ private Action invokeAction;
+ private PropertiesFilter filter;
+ public static final String SEPARATOR = "-"; //$NON-NLS-1$
+ private static final ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ viewer = new PropertyTreeViewer(parent, SWT.FULL_SELECTION | SWT.SINGLE | SWT.HIDE_SELECTION);
+ viewer.setContentProvider(new PropertyTreeContentProvider());
+ viewer.setLabelProvider(new ViewLabelProvider());
+ filter = new PropertiesFilter();
+ viewer.addFilter(filter);
+ makeActions();
+ hookContextMenu();
+ contributeToActionBars();
+ if( null != MSAAViewRegistory.outlineObject ) {
+ setInput(MSAAViewRegistory.outlineObject);
+ }
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ public void setInput(Object input) {
+ viewer.setInput(input);
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ MSAAPropertiesView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(showNullAction);
+ manager.add(new Separator());
+ manager.add(changeColorAction);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(new Separator());
+ manager.add(copyAction);
+ manager.add(new Separator());
+ manager.add(refreshAction);
+ Object selected = getSelectedItem();
+ if (selected instanceof PropertyTreeEntry &&
+ ((PropertyTreeEntry)selected).canInvoke() ) {
+ manager.add(new Separator());
+ manager.add(invokeAction);
+ }
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private Object getSelectedItem() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ if (selection.size() == 1) {
+ return selection.getFirstElement();
+ }
+ return null;
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(refreshAction);
+ }
+
+ private void makeActions() {
+ refreshAction = new Action(Messages.getString("msaa.refresh")) { //$NON-NLS-1$
+ public void run() {
+ viewer.refresh();
+ }
+ };
+ refreshAction.setToolTipText(Messages.getString("msaa.refresh")); //$NON-NLS-1$
+ refreshAction.setImageDescriptor(GuiPlugin.IMAGE_REFRESH);
+
+ showNullAction = new Action(Messages.getString("msaa.showNull"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ filter.showNull = showNullAction.isChecked();
+ viewer.refresh();
+ }
+ };
+ showNullAction.setChecked(filter.showNull);
+
+ changeColorAction = new Action(Messages.getString("msaa.changePropertiesColor"),Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ filter.changeColor = changeColorAction.isChecked();
+ viewer.refresh();
+ }
+ };
+ changeColorAction.setChecked(filter.changeColor);
+
+ copyAction = new Action(Messages.getString("msaa.copy")) { //$NON-NLS-1$
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ if( selection instanceof IStructuredSelection && !selection.isEmpty() ) {
+ String strText = null, strValue = null;
+ Object element = ((IStructuredSelection)selection).getFirstElement();
+ if( element instanceof PropertyTreeEntry ) {
+ strText = ((PropertyTreeEntry)element).getDisplayName();
+ strValue = ((PropertyTreeEntry)element).getValueAsString();
+ }
+ else if( element instanceof IPropertySheetEntry ) {
+ strText = ((IPropertySheetEntry)element).getDisplayName();
+ strValue = ((IPropertySheetEntry)element).getValueAsString();
+ }
+ if( null != strText ) {
+ if( null != strValue ) {
+ strText += "\t"+strValue; //$NON-NLS-1$
+ }
+ new Clipboard(Display.getCurrent()).setContents(new Object[] { strText }, new Transfer[] { TextTransfer.getInstance() });
+ }
+ }
+ }
+ };
+ copyAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
+
+ invokeAction = new Action(Messages.getString("msaa.invoke")) { //$NON-NLS-1$
+ public void run() {
+ viewer.invoke(getSelectedItem());
+ }
+ };
+ }
+
+ private class ViewLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider {
+ public String getColumnText(Object obj, int index) {
+ if( obj instanceof PropertyTreeEntry ) {
+ PropertyTreeEntry entry = (PropertyTreeEntry)obj;
+ if( 0==index ) {
+ String text = entry.getDisplayName();
+ if( entry.canInvoke() ) {
+ text += "..."; //$NON-NLS-1$
+ }
+ return text;
+ }
+ return entry.getValueAsString();
+ }
+ return ""; //$NON-NLS-1$
+ }
+ public Image getColumnImage(Object obj, int index) {
+ return null;
+ }
+ public Color getForeground(Object element) {
+ if( element instanceof PropertyTreeEntry ) {
+ int color =((PropertyTreeEntry)element).getColor();
+ if ( -1 != color) {
+ return Display.getCurrent().getSystemColor(color);
+ }
+ }
+ return null;
+ }
+ public Color getBackground(Object element) {
+ return null;
+ }
+ }
+
+ private class PropertiesFilter extends ViewerFilter {
+ public boolean showNull = false;
+ public boolean changeColor = false;
+ public String separateColor = Integer.toString(SWT.COLOR_GRAY);
+ public String hilightColor = Integer.toString(SWT.COLOR_BLUE);
+
+ public Object[] filter(Viewer viewer, Object parent, Object[] elements) {
+ List outList = new ArrayList();
+ for (int i = 0; i < elements.length; ++i) {
+ if( elements[i] instanceof PropertyTreeEntry ) {
+ PropertyTreeEntry entry = (PropertyTreeEntry)elements[i];
+ String value = entry.getValueAsString();
+ if( !showNull && "null".equals(value) ) { //$NON-NLS-1$
+ continue;
+ }
+ if( changeColor && viewer instanceof PropertyTreeViewer ) {
+ Map lastContents = ((PropertyTreeViewer)viewer).getLastContents();
+ if( !lastContents.isEmpty() ) {
+ String lastValue = (String)lastContents.get(entry.getPath());
+ if( null != lastValue ) {
+ if( null == value ) {
+ value = ""; //$NON-NLS-1$
+ }
+ entry.setColor(value.equals(lastValue) ? -1 : SWT.COLOR_BLUE);
+ }
+ }
+ }
+ outList.add(entry);
+ }
+ else {
+ outList.add(elements[i]);
+ }
+ }
+ return outList.toArray();
+ }
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return false;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAATreeContentProvider.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAATreeContentProvider.java
new file mode 100644
index 0000000..3c22dff
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAATreeContentProvider.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.visualization.gui.flash.FlashUtil;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+
+public class MSAATreeContentProvider implements ITreeContentProvider {
+
+ public boolean hideHtml = false;
+ public boolean showOffscreen = false;
+
+ private static MSAATreeContentProvider instance = new MSAATreeContentProvider();
+
+ public static MSAATreeContentProvider getDefault() {
+ if( null == instance ) {
+ instance = new MSAATreeContentProvider();
+ }
+ return instance;
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof AccessibleObject) {
+ AccessibleObject[] accChildren = ((AccessibleObject) parentElement).getChildren();
+ List<AccessibleObject> childList = new Vector<AccessibleObject>();
+ for (int i = 0; i < accChildren.length; i++) {
+ AccessibleObject accChild = accChildren[i];
+ if( null != accChild ) {
+ int accState = accChild.getAccState();
+ if ( 0 == (accState & MSAA.STATE_INVISIBLE)) {
+ childList.add(accChild);
+ }
+ else if ( showOffscreen && 0 != (accState & MSAA.STATE_OFFSCREEN)) {
+ childList.add(accChild);
+ }
+ }
+ }
+ return childList.toArray();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof AccessibleObject) {
+ return ((AccessibleObject) element).getChildCount() > 0;
+ }
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ Object[] elements;
+ if (inputElement instanceof Object[]) {
+ elements = (Object[]) inputElement;
+ } else {
+ elements = getChildren(inputElement);
+ }
+ if (hideHtml) {
+ return FlashUtil.getFlashElements(elements);
+ }
+ return elements;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (oldInput instanceof Object[]) {
+ oldInput = ((Object[]) oldInput)[0];
+ }
+ if (oldInput instanceof AccessibleObject) {
+ try {
+ ((AccessibleObject) oldInput).dispose();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAViewRegistory.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAViewRegistory.java
new file mode 100644
index 0000000..e1e7122
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/MSAAViewRegistory.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.AccessibleObjectFactory;
+import org.eclipse.actf.util.win32.HighlightComposite;
+import org.eclipse.actf.visualization.gui.common.TargetWindow;
+import org.eclipse.actf.visualization.gui.msaa.checker.MSAAProblemsView;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.PropertySheet;
+
+
+public class MSAAViewRegistory {
+
+ // View IDs
+ public static final String MSAAOutlineView_ID = MSAAOutlineView.ID;
+ public static final String FlashDOMView_ID = "org.eclipse.actf.visualization.flash.ui.views.FlashDOMView"; //$NON-NLS-1$
+ public static final String MSAAProblemsView_ID = MSAAProblemsView.ID;
+ public static final String MSAAPropertiesView_ID = MSAAPropertiesView.ID;
+ public static final String MSAAListView_ID = MSAAListView.ID;
+ public static final String JAWSTextView_ID = JAWSTextView.ID;
+ public static final String MSAAEventView_ID = MSAAEventView.ID;
+
+ public static AccessibleObject rootObject = null;
+ public static AccessibleObject outlineObject = null;
+
+ private static int updateRef = 0;
+
+ private static final Display display = Display.getCurrent();
+ private static int hwndRoot = 0;
+ private static IPartListener2 partListener = new IPartListener2() {
+ public void partActivated(IWorkbenchPartReference partRef) {
+ if( partRef instanceof IEditorReference ) {
+ if( TargetWindow.isEmbeddedBrowser() ) {
+ final int hwnd = TargetWindow.getRootWindow();
+ if( hwnd != hwndRoot ) {
+ display.timerExec("Web Browser".equals(partRef.getPartName())?3000:0,new Runnable(){ //$NON-NLS-1$
+ public void run() {
+ if( !display.isDisposed() && hwnd != hwndRoot ) {
+ refreshRootObject();
+ }
+ }
+ });
+ }
+ }
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {}
+ public void partClosed(IWorkbenchPartReference partRef) {}
+ public void partDeactivated(IWorkbenchPartReference partRef) {}
+ public void partHidden(IWorkbenchPartReference partRef) {}
+ public void partInputChanged(IWorkbenchPartReference partRef) {}
+ public void partOpened(IWorkbenchPartReference partRef) {}
+ public void partVisible(IWorkbenchPartReference partRef) {}
+ };
+ private static boolean partListening = false;
+
+ public static void outlineSelected(Object object ) {
+ addUpdateRef();
+ try {
+ object = adjustSelection(object);
+ if( object instanceof AccessibleObject ) {
+ outlineObject = (AccessibleObject)object;
+ showProperties(outlineObject);
+ IMSAAListView listView = (IMSAAListView)findView(MSAAListView_ID);
+ if( null != listView ) {
+ listView.setSelection(outlineObject);
+ }
+ IJAWSTextView jawsTextView = (IJAWSTextView)findView(JAWSTextView_ID);
+ if( null != jawsTextView ) {
+ jawsTextView.setSelection(outlineObject);
+ }
+ HighlightComposite.flashRectangle(outlineObject.getAccLocation());
+ }
+ }
+ finally {
+ releaseUpdateRef();
+ }
+ }
+
+ public static boolean showProperties(Object input) {
+ boolean rc = false;
+ IMSAAPropertiesView propertiesView = (IMSAAPropertiesView)findView(MSAAPropertiesView_ID);
+ if( null != propertiesView ) {
+ propertiesView.setInput(input);
+ rc = true;
+ }
+ IViewPart propertySheet = findView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
+ if( propertySheet instanceof PropertySheet ) {
+ ((PropertySheet)propertySheet).selectionChanged(null, new StructuredSelection(input));
+ rc = true;
+ }
+ return rc;
+ }
+
+ public static IViewReference findViewReference(String viewId) {
+ try {
+ IWorkbenchPage page = getActivePage();
+ if( null != page ) {
+ return page.findViewReference(viewId);
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static IViewPart findView(String viewId) {
+ try {
+ IViewReference ref = findViewReference(viewId);
+ if( null != ref ) {
+ return ref.getView(false);
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static IViewPart showView(String viewId, boolean activate) {
+ try {
+ IWorkbenchPage page = getActivePage();
+ if( null != page ) {
+ IViewPart part = page.findView(viewId);
+ if( null != part ) {
+ if( activate ) {
+ page.activate(part);
+ }
+ return part;
+ }
+ return page.showView(viewId,null,activate?IWorkbenchPage.VIEW_ACTIVATE:IWorkbenchPage.VIEW_CREATE);
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static void hideView(String viewId) {
+ try {
+ IWorkbenchPage page = getActivePage();
+ if( null != page ) {
+ IViewPart part = page.findView(viewId);
+ if( null != part ) {
+ page.hideView(part);
+ }
+ }
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
+ public static AccessibleObject getRootObject() {
+ if( null == rootObject &&
+ 0 != (hwndRoot = TargetWindow.getRootWindow()) ) {
+ rootObject = AccessibleObjectFactory.getAccessibleObjectFromWindow(hwndRoot);
+ }
+ if( !partListening ) {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().addPartListener(partListener);
+ partListening = true;
+ }
+ catch( Exception e ) {
+ }
+ }
+ return rootObject;
+ }
+
+ public static void refreshRootObject() {
+ addUpdateRef();
+ HighlightComposite.updateSuppressCount(1);
+ try {
+ if( null != rootObject ) {
+ rootObject.reset();
+ rootObject = null;
+ }
+ IMSAAOutlineView outlineView = (IMSAAOutlineView)findView(MSAAOutlineView_ID);
+ if( null != outlineView ) {
+ outlineView.refresh();
+ }
+ IMSAAProblemsView problemsView = (IMSAAProblemsView)findView(MSAAProblemsView_ID);
+ if( null != problemsView ) {
+ problemsView.refresh();
+ }
+ IFlashDOMView flashDOMView = (IFlashDOMView)findView(FlashDOMView_ID);
+ if( null != flashDOMView ) {
+ flashDOMView.refresh();
+ }
+ IJAWSTextView jawsTextView = (IJAWSTextView)findView(JAWSTextView_ID);
+ if( null != jawsTextView ) {
+ jawsTextView.refresh();
+ }
+ outlineSelected(null);
+ }
+ finally {
+ HighlightComposite.updateSuppressCount(-1);
+ releaseUpdateRef();
+ }
+ }
+
+ public static AccessibleObject adjustSelection(Object selection) {
+ getRootObject();
+ if( selection instanceof AccessibleObject && selection != rootObject ) {
+ return (AccessibleObject)selection;
+ }
+ if( null != rootObject ) {
+ AccessibleObject rootChildlen[] = rootObject.getChildren();
+ if( null != rootChildlen && rootChildlen.length > 0 ) {
+ return rootChildlen[0];
+ }
+ }
+ return rootObject;
+ }
+
+ public static int addUpdateRef() {
+ return ++updateRef;
+ }
+ public static int releaseUpdateRef() {
+ return --updateRef;
+ }
+ public static int getUpdateRef() {
+ return updateRef;
+ }
+
+ private static IWorkbenchPage getActivePage() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeContentProvider.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeContentProvider.java
new file mode 100644
index 0000000..7c8ad90
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeContentProvider.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class PropertyTreeContentProvider implements ITreeContentProvider {
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof PropertyTreeEntry ) {
+ return ((PropertyTreeEntry)parentElement).getChildren();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if( element instanceof PropertyTreeEntry ) {
+ return ((PropertyTreeEntry)element).hasChildren();
+ }
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ Object adapter = Platform.getAdapterManager().getAdapter(inputElement, IPropertySource.class);
+ if( null != adapter ) {
+ return PropertyTreeEntry.getElements(null,(IPropertySource)adapter);
+ }
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeEntry.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeEntry.java
new file mode 100644
index 0000000..d377f4e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeEntry.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import org.eclipse.actf.visualization.gui.msaa.properties.IPropertyInvoke;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+
+public class PropertyTreeEntry {
+
+ private IPropertySource source;
+ private IPropertyDescriptor descriptor;
+ private PropertyTreeEntry parent;
+ private Object id;
+ private String path;
+ private int color = -1;
+
+ public PropertyTreeEntry(PropertyTreeEntry parent, IPropertySource propertySource,IPropertyDescriptor propertyDescriptor) {
+ this.parent = parent;
+ this.source = propertySource;
+ this.descriptor = propertyDescriptor;
+ this.id = propertyDescriptor.getId();
+ path = null == parent ? "" : parent.path+ "/"; //$NON-NLS-1$ //$NON-NLS-2$
+ path += id.toString();
+ }
+
+ public String getDisplayName() {
+ return descriptor.getDisplayName();
+ }
+
+ public String getValueAsString() {
+ Object value = getValue();
+ if( null == value ) {
+ return "null"; //$NON-NLS-1$
+ }
+ if( value instanceof IPropertySource ) {
+ value = ((IPropertySource)value).getEditableValue();
+ }
+ if (value == null) {
+ return null;
+ }
+ ILabelProvider provider = descriptor.getLabelProvider();
+ if (provider == null) {
+ return value.toString();
+ }
+ String text = provider.getText(value);
+ if (text == null) {
+ return "";//$NON-NLS-1$
+ }
+ return text;
+ }
+
+
+ public Object getId() {
+ return id;
+ }
+ public IPropertySource getPropertySource() {
+ return source;
+ }
+ public String getPath() {
+ return path;
+ }
+ public Object getValue() {
+ return null != id ? source.getPropertyValue(id) : null;
+ }
+ public boolean canInvoke() {
+ if( null != id && source instanceof IPropertyInvoke ) {
+ return ((IPropertyInvoke)source).canInvoke(id);
+ }
+ return false;
+ }
+
+ public PropertyTreeEntry getParent() {
+ return parent;
+ }
+
+ public boolean hasChildren() {
+ return getChildren().length > 0;
+ }
+
+ public Object[] getChildren() {
+ Object value = getValue();
+ if( value instanceof IPropertySource ) {
+ return getElements(this,(IPropertySource)value);
+ }
+ return new Object[0];
+ }
+
+ public void setColor(int color) {
+ this.color = color;
+ }
+
+ public int getColor() {
+ return color;
+ }
+
+ public static Object[] getElements(PropertyTreeEntry parent, IPropertySource source) {
+ IPropertyDescriptor[] base = source.getPropertyDescriptors();
+ IPropertyDescriptor[] extra = new IPropertyDescriptor[0];
+ if( source instanceof IPropertyInvoke ) {
+ extra = ((IPropertyInvoke)source).getPropertyDescriptorsExtra();
+ }
+ Object[] elements = new Object[base.length+extra.length];
+ for( int i=0; i<base.length; i++ ) {
+ elements[i] = new PropertyTreeEntry(parent,source,base[i]);
+ }
+ for( int i=0; i<extra.length; i++ ) {
+ elements[base.length+i] = new PropertyTreeEntry(parent,source,extra[i]);
+ }
+ return elements;
+ }
+
+ public boolean equals(Object o) {
+ if( super.equals(o) ) {
+ return true;
+ }
+ if( o instanceof PropertyTreeEntry ) {
+ return this.path.equals(((PropertyTreeEntry)o).path);
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeViewer.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeViewer.java
new file mode 100644
index 0000000..0909dd0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/ui/views/PropertyTreeViewer.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.ui.views;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.msaa.properties.IPropertyInvoke;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+
+public class PropertyTreeViewer extends TreeViewer {
+
+ private Map lastContents = new HashMap();
+
+ public PropertyTreeViewer(Composite parent, int style) {
+ this(new Tree(parent, style));
+ }
+
+ public PropertyTreeViewer(Composite parent) {
+ this(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ }
+
+ public PropertyTreeViewer(Tree tree) {
+ super(tree);
+ tree.setLinesVisible(true);
+ tree.setHeaderVisible(true);
+ tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ TreeColumn nameColumn = new TreeColumn(tree,SWT.NONE);
+ nameColumn.setText(Messages.getString("msaa.name")); //$NON-NLS-1$
+ TreeColumn valueColumn = new TreeColumn(tree,SWT.NONE);
+ valueColumn.setText(Messages.getString("msaa.value")); //$NON-NLS-1$
+ tree.addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ Tree tree = getTree();
+ Rectangle area = tree.getClientArea();
+ TreeColumn[] columns = tree.getColumns();
+ if (area.width > 0) {
+ columns[0].setWidth(area.width * 40 / 100);
+ columns[1].setWidth(area.width - columns[0].getWidth() - 4);
+ tree.removeControlListener(this);
+ }
+ }
+ });
+ tree.addKeyListener(new KeyAdapter(){
+
+ public void keyPressed(KeyEvent e) {
+ if( SWT.CR == e.keyCode ) {
+ invokeSource();
+ }
+ }
+
+ });
+ }
+
+ private void invokeSource() {
+ IStructuredSelection selection = (IStructuredSelection)getSelection();
+ if (selection.size() == 1) {
+ invoke(selection.getFirstElement());
+ }
+ }
+
+ public void invoke(Object element) {
+ if( element instanceof PropertyTreeEntry ) {
+ PropertyTreeEntry entry = (PropertyTreeEntry)element;
+ IPropertySource source = entry.getPropertySource();
+ if( source instanceof IPropertyInvoke ) {
+ MSAAViewRegistory.addUpdateRef();
+ try {
+ if( ((IPropertyInvoke)source).invoke(entry.getId(),getControl().getShell()) ) {
+ refresh(element);
+ }
+ }
+ finally {
+ MSAAViewRegistory.releaseUpdateRef();
+ }
+ }
+ }
+ }
+
+ public void refresh() {
+ setInput(getRoot());
+ }
+
+ protected void inputChanged(Object input, Object oldInput) {
+ preservingSelection(new Runnable() {
+ public void run() {
+ Tree tree = (Tree)getControl();
+ tree.setRedraw(false);
+ ISelection selected = getSelection();
+ Object[] expanded = getExpandedElements();
+ lastContents.clear();
+ getContents(lastContents, tree.getItems());
+ removeAll(tree);
+ tree.setData(getRoot());
+ createChildren(tree);
+ for( int i=0; i<expanded.length; i++ ) {
+ setExpandedState(expanded[i], true);
+ }
+ if( getExpandedElements().length==0 && tree.getItemCount()>0) {
+ setExpandedState(tree.getItem(0).getData(), true);
+ }
+ setSelection(selected,true);
+ tree.setRedraw(true);
+ }
+ });
+ }
+
+ private void getContents(Map map, TreeItem[] items) {
+ for( int i=0; i<items.length; i++ ) {
+ TreeItem item = items[i];
+ Object itemData = item.getData();
+ if( itemData instanceof PropertyTreeEntry ) {
+ PropertyTreeEntry entry = (PropertyTreeEntry)itemData;
+ map.put(entry.getPath(), item.getText(1));
+ }
+ getContents(map, item.getItems());
+ }
+ }
+
+ public Map getLastContents() {
+ return lastContents;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/AccessiblePropertyUtil.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/AccessiblePropertyUtil.java
new file mode 100644
index 0000000..8a713d7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/AccessiblePropertyUtil.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.util;
+
+import org.eclipse.actf.visualization.gui.msaa.properties.AccessibleObjectPropertySource;
+import org.eclipse.actf.visualization.gui.ui.views.PropertyTreeContentProvider;
+import org.eclipse.actf.visualization.gui.ui.views.PropertyTreeEntry;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+
+
+public class AccessiblePropertyUtil {
+
+ private static final ITreeContentProvider provider = new PropertyTreeContentProvider();
+
+ public static String[][] getPropertyStrings(Object input) {
+ Object[] rootElements = provider.getElements(input);
+ for( int i=0; i<rootElements.length; i++ ) {
+ if( rootElements[i] instanceof PropertyTreeEntry ) {
+ PropertyTreeEntry entry = (PropertyTreeEntry)rootElements[i];
+ if( AccessibleObjectPropertySource.PID_IA1.equals(entry.getId()) ) {
+ Object[] children = provider.getChildren(entry);
+ String[][] result = new String[children.length][2];
+ for( int j=0; j<children.length; j++ ) {
+ PropertyTreeEntry child = (PropertyTreeEntry)children[j];
+ result[j][0]=child.getDisplayName();
+ result[j][1]=child.getValueAsString();
+ }
+ return result;
+ }
+ }
+ }
+ return new String[0][];
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/ScreenReaderRenderer.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/ScreenReaderRenderer.java
new file mode 100644
index 0000000..099fb1e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/ScreenReaderRenderer.java
@@ -0,0 +1,503 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.util;
+
+import java.text.MessageFormat;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.IA2;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.IA2Util;
+import org.eclipse.actf.visualization.gui.Messages;
+import org.eclipse.actf.visualization.gui.common.WebBrowserUtil;
+import org.eclipse.actf.visualization.gui.flash.FlashUtil;
+import org.eclipse.actf.visualization.gui.ui.views.IFlashDOMView;
+import org.eclipse.actf.visualization.gui.ui.views.MSAATreeContentProvider;
+import org.eclipse.actf.visualization.gui.ui.views.MSAAViewRegistory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
+
+
+public class ScreenReaderRenderer {
+ private int lastHwnd = 0;
+ private String lastText = ""; //$NON-NLS-1$
+ private StyledText text;
+ private TextMap textMap;
+ private static final MSAATreeContentProvider provider = MSAATreeContentProvider.getDefault();
+ private static final Display display = Display.getCurrent();
+ private static RenderThread renderThread = null;
+ private static DisposeListener disposeListener = null;
+ private static final int IDLE_WAIT = 5;
+ private static final int BUSY_WAIT = 500;
+ public static int waitMS = IDLE_WAIT;
+ private IFlashDOMView flashDOMView = (IFlashDOMView)MSAAViewRegistory.findView(MSAAViewRegistory.FlashDOMView_ID);
+
+ private static final String[] BROWSER_CONTENT_CLASSNAMES = new String[] {
+ "Internet Explorer_Server", //$NON-NLS-1$
+ "MozillaWindowClass", //$NON-NLS-1$
+ "MozillaContentWindowClass" //$NON-NLS-1$
+ };
+
+ private static boolean isBrowserContent(String className) {
+ for( int i=0; i<BROWSER_CONTENT_CLASSNAMES.length; i++ ) {
+ if( BROWSER_CONTENT_CLASSNAMES[i].equals(className) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public ScreenReaderRenderer(StyledText text, TextMap textMap) {
+ this.text = text;
+ this.textMap = textMap;
+ if( null == disposeListener ) {
+ disposeListener = new DisposeListener(){
+ public void widgetDisposed(DisposeEvent e) {
+ if( null != renderThread ) {
+ renderThread.cancel = true;
+ renderThread.interrupt();
+ renderThread = null;
+ disposeListener = null;
+ }
+ }
+ };
+ text.addDisposeListener(disposeListener);
+ }
+ }
+
+ public void renderAll(AccessibleObject object) {
+ if( null != renderThread ) {
+ renderThread.cancel = true;
+ renderThread.interrupt();
+ }
+ text.setText(""); //$NON-NLS-1$
+ if( null != textMap ) {
+ textMap.clear();
+ }
+ AccessibleObject parent = object.getCachedParent();
+ if( null !=parent ) {
+ renderThread = new RenderThread(provider.getElements(parent));
+ renderThread.start();
+ Thread.yield();
+ }
+ }
+
+ private class RenderThread extends Thread{
+
+ private Object[] startElements;
+
+ public boolean cancel = false;
+ public RenderThread(Object[] startElements) {
+ super();
+ this.startElements = startElements;
+ }
+
+ public void run() {
+ try {
+ renderElements(startElements);
+ display.syncExec(new Runnable(){
+ public void run() {
+ if( !(cancel || text.isDisposed() || text.getCharCount()>0) ) {
+ appendText(Messages.getString(provider.hideHtml ? "msaa.no_flash" : "msaa.empty_page"),SWT.COLOR_GRAY,-1,false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ });
+ }
+ catch( InterruptedException e ) {
+ }
+ }
+ private void renderElements(Object[] inputElements) throws InterruptedException {
+ if( null == inputElements ) {
+ return;
+ }
+ for( int i=0; i<inputElements.length; i++ ) {
+ if( cancel ) {
+ throw new InterruptedException();
+ }
+ if( inputElements[i] instanceof AccessibleObject ) {
+ final int index = i;
+ final boolean sayFlashEnd[] = new boolean[]{false};
+ final Object[][] renderChildren = new Object[][]{null};
+ final AccessibleObject accObject = (AccessibleObject)inputElements[i];
+ display.syncExec(new Runnable(){
+ public void run() {
+ if( !(cancel || text.isDisposed()) ) {
+ int hwnd = accObject.getWindow();
+ if( hwnd != lastHwnd ) {
+ if( FlashUtil.isFlash(accObject) ) {
+ String wmode = null;
+ if( 0 == hwnd ) {
+ wmode = WebBrowserUtil.getHtmlAttribute(accObject,"WMode"); //$NON-NLS-1$
+ }
+ if( null == wmode ) {
+ AccessibleObject parentObject = accObject.getCachedParent();
+ if( null != parentObject && hwnd != parentObject.getWindow() ) {
+ appendText(Messages.getString("msaa.flash_start")+"\n",SWT.COLOR_GRAY,SWT.COLOR_YELLOW,false); //$NON-NLS-1$ //$NON-NLS-2$
+ sayFlashEnd[0] = true;
+ }
+ }
+ else {
+ appendText(Messages.getString("msaa.flash_inaccessible")+" wmode="+wmode+"\n",SWT.COLOR_GRAY,SWT.COLOR_RED,false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if( null != flashDOMView ) {
+ flashDOMView.addWindowlessElement(accObject);
+ }
+ }
+ }
+ lastHwnd = hwnd;
+ }
+ renderItem(accObject, false, index);
+ renderChildren[0] = provider.getChildren(accObject);
+ }
+ }
+ });
+ renderElements(renderChildren[0]);
+ if ( sayFlashEnd[0] ) {
+ display.syncExec(new Runnable(){
+ public void run() {
+ if( !(cancel || text.isDisposed()) ) {
+ appendText(Messages.getString("msaa.flash_end")+"\n",SWT.COLOR_GRAY,SWT.COLOR_YELLOW,false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ });
+ }
+ Thread.yield();
+ Thread.sleep(waitMS);
+ setBusy(false);
+ }
+ }
+ }
+ };
+
+ public static void setBusy(boolean busy) {
+ waitMS = busy ? BUSY_WAIT : IDLE_WAIT;
+ }
+
+ public String renderItem(AccessibleObject accObject, boolean selected, int parentIndex) {
+ String accName = accObject.getAccName();
+ String outText = null==accName ? "" : accName.replace('\u00A0',' ').trim(); //$NON-NLS-1$
+ int accState = accObject.getAccState();
+ int accRole = accObject.getAccRole();
+ boolean isFlash = FlashUtil.isFlash(accObject);
+// boolean isBrowser = WebBrowserUtil.isBrowser(accObject);
+ boolean isBrowser = isBrowserContent(accObject.getClassName());
+ String prefix="", postfix=""; //$NON-NLS-1$ //$NON-NLS-2$
+ String defaultAction = accObject.getAccDefaultAction();
+ boolean clickable = null != defaultAction && defaultAction.length()>0;
+ boolean visible = 0 == (accObject.getAccState() & MSAA.STATE_INVISIBLE);
+ int foreground = visible ? (clickable ? SWT.COLOR_BLUE : -1) : SWT.COLOR_GRAY;
+ int background = selected ? SWT.COLOR_CYAN : -1;
+ switch( accRole ) {
+ case MSAA.ROLE_SYSTEM_TEXT:
+ {
+ boolean editable = (0 == (accState&MSAA.STATE_READONLY));
+ if( !isBrowser || editable ) {
+ prefix = Messages.getString(editable ? "msaa.edit" : "msaa.edit_readonly"); //$NON-NLS-1$ //$NON-NLS-2$
+ outText = accObject.getAccValue();
+ if( null==outText || 0==outText.length() ) {
+ outText = " "; //$NON-NLS-1$
+ }
+ break;
+ }
+ }
+ case MSAA.ROLE_SYSTEM_STATICTEXT:
+ if( outText.equals(lastText) ) {
+ outText = ""; //$NON-NLS-1$
+ }
+ break;
+ case 0x28: // ROLE_SYSTEM_GRAPHIC
+ if( isFlash ) {
+ prefix = Messages.getString("msaa.graphic"); //$NON-NLS-1$
+ }
+ else {
+ postfix = Messages.getString("msaa.graphic"); //$NON-NLS-1$
+ }
+ if( outText.equals(lastText) ) {
+ outText = ""; //$NON-NLS-1$
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_LINK:
+ prefix = Messages.getString("msaa.link"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_CHECKBUTTON:
+ prefix = Messages.getString("msaa.checkbox")+" "; //$NON-NLS-1$ //$NON-NLS-2$
+ prefix += 0!=(accState&MSAA.STATE_CHECKED) ? Messages.getString("msaa.checked") : Messages.getString("msaa.not_checked"); //$NON-NLS-1$ //$NON-NLS-2$
+ break;
+ case MSAA.ROLE_SYSTEM_RADIOBUTTON:
+ prefix = Messages.getString("msaa.radiobutton")+" "; //$NON-NLS-1$ //$NON-NLS-2$
+ prefix += 0!=(accState&MSAA.STATE_CHECKED) ? Messages.getString("msaa.checked") : Messages.getString("msaa.not_checked"); //$NON-NLS-1$ //$NON-NLS-2$
+ break;
+ case MSAA.ROLE_SYSTEM_SLIDER:
+ outText = accObject.getAccValue();
+ postfix = Messages.getString("msaa.updown_scrollbat"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_PROGRESSBAR:
+ outText = accObject.getAccValue();
+ postfix = Messages.getString("msaa.progressbar"); //$NON-NLS-1$
+ break;
+ case 0x34: // ROLE_SYSTEM_SPINBUTTON
+ outText = accObject.getAccValue();
+ postfix = Messages.getString("msaa.editspinbox"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_COMBOBOX:
+ prefix = Messages.getString("msaa.combobox"); //$NON-NLS-1$
+ outText = accObject.getAccValue();
+ if( null==outText || 0==outText.length() ) {
+ outText = accObject.getAccName();
+ }
+ break;
+ case 0x3E: // ROLE_SYSTEM_SPLITBUTTON
+ case MSAA.ROLE_SYSTEM_BUTTONDROPDOWN:
+ case MSAA.ROLE_SYSTEM_PUSHBUTTON:
+ postfix = Messages.getString("msaa.button"); //$NON-NLS-1$
+ if( 0==outText.length() ) {
+ if( isFlash ) {
+ outText = Integer.toString(parentIndex);
+ foreground = SWT.COLOR_RED;
+ }
+ else {
+ outText = " "; //$NON-NLS-1$
+ }
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_LISTITEM:
+ {
+ AccessibleObject parent = accObject.getCachedParent();
+ if( null!=parent) {
+ switch( parent.getAccRole() ) {
+ case MSAA.ROLE_SYSTEM_LIST:
+ postfix = Messages.getString("msaa.listbox"); //$NON-NLS-1$
+ if( 0!=(accState&MSAA.STATE_SELECTED) ) {
+ postfix += " "+Messages.getString("msaa.selected"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_COMBOBOX:
+ prefix = Messages.getString("msaa.combobox"); //$NON-NLS-1$
+ break;
+ }
+ }
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_TABLE:
+ postfix = Messages.getString("msaa.table"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_CELL:
+ postfix = Messages.getString("msaa.cell"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_COLUMNHEADER:
+ postfix = Messages.getString("msaa.columnheader"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_ROWHEADER:
+ postfix = Messages.getString("msaa.rowheader"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_PAGETAB:
+ postfix = Messages.getString("msaa.tab"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_OUTLINEITEM:
+ postfix = Messages.getString("msaa.treeview"); //$NON-NLS-1$
+ if( 0!=(accState&MSAA.STATE_SELECTED) ) {
+ postfix += " "+Messages.getString("msaa.selected"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ else if( isFlash ) {
+ outText = ""; // Ignore in flash //$NON-NLS-1$
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_OUTLINE:
+ postfix = Messages.getString("msaa.tree"); //$NON-NLS-1$
+ break;
+
+ case MSAA.ROLE_SYSTEM_MENUBAR:
+ postfix = Messages.getString("msaa.menubar"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_MENUPOPUP:
+ case MSAA.ROLE_SYSTEM_MENUITEM:
+ if( 0 != (accState&MSAA.STATE_SYSTEM_UNAVAILABLE) ) {
+ postfix = Messages.getString("msaa.unavailable"); //$NON-NLS-1$
+ break;
+ }
+ if( accObject.getChildCount() > 0 ) {
+ AccessibleObject parent = accObject.getCachedParent();
+ if( null != parent && MSAA.ROLE_SYSTEM_MENUITEM==parent.getAccRole() ) {
+ postfix = Messages.getString("msaa.submenu"); //$NON-NLS-1$
+ }
+ else {
+ postfix = Messages.getString("msaa.menu"); //$NON-NLS-1$
+ }
+ }
+ else if( 0 != (accState&MSAA.STATE_CHECKED) ) {
+ postfix = Messages.getString("msaa.checked"); //$NON-NLS-1$
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_TOOLBAR:
+ postfix = Messages.getString("msaa.toolbar"); //$NON-NLS-1$
+ break;
+ case 0x17: // ROLE_SYSTEM_STATUSBAR
+ postfix= Messages.getString("msaa.statusbar"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_SCROLLBAR:
+ postfix = Messages.getString("msaa.scrollbar"); //$NON-NLS-1$
+ break;
+ case 0x27: // ROLE_SYSTEM_INDICATOR
+ postfix = Messages.getString("msaa.indicator"); //$NON-NLS-1$
+ break;
+ case 0xe: // ROLE_SYSTEM_APPLICATION
+ postfix = Messages.getString("msaa.application"); //$NON-NLS-1$
+ break;
+ case 0xf: // ROLE_SYSTEM_DOCUMENT
+ postfix = Messages.getString("msaa.document"); //$NON-NLS-1$
+ break;
+ case MSAA.ROLE_SYSTEM_WINDOW:
+ case 0x10: // ROLE_SYSTEM_PANE
+ if( isFlash ) {
+ outText = ""; // Ignore in flash //$NON-NLS-1$
+ }
+ else {
+ postfix = Messages.getString("msaa.window"); //$NON-NLS-1$
+ }
+ break;
+ case MSAA.ROLE_SYSTEM_CLIENT:
+ if( isFlash || isBrowser || outText.equals(lastText) ) {
+ outText = ""; // Ignore in flash //$NON-NLS-1$
+ }
+ break;
+ case IA2.IA2_ROLE_ROOT_PANE:
+ case IA2.IA2_ROLE_OPTION_PANE:
+ break; // TODO Do nothing?
+ case IA2.IA2_ROLE_SHAPE:
+ {
+ String style = null;
+ Accessible2 ac2 = accObject.getAccessible2();
+ if( null != ac2 ) {
+ style = IA2Util.getAttribute(ac2.getAttributes(),"style"); //$NON-NLS-1$
+ }
+ if( null != style ) {
+ postfix = MessageFormat.format(Messages.getString("ia2.style_shape"),new Object[]{style}); //$NON-NLS-1$
+ }
+ else {
+ postfix += Messages.getString("ia2.shape"); //$NON-NLS-1$
+ }
+ }
+ break;
+ case IA2.IA2_ROLE_CHECK_MENU_ITEM:
+ case IA2.IA2_ROLE_RADIO_MENU_ITEM:
+ if( 0 != (accState&MSAA.STATE_SYSTEM_UNAVAILABLE) ) {
+ postfix = Messages.getString("msaa.unavailable"); //$NON-NLS-1$
+ break;
+ }
+ {
+ Accessible2 ac2 = accObject.getAccessible2();
+ if( null != ac2 ) {
+ String extendedStates[] = ac2.getExtendedStates(8);
+ if( IA2Util.getExtendedState(extendedStates,"CHECKED") ) { //$NON-NLS-1$
+ postfix = Messages.getString("msaa.checked"); //$NON-NLS-1$
+ }
+ }
+ }
+ break;
+ case IA2.IA2_ROLE_HEADING:
+ String level = "?"; //$NON-NLS-1$
+ try {
+ Accessible2 ac2 = accObject.getAccessible2();
+ if( null != ac2 ) {
+ level = IA2Util.getAttribute(ac2.getAttributes(),"heading-level"); //$NON-NLS-1$
+ }
+ }
+ catch( Exception e) {
+ }
+ prefix = MessageFormat.format(Messages.getString("ia2.heading_level"),new Object[]{level}); //$NON-NLS-1$
+ case IA2.IA2_ROLE_PARAGRAPH:
+ outText = accObject.getAccValue();
+ if( null==outText || 0==outText.length() ) {
+ outText = accObject.getAccName();
+ }
+ break;
+ default:
+ prefix = "["+accObject.getRoleText() + " 0x"+Integer.toHexString(accRole)+"]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ }
+ String speakText = ""; //$NON-NLS-1$
+ Point point = new Point(text.getCharCount(),0);
+ if( null!=outText && outText.length()>0 ) {
+ if( " ".equals(outText) ) { //$NON-NLS-1$
+ outText = ""; //$NON-NLS-1$
+ }
+ if( prefix.length()>0 ) {
+ if( outText.length()>0 ) {
+ prefix += " "; //$NON-NLS-1$
+ }
+ appendText(prefix,SWT.COLOR_GRAY,background,false);
+ speakText += prefix;
+ }
+ if( outText.length()> 0 ) {
+ appendText(outText,foreground,background,clickable);
+ speakText += outText;
+ }
+ if( postfix.length()>0 ) {
+ if( speakText.length()> 0 ) {
+ postfix = " "+postfix; //$NON-NLS-1$
+ }
+ appendText(postfix,SWT.COLOR_GRAY,background,false);
+ speakText += postfix;
+ }
+ text.append("\n"); //$NON-NLS-1$
+ lastText = outText;
+ }
+ point.y = text.getCharCount();
+ if( null != textMap ) {
+ textMap.put(accObject,point);
+ }
+ return speakText;
+ }
+
+ public String renderEvent(int event) {
+ String eventText = ""; //$NON-NLS-1$
+ switch( event ) {
+ case MSAA.EVENT_SYSTEM_MENUSTART:
+ eventText = Messages.getString("msaa.menu_start"); //$NON-NLS-1$
+ break;
+ case MSAA.EVENT_SYSTEM_MENUPOPUPSTART:
+ eventText = Messages.getString("msaa.popup_start"); //$NON-NLS-1$
+ break;
+ case MSAA.EVENT_SYSTEM_MENUEND:
+ eventText = Messages.getString("msaa.menu_end"); //$NON-NLS-1$
+ break;
+ case MSAA.EVENT_SYSTEM_MENUPOPUPEND:
+ eventText = Messages.getString("msaa.popup_end"); //$NON-NLS-1$
+ break;
+ }
+ if( eventText.length() > 0 ) {
+ appendText(eventText,SWT.COLOR_GRAY,-1,false); //$NON-NLS-1$
+ text.append("\n"); //$NON-NLS-1$
+ lastText = eventText;
+ }
+ return eventText;
+ }
+
+ private void appendText(String str, int foreground, int background, boolean underline ) {
+ StyleRange range = new StyleRange();
+ if( foreground >= 0 ) {
+ range.foreground = Display.getCurrent().getSystemColor(foreground);
+ }
+ if( background >= 0 ) {
+ range.background = Display.getCurrent().getSystemColor(background);
+ }
+ range.underline = underline;
+ range.start = text.getCharCount();
+ range.length = str.length();
+ text.append(str);
+ text.setStyleRange(range);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/TTSMonitor.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/TTSMonitor.java
new file mode 100644
index 0000000..9cc5e0f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/TTSMonitor.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.gui.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+import org.eclipse.actf.visualization.gui.ui.views.IMSAAEventView;
+import org.eclipse.swt.internal.win32.OS;
+import org.eclipse.swt.internal.win32.TCHAR;
+
+
+
+
+public class TTSMonitor extends Thread {
+
+ private IMSAAEventView eventView;
+ private boolean repeat = false;
+
+ private static int port = getMonitorPort();//5556;
+
+ private static TTSMonitor gMonitor = null;
+
+ public static void startThread(IMSAAEventView eventView) {
+ if( null==gMonitor && port>0 ) {
+ gMonitor = new TTSMonitor(eventView);
+ gMonitor.start();
+ }
+ }
+
+ public static void stopThread() {
+ if( null != gMonitor ) {
+ gMonitor.repeat = false;
+ gMonitor.interrupt();
+ }
+ }
+
+ public TTSMonitor(IMSAAEventView eventView) {
+ this.eventView = eventView;
+ }
+
+ public void run() {
+ ServerSocket serverSocket = null;
+ try {
+ serverSocket = new ServerSocket(port);
+ repeat = true;
+ while( repeat ) {
+ Socket socket = serverSocket.accept();
+ if( null != socket ) {
+ PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
+ BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
+
+ StringBuffer sb = new StringBuffer();
+ try {
+ String inputLine;
+ while ((inputLine = in.readLine()) != null) {
+ sb.append(inputLine);
+ sb.append("\n"); //$NON-NLS-1$
+ }
+ }
+ catch(IOException e){
+ }
+ finally {
+ if( sb.length() > 0 ) {
+ eventView.setTTSText(sb.toString());
+ }
+ out.close();
+ in.close();
+ socket.close();
+ }
+ }
+ }
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ finally {
+ if( null!=serverSocket ) {
+ try {
+ serverSocket.close();
+ }
+ catch( Exception e) {
+
+ }
+ }
+ }
+ }
+
+ private static int getMonitorPort() {
+ TCHAR keyName = new TCHAR(0, "SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\AcTFTTS\\Settings", true); //$NON-NLS-1$
+ int[] phKey = new int[1];
+ if (0 == OS.RegOpenKeyEx(OS.HKEY_LOCAL_MACHINE, keyName, 0, OS.KEY_READ, phKey)) {
+ TCHAR valueName = new TCHAR(0, "MonitorPort", true); //$NON-NLS-1$
+ int[] lpcbData = new int[] { 4 }, lpType = new int[] { 4 }, lpData = new int[1];
+ if (0 == OS.RegQueryValueEx(phKey[0], valueName, 0, lpType, lpData, lpcbData)) {
+ return lpData[0];
+ }
+ }
+ return 0;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/TextMap.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/TextMap.java
new file mode 100644
index 0000000..5dd04ae
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/visualization/gui/util/TextMap.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.gui.util;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.swt.graphics.Point;
+
+public class TextMap extends LinkedHashMap<AccessibleObject, Point> {
+
+ private static final long serialVersionUID = -8640673640566349712L;
+
+ public void clear() {
+ super.clear();
+ }
+
+ public Point put(AccessibleObject accObject, Point point) {
+ return super.put(accObject,point);
+ }
+
+ public Point getPoint(AccessibleObject accObject) {
+ return get(accObject);
+ }
+
+ public AccessibleObject getAccessibleObject(Point point) {
+ AccessibleObject retObject = null;
+ for( Iterator it = keySet().iterator(); it.hasNext(); ) {
+ AccessibleObject accObject = (AccessibleObject)it.next();
+ Point accPoint = getPoint(accObject);
+ if( accPoint.x <= point.x && point.x < accPoint.y ) {
+ retObject = accObject;
+ if( accPoint.x != accPoint.y ) break;
+ }
+ }
+ return retObject;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/.classpath b/plugins/org.eclipse.actf.visualization.lowvision/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/.cvsignore b/plugins/org.eclipse.actf.visualization.lowvision/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/.project b/plugins/org.eclipse.actf.visualization.lowvision/.project
new file mode 100644
index 0000000..e5c3dd0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.lowvision</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.actf.visualization.lowvision/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..11f6438
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Sat Sep 15 20:30:55 JST 2007
+eclipse.preferences.version=1
+encoding//src/messages.properties=8859_1
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.lowvision/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..633a716
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF Lowvision Vizualization Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.lowvision;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.actf.common,
+ org.eclipse.actf.visualization.engines.lowvision,
+ org.eclipse.actf.visualization.eval,
+ org.eclipse.actf.visualization.ui.report,
+ org.eclipse.actf.model.dom.html
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.actf.visualization.lowvision.ui.preferences,
+ org.eclipse.actf.visualization.lowvision.ui.views
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/about.html b/plugins/org.eclipse.actf.visualization.lowvision/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/build.properties b/plugins/org.eclipse.actf.visualization.lowvision/build.properties
new file mode 100644
index 0000000..50046c1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ about.html,\
+ .,\
+ plugin.xml,\
+ plugin_ja.properties,\
+ plugin.properties,\
+ vizResources/,\
+ icons/
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/icons/ButtonSave.png b/plugins/org.eclipse.actf.visualization.lowvision/icons/ButtonSave.png
new file mode 100644
index 0000000..0b6a471
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/icons/ButtonSave.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/icons/setting.png b/plugins/org.eclipse.actf.visualization.lowvision/icons/setting.png
new file mode 100644
index 0000000..e493c47
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/icons/setting.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/icons/simulation.png b/plugins/org.eclipse.actf.visualization.lowvision/icons/simulation.png
new file mode 100644
index 0000000..b6d6273
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/icons/simulation.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/icons/simulation16.gif b/plugins/org.eclipse.actf.visualization.lowvision/icons/simulation16.gif
new file mode 100644
index 0000000..9eccbb9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/icons/simulation16.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/plugin.properties b/plugins/org.eclipse.actf.visualization.lowvision/plugin.properties
new file mode 100644
index 0000000..010ca8a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+adesigner.preferences.lowvision.title=Low Vision Simulation
+adesigner.lowvision.tab.title=LowVision
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/plugin.xml b/plugins/org.eclipse.actf.visualization.lowvision/plugin.xml
new file mode 100644
index 0000000..ee96d0e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/plugin.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.actf.visualization.lowvision.ui.preferences.LowVisionPreferencePage"
+ id="org.eclipse.actf.visualization.lowvision.ui.preferences.LowVisionPreferencePage"
+ name="%adesigner.preferences.lowvision.title"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ class="org.eclipse.actf.visualization.lowvision.ui.views.LowVisionView"
+ icon="icons/simulation16.gif"
+ id="org.eclipse.actf.visualization.lowvision.ui.views.LowVisionView"
+ name="%adesigner.lowvision.tab.title"/>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/plugin_ja.properties b/plugins/org.eclipse.actf.visualization.lowvision/plugin_ja.properties
new file mode 100644
index 0000000..1dd6d52
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/plugin_ja.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+adesigner.preferences.lowvision.title=\u30ed\u30fc\u30d3\u30b8\u30e7\u30f3\u3000\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3
+adesigner.lowvision.tab.title=\u30ed\u30fc\u30d3\u30b8\u30e7\u30f3
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/messages.properties b/plugins/org.eclipse.actf.visualization.lowvision/src/messages.properties
new file mode 100644
index 0000000..ea6eed4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/messages.properties
@@ -0,0 +1,65 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+EvalLV.color.difficult.distinguish=Some parts of this content use color combinations that are difficult to distinguish from each other.
+EvalLV.color.might.difficult.distinguish=Some parts of this content use color combinations that might be difficult to distinguish from each other.
+EvalLV.click.detailed.report=Please confirm these parts by clicking problem items in detailed report.
+EvalLV.no.color.difficult.distinguish=This page might not contain color combinations that are difficult to distinguish from each other.
+EvalLV.text.color.combination=Foreground/background color combination of text:
+EvalLV.img.color.combination=Color combination in image:
+EvalLV.font.too.small.to.read=Some fonts in the content is too small to read.
+EvalLV.font.might.too.small.to.read=Some fonts in the content might be too small to read.
+EvalLV.font.might.enough.to.read=Sizes of fonts used in this page might be enough to read.
+EvalLV.font.too.small.fixed=Too small and fixed size font:
+EvalLV.font.too.small=Too small font:
+EvalLV.font.fixed=Fixed size font:
+EvalLV.page.have.fixed.font=This content seems to have fixed size fonts.
+EvalLV.use.relative.font=Please consider using relative font size instead of fixed font size.
+EvalLV.0=aDesigner currently does not support Lowvision check of this type of content.
+
+DialogSettingLowVision.Crystalline_lens = Crystalline lens transparency (Age)
+DialogSettingLowVision.60 = 60's
+DialogSettingLowVision.40 = 40's
+DialogSettingLowVision.20 = 20's
+DialogSettingLowVision.Eyesight_9 = Eyesight
+DialogSettingLowVision.Color_Vision_Deficiency_10 = Color Vision Deficiency
+DialogSettingLowVision.Protan = Protan: Abnormality of red-sensitive cone pigment
+DialogSettingLowVision.Deutan = Deutan: Abnormality of green-sensitive cone pigment
+DialogSettingLowVision.Tritan = Tritan: Abnormality of blue-sensitive cone pigment
+DialogSettingLowVision.Original__24 = Original:
+DialogSettingLowVision.After_simulation = After simulation:
+
+ParamLowVision.1 = EyeSight:
+ParamLowVision.4 = ColorVision:
+ParamLowVision.7 = ColorFilter:
+
+SaveReportLowVision.Iro21_Error_Alt = Color Problem
+SaveReportLowVision.Boke21_Error_Alt = Text Size Problem
+#
+# LowVisionView
+#
+LowVisionView.begin_to_make_PageImage._2 = begin to make PageImage.
+LowVisionView.begin_to_check_problems._4 = begin to check problems.
+LowVisionView.simulation_of_current_page_is_over._8 = simulation of current page is over.
+LowVisionView.get_information_of_all_images._25 = get information of all images.
+LowVisionView.dump_the_image_in_the_web_browser._26 = dump the image.
+LowVisionView.prepare_Simulation_Image._29 = prepare Simulation Image.
+#
+# Toolbar
+#
+LowVisionView.whole_page_1 = whole page
+LowVisionView.Synchronous_view_5 = View Sync
+#
+# Actions
+#
+LowVisionView.Simulate_2 = Simulate LowVision
+LVSimulationAction.0 = Simulate
+
+
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/messages_ja.properties b/plugins/org.eclipse.actf.visualization.lowvision/src/messages_ja.properties
new file mode 100644
index 0000000..717b635
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/messages_ja.properties
@@ -0,0 +1,65 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+EvalLV.color.difficult.distinguish=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u306f\u533a\u5225\u3057\u3065\u3089\u3044\u8272\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u90e8\u5206\u304c\u6709\u308a\u307e\u3059\uff0e
+EvalLV.color.might.difficult.distinguish=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u306f\u533a\u5225\u3057\u3065\u3089\u3044\u3068\u601d\u308f\u308c\u308b\u8272\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u90e8\u5206\u304c\u6709\u308a\u307e\u3059\uff0e
+EvalLV.click.detailed.report=\u8a73\u7d30\u30ec\u30dd\u30fc\u30c8\u5185\u306e\u5404\u9805\u76ee\u3092\u9078\u629e\u3057\u3066\uff0c\u554f\u984c\u7b87\u6240\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\uff0e
+EvalLV.no.color.difficult.distinguish=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u306f\u533a\u5225\u3057\u3065\u3089\u3044\u8272\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u90e8\u5206\u306f\u7121\u3044\u3088\u3046\u3067\u3059\uff0e
+EvalLV.text.color.combination=\u30c6\u30ad\u30b9\u30c8\u306e\u524d\u666f\u8272/\u80cc\u666f\u8272\u306e\u7d44\u307f\u5408\u308f\u305b:
+EvalLV.img.color.combination=\u753b\u50cf\u5185\u306e\u8981\u7d20\u9593\u306e\u8272\u306e\u7d44\u307f\u5408\u308f\u305b:
+EvalLV.font.too.small.to.read=\u30b3\u30f3\u30c6\u30f3\u30c4\u5185\u306e\u4e00\u90e8\u306e\u6587\u5b57\u306f\u5c0f\u3055\u3059\u304e\u307e\u3059\uff0e
+EvalLV.font.might.too.small.to.read=\u30b3\u30f3\u30c6\u30f3\u30c4\u5185\u306e\u4e00\u90e8\u306e\u6587\u5b57\u306f\u5c0f\u3055\u3059\u304e\u308b\u3088\u3046\u3067\u3059\uff0e
+EvalLV.font.might.enough.to.read=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u306f\uff0c\u5341\u5206\u306b\u8aad\u307f\u3084\u3059\u3044\u5927\u304d\u3055\u3067\u3042\u308b\u3068\u601d\u308f\u308c\u307e\u3059\uff0e
+EvalLV.font.too.small.fixed=\u6587\u5b57\u304c\u5c0f\u3055\u3059\u304e\uff0c\u304b\u3064\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b:
+EvalLV.font.too.small=\u6587\u5b57\u304c\u5c0f\u3055\u3059\u304e\u308b:
+EvalLV.font.fixed=\u6587\u5b57\u306e\u5927\u304d\u3055\u304c\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b:
+EvalLV.page.have.fixed.font=\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u5185\u306e\u4e00\u90e8\u306e\u6587\u5b57\u306f\u5927\u304d\u3055\u304c\u56fa\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\uff0e
+EvalLV.use.relative.font=\u6587\u5b57\u306e\u5927\u304d\u3055\u306e\u6307\u5b9a\u306f\uff0c\u76f8\u5bfe\u7684\u306a\u3082\u306e\u306b\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u4e0b\u3055\u3044\uff0e
+EvalLV.0=\u73fe\u5728\u306eaDesigner\u3067\u306f\uff0c\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u30ed\u30fc\u30d3\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093.
+
+DialogSettingLowVision.Crystalline_lens = \u6c34\u6676\u4f53\u900f\u904e\u7387\u3000\uff08\u5e74\u9f62\uff09
+DialogSettingLowVision.60 = 60\u624d\u4ee3
+DialogSettingLowVision.40 = 40\u624d\u4ee3
+DialogSettingLowVision.20 = 20\u624d\u4ee3
+DialogSettingLowVision.Eyesight_9 = \u8996\u529b
+DialogSettingLowVision.Color_Vision_Deficiency_10 = \u8272\u899a\u7570\u5e38
+DialogSettingLowVision.Protan = \u7b2c\u4e00\u8272\u899a\u7570\u5e38\uff08\u8d64\u8272\u899a\u7570\u5e38\uff09
+DialogSettingLowVision.Deutan = \u7b2c\u4e8c\u8272\u899a\u7570\u5e38\uff08\u7dd1\u8272\u899a\u7570\u5e38\uff09
+DialogSettingLowVision.Tritan = \u7b2c\u4e09\u8272\u899a\u7570\u5e38\uff08\u9752\u8272\u899a\u7570\u5e38\uff09
+DialogSettingLowVision.Original__24 = \u30aa\u30ea\u30b8\u30ca\u30eb\u753b\u50cf\uff1a
+DialogSettingLowVision.After_simulation = \u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u5f8c\uff1a
+
+ParamLowVision.1 = \u8996\u529b\uff1a
+ParamLowVision.4 = \u8272\u899a\u7570\u5e38\uff1a
+ParamLowVision.7 = \u6c34\u6676\u4f53\u900f\u904e\u7387\uff1a
+
+SaveReportLowVision.Iro21_Error_Alt = \u8272\u306b\u95a2\u3059\u308b\u554f\u984c
+SaveReportLowVision.Boke21_Error_Alt = \u6587\u5b57\u306e\u5927\u304d\u3055\u306b\u95a2\u3059\u308b\u554f\u984c
+#
+# LowVisionView
+#
+LowVisionView.begin_to_make_PageImage._2 = \u63cf\u753b\u30a4\u30e1\u30fc\u30b8\u306e\u53d6\u5f97\u4e2d
+LowVisionView.begin_to_check_problems._4 = \u554f\u984c\u70b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u307e\u3059
+LowVisionView.simulation_of_current_page_is_over._8 = \u7d42\u4e86\uff08\u30ed\u30fc\u30d3\u30b8\u30e7\u30f3\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\uff09
+LowVisionView.get_information_of_all_images._25 = \u753b\u50cf\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u4e2d
+LowVisionView.dump_the_image_in_the_web_browser._26 = \u63cf\u753b\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u4e2d
+LowVisionView.prepare_Simulation_Image._29 = \u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u753b\u50cf\u6e96\u5099\u4e2d\u2026
+#
+# Toolbar
+#
+LowVisionView.whole_page_1 = \u5168\u753b\u9762
+LowVisionView.Synchronous_view_5 = \u30d3\u30e5\u30fc\u306e\u540c\u671f
+#
+# Actions
+#
+LowVisionView.Simulate_2 = \u5f31\u8996\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u5b9f\u884c
+LVSimulationAction.0 = \u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u5b9f\u884c
+
+
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/LowVisionVizPlugin.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/LowVisionVizPlugin.java
new file mode 100644
index 0000000..d7132a0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/LowVisionVizPlugin.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.lowvision;
+
+import java.io.File;
+
+import org.eclipse.actf.util.FileUtils;
+import org.eclipse.actf.visualization.lowvision.util.LowVisionVizResourceUtil;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class LowVisionVizPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.actf.visualization.lowvision";
+
+ // The shared instance
+ private static LowVisionVizPlugin plugin;
+
+ private static File tmpDir = null;
+
+ /**
+ * The constructor
+ */
+ public LowVisionVizPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+
+ createTempDirectory();
+ String tmpS;
+ if (tmpDir != null) {
+ tmpS = tmpDir.getAbsolutePath() + File.separator + "img";
+ if (FileUtils.isAvailableDirectory(tmpS)) {
+ String tmpS2 = tmpS + File.separator;
+ LowVisionVizResourceUtil.saveImages(tmpS2);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+
+ if (tmpDir != null) {
+ FileUtils.deleteFiles(tmpDir);
+ }
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static LowVisionVizPlugin getDefault() {
+ return plugin;
+ }
+
+ private static void createTempDirectory() {
+ if (tmpDir == null) {
+ String tmpS = plugin.getStateLocation().toOSString()
+ + File.separator + "tmp";
+ if (FileUtils.isAvailableDirectory(tmpS)) {
+ tmpDir = new File(tmpS);
+ } else {
+ System.err.println(PLUGIN_ID + " : can't create tmp Directory");
+ tmpDir = new File(System.getProperty("java.io.tmpdir"));
+ }
+ }
+ }
+
+ public static File createTempFile(String prefix, String suffix)
+ throws Exception {
+ createTempDirectory();
+ return (File.createTempFile(prefix, suffix, tmpDir));
+ }
+
+ public static File getTempDirectory() {
+ if (tmpDir == null) {
+ createTempDirectory();
+ }
+ return tmpDir;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/CheckResultLowVision.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/CheckResultLowVision.java
new file mode 100644
index 0000000..20ceaa5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/CheckResultLowVision.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.eval;
+
+import java.util.Iterator;
+
+import org.eclipse.actf.visualization.engines.lowvision.image.PageImage;
+import org.eclipse.actf.visualization.eval.EvaluationResultImpl;
+import org.eclipse.actf.visualization.eval.problem.ProblemItemLV;
+
+
+
+public class CheckResultLowVision extends EvaluationResultImpl {
+
+ //serial number
+ public CheckResultLowVision() {
+ setSummaryReportUrl("about:blank");
+ setShowAllGuidelineItems(true);
+ }
+
+ public void setFrameOffsetToProblems(PageImage[] framePageImages){
+ int frameOffset[];
+
+ if (null != framePageImages) {
+
+ frameOffset = new int[framePageImages.length];
+ frameOffset[0] = 0;
+
+ for (int i = 1; i < framePageImages.length; i++) {
+ frameOffset[i] = frameOffset[i - 1] + framePageImages[i - 1].getInt2D().height;
+ }
+
+ for (Iterator i = getProblemList().iterator(); i.hasNext();) {
+ try {
+ ProblemItemLV tmpP = (ProblemItemLV) i.next();
+ int frameId = tmpP.getFrameId();
+ if (frameId > -1 && frameId < frameOffset.length) {
+ tmpP.setFrameOffset(frameOffset[frameId]);
+ tmpP.setY(tmpP.getY() + frameOffset[frameId]);
+ }
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ for (Iterator i = getProblemList().iterator(); i.hasNext();) {
+ ProblemItemLV tmpP = (ProblemItemLV) i.next();
+ System.out.println(tmpP.getFrameId()+":"+tmpP.getFrameOffset());
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/SaveReportLowVision.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/SaveReportLowVision.java
new file mode 100644
index 0000000..93d217b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/SaveReportLowVision.java
@@ -0,0 +1,518 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Junji MAEDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.eval;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.List;
+
+import org.eclipse.actf.util.FileUtils;
+import org.eclipse.actf.util.ui.DialogSave;
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineData;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.ProblemConst;
+import org.eclipse.actf.visualization.eval.problem.ProblemItemLV;
+import org.eclipse.actf.visualization.lowvision.ui.internal.Messages;
+import org.eclipse.actf.visualization.lowvision.util.LowVisionVizResourceUtil;
+import org.eclipse.swt.widgets.Shell;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+
+public class SaveReportLowVision {
+
+ private static final String LVIMG_FILE = "lvimg.bmp";
+
+ private static final String RESULT_BMP_FILE = "result.bmp";
+
+ private static final String[] ERROR_IMAGE_ALT = {
+ Messages.getString("SaveReportLowVision.Iro21_Error_Alt"),
+ Messages.getString("SaveReportLowVision.Boke21_Error_Alt") };
+
+ private Shell shell;
+
+ private String saveFileName;
+
+ private List<IProblemItem> problemList;
+
+ private String currentUrlS;
+
+ private boolean bSave;
+
+ private String saveImgName;
+
+ // private String probStaticsName;
+ private String strParamNo;
+
+ private int iColorNum;
+
+ private int iFontNum;
+
+ private int processNo;
+
+ private Document document;
+
+ private File vizImageFile;
+
+ private File reportImageFile;
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder
+ .getInstance();
+
+ public SaveReportLowVision(Shell _shell) {
+ shell = _shell;
+ saveFileName = "";
+ }
+
+ // TODO save rating
+
+ public void doSave(String _currentUrlS, List<IProblemItem> targetList,
+ File vizImageFile, File reportImageFile) {
+ currentUrlS = _currentUrlS;
+
+ saveFileName = DialogSave.open(shell, DialogSave.HTML, currentUrlS,
+ "_lowVision.htm");
+ saveImgName = LVIMG_FILE;
+ // probStaticsName = "";
+ problemList = targetList;
+
+ if (saveFileName == null)
+ return;
+ document = null;
+ bSave = true;
+
+ this.vizImageFile = vizImageFile;
+ this.reportImageFile = reportImageFile;
+
+ SaveBmpFileThread saveThread = new SaveBmpFileThread();
+ saveThread.start();
+ }
+
+ public void doSave(int _processNo, int[] paramNo, String paramStr,
+ String folder, Document probStatisticsDoc, String _currentUrlS,
+ List<IProblemItem> targetList, File vizImageFile,
+ File reportImageFile) {
+ currentUrlS = _currentUrlS;
+ processNo = _processNo;
+ this.vizImageFile = vizImageFile;
+ this.reportImageFile = reportImageFile;
+
+ // saveFileName = DialogSave.open(shell,DialogSave.HTML, currentUrlS,
+ // "_lowVision.htm");
+ saveFileName = currentUrlS;
+ if (saveFileName != null) {
+
+ int iPos = saveFileName.indexOf("//");
+ if (iPos == -1)
+ iPos = 0;
+ saveFileName = saveFileName.substring(iPos + 2);
+ saveFileName = saveFileName.replaceAll("\\p{Punct}", "_");
+
+ if (saveFileName.indexOf(".") > 0) {
+ saveFileName = saveFileName.substring(0, saveFileName
+ .lastIndexOf("."));
+ }
+
+ if (saveFileName.length() > 100) {
+ saveFileName = saveFileName.substring(0, 100);
+ }
+ // saveFileName += "_"+String.valueOf(processNo)+"_lowVision.htm";
+ }
+ // probStaticsName = folder + probName;
+ saveImgName = saveFileName + "_" + String.valueOf(processNo) + "_"
+ + String.valueOf(paramNo[0]) + String.valueOf(paramNo[1])
+ + String.valueOf(paramNo[2]) + "_lvimg.png";
+ saveFileName += "_" + String.valueOf(processNo) + "_"
+ + String.valueOf(paramNo[0]) + String.valueOf(paramNo[1])
+ + String.valueOf(paramNo[2]) + "_lowVision.htm";
+ folder += "lowvision" + File.separator;
+ File testDir = new File(folder);
+ if (!testDir.isDirectory())
+ testDir.mkdirs();
+ saveFileName = folder + saveFileName;
+ strParamNo = paramStr;
+
+ problemList = targetList;
+
+ if (saveFileName == null)
+ return;
+ document = probStatisticsDoc;
+ bSave = true;
+ SaveBmpFileThread saveThread = new SaveBmpFileThread();
+ saveThread.start();
+ }
+
+ private class SaveBmpFileThread extends Thread {
+
+ private String getArrayString(int[][] data, int item) {
+ StringBuffer tmpSB = new StringBuffer();
+ try {
+ if (data.length > 0) {
+ for (int i = 0; i < data.length; i++) {
+ tmpSB.append(data[i][item] + ",");
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return (tmpSB.toString());
+ }
+
+ private void prepareJavaScript(Writer writer,
+ ProblemItemLV[] problemArray, String imgDir) {
+
+ int size = problemArray.length;
+ int[][] data = new int[size][4]; // left,top,width,height
+ for (int i = 0; i < size; i++) {
+ data[i][0] = problemArray[i].getX();
+ data[i][1] = problemArray[i].getY();
+ data[i][2] = problemArray[i].getWidth();
+ data[i][3] = problemArray[i].getHeight();
+ }
+ try {
+ writer.write("<SCRIPT Language=\"JavaScript\">"
+ + Constants.LINE_SEP);
+ writer.write("var divLeft = new Array("
+ + getArrayString(data, 0) + "0);" + Constants.LINE_SEP);
+ writer.write("var divTop = new Array("
+ + getArrayString(data, 1) + "0);" + Constants.LINE_SEP);
+ writer.write("var divWidth = new Array("
+ + getArrayString(data, 2) + "0);" + Constants.LINE_SEP);
+ writer.write("var divHeight = new Array("
+ + getArrayString(data, 3) + "0);" + Constants.LINE_SEP);
+ writer.write("var divArray = new Array(" + size + ");"
+ + Constants.LINE_SEP);
+ writer.write("var sLeft = new Array(" + size + ");"
+ + Constants.LINE_SEP);
+ writer.write("var sTop = new Array(" + size + ");"
+ + Constants.LINE_SEP);
+
+ writer.write("</SCRIPT>" + Constants.LINE_SEP);
+ // writer.write(
+ // "<SCRIPT Language=\"JavaScript\"
+ // src=\"lvHighlight.js\"></SCRIPT>"
+ // + ADesignerConst.LINE_SEP);
+ writer.write("<SCRIPT><!--" + Constants.LINE_SEP);
+ writer
+ .write("if(navigator.appName.toLowerCase().indexOf(\"microsoft\")>=0){"
+ + Constants.LINE_SEP);
+ writer.write("jsFile=\"" + imgDir + "lvHighlight.js\";"
+ + Constants.LINE_SEP);
+ writer.write("}else{" + Constants.LINE_SEP);
+ writer.write("jsFile=\"" + imgDir + "lvHighlight_moz.js\";"
+ + Constants.LINE_SEP);
+ writer.write("}" + Constants.LINE_SEP);
+ writer
+ .write("document.write(\"<script src=\"+jsFile+\"></script>\");"
+ + Constants.LINE_SEP);
+ writer.write("-->" + Constants.LINE_SEP + "</SCRIPT>"
+ + Constants.LINE_SEP);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public void run() {
+ try {
+
+ String saveDir = saveFileName.substring(0, saveFileName
+ .lastIndexOf("."));
+ ;
+ File tmpFile = new File(saveDir);
+ tmpFile.mkdirs();
+
+ String imgDir = saveDir;
+ imgDir = getFileName(imgDir) + "/";
+
+ saveDir += File.separator;
+ String saveBmpName = saveDir + RESULT_BMP_FILE;
+
+ FileUtils.copyFile(vizImageFile.getAbsolutePath(), saveBmpName,
+ true);
+
+ PrintWriter fileOutput = new PrintWriter(new FileWriter(
+ saveFileName));
+ // FileWriter fileOutput = new FileWriter(saveFileName);
+ // problemLVItemArray =
+ // phlv.getProblemTableItemArrayLV();
+
+ fileOutput.write("<html><head><title>Report (LowVision) of "
+ + currentUrlS + "</title>");
+
+ ProblemItemLV[] problemLVArray = new ProblemItemLV[problemList
+ .size()];
+ problemList.toArray(problemLVArray);
+
+ prepareJavaScript(fileOutput, problemLVArray, imgDir);
+
+ fileOutput.write("</head>");
+ if (problemLVArray.length > 0) {
+ fileOutput.write("<body onload=\"onloadFunc()\">"
+ + Constants.LINE_SEP);
+ } else {
+ fileOutput.write("<body>" + Constants.LINE_SEP);
+ }
+
+ // TODO logo
+ // fileOutput.write("<DIV align=\"right\"><img src=\"" + imgDir
+ // + ImageUtils.LOGO + "\"></DIV><hr>"
+ // + LINE_SEP);
+
+ if (reportImageFile != null) {
+ fileOutput.write("<p><FONT>Problem Map</FONT><BR>");
+ fileOutput
+ .write("<img src=\""
+ // + LVIMG_FILE //Modified on 2004/02/05
+ + imgDir
+ + saveImgName
+ + "\" height=\"200\" style=\"{border:2 solid black}\">");
+ fileOutput.write("</p><hr>" + Constants.LINE_SEP);
+ }
+
+ fileOutput.write("<DIV id=\"mother\">");
+ fileOutput.write("<img id=\"simImg\" src=\"" + imgDir
+ + RESULT_BMP_FILE + "\"></DIV>" + Constants.LINE_SEP);
+ fileOutput.write("<hr>" + Constants.LINE_SEP);
+
+ iColorNum = 0;
+ iFontNum = 0;
+
+ if (problemLVArray.length > 0) {
+
+ fileOutput.write("<table border=\"1\">\r\n");
+
+ fileOutput.write("<tr>");
+ fileOutput
+ .write("<th>" + ProblemConst.TITLE_ICON + "</th>");
+
+ GuidelineData[] guidelineDataArray = guidelineHolder
+ .getGuidelineData();
+ for (int i = 0; i < guidelineDataArray.length; i++) {
+ fileOutput.write("<th>"
+ + guidelineDataArray[i].getGuidelineName()
+ + "</th>");
+ }
+
+ fileOutput.write("<th>" + ProblemConst.TITLE_DESCRIPTION
+ + "</th>");
+
+ fileOutput.write("<th>" + ProblemConst.TITLE_SEVERITY
+ + "</th>");
+ fileOutput.write("<th>" + ProblemConst.TITLE_FORECOLOR
+ + "</th>");
+
+ fileOutput.write("<th>" + ProblemConst.TITLE_BACKCOLOR
+ + "</th>");
+
+ fileOutput.write("<th>" + ProblemConst.TITLE_X + "</th>");
+
+ fileOutput.write("<th>" + ProblemConst.TITLE_Y + "</th>");
+
+ fileOutput
+ .write("<th>" + ProblemConst.TITLE_AREA + "</th>");
+
+ fileOutput.write("</tr>" + Constants.LINE_SEP);
+
+ LowVisionVizResourceUtil.saveErrorIcons(saveDir);
+ LowVisionVizResourceUtil.saveImages(saveDir);
+ LowVisionVizResourceUtil.saveScripts(saveDir);
+
+ for (int i = 0; i < problemLVArray.length; i++) {
+ fileOutput.write("<tr id=\"" + i
+ + "\" onclick=\"TROnclickFunc(this)\">");
+
+ int iconId = problemLVArray[i].getIconId();
+ int currentIcon = 0;
+ String strIconName = "";// TODO
+ switch (iconId) {
+ case ProblemItemLV.ICON_IRO:
+ iColorNum++;
+ currentIcon = 0;
+ if (problemLVArray[i].isCanHighlight()) {
+ strIconName = "HiIro21.gif";
+ } else {
+ strIconName = "ErrIro21.gif";
+ }
+ break;
+ case ProblemItemLV.ICON_BOKE:
+ iFontNum++;
+ currentIcon = 1;
+ if (problemLVArray[i].isCanHighlight()) {
+ strIconName = "HiBoke21.gif";
+ } else {
+ strIconName = "ErrBoke21.gif";
+ }
+ break;
+ }
+ ;
+
+ fileOutput.write("<td><img src=" + imgDir + strIconName
+ + " alt=\"" + ERROR_IMAGE_ALT[currentIcon]
+ + "\"></td>");
+
+ String[] guidelineItems = problemLVArray[i]
+ .getEvaluationItem().getTableDataGuideline();
+
+ for (int j = 0; j < guidelineItems.length; j++) {
+ fileOutput.write("<td>" + guidelineItems[j]
+ + " </td>");
+ }
+
+ fileOutput
+ .write("<td STYLE=\"COLOR:blue;TEXT-DECORATION:underline\">"
+ + problemLVArray[i].getDescription()
+ + " </td>");
+
+ fileOutput.write("<td>"
+ + String.valueOf(problemLVArray[i]
+ .getSeverityLV()) + " </td>");
+
+ fileOutput.write("<td>"
+ + problemLVArray[i].getForegroundS()
+ + " </td>");
+
+ fileOutput.write("<td>"
+ + problemLVArray[i].getBackgroundS()
+ + " </td>");
+
+ fileOutput.write("<td>"
+ + String.valueOf(problemLVArray[i].getX())
+ + " </td>");
+
+ fileOutput.write("<td>"
+ + String.valueOf(problemLVArray[i].getY())
+ + " </td>");
+
+ fileOutput.write("<td>"
+ + String.valueOf(problemLVArray[i].getArea())
+ + " </td>");
+
+ fileOutput.write("</tr>" + Constants.LINE_SEP);
+ }
+
+ fileOutput.write("</table>" + Constants.LINE_SEP);
+ }
+
+ if (reportImageFile != null) {
+ FileUtils.copyFile(reportImageFile.getAbsolutePath(),
+ saveDir + saveImgName, true);
+ }
+
+ fileOutput.write("</body>" + Constants.LINE_SEP);
+ fileOutput.write("</html>");
+
+ fileOutput.flush();
+ fileOutput.close();
+
+ // problem statics
+ if (document != null) {
+ int iPos = saveFileName.lastIndexOf("lowvision"
+ + File.separator);
+ // String relFile = saveFileName.substring(iPos);
+ String relFile = "lowvision/"
+ + saveFileName.substring(iPos + 10);
+
+ // HtmlParserUtil hpu = new HtmlParserUtil();
+ // hpu.parse(new FileInputStream(probStaticsName +
+ // ".html"));
+ // SHDocument document = hpu.getSHDocument();
+
+ NodeList tdList = document.getElementsByTagName("td");
+ Element urlEle = (Element) tdList.item(0);
+ Node oldNode = urlEle.getChildNodes().item(0);
+ urlEle.replaceChild(document.createTextNode("URL("
+ + String.valueOf(processNo) + ")"), oldNode);
+
+ NodeList tableList = document.getElementsByTagName("tbody");
+ Element tableEle = (Element) tableList.item(0);
+ Element trElement = document.createElement("tr");
+ tableEle.appendChild(trElement);
+ Element tdElement = document.createElement("td");
+ tdElement.setAttribute("width", "600");
+ trElement.appendChild(tdElement);
+ Element aElement = document.createElement("a");
+ aElement.setAttribute("href", relFile);
+ aElement.appendChild(document.createTextNode(currentUrlS));
+ tdElement.appendChild(aElement);
+ tdElement = document.createElement("td");
+ tdElement.appendChild(document.createTextNode(strParamNo));
+ trElement.appendChild(tdElement);
+ tdElement = document.createElement("td");
+ tdElement.appendChild(document.createTextNode(String
+ .valueOf(iColorNum)));
+ trElement.appendChild(tdElement);
+ tdElement = document.createElement("td");
+ tdElement.appendChild(document.createTextNode(String
+ .valueOf(iFontNum)));
+ trElement.appendChild(tdElement);
+ // tdElement = document.createElement("td");
+ // tdElement.appendChild(
+ // document.createTextNode(String.valueOf(iBobbyNum)));
+ // trElement.appendChild(tdElement);
+ // PrintWriter pw =
+ // new PrintWriter(
+ // new FileWriter(probStaticsName + ".html"));
+ // document.printAsSGML(pw, true);
+ // pw.flush();
+ // pw.close();
+ }
+
+ bSave = false;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ public boolean isInSaveReport() {
+ return bSave;
+ }
+
+ /**
+ * @return
+ */
+ public int getNumColorProblem() {
+ return iColorNum;
+ }
+
+ /**
+ * @return
+ */
+ public int getNumFontProblem() {
+ return iFontNum;
+ }
+
+ private String getFileName(String filePath) {
+ int index = filePath.lastIndexOf("/");
+ int index2 = filePath.lastIndexOf("\\");
+ if (index < index2) {
+ index = index2;
+ }
+ if (index > -1) {
+ return filePath.substring(index + 1);
+ }
+ return filePath;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/SummaryEvaluationLV.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/SummaryEvaluationLV.java
new file mode 100644
index 0000000..c094d34
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/eval/SummaryEvaluationLV.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.eval;
+
+import java.util.List;
+
+import org.eclipse.actf.util.ui.HighlightStringListener;
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.ProblemItemLV;
+import org.eclipse.actf.visualization.lowvision.ui.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+
+
+public class SummaryEvaluationLV {
+
+ public static HighlightStringListener getHighLightStringListener() {
+ HighlightStringListener hlsl = new HighlightStringListener();
+ Color blue = Display.getDefault().getSystemColor(SWT.COLOR_BLUE);
+ Color red = Display.getDefault().getSystemColor(SWT.COLOR_RED);
+ Color green = Display.getDefault().getSystemColor(SWT.COLOR_GREEN);
+
+ hlsl
+ .addTarget(
+ Messages
+ .getString("EvalLV.no.color.difficult.distinguish"), blue, SWT.BOLD); //$NON-NLS-1$
+ hlsl
+ .addTarget(
+ Messages.getString("EvalLV.font.might.enough.to.read"), blue, SWT.BOLD); //$NON-NLS-1$
+
+ hlsl
+ .addTarget(
+ Messages
+ .getString("EvalLV.color.difficult.distinguish"), red, SWT.BOLD); //$NON-NLS-1$
+ hlsl
+ .addTarget(
+ Messages
+ .getString("EvalLV.color.might.difficult.distinguish"), red, SWT.BOLD); //$NON-NLS-1$
+ hlsl
+ .addTarget(
+ Messages.getString("EvalLV.font.too.small.to.read"), red, SWT.BOLD); //$NON-NLS-1$
+ hlsl
+ .addTarget(
+ Messages
+ .getString("EvalLV.font.might.too.small.to.read"), red, SWT.BOLD); //$NON-NLS-1$
+ hlsl
+ .addTarget(
+ Messages.getString("EvalLV.page.have.fixed.font"), red, SWT.BOLD); //$NON-NLS-1$
+
+ hlsl.addTarget(Messages.getString("EvalLV.0"), green, SWT.BOLD);
+ // TODO
+
+ return (hlsl);
+ }
+
+ private ProblemItemLV[] _problems = new ProblemItemLV[0];
+
+ public SummaryEvaluationLV(List<IProblemItem> problemList) {
+ try {
+ _problems = new ProblemItemLV[problemList.size()];
+ problemList.toArray(_problems);
+ } catch (Exception e) {
+ _problems = new ProblemItemLV[0];
+ }
+ }
+
+ public static String notSupported() {
+ return (Messages.getString("EvalLV.0")); //$NON-NLS-1$
+ }
+
+ public String getOverview() {
+ StringBuffer tmpSB = new StringBuffer(512);
+
+ int problemCount[] = new int[] { 0, 0, 0, 0, 0, 0, 0 };
+ int severeCount[] = new int[] { 0, 0, 0, 0, 0, 0, 0 };
+
+ for (int i = 0; i < _problems.length; i++) {
+ ProblemItemLV curProblem = _problems[i];
+ problemCount[curProblem.getSubType()]++;
+ if (curProblem.getSeverityLV() > 49) {
+ severeCount[curProblem.getSubType()]++;
+ }
+ }
+
+ // for(int i=0;i<problemCount.length;i++){
+ // System.out.print(problemCount[i]+"/"+severeCount[i]+", ");
+ // }
+
+ if (problemCount[1] > 0 || problemCount[3] > 0) {
+ if (severeCount[1] > 0 || severeCount[3] > 0) {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.color.difficult.distinguish") + Constants.LINE_SEP); //$NON-NLS-1$
+ } else {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.color.might.difficult.distinguish") + Constants.LINE_SEP); //$NON-NLS-1$
+ }
+ tmpSB
+ .append(Messages.getString("EvalLV.click.detailed.report") + Constants.LINE_SEP); //$NON-NLS-1$
+
+ tmpSB.append(Constants.LINE_SEP);
+ if (problemCount[1] > 0) {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.text.color.combination") + " " + problemCount[1] + Constants.LINE_SEP); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ if (problemCount[3] > 0) {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.img.color.combination") + " " + problemCount[3] + Constants.LINE_SEP); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.no.color.difficult.distinguish") + Constants.LINE_SEP); //$NON-NLS-1$
+ }
+
+ tmpSB.append(Constants.LINE_SEP);
+
+ if (problemCount[5] > 0 || problemCount[6] > 0) {
+ if (severeCount[5] > 0 || severeCount[6] > 0) {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.font.too.small.to.read") + Constants.LINE_SEP); //$NON-NLS-1$
+ } else {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.font.might.too.small.to.read") + Constants.LINE_SEP); //$NON-NLS-1$
+ }
+ tmpSB
+ .append(Messages.getString("EvalLV.click.detailed.report") + Constants.LINE_SEP); //$NON-NLS-1$
+
+ tmpSB.append(Constants.LINE_SEP);
+ if (problemCount[5] > 0) {
+ tmpSB
+ .append(Messages.getString("EvalLV.font.too.small") + " " + problemCount[5]); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ if (problemCount[6] > 0) {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.font.too.small.fixed") + " " + problemCount[6]); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else if (problemCount[4] > 0) {
+ tmpSB
+ .append(Messages.getString("EvalLV.page.have.fixed.font") + Constants.LINE_SEP); //$NON-NLS-1$
+ tmpSB.append(Constants.LINE_SEP);
+ tmpSB
+ .append(Messages.getString("EvalLV.font.fixed") + " " + problemCount[4]); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ tmpSB
+ .append(Messages
+ .getString("EvalLV.font.might.enough.to.read") + Constants.LINE_SEP); //$NON-NLS-1$
+ }
+
+ return (tmpSB.toString());
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSaveAction.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSaveAction.java
new file mode 100644
index 0000000..bfb4691
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSaveAction.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.actions;
+
+import org.eclipse.actf.util.ui.Messages;
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.eclipse.actf.visualization.lowvision.ui.internal.PartControlLowVision;
+import org.eclipse.jface.action.Action;
+
+
+
+public class LowVisionSaveAction extends Action {
+
+ private PartControlLowVision lowVisionCtrl;
+
+ public LowVisionSaveAction(PartControlLowVision lowVisionCtrl) {
+ setToolTipText(Messages.getString("Tooltip.Save")); //$NON-NLS-1$
+ setImageDescriptor(LowVisionVizPlugin.imageDescriptorFromPlugin(LowVisionVizPlugin.PLUGIN_ID, "icons/ButtonSave.png"));
+ setText(Messages.getString("MenuConst.Save")); //$NON-NLS-1$
+ this.lowVisionCtrl = lowVisionCtrl;
+ }
+
+ public void run() {
+ lowVisionCtrl.saveReport();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSettingsAction.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSettingsAction.java
new file mode 100644
index 0000000..4c6776a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSettingsAction.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.actions;
+
+import org.eclipse.actf.util.ui.Messages;
+import org.eclipse.actf.util.ui.PreferenceUtils;
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.eclipse.actf.visualization.lowvision.ui.preferences.LowVisionPreferencePage;
+import org.eclipse.jface.action.Action;
+
+
+
+public class LowVisionSettingsAction extends Action {
+
+ public LowVisionSettingsAction() {
+ setToolTipText(Messages.getString("Tooltip.Settings")); //$NON-NLS-1$
+ setImageDescriptor(LowVisionVizPlugin.imageDescriptorFromPlugin(LowVisionVizPlugin.PLUGIN_ID, "icons/setting.png"));
+ setText(Messages.getString("MenuConst.Settings")); //$NON-NLS-1$
+ }
+
+ public void run() {
+ PreferenceUtils.openPreferenceDialog(LowVisionPreferencePage.ID);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSimulateAction.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSimulateAction.java
new file mode 100644
index 0000000..8584782
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/actions/LowVisionSimulateAction.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.actions;
+
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.eclipse.actf.visualization.lowvision.ui.internal.Messages;
+import org.eclipse.actf.visualization.lowvision.ui.internal.PartControlLowVision;
+import org.eclipse.jface.action.Action;
+
+
+public class LowVisionSimulateAction extends Action {
+
+ private PartControlLowVision lowVisionCtrl;
+
+ public LowVisionSimulateAction(PartControlLowVision lowVisionCtrl) {
+ setToolTipText(Messages.getString("LowVisionView.Simulate_2")); //$NON-NLS-1$
+ setImageDescriptor(LowVisionVizPlugin.imageDescriptorFromPlugin(
+ LowVisionVizPlugin.PLUGIN_ID, "icons/simulation.png"));
+ setText(Messages.getString("LVSimulationAction.0")); //$NON-NLS-1$
+ this.lowVisionCtrl = lowVisionCtrl;
+ }
+
+ public void run() {
+ lowVisionCtrl.setLVParamStatus();
+ lowVisionCtrl.doSimulate();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/LowVisionSimulationView.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/LowVisionSimulationView.java
new file mode 100644
index 0000000..b153597
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/LowVisionSimulationView.java
@@ -0,0 +1,525 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.actf.mediator.Mediator;
+import org.eclipse.actf.model.ModelServiceSizeInfo;
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.IModelServiceScrollManager;
+import org.eclipse.actf.visualization.eval.problem.IPositionSize;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+
+public class LowVisionSimulationView {
+
+ private Display _display;
+
+ private Canvas _imageCanvas;
+
+ private Image _image = null;
+
+ private ImageData _imageData = null; // the currently-displayed image
+
+ // data
+
+ private int _ix;
+
+ private int _iy;
+
+ private ScrollBar _horizontalBar;
+
+ private ScrollBar _verticalBar;
+
+ private boolean _isLocked = false;
+
+ private List _highlightTargetList = new ArrayList();
+
+ private LowVisionToolbar _lowVisionToolbar;
+
+ private Mediator mediator = Mediator.getInstance();
+
+ private IModelService target;
+
+ // separate from PartRightLowVision
+ public LowVisionSimulationView(Composite parent,
+ PartControlLowVision lowVisionCtrl) {
+
+ this._display = parent.getDisplay();
+ this._ix = 0;
+ this._iy = 0;
+
+ GridData gridData;
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ gridLayout.marginHeight = gridLayout.marginWidth = 0;
+ gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
+ parent.setLayout(gridLayout);
+
+ this._lowVisionToolbar = new LowVisionToolbar(parent, SWT.NONE,
+ lowVisionCtrl);
+
+ Composite compositeLowVisionHalf2 = new Composite(parent, SWT.NONE);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ compositeLowVisionHalf2.setLayoutData(gridData);
+
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ gridLayout.marginHeight = gridLayout.marginWidth = 0;
+ gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
+ compositeLowVisionHalf2.setLayout(gridLayout);
+
+ // Canvas to show the image.
+ this._imageCanvas = new Canvas(compositeLowVisionHalf2, SWT.V_SCROLL
+ | SWT.H_SCROLL);
+ // | SWT.NO_REDRAW_RESIZE
+ this._imageCanvas.setBackground(new Color(_display, 255, 255, 255));
+ // white color
+ gridData = new GridData();
+ gridData.horizontalSpan = 1;
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ this._imageCanvas.setLayoutData(gridData);
+
+ this._imageCanvas.addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent event) {
+
+ if (null == _imageData) {
+ return;
+ }
+
+ if (null != _image) {
+ paintImage(event);
+ }
+
+ resizeScrollBars();
+
+ if (null == _image || _isLocked) {
+ _lowVisionToolbar.getSyncButton().setSelection(true);
+ _lowVisionToolbar.getSyncButton().setEnabled(false);
+ } else {
+ int imageHeight = Math.round(_imageData.height);
+
+ int ieHeight = Integer.MIN_VALUE;
+
+ IModelService modelService = mediator
+ .getActiveModelService();
+ if (modelService != null) {
+ ieHeight = modelService.getScrollManager()
+ .getSize(true).getWholeSizeY();
+ }
+
+ // TODO use bar height
+ if (Math.abs(imageHeight - ieHeight) < 10) {
+ _lowVisionToolbar.getSyncButton().setEnabled(true);
+ } else {
+ _lowVisionToolbar.getSyncButton().setEnabled(false);
+ }
+ }
+
+ }
+ });
+
+ // _imageCanvas.addMouseMoveListener(new MouseMoveListener() {
+ // public void mouseMove(MouseEvent event) {
+ // // do nothing
+ // }
+ // });
+
+ // Set up the image canvas scroll bars.
+ _horizontalBar = _imageCanvas.getHorizontalBar();
+ _horizontalBar.setVisible(true);
+ _horizontalBar.setMinimum(0);
+ _horizontalBar.setEnabled(false);
+ _horizontalBar.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ scrollHorizontally((ScrollBar) event.widget);
+ }
+ });
+ _verticalBar = _imageCanvas.getVerticalBar();
+ _verticalBar.setVisible(true);
+ _verticalBar.setMinimum(0);
+ _verticalBar.setEnabled(false);
+ _verticalBar.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ scrollVertically((ScrollBar) event.widget);
+ }
+ });
+
+ parent.getShell().addListener(100, new Listener() {
+ public void handleEvent(Event e) {
+ setVScrollBar(e.detail);
+ }
+ });
+
+ }
+
+ protected Point getVarticalBarSize() {
+ return _verticalBar.getSize();
+ }
+
+ protected void highlight(List target) {
+
+ if (target != null) {
+ // int topX = 0;
+ int topY = -1;
+
+ for (Iterator i = target.iterator(); i.hasNext();) {
+ try {
+ IPositionSize ips = (IPositionSize) i.next();
+ if (topY < 0 || topY > ips.getY()) {
+ topY = ips.getY();
+ // TODO topX = ips.getX();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (topY >= 0) {
+ Rectangle canvasBounds = this._imageCanvas.getClientArea();
+ int height = Math.round(this._imageData.height); // yscale
+ if (height > canvasBounds.height) {
+ if (height - topY < canvasBounds.height) {
+ // Don't scroll past the end of the image.
+ topY = height - canvasBounds.height;
+ }
+ if (this._lowVisionToolbar.getSyncButton().isEnabled()
+ && this._lowVisionToolbar.getSyncButton()
+ .getSelection()) {
+ // TODO use VizResult ModelService mapping
+ // BrowserEventListenerManager.getInstance().fireScrollY(this._iy
+ // + topY);
+ }
+ setVScrollBar(topY);
+ }
+ }
+ this._highlightTargetList = target;
+ }
+
+ this._imageCanvas.redraw();
+
+ }
+
+ public void disposeImage() {
+ if (_image != null && _image.isDisposed()) {
+ _image.dispose();
+
+ }
+ _image = null;
+ if (_imageData != null) {
+ _imageData = null;
+ }
+ }
+
+ protected void clearImage() {
+ if (_image != null) {
+ _image.dispose();
+ _image = null;
+ }
+ if (_imageData != null) {
+ _imageData = null;
+ }
+ _highlightTargetList = new ArrayList();
+ resetScrollBars();
+ _imageCanvas.redraw();
+ }
+
+ protected void displayImage(ImageData newImageData) {
+ // Dispose of the old image, if there was one.
+ if (null != this._image) {
+ this._image.dispose();
+ }
+
+ this._imageData = newImageData;
+ this._image = null;
+
+ if (null != this._imageData) {
+ try {
+ // Cache the new image and imageData.
+ this._image = new Image(_display, newImageData);
+ } catch (SWTException se) {
+ se.printStackTrace();
+ }
+ }
+
+ // Redraw the canvases.
+ _imageCanvas.redraw();
+ }
+
+ private void paintImage(PaintEvent event) {
+ if (null == _image || null == _imageData) {
+ return;
+ }
+
+ Image paintImage = _image;
+ // int transparentPixel = _imageData.transparentPixel;
+ int w = Math.round(_imageData.width); // xscale
+ int h = Math.round(_imageData.height); // yscale
+ event.gc
+ .drawImage(paintImage, 0, 0, _imageData.width,
+ _imageData.height, _ix + _imageData.x, _iy
+ + _imageData.y, w, h);
+
+ // Vector tmpV = lowVisionControl.getSelectedItemsInfo();
+ List tmpV = _highlightTargetList;
+ if (tmpV != null) {
+ event.gc.setXORMode(false);
+ event.gc.setLineWidth(2);
+ for (Iterator i = tmpV.iterator(); i.hasNext();) {
+ try {
+ IPositionSize ips = (IPositionSize) i.next();
+
+ event.gc.setForeground(_display
+ .getSystemColor(SWT.COLOR_WHITE));
+ event.gc.drawRectangle(_ix + ips.getX(), _iy + ips.getY(),
+ ips.getWidth(), ips.getHeight());
+
+ event.gc.setForeground(_display
+ .getSystemColor(SWT.COLOR_BLACK));
+ event.gc.drawRectangle(_ix + ips.getX() - 2, _iy
+ + ips.getY() - 2, ips.getWidth() + 4, ips
+ .getHeight() + 4);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ protected void resetScrollBars() {
+ if (_image == null) {
+ _horizontalBar.setEnabled(false);
+ _verticalBar.setEnabled(false);
+ return;
+ }
+
+ _ix = 0;
+ _iy = 0;
+ resizeScrollBars();
+ _horizontalBar.setSelection(0);
+ _verticalBar.setSelection(0);
+ }
+
+ private void resizeScrollBars() {
+ if (_imageData == null)
+ return;
+
+ // Set the max and thumb for the image canvas scroll bars.
+
+ Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(_imageData.width); // xscale
+ if (width > canvasBounds.width) {
+ // The image is wider than the canvas.
+ _horizontalBar.setEnabled(true);
+ _horizontalBar.setMaximum(width);
+ _horizontalBar.setThumb(canvasBounds.width);
+ _horizontalBar.setPageIncrement(canvasBounds.width);
+ } else {
+ // The canvas is wider than the image.
+ _horizontalBar.setEnabled(false);
+ if (_ix != 0) {
+ // Make sure the image is completely visible.
+ _ix = 0;
+ _imageCanvas.redraw();
+ }
+ }
+ int height = Math.round(_imageData.height); // yscale
+ if (height > canvasBounds.height) {
+ // The image is taller than the canvas.
+ _verticalBar.setEnabled(true);
+ _verticalBar.setMaximum(height);
+ _verticalBar.setThumb(canvasBounds.height);
+ _verticalBar.setPageIncrement(canvasBounds.height);
+ } else {
+ // The canvas is taller than the image.
+ _verticalBar.setEnabled(false);
+ if (_iy != 0) {
+ // Make sure the image is completely visible.
+ _iy = 0;
+ _imageCanvas.redraw();
+ }
+ }
+ }
+
+ private void scrollHorizontally(ScrollBar scrollBar) {
+ if (_image == null)
+ return;
+ Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(_imageData.width); // xscale
+ int height = Math.round(_imageData.height); // yscale
+ if (width > canvasBounds.width) {
+ // Only scroll if the image is bigger than the canvas.
+ int x = -scrollBar.getSelection();
+ if (x + width < canvasBounds.width) {
+ // Don't scroll past the end of the image.
+ x = canvasBounds.width - width;
+ }
+ _imageCanvas.scroll(x, _iy, _ix, _iy, width, height, false);
+ _ix = x;
+
+ }
+ }
+
+ /*
+ * Called when the image canvas' vertical scrollbar is selected.
+ */
+ private void scrollVertically(ScrollBar scrollBar) {
+ if (null != this._image) {
+ Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(this._imageData.width); // xscale
+ int height = Math.round(this._imageData.height); // yscale
+ if (height > canvasBounds.height) {
+ // Only scroll if the image is bigger than the canvas.
+ int y = -scrollBar.getSelection();
+ if (y + height < canvasBounds.height) {
+ // Don't scroll past the end of the image.
+ y = canvasBounds.height - height;
+ }
+ // System.out.println("height=" + height + ", ix=" + _ix+", iy="
+ // + _iy + ", y=" + y);
+ _imageCanvas.scroll(_ix, y, _ix, _iy, width, height, false);
+
+ if (this._lowVisionToolbar.getSyncButton().isEnabled()
+ && this._lowVisionToolbar.getSyncButton()
+ .getSelection()) {
+
+ if (target != null) {
+ IModelServiceScrollManager scrollManager = target
+ .getScrollManager();
+ switch (scrollManager.getScrollType()) {
+ case IModelServiceScrollManager.ABSOLUTE_COORDINATE:
+ scrollManager.absoluteCoordinateScroll(
+ this._iy - y, false);
+ break;
+ case IModelServiceScrollManager.INCREMENTAL:
+ // TODO
+ break;
+ case IModelServiceScrollManager.PAGE:
+ ModelServiceSizeInfo sizeInfo = scrollManager
+ .getSize(false);
+ int page = Math.abs(y / sizeInfo.getViewSizeY()) + 1;
+ // System.out.println(y+"
+ // "+sizeInfo.getViewSizeY()+" "+page);
+ if (page < 1) {
+ page = 1;
+ } else if (page > scrollManager.getLastPageNumber()) {
+ page = scrollManager.getCurrentPageNumber();
+ }
+ if (page != scrollManager.getCurrentPageNumber()) {
+ scrollManager.jumpToPage(page, false);
+ }
+
+ break;
+ case IModelServiceScrollManager.NONE:
+ default:
+ }
+ }
+
+ // BrowserEventListenerManager.getInstance().fireScrollY(this._iy
+ // - y);
+ }
+
+ _iy = y;
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ public boolean isWholepage() {
+ Button button = _lowVisionToolbar.getWholePageButton();
+
+ return (button.isEnabled() && button.getSelection());
+ }
+
+ private void setVScrollBar(int iPos) {
+ if (this._lowVisionToolbar.getSyncButton().isEnabled()
+ && this._lowVisionToolbar.getSyncButton().getSelection()) {
+ if (_image == null) {
+ return;
+ }
+
+ // Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(_imageData.width); // xscale
+ int height = Math.round(_imageData.height); // yscale
+
+ this._imageCanvas
+ .scroll(_ix, -iPos, _ix, _iy, width, height, false);
+ this._iy = -iPos;
+
+ this._imageCanvas.getVerticalBar().setSelection(iPos);
+
+ }
+ }
+
+ public void setWholePage(boolean isWholePage) {
+ this._lowVisionToolbar.getWholePageButton().setSelection(isWholePage);
+ }
+
+ public void setTarget(IModelService target) {
+ this.target = target;
+ Button button = _lowVisionToolbar.getWholePageButton();
+ Button button2 = _lowVisionToolbar.getSyncButton();
+
+ if(null==target){
+ button.setEnabled(false);
+ button2.setEnabled(false);
+ return;
+ }
+
+ switch (target.getScrollManager().getScrollType()) {
+ case IModelServiceScrollManager.ABSOLUTE_COORDINATE:
+ case IModelServiceScrollManager.INCREMENTAL:
+ case IModelServiceScrollManager.PAGE:
+ button.setEnabled(true);
+ button2.setEnabled(true);
+ break;
+ case IModelServiceScrollManager.NONE:
+ default:
+ button.setEnabled(false);
+ button2.setEnabled(false);
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/LowVisionToolbar.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/LowVisionToolbar.java
new file mode 100644
index 0000000..d2c6853
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/LowVisionToolbar.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.internal;
+
+import org.eclipse.actf.visualization.lowvision.ui.actions.LowVisionSaveAction;
+import org.eclipse.actf.visualization.lowvision.ui.actions.LowVisionSettingsAction;
+import org.eclipse.actf.visualization.lowvision.ui.actions.LowVisionSimulateAction;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ToolBar;
+
+
+public class LowVisionToolbar extends Composite {
+
+ private Button _wholePageButton;
+
+ private Button _syncButton;
+
+ private PartControlLowVision lowVisionCtrl;
+
+ public LowVisionToolbar(Composite parent, int style,
+ PartControlLowVision lowVisionCtrl) {
+ super(parent, style);
+ this.lowVisionCtrl = lowVisionCtrl;
+ initLayout(parent);
+ }
+
+ private void initLayout(Composite parent) {
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 0;
+ gridLayout.marginBottom = 1;
+ gridLayout.marginHeight = gridLayout.marginWidth = 1;
+ gridLayout.numColumns = 3;
+ setLayout(gridLayout);
+
+ ToolBar toolBar = new ToolBar(this, SWT.RIGHT);
+ ToolBarManager toolBarManager = new ToolBarManager(toolBar);
+
+ ActionContributionItem simulateActionItem = new ActionContributionItem(
+ new LowVisionSimulateAction(lowVisionCtrl));
+ simulateActionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ toolBarManager.add(simulateActionItem);
+ toolBarManager.add(new Separator());
+
+ ActionContributionItem settingsActionItem = new ActionContributionItem(
+ new LowVisionSettingsAction());
+ settingsActionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ toolBarManager.add(settingsActionItem);
+ toolBarManager.add(new Separator());
+
+ ActionContributionItem saveActionItem = new ActionContributionItem(
+ new LowVisionSaveAction(lowVisionCtrl));
+ saveActionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ toolBarManager.add(saveActionItem);
+
+ toolBarManager.update(true);
+
+ this._wholePageButton = new Button(this, SWT.CHECK);
+ this._wholePageButton.setText(Messages
+ .getString("LowVisionView.whole_page_1")); //$NON-NLS-1$
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.CENTER;
+ this._wholePageButton.setLayoutData(gridData);
+ this._wholePageButton.setSelection(true);
+
+ this._syncButton = new Button(this, SWT.CHECK);
+ this._syncButton.setText(Messages
+ .getString("LowVisionView.Synchronous_view_5")); //$NON-NLS-1$
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.CENTER;
+ this._syncButton.setLayoutData(gridData);
+ this._syncButton.setSelection(true);
+ }
+
+ public Button getSyncButton() {
+ return this._syncButton;
+ }
+
+ public Button getWholePageButton() {
+ return this._wholePageButton;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/Messages.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/Messages.java
new file mode 100644
index 0000000..12348e3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/Messages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.lowvision.ui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/PartControlLowVision.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/PartControlLowVision.java
new file mode 100644
index 0000000..ede7fdd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/internal/PartControlLowVision.java
@@ -0,0 +1,622 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Junji MAEDA - initial API and implementation
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.internal;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.actf.mediator.Mediator;
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.IWebBrowserACTF;
+import org.eclipse.actf.model.ModelServiceImageCreator;
+import org.eclipse.actf.model.events.IModelServiceEventListener;
+import org.eclipse.actf.model.ui.editor.ImagePositionInfo;
+import org.eclipse.actf.visualization.IVisualizationConst;
+import org.eclipse.actf.visualization.IVisualizationView;
+import org.eclipse.actf.visualization.engines.lowvision.TargetPage;
+import org.eclipse.actf.visualization.engines.lowvision.image.PageImage;
+import org.eclipse.actf.visualization.engines.lowvision.io.ImageDumpUtil;
+import org.eclipse.actf.visualization.eval.problem.IPositionSize;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.eclipse.actf.visualization.lowvision.eval.CheckResultLowVision;
+import org.eclipse.actf.visualization.lowvision.eval.SaveReportLowVision;
+import org.eclipse.actf.visualization.lowvision.eval.SummaryEvaluationLV;
+import org.eclipse.actf.visualization.lowvision.util.LowVisionUtil;
+import org.eclipse.actf.visualization.lowvision.util.ParamLowVision;
+import org.eclipse.actf.visualization.lowvision.util.SimulateLowVision;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.w3c.dom.Document;
+
+
+public class PartControlLowVision implements ISelectionListener,
+ IVisualizationConst, IModelServiceEventListener {
+
+ private String[] frameUrl;
+
+ private PageImage[] framePageImage;
+
+ private ImagePositionInfo[][] imageInfoInHtmlArray;
+
+ private HashMap[] styleInfoArray;
+
+ private Vector<Thread> checkThreads;
+
+ private LowVisionSimulationView lowVisionView;
+
+ private ParamLowVision paramLowVision;
+
+ private Shell _shell;
+
+ private String targetUrlS;
+
+ private boolean[] isFinished;
+
+ private SaveReportLowVision _saveReportLowVision;
+
+ private boolean _isInSimulate;
+
+ private boolean is1stSimulateDone = false;
+
+ // 256M -> 7000000 400M->10000000
+ private int dump_image_size = 7000000;
+
+ private CheckResultLowVision checkResult = new CheckResultLowVision();
+
+ private File reportFile;
+
+ private File reportImageFile;
+
+ private File visResultFile;
+
+ private String dumpImageFile;
+
+ private IVisualizationView checker;
+
+ private Mediator mediator = Mediator.getInstance();
+
+ private IWebBrowserACTF webBrowser = null;
+
+ private class ExtractCheckThread extends Thread {
+ int frameId;
+
+ String address;
+
+ TargetPage targetPage;
+
+ private List<IProblemItem> lowvisionProblemList;
+
+ ExtractCheckThread(int _frameId, String _address) {
+ frameId = _frameId;
+ address = _address;
+ }
+
+ public void run() {
+ try {
+ targetPage = new TargetPage();
+ targetPage.setPageImage(framePageImage[frameId]);
+ targetPage
+ .setInteriorImagePosition(imageInfoInHtmlArray[frameId]);
+ targetPage.setCurrentStyles(styleInfoArray[frameId]);
+
+ _shell.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ checker
+ .setStatusMessage(Messages
+ .getString("LowVisionView.begin_to_check_problems._4"));
+ }
+ });
+
+ lowvisionProblemList = targetPage.check(paramLowVision
+ .getLowVisionType(), address, frameId);
+
+ // TODO frames
+ try {
+ reportFile = LowVisionVizPlugin.createTempFile(
+ PREFIX_REPORT, SUFFIX_HTML);
+ // TODO modelservice type
+ if (webBrowser != null) {
+ reportImageFile = LowVisionVizPlugin.createTempFile(
+ PREFIX_REPORT, SUFFIX_BMP);
+ targetPage
+ .makeAndStoreReport(reportFile.getParent(),
+ reportFile.getName(), reportImageFile
+ .getName(),
+ lowvisionProblemList);
+ } else {// current lv mode doesn't support ODF
+ reportImageFile = null;
+ targetPage.unsupportedModeReport(reportFile);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ targetPage = null;
+
+ checkResult.addProblemItems(lowvisionProblemList);
+
+ // ext checker here
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void disposeTargetPage() {
+ if (targetPage != null) {
+ targetPage.disposePageImage();
+ }
+ }
+
+ }
+
+ // TODO use event
+ private class WaitExtractThread extends Thread {
+ Thread simulateThread;
+
+ WaitExtractThread(Thread _simulateThread) {
+ simulateThread = _simulateThread;
+ }
+
+ public void run() {
+ if (simulateThread == null && checkThreads == null)
+ return;
+ boolean flag = true;
+ int count = 0;
+
+ while (flag) {
+ if (simulateThread == null || !simulateThread.isAlive()) {
+ flag = false;
+ simulateThread = null;
+ for (int i = 0; i < checkThreads.size(); i++) {
+ flag = flag || checkThreads.get(i).isAlive();
+ }
+ }
+ if (count >= 200) {
+ // //$NON-NLS-1$
+ break;
+ }
+ count++;
+ try {
+ WaitExtractThread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ _shell.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+
+ if (webBrowser != null) {
+ checkResult
+ .setSummaryReportText(new SummaryEvaluationLV(
+ checkResult.getProblemList())
+ .getOverview());
+ } else {
+ checkResult.setSummaryReportText(SummaryEvaluationLV
+ .notSupported());
+ }
+ checkResult.setLineStyleListener(SummaryEvaluationLV
+ .getHighLightStringListener());
+
+ checkResult.setSummaryReportUrl(reportFile
+ .getAbsolutePath());
+ mediator.setEvaluationResult(checker, checkResult);
+
+ checker
+ .setStatusMessage(Messages
+ .getString("LowVisionView.simulation_of_current_page_is_over._8"));
+ _shell.setCursor(null);
+ _isInSimulate = false;
+
+ for (Iterator i = checkThreads.iterator(); i.hasNext();) {
+ ExtractCheckThread tmpT = (ExtractCheckThread) i.next();
+ tmpT.disposeTargetPage();
+ }
+ checkThreads = new Vector<Thread>();
+ }
+ });
+ }
+ }
+
+ public PartControlLowVision(IVisualizationView checker, Composite parent) {
+
+ this.checker = checker;
+
+ this._shell = parent.getShell();
+
+ paramLowVision = ParamLowVision.getDefaultInstance();
+ this._saveReportLowVision = new SaveReportLowVision(_shell);
+
+ lowVisionView = new LowVisionSimulationView(parent, this);
+
+ _isInSimulate = false;
+
+ try {
+ File dumpImgFile = LowVisionVizPlugin.createTempFile(
+ PREFIX_SCREENSHOT, SUFFIX_BMP);
+ dumpImageFile = dumpImgFile.getAbsolutePath();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ Mediator.getInstance().addModelServiceListener(this);
+
+ }
+
+ public void saveReport() {
+ IModelService modelService = mediator.getActiveModelService();
+ if (is1stSimulateDone && !isBInSimulate() && modelService != null) {
+ this._saveReportLowVision.doSave(modelService.getURL(), checkResult
+ .getProblemList(), visResultFile, reportImageFile);
+ }
+ }
+
+ public void saveReport(int processNo, int[] paramNo, String paramStr,
+ String folder, String probName, Document probStatisticsDoc,
+ String urlS, int depth) {
+
+ _saveReportLowVision.doSave(processNo, paramNo, paramStr, folder,
+ probStatisticsDoc, urlS, checkResult.getProblemList(),
+ visResultFile, reportImageFile);
+ }
+
+ private void allocate(int frameSize) {
+ framePageImage = new PageImage[frameSize];
+ imageInfoInHtmlArray = new ImagePositionInfo[frameSize][];
+ styleInfoArray = new HashMap[frameSize];
+ // htmlLine2Id = new HtmlLine2Id[frameSize];
+ // nodeId2Position = new HashMap[frameSize];
+ isFinished = new boolean[frameSize];
+ for (int i = 0; i < frameSize; i++) {
+ isFinished[i] = false;
+ }
+ }
+
+ public void doSimulate() {
+ is1stSimulateDone = true;
+ // TODO button: enable,disable
+ if (isBInSimulate()) {
+ return;
+ }
+
+ this._isInSimulate = true;
+ this._shell.setCursor(new Cursor(_shell.getDisplay(), SWT.CURSOR_WAIT));
+
+ checkResult = new CheckResultLowVision();
+ Mediator.getInstance().setEvaluationResult(checker, checkResult);
+
+ lowVisionView.clearImage();
+ _shell.getDisplay().update();
+
+ checkThreads = new Vector<Thread>();
+
+ IModelService modelService = mediator.getActiveModelService();
+ if (modelService == null) {
+ this._shell.setCursor(new Cursor(_shell.getDisplay(),
+ SWT.CURSOR_ARROW));
+ this._isInSimulate = false;
+ return;
+ }
+
+ lowVisionView.setTarget(modelService);
+
+ webBrowser = null;
+ if (modelService instanceof IWebBrowserACTF) {
+ webBrowser = (IWebBrowserACTF) modelService;
+ }
+
+ frameUrl = new String[0];
+ int frameSize = 0;
+ if (webBrowser != null) {
+ if (lowVisionView.isWholepage()) {
+ frameUrl = LowVisionUtil.frameAnalyze(webBrowser);
+ }
+
+ frameSize = frameUrl.length;
+ if (frameSize == 0) {
+ allocate(1);
+ } else {
+ allocate(frameSize);
+ int tmpSize = dump_image_size / frameSize
+ - (dump_image_size / 10) * (frameSize - 1);
+ if (tmpSize < dump_image_size / 10) {
+ tmpSize = dump_image_size / 10;
+ }
+ }
+ } else {
+ allocate(1);
+ }
+
+ targetUrlS = modelService.getURL();
+
+ if (webBrowser != null) {
+ try {
+ File sourceHtmlFile = LowVisionVizPlugin.createTempFile(
+ PREFIX_SOURCE_HTML, SUFFIX_HTML);
+ webBrowser.saveOriginalDocument(sourceHtmlFile
+ .getAbsolutePath());
+ checkResult.setSourceFile(sourceHtmlFile);
+ } catch (Exception e) {
+ }
+
+ }
+
+ if (frameSize == 0) {
+ frameUrl = new String[1];
+ frameUrl[0] = targetUrlS;
+ prepareInt2Ds(modelService, 0, 0);
+ } else {
+ if (webBrowser != null) {
+ // TODO replace with WaitForBrowserReadyHandler
+ // webBrowser.syncNavigate(frameUrl[0]);
+ // new WaitSyncNavigateThread(0, frameSize - 1).start();
+ }
+ }
+
+ }
+
+ private void prepareInt2Ds(IModelService modelService, int frameId,
+ int lastFrame) {
+ try {
+ checker
+ .setStatusMessage(Messages
+ .getString("LowVisionView.dump_the_image_in_the_web_browser._26"));
+
+ modelService
+ .setScrollbarWidth(lowVisionView.getVarticalBarSize().x);
+ ModelServiceImageCreator imgCreator = new ModelServiceImageCreator(
+ modelService);
+ imgCreator.getScreenImageAsBMP(dumpImageFile, lowVisionView
+ .isWholepage());
+
+ framePageImage[frameId] =
+ // partLeftWebBrowser.dumpWebBrowserImg(
+ ImageDumpUtil.createPageImage(dumpImageFile, _shell);
+ // System.out.println("finish dump");
+
+ IWebBrowserACTF browser = null;
+ if (modelService instanceof IWebBrowserACTF) {
+ browser = (IWebBrowserACTF) modelService;
+ }
+
+ if (framePageImage[frameId] != null) {
+ checker
+ .setStatusMessage(Messages
+ .getString("LowVisionView.get_information_of_all_images._25"));
+ if (browser != null) {
+ imageInfoInHtmlArray[frameId] = browser
+ .getAllImagePosition();
+ // styleInfoArray[frameId] = browser.getNodeStyles();//TODO
+ styleInfoArray[frameId] = new HashMap();
+ } else {
+ styleInfoArray[frameId] = new HashMap();
+ }
+
+ if (lastFrame > 1) { // TODO frameURL.length?
+ imageInfoInHtmlArray[frameId] = LowVisionUtil
+ .trimInfoImageInHtml(imageInfoInHtmlArray[frameId],
+ framePageImage[frameId].getHeight());
+ styleInfoArray[frameId] = LowVisionUtil.trimStyleInfoArray(
+ styleInfoArray[frameId], framePageImage[frameId]
+ .getHeight());
+ }
+
+ checker.setStatusMessage(Messages
+ .getString("LowVisionView.begin_to_make_PageImage._2"));
+
+ ExtractCheckThread checkThread = new ExtractCheckThread(
+ frameId, frameUrl[frameId]);
+ checkThread.start();
+
+ checkThreads.add(checkThread);
+
+ isFinished[frameId] = true;
+ if (browser != null) {
+ if (frameId == lastFrame) {
+
+ if (lastFrame > 0) {
+ // browser.syncNavigate(targetUrlS);
+ browser.navigate(targetUrlS);
+ }
+ doSimulateAfterHalf();
+ } else {
+ frameId++;
+ // TODO replace with WaitForBrowserReadyHandler
+ // browser.syncNavigate(frameUrl[frameId]);
+ // new WaitSyncNavigateThread(frameId,
+ // lastFrame).start();
+ }
+ } else {
+ doSimulateAfterHalf();
+ }
+ } else {
+ _shell.setCursor(null);
+ _isInSimulate = false;
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void doSimulateAfterHalf() {
+ PageImage pageImageWhole;
+ if (framePageImage.length > 1) {
+ File mergedImageFile;
+ try {
+ mergedImageFile = LowVisionVizPlugin.createTempFile(
+ PREFIX_MERGED_IMAGE, SUFFIX_BMP);
+ pageImageWhole = ImageDumpUtil.joinPageImages(mergedImageFile
+ .getAbsolutePath(), //$NON-NLS-1$
+ framePageImage);
+ if (mergedImageFile != null) {
+ mergedImageFile.delete();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ pageImageWhole = framePageImage[0];
+ }
+ } else {
+ pageImageWhole = framePageImage[0];
+ }
+
+ checker.setStatusMessage(Messages
+ .getString("LowVisionView.prepare_Simulation_Image._29"));
+
+ try {
+ visResultFile = LowVisionVizPlugin.createTempFile(
+ PREFIX_VISUALIZATION, SUFFIX_BMP);
+ ImageData[] imageDataArray = SimulateLowVision.doSimulate(
+ pageImageWhole, paramLowVision, visResultFile
+ .getAbsolutePath());
+ if (imageDataArray.length > 0) {
+ lowVisionView.displayImage(imageDataArray[0]);
+ lowVisionView.resetScrollBars();
+ imageDataArray = null;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ checkResult.setFrameOffsetToProblems(framePageImage);
+
+ new WaitExtractThread(null).start();
+ }
+
+ public void setHighlightPositions(List infoPositionSizeList) {
+ lowVisionView.highlight(infoPositionSizeList);
+ }
+
+ /**
+ * @param vision
+ */
+ public void setParamLowVision(ParamLowVision vision) {
+ paramLowVision = vision;
+ }
+
+ public boolean isChildThread() {
+ // TODO for HPB integration
+ // return (aDesigner.isChildThread());
+ return false;
+ }
+
+ public void setWholePage(boolean isWhole) {
+ lowVisionView.setWholePage(isWhole);
+ }
+
+ public void setLVParamStatus() {
+ if (!isBInSimulate()) {
+ checker.setInfoMessage(paramLowVision.toString());
+ }
+ }
+
+ public void simulateForMoreParameter() {
+ _isInSimulate = true;
+
+ checkResult = new CheckResultLowVision();
+ // ADesignerMediator.getInstance().setCheckResult(checker, checkResult);
+
+ lowVisionView.clearImage();
+ checkThreads = new Vector<Thread>();
+
+ IModelService modelService = mediator.getActiveModelService();
+ // TODO null check?
+
+ if (frameUrl.length == 0) {
+ checker.setStatusMessage(Messages
+ .getString("LowVisionView.begin_to_make_PageImage._2"));
+ // TODO check(original is getAddressText())
+ ExtractCheckThread checkThread = new ExtractCheckThread(0,
+ modelService.getURL());
+
+ checkThread.start();
+ checkThreads.add(checkThread);
+ } else {
+ for (int i = 0; i < frameUrl.length; i++) {
+ ExtractCheckThread checkThread = new ExtractCheckThread(i,
+ frameUrl[i]);
+ checkThread.start();
+ checkThreads.add(checkThread);
+ }
+ }
+ doSimulateAfterHalf();
+ }
+
+ /**
+ * @return
+ */
+ public boolean isBInSimulate() {
+ return _isInSimulate;
+ }
+
+ public boolean isInSaveReport() {
+ return _saveReportLowVision.isInSaveReport();
+ }
+
+ public int getReportColorNum() {
+ return _saveReportLowVision.getNumColorProblem();
+ }
+
+ public int getReportFontNum() {
+ return _saveReportLowVision.getNumFontProblem();
+ }
+
+ /**
+ * @param dump_image_size
+ * The dump_image_size to set.
+ */
+ public void setDump_image_size(int dump_image_size) {
+ this.dump_image_size = dump_image_size;
+ }
+
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if (selection == null || !(selection instanceof IStructuredSelection)) {
+ System.err.println(this.getClass().getName() + ":" + "Iselection");
+ return;
+ }
+ ArrayList<IPositionSize> result = new ArrayList<IPositionSize>();
+
+ for (Iterator i = ((IStructuredSelection) selection).iterator(); i
+ .hasNext();) {
+ IProblemItem item = (IProblemItem) i.next();
+ if (checkResult.getProblemList().contains(item)) {
+ IPositionSize ips = (IPositionSize) item;
+ result.add(ips);
+ }
+ }
+ setHighlightPositions(result);
+ }
+
+ public void modelserviceChanged(IModelService modelService) {
+ lowVisionView.setTarget(modelService);
+ }
+
+ public void inputChanged(IModelService modelService) {
+ lowVisionView.setTarget(modelService);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/preferences/LowVisionPreferencePage.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/preferences/LowVisionPreferencePage.java
new file mode 100644
index 0000000..da8b902
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/preferences/LowVisionPreferencePage.java
@@ -0,0 +1,722 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.preferences;
+
+import java.io.File;
+
+import org.eclipse.actf.util.ui.IDialogConstants;
+import org.eclipse.actf.visualization.IVisualizationConst;
+import org.eclipse.actf.visualization.engines.lowvision.image.Int2D;
+import org.eclipse.actf.visualization.engines.lowvision.image.PageImage;
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.eclipse.actf.visualization.lowvision.ui.internal.Messages;
+import org.eclipse.actf.visualization.lowvision.ui.internal.PartControlLowVision;
+import org.eclipse.actf.visualization.lowvision.util.ParamLowVision;
+import org.eclipse.actf.visualization.lowvision.util.SimulateLowVision;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.Bundle;
+
+
+public class LowVisionPreferencePage extends PreferencePage implements
+ IWorkbenchPreferencePage {
+
+ public static final String ID = LowVisionPreferencePage.class.getName();
+
+ private static final String EYESIGHT_1_0_JP = "1.0"; //$NON-NLS-1$
+
+ private static final String EYESIGHT_0_5_JP = "0.5"; //$NON-NLS-1$
+
+ private static final String EYESIGHT_0_1_JP = "0.1"; //$NON-NLS-1$
+
+ private static final String EYESIGHT_1_0 = "20/20"; //$NON-NLS-1$
+
+ private static final String EYESIGHT_0_5 = "20/40"; //$NON-NLS-1$
+
+ private static final String EYESIGHT_0_1 = "20/200"; //$NON-NLS-1$
+
+ private static final String COLOR_VISION_1 = Messages
+ .getString("DialogSettingLowVision.Protan"); //$NON-NLS-1$
+
+ private static final String COLOR_VISION_2 = Messages
+ .getString("DialogSettingLowVision.Deutan"); //$NON-NLS-1$
+
+ private static final String COLOR_VISION_3 = Messages
+ .getString("DialogSettingLowVision.Tritan"); //$NON-NLS-1$
+
+ private Button _eyesightCheckButton;
+
+ private Label _eyeSightLabel;
+
+ private Slider _eyeSightSlider;
+
+ private Group _colorvisionGroup;
+
+ private Button _colorvisionCheckButton;
+
+ private Button _colorvision1RadioButton;
+
+ private Button _colorvision2RadioButton;
+
+ private Button _colorvision3RadioButton;
+
+ private Button _colorfilterCheckButton;
+
+ private Label _colorfilterNumLabel;
+
+ private Slider _colorFilterSlider;
+
+ private PageImage _samplePageImage;
+
+ private ImageData[] _sampleImageData;
+
+ private Image _beforeSimulateImage;
+
+ private ImageData _beforeSimulateImageData;
+
+ private Canvas _beforeSimulateImageCanvas;
+
+ private Image _afterSimulateImage;
+
+ private ImageData _afterSimulateImageData;
+
+ private ImageData[] _afterSimulateImageDataArray;
+
+ private Canvas _afterSimulateImageCanvas;
+
+ private ParamLowVision _currentSetting = null;
+
+ private ParamLowVision _appSetting = null;
+
+ private PartControlLowVision _partRightLowVision;
+
+ private File simulationImageFile;
+
+ public LowVisionPreferencePage() {
+ super();
+ }
+
+ public void init(IWorkbench workbench) {
+
+ this._appSetting = ParamLowVision.getDefaultInstance();
+ this._currentSetting = (ParamLowVision) this._appSetting.clone();
+
+ initSampleImage();
+
+ }
+
+ protected Control createContents(Composite parent) {
+
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite
+ .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ composite.setLayout(layout);
+
+ createSettingControlsPart(composite);
+
+ createSampleImagePart(composite);
+
+ Composite buttonComposite = new Composite(parent, SWT.NONE);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
+ gridData.horizontalIndent = 10;
+ gridData.verticalIndent = 5;
+ buttonComposite.setLayoutData(gridData);
+ layout = new GridLayout();
+ layout.numColumns = 1;
+ buttonComposite.setLayout(layout);
+
+ Button helpButton = new Button(buttonComposite, SWT.PUSH);
+ helpButton.setText(IDialogConstants.HELP);
+ helpButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ openHelp();
+ }
+ });
+
+ return parent;
+ }
+
+ public boolean performOk() {
+ setNewValue(this._appSetting);
+ return true;
+ }
+
+ protected void performApply() {
+ performOk();
+ }
+
+ private void initSampleImage() {
+
+ Int2D int2D = null;
+
+ Bundle lvBundle = LowVisionVizPlugin.getDefault().getBundle();
+
+ try {
+ int2D = Int2D.readFromBMPInputStream(FileLocator.openStream(
+ lvBundle, new Path(
+ "vizResources/images/LowVisionSample.bmp"), false));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ if (null != int2D) {
+ this._samplePageImage = new PageImage(int2D, false);
+ } else {
+ this._samplePageImage = new PageImage();
+ }
+
+ _sampleImageData = new ImageData[0];
+
+ try {
+ ImageLoader imageLoader = new ImageLoader();
+ _sampleImageData = imageLoader.load(FileLocator.openStream(
+ lvBundle, new Path(
+ "vizResources/images/LowVisionSample.bmp"), false));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ if (simulationImageFile == null) {
+ try {
+ simulationImageFile = LowVisionVizPlugin.createTempFile(
+ "preference", IVisualizationConst.SUFFIX_BMP);
+ } catch (Exception e) {
+ }
+ }
+
+ }
+
+ private void openHelp() {
+ // TODO customize
+ PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(
+ "/org.eclipse.actf.examples.adesigner.doc/docs/parametersLv.html");
+ }
+
+ private void createSettingControlsPart(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ composite.setLayout(layout);
+
+ createEyeSightControl(composite);
+
+ new Label(composite, SWT.NONE);
+
+ createColorVisionControl(composite);
+
+ new Label(composite, SWT.NONE);
+
+ createColorFilterControl(composite);
+
+ }
+
+ private void createEyeSightControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite
+ .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ composite.setLayout(layout);
+
+ this._eyesightCheckButton = new Button(composite, SWT.CHECK);
+ this._eyesightCheckButton.setLayoutData(new GridData(SWT.LEFT,
+ SWT.CENTER, false, false, 2, 1));
+ this._eyesightCheckButton.setText(Messages
+ .getString("DialogSettingLowVision.Eyesight_9"));
+ this._eyesightCheckButton.setSelection(this._appSetting.useEyeSight());
+ this._eyesightCheckButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ if (_partRightLowVision != null
+ && _partRightLowVision.isChildThread()) {
+ _eyeSightSlider.setVisible(((Button) event.widget)
+ .getSelection());
+ } else {
+ _eyeSightSlider.setEnabled(((Button) event.widget)
+ .getSelection());
+ }
+ doSimulate();
+ }
+ });
+
+ Composite sliderComposite = new Composite(composite, SWT.NONE);
+ sliderComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
+ false));
+ layout = new GridLayout();
+ layout.numColumns = 3;
+ sliderComposite.setLayout(layout);
+
+ // Create the labels of EyeSight
+ Label eyeSightLable11 = new Label(sliderComposite, SWT.NONE);
+ eyeSightLable11.setText(EYESIGHT_0_1);
+ eyeSightLable11.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true,
+ false));
+
+ Label eyeSightLable12 = new Label(sliderComposite, SWT.NONE);
+ eyeSightLable12.setText(EYESIGHT_0_5);
+ GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, false);
+ eyeSightLable12.setLayoutData(gridData);
+
+ Label eyeSightLable13 = new Label(sliderComposite, SWT.NONE);
+ eyeSightLable13.setText(EYESIGHT_1_0);
+ eyeSightLable13.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true,
+ false));
+
+ Label eyeSightLable21 = new Label(sliderComposite, SWT.NONE);
+ eyeSightLable21.setText(EYESIGHT_0_1_JP);
+ eyeSightLable21.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true,
+ false));
+
+ Label eyeSightLable22 = new Label(sliderComposite, SWT.NONE);
+ eyeSightLable22.setText(EYESIGHT_0_5_JP);
+ gridData = new GridData(SWT.CENTER, SWT.CENTER, true, false);
+ eyeSightLable22.setLayoutData(gridData);
+
+ Label eyeSightLable23 = new Label(sliderComposite, SWT.NONE);
+ eyeSightLable23.setText(EYESIGHT_1_0_JP);
+ eyeSightLable23.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true,
+ false));
+
+ // create the slider of EyeSight
+ this._eyeSightSlider = new Slider(sliderComposite, SWT.NONE);
+ this._eyeSightSlider.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
+ false, false, 3, 1));
+
+ this._eyeSightSlider.setMinimum(10);
+ this._eyeSightSlider.setMaximum(101);
+ this._eyeSightSlider.setIncrement(10);
+ this._eyeSightSlider.setPageIncrement(10);
+ this._eyeSightSlider.setThumb(1);
+ this._eyeSightSlider.setSelection(this._appSetting.getEyeSightValue());
+
+ if (this._partRightLowVision != null
+ && this._partRightLowVision.isChildThread()) {
+ this._eyeSightSlider
+ .setVisible(_eyesightCheckButton.getSelection());
+ } else {
+ this._eyeSightSlider
+ .setEnabled(_eyesightCheckButton.getSelection());
+ }
+
+ this._eyeSightSlider.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ doSimulate();
+ }
+ });
+
+ this._eyeSightLabel = new Label(composite, SWT.NONE);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gridData.horizontalIndent = 10;
+ gridData.widthHint = 25;
+ this._eyeSightLabel.setLayoutData(gridData);
+ }
+
+ private void createColorVisionControl(Composite parent) {
+
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite
+ .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ composite.setLayout(new GridLayout());
+
+ this._colorvisionCheckButton = new Button(composite, SWT.CHECK);
+ this._colorvisionCheckButton.setLayoutData(new GridData(SWT.FILL,
+ SWT.CENTER, true, false));
+ this._colorvisionCheckButton
+ .setText(Messages
+ .getString("DialogSettingLowVision.Color_Vision_Deficiency_10"));
+ this._colorvisionCheckButton.setSelection(this._appSetting
+ .useColorVision());
+ this._colorvisionCheckButton
+ .addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ _colorvisionGroup.setEnabled(((Button) event.widget)
+ .getSelection());
+ _colorvision1RadioButton
+ .setEnabled(((Button) event.widget)
+ .getSelection());
+ _colorvision2RadioButton
+ .setEnabled(((Button) event.widget)
+ .getSelection());
+ _colorvision3RadioButton
+ .setEnabled(((Button) event.widget)
+ .getSelection());
+ doSimulate();
+ }
+ });
+
+ // create the group of 1,2,3 radio buttons
+ this._colorvisionGroup = new Group(composite, SWT.NONE); // controlGroup
+ GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ this._colorvisionGroup.setLayoutData(gridData);
+ this._colorvisionGroup.setLayout(new GridLayout());
+
+ // Create the 1,2,3 radio buttons
+ this._colorvision1RadioButton = new Button(_colorvisionGroup, SWT.RADIO);
+ this._colorvision1RadioButton.setText(COLOR_VISION_1);
+
+ this._colorvision2RadioButton = new Button(_colorvisionGroup, SWT.RADIO);
+ this._colorvision2RadioButton.setText(COLOR_VISION_2);
+
+ this._colorvision3RadioButton = new Button(_colorvisionGroup, SWT.RADIO);
+ this._colorvision3RadioButton.setText(COLOR_VISION_3);
+
+ int colorVisionValue = this._appSetting.getColorVisionValue();
+ switch (colorVisionValue) {
+ case 1:
+ this._colorvision1RadioButton.setSelection(true);
+ break;
+ case 2:
+ this._colorvision2RadioButton.setSelection(true);
+ break;
+ case 3:
+ this._colorvision3RadioButton.setSelection(true);
+ break;
+ default:
+ this._colorvision1RadioButton.setSelection(true);
+ break;
+ }
+
+ // Add the listeners of 1,2,3 radio buttons
+ SelectionListener selectionListener2 = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ doSimulate();
+ if (!((Button) event.widget).getSelection())
+ return;
+ };
+ };
+ this._colorvision1RadioButton.addSelectionListener(selectionListener2);
+ this._colorvision2RadioButton.addSelectionListener(selectionListener2);
+ this._colorvision3RadioButton.addSelectionListener(selectionListener2);
+
+ this._colorvisionGroup.setEnabled(_colorvisionCheckButton
+ .getSelection());
+ this._colorvision1RadioButton.setEnabled(_colorvisionCheckButton
+ .getSelection());
+ this._colorvision2RadioButton.setEnabled(_colorvisionCheckButton
+ .getSelection());
+ this._colorvision3RadioButton.setEnabled(_colorvisionCheckButton
+ .getSelection());
+ }
+
+ private void createColorFilterControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite
+ .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ composite.setLayout(layout);
+
+ this._colorfilterCheckButton = new Button(composite, SWT.CHECK);
+ this._colorfilterCheckButton.setLayoutData(new GridData(SWT.LEFT,
+ SWT.CENTER, false, false, 2, 1));
+ this._colorfilterCheckButton.setText(Messages
+ .getString("DialogSettingLowVision.Crystalline_lens"));
+ this._colorfilterCheckButton.setSelection(this._appSetting
+ .useEyeSight());
+ this._colorfilterCheckButton
+ .addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ if (_partRightLowVision != null
+ && _partRightLowVision.isChildThread()) {
+ _colorFilterSlider
+ .setVisible(((Button) event.widget)
+ .getSelection());
+ } else {
+ _colorFilterSlider
+ .setEnabled(((Button) event.widget)
+ .getSelection());
+ }
+ doSimulate();
+ }
+ });
+
+ Composite colorFilterComposite = new Composite(composite, SWT.NONE);
+ colorFilterComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
+ true, false));
+ layout = new GridLayout();
+ layout.numColumns = 3;
+ colorFilterComposite.setLayout(layout);
+
+ // Create the labels of Color Filter
+ Label colorfilterLable1 = new Label(colorFilterComposite, SWT.NONE);
+ colorfilterLable1.setText(Messages
+ .getString("DialogSettingLowVision.60"));
+ colorfilterLable1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER,
+ true, false));
+
+ Label colorfilterLable2 = new Label(colorFilterComposite, SWT.NONE);
+ colorfilterLable2.setText(Messages
+ .getString("DialogSettingLowVision.40"));
+ colorfilterLable2.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER,
+ true, false));
+
+ Label colorfilterLable3 = new Label(colorFilterComposite, SWT.NONE);
+ colorfilterLable3.setText(Messages
+ .getString("DialogSettingLowVision.20"));
+ colorfilterLable3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER,
+ true, false));
+
+ this._colorFilterSlider = new Slider(colorFilterComposite, SWT.NONE);
+ this._colorFilterSlider.setLayoutData(new GridData(SWT.FILL,
+ SWT.CENTER, false, false, 3, 1));
+
+ this._colorFilterSlider.setMinimum(60);
+ this._colorFilterSlider.setMaximum(101);
+
+ this._colorFilterSlider.setIncrement(5);
+ this._colorFilterSlider.setPageIncrement(10);
+ this._colorFilterSlider.setThumb(1);
+ this._colorFilterSlider.setSelection(this._appSetting
+ .getColorFilterValue());
+
+ if (this._partRightLowVision != null
+ && this._partRightLowVision.isChildThread()) {
+ this._colorFilterSlider.setVisible(_colorfilterCheckButton
+ .getSelection());
+ } else {
+ this._colorFilterSlider.setEnabled(_colorfilterCheckButton
+ .getSelection());
+ }
+
+ this._colorFilterSlider.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ doSimulate();
+ }
+ });
+
+ this._colorfilterNumLabel = new Label(composite, SWT.NONE);
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gridData.horizontalIndent = 10;
+ gridData.widthHint = 25;
+ this._colorfilterNumLabel.setLayoutData(gridData);
+ }
+
+ private void createSampleImagePart(Composite parent) {
+ GridData gridData;
+
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
+ | GridData.FILL_VERTICAL));
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ composite.setLayout(layout);
+
+ // Create the Label "Original:"
+ Label labelOriginal = new Label(composite, SWT.NONE);
+ labelOriginal.setText(Messages
+ .getString("DialogSettingLowVision.Original__24")); //$NON-NLS-1$
+
+ _beforeSimulateImageCanvas = new Canvas(composite, SWT.NO_REDRAW_RESIZE);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ gridData.widthHint = 320;
+ gridData.heightHint = 130;
+ _beforeSimulateImageCanvas.setLayoutData(gridData);
+ _beforeSimulateImageCanvas.addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent event) {
+ if (null != _beforeSimulateImage) {
+ paintBeforeSimulateImage(event);
+ }
+ }
+ });
+
+ // Create the blank label for adjust the location
+ Label labelBlank = new Label(composite, SWT.NONE);
+ labelBlank.setText(" ");
+ gridData = new GridData();
+ gridData.heightHint = 20;
+ labelBlank.setLayoutData(gridData);
+
+ // Create the Label "After simulation:"
+ Label labelAfterSimulation = new Label(composite, SWT.NONE);
+ labelAfterSimulation.setText(Messages
+ .getString("DialogSettingLowVision.After_simulation")); //$NON-NLS-1$
+
+ _afterSimulateImageCanvas = new Canvas(composite, SWT.NO_REDRAW_RESIZE);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ gridData.widthHint = 320;
+ gridData.heightHint = 130;
+ _afterSimulateImageCanvas.setLayoutData(gridData);
+ _afterSimulateImageCanvas.addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent event) {
+ if (null != _afterSimulateImage) {
+ paintAfterSimulateImage(event);
+ }
+ }
+ });
+
+ initImageBeforeSimulate(parent);
+ doSimulate();
+ }
+
+ private void initImageBeforeSimulate(Composite parent) {
+ try {
+ for (int i = 0; i < this._sampleImageData.length; i++) {
+ displayImageBeforeSimulate(this._sampleImageData[i]);
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void displayImageBeforeSimulate(ImageData newImageData) {
+ // Dispose of the old image, if there was one.
+ if (null != this._beforeSimulateImage) {
+ this._beforeSimulateImage.dispose();
+ }
+
+ try {
+ // Cache the new image and imageData.
+ this._beforeSimulateImage = new Image(getShell().getDisplay(),
+ newImageData);
+ this._beforeSimulateImageData = newImageData;
+ } catch (SWTException swte) {
+ swte.printStackTrace();
+ this._beforeSimulateImage = null;
+
+ return;
+ }
+
+ // Redraw the canvases.
+ this._beforeSimulateImageCanvas.redraw();
+ }
+
+ private void displayImageAfterSimulate(ImageData newImageData) {
+ // Dispose of the old image, if there was one.
+ if (null != this._afterSimulateImage) {
+ this._afterSimulateImage.dispose();
+ }
+
+ try {
+ // Cache the new image and imageData.
+ this._afterSimulateImage = new Image(getShell().getDisplay(),
+ newImageData);
+ this._afterSimulateImageData = newImageData;
+ } catch (SWTException e) {
+ e.printStackTrace();
+ this._afterSimulateImage = null;
+
+ return;
+ }
+
+ // Redraw the canvases.
+ this._afterSimulateImageCanvas.redraw();
+ }
+
+ private void doSimulate() {
+
+ try {
+ setNewValue(this._currentSetting);
+
+ this._afterSimulateImageDataArray = SimulateLowVision.doSimulate(
+ this._samplePageImage, this._currentSetting,
+ simulationImageFile.getAbsolutePath());
+ for (int i = 0; i < this._afterSimulateImageDataArray.length; i++) {
+ displayImageAfterSimulate(this._afterSimulateImageDataArray[i]);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void paintBeforeSimulateImage(PaintEvent event) {
+ event.gc.drawImage(this._beforeSimulateImage, 0, 0,
+ this._beforeSimulateImageData.width,
+ this._beforeSimulateImageData.height,
+ this._beforeSimulateImageData.x,
+ this._beforeSimulateImageData.y, Math
+ .round(this._beforeSimulateImageData.width), Math
+ .round(this._beforeSimulateImageData.height));
+ }
+
+ private void paintAfterSimulateImage(PaintEvent event) {
+ event.gc.drawImage(this._afterSimulateImage, 0, 0,
+ this._afterSimulateImageData.width,
+ this._afterSimulateImageData.height,
+ this._afterSimulateImageData.x, this._afterSimulateImageData.y,
+ Math.round(this._afterSimulateImageData.width), Math
+ .round(this._afterSimulateImageData.height));
+ }
+
+ private void setNewValue(ParamLowVision currParam) {
+ String str;
+ currParam.setEyeSight(_eyesightCheckButton.getSelection());
+ if (currParam.useEyeSight()) {
+ currParam.setEyeSightValue(_eyeSightSlider.getSelection());
+
+ int sliderValue = _eyeSightSlider.getSelection();
+ if (sliderValue < 100) {
+ str = "0." + String.valueOf(sliderValue);
+ } else {
+ str = "1.00";
+ }
+ _eyeSightLabel.setText(str);
+ } else {
+ _eyeSightLabel.setText("");
+ }
+
+ currParam.setColorVision(_colorvisionCheckButton.getSelection());
+ if (currParam.useColorVision()) {
+ if (_colorvision1RadioButton.getSelection()) {
+ currParam.setColorVisionValue(1);
+ } else if (_colorvision2RadioButton.getSelection()) {
+ currParam.setColorVisionValue(2);
+ } else {
+ currParam.setColorVisionValue(3);
+ }
+ }
+
+ currParam.setColorFilter(_colorfilterCheckButton.getSelection());
+ if (currParam.useColorFilter()) {
+ currParam.setColorFilterValue(_colorFilterSlider.getSelection());
+ int iAge = 120 - _colorFilterSlider.getSelection();
+ str = String.valueOf(iAge);
+ _colorfilterNumLabel.setText(str);
+ } else {
+ _colorfilterNumLabel.setText(""); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/views/LowVisionView.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/views/LowVisionView.java
new file mode 100644
index 0000000..fdf08de
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/ui/views/LowVisionView.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.ui.views;
+
+import org.eclipse.actf.visualization.IVisualizationView;
+import org.eclipse.actf.visualization.VisualizationStatusLineContributionItem;
+import org.eclipse.actf.visualization.lowvision.ui.internal.PartControlLowVision;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableLabelProviderLV;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableSorterLV;
+import org.eclipse.actf.visualization.ui.report.views.DetailedReportView;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+
+public class LowVisionView extends ViewPart implements IVisualizationView {
+
+ public static final String ID = LowVisionView.class.getName();
+
+ private PartControlLowVision partRightLowVision;
+
+ private IBaseLabelProvider baseLabelProvider = new ResultTableLabelProviderLV();
+ private ResultTableSorterLV viewerSorter = new ResultTableSorterLV();
+
+
+ public LowVisionView() {
+ super();
+ }
+
+ public void init(IViewSite site) throws PartInitException {
+ setSite(site);
+ setStatusLine();
+ }
+
+ public void createPartControl(Composite parent) {
+ partRightLowVision = new PartControlLowVision(this, parent);
+ //TODO
+ getSite().getPage().addSelectionListener(DetailedReportView.ID, partRightLowVision);
+// ((IViewSite)getSite()).getActionBars().setGlobalActionHandler("visualizationAction", new Action(){
+// public void run() {
+// partRightLowVision.doSimulate();
+// }
+// }
+// );
+
+ }
+
+ public void setFocus() {
+ }
+
+ public void setStatusMessage(String statusMessage) {
+ IContributionItem[] items = getViewSite().getActionBars().getStatusLineManager().getItems();
+ for (int i = 0; i < items.length; i++) {
+ if (null != items[i] && items[i].getId().equals(VisualizationStatusLineContributionItem.ID + ID)) {
+ ((VisualizationStatusLineContributionItem) items[i]).setStatusMessage(statusMessage);
+ }
+ }
+ }
+
+ public void setInfoMessage(String infoMessage) {
+ IContributionItem[] items = getViewSite().getActionBars().getStatusLineManager().getItems();
+ for (int i = 0; i < items.length; i++) {
+ if (null != items[i] && items[i].getId().equals(VisualizationStatusLineContributionItem.ID + ID)) {
+ ((VisualizationStatusLineContributionItem) items[i]).setInfoMessage(infoMessage);
+ }
+ }
+ }
+
+ private void setStatusLine() {
+ getViewSite().getActionBars().getStatusLineManager().add(new VisualizationStatusLineContributionItem(ID));
+ }
+
+ public IBaseLabelProvider getLabelProvider() {
+ return baseLabelProvider;
+ }
+
+ public ViewerSorter getTableSorter() {
+ viewerSorter.reset();
+ return viewerSorter;
+ }
+
+ public int getResultTableMode() {
+ return MODE_LOWVISION;
+ }
+
+ public void doVisualize(){
+ if(partRightLowVision!=null){
+ partRightLowVision.doSimulate();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/LowVisionUtil.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/LowVisionUtil.java
new file mode 100644
index 0000000..a35d0c5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/LowVisionUtil.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.eclipse.actf.model.IWebBrowserACTF;
+import org.eclipse.actf.model.dom.html.impl.SHDocument;
+import org.eclipse.actf.model.dom.html.util.HtmlParserUtil;
+import org.eclipse.actf.model.ui.editor.ImagePositionInfo;
+import org.eclipse.actf.model.ui.editor.browser.CurrentStyles;
+import org.eclipse.actf.visualization.IVisualizationConst;
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+
+
+
+public class LowVisionUtil implements IVisualizationConst{
+
+ static File runtimeHtmlFile = null;
+
+ public static String[] frameAnalyze(IWebBrowserACTF webBrowser) {
+ try {
+ if(runtimeHtmlFile==null){
+ runtimeHtmlFile = LowVisionVizPlugin.createTempFile(PREFIX_RUNTIME_HTML, SUFFIX_HTML);
+ }
+ URL urlBase = new URL(webBrowser.getURL());
+
+ webBrowser.saveDocumentAsHTMLFile(runtimeHtmlFile.getAbsolutePath());
+
+ HtmlParserUtil hpu = new HtmlParserUtil();
+ hpu.parse(new FileInputStream(runtimeHtmlFile));
+
+ //TODO from Mediator
+ SHDocument document = hpu.getSHDocument();
+
+ NodeList frameList = document.getElementsByName("frame"); //$NON-NLS-1$
+ try {
+ NodeList baseNL = document.getElementsByName("base");
+ if (baseNL.getLength() > 0) {
+ Element baseE = (Element) baseNL.item(baseNL.getLength() - 1);
+ String baseUrlS = baseE.getAttribute("href");
+ if (baseUrlS.length() > 0) {
+ URL tmpUrl = new URL(urlBase, baseUrlS);
+ urlBase = tmpUrl;
+ }
+ }
+ } catch (Exception e) {
+ }
+
+ int frameNum = frameList.getLength();
+ String[] result = new String[frameNum];
+
+ for (int i = 0; i < frameNum; i++) {
+ Element frameEl = (Element) frameList.item(i);
+ String srcUrl = frameEl.getAttribute("src"); //$NON-NLS-1$
+ try {
+ URL url = new URL(urlBase, srcUrl);
+ result[i] = url.toString();
+ } catch (MalformedURLException e2) {
+ result[i] = ""; //$NON-NLS-1$
+ e2.printStackTrace();
+ }
+ }
+ hpu = null;
+ return (result);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ return (new String[0]);
+ }
+
+ public static ImagePositionInfo[] trimInfoImageInHtml(ImagePositionInfo[] target, int height) {
+ Vector<ImagePositionInfo> tmpV = new Vector<ImagePositionInfo>();
+ for (int i = 0; i < target.length; i++) {
+ if (target[i].getY() <= height) {
+ tmpV.add(target[i]);
+ }
+ }
+ ImagePositionInfo[] result = new ImagePositionInfo[tmpV.size()];
+ tmpV.toArray(result);
+ return (result);
+ }
+
+ public static HashMap trimStyleInfoArray(HashMap target, int height) {
+ HashMap<String, CurrentStyles> result = new HashMap<String, CurrentStyles>();
+ for (Iterator keyI = target.keySet().iterator(); keyI.hasNext();) {
+ String tmpKey = (String) keyI.next();
+ try {
+ CurrentStyles tmpS = (CurrentStyles) target.get(tmpKey);
+ if (Integer.parseInt(tmpS.getOffsetTop()) <= height) {
+ result.put(tmpKey, tmpS);
+ }
+ } catch (Exception e) {
+ }
+ }
+ // System.out.println("size: "+target.size()+" : "+result.size());
+ return (result);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/LowVisionVizResourceUtil.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/LowVisionVizResourceUtil.java
new file mode 100644
index 0000000..cc48e1a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/LowVisionVizResourceUtil.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.util;
+
+import org.eclipse.actf.util.FileUtils;
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.lowvision.LowVisionVizPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
+
+
+
+public class LowVisionVizResourceUtil {
+
+ public static void saveErrorIcons(String path) {
+ Bundle bundleChecker = Platform.getBundle(EvaluationPlugin.PLUGIN_ID);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/lowvision/HiIro21.gif"), false, path + "HiIro21.gif", true);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/lowvision/HiBoke21.gif"), false, path + "HiBoke21.gif",
+ true);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/lowvision/ErrIro21.gif"), false, path + "ErrIro21.gif",
+ true);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/lowvision/ErrBoke21.gif"), false, path + "ErrBoke21.gif",
+ true);
+
+ }
+
+ public static void saveImages(String path) {
+ Bundle bundleChecker = Platform.getBundle(EvaluationPlugin.PLUGIN_ID);
+
+ FileUtils.saveToFile(bundleChecker, new Path("icons/rating/Bad.png"), false, path + "Bad.png", true);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/rating/Good.png"), false, path + "Good.png", true);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/rating/Poor.png"), false, path + "Poor.png", true);
+ FileUtils.saveToFile(bundleChecker, new Path("icons/rating/VeryGood.png"), false, path + "VeryGood.png", true);
+ }
+
+ public static void saveScripts(String path) {
+ Bundle lvBundle = Platform.getBundle(LowVisionVizPlugin.PLUGIN_ID);
+
+ FileUtils.saveToFile(lvBundle, new Path("vizResources/scripts/lvHighlight.js"), false, path + "lvHighlight.js",
+ true);
+ FileUtils.saveToFile(lvBundle, new Path("vizResources/scripts/lvHighlight_moz.js"), false, path + "lvHighlight_moz.js",
+ true);
+
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/ParamLowVision.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/ParamLowVision.java
new file mode 100644
index 0000000..99ef2c8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/ParamLowVision.java
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Junji MAEDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.util;
+
+import org.eclipse.actf.visualization.engines.lowvision.LowVisionType;
+import org.eclipse.actf.visualization.lowvision.ui.internal.Messages;
+
+
+
+public class ParamLowVision {
+ //TODO use preference store
+ private static ParamLowVision INSTANCE;
+
+ //the current setting
+ private boolean oEyeSight;
+
+ private int iCurEyeSightValue; //the actual value:devided it by 100
+
+ private boolean oColorVision;
+
+ private int iCurColorVisionValue; //1,2,3
+
+ private boolean oColorFilter;
+
+ private int iCurColorFilterValue; //the actual value:devided it by 100
+
+ private LowVisionType lowVisionType;
+
+ private static final double DEFAULT_EYESIGHT_DEGREE = 0.5;
+
+ private static final int DEFAULT_CVD_TYPE = 2;
+
+ private static final double DEFAULT_COLOR_FILTER = 0.8;
+
+ public static ParamLowVision getDefaultInstance(){
+ if(INSTANCE==null){
+ INSTANCE=new ParamLowVision();
+ }
+ return INSTANCE;
+ }
+
+ public ParamLowVision() {
+
+ oEyeSight = true;
+ iCurEyeSightValue = (int) (Math.rint(DEFAULT_EYESIGHT_DEGREE * 100.0));
+ oColorVision = true;
+ iCurColorVisionValue = DEFAULT_CVD_TYPE;
+ oColorFilter = true;
+ iCurColorFilterValue = (int) (Math.rint(DEFAULT_COLOR_FILTER * 100.0));
+ lowVisionType = new LowVisionType();
+ }
+
+ public LowVisionType getLowVisionType() {
+ // LowVisionType lowVisionType = new LowVisionType();
+ try {
+ lowVisionType.setEyesight(oEyeSight);
+ if (oEyeSight) {
+ float fEyeSight = iCurEyeSightValue / 100.0f;
+ /*
+ * float fEye = 0.1f; if (fEyeSight < 0.075f) fEye = 0.05f; else
+ * if (fEyeSight > 0.15f) fEye = 0.2f;
+ */
+ //System.out.println(fEyeSight);
+ lowVisionType.setEyesightDegree(fEyeSight);
+ }
+
+ lowVisionType.setCVD(oColorVision);
+ if (oColorVision) {
+ lowVisionType.setCVDType(iCurColorVisionValue);
+ }
+
+ lowVisionType.setColorFilter(oColorFilter);
+ if (oColorFilter) {
+ lowVisionType.setColorFilterDegree(iCurColorFilterValue / 100.0f);
+ }
+ // debug
+ //DebugUtil.outMsg( this, "eyesight = " +
+ // lowVisionType.getEyesight() + "\nCVD = " + lowVisionType.getCVD()
+ // + "\nfileter = " + lowVisionType.getColorFilter());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return (lowVisionType);
+ }
+
+ public Object clone() {
+ ParamLowVision tmpParam = new ParamLowVision();
+ tmpParam.setColorFilterValue(iCurColorFilterValue);
+ tmpParam.setColorVisionValue(iCurColorVisionValue);
+ tmpParam.setEyeSightValue(iCurEyeSightValue);
+ tmpParam.setColorFilter(oColorFilter);
+ tmpParam.setColorVision(oColorVision);
+ tmpParam.setEyeSight(oEyeSight);
+
+ return (tmpParam);
+ }
+
+ /**
+ * @return
+ */
+ public int getColorFilterValue() {
+ return iCurColorFilterValue;
+ }
+
+ /**
+ * @return
+ */
+ public int getColorVisionValue() {
+ return iCurColorVisionValue;
+ }
+
+ /**
+ * @return
+ */
+ public int getEyeSightValue() {
+ return iCurEyeSightValue;
+ }
+
+ /**
+ * @return
+ */
+ public boolean useColorFilter() {
+ return oColorFilter;
+ }
+
+ /**
+ * @return
+ */
+ public boolean useColorVision() {
+ return oColorVision;
+ }
+
+ /**
+ * @return
+ */
+ public boolean useEyeSight() {
+ return oEyeSight;
+ }
+
+ /**
+ * @param i
+ */
+ public void setColorFilterValue(int i) {
+ iCurColorFilterValue = i;
+ }
+
+ /**
+ * @param i
+ */
+ public void setColorVisionValue(int i) {
+ iCurColorVisionValue = i;
+ }
+
+ /**
+ * @param i
+ */
+ public void setEyeSightValue(int i) {
+ iCurEyeSightValue = i;
+ }
+
+ /**
+ * @param b
+ */
+ public void setColorFilter(boolean b) {
+ oColorFilter = b;
+ }
+
+ /**
+ * @param b
+ */
+ public void setColorVision(boolean b) {
+ oColorVision = b;
+ }
+
+ /**
+ * @param b
+ */
+ public void setEyeSight(boolean b) {
+ oEyeSight = b;
+ }
+
+ public String toString() {
+ StringBuffer result = new StringBuffer(" "); //$NON-NLS-1$
+
+ if (useEyeSight()) {
+ result.append(Messages.getString("ParamLowVision.1")+" " + (getEyeSightValue() / 100.0f) + " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ if (useColorVision()) {
+ result.append(Messages.getString("ParamLowVision.4")+" " + getColorVisionValue() + " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ if (useColorFilter()) {
+ result.append(Messages.getString("ParamLowVision.7")+" " + (getColorFilterValue() / 100.0f) + " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ return result.toString();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/SimulateLowVision.java b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/SimulateLowVision.java
new file mode 100644
index 0000000..7242f92
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/src/org/eclipse/actf/visualization/lowvision/util/SimulateLowVision.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.lowvision.util;
+
+import org.eclipse.actf.visualization.engines.lowvision.image.ImageException;
+import org.eclipse.actf.visualization.engines.lowvision.image.Int2D;
+import org.eclipse.actf.visualization.engines.lowvision.image.PageImage;
+import org.eclipse.actf.visualization.engines.lowvision.image.SimulatedPageImage;
+import org.eclipse.actf.visualization.engines.lowvision.io.ImageDumpUtil;
+import org.eclipse.actf.visualization.engines.lowvision.io.LowVisionIOException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.widgets.Display;
+
+public class SimulateLowVision {
+
+ //separated from Lowvision part
+
+ public static synchronized Int2D getSimulatedInt2D(PageImage target,
+ ParamLowVision currentSetting) {
+
+ Int2D result = new Int2D(0, 0);
+
+ try {
+ SimulatedPageImage simulatedPageImage;
+ simulatedPageImage = new SimulatedPageImage(target, currentSetting
+ .getLowVisionType());
+ result = simulatedPageImage.getInt2D();
+ } catch (ImageException ie) {
+ ie.printStackTrace();
+ }
+
+ return result;
+ }
+
+ public static synchronized ImageData[] doSimulate(PageImage target,
+ ParamLowVision currentSetting, String fileName) {
+
+ ImageData[] imageDataArray = new ImageData[0];
+
+ // TODO use memory
+ try {
+ Int2D int2d_sim = getSimulatedInt2D(target, currentSetting);
+ if (ImageDumpUtil.isLV16BIT()) {
+ int2d_sim.writeToBMPFile(fileName, 16);
+ } else {
+ int2d_sim.writeToBMPFile(fileName);
+ }
+ ImageLoader loaderAfterSimulate = new ImageLoader();
+ imageDataArray = loaderAfterSimulate.load(fileName);
+ } catch (LowVisionIOException lvioe) {
+ lvioe.printStackTrace();
+ }
+
+ return imageDataArray;
+ }
+
+ public static synchronized Image doSimulate(PageImage target,
+ ParamLowVision currentSetting, Display display, String fileS) {
+
+ Image image = null;
+
+ try {
+ SimulatedPageImage simulatedPageImage;
+ simulatedPageImage = new SimulatedPageImage(target, currentSetting
+ .getLowVisionType());
+ Int2D int2d_sim = simulatedPageImage.getInt2D();
+
+ // TODO do not use file
+
+ if (ImageDumpUtil.isLV16BIT()) {
+ int2d_sim.writeToBMPFile(fileS, 16);
+ } else {
+ int2d_sim.writeToBMPFile(fileS);
+ }
+
+ image = new Image(display, fileS);
+
+ } catch (ImageException ie) {
+ ie.printStackTrace();
+ } catch (LowVisionIOException lvioe) {
+ lvioe.printStackTrace();
+ }
+
+ return image;
+ }
+
+ public static PageImage getPageImage(String fileName, boolean withoutFrame) {
+
+ PageImage pageImage = null;
+
+ try {
+ Int2D int2d = Int2D.readFromBMPFile(fileName);
+ pageImage = new PageImage(int2d, withoutFrame);
+ } catch (LowVisionIOException lvioe) {
+ lvioe.printStackTrace();
+ }
+
+ return pageImage;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/vizResources/images/LowVisionSample.bmp b/plugins/org.eclipse.actf.visualization.lowvision/vizResources/images/LowVisionSample.bmp
new file mode 100644
index 0000000..381ffd5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/vizResources/images/LowVisionSample.bmp
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/vizResources/scripts/lvHighlight.js b/plugins/org.eclipse.actf.visualization.lowvision/vizResources/scripts/lvHighlight.js
new file mode 100644
index 0000000..d2e5d47
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/vizResources/scripts/lvHighlight.js
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+var mother = null;
+var simImg = null;
+var coverDiv = document.createElement( "DIV" );
+var curTRTop = 0;
+var BORDER_WIDTH = 4;
+var HIGHLIGHT_BGCOLOR = "#ffdddd";
+function onloadFunc(){
+ mother = document.body.all( "mother" );
+ simImg = mother.all( "simImg" );
+ simOffLeft = simImg.offsetLeft;
+ simOffTop = simImg.offsetTop;
+ for( i=0; i<divArray.length; i++ ){
+ if( divLeft[i] < 0 ){ divLeft[i] = 0; }
+ if( divTop[i] < 0 ){ divTop[i] = 0; }
+ if( divWidth[i] < 0 ){ divWidth[i] = 0; }
+ if( divHeight[i] < 0 ){ divHeight[i] = 0; }
+
+ divArray[i] = document.createElement( "DIV" );
+ divArray[i].style.position = "absolute";
+ divArray[i].style.left = divLeft[i] + simOffLeft;
+ divArray[i].style.top = divTop[i] + simOffTop;
+ divArray[i].style.width = divWidth[i];
+ divArray[i].style.height = divHeight[i];
+ divArray[i].style.borderStyle = "groove";
+ divArray[i].style.borderColor = "white";
+ divArray[i].style.borderWidth = BORDER_WIDTH;
+ divArray[i].style.zIndex = 10;
+ divArray[i].style.fontSize = "0pt";
+ divArray[i].style.lineHeight = 0;
+ divArray[i].style.display = "none";
+ mother.appendChild( divArray[i] );
+ sLeft[i] = divLeft[i] + simOffLeft;
+ sTop[i] = divTop[i] + simOffTop;
+ }
+}
+
+function DIVOnclickFunc(){
+ document.body.scrollLeft = 0;
+ document.body.scrollTop = curTRTop;
+}
+
+function TROnclickFunc( _tr ){
+ window.event.cancelBubble = true;
+ clearDiv();
+ showDiv( _tr.id );
+ _tr.style.backgroundColor = HIGHLIGHT_BGCOLOR;
+
+ curTRTop = 0;
+ for( e=_tr; e!=document.body; e=e.offsetParent ){
+ curTRTop += e.offsetTop;
+ }
+}
+
+function clearDiv(){
+ var allTR = document.body.all.tags( "TR" );
+ for( i=0; i<allTR.length; i++ ){
+ if( allTR[i].style.backgroundColor == HIGHLIGHT_BGCOLOR ){
+ allTR[i].style.backgroundColor = "transparent";
+ }
+ }
+ coverDiv.style.width = 0;
+ coverDiv.style.height = 0;
+ for( i=0; i<divArray.length; i++ ){
+ divArray[i].style.display = "none";
+ divArray[i].onclick = null;
+ }
+}
+
+function showDiv( _id ){
+ divArray[_id].style.display = "block";
+ coverDiv.style.left = 0;
+ coverDiv.style.top = 0;
+ var coverDivWidth = divWidth[_id]-BORDER_WIDTH*2;
+ if( coverDivWidth > 0 ){ coverDiv.style.width = coverDivWidth; }
+ else{ coverDivWidth = 0; }
+ var coverDivHeight = divHeight[_id]-BORDER_WIDTH*2;
+ if( coverDivHeight > 0 ){ coverDiv.style.height = coverDivHeight; }
+ else{ coverDivHeight = 0; }
+ coverDiv.style.fontSize = "0pt";
+ coverDiv.style.lineHeight = 0;
+ coverDiv.style.zIndex = 20;
+ coverDiv.style.backgroundColor = "red";
+ var finX = divWidth[_id]-BORDER_WIDTH;
+ if( finX < 0 ){ finX = 0; }
+ var finY = divHeight[_id]-BORDER_WIDTH;
+ if( finY < 0 ){ finY = 0; }
+ coverDiv.style.filter = "alpha(opacity=0,finishopacity=0,style=0,startx=" + BORDER_WIDTH + ",starty=" + BORDER_WIDTH + ",finishx=" + finX + ",finishy=" + finY + ")";
+ divArray[_id].appendChild( coverDiv );
+ divArray[_id].onclick = DIVOnclickFunc;
+ document.body.scrollLeft = sLeft[_id];
+ document.body.scrollTop = sTop[_id];
+}
diff --git a/plugins/org.eclipse.actf.visualization.lowvision/vizResources/scripts/lvHighlight_moz.js b/plugins/org.eclipse.actf.visualization.lowvision/vizResources/scripts/lvHighlight_moz.js
new file mode 100644
index 0000000..8b7f790
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.lowvision/vizResources/scripts/lvHighlight_moz.js
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+var mother = null;
+var simImg = null;
+var coverDiv = document.createElement( "DIV" );
+var curTRTop = 0;
+var BORDER_WIDTH = 4;
+//var HIGHLIGHT_BGCOLOR = "#ffdddd";
+var HIGHLIGHT_BGCOLOR = "rgb(255, 221, 221)";
+function onloadFunc(){
+ //mother = document.body.all( "mother" );
+ mother = document.getElementById( "mother" );
+ //simImg = mother.all( "simImg" );
+ simImg = document.getElementById( "simImg" );
+ simOffLeft = simImg.offsetLeft;
+ simOffTop = simImg.offsetTop;
+
+ for( i=0; i<divArray.length; i++ ){
+ if( divLeft[i] < 0 ){ divLeft[i] = 0; }
+ if( divTop[i] < 0 ){ divTop[i] = 0; }
+ if( divWidth[i] < 0 ){ divWidth[i] = 0; }
+ if( divHeight[i] < 0 ){ divHeight[i] = 0; }
+
+ divArray[i] = document.createElement( "DIV" );
+ divArray[i].style.position = "absolute";
+ divArray[i].style.left = divLeft[i] + simOffLeft;
+ divArray[i].style.top = divTop[i] + simOffTop;
+ divArray[i].style.width = divWidth[i];
+ divArray[i].style.height = divHeight[i];
+ divArray[i].style.borderStyle = "groove";
+ divArray[i].style.borderColor = "white";
+ divArray[i].style.borderWidth = BORDER_WIDTH;
+ divArray[i].style.zIndex = 10;
+ divArray[i].style.fontSize = "0pt";
+ divArray[i].style.lineHeight = 0;
+ divArray[i].style.display = "none";
+ mother.appendChild( divArray[i] );
+ sLeft[i] = divLeft[i] + simOffLeft;
+ sTop[i] = divTop[i] + simOffTop;
+ }
+}
+
+function DIVOnclickFunc(){
+ document.body.scrollLeft = 0;
+ document.body.scrollTop = curTRTop;
+}
+
+function TROnclickFunc( _tr ){
+ //window.event.cancelBubble = true;
+ clearDiv();
+ showDiv( _tr.id );
+ _tr.style.backgroundColor = HIGHLIGHT_BGCOLOR;
+
+ curTRTop = 0;
+ for( e=_tr; e!=document.body; e=e.offsetParent ){
+ curTRTop += e.offsetTop;
+ }
+}
+
+function clearDiv(){
+ //var allTR = document.body.all.tags( "TR" );
+ allTR=document.getElementsByTagName("tr");
+ for( i=0; i<allTR.length; i++ ){
+ if( allTR[i].style.backgroundColor == HIGHLIGHT_BGCOLOR ){
+ allTR[i].style.backgroundColor = "transparent";
+ }
+ }
+ coverDiv.style.width = 0;
+ coverDiv.style.height = 0;
+ for( i=0; i<divArray.length; i++ ){
+ divArray[i].style.display = "none";
+ divArray[i].onclick = null;
+ }
+}
+
+function showDiv( _id ){
+ divArray[_id].style.display = "block";
+ coverDiv.style.left = 0;
+ coverDiv.style.top = 0;
+ var coverDivWidth = divWidth[_id]-BORDER_WIDTH*2;
+ if( coverDivWidth > 0 ){ coverDiv.style.width = coverDivWidth; }
+ else{ coverDivWidth = 0; }
+ var coverDivHeight = divHeight[_id]-BORDER_WIDTH*2;
+ if( coverDivHeight > 0 ){ coverDiv.style.height = coverDivHeight; }
+ else{ coverDivHeight = 0; }
+ coverDiv.style.fontSize = "0pt";
+ coverDiv.style.lineHeight = 0;
+ coverDiv.style.zIndex = 20;
+ //coverDiv.style.backgroundColor = "red";
+ var finX = divWidth[_id]-BORDER_WIDTH;
+ if( finX < 0 ){ finX = 0; }
+ var finY = divHeight[_id]-BORDER_WIDTH;
+ if( finY < 0 ){ finY = 0; }
+ coverDiv.style.filter = "alpha(opacity=0,finishopacity=0,style=0,startx=" + BORDER_WIDTH + ",starty=" + BORDER_WIDTH + ",finishx=" + finX + ",finishy=" + finY + ")";
+ divArray[_id].appendChild( coverDiv );
+ divArray[_id].onclick = DIVOnclickFunc;
+ document.body.scrollLeft = sLeft[_id];
+ document.body.scrollTop = sTop[_id];
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/.classpath b/plugins/org.eclipse.actf.visualization.presentation/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/.cvsignore b/plugins/org.eclipse.actf.visualization.presentation/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.actf.visualization.presentation/.project b/plugins/org.eclipse.actf.visualization.presentation/.project
new file mode 100644
index 0000000..2d9f52c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.presentation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.presentation/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..b95be73
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF Presentation Visualization Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.presentation;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.presentation.RoomPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.actf.common,
+ org.eclipse.actf.visualization.engines.lowvision,
+ org.eclipse.actf.visualization.eval,
+ org.eclipse.actf.visualization.ui.report
+Eclipse-LazyStart: true
+Bundle-ClassPath: runtimes/simulator_room.jar
+Export-Package: org.eclipse.actf.visualization.presentation.ui.views
diff --git a/plugins/org.eclipse.actf.visualization.presentation/about.html b/plugins/org.eclipse.actf.visualization.presentation/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.presentation/build.properties b/plugins/org.eclipse.actf.visualization.presentation/build.properties
new file mode 100644
index 0000000..a70ba31
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/build.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = plugin.xml,\
+ about.html,\
+ META-INF/,\
+ plugin_ja.properties,\
+ plugin.properties,\
+ icons/,\
+ html/,\
+ runtimes/simulator_room.jar
+jars.compile.order = runtimes/simulator_room.jar
+source.runtimes/simulator_room.jar = src/
+output.runtimes/simulator_room.jar = bin/
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/en/large.html b/plugins/org.eclipse.actf.visualization.presentation/html/en/large.html
new file mode 100644
index 0000000..0a0b21b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/en/large.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+</head>
+<body>
+<h2>Auditorium</h2>
+<img src="../images/auditorium.png" alt=""><br>
+Display Size : 10 feet<br>
+Distance from the Audience : 100 feet</br>
+</body>
+</html>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/en/middle.html b/plugins/org.eclipse.actf.visualization.presentation/html/en/middle.html
new file mode 100644
index 0000000..88486b2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/en/middle.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+</head>
+<body>
+<h2>Large Meeting Room</h2>
+<img src="../images/largeMeetingRoom.png" alt=""><br>
+Display Size : 5 feet<br>
+Distance from the Audience : 30 feet</br>
+</body>
+</html>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/en/small.html b/plugins/org.eclipse.actf.visualization.presentation/html/en/small.html
new file mode 100644
index 0000000..84d51d0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/en/small.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+</head>
+<body>
+<h2>Small Meeting Room</h2>
+<img src="../images/smallMeetingRoom.png" alt=""><br>
+Display Size : 3 feet<br>
+Distance from the Audience : 10 feet</br>
+</body>
+</html>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/images/auditorium.png b/plugins/org.eclipse.actf.visualization.presentation/html/images/auditorium.png
new file mode 100644
index 0000000..5d63005
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/images/auditorium.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/images/largeMeetingRoom.png b/plugins/org.eclipse.actf.visualization.presentation/html/images/largeMeetingRoom.png
new file mode 100644
index 0000000..577eb77
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/images/largeMeetingRoom.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/images/smallMeetingRoom.png b/plugins/org.eclipse.actf.visualization.presentation/html/images/smallMeetingRoom.png
new file mode 100644
index 0000000..29b1d27
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/images/smallMeetingRoom.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/ja/large.html b/plugins/org.eclipse.actf.visualization.presentation/html/ja/large.html
new file mode 100644
index 0000000..b4187e4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/ja/large.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+</head>
+<body>
+<h2>u°</h2>
+<img src="../images/auditorium.png" alt=""><br>
+fBXvCÌ嫳 : 3 [g<br>
+fBXvC©çÌ£ : 30 [g</br>
+</body>
+</html>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/ja/middle.html b/plugins/org.eclipse.actf.visualization.presentation/html/ja/middle.html
new file mode 100644
index 0000000..c2613e2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/ja/middle.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+</head>
+<body>
+<h2>åïcº</h2>
+<img src="../images/largeMeetingRoom.png" alt=""><br>
+fBXvCÌ嫳 : 1.5 [g<br>
+fBXvC©çÌ£ : 9 [g</br>
+</body>
+</html>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/html/ja/small.html b/plugins/org.eclipse.actf.visualization.presentation/html/ja/small.html
new file mode 100644
index 0000000..6892db7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/html/ja/small.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+</head>
+<body>
+<h2>¬ïcº</h2>
+<img src="../images/smallMeetingRoom.png" alt=""><br>
+fBXvCÌ嫳 : 0.9 [g<br>
+fBXvC©çÌ£ : 3 [g</br>
+</body>
+</html>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonLarge.gif b/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonLarge.gif
new file mode 100644
index 0000000..7353124
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonLarge.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonMiddle.gif b/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonMiddle.gif
new file mode 100644
index 0000000..4830aef
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonMiddle.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonSmall.gif b/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonSmall.gif
new file mode 100644
index 0000000..d511047
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/icons/ButtonSmall.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.presentation/plugin.properties b/plugins/org.eclipse.actf.visualization.presentation/plugin.properties
new file mode 100644
index 0000000..9babf08
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/plugin.properties
@@ -0,0 +1,34 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+adesigner.room.tab.title=Presentation
+
+adesigner.room.report.small.url=en/small.html
+adesigner.room.report.middle.url=en/middle.html
+adesigner.room.report.large.url=en/large.html
+
+RoomView.Simulate_Large=Auditorium
+RoomSimulationAction.Large=Auditorium
+RoomView.Simulate_Middle=Large Meeting Room
+RoomSimulationAction.Middle=Large Meeting Room
+RoomView.Simulate_Small=Small Meeting Room
+RoomSimulationAction.Small=Small Meeting Room
+
+PartRightRoom.begin_to_make_PageImage._2 = begin to make PageImage.
+PartRightRoom.begin_to_check_problems._4 = begin to check problems.
+PartRightRoom.simulation_of_current_page_is_over._8 = simulation of current page is over.
+PartRightRoom.now_preparing_15 = now preparing
+PartRightRoom.get_node_position._24 = get node position.
+PartRightRoom.get_information_of_all_images._25 = get information of all images.
+PartRightRoom.dump_the_image_in_the_web_browser._26 = dump the image.
+PartRightRoom.start_the_thread_of_extracting_and_checking._27 = start simulation.
+PartRightRoom.prepare_Simulation_Image._29 = prepare Simulation Image.
+PartRightRoom.Can__t_process_it_because_It_is_in_visualizing_30 = Can't process it because It is in visualizing
+PartRightRoom.Can__t_process_it_because_It_is_in_simulating_31 = Can't process it because It is in simulating
diff --git a/plugins/org.eclipse.actf.visualization.presentation/plugin.xml b/plugins/org.eclipse.actf.visualization.presentation/plugin.xml
new file mode 100644
index 0000000..79a7ca7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/plugin.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="%adesigner.room.tab.title"
+ class="org.eclipse.actf.visualization.presentation.ui.views.RoomView"
+ id="org.eclipse.actf.visualization.presentation.ui.views.RoomView">
+ </view>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.actf.visualization.presentation/plugin_ja.properties b/plugins/org.eclipse.actf.visualization.presentation/plugin_ja.properties
new file mode 100644
index 0000000..2d2d730
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/plugin_ja.properties
@@ -0,0 +1,34 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+adesigner.room.tab.title=\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3
+
+adesigner.room.report.small.url=ja/small.html
+adesigner.room.report.middle.url=ja/middle.html
+adesigner.room.report.large.url=ja/large.html
+
+RoomView.Simulate_Large=\u8b1b\u5802
+RoomSimulationAction.Large=\u8b1b\u5802
+RoomView.Simulate_Middle=\u5927\u4f1a\u8b70\u5ba4
+RoomSimulationAction.Middle=\u5927\u4f1a\u8b70\u5ba4
+RoomView.Simulate_Small=\u5c0f\u4f1a\u8b70\u5ba4
+RoomSimulationAction.Small=\u5c0f\u4f1a\u8b70\u5ba4
+
+PartRightRoom.begin_to_make_PageImage._2 = \u63cf\u753b\u30a4\u30e1\u30fc\u30b8\u306e\u53d6\u5f97\u4e2d
+PartRightRoom.begin_to_check_problems._4 = \u554f\u984c\u70b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u307e\u3059
+PartRightRoom.simulation_of_current_page_is_over._8 = \u7d42\u4e86\uff08\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3 \u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\uff09
+PartRightRoom.now_preparing_15 = \u6e96\u5099\u4e2d\u2026
+PartRightRoom.get_node_position._24 = \u5404\u8981\u7d20\u306e\u63cf\u753b\u4f4d\u7f6e\u3092\u53d6\u5f97\u4e2d
+PartRightRoom.get_information_of_all_images._25 = \u753b\u50cf\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u4e2d
+PartRightRoom.dump_the_image_in_the_web_browser._26 = \u63cf\u753b\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u4e2d
+PartRightRoom.start_the_thread_of_extracting_and_checking._27 = \u30c1\u30a7\u30c3\u30af\u7528\u30b9\u30ec\u30c3\u30c9\u5b9f\u884c\u4e2d\u2026
+PartRightRoom.prepare_Simulation_Image._29 = \u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u753b\u50cf\u6e96\u5099\u4e2d\u2026
+PartRightRoom.Can__t_process_it_because_It_is_in_visualizing_30 = \u97f3\u58f0\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u8996\u899a\u5316\u4e2d\u306e\u305f\u3081\u51e6\u7406\u3067\u304d\u307e\u305b\u3093
+PartRightRoom.Can__t_process_it_because_It_is_in_simulating_31 = \u30ed\u30fc\u30d3\u30b8\u30e7\u30f3\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u4e2d\u306e\u305f\u3081\u51e6\u7406\u3067\u304d\u307e\u305b\u3093
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/RoomPlugin.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/RoomPlugin.java
new file mode 100644
index 0000000..eb2ea1b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/RoomPlugin.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Daisuke SATO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.actf.util.FileUtils;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class RoomPlugin extends AbstractUIPlugin {
+
+ public static String PLUGIN_ID = "org.eclipse.actf.visualization.presentation";
+
+ //The shared instance.
+ private static RoomPlugin _plugin;
+
+ private ResourceBundle _resourceBundle;
+
+ private static BundleContext _context;
+
+ private static File tmpDir;
+
+ /**
+ * The constructor.
+ */
+ public RoomPlugin() {
+ _plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ _context = context;
+
+ createTempDirectory();
+ }
+
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ _plugin = null;
+ _context = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static RoomPlugin getDefault() {
+ return _plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = RoomPlugin.getDefault().getResourceBundle();
+ try {
+ return (null != bundle) ? bundle.getString(key) : key;
+ } catch (MissingResourceException mre) {
+ return "???" + key + "???";
+ }
+ }
+
+ public ResourceBundle getResourceBundle() {
+ if (null == _resourceBundle && null != _context) {
+ Bundle bundle = _context.getBundle();
+ if (null != bundle) {
+ _resourceBundle = Platform.getResourceBundle(bundle);
+ }
+ }
+
+ return _resourceBundle;
+ }
+
+ public static String getDirectory(String dir) {
+
+ try {
+ URL url = _context.getBundle().getEntry(dir);
+ url = FileLocator.resolve(url);
+ return new Path(url.getPath()).makeAbsolute().toOSString();
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ return "";
+ }
+ }
+
+ private static void createTempDirectory(){
+ if (tmpDir == null) {
+ String tmpS = _plugin.getStateLocation().toOSString()+File.separator + "tmp";
+ if (FileUtils.isAvailableDirectory(tmpS)) {
+ tmpDir = new File(tmpS);
+ }
+ }
+ }
+
+
+ public static File createTempFile(String prefix, String suffix) throws Exception {
+ createTempDirectory();
+ return (File.createTempFile(prefix, suffix, tmpDir));
+ }
+
+
+}
+
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/eval/CheckResultPresentation.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/eval/CheckResultPresentation.java
new file mode 100644
index 0000000..416467b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/eval/CheckResultPresentation.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.presentation.eval;
+
+import org.eclipse.actf.visualization.eval.EvaluationResultImpl;
+
+
+public class CheckResultPresentation extends EvaluationResultImpl {
+
+ //serial number
+
+ public CheckResultPresentation() {
+ setSummaryReportUrl("about:blank");
+ setShowAllGuidelineItems(true);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/LargeRoomSimulateAction.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/LargeRoomSimulateAction.java
new file mode 100644
index 0000000..371257e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/LargeRoomSimulateAction.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.ui.actions;
+
+import org.eclipse.actf.visualization.presentation.RoomPlugin;
+import org.eclipse.actf.visualization.presentation.ui.internal.PartControlRoom;
+import org.eclipse.actf.visualization.presentation.util.ParamRoom;
+import org.eclipse.jface.action.Action;
+
+
+
+public class LargeRoomSimulateAction extends Action {
+
+ public LargeRoomSimulateAction() {
+ setToolTipText(RoomPlugin.getResourceString("RoomView.Simulate_Large")); //$NON-NLS-1$
+ setImageDescriptor(RoomPlugin.getImageDescriptor("icons/ButtonLarge.gif")); //$NON-NLS-1$
+ setText(RoomPlugin.getResourceString("RoomSimulationAction.Large")); //$NON-NLS-1$
+ }
+
+ public void run() {
+ //TODO
+ PartControlRoom.getDefaultInstance().getParamLowVision().setType(ParamRoom.ROOM_LARGE);
+ PartControlRoom.getDefaultInstance().doSimulate();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/MiddleRoomSimulateAction.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/MiddleRoomSimulateAction.java
new file mode 100644
index 0000000..ec1ce8d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/MiddleRoomSimulateAction.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.ui.actions;
+
+import org.eclipse.actf.visualization.presentation.RoomPlugin;
+import org.eclipse.actf.visualization.presentation.ui.internal.PartControlRoom;
+import org.eclipse.actf.visualization.presentation.util.ParamRoom;
+import org.eclipse.jface.action.Action;
+
+
+
+public class MiddleRoomSimulateAction extends Action {
+
+ public MiddleRoomSimulateAction() {
+ setToolTipText(RoomPlugin.getResourceString("RoomView.Simulate_Middle")); //$NON-NLS-1$
+ setImageDescriptor(RoomPlugin.getImageDescriptor("icons/ButtonMiddle.gif")); //$NON-NLS-1$
+ setText(RoomPlugin.getResourceString("RoomSimulationAction.Middle")); //$NON-NLS-1$
+ }
+
+ public void run() {
+ //TODO
+ PartControlRoom.getDefaultInstance().getParamLowVision().setType(ParamRoom.ROOM_MIDDLE);
+ PartControlRoom.getDefaultInstance().doSimulate();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/SmallRoomSimulateAction.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/SmallRoomSimulateAction.java
new file mode 100644
index 0000000..0b7d5f1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/actions/SmallRoomSimulateAction.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.presentation.ui.actions;
+
+import org.eclipse.actf.visualization.presentation.RoomPlugin;
+import org.eclipse.actf.visualization.presentation.ui.internal.PartControlRoom;
+import org.eclipse.actf.visualization.presentation.util.ParamRoom;
+import org.eclipse.jface.action.Action;
+
+
+
+
+public class SmallRoomSimulateAction extends Action {
+
+ public SmallRoomSimulateAction() {
+ setToolTipText(RoomPlugin.getResourceString("RoomView.Simulate_Small")); //$NON-NLS-1$
+ setImageDescriptor(RoomPlugin.getImageDescriptor("icons/ButtonSmall.gif"));
+ setText(RoomPlugin.getResourceString("RoomSimulationAction.Small")); //$NON-NLS-1$
+ }
+
+
+ public void run(){
+ //TODO
+ PartControlRoom.getDefaultInstance().getParamLowVision().setType(ParamRoom.ROOM_SMALL);
+ PartControlRoom.getDefaultInstance().doSimulate();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/PartControlRoom.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/PartControlRoom.java
new file mode 100644
index 0000000..c888d57
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/PartControlRoom.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Daisuke SATO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.ui.internal;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.actf.mediator.Mediator;
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.ModelServiceImageCreator;
+import org.eclipse.actf.visualization.IVisualizationConst;
+import org.eclipse.actf.visualization.IVisualizationView;
+import org.eclipse.actf.visualization.engines.lowvision.image.PageImage;
+import org.eclipse.actf.visualization.engines.lowvision.io.ImageDumpUtil;
+import org.eclipse.actf.visualization.presentation.RoomPlugin;
+import org.eclipse.actf.visualization.presentation.eval.CheckResultPresentation;
+import org.eclipse.actf.visualization.presentation.util.ParamRoom;
+import org.eclipse.actf.visualization.presentation.util.SimulateRoom;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+
+public class PartControlRoom implements IVisualizationConst {
+
+ private static PartControlRoom INSTANCE = null;
+
+ private PageImage targetPageImage;
+
+ private RoomView roomView;
+
+ private ParamRoom paramRoom;
+
+ private Shell _shell;
+
+ private boolean _isInSimulate;
+
+ private CheckResultPresentation checkResult;
+
+ private File vizResultFile;
+
+ private String dumpImageFile;
+
+ private IVisualizationView checker;
+
+ private Mediator mediator = Mediator.getInstance();
+
+ public static PartControlRoom getDefaultInstance() {
+ return INSTANCE;
+ }
+
+ public PartControlRoom(IVisualizationView checker, Composite parent) {
+ INSTANCE = this;
+
+ this.checker = checker;
+ this._shell = parent.getShell();
+
+ paramRoom = new ParamRoom();
+
+ roomView = new RoomView(parent);
+
+ _isInSimulate = false;
+
+ try {
+ File dumpImgFile = RoomPlugin.createTempFile(PREFIX_SCREENSHOT,
+ SUFFIX_BMP);
+ dumpImageFile = dumpImgFile.getAbsolutePath();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public void doSimulate() {
+ // TODO enable,disable button
+ if (_isInSimulate) {
+ return;
+ }
+
+ this._isInSimulate = true;
+ this._shell.setCursor(new Cursor(_shell.getDisplay(), SWT.CURSOR_WAIT));
+
+ checkResult = new CheckResultPresentation();
+ mediator.setEvaluationResult(checker, checkResult);
+
+ roomView.clearImage();
+ _shell.getDisplay().update();
+
+ IModelService modelService = mediator.getActiveModelService();
+ if (modelService == null) {
+ return;
+ }
+ prepareInt2Ds(modelService);
+
+ }
+
+ private void prepareInt2Ds(IModelService modelService) {
+ try {
+ checker
+ .setStatusMessage(RoomPlugin
+ .getResourceString("PartRightRoom.dump_the_image_in_the_web_browser._26"));
+
+ modelService.setScrollbarWidth(roomView.getVarticalBarSize().x);
+ ModelServiceImageCreator imgCreator = new ModelServiceImageCreator(
+ modelService);
+ imgCreator.getScreenImageAsBMP(dumpImageFile, false);
+
+ targetPageImage = ImageDumpUtil.createPageImage(dumpImageFile,
+ _shell);
+
+ if (targetPageImage != null) {
+
+ checker
+ .setStatusMessage(RoomPlugin
+ .getResourceString("PartRightRoom.begin_to_make_PageImage._2"));
+
+ doSimulateAfterHalf(modelService);
+ } else {
+ _shell.setCursor(null);
+ _isInSimulate = false;
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void doSimulateAfterHalf(IModelService modelService) {
+ // TODO
+ PageImage pageImageWhole = targetPageImage;
+
+ checker
+ .setStatusMessage(RoomPlugin
+ .getResourceString("PartRightRoom.prepare_Simulation_Image._29"));
+
+ paramRoom.setDisplayResolution(modelService.getTargetComposite()
+ .getSize().y);
+
+ try {
+ vizResultFile = RoomPlugin.createTempFile(PREFIX_VISUALIZATION,
+ SUFFIX_BMP);
+ ImageData[] imageDataArray = SimulateRoom.doSimulate(
+ pageImageWhole, paramRoom, vizResultFile.getAbsolutePath());
+ if (imageDataArray.length > 0) {
+ roomView.displayImage(imageDataArray[0]);
+ }
+ imageDataArray = null;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ String html = "";
+ switch (paramRoom.getType()) {
+ case ParamRoom.ROOM_SMALL:
+ html = RoomPlugin
+ .getResourceString("adesigner.room.report.small.url");
+ break;
+ case ParamRoom.ROOM_MIDDLE:
+ html = RoomPlugin
+ .getResourceString("adesigner.room.report.middle.url");
+ break;
+ case ParamRoom.ROOM_LARGE:
+ html = RoomPlugin
+ .getResourceString("adesigner.room.report.large.url");
+ break;
+ }
+
+ checkResult.setSummaryReportUrl(RoomPlugin.getDirectory("html") + html);
+ // TODO
+ checkResult.setSummaryReportText("");
+ Mediator.getInstance().setEvaluationResult(checker, checkResult);
+
+ checker
+ .setStatusMessage(RoomPlugin
+ .getResourceString("PartRightRoom.simulation_of_current_page_is_over._8"));
+ // //$NON-NLS-1$
+ _shell.setCursor(null);
+ _isInSimulate = false;
+
+ }
+
+ public void setHighlightPositions(List infoPositionSizeList) {
+ roomView.highlight(infoPositionSizeList);
+ }
+
+ /**
+ * @return
+ */
+ public ParamRoom getParamLowVision() {
+ return paramRoom;
+ }
+
+ /**
+ * @param vision
+ */
+ public void setParamLowVision(ParamRoom vision) {
+ paramRoom = vision;
+ }
+
+ public void setLVParamStatus() {
+ if (!_isInSimulate) {
+ checker.setInfoMessage(paramRoom.toString());
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/RoomToolbar.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/RoomToolbar.java
new file mode 100644
index 0000000..86db9e8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/RoomToolbar.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Daisuke SATO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.ui.internal;
+
+import org.eclipse.actf.visualization.presentation.ui.actions.LargeRoomSimulateAction;
+import org.eclipse.actf.visualization.presentation.ui.actions.MiddleRoomSimulateAction;
+import org.eclipse.actf.visualization.presentation.ui.actions.SmallRoomSimulateAction;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ToolBar;
+
+
+public class RoomToolbar extends Composite {
+
+ public RoomToolbar(Composite parent, int style) {
+ super(parent, style);
+ initLayout(parent);
+ }
+
+ private void initLayout(Composite parent) {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 0;
+ gridLayout.marginBottom = 1;
+ gridLayout.marginHeight = gridLayout.marginWidth = 1;
+ gridLayout.numColumns = 3;
+ setLayout(gridLayout);
+
+ ToolBar toolBar = new ToolBar(this, SWT.RIGHT);
+ ToolBarManager toolBarManager = new ToolBarManager(toolBar);
+
+ ActionContributionItem smallRoomActionItem = new ActionContributionItem(new SmallRoomSimulateAction());
+ smallRoomActionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ toolBarManager.add(smallRoomActionItem);
+ toolBarManager.add(new Separator());
+
+ ActionContributionItem middleRoomActionItem = new ActionContributionItem(new MiddleRoomSimulateAction());
+ middleRoomActionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ toolBarManager.add(middleRoomActionItem);
+ toolBarManager.add(new Separator());
+
+ ActionContributionItem largeRoomActionItem = new ActionContributionItem(new LargeRoomSimulateAction());
+ largeRoomActionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ toolBarManager.add(largeRoomActionItem);
+
+ toolBarManager.update(true);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/RoomView.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/RoomView.java
new file mode 100644
index 0000000..ca867c9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/internal/RoomView.java
@@ -0,0 +1,392 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.presentation.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.actf.mediator.Mediator;
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.visualization.eval.problem.IPositionSize;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+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.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ScrollBar;
+
+
+
+
+public class RoomView {
+
+ private Display _display;
+
+ private Canvas _imageCanvas;
+
+ private Image _image = null;
+
+ private ImageData _imageData = null; // the currently-displayed image
+ // data
+
+ private int _ix;
+
+ private int _iy;
+
+ private ScrollBar _horizontalBar;
+
+ private ScrollBar _verticalBar;
+
+ private boolean _isLocked = false;
+
+ private List _highlightTargetList = new ArrayList();
+
+ private RoomToolbar _roomToolbar;
+
+ private Mediator mediator = Mediator.getInstance();
+
+ // separate from PartRightLowVision
+ public RoomView(Composite parent) {
+
+ this._display = parent.getDisplay();
+ this._ix = 0;
+ this._iy = 0;
+
+ GridData gridData;
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ gridLayout.marginHeight = gridLayout.marginWidth = 0;
+ gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
+ parent.setLayout(gridLayout);
+
+ this._roomToolbar = new RoomToolbar(parent, SWT.NONE);
+
+ Composite compositeLowVisionHalf2 = new Composite(parent, SWT.NONE);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ compositeLowVisionHalf2.setLayoutData(gridData);
+
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ gridLayout.marginHeight = gridLayout.marginWidth = 0;
+ gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
+ compositeLowVisionHalf2.setLayout(gridLayout);
+
+ // Canvas to show the image.
+ this._imageCanvas = new Canvas(compositeLowVisionHalf2, SWT.V_SCROLL | SWT.H_SCROLL);
+ // | SWT.NO_REDRAW_RESIZE
+ this._imageCanvas.setBackground(new Color(_display, 255, 255, 255));
+ // white color
+ gridData = new GridData();
+ gridData.horizontalSpan = 1;
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ this._imageCanvas.setLayoutData(gridData);
+
+ this._imageCanvas.addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent event) {
+
+ if (null == _imageData) {
+ return;
+ }
+
+ if (null != _image) {
+ paintImage(event);
+ }
+
+ resizeScrollBars();
+
+ if (null == _image || _isLocked) {
+ // _roomToolbar.getSyncButton().setSelection(true);
+ // _roomToolbar.getSyncButton().setEnabled(false);
+ } else {
+ int imageHeight = Math.round(_imageData.height);
+ int ieHeight = Integer.MIN_VALUE;
+
+ IModelService modelService = mediator.getActiveModelService();
+ if (modelService != null) {
+ ieHeight = modelService.getScrollManager().getSize(true).getWholeSizeY();
+ }
+
+ if (Math.abs(imageHeight - ieHeight) < 10) {
+ // _roomToolbar.getSyncButton().setEnabled(true);
+ } else {
+ // _roomToolbar.getSyncButton().setEnabled(false);
+ }
+ }
+
+ }
+ });
+
+ _imageCanvas.addMouseMoveListener(new MouseMoveListener() {
+ public void mouseMove(MouseEvent event) {
+ // do nothing
+ }
+ });
+
+ // Set up the image canvas scroll bars.
+ _horizontalBar = _imageCanvas.getHorizontalBar();
+ _horizontalBar.setVisible(true);
+ _horizontalBar.setMinimum(0);
+ _horizontalBar.setEnabled(false);
+ _horizontalBar.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ scrollHorizontally((ScrollBar) event.widget);
+ }
+ });
+ _verticalBar = _imageCanvas.getVerticalBar();
+ _verticalBar.setVisible(true);
+ _verticalBar.setMinimum(0);
+ _verticalBar.setEnabled(false);
+ _verticalBar.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ scrollVertically((ScrollBar) event.widget);
+ }
+ });
+
+ }
+
+ protected Point getVarticalBarSize() {
+ return _verticalBar.getSize();
+ }
+
+ protected void highlight(List target) {
+
+ if (target != null) {
+ int topY = -1;
+
+ for (Iterator i = target.iterator(); i.hasNext();) {
+ try {
+ IPositionSize ips = (IPositionSize) i.next();
+ if (topY < 0 || topY > ips.getY()) {
+ topY = ips.getY();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (topY >= 0) {
+ Rectangle canvasBounds = this._imageCanvas.getClientArea();
+ int height = Math.round(this._imageData.height); // yscale
+ if (height > canvasBounds.height) {
+ if (height - topY < canvasBounds.height) {
+ // Don't scroll past the end of the image.
+ topY = height - canvasBounds.height;
+ }
+ }
+ }
+ this._highlightTargetList = target;
+ }
+
+ this._imageCanvas.redraw();
+
+ }
+
+ public void disposeImage() {
+ if (_image != null && _image.isDisposed()) {
+ _image.dispose();
+
+ }
+ _image = null;
+ if (_imageData != null) {
+ _imageData = null;
+ }
+ }
+
+ protected void clearImage() {
+ if (_image != null) {
+ _image.dispose();
+ _image = null;
+ }
+ if (_imageData != null) {
+ _imageData = null;
+ }
+ _highlightTargetList = new ArrayList();
+ resetScrollBars();
+ _imageCanvas.redraw();
+ }
+
+ protected void displayImage(ImageData newImageData) {
+ // Dispose of the old image, if there was one.
+ if (null != this._image) {
+ this._image.dispose();
+ }
+
+ this._imageData = newImageData;
+ this._image = null;
+
+ if (null != this._imageData) {
+ try {
+ // Cache the new image and imageData.
+ this._image = new Image(_display, newImageData);
+ } catch (SWTException se) {
+ se.printStackTrace();
+ }
+ }
+
+ // Redraw the canvases.
+ _imageCanvas.redraw();
+ }
+
+ private void paintImage(PaintEvent event) {
+ if (null == _image || null == _imageData) {
+ return;
+ }
+
+ Image paintImage = _image;
+// int transparentPixel = _imageData.transparentPixel;
+ int w = Math.round(_imageData.width); // xscale
+ int h = Math.round(_imageData.height); // yscale
+ event.gc.drawImage(paintImage, 0, 0, _imageData.width, _imageData.height, _ix + _imageData.x, _iy
+ + _imageData.y, w, h);
+
+ // Vector tmpV = lowVisionControl.getSelectedItemsInfo();
+ List tmpV = _highlightTargetList;
+ if (tmpV != null) {
+ event.gc.setXORMode(false);
+ event.gc.setLineWidth(2);
+ for (Iterator i = tmpV.iterator(); i.hasNext();) {
+ try {
+ IPositionSize ips = (IPositionSize) i.next();
+
+ event.gc.setForeground(_display.getSystemColor(SWT.COLOR_WHITE));
+ event.gc.drawRectangle(_ix + ips.getX(), _iy + ips.getY(), ips.getWidth(), ips.getHeight());
+
+ event.gc.setForeground(_display.getSystemColor(SWT.COLOR_BLACK));
+ event.gc.drawRectangle(_ix + ips.getX() - 2, _iy + ips.getY() - 2, ips.getWidth() + 4, ips
+ .getHeight() + 4);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ protected void resetScrollBars() {
+ if (_image == null) {
+ _horizontalBar.setEnabled(false);
+ _verticalBar.setEnabled(false);
+ return;
+ }
+
+ _ix = 0;
+ _iy = 0;
+ resizeScrollBars();
+ _horizontalBar.setSelection(0);
+ _verticalBar.setSelection(0);
+ }
+
+ private void resizeScrollBars() {
+ if (_imageData == null)
+ return;
+
+ // Set the max and thumb for the image canvas scroll bars.
+
+ Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(_imageData.width); // xscale
+ if (width > canvasBounds.width) {
+ // The image is wider than the canvas.
+ _horizontalBar.setEnabled(true);
+ _horizontalBar.setMaximum(width);
+ _horizontalBar.setThumb(canvasBounds.width);
+ _horizontalBar.setPageIncrement(canvasBounds.width);
+ } else {
+ // The canvas is wider than the image.
+ _horizontalBar.setEnabled(false);
+ if (_ix != 0) {
+ // Make sure the image is completely visible.
+ _ix = 0;
+ _imageCanvas.redraw();
+ }
+ }
+ int height = Math.round(_imageData.height); // yscale
+ if (height > canvasBounds.height) {
+ // The image is taller than the canvas.
+ _verticalBar.setEnabled(true);
+ _verticalBar.setMaximum(height);
+ _verticalBar.setThumb(canvasBounds.height);
+ _verticalBar.setPageIncrement(canvasBounds.height);
+ } else {
+ // The canvas is taller than the image.
+ _verticalBar.setEnabled(false);
+ if (_iy != 0) {
+ // Make sure the image is completely visible.
+ _iy = 0;
+ _imageCanvas.redraw();
+ }
+ }
+ }
+
+ private void scrollHorizontally(ScrollBar scrollBar) {
+ if (_image == null)
+ return;
+ Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(_imageData.width); // xscale
+ int height = Math.round(_imageData.height); // yscale
+ if (width > canvasBounds.width) {
+ // Only scroll if the image is bigger than the canvas.
+ int x = -scrollBar.getSelection();
+ if (x + width < canvasBounds.width) {
+ // Don't scroll past the end of the image.
+ x = canvasBounds.width - width;
+ }
+ _imageCanvas.scroll(x, _iy, _ix, _iy, width, height, false);
+ _ix = x;
+
+ }
+ }
+
+ /*
+ * Called when the image canvas' vertical scrollbar is selected.
+ */
+ private void scrollVertically(ScrollBar scrollBar) {
+ if (null != this._image) {
+ Rectangle canvasBounds = _imageCanvas.getClientArea();
+ int width = Math.round(this._imageData.width); // xscale
+ int height = Math.round(this._imageData.height); // yscale
+ if (height > canvasBounds.height) {
+ // Only scroll if the image is bigger than the canvas.
+ int y = -scrollBar.getSelection();
+ if (y + height < canvasBounds.height) {
+ // Don't scroll past the end of the image.
+ y = canvasBounds.height - height;
+ }
+ _imageCanvas.scroll(_ix, y, _ix, _iy, width, height, false);
+
+ _iy = y;
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/views/RoomView.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/views/RoomView.java
new file mode 100644
index 0000000..2eae2ac
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/ui/views/RoomView.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Daisuke SATO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.ui.views;
+
+import org.eclipse.actf.visualization.IVisualizationView;
+import org.eclipse.actf.visualization.VisualizationStatusLineContributionItem;
+import org.eclipse.actf.visualization.presentation.ui.internal.PartControlRoom;
+import org.eclipse.actf.visualization.presentation.util.ParamRoom;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableLabelProviderLV;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableSorterLV;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+
+public class RoomView extends ViewPart implements IVisualizationView {
+
+ public static final String ID = RoomView.class.getName();
+
+ public static final int ROOM_SMALL = ParamRoom.ROOM_SMALL;
+
+ public static final int ROOM_LARGE = ParamRoom.ROOM_MIDDLE;
+
+ public static final int ROOM_AUDITORIUM = ParamRoom.ROOM_LARGE;
+
+ private IBaseLabelProvider baseLabelProvider = new ResultTableLabelProviderLV();
+
+ private ViewerSorter viewerSorter = new ResultTableSorterLV();
+
+ private PartControlRoom partRightRoom;
+
+ public RoomView() {
+ super();
+ }
+
+ public void init(IViewSite site) throws PartInitException {
+ setSite(site);
+ setStatusLine();
+ }
+
+ public void createPartControl(Composite parent) {
+ partRightRoom = new PartControlRoom(this, parent);
+ }
+
+ public void setFocus() {
+ }
+
+ public void setStatusMessage(String statusMessage) {
+ IContributionItem[] items = getViewSite().getActionBars()
+ .getStatusLineManager().getItems();
+ for (int i = 0; i < items.length; i++) {
+ if (null != items[i]
+ && items[i].getId().equals(
+ VisualizationStatusLineContributionItem.ID + ID)) {
+ ((VisualizationStatusLineContributionItem) items[i])
+ .setStatusMessage(statusMessage);
+ }
+ }
+ }
+
+ public void setInfoMessage(String infoMessage) {
+ IContributionItem[] items = getViewSite().getActionBars()
+ .getStatusLineManager().getItems();
+ for (int i = 0; i < items.length; i++) {
+ if (null != items[i]
+ && items[i].getId().equals(
+ VisualizationStatusLineContributionItem.ID + ID)) {
+ ((VisualizationStatusLineContributionItem) items[i])
+ .setInfoMessage(infoMessage);
+ }
+ }
+ }
+
+ private void setStatusLine() {
+ getViewSite().getActionBars().getStatusLineManager().add(
+ new VisualizationStatusLineContributionItem(ID));
+ }
+
+ public IBaseLabelProvider getLabelProvider() {
+ return baseLabelProvider;
+ }
+
+ public ViewerSorter getTableSorter() {
+ return viewerSorter;
+ }
+
+ public int getResultTableMode() {
+ return MODE_LOWVISION;
+ }
+
+ public void doVisualize() {
+ partRightRoom.doSimulate();
+ }
+
+ public void setVisualizeMode(int mode) {
+ if (mode == ROOM_AUDITORIUM || mode == ROOM_LARGE || mode == ROOM_SMALL) {
+ partRightRoom.getParamLowVision().setType(mode);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/ParamRoom.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/ParamRoom.java
new file mode 100644
index 0000000..b6517b0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/ParamRoom.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Daisuke SATO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.util;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.actf.visualization.engines.lowvision.LowVisionException;
+import org.eclipse.actf.visualization.engines.lowvision.LowVisionType;
+
+
+
+
+public class ParamRoom {
+ public static final int ROOM_SMALL = 0;
+
+ public static final int ROOM_MIDDLE = 1;
+
+ public static final int ROOM_LARGE = 2;
+
+ private int type = ROOM_SMALL;
+
+ private int height;
+
+ public ParamRoom() {
+ }
+
+ public LowVisionType getLowVisionType() {
+ LowVisionType result = null;
+ switch (type) {
+ case ROOM_SMALL:
+ result = RoomTypeCollection.getSmallType();
+ break;
+ case ROOM_MIDDLE:
+ result = RoomTypeCollection.getMiddleType();
+ break;
+ case ROOM_LARGE:
+ result = RoomTypeCollection.getLargeType();
+ break;
+ }
+ if(result != null)
+ result.setDisplayResolution(height);
+ try {
+ result.setEyesightDegree(1.0f);
+ } catch (LowVisionException e) {
+ e.printStackTrace();
+ }
+
+ DebugPrintUtil.devOrDebugPrintln(result.getEyesightPixel());
+ return result;
+ }
+
+ public void setType(int type){
+ this.type = type;
+ }
+ public int getType(){
+ return this.type;
+ }
+
+ public void setDisplayResolution(int height) {
+ this.height = height;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/RoomTypeCollection.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/RoomTypeCollection.java
new file mode 100644
index 0000000..9b8d76e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/RoomTypeCollection.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Daisuke SATO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.util;
+
+import java.awt.Toolkit;
+
+import org.eclipse.actf.visualization.engines.lowvision.LowVisionType;
+
+
+public class RoomTypeCollection {
+ private static LowVisionType smallMeetingRoom = null;
+
+ private static LowVisionType largeMeetingRoom = null;
+
+ private static LowVisionType auditorium = null;
+
+ public static final int DEFAULT_RESOLUTION_WIDTH = Toolkit.getDefaultToolkit().getScreenSize().width / 2;
+
+ public static final int DEFAULT_RESOLUTION_HEIGHT = Toolkit.getDefaultToolkit().getScreenSize().height / 2;
+
+ public static LowVisionType getSmallType() {
+ smallMeetingRoom = new LowVisionType();
+ smallMeetingRoom.setEyesight(true);
+ smallMeetingRoom.setDisplayHeight(100);
+ smallMeetingRoom.setEyeDisplayDistance(300);
+ smallMeetingRoom.setDisplayResolution(DEFAULT_RESOLUTION_HEIGHT);
+ smallMeetingRoom.setCVD(false);
+ smallMeetingRoom.setColorFilter(false);
+ smallMeetingRoom.setGlare(false);
+ try {
+ smallMeetingRoom.setEyesightDegree(1.0f);
+ } catch (Exception e) {
+
+ }
+ return smallMeetingRoom;
+ }
+
+ public static LowVisionType getMiddleType() {
+ largeMeetingRoom = new LowVisionType();
+ largeMeetingRoom.setEyesight(true);
+ largeMeetingRoom.setDisplayHeight(150);
+ largeMeetingRoom.setEyeDisplayDistance(1200);
+ largeMeetingRoom.setDisplayResolution(DEFAULT_RESOLUTION_HEIGHT);
+ largeMeetingRoom.setCVD(false);
+ largeMeetingRoom.setColorFilter(false);
+ largeMeetingRoom.setGlare(false);
+ try {
+ largeMeetingRoom.setEyesightDegree(1.0f);
+ } catch (Exception e) {
+
+ }
+
+ return largeMeetingRoom;
+ }
+
+ public static LowVisionType getLargeType() {
+ auditorium = new LowVisionType();
+ auditorium.setEyesight(true);
+ auditorium.setDisplayHeight(300);
+ auditorium.setEyeDisplayDistance(3000);
+ auditorium.setDisplayResolution(DEFAULT_RESOLUTION_HEIGHT);
+ auditorium.setCVD(false);
+ auditorium.setColorFilter(false);
+ auditorium.setGlare(false);
+ try {
+ auditorium.setEyesightDegree(1.0f);
+ } catch (Exception e) {
+
+ }
+
+ return auditorium;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/SimulateRoom.java b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/SimulateRoom.java
new file mode 100644
index 0000000..edac834
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.presentation/src/org/eclipse/actf/visualization/presentation/util/SimulateRoom.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.presentation.util;
+
+import org.eclipse.actf.visualization.engines.lowvision.image.ImageException;
+import org.eclipse.actf.visualization.engines.lowvision.image.Int2D;
+import org.eclipse.actf.visualization.engines.lowvision.image.PageImage;
+import org.eclipse.actf.visualization.engines.lowvision.image.SimulatedPageImage;
+import org.eclipse.actf.visualization.engines.lowvision.io.ImageDumpUtil;
+import org.eclipse.actf.visualization.engines.lowvision.io.LowVisionIOException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.widgets.Display;
+
+
+
+public class SimulateRoom {
+
+
+ public static synchronized Int2D getSimulatedInt2D(PageImage target, ParamRoom currentSetting) {
+
+ Int2D result = new Int2D(0, 0);
+
+ try {
+ SimulatedPageImage simulatedPageImage;
+ simulatedPageImage = new SimulatedPageImage(target, currentSetting.getLowVisionType());
+ result = simulatedPageImage.getInt2D();
+ } catch (ImageException ie) {
+ ie.printStackTrace();
+ }
+
+ return result;
+ }
+
+ public static synchronized ImageData[] doSimulate(PageImage target, ParamRoom currentSetting, String fileName) {
+
+ ImageData[] imageDataArray = new ImageData[0];
+
+ // TODO use memory
+ try {
+ Int2D int2d_sim = getSimulatedInt2D(target, currentSetting);
+ if (ImageDumpUtil.isLV16BIT()) {
+ int2d_sim.writeToBMPFile(fileName, 16);
+ } else {
+ int2d_sim.writeToBMPFile(fileName);
+ }
+ ImageLoader loaderAfterSimulate = new ImageLoader();
+ imageDataArray = loaderAfterSimulate.load(fileName);
+ } catch (LowVisionIOException lvioe) {
+ lvioe.printStackTrace();
+ }
+
+ return imageDataArray;
+ }
+
+ public static synchronized Image doSimulate(PageImage target, ParamRoom currentSetting, Display display, String fileS) {
+
+ Image image = null;
+
+ try {
+ SimulatedPageImage simulatedPageImage;
+ simulatedPageImage = new SimulatedPageImage(target, currentSetting.getLowVisionType());
+ Int2D int2d_sim = simulatedPageImage.getInt2D();
+
+ // TODO use memory
+
+ if (ImageDumpUtil.isLV16BIT()) {
+ int2d_sim.writeToBMPFile(fileS, 16);
+ } else {
+ int2d_sim.writeToBMPFile(fileS);
+ }
+
+ image = new Image(display, fileS);
+
+ } catch (ImageException ie) {
+ ie.printStackTrace();
+ } catch (LowVisionIOException lvioe) {
+ lvioe.printStackTrace();
+ }
+
+ return image;
+ }
+
+ public static PageImage getPageImage(String fileName, boolean withoutFrame) {
+
+ PageImage pageImage = null;
+
+ try {
+ Int2D int2d = Int2D.readFromBMPFile(fileName);
+ pageImage = new PageImage(int2d, withoutFrame);
+ } catch (LowVisionIOException lvioe) {
+ lvioe.printStackTrace();
+ }
+
+ return pageImage;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/.classpath b/plugins/org.eclipse.actf.visualization.ui.report/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/.cvsignore b/plugins/org.eclipse.actf.visualization.ui.report/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/.project b/plugins/org.eclipse.actf.visualization.ui.report/.project
new file mode 100644
index 0000000..d01d32f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.actf.visualization.ui.report</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.ui.report/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..559162c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse ACTF Visualization Report Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.actf.visualization.ui.report;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.eclipse.actf.visualization.ui.report.ReportPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.actf.common,
+ org.eclipse.actf.visualization.eval
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.actf.visualization.ui.report,
+ org.eclipse.actf.visualization.ui.report.table,
+ org.eclipse.actf.visualization.ui.report.views
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/about.html b/plugins/org.eclipse.actf.visualization.ui.report/about.html
new file mode 100644
index 0000000..481dbcf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/about.html
@@ -0,0 +1,25 @@
+<!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 5, 2006</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/org/documents/epl-v10.php">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>
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/build.properties b/plugins/org.eclipse.actf.visualization.ui.report/build.properties
new file mode 100644
index 0000000..d87a522
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/build.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ about.html,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ plugin_ja.properties,\
+ icons/
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/icons/IconBlue.gif b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconBlue.gif
new file mode 100644
index 0000000..3f7f67d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconBlue.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/icons/IconGreen.gif b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconGreen.gif
new file mode 100644
index 0000000..a211814
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconGreen.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/icons/IconPink.gif b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconPink.gif
new file mode 100644
index 0000000..f6cfa09
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconPink.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/icons/IconRed.gif b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconRed.gif
new file mode 100644
index 0000000..fa1c9e8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconRed.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/icons/IconYellow.gif b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconYellow.gif
new file mode 100644
index 0000000..2917cb8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/icons/IconYellow.gif
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/icons/excla_squ.png b/plugins/org.eclipse.actf.visualization.ui.report/icons/excla_squ.png
new file mode 100644
index 0000000..b8983c5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/icons/excla_squ.png
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/plugin.properties b/plugins/org.eclipse.actf.visualization.ui.report/plugin.properties
new file mode 100644
index 0000000..d875a70
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+summary.view.title=Summary report
+detailed.view.title=Detailed report
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/plugin.xml b/plugins/org.eclipse.actf.visualization.ui.report/plugin.xml
new file mode 100644
index 0000000..f1d11fa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/plugin.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ class="org.eclipse.actf.visualization.ui.report.views.DetailedReportView"
+ id="org.eclipse.actf.visualization.ui.report.views.DetailedReportView"
+ name="%detailed.view.title"/>
+ <view
+ class="org.eclipse.actf.visualization.ui.report.views.SummaryReportView"
+ id="org.eclipse.actf.visualization.ui.report.views.SummaryReportView"
+ name="%summary.view.title"/>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/plugin_ja.properties b/plugins/org.eclipse.actf.visualization.ui.report/plugin_ja.properties
new file mode 100644
index 0000000..58cbb94
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/plugin_ja.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+summary.view.title=\u6982\u8981\u30ec\u30dd\u30fc\u30c8
+detailed.view.title=\u8a73\u7d30\u30ec\u30dd\u30fc\u30c8
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/DetailProblemReportArea.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/DetailProblemReportArea.java
new file mode 100644
index 0000000..bace9b9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/DetailProblemReportArea.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.events.IModelServiceEventListener;
+import org.eclipse.actf.visualization.events.IVisualizationEventListener;
+import org.eclipse.actf.visualization.events.VisualizationEvent;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+public class DetailProblemReportArea extends SashForm implements IVisualizationEventListener, IModelServiceEventListener {
+
+ private ProblemTree _problemTree;
+ private ResultTableViewer resultTableViewer;
+
+ public DetailProblemReportArea(Composite parent, int style) {
+ super(parent, style);
+ init();
+ }
+
+ private void init(){
+ setOrientation(SWT.HORIZONTAL);
+
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
+ gridData.horizontalSpan = 1;
+ setLayoutData(gridData);
+
+ this._problemTree = new ProblemTree(this);
+ resultTableViewer = new ResultTableViewer(this);
+
+ this._problemTree.setResultTableViewer(resultTableViewer);
+
+ setWeights(new int[] { 2, 9 });
+
+ }
+
+ public void visualizerChanged(VisualizationEvent checkerEvent) {
+ this._problemTree.visualizerChanged(checkerEvent);
+ }
+
+ public ProblemTree getProblemTree() {
+ return _problemTree;
+ }
+
+ public void modelserviceChanged(IModelService modelService) {
+ resultTableViewer.modelserviceChanged(modelService);
+ }
+
+ public void inputChanged(IModelService modelService) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ProblemTree.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ProblemTree.java
new file mode 100644
index 0000000..4810f03
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ProblemTree.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.actf.util.ui.PlatformUIUtil;
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.eval.IEvaluationItem;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.ProblemConst;
+import org.eclipse.actf.visualization.events.IVisualizationEventListener;
+import org.eclipse.actf.visualization.events.VisualizationEvent;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableFilter;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.ISharedImages;
+
+
+
+public class ProblemTree implements IVisualizationEventListener {
+
+ private Tree tree;
+
+ private TreeItem nodeRoot;
+
+ private TreeItem node1_1;
+
+ private TreeItem node1_2;
+
+ private TreeItem node1_3;
+
+ private ResultTableViewer _resultTableViewer = null;
+
+ public ProblemTree(Composite parent) {
+
+ tree = new Tree(parent, SWT.MULTI | SWT.BORDER);
+
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessVerticalSpace = true;
+ tree.setLayoutData(gridData);
+
+ createTreeNodes();
+
+ tree.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent arg0) {
+ if (null != _resultTableViewer) {
+ TreeItem[] targets = tree.getSelection();
+ if (targets != null) {
+ int result = 0;
+ for (int i = 0; i < targets.length; i++) {
+ TreeItem item = targets[i];
+ if (item == nodeRoot) {
+ _resultTableViewer.changeFilterType(ResultTableFilter.ALL);
+ return;
+ } else if (item == node1_1) {
+ result = result | IEvaluationItem.SEV_ERROR;
+ } else if (item == node1_2) {
+ result = result | IEvaluationItem.SEV_WARNING;
+ } else if (item == node1_3) {
+ result = result | IEvaluationItem.SEV_INFO;
+ }
+ }
+ _resultTableViewer.changeFilterType(result);
+ return;
+ }
+ _resultTableViewer.changeFilterType(ResultTableFilter.ALL);
+ }
+ }
+ });
+ }
+
+ public void createTreeNodes() {
+ tree.removeAll();
+
+ nodeRoot = new TreeItem(tree, SWT.NULL);
+ nodeRoot.setImage(PlatformUIUtil
+ .getSharedImageDescriptor(ISharedImages.IMG_OBJ_FOLDER).createImage());
+
+ node1_1 = new TreeItem(nodeRoot, SWT.NULL);
+ node1_1.setImage(EvaluationPlugin.getImageDescriptor("icons/Err.png").createImage());
+
+ node1_2 = new TreeItem(nodeRoot, SWT.NULL);
+ node1_2.setImage(EvaluationPlugin.getImageDescriptor("icons/Warn.png").createImage());
+
+ node1_3 = new TreeItem(nodeRoot, SWT.NULL);
+ node1_3.setImage(EvaluationPlugin.getImageDescriptor("icons/Info.png").createImage());
+
+ nodeRoot.setExpanded(true);
+
+ clearTreeNodeAmount();
+ }
+
+ public Tree getTree() {
+ return tree;
+ }
+
+ public void setRootSel() {
+ tree.setSelection(new TreeItem[] { nodeRoot });
+ }
+
+ public void clearTreeNodeAmount() {
+ changeTreeNodeAmount(new ArrayList());
+ tree.getDisplay().update();
+ }
+
+ public void changeTreeNodeAmount(List targetList) {
+
+ int error = 0;
+ int user = 0;
+ int info = 0;
+
+ // TODO lv
+ for (Iterator i = targetList.iterator(); i.hasNext();) {
+ try {
+ switch (((IProblemItem) i.next()).getSeverity()) {
+ case IProblemItem.SEV_ERROR:
+ error++;
+ break;
+ case IProblemItem.SEV_WARNING:
+ user++;
+ break;
+ case IProblemItem.SEV_INFO:
+ info++;
+ break;
+ }
+ } catch (Exception e) {
+
+ }
+ }
+
+ int all = error + user + info;
+
+ nodeRoot.setText(ProblemConst.ALL_ERRORS + " (" + all + ")");
+ node1_1.setText(ProblemConst.ESSENTIAL + " (" + error + ")");
+ node1_2.setText(ProblemConst.USER_CHECK + " (" + user + ")");
+ node1_3.setText(ProblemConst.INFO + " (" + info + ")");
+
+ }
+
+ public void setResultTableViewer(ResultTableViewer resultTableViewer) {
+ this._resultTableViewer = resultTableViewer;
+ }
+
+ public ResultTableViewer getResultTableViewer() {
+ return this._resultTableViewer;
+ }
+
+ public void visualizerChanged(VisualizationEvent checkerEvent) {
+
+ _resultTableViewer.visualizerChanged(checkerEvent);
+ changeTreeNodeAmount(checkerEvent.getEvaluationResult().getProblemList());
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ReportDisplay.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ReportDisplay.java
new file mode 100644
index 0000000..480f8bd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ReportDisplay.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report;
+
+import java.io.File;
+
+import org.eclipse.actf.util.DebugPrintUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.OleAutomation;
+import org.eclipse.swt.ole.win32.OleControlSite;
+import org.eclipse.swt.ole.win32.OleFrame;
+import org.eclipse.swt.ole.win32.Variant;
+import org.eclipse.swt.widgets.Composite;
+
+public class ReportDisplay {
+
+ //old implementation
+
+ private final static String WEBBROWSER_CONTROL_NAME = "Shell.Explorer"; //$NON-NLS-1$
+ private final static String NAVIGATE_METHOD_NAME = "Navigate"; //$NON-NLS-1$
+ private final static String URL_PARAM_NAME = "URL"; //$NON-NLS-1$
+
+
+ private OleFrame webFrame;
+ private OleControlSite webControlSite;
+ private OleAutomation oleAutomation;
+ private int dispIdMember;
+ int[] rgdispidNamedArgs = new int[1];
+
+
+ public void disposeOleBrowser() {
+ if (oleAutomation != null) {
+ oleAutomation.dispose();
+ oleAutomation = null;
+ }
+ }
+
+ public ReportDisplay(Composite _compositeParent) {
+
+ Composite compositeRecommendationHalf = new Composite(_compositeParent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ gridLayout.verticalSpacing = 0;
+ gridLayout.horizontalSpacing = 0;
+ compositeRecommendationHalf.setLayout(gridLayout);
+
+ webFrame = new OleFrame(compositeRecommendationHalf, SWT.NONE);
+ webControlSite = new OleControlSite(webFrame, SWT.NONE, WEBBROWSER_CONTROL_NAME);
+ oleAutomation = new OleAutomation(webControlSite);
+
+ // activate OLE
+ if (!(webControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE) == OLE.S_OK)) {
+ DebugPrintUtil.devOrDebugPrintln("ole init failure");
+ }
+
+ if (oleAutomation != null) {
+ int[] rgdispid = oleAutomation.getIDsOfNames(new String[] { NAVIGATE_METHOD_NAME, URL_PARAM_NAME });
+ dispIdMember = rgdispid[0];
+ int[] rgdispidNamedArgs = new int[1];
+ rgdispidNamedArgs[0] = rgdispid[1];
+ }
+
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessVerticalSpace = true;
+ webFrame.setLayoutData(gridData);
+
+ displayReportFile("");
+ }
+
+ public void displayReportFile(String url) {
+ File targetFile = new File(url);
+ if (!targetFile.exists()) {
+ url = "about:blank";
+ }
+ if (oleAutomation != null) {
+ Variant[] rgvarg = new Variant[1];
+ rgvarg[0] = new Variant(url);
+ //Variant pVarResult =
+ oleAutomation.invoke(dispIdMember, rgvarg, rgdispidNamedArgs);
+ }
+ }
+
+ public OleControlSite getOleControleSite() {
+ return webControlSite;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ReportPlugin.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ReportPlugin.java
new file mode 100644
index 0000000..0452dc0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/ReportPlugin.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class ReportPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.actf.visualization.ui.report";
+
+ // The shared instance
+ private static ReportPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public ReportPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static ReportPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/SummaryProblemReportArea.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/SummaryProblemReportArea.java
new file mode 100644
index 0000000..805699c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/SummaryProblemReportArea.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report;
+
+import org.eclipse.actf.visualization.eval.IEvaluationResult;
+import org.eclipse.actf.visualization.events.IVisualizationEventListener;
+import org.eclipse.actf.visualization.events.VisualizationEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.LineStyleListener;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+
+
+
+public class SummaryProblemReportArea extends SashForm implements IVisualizationEventListener {
+
+ private StyledText _summaryReportText;
+
+ private ReportDisplay _reportDisplay;
+
+ private LineStyleListener currentStyle;
+
+ public SummaryProblemReportArea(Composite parent, int style) {
+ super(parent, style);
+ init();
+ }
+
+ public void init() {
+ setOrientation(SWT.HORIZONTAL);
+
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
+ gridData.horizontalSpan = 1;
+ setLayoutData(gridData);
+
+ this._summaryReportText = new StyledText(this, SWT.BORDER | SWT.V_SCROLL);
+ this._summaryReportText.setEditable(false);
+ this._summaryReportText.setWordWrap(true);
+
+ this._reportDisplay = new ReportDisplay(this);
+ setWeights(new int[] { 2, 1 });
+
+ }
+
+
+ public void visualizerChanged(VisualizationEvent checkerEvent) {
+ IEvaluationResult result = checkerEvent.getEvaluationResult();
+ if(currentStyle!=null){
+ _summaryReportText.removeLineStyleListener(currentStyle);
+ }
+ currentStyle = result.getLineStyleListener();
+ this._summaryReportText.addLineStyleListener(currentStyle);
+ this._summaryReportText.setText(result.getSummaryReportText());
+ this._reportDisplay.displayReportFile(result.getSummaryReportUrl());
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/Messages.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/Messages.java
new file mode 100644
index 0000000..2a81993
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/Messages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.ui.report.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "org.eclipse.actf.visualization.ui.report.internal.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/messages.properties b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/messages.properties
new file mode 100644
index 0000000..c65ea21
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/messages.properties
@@ -0,0 +1,32 @@
+###############################################################################
+# Copyright (c) 2003, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#
+ProblemTable.5 = View Source HTML
+ProblemTable.6 = View Problem Description
+ProblemTable.Clear_Selection_15 = Clear Selection
+ProblemTable.View_Guideline_16 = View Guideline
+
+DialogTextSearch.0 = Search
+DialogTextSearch.1 = The string to be searched:
+DialogTextSearch.3 = Case sens&itive
+DialogTextSearch.4 = Search direction
+DialogTextSearch.5 = &Up
+DialogTextSearch.6 = &Down
+DialogTextSearch.7 = &Find next
+DialogTextSearch.8 = The text is not found, Do you want to search from beginning?
+DialogTextSearch.10 = The text is not found, Do you want to search from end?
+DialogTextSearch.12 = The text is not found.
+
+SrcViewer.3 = Line:
+SrcViewer.6 = Column:
+SrcViewer.8 = &Search
+SrcViewer.9 = &Copy
+SrcViewer.0 = file can't read:
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/messages_ja.properties b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/messages_ja.properties
new file mode 100644
index 0000000..4248a04
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/internal/messages_ja.properties
@@ -0,0 +1,32 @@
+###############################################################################
+# Copyright (c) 2003, 2008 IBM Corporation and others.
+# 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#
+ProblemTable.5 = \u30bd\u30fc\u30b9HTML\u3092\u898b\u308b
+ProblemTable.6 = \u30a8\u30e9\u30fc\u306e\u5185\u5bb9\u3092\u898b\u308b
+ProblemTable.Clear_Selection_15 = \u9078\u629e\u306e\u89e3\u9664
+ProblemTable.View_Guideline_16 = \u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3092\u898b\u308b
+
+DialogTextSearch.0 = \u691c\u7d22
+DialogTextSearch.1 = \u691c\u7d22\u3059\u308b\u6587\u5b57\u5217:
+DialogTextSearch.3 = \u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u3092\u533a\u5225\t(&I)
+DialogTextSearch.4 = \u691c\u7d22\u65b9\u5411
+DialogTextSearch.5 = \u4e0a\u3078\t(&U)
+DialogTextSearch.6 = \u4e0b\u3078 (&D)
+DialogTextSearch.7 = \u6b21\u3092\u691c\u7d22\t(&F)
+DialogTextSearch.8 = \u691c\u7d22\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\uff0e\u6587\u7ae0\u306e\u5148\u982d\u304b\u3089\u518d\u5ea6\u691c\u7d22\u3057\u307e\u3059\u304b\uff1f
+DialogTextSearch.10 = \u691c\u7d22\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\uff0e\u6587\u7ae0\u306e\u6700\u5f8c\u5c3e\u304b\u3089\u518d\u5ea6\u691c\u7d22\u3057\u307e\u3059\u304b\uff1f
+DialogTextSearch.12 = \u691c\u7d22\u6587\u5b57\u5217\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\uff0e
+
+SrcViewer.3 = \u884c:
+SrcViewer.6 = \u6587\u5b57:
+SrcViewer.8 = \u691c\u7d22\t(&S)
+SrcViewer.9 = \u30b3\u30d4\u30fc\t(&C)
+SrcViewer.0 = \u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093:
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/srcviewer/DialogTextSearch.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/srcviewer/DialogTextSearch.java
new file mode 100644
index 0000000..49208d8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/srcviewer/DialogTextSearch.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.srcviewer;
+
+import org.eclipse.actf.util.ui.IDialogConstants;
+import org.eclipse.actf.visualization.ui.report.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class DialogTextSearch {
+ private Shell shell;
+
+ private SrcViewer viewer;
+
+ private StyledText styledText;
+
+ private Button searchButton;
+
+ //TODO replace
+
+ public DialogTextSearch(Shell _shell, SrcViewer _viewer) {
+ shell = _shell;
+ shell.setText(Messages.getString("DialogTextSearch.0")); //$NON-NLS-1$
+ viewer = _viewer;
+ styledText = viewer.getStyledText();
+ createSettingControls();
+ }
+
+ private void createSettingControls() {
+ Composite composite = new Composite(shell, SWT.NULL);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+
+ Composite leftComp = new Composite(composite, SWT.NULL);
+ leftComp.setLayout(new GridLayout());
+
+ Composite strComp = new Composite(leftComp, SWT.NULL);
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ strComp.setLayout(gridLayout);
+ strComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Label label = new Label(strComp, SWT.NONE);
+ label.setText(Messages.getString("DialogTextSearch.1")); //$NON-NLS-1$
+
+ final Text text = new Text(strComp, SWT.BORDER);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.widthHint = 250;
+ text.setLayoutData(gridData);
+ text.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent arg0) {
+ if (text.getText().equals("")) { //$NON-NLS-1$
+ searchButton.setEnabled(false);
+ } else {
+ searchButton.setEnabled(true);
+ }
+
+ }
+ });
+
+ Composite optionComp = new Composite(leftComp, SWT.NULL);
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ optionComp.setLayout(gridLayout);
+
+ final Button disLetterSize = new Button(optionComp, SWT.CHECK);
+ disLetterSize.setText(Messages.getString("DialogTextSearch.3")); //$NON-NLS-1$
+
+ Group group = new Group(optionComp, SWT.NONE);
+ group.setText(Messages.getString("DialogTextSearch.4")); //$NON-NLS-1$
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ group.setLayout(gridLayout);
+
+ Button upButton = new Button(group, SWT.RADIO);
+ upButton.setText(Messages.getString("DialogTextSearch.5")); //$NON-NLS-1$
+ final Button downButton = new Button(group, SWT.RADIO);
+ downButton.setText(Messages.getString("DialogTextSearch.6")); //$NON-NLS-1$
+ downButton.setSelection(true);
+
+ Composite rightComp = new Composite(composite, SWT.NULL);
+ rightComp.setLayout(new GridLayout());
+ rightComp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+
+ searchButton = new Button(rightComp, SWT.PUSH);
+ searchButton.setText(Messages.getString("DialogTextSearch.7")); //$NON-NLS-1$
+ searchButton.setEnabled(false);
+ gridData = new GridData();
+ gridData.widthHint = 100;
+ searchButton.setLayoutData(gridData);
+ shell.setDefaultButton(searchButton);
+ searchButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ String str = text.getText();
+ int pos;
+ String wholeText = styledText.getText();
+ int findedPos;
+ if (downButton.getSelection()) {
+ pos = styledText.getSelectionRange().x + styledText.getSelectionRange().y;
+ if (disLetterSize.getSelection()) {
+ findedPos = wholeText.indexOf(str, pos);
+ if (findedPos == -1 && pos > 0) {
+ if (SWT.CANCEL == popupMessage(Messages.getString("DialogTextSearch.8"), //$NON-NLS-1$
+ SWT.OK | SWT.CANCEL)) {
+ return;
+ }
+ findedPos = wholeText.indexOf(str, 0);
+ }
+ } else {
+ findedPos = wholeText.toLowerCase().indexOf(str.toLowerCase(), pos);
+ if (findedPos == -1 && pos > 0) {
+ if (SWT.CANCEL == popupMessage(Messages.getString("DialogTextSearch.8"), //$NON-NLS-1$
+ SWT.OK | SWT.CANCEL)) {
+ return;
+ }
+ findedPos = wholeText.toLowerCase().indexOf(str.toLowerCase(), 0);
+ }
+ }
+
+ } else {
+ pos = styledText.getSelectionRange().x;
+ if (disLetterSize.getSelection()) {
+ findedPos = wholeText.lastIndexOf(str, pos - 1);
+ if (findedPos == -1 && pos < wholeText.length()) {
+ if (SWT.CANCEL == popupMessage(Messages.getString("DialogTextSearch.10"), //$NON-NLS-1$
+ SWT.OK | SWT.CANCEL)) {
+ return;
+ }
+ findedPos = wholeText.lastIndexOf(str, wholeText.length());
+ }
+ } else {
+ findedPos = wholeText.toLowerCase().lastIndexOf(str.toLowerCase(), pos - 1);
+ if (findedPos == -1 && pos < wholeText.length()) {
+ if (SWT.CANCEL == popupMessage(Messages.getString("DialogTextSearch.10"), //$NON-NLS-1$
+ SWT.OK | SWT.CANCEL)) {
+ return;
+ }
+ findedPos = wholeText.toLowerCase().lastIndexOf(str.toLowerCase(), wholeText.length());
+ }
+ }
+ }
+
+ if (findedPos == -1) {
+ popupMessage(Messages.getString("DialogTextSearch.12"), SWT.OK); //$NON-NLS-1$
+ } else {
+ viewer.selectByOffset(findedPos, str.length());
+ }
+
+ }
+ });
+
+ Button cancelButton = new Button(rightComp, SWT.PUSH);
+ cancelButton.setText(IDialogConstants.CANCEL);
+ gridData = new GridData();
+ gridData.widthHint = 100;
+ cancelButton.setLayoutData(gridData);
+ cancelButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ shell.close();
+ }
+ });
+ }
+
+ private int popupMessage(String msg, int option) {
+ MessageBox msgBox = new MessageBox(shell, option);
+ msgBox.setMessage(msg);
+ return msgBox.open();
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/srcviewer/SrcViewer.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/srcviewer/SrcViewer.java
new file mode 100644
index 0000000..0c917bf
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/srcviewer/SrcViewer.java
@@ -0,0 +1,570 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.srcviewer;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Vector;
+
+import org.eclipse.actf.util.JapaneseEncodingDetector;
+import org.eclipse.actf.visualization.Constants;
+import org.eclipse.actf.visualization.ui.report.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+
+public class SrcViewer {
+
+ private Composite parentCom;
+
+ private Display display;
+
+ private StyledText styledText, lineText;
+
+ private Text lineNo, columnNo;
+
+ int start, end;
+
+ Color hlFg, hlBg;
+
+ Vector<Integer> startV, lenV;
+ Vector<Color> fgV, bgV;
+
+ private static Shell searchDlgShell;
+
+ private String highLightedText = ""; //$NON-NLS-1$
+
+ private boolean highlighted = false;
+
+ private Button copyButton;
+
+ /**
+ *
+ */
+ public SrcViewer(Composite parent) {
+
+ //TODO very old implimentation, use JFace SourceViewer
+
+ parentCom = parent;
+ display = parent.getDisplay();
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ composite.setLayout(gridLayout);
+
+
+ Composite composite2 = new Composite(composite, SWT.NONE);
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 6;
+ gridLayout.marginHeight = gridLayout.marginWidth = 0;
+ gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
+ composite2.setLayout(gridLayout);
+
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ composite2.setLayoutData(gridData);
+
+ Label label = new Label(composite2, SWT.NONE);
+ label.setText(Messages.getString("SrcViewer.3")); //$NON-NLS-1$
+ gridData = new GridData();
+ gridData.horizontalIndent = 5;
+ label.setLayoutData(gridData);
+
+ lineNo = new Text(composite2, SWT.BORDER | SWT.RIGHT);
+ gridData = new GridData();
+ gridData.widthHint = 70;
+ lineNo.setLayoutData(gridData);
+ lineNo.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent arg0) {
+ if (arg0.stateMask == SWT.CTRL && (arg0.keyCode == 'f' || arg0.keyCode == 'F')) {
+ openSearchDialog();
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0) {
+ if (arg0.stateMask != SWT.NONE) {
+ return;
+ }
+ try {
+ clearHighlight(false);
+ int line = Integer.parseInt(lineNo.getText());
+ int lineCnt = styledText.getLineCount();
+ if (line < 1) {
+ line = 1;
+ lineNo.setText(String.valueOf(line));
+ } else if (line > lineCnt) {
+ line = lineCnt;
+ lineNo.setText(String.valueOf(line));
+ }
+ columnNo.setText("0"); //$NON-NLS-1$
+ highlight(line, 0, line + 1, 0, false);
+
+ } catch (NumberFormatException e) {
+ lineNo.setText(""); //$NON-NLS-1$
+ }
+
+ }
+ });
+
+ label = new Label(composite2, SWT.NONE);
+ label.setText(Messages.getString("SrcViewer.6")); //$NON-NLS-1$
+ gridData = new GridData();
+ gridData.horizontalIndent = 10;
+ label.setLayoutData(gridData);
+
+ columnNo = new Text(composite2, SWT.BORDER | SWT.RIGHT);
+ gridData = new GridData();
+ gridData.widthHint = 70;
+ columnNo.setLayoutData(gridData);
+ columnNo.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent arg0) {
+ if (arg0.stateMask == SWT.CTRL && (arg0.keyCode == 'f' || arg0.keyCode == 'F')) {
+ openSearchDialog();
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0) {
+ if (arg0.stateMask != SWT.NONE) {
+ return;
+ }
+
+ try {
+ clearHighlight(false);
+ int line = Integer.parseInt(lineNo.getText());
+ int colCnt;
+ if (line < styledText.getLineCount()) {
+ colCnt = styledText.getOffsetAtLine(line) - styledText.getOffsetAtLine(line - 1) - 1;
+ } else {
+ colCnt = styledText.getCharCount() - styledText.getOffsetAtLine(line - 1);
+
+ }
+ int column = Integer.parseInt(columnNo.getText());
+ if (column < 0) {
+ column = 0;
+ columnNo.setText(String.valueOf(column));
+ } else if (column >= colCnt) {
+ column = colCnt;
+ columnNo.setText(String.valueOf(column));
+ }
+ highlight(line, column, line + 1, 0, false);
+
+ } catch (NumberFormatException e) {
+ columnNo.setText(""); //$NON-NLS-1$
+ }
+
+ }
+ });
+
+ Button searchButton = new Button(composite2, SWT.PUSH);
+ searchButton.setText(Messages.getString("SrcViewer.8")); //$NON-NLS-1$
+ gridData = new GridData();
+ gridData.horizontalIndent = 20;
+ searchButton.setLayoutData(gridData);
+ searchButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ openSearchDialog();
+ }
+ });
+
+ copyButton = new Button(composite2, SWT.PUSH);
+ copyButton.setText(Messages.getString("SrcViewer.9")); //$NON-NLS-1$
+ gridData = new GridData();
+ gridData.horizontalIndent = 10;
+ copyButton.setLayoutData(gridData);
+ copyButton.setEnabled(false);
+ copyButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ copyToClipBoard();
+ }
+ });
+
+ Composite composite3 = new Composite(composite, SWT.NONE);
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ composite3.setLayout(gridLayout);
+
+ gridData = new GridData(GridData.FILL_BOTH);
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessVerticalSpace = true;
+ composite3.setLayoutData(gridData);
+
+ lineText = new StyledText(composite3, SWT.NONE);
+ gridData = new GridData(GridData.VERTICAL_ALIGN_FILL);
+ gridData.widthHint = 32;
+ //gridData.horizontalAlignment=GridData.FILL;
+ gridData.grabExcessVerticalSpace = true;
+ lineText.setLayoutData(gridData);
+ lineText.setEditable(false);
+
+ styledText = new StyledText(composite3, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ gridData = new GridData(GridData.FILL_BOTH);
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessVerticalSpace = true;
+ styledText.setLayoutData(gridData);
+
+ styledText.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ getSelectionLineCol();
+ setCopyButton();
+ }
+ });
+
+ styledText.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent arg0) {
+ getSelectionLineCol();
+ }
+ });
+
+ styledText.setKeyBinding('C' | SWT.MOD1, SWT.NULL);
+ styledText.setKeyBinding('X' | SWT.MOD1, SWT.NULL);
+
+ styledText.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent arg0) {
+ if (arg0.keyCode == SWT.PAGE_DOWN || arg0.keyCode == SWT.PAGE_UP || arg0.keyCode == SWT.HOME
+ || arg0.keyCode == SWT.END || arg0.keyCode == SWT.ARROW_DOWN || arg0.keyCode == SWT.ARROW_UP
+ || arg0.keyCode == SWT.ARROW_LEFT || arg0.keyCode == SWT.ARROW_RIGHT) {
+ getSelectionLineCol();
+ setLineText();
+ } else if (arg0.stateMask == SWT.CTRL) {
+ if (arg0.keyCode == 'f' || arg0.keyCode == 'F') {
+ openSearchDialog();
+ } else if (arg0.keyCode == 'c' || arg0.keyCode == 'C') {
+ copyToClipBoard();
+ }
+ }
+ }
+ });
+
+ styledText.getVerticalBar().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ setLineText();
+ }
+ });
+
+ parentCom.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent arg0) {
+ if (arg0.stateMask == SWT.CTRL) {
+ if (arg0.keyCode == 'f' || arg0.keyCode == 'F') {
+ openSearchDialog();
+ } else if (arg0.keyCode == 'c' || arg0.keyCode == 'C') {
+ copyToClipBoard();
+ }
+ }
+ }
+ });
+
+ hlFg = styledText.getSelectionForeground();
+ hlBg = styledText.getSelectionBackground();
+
+ startV = new Vector<Integer>();
+ lenV = new Vector<Integer>();
+ fgV = new Vector<Color>();
+ bgV = new Vector<Color>();
+ }
+
+ private void setCopyButton() {
+ String selText = styledText.getSelectionText();
+ if (selText.equals("") && highLightedText.equals("") //$NON-NLS-1$ //$NON-NLS-2$
+ || !selText.equals("") && highlighted) { //$NON-NLS-1$
+ copyButton.setEnabled(false);
+ } else {
+ copyButton.setEnabled(true);
+ }
+ }
+
+ private void copyToClipBoard() {
+ if (!copyButton.getEnabled()) {
+ return;
+ }
+
+ String strText;
+ if (!highLightedText.equals("")) { //$NON-NLS-1$
+ strText = highLightedText;
+ } else {
+ strText = styledText.getSelectionText();
+ }
+
+ Clipboard clipboard = new Clipboard(display);
+ clipboard.setContents(new Object[] { strText }, new Transfer[] { TextTransfer.getInstance() });
+ }
+
+ private void openSearchDialog() {
+ if (searchDlgShell == null || searchDlgShell.isDisposed()) {
+ searchDlgShell = new Shell(parentCom.getShell(), SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
+ searchDlgShell.setSize(600, 170);
+ searchDlgShell.setLayout(new FillLayout());
+ new DialogTextSearch(searchDlgShell, this);
+ searchDlgShell.open();
+
+ } else {
+ searchDlgShell.forceActive();
+ }
+ }
+
+ private void setLineText() {
+ StringBuffer strBuf = new StringBuffer();
+ int len = lineText.getBounds().height / styledText.getLineHeight();
+ int top = styledText.getTopIndex();
+ for (int i = 0; i < len; i++) {
+ strBuf.append(String.valueOf(top + i + 1) + "\r\n"); //$NON-NLS-1$
+ }
+ lineText.setText(strBuf.toString());
+ styledText.setTopIndex(top);
+ }
+
+ public void setHighlightColor(Color hlFg, Color hlBg) {
+ this.hlFg = hlFg;
+ this.hlBg = hlBg;
+ }
+
+ public void getSelectionLineCol() {
+ int pos = styledText.getSelectionRange().x;
+ int line = styledText.getLineAtOffset(pos) + 1;// 1 base
+ lineNo.setText(new Integer(line).toString());
+ columnNo.setText(new Integer(pos - styledText.getOffsetAtLine(line - 1)).toString());
+
+ }
+
+ public void openFile(File target) {
+ styledText.setText(""); //$NON-NLS-1$
+ //TODO check
+ try {
+ String encoding = Constants.DEFAULT_ENCODING;
+
+ JapaneseEncodingDetector JED = null;
+
+ InputStreamReader isr = null;
+ InputStream is = new FileInputStream(target);
+ try {
+ JED = new JapaneseEncodingDetector(is);
+ encoding = JED.detect();
+ isr = new InputStreamReader(JED.getInputStream(), encoding);
+ } catch (Exception e2) {
+ //e2.printStackTrace();
+ }
+
+ BufferedReader br = null;
+ if (isr != null) {
+ br = new BufferedReader(isr);
+ } else {
+ br = new BufferedReader(new FileReader(target));
+ }
+ String line = new String();
+ try {
+ while ((line = br.readLine()) != null) {
+ styledText.append(line + "\n"); //$NON-NLS-1$
+ }
+ } catch (Exception e) {
+ try {
+ isr = new InputStreamReader(JED.getInputStream(), "MS932"); //$NON-NLS-1$
+ styledText.setText(""); //$NON-NLS-1$
+ br = new BufferedReader(isr);
+ while ((line = br.readLine()) != null) {
+ styledText.append(line + "\n"); //$NON-NLS-1$
+ }
+ } catch (Exception e2) {
+ styledText.setText(Messages.getString("SrcViewer.0") + target.getName()); //$NON-NLS-1$
+ }
+ }
+ is.close();
+ br.close();
+ isr.close();
+ } catch (Exception e) {
+ //e.printStackTrace();
+ }
+
+ setLineText();
+ initializeColor();
+ }
+
+ public void setText(String target) {
+ styledText.setText(target);
+ setLineText();
+ initializeColor();
+ }
+
+ private void initializeColor() {
+ startV.clear();
+ lenV.clear();
+ fgV.clear();
+ bgV.clear();
+
+ lineNo.setText(""); //$NON-NLS-1$
+ columnNo.setText(""); //$NON-NLS-1$
+ }
+
+ public void selectByOffset(int start, int len) {
+ clearHighlight();
+ styledText.setSelection(start, start + len);
+ getSelectionLineCol();
+ setLineText();
+ }
+
+ private void setStyleByOffset(int start, int len, Color fgcolor, Color bgcolor) {
+ StyleRange styleRange = new StyleRange();
+ styleRange.start = start;
+ styleRange.length = len;
+ styleRange.foreground = fgcolor;
+ styleRange.background = bgcolor;
+ styledText.setStyleRange(styleRange);
+ }
+
+ public void clearColor() {
+ styledText.setStyleRange(null);
+ initializeColor();
+ }
+
+ public void setColor(int startLine, int startPos, int endLine, int endPos, Color fgcolor, Color bgcolor) {
+ calculateStartEnd(startLine, startPos, endLine, endPos);
+ setStyleByOffset(start, end - start, fgcolor, bgcolor);
+ startV.add(new Integer(start));
+ lenV.add(new Integer(end - start));
+ fgV.add(fgcolor);
+ bgV.add(bgcolor);
+ }
+
+ public void clearHighlight() {
+ clearHighlight(true);
+ highlighted = false;
+ highLightedText = ""; //$NON-NLS-1$
+ setCopyButton();
+ }
+
+ private void clearHighlight(boolean bUpdate) {
+
+ styledText.setStyleRange(null);
+ for (int i = 0; i < startV.size(); i++) {
+ StyleRange styleRange = new StyleRange();
+ styleRange.start = ((Integer) startV.get(i)).intValue();
+ styleRange.length = ((Integer) lenV.get(i)).intValue();
+ styleRange.foreground = fgV.get(i);
+ styleRange.background = bgV.get(i);
+ styledText.setStyleRange(styleRange);
+ }
+
+ if (bUpdate) {
+ lineNo.setText(""); //$NON-NLS-1$
+ columnNo.setText(""); //$NON-NLS-1$
+ }
+
+ }
+
+ public void highlight(int startLine, int startPos, int endLine, int endPos) {
+ highlight(startLine, startPos, endLine, endPos, true);
+ }
+
+ private void highlight(int startLine, int startPos, int endLine, int endPos, boolean bUpdate) {
+ //Color oldFg=styledText.getSelectionForeground();
+ //Color oldBg=styledText.getSelectionBackground();
+
+ calculateStartEnd(startLine, startPos, endLine, endPos);
+
+ //styledText.setSelectionForeground(new Color(null, 255, 255, 255));
+ //styledText.setSelectionBackground(new Color(null, 0, 0, 0));
+
+ styledText.setSelection(styledText.getText().length());
+ styledText.setSelection(start);
+ setLineText();
+
+ //styledText.setSelectionRange(start, end - start);
+ setStyleByOffset(start, end - start, hlFg, hlBg);
+ if (end > start) {
+ if (highlighted) {
+ highLightedText = ""; //$NON-NLS-1$
+ } else {
+ highLightedText = styledText.getText(start, end);
+ highlighted = true;
+ }
+ setCopyButton();
+ }
+
+ //startV.add(new Integer(start));
+ //lenV.add(new Integer(end - start));
+
+ if (bUpdate) {
+ lineNo.setText(new Integer(startLine).toString());
+ columnNo.setText(new Integer(startPos).toString());
+ }
+ //styledText.setSelectionForeground(oldFg);
+ //styledText.setSelectionBackground(oldBg);
+ }
+
+ public void highlightLine(int line) {
+ highlightLines(line, line);
+ }
+
+ public void highlightLines(int start, int end) {
+ highlight(start, 0, end + 1, 0);
+ }
+
+ private void calculateStartEnd(int startLine, int startPos, int endLine, int endPos) {
+ if (startPos < 0) {
+ startPos = 0;
+ }
+ if (endPos < 0) {
+ endPos = 0;
+ }
+
+ try {
+ start = styledText.getOffsetAtLine(startLine - 1) + startPos;
+ } catch (Exception e) {
+ start = styledText.getCharCount();
+ }
+ try {
+ end = styledText.getOffsetAtLine(endLine - 1) + endPos;
+ } catch (Exception e1) {
+ end = styledText.getCharCount();
+ }
+ if (start > end) {
+ start = end;
+ }
+ }
+
+ public StyledText getStyledText() {
+ return styledText;
+ }
+
+ public void closeSearchDlgShell() {
+ if (searchDlgShell != null && !searchDlgShell.isDisposed()) {
+ searchDlgShell.dispose();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/IResultTableSorter.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/IResultTableSorter.java
new file mode 100644
index 0000000..b8d53e3
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/IResultTableSorter.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.ui.report.table;
+
+
+public interface IResultTableSorter {
+ public void setCurColumn(int curColumn);
+ public void reset();
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/MetricsLabelProvider.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/MetricsLabelProvider.java
new file mode 100644
index 0000000..1df325c
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/MetricsLabelProvider.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Shin SAITO - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class MetricsLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder.getInstance();
+
+ private int numMetrics;
+
+ public MetricsLabelProvider() {
+ super();
+ numMetrics = guidelineHolder.getMetricsNames().length;
+ }
+
+ public Image getColumnImage(Object arg0, int arg1) {
+ IProblemItem tmpItem = (IProblemItem) arg0;
+ if (arg1 >= 0 && arg1 < numMetrics) {
+ return (tmpItem.getEvaluationItem().getMetricsIcons()[arg1]);
+ }
+ return null;
+ }
+
+ public String getColumnText(Object arg0, int arg1) {
+ IProblemItem tmpItem = (IProblemItem) arg0;
+ if (arg1 >= 0 && arg1 < numMetrics) {
+ return (tmpItem.getEvaluationItem().getTableDataMetrics()[arg1]);
+ }
+ return "";
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableFilter.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableFilter.java
new file mode 100644
index 0000000..c7d27e4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableFilter.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+
+
+public class ResultTableFilter extends ViewerFilter {
+
+ public static final int ALL = Integer.MAX_VALUE;
+
+ private int severity = ALL;
+
+ /**
+ *
+ */
+ public ResultTableFilter() {
+ super();
+ }
+
+ public void setSeverity(int type) {
+ this.severity = type;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ public boolean select(Viewer arg0, Object arg1, Object arg2) {
+ try {
+ IProblemItem tmpItem = (IProblemItem) arg2;
+ if((severity&tmpItem.getSeverity())>0){
+ return true;
+ }
+ } catch (Exception e) {
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableLabelProvider.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableLabelProvider.java
new file mode 100644
index 0000000..9214046
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableLabelProvider.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.visualization.eval.EvaluationPlugin;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.ui.report.ReportPlugin;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class ResultTableLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder.getInstance();
+
+ private int metricsFinPos= guidelineHolder.getMetricsNames().length+1;
+ private int guidelineFinPos= metricsFinPos+guidelineHolder.getGuidelineData().length;
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ public Image getColumnImage(Object arg0, int arg1) {
+ IProblemItem tmpItem = (IProblemItem)arg0;
+ if(arg1==0){
+ if(tmpItem.isCanHighlight()){
+ return (ReportPlugin.imageDescriptorFromPlugin(EvaluationPlugin.PLUGIN_ID, "icons/star.gif").createImage());
+ }
+ }else if(arg1<metricsFinPos){
+ return(tmpItem.getEvaluationItem().getMetricsIcons()[arg1-1]);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ public String getColumnText(Object arg0, int arg1) {
+ IProblemItem tmpItem = (IProblemItem)arg0;
+
+ if(arg1==0){
+
+ }else if(arg1<metricsFinPos){
+ return (tmpItem.getEvaluationItem().getTableDataMetrics()[arg1-1]);
+ }else if(arg1<guidelineFinPos){
+ return (tmpItem.getEvaluationItem().getTableDataGuideline()[arg1-metricsFinPos]);
+ }else{
+ if(arg1-guidelineFinPos==0){
+ return(tmpItem.getLineStrMulti());
+ }else{
+ return(tmpItem.getDescription());
+ }
+ }
+
+
+ return "";
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableLabelProviderLV.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableLabelProviderLV.java
new file mode 100644
index 0000000..8ab0b6a
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableLabelProviderLV.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.ProblemItemLV;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class ResultTableLabelProviderLV extends LabelProvider implements ITableLabelProvider {
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder.getInstance();
+
+ private int guidelineFinPos;
+
+ /**
+ *
+ */
+ public ResultTableLabelProviderLV() {
+ super();
+ guidelineFinPos = 1 + guidelineHolder.getGuidelineData().length;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
+ * int)
+ */
+ public Image getColumnImage(Object arg0, int arg1) {
+ ProblemItemLV tmpItem = (ProblemItemLV) arg0;
+ if (arg1 == 0) {
+ return (tmpItem.getImageIcon());
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
+ * int)
+ */
+ public String getColumnText(Object arg0, int arg1) {
+ ProblemItemLV tmpItem = (ProblemItemLV) arg0;
+
+ //TODO
+ if (arg1 == 0) {
+ //
+ } else if (arg1 < guidelineFinPos) {
+ return(tmpItem.getEvaluationItem().getTableDataGuideline()[arg1-1]);
+ } else {
+ switch (arg1 - guidelineFinPos) {
+ case 0:
+ return (Integer.toString(tmpItem.getSeverityLV()));
+ case 1:
+ return (tmpItem.getForegroundS());
+ case 2:
+ return (tmpItem.getBackgroundS());
+ case 3:
+ return (Integer.toString(tmpItem.getX()));
+ case 4:
+ return (Integer.toString(tmpItem.getY()));
+ case 5:
+ return (Integer.toString(tmpItem.getArea()));
+ case 6:
+ return (tmpItem.getDescription());
+ default:
+ return("");
+
+ }
+ }
+
+ return "";
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorter.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorter.java
new file mode 100644
index 0000000..468e578
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorter.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.jface.viewers.Viewer;
+
+
+
+public class ResultTableSorter extends ResultTableSorterBase implements IResultTableSorter{
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder.getInstance();
+
+ private boolean inverse = false;
+
+ private int curColumn = -1;
+
+ private int metricsFinPos;
+
+ private int guidelineFinPos;
+
+ /**
+ *
+ */
+ public ResultTableSorter() {
+ super();
+ metricsFinPos = guidelineHolder.getMetricsNames().length + 1;
+ guidelineFinPos = metricsFinPos + guidelineHolder.getGuidelineData().length;
+ }
+
+ //for only aDesigner client
+ protected int compareTotalScore(IProblemItem item1, IProblemItem item2) {
+ int[] score1 = item1.getMetricsScores();
+ int[] score2 = item2.getMetricsScores();
+
+ int result = 0;
+ boolean[] isEnabled = guidelineHolder.getMatchedMetrics();
+ for (int i = 0; i < score1.length; i++) {
+ if(isEnabled[i]){
+ result += score2[i] - score1[i];
+ }
+ }
+ return (result);
+ }
+
+ //for only aDesigner client
+ protected int compareHighlight(IProblemItem tmp1, IProblemItem tmp2) {
+ boolean b1 = tmp1.isCanHighlight();
+ boolean b2 = tmp2.isCanHighlight();
+ if (b1 == b2) {
+ return (compareTotalScore(tmp1, tmp2));
+ } else if (b1) {
+ return (-1);
+ } else {
+ return (1);
+ }
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ public int compare(Viewer arg0, Object arg1, Object arg2) {
+ int result = 0;
+ if (arg1 != null && arg2 != null) {
+ try {
+ IProblemItem tmp1 = (IProblemItem) arg1;
+ IProblemItem tmp2 = (IProblemItem) arg2;
+
+// ICheckItem item1 = tmp1.getCheckItem();
+// ICheckItem item2 = tmp2.getCheckItem();
+
+ if (curColumn==-1) {
+ result = compareTotalScore(tmp1, tmp2);
+ } else if (curColumn == 0) {
+ result = compareHighlight(tmp1, tmp2);
+ } else if (curColumn < metricsFinPos) {
+ result = compareScore(tmp1, tmp2, curColumn-1);
+ } else if (curColumn < guidelineFinPos) {
+ result = compareGuideline(tmp1, tmp2, curColumn-metricsFinPos);
+ } else if (curColumn == guidelineFinPos) {
+ result = compareLine(tmp1, tmp2);
+ } else {
+ result = compareString(tmp1.getDescription(),tmp2.getDescription());
+ }
+
+ if (result == 0) {
+ result = compareSeverity(tmp1, tmp2);
+ if (result == 0) {
+ result = tmp1.getSerialNumber() - tmp2.getSerialNumber();
+ }
+ }
+
+ if (inverse) {
+ return (-result);
+ } else {
+ return (result);
+ }
+ } catch (Exception e) {
+ }
+ }
+ return super.compare(arg0, arg1, arg2);
+ }
+
+ public void setCurColumn(int curColumn) {
+ if (this.curColumn == curColumn) {
+ inverse = !inverse;
+ } else {
+ inverse = false;
+ this.curColumn = curColumn;
+ }
+ }
+
+ public void reset() {
+ curColumn = -1;
+ inverse = false;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorterBase.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorterBase.java
new file mode 100644
index 0000000..79b67e1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorterBase.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.util.comparator.ChainComparator;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public class ResultTableSorterBase extends ViewerSorter {
+
+ public class ScoreCompator extends ChainComparator {
+
+ private int pos;
+
+ public ScoreCompator(int pos) {
+ this.pos = pos;
+ }
+
+ protected int resolve(Object o1, Object o2) {
+ return (compareScore((IProblemItem) o1, (IProblemItem) o2, this.pos));
+ }
+
+ }
+
+ protected int compareScore(IProblemItem item1, IProblemItem item2, int pos) {
+ int[] score1 = item1.getMetricsScores();
+ int[] score2 = item2.getMetricsScores();
+ try {
+ int result = score2[pos] - score1[pos];
+ if (result == 0) {
+ Image[] icon1 = item1.getMetricsIcons();
+ Image[] icon2 = item2.getMetricsIcons();
+ if (icon1[pos] == null && icon2[pos] != null) {
+ return (1);
+ } else if (icon1[pos] != null && icon2[pos] == null) {
+ return (-1);
+ }
+ }
+ return (result);
+ } catch (Exception e) {
+ return (0);
+ }
+ }
+
+ public class SeverityComparator extends ChainComparator {
+ protected int resolve(Object o1, Object o2) {
+ return (compareSeverity((IProblemItem) o1, (IProblemItem) o2));
+ }
+ }
+
+ protected int compareSeverity(IProblemItem item1, IProblemItem item2) {
+ return (item1.getSeverity() - item2.getSeverity());
+ }
+
+ public class GuidelineComparator extends ChainComparator {
+ private int pos;
+
+ public GuidelineComparator(int pos) {
+ this.pos = pos;
+ }
+
+ protected int resolve(Object o1, Object o2) {
+ return (compareGuideline((IProblemItem) o1, (IProblemItem) o2, this.pos));
+ }
+ }
+
+ //TODO levels -> itemName
+ protected int compareGuideline(IProblemItem item1, IProblemItem item2, int pos) {
+ String guide1 = item1.getTableDataGuideline()[pos];
+ String guide2 = item2.getTableDataGuideline()[pos];
+
+ return (compareString(guide1, guide2));
+ }
+
+ public class LinesComparator extends ChainComparator {
+ protected int resolve(Object o1, Object o2) {
+ return (compareLine((IProblemItem) o1, (IProblemItem) o2));
+ }
+ }
+
+ protected int compareLine(IProblemItem tmp1, IProblemItem tmp2) {
+ int line1 = tmp1.getLine();
+ int line2 = tmp2.getLine();
+
+ if (line1 < 0 && line2 > -1) {
+ return (1);
+ } else if (line1 > -1 && line2 < 0) {
+ return (-1);
+ } else if (line1 == 0 && line2 == 0) {
+ return (0);
+ }
+
+ int result = tmp1.getLine() - tmp2.getLine();
+ if (result == 0) {
+ return (tmp1.getLineStrMulti().compareTo(tmp2.getLineStrMulti()));
+ }
+ return (result);
+ }
+
+ public class StringComparator extends ChainComparator {
+ protected int resolve(Object o1, Object o2) {
+ String target1 = (String) o1;
+ String target2 = (String) o2;
+
+ if (target1.length() == 0 && target2.length() != 0) {
+ return (1);
+ } else if (target1.length() != 0 && target2.length() == 0) {
+ return (-1);
+ }
+ return (target1.compareTo(target2));
+ }
+ }
+
+ public class DescriptionComparator extends StringComparator {
+ protected int resolve(Object o1, Object o2) {
+ IProblemItem item1 = (IProblemItem) o1;
+ IProblemItem item2 = (IProblemItem) o2;
+ return super.resolve(item1.getDescription(), item2.getDescription());
+ }
+ }
+
+ public class ErrorIDComparator extends StringComparator {
+ protected int resolve(Object o1, Object o2) {
+ IProblemItem item1 = (IProblemItem) o1;
+ IProblemItem item2 = (IProblemItem) o2;
+ String id1 = item1.getId();
+ String id2 = item2.getId();
+ String[] id1tokens = id1.split("_");
+ String[] id2tokens = id2.split("_");
+ if (id1tokens.length < 2 || id2tokens.length < 2)
+ return super.resolve(item1.getId(), item2.getId());
+ else {
+ int ret = super.resolve(id1tokens[0], id2tokens[0]);
+ if (ret != 0)
+ return ret;
+ else {
+ Double d1 = new Double(id1tokens[1]);
+ Double d2 = new Double(id2tokens[1]);
+ return d1.compareTo(d2);
+ }
+ }
+ }
+ }
+
+ protected int compareString(String target1, String target2) {
+ if (target1.length() == 0 && target2.length() != 0) {
+ return (1);
+ } else if (target1.length() != 0 && target2.length() == 0) {
+ return (-1);
+ }
+ return (target1.compareTo(target2));
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorterLV.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorterLV.java
new file mode 100644
index 0000000..ae5986d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableSorterLV.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.ProblemItemLV;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+
+
+
+public class ResultTableSorterLV extends ViewerSorter implements IResultTableSorter{
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder.getInstance();
+
+ private boolean inverse = false;
+
+ private int curColumn = 0;
+
+ private int guidelineFinPos;
+
+ /**
+ *
+ */
+ public ResultTableSorterLV() {
+ super();
+ guidelineFinPos = 1 + guidelineHolder.getGuidelineData().length;
+ }
+
+ //TODO levels then itemName
+ private int compareString(String guide1, String guide2) {
+
+ if (guide1.length() == 0 && guide2.length() != 0) {
+ return (1);
+ } else if (guide1.length() != 0 && guide2.length() == 0) {
+ return (-1);
+ }
+ return (guide1.compareTo(guide2));
+ }
+
+ private int compareInt(int type1, int type2) {
+ return (type1 - type2);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ public int compare(Viewer arg0, Object arg1, Object arg2) {
+ int result = 0;
+ if (arg1 != null && arg2 != null) {
+ try {
+ ProblemItemLV tmp1 = (ProblemItemLV) arg1;
+ ProblemItemLV tmp2 = (ProblemItemLV) arg2;
+
+ if (curColumn == 0) {
+ result = compareInt(tmp1.getIconId(), tmp2.getIconId());
+ } else if (curColumn < guidelineFinPos) {
+ //TODO sync with label
+
+ result = compareString(tmp1.getEvaluationItem().getTableDataGuideline()[curColumn - 1], tmp2
+ .getEvaluationItem().getTableDataGuideline()[curColumn - 1]);
+
+ } else {
+ switch (curColumn - guidelineFinPos) {
+ case 0:
+ result = compareInt(tmp1.getSeverityLV(), tmp2.getSeverityLV());
+ break;
+ case 1:
+ result = compareString(tmp1.getForegroundS(), tmp2.getForegroundS());
+ break;
+ case 2:
+ result = compareString(tmp1.getBackgroundS(), tmp2.getBackgroundS());
+ break;
+ case 3:
+ result = compareInt(tmp1.getX(), tmp2.getX());
+ break;
+ case 4:
+ result = compareInt(tmp1.getY(), tmp2.getY());
+ break;
+ case 5:
+ result = compareInt(tmp1.getArea(), tmp2.getArea());
+ break;
+ case 6:
+ result = compareString(tmp1.getDescription(), tmp2.getDescription());
+ break;
+ }
+ }
+
+ if (result == 0) {
+ result = tmp1.getSerialNumber() - tmp2.getSerialNumber();
+ }
+
+ if (inverse) {
+ return (-result);
+ } else {
+ return (result);
+ }
+ } catch (Exception e) {
+ }
+ }
+ return super.compare(arg0, arg1, arg2);
+ }
+
+ public void setCurColumn(int curColumn) {
+ if (this.curColumn == curColumn) {
+ inverse = !inverse;
+ } else {
+ inverse = false;
+ this.curColumn = curColumn;
+ }
+ }
+
+ public void reset() {
+ curColumn = -1;
+ inverse = false;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableViewer.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableViewer.java
new file mode 100644
index 0000000..3dd7a0d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/ResultTableViewer.java
@@ -0,0 +1,356 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import java.io.File;
+import java.util.Vector;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.model.IWebBrowserACTF;
+import org.eclipse.actf.model.events.IModelServiceEventListener;
+import org.eclipse.actf.visualization.IVisualizationView;
+import org.eclipse.actf.visualization.eval.IEvaluationResult;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineData;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineSelectionChangedEvent;
+import org.eclipse.actf.visualization.eval.guideline.IGuidelineSlectionChangedListener;
+import org.eclipse.actf.visualization.eval.problem.ProblemConst;
+import org.eclipse.actf.visualization.events.IVisualizationEventListener;
+import org.eclipse.actf.visualization.events.VisualizationEvent;
+import org.eclipse.actf.visualization.ui.report.ReportPlugin;
+import org.eclipse.actf.visualization.ui.report.table.popup.ClearSelectionAction;
+import org.eclipse.actf.visualization.ui.report.table.popup.GuidelineSubMenu;
+import org.eclipse.actf.visualization.ui.report.table.popup.ShowDescriptionAction;
+import org.eclipse.actf.visualization.ui.report.table.popup.SrcHighlightAction;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+
+public class ResultTableViewer implements IGuidelineSlectionChangedListener,
+ IVisualizationEventListener, IModelServiceEventListener {
+
+ private class ColumnSelectionAdapter extends SelectionAdapter {
+ private int column;
+
+ public ColumnSelectionAdapter(int column) {
+ this.column = column;
+ }
+
+ public void widgetSelected(SelectionEvent arg0) {
+ tableViewer.setSelection(null);
+ if (tableSorter instanceof IResultTableSorter) {
+ ((IResultTableSorter) tableSorter).setCurColumn(column);
+ }
+ tableViewer.refresh();
+ }
+ }
+
+ private GuidelineHolder guidelineHolder = GuidelineHolder
+ .getInstance();
+
+ private int mode = IVisualizationView.MODE_DEFAULT;
+
+ private Table table;
+
+ private ViewerSorter tableSorter = new ResultTableSorter();
+
+ private ResultTableFilter tableFilter;
+
+ private TableViewer tableViewer;
+
+ private SrcViewerForPT srcViewerForPT;
+
+ private int curMode = -1;
+
+ private File currentSoruceFile;
+
+ private SrcHighlightAction srcHighlightAction;
+
+ private boolean isShowAllGuidelineItems = false;
+
+ public ResultTableViewer(Composite parent) {
+
+ tableViewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION
+ | SWT.MULTI);
+ table = tableViewer.getTable();
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+
+ srcViewerForPT = SrcViewerForPT.initSrcViewerForPT(parent.getShell());
+
+ initColumns();
+
+ changeColumnLayout();
+
+ tableViewer.setContentProvider(new ArrayContentProvider());
+ tableFilter = new ResultTableFilter();
+ tableViewer.addFilter(tableFilter);
+
+ MenuManager popupMenu = new MenuManager();
+ popupMenu.add(new ClearSelectionAction(tableViewer));
+ popupMenu.add(new GuidelineSubMenu(this));
+ popupMenu.add(new ShowDescriptionAction(tableViewer));
+ srcHighlightAction = new SrcHighlightAction(this);
+ srcHighlightAction.setEnabled(false);
+ popupMenu.add(srcHighlightAction);
+ table.setMenu(popupMenu.createContextMenu(table));
+
+ guidelineHolder.addGuidelineSelectionChangedListener(this);
+ }
+
+ public TableViewer getTableViewer() {
+ return tableViewer;
+ }
+
+ private void changeColumnLayout() {
+ srcViewerForPT.setSrcChanged(true);
+ switch (mode) {
+ case IVisualizationView.MODE_LOWVISION:
+ initLVMode();
+ // srcViewerForPT.updateSrcViewer(mode);
+ break;
+ case IVisualizationView.MODE_DEFAULT:
+ default:
+ initDefaultMode();
+ // srcViewerForPT.updateSrcViewer(mode);
+ break;
+ }
+ }
+
+ public void refresh() {
+ // change checker setting
+ // TODO
+ tableViewer.refresh();
+ }
+
+ private void initColumns() {
+ int columnSize = 3 + guidelineHolder.getGuidelineData().length
+ + guidelineHolder.getMetricsNames().length;
+ int lvColumn = 3 + 6 + guidelineHolder.getGuidelineData().length;
+
+ if (lvColumn > columnSize) {
+ columnSize = lvColumn;
+ }
+
+ for (int i = 0; i < columnSize; i++) {
+ TableColumn column = new TableColumn(table, SWT.LEFT);
+ column.addSelectionListener(new ColumnSelectionAdapter(i));
+ }
+
+ }
+
+ private void initDefaultMode() {
+ // table.clearAll();
+
+ TableColumn[] columns = table.getColumns();
+ int curPos = 0;
+
+ for (int i = 0; i < columns.length; i++) {
+ columns[i].setImage(null);
+ columns[i].setResizable(true);
+ }
+
+ columns[curPos].setText(ProblemConst.TITLE_HIGHLIGHT);
+ columns[curPos].setWidth(25);
+ curPos++;
+
+ String[] tmpSarray = guidelineHolder.getMetricsNames();
+ boolean[] enabledMetrics = guidelineHolder.getMatchedMetrics();
+ for (int i = 0; i < tmpSarray.length; i++) {
+ columns[curPos].setText(tmpSarray[i]);
+ switch (i % 5) {
+ case 0:
+ columns[curPos].setImage(ReportPlugin
+ .imageDescriptorFromPlugin(ReportPlugin.PLUGIN_ID,
+ "icons/IconRed.gif").createImage());
+ break;
+ case 1:
+ columns[curPos].setImage(ReportPlugin
+ .imageDescriptorFromPlugin(ReportPlugin.PLUGIN_ID,
+ "icons/IconYellow.gif").createImage());
+ break;
+ case 2:
+ columns[curPos].setImage(ReportPlugin
+ .imageDescriptorFromPlugin(ReportPlugin.PLUGIN_ID,
+ "icons/IconBlue.gif").createImage());
+ break;
+ case 3:
+ columns[curPos].setImage(ReportPlugin
+ .imageDescriptorFromPlugin(ReportPlugin.PLUGIN_ID,
+ "icons/IconGreen.gif").createImage());
+ break;
+ case 4:
+ columns[curPos].setImage(ReportPlugin
+ .imageDescriptorFromPlugin(ReportPlugin.PLUGIN_ID,
+ "icons/IconPink.gif").createImage());
+ break;
+ default:
+ }
+ if (enabledMetrics[i]) {
+ columns[curPos].setWidth(75);
+ } else {
+ columns[curPos].setWidth(0);
+ columns[curPos].setResizable(false);
+ }
+ curPos++;
+ }
+
+ GuidelineData[] dataArray = guidelineHolder.getGuidelineData();
+ for (int i = 0; i < dataArray.length; i++) {
+ columns[curPos].setText(dataArray[i].getGuidelineName());
+ if (dataArray[i].isMatched()) {
+ columns[curPos].setWidth(65);
+ } else {
+ columns[curPos].setWidth(0);
+ columns[curPos].setResizable(false);
+ }
+ curPos++;
+ }
+
+ columns[curPos].setText(ProblemConst.TITLE_LINE);
+ columns[curPos].setWidth(60);
+ curPos++;
+
+ columns[curPos].setText(ProblemConst.TITLE_DESCRIPTION);
+ columns[curPos].setWidth(1000);
+ curPos++;
+
+ for (int i = curPos; i < columns.length; i++) {
+ columns[i].setWidth(0);
+ columns[i].setResizable(false);
+ }
+
+ }
+
+ private void initLVMode() {
+
+ TableColumn[] columns = table.getColumns();
+ int curPos = 0;
+
+ for (int i = 0; i < columns.length; i++) {
+ columns[i].setImage(null);
+ columns[i].setResizable(true);
+ }
+
+ columns[curPos].setText(ProblemConst.TITLE_ICON);
+ columns[curPos].setWidth(45);
+ curPos++;
+
+ GuidelineData[] dataArray = guidelineHolder.getGuidelineData();
+ for (int i = 0; i < dataArray.length; i++) {
+ columns[curPos].setText(dataArray[i].getGuidelineName());
+ columns[curPos].setWidth(70);
+ curPos++;
+ }
+
+ columns[curPos].setText(ProblemConst.TITLE_SEVERITY);
+ columns[curPos].setWidth(60);
+ curPos++;
+ columns[curPos].setText(ProblemConst.TITLE_FORECOLOR);
+ columns[curPos].setWidth(100);
+ curPos++;
+ columns[curPos].setText(ProblemConst.TITLE_BACKCOLOR);
+ columns[curPos].setWidth(100);
+ curPos++;
+ columns[curPos].setText(ProblemConst.TITLE_X);
+ columns[curPos].setWidth(50);
+ curPos++;
+ columns[curPos].setText(ProblemConst.TITLE_Y);
+ columns[curPos].setWidth(50);
+ curPos++;
+ columns[curPos].setText(ProblemConst.TITLE_AREA);
+ columns[curPos].setWidth(70);
+ curPos++;
+
+ columns[curPos].setText(ProblemConst.TITLE_DESCRIPTION);
+ columns[curPos].setWidth(1000);
+ curPos++;
+
+ for (int i = curPos; i < columns.length; i++) {
+ columns[i].setWidth(0);
+ columns[i].setResizable(false);
+ }
+
+ // tableViewer.setLabelProvider(new ResultTableLabelProviderLV());
+ // tableViewer.setSorter(tableSorterLV);
+
+ }
+
+ public void changeFilterType(int type) {
+ tableFilter.setSeverity(type);
+ refresh();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.actf.visualization.eval.guideline.IGuidelineSlectionChangedListener#selectionChanged(org.eclipse.actf.visualization.eval.guideline.GuidelineSelectionChangedEvent)
+ */
+ public void selectionChanged(GuidelineSelectionChangedEvent e) {
+ changeColumnLayout();
+ // tableFilter.setEnabledMetrics(guidelineHolder.getEnabledMetrics());
+ refresh();
+ }
+
+ public void visualizerChanged(VisualizationEvent vizEvent) {
+ IVisualizationView checker = vizEvent.getVisualizationView();
+ IEvaluationResult result = vizEvent.getEvaluationResult();
+ mode = checker.getResultTableMode();
+
+ currentSoruceFile = result.getSourceFile();
+ isShowAllGuidelineItems = result.isShowAllGuidelineItems();
+ tableSorter = checker.getTableSorter();
+
+ if (curMode != checker.getResultTableMode()) {
+ tableViewer.setInput(new Vector());
+ changeColumnLayout();
+ }
+
+ tableViewer.setLabelProvider(checker.getLabelProvider());
+ tableViewer.setSorter(tableSorter);
+
+ tableViewer.setInput(result.getProblemList());
+
+ // tableSorter.reset();
+ // tableSorterLV.reset();
+
+ srcViewerForPT.setSrcChanged(true);
+ srcViewerForPT.updateSrcViewer(result.getSourceFile());
+
+ }
+
+ public File getCurrentSoruceFile() {
+ return currentSoruceFile;
+ }
+
+ public boolean isShowAllGuidelineItems() {
+ return isShowAllGuidelineItems;
+ }
+
+ public void modelserviceChanged(IModelService modelService) {
+ // for HTML source viewer
+ srcHighlightAction.setEnabled(modelService instanceof IWebBrowserACTF);
+ }
+
+ public void inputChanged(IModelService modelService) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/SrcViewerForPT.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/SrcViewerForPT.java
new file mode 100644
index 0000000..56da6f0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/SrcViewerForPT.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table;
+
+import java.io.File;
+
+import org.eclipse.actf.visualization.eval.EvaluationPreferencesUtil;
+import org.eclipse.actf.visualization.eval.problem.HighlightTargetSourceInfo;
+import org.eclipse.actf.visualization.ui.report.ReportPlugin;
+import org.eclipse.actf.visualization.ui.report.srcviewer.SrcViewer;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+
+
+
+public class SrcViewerForPT {
+
+ //TODO viewpart, SourceViewer
+
+ private static SrcViewerForPT INSTANCE = null;
+
+ private static SrcViewer _srcViewer;
+
+ private static Shell _srcViewerShell;
+
+ private Shell _shell = null;
+
+ private boolean srcChanged;
+
+ private File curTarget;
+
+ /**
+ * @param pt
+ * @param display
+ */
+ private SrcViewerForPT(Shell shell) {
+ super();
+ this._shell = shell;
+ initSrcViewer();
+ }
+
+ public static SrcViewerForPT initSrcViewerForPT(Shell parent) {
+ if (INSTANCE != null) {
+ // TODO close
+ // INSTANCE.PARENT.removeShellListener();
+ }
+
+ INSTANCE = new SrcViewerForPT(parent);
+ return (INSTANCE);
+ }
+
+ public static SrcViewerForPT getInstance() {
+ return (INSTANCE);
+ }
+
+ private void initSrcViewer() {
+ srcChanged = true;
+
+ if (_shell != null) {
+ _shell.addShellListener(new ShellAdapter() {
+ public void shellClosed(ShellEvent arg0) {
+ if (_srcViewerShell != null && !_srcViewerShell.isDisposed()) {
+ _srcViewerShell.dispose();
+ }
+ }
+ });
+ }
+ }
+
+ public void openSrcViewer() {
+ if (null == _srcViewerShell || _srcViewerShell.isDisposed()) {
+ Display display = _shell.getDisplay();
+ if (null == display) {
+ display = Display.getDefault();
+ }
+ _srcViewerShell = new Shell(display);
+ _srcViewerShell.setLayout(new FillLayout());
+ _srcViewerShell.setImage(ReportPlugin.imageDescriptorFromPlugin(ReportPlugin.PLUGIN_ID, "icons/excla_squ.png").createImage());
+ _srcViewerShell.setText("HTML Source");
+ _srcViewer = new SrcViewer(_srcViewerShell);
+ _srcViewerShell.setSize(600, 750);
+ _srcViewerShell.setFocus();
+ _srcViewerShell.open();
+
+ _srcViewerShell.addShellListener(new ShellAdapter() {
+ public void shellClosed(ShellEvent arg0) {
+ _srcViewer.closeSearchDlgShell();
+ }
+ });
+
+ srcChanged = true;
+
+ } else if (!_srcViewerShell.isDisposed()) {
+ if (_srcViewerShell.getMinimized()) {
+ _srcViewerShell.setMinimized(false);
+ }
+ _srcViewerShell.forceActive();
+ }
+ }
+
+ public void highlightSrcViewer(HighlightTargetSourceInfo[] sourceInfos, File target) {
+ if (_srcViewerShell != null && !_srcViewerShell.isDisposed() && EvaluationPreferencesUtil.isOriginalDOM()) {
+
+ if(curTarget!=target){
+ srcChanged =true;
+ updateSrcViewer(target);
+ }
+
+ //updateSrcViewer(currentLayout);
+ _srcViewer.clearHighlight();
+
+ for (int i = 0; i < sourceInfos.length; i++) {
+ HighlightTargetSourceInfo curInfo = sourceInfos[i];
+
+ if (curInfo.getStartColumn() < 0 || curInfo.getEndColumn() < 0) {
+ _srcViewer.highlightLines(curInfo.getStartLine(),curInfo.getEndLine());
+ } else {
+ _srcViewer.highlight(curInfo.getStartLine(),curInfo.getStartColumn(),curInfo.getEndLine(),curInfo.getEndColumn());
+ }
+
+ }
+ }
+
+ }
+
+ public void updateSrcViewer(File target) {
+ if (_srcViewerShell != null && !_srcViewerShell.isDisposed() && srcChanged) {
+ try {
+ _srcViewer.openFile(target);
+ curTarget = target;
+ } catch (Exception e) {
+ // e.printStackTrace();
+ _srcViewer.setText(""); //$NON-NLS-1$
+ }
+ srcChanged = false;
+ }
+ }
+
+ /**
+ * @param srcChanged
+ * The srcChanged to set.
+ */
+ public void setSrcChanged(boolean srcChanged) {
+ this.srcChanged = srcChanged;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ClearSelectionAction.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ClearSelectionAction.java
new file mode 100644
index 0000000..2cb1bc6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ClearSelectionAction.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table.popup;
+
+import org.eclipse.actf.visualization.ui.report.internal.Messages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TableViewer;
+
+
+
+public class ClearSelectionAction extends Action {
+
+
+ private TableViewer _tableViewer;
+
+
+ /**
+ * @param tableViewer
+ */
+
+ public ClearSelectionAction(TableViewer tableViewer) {
+ super(Messages.getString("ProblemTable.Clear_Selection_15"));
+ this._tableViewer = tableViewer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ public void run() {
+ //resultViewer.clearSelection();
+ _tableViewer.setSelection(null);
+
+ //TODO
+ //guidelineSubMenu.setGuidelineItem(new ArrayList());
+
+ //TODO recover highlight (use mediator/IVisualization,IDataSoruce)
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/GuidelineSubMenu.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/GuidelineSubMenu.java
new file mode 100644
index 0000000..c81076e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/GuidelineSubMenu.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table.popup;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TreeSet;
+
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.ui.report.internal.Messages;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableViewer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+
+
+public class GuidelineSubMenu extends MenuManager {
+
+ private ResultTableViewer _resultTableViewer;
+
+ private TableViewer _tableViewer;
+
+ private Action _dummy;
+
+ private GuidelineHolder _guidelineHolder = GuidelineHolder
+ .getInstance();
+
+ public GuidelineSubMenu(ResultTableViewer resultTableViewer) {
+ super(Messages.getString("ProblemTable.View_Guideline_16"));
+
+ this._resultTableViewer = resultTableViewer;
+ this._tableViewer = resultTableViewer.getTableViewer();
+
+ this._tableViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent arg0) {
+ List tmpList = ((IStructuredSelection) arg0
+ .getSelection()).toList();
+ setGuidelineItem(tmpList);
+ }
+ });
+
+ this._dummy = new Action("guideline help is not available.") {
+ };
+ this._dummy.setEnabled(false);
+ add(this._dummy);
+ }
+
+ public void setGuidelineItem(List target) {
+ TreeSet<IGuidelineItem> tmpSet = new TreeSet<IGuidelineItem>(new Comparator<IGuidelineItem>() {
+ public int compare(IGuidelineItem o1, IGuidelineItem o2) {
+ return (o1.toString().compareTo(o2.toString()));//TODO
+ }
+ });
+
+ for (Iterator i = target.iterator(); i.hasNext();) {
+ try {
+ IProblemItem tmpItem = (IProblemItem) i.next();
+ tmpSet.addAll(Arrays.asList(tmpItem.getEvaluationItem()
+ .getGuidelines()));
+ } catch (Exception e) {
+ }
+ }
+
+ this.removeAll();
+
+ for (Iterator i = tmpSet.iterator(); i.hasNext();) {
+ IGuidelineItem tmpItem = (IGuidelineItem) i.next();
+ if (tmpItem.getUrl() != null && tmpItem.getUrl().length() != 0) {
+ // Lowvision-> show all
+ if (_resultTableViewer.isShowAllGuidelineItems()
+ || this._guidelineHolder.isMatchedInTopLevel(tmpItem)) {
+ add(new ShowGuidelineAction(tmpItem));
+ }
+ }
+ }
+
+ if (this.getItems().length == 0) {
+ this.add(this._dummy);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ShowDescriptionAction.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ShowDescriptionAction.java
new file mode 100644
index 0000000..ae0b9d8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ShowDescriptionAction.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.ui.report.table.popup;
+
+import java.util.List;
+
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.eval.problem.ProblemConst;
+import org.eclipse.actf.visualization.ui.report.internal.Messages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+
+
+public class ShowDescriptionAction extends Action {
+
+ private TableViewer tableViewer;
+
+ private IProblemItem curItem;
+
+ /**
+ *
+ */
+ public ShowDescriptionAction(TableViewer tableViewer) {
+ super(Messages.getString("ProblemTable.6"));
+ this.tableViewer = tableViewer;
+
+ tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent arg0) {
+ List tmpList = ((IStructuredSelection) arg0.getSelection()).toList();
+ if(tmpList==null||tmpList.size()>1||tmpList.size()==0){
+ setIProblemItem(null);
+ }else{
+ try{
+ setIProblemItem((IProblemItem)tmpList.get(0));
+ }catch(Exception e){
+ setIProblemItem(null);
+ }
+ }
+ }
+ });
+
+ this.setEnabled(false);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ public void run() {
+ MessageDialog.openInformation(tableViewer.getControl().getShell(),ProblemConst.TITLE_DESCRIPTION,curItem.getDescription());
+ }
+
+ public void setIProblemItem(IProblemItem target){
+ if(target==null){
+ this.setEnabled(false);
+ }else{
+ this.setEnabled(true);
+ curItem = target;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ShowGuidelineAction.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ShowGuidelineAction.java
new file mode 100644
index 0000000..4474411
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/ShowGuidelineAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table.popup;
+
+import org.eclipse.actf.visualization.eval.IGuidelineItem;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.program.Program;
+
+
+
+public class ShowGuidelineAction extends Action {
+
+ private IGuidelineItem _targetItem;
+
+ /**
+ *
+ */
+ public ShowGuidelineAction(IGuidelineItem targetItem) {
+ super(targetItem.getGuidelineName() + ": " + targetItem.getId());
+ this._targetItem = targetItem;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ public void run() {
+
+ // launch default web browser
+ Program program = Program.findProgram(".html");
+ if (null != program) {
+ program.execute(this._targetItem.getUrl());
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/SrcHighlightAction.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/SrcHighlightAction.java
new file mode 100644
index 0000000..dc01635
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/table/popup/SrcHighlightAction.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.ui.report.table.popup;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.actf.visualization.eval.problem.HighlightTargetSourceInfo;
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.ui.report.internal.Messages;
+import org.eclipse.actf.visualization.ui.report.table.ResultTableViewer;
+import org.eclipse.actf.visualization.ui.report.table.SrcViewerForPT;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+
+
+
+public class SrcHighlightAction extends Action {
+
+ private ResultTableViewer _resultTableViewer;
+
+ private TableViewer _tableView;
+
+ private SrcViewerForPT _srcViewer;
+
+ public SrcHighlightAction(ResultTableViewer resultTableViewer) {
+ super(Messages.getString("ProblemTable.5"));
+ this._resultTableViewer = resultTableViewer;
+ this._tableView = resultTableViewer.getTableViewer();
+ this._srcViewer = SrcViewerForPT.getInstance();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ public void run() {
+
+ if (_srcViewer != null) {
+
+ _srcViewer.openSrcViewer();
+
+ // TODO use event
+
+ List targetList = ((IStructuredSelection) _tableView.getSelection()).toList();
+ ArrayList<HighlightTargetSourceInfo> srcLineArray = new ArrayList<HighlightTargetSourceInfo>();
+
+ for (Iterator i = targetList.iterator(); i.hasNext();) {
+ IProblemItem tmpItem = (IProblemItem) i.next();
+ srcLineArray.addAll(Arrays.asList(tmpItem.getHighlightTargetSoruceInfo()));
+ }
+
+ HighlightTargetSourceInfo[] target = new HighlightTargetSourceInfo[srcLineArray.size()];
+ srcLineArray.toArray(target);
+ _srcViewer.highlightSrcViewer(target, _resultTableViewer.getCurrentSoruceFile());
+
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/views/DetailedReportView.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/views/DetailedReportView.java
new file mode 100644
index 0000000..31d7513
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/views/DetailedReportView.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.ui.report.views;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.visualization.events.VisualizationEvent;
+import org.eclipse.actf.visualization.ui.report.DetailProblemReportArea;
+import org.eclipse.actf.visualization.ui.report.IReportViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+public class DetailedReportView extends ViewPart implements IReportViewer{
+
+ public static final String ID = DetailedReportView.class.getName();
+
+ private DetailProblemReportArea problemArea;
+
+ public DetailedReportView() {
+ super();
+ }
+
+ public void createPartControl(Composite parent) {
+ problemArea = new DetailProblemReportArea(parent, SWT.NONE);
+ getSite().setSelectionProvider(problemArea.getProblemTree().getResultTableViewer().getTableViewer());
+ }
+
+ public void setFocus() {
+ }
+
+ public void visualizerChanged(VisualizationEvent vizEvent) {
+ problemArea.visualizerChanged(vizEvent);
+ }
+
+ public void modelserviceChanged(IModelService modelService) {
+ problemArea.modelserviceChanged(modelService);
+ }
+
+ public void inputChanged(IModelService modelService) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/views/SummaryReportView.java b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/views/SummaryReportView.java
new file mode 100644
index 0000000..5447409
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.ui.report/src/org/eclipse/actf/visualization/ui/report/views/SummaryReportView.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and Others
+ * 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:
+ * Norimasa HAYASHIDA - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.visualization.ui.report.views;
+
+import org.eclipse.actf.model.IModelService;
+import org.eclipse.actf.visualization.events.VisualizationEvent;
+import org.eclipse.actf.visualization.ui.report.IReportViewer;
+import org.eclipse.actf.visualization.ui.report.SummaryProblemReportArea;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+public class SummaryReportView extends ViewPart implements IReportViewer{
+
+ public static final String ID = SummaryReportView.class.getName();
+
+ private SummaryProblemReportArea problemArea;
+
+ public SummaryReportView() {
+ super();
+ }
+
+ public void createPartControl(Composite parent) {
+ problemArea = new SummaryProblemReportArea(parent, SWT.NONE);
+ }
+
+ public void setFocus() {
+
+ }
+
+ public void visualizerChanged(VisualizationEvent vizEvent) {
+ problemArea.visualizerChanged(vizEvent);
+ }
+
+ public void modelserviceChanged(IModelService modelService) {
+ }
+
+ public void inputChanged(IModelService modelService) {
+ // TODO Auto-generated method stub
+
+ }
+
+}