[225701, 245847, 246188] documentation, remove warnings, move non API packages to under internal
diff --git a/plugins/org.eclipse.actf.visualization.blind.html/src/org/eclipse/actf/visualization/blind/html/BlindVisualizerHtml.java b/plugins/org.eclipse.actf.visualization.blind.html/src/org/eclipse/actf/visualization/blind/html/BlindVisualizerHtml.java
index 57d8ec5..42ffdec 100644
--- a/plugins/org.eclipse.actf.visualization.blind.html/src/org/eclipse/actf/visualization/blind/html/BlindVisualizerHtml.java
+++ b/plugins/org.eclipse.actf.visualization.blind.html/src/org/eclipse/actf/visualization/blind/html/BlindVisualizerHtml.java
@@ -37,7 +37,7 @@
import org.eclipse.actf.visualization.engines.blind.eval.EvaluationResultBlind;
import org.eclipse.actf.visualization.engines.blind.html.IVisualizeMapData;
import org.eclipse.actf.visualization.engines.blind.html.VisualizeEngine;
-import org.eclipse.actf.visualization.engines.blind.html.eval.HtmlErrorLogListener;
+import org.eclipse.actf.visualization.engines.blind.html.util.HtmlErrorLogListener;
import org.eclipse.actf.visualization.eval.CheckTargetFactory;
import org.eclipse.actf.visualization.eval.EvaluationUtil;
import org.eclipse.actf.visualization.eval.IHtmlCheckTarget;
diff --git a/plugins/org.eclipse.actf.visualization.blind.odfbyhtml/src/org/eclipse/actf/visualization/blind/odfbyhtml/BlindVisualizerOdfByHtml.java b/plugins/org.eclipse.actf.visualization.blind.odfbyhtml/src/org/eclipse/actf/visualization/blind/odfbyhtml/BlindVisualizerOdfByHtml.java
index f6067d7..2698e83 100644
--- a/plugins/org.eclipse.actf.visualization.blind.odfbyhtml/src/org/eclipse/actf/visualization/blind/odfbyhtml/BlindVisualizerOdfByHtml.java
+++ b/plugins/org.eclipse.actf.visualization.blind.odfbyhtml/src/org/eclipse/actf/visualization/blind/odfbyhtml/BlindVisualizerOdfByHtml.java
@@ -31,7 +31,7 @@
import org.eclipse.actf.visualization.engines.blind.eval.EvaluationResultBlind;
import org.eclipse.actf.visualization.engines.blind.html.IVisualizeMapData;
import org.eclipse.actf.visualization.engines.blind.html.VisualizeEngine;
-import org.eclipse.actf.visualization.engines.blind.html.eval.HtmlErrorLogListener;
+import org.eclipse.actf.visualization.engines.blind.html.util.HtmlErrorLogListener;
import org.eclipse.actf.visualization.engines.blind.html.util.VisualizeReportUtil;
import org.eclipse.actf.visualization.eval.CheckTargetFactory;
import org.eclipse.actf.visualization.eval.EvaluationUtil;
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.engines.blind.html/META-INF/MANIFEST.MF
index 0ad0da0..eaee69f 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/META-INF/MANIFEST.MF
@@ -16,7 +16,6 @@
org.eclipse.actf.ui
Eclipse-LazyStart: true
Export-Package: org.eclipse.actf.visualization.engines.blind.html,
- org.eclipse.actf.visualization.engines.blind.html.eval,
org.eclipse.actf.visualization.engines.blind.html.ui.actions,
org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer,
org.eclipse.actf.visualization.engines.blind.html.util
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java
new file mode 100644
index 0000000..766a2a9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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:
+ * Hironobu TAKAGI - initial API and implementation
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.visualization.engines.blind.html;
+
+import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+
+/**
+ * Interface for detected problems through blind visualization.
+ */
+public interface IBlindProblem extends IProblemItem {
+
+ public static final int NO_ALT_IMG = 0;
+ public static final int NO_ALT_INPUT = 1;
+ public static final int NO_ALT_AREA = 2;
+ public static final int WRONG_ALT_IMG = 4;
+ public static final int WRONG_ALT_INPUT = 5;// TODO
+ public static final int WRONG_ALT_AREA = 6;
+ public static final int NO_DEST_LINK = 8;
+ public static final int REDUNDANT_ALT = 9;
+ public static final int NO_SKIPTOMAIN_LINK = 10;// without structure
+ public static final int TOO_LESS_STRUCTURE = 12;
+ public static final int NO_TEXT_INTRAPAGELINK = 14;
+ public static final int WRONG_TEXT = 15;
+ public static final int NO_ID_INPUT = 16; // TODO
+ public static final int TOOFAR_SKIPTOMAIN_LINK = 17;
+ public static final int NO_DEST_SKIP_LINK = 18;
+ public static final int WRONG_SKIP_LINK_TEXT = 19;
+ public static final int NO_SKIPTOMAIN_WITH_STRUCTURE = 20;
+ public static final int ALERT_NO_SKIPTOMAIN_NO_STRUCTURE = 21;
+ public static final int LESS_STRUCTURE_WITH_SKIPLINK = 22;
+ public static final int LESS_STRUCTURE_WITH_HEADING = 23;
+ public static final int LESS_STRUCTURE_WITH_BOTH = 24;
+ public static final int NO_TEXT_WITH_TITLE_INTRAPAGELINK = 25;
+ public static final int WRONG_SKIP_LINK_TITLE = 26;
+ public static final int ALERT_WRONG_ALT = 27;
+ public static final int ALERT_REDUNDANT_TEXT = 28; // TODO
+ public static final int SEPARATE_DBCS_ALT_IMG = 29;
+ public static final int SEPARATE_DBCS_ALT_INPUT = 30; // TODO
+ public static final int SEPARATE_DBCS_ALT_AREA = 31;
+ public static final int ALERT_NO_DEST_INTRA_LINK = 33;
+ public static final int ALERT_SPELL_OUT = 34;
+ public static final int INVISIBLE_INTRAPAGE_LINK = 35;
+ public static final int NO_VALUE_INPUT_BUTTON = 36;
+ public static final int SEPARATE_DBCS_INPUT_VALUE = 37;
+ public static final int NUM_PROBLEMS = 38;// max id+1
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java
index 4ef9eea..b195dbb 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java
@@ -23,10 +23,9 @@
import org.eclipse.actf.visualization.engines.blind.ParamBlind;
import org.eclipse.actf.visualization.engines.blind.TextChecker;
-import org.eclipse.actf.visualization.engines.blind.html.eval.BlindProblem;
import org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.impl.VisualizeStyleInfo;
import org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.impl.VisualizeStyleInfoManager;
-import org.eclipse.actf.visualization.engines.blind.html.util.Id2LineViaAccId;
+import org.eclipse.actf.visualization.engines.blind.html.util.Id2LineViaActfId;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacket;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacketCollection;
import org.eclipse.actf.visualization.engines.voicebrowser.IVoiceBrowserController;
@@ -36,6 +35,7 @@
import org.eclipse.actf.visualization.eval.guideline.GuidelineHolder;
import org.eclipse.actf.visualization.eval.html.statistics.PageData;
import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.internal.engines.blind.html.BlindProblem;
import org.eclipse.actf.visualization.internal.engines.blind.html.util.DocumentCleaner;
import org.eclipse.actf.visualization.internal.engines.blind.html.util.ImgChecker;
import org.eclipse.actf.visualization.internal.engines.blind.html.util.LinkAnalyzer;
@@ -100,7 +100,7 @@
private GuidelineHolder guidelineHolder = GuidelineHolder.getInstance();
- private boolean[] checkItems = new boolean[BlindProblem.NUM_PROBLEMS];
+ private boolean[] checkItems = new boolean[IBlindProblem.NUM_PROBLEMS];
private File variantFile;
@@ -130,7 +130,7 @@
id = id.substring(2);
try {
int item = Integer.parseInt(id);
- if (item > -1 && item < BlindProblem.NUM_PROBLEMS) {
+ if (item > -1 && item < IBlindProblem.NUM_PROBLEMS) {
checkItems[item] = true;
} else {
// TODO
@@ -245,23 +245,23 @@
IProblemItem tmpBP = i.next();
if (tmpBP instanceof BlindProblem) {
BlindProblem curBP = (BlindProblem) tmpBP;
- if (checkItems[curBP.getProblemSubType()]) {
+ if (checkItems[curBP.getSubType()]) {
if (curBP.getSeverity() == IEvaluationItem.SEV_ERROR) {
- switch (curBP.getProblemSubType()) {
- case BlindProblem.NO_ALT_IMG:
- case BlindProblem.NO_ALT_INPUT:
+ switch (curBP.getSubType()) {
+ case IBlindProblem.NO_ALT_IMG:
+ case IBlindProblem.NO_ALT_INPUT:
missing++;
errorCount++;
break;
- case BlindProblem.WRONG_ALT_IMG:
- case BlindProblem.WRONG_ALT_INPUT:
- case BlindProblem.SEPARATE_DBCS_ALT_IMG:
- case BlindProblem.SEPARATE_DBCS_ALT_INPUT:
+ case IBlindProblem.WRONG_ALT_IMG:
+ case IBlindProblem.WRONG_ALT_INPUT:
+ case IBlindProblem.SEPARATE_DBCS_ALT_IMG:
+ case IBlindProblem.SEPARATE_DBCS_ALT_INPUT:
wrong++;
errorCount++;
- case BlindProblem.NO_ALT_AREA: // TODO
- case BlindProblem.WRONG_ALT_AREA:
- case BlindProblem.SEPARATE_DBCS_ALT_AREA:
+ case IBlindProblem.NO_ALT_AREA: // TODO
+ case IBlindProblem.WRONG_ALT_AREA:
+ case IBlindProblem.SEPARATE_DBCS_ALT_AREA:
area++;
}
}
@@ -290,9 +290,9 @@
// System.out.println("remove elements fin");
// TODO merge with visualizeError
- Id2LineViaAccId id2line = null;
+ Id2LineViaActfId id2line = null;
if (EvaluationUtil.isOriginalDOM()) {
- id2line = new Id2LineViaAccId(mapData.getId2AccIdMap(),
+ id2line = new Id2LineViaActfId(mapData.getId2AccIdMap(),
html2viewMapV);
}
@@ -427,7 +427,7 @@
input.setAttribute("value", altNode.getNodeValue());
} else {
BlindProblem prob = new BlindProblem(
- BlindProblem.NO_ALT_INPUT);
+ IBlindProblem.NO_ALT_INPUT);
Integer idObj = mapData.getIdOfNode(input);
if (idObj != null) {
prob.setNode(input, idObj.intValue());
@@ -449,11 +449,11 @@
if (typeS.equals("button")) {
// not readable
prob = new BlindProblem(
- BlindProblem.NO_VALUE_INPUT_BUTTON);
+ IBlindProblem.NO_VALUE_INPUT_BUTTON);
}
} else if (textChecker.isSeparatedJapaneseChars(valueS)) {
prob = new BlindProblem(
- BlindProblem.SEPARATE_DBCS_INPUT_VALUE, valueS);
+ IBlindProblem.SEPARATE_DBCS_INPUT_VALUE, valueS);
}
if (prob != null) {
Integer idObj = mapData.getIdOfNode(input);
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/ElementViewerManagerFactory.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/ElementViewerManagerFactory.java
index ab230c1..892c028 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/ElementViewerManagerFactory.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/ElementViewerManagerFactory.java
@@ -12,9 +12,16 @@
import org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.impl.ElementViewerManager;
+/**
+ * Factory for {@link IElementViewerManager} that manages element information
+ * viewer in blind visualization mode
+ */
public class ElementViewerManagerFactory {
private static ElementViewerManager INSTANCE;
+ /**
+ * @return instance of {@link IElementViewerManager}
+ */
public static IElementViewerManager getInstance() {
if (INSTANCE == null) {
INSTANCE = new ElementViewerManager();
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerAccessKeyInfo.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerAccessKeyInfo.java
index 4b73512..575a349 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerAccessKeyInfo.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerAccessKeyInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * 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
@@ -11,8 +11,19 @@
package org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer;
-
+/**
+ * Interface to store accesskey information
+ *
+ * @see IElementViewerInfoProvider
+ */
public interface IElementViewerAccessKeyInfo {
- String getDescription();
- String getHelpUrl();
+ /**
+ * @return description about the accesskey
+ */
+ String getDescription();
+
+ /**
+ * @return help page URL for the accesskey
+ */
+ String getHelpUrl();
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerIdInfo.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerIdInfo.java
index 773e33f..4d30525 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerIdInfo.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerIdInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * 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
@@ -11,8 +11,19 @@
package org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer;
-
+/**
+ * Interface to store ID information
+ *
+ * @see IElementViewerInfoProvider
+ */
public interface IElementViewerIdInfo {
- String getCategory();
- String getHelpUrl();
+ /**
+ * @return category of ID
+ */
+ String getCategory();
+
+ /**
+ * @return help page URL for the ID
+ */
+ String getHelpUrl();
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerInfoProvider.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerInfoProvider.java
index db07663..3050bf2 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerInfoProvider.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerInfoProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * 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
@@ -13,10 +13,29 @@
import java.util.Enumeration;
+/**
+ * Interface to add information to element information viewer. Contributers need
+ * to register the instance to
+ * org.eclipse.actf.visualization.engines.blind.html.elementInfoProvider
+ * extension point.
+ */
public interface IElementViewerInfoProvider {
+ /**
+ * @return categories of IDs
+ */
Enumeration<String> getCategories();
+ /**
+ * @param id
+ * target ID
+ * @return ID information
+ */
IElementViewerIdInfo getIdInfo(String id);
+ /**
+ * @param accessKey
+ * target accesskey
+ * @return accesskey information
+ */
IElementViewerAccessKeyInfo getAccessKeyInfo(String accessKey);
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerManager.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerManager.java
index e138c27..f703287 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerManager.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IElementViewerManager.java
@@ -10,15 +10,34 @@
*******************************************************************************/
package org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer;
+/**
+ * IElementViewerManager is used to control element information viewer
+ */
public interface IElementViewerManager {
+ /**
+ * Set {@link IHighlightElementListener} to highlight corresponding position
+ * of selected item in visualization result
+ *
+ * @param hel
+ * target {@link IHighlightElementListener}
+ */
public abstract void setHighlightElementListener(
IHighlightElementListener hel);
+ /**
+ * Open element information viewer.
+ */
public abstract void openElementViewer();
+ /**
+ * Activate element information viewer if exists.
+ */
public abstract void activateElementViewer();
+ /**
+ * Hide element information viewer if exists.
+ */
public abstract void hideElementViewer();
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IHighlightElementListener.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IHighlightElementListener.java
index d3b415d..2083c63 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IHighlightElementListener.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/IHighlightElementListener.java
@@ -14,8 +14,22 @@
import org.eclipse.actf.visualization.eval.problem.HighlightTargetId;
+/**
+ * Interface to highlight corresponding position of selected item in
+ * visualization result. If visualization view implements this interface, they
+ * can be synchronized with element information view.
+ */
public interface IHighlightElementListener {
+ /**
+ * Clear highlight
+ */
void clearHighlight();
+ /**
+ * Highlight corresponding positions.
+ *
+ * @param targetIdList
+ * target positions as list of {@link HighlightTargetId}
+ */
void highlight(List<HighlightTargetId> targetIdList);
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/CSSViewer.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/CSSViewer.java
index c0230a7..3963bdd 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/CSSViewer.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/CSSViewer.java
@@ -28,76 +28,78 @@
import org.eclipse.ui.PlatformUI;
public class CSSViewer {
-
- private Composite compositeCss;
- private List cssListCon;
+ private Composite compositeCss;
- public CSSViewer(Composite parent) {
- compositeCss = new Composite(parent, SWT.NULL);
- compositeCss.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout gridLayout1 = new GridLayout();
- gridLayout1.numColumns = 1;
- compositeCss.setLayout(gridLayout1);
+ private List cssListCon;
- cssListCon = new List(compositeCss, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- cssListCon.setLayoutData(gridData);
+ public CSSViewer(Composite parent) {
+ compositeCss = new Composite(parent, SWT.NULL);
+ compositeCss.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout gridLayout1 = new GridLayout();
+ gridLayout1.numColumns = 1;
+ compositeCss.setLayout(gridLayout1);
- cssListCon.addMouseListener(new MouseAdapter() {
- public void mouseUp(MouseEvent arg0) {
- if (arg0.stateMask == SWT.BUTTON3) {
- if (cssListCon.getSelectionIndex() >= 0)
- openPopupMenu(cssListCon.getSelectionIndex());
- }
- }
+ cssListCon = new List(compositeCss, SWT.SINGLE | SWT.H_SCROLL
+ | SWT.V_SCROLL | SWT.BORDER);
+ GridData gridData = new GridData(GridData.FILL_BOTH);
+ cssListCon.setLayoutData(gridData);
- // public void mouseDoubleClick(MouseEvent arg0) {
- // if (cssListCon.getSelectionIndex() >= 0)
- // getAndViewFile(cssListCon.getSelectionIndex());
- // }
- });
- }
+ cssListCon.addMouseListener(new MouseAdapter() {
+ public void mouseUp(MouseEvent arg0) {
+ if (arg0.stateMask == SWT.BUTTON3) {
+ if (cssListCon.getSelectionIndex() >= 0)
+ openPopupMenu(cssListCon.getSelectionIndex());
+ }
+ }
- /**
- * @return
- */
- public Composite getCompositeCss() {
- return compositeCss;
- }
+ // public void mouseDoubleClick(MouseEvent arg0) {
+ // if (cssListCon.getSelectionIndex() >= 0)
+ // getAndViewFile(cssListCon.getSelectionIndex());
+ // }
+ });
+ }
- public void setCssSet(Set cssSet) {
- cssListCon.removeAll();
- if (cssSet != null) {
- for (Iterator i = cssSet.iterator(); i.hasNext();) {
- cssListCon.add((String) i.next());
- }
- }
- }
+ /**
+ * @return
+ */
+ public Composite getCompositeCss() {
+ return compositeCss;
+ }
- private void openPopupMenu(int index) {
- String[] itemName = new String[2];
- itemName[0] = "&Copy URL";
- itemName[1] = "&Open";
- boolean[] enabled = new boolean[2];
- enabled[0] = true;
- enabled[1] = true;
- PopupMenu popupMenu = new PopupMenu(new Shell(), itemName, enabled);
- String strRet = popupMenu.open();
- if (strRet.equals(itemName[0])) {
- Clipboard clipboard = new Clipboard(compositeCss.getDisplay());
- clipboard.setContents(new Object[] { cssListCon.getItem(index) }, new Transfer[] { TextTransfer
- .getInstance() });
- } else if (strRet.equals(itemName[1])) {
- getAndViewFile(cssListCon.getSelectionIndex());
- }
- }
+ public void setCssSet(Set<String> cssSet) {
+ cssListCon.removeAll();
+ if (cssSet != null) {
+ for (Iterator<String> i = cssSet.iterator(); i.hasNext();) {
+ cssListCon.add(i.next());
+ }
+ }
+ }
- private void getAndViewFile(int index) {
- try {
- PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(cssListCon.getItem(index));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
+ private void openPopupMenu(int index) {
+ String[] itemName = new String[2];
+ itemName[0] = "&Copy URL";
+ itemName[1] = "&Open";
+ boolean[] enabled = new boolean[2];
+ enabled[0] = true;
+ enabled[1] = true;
+ PopupMenu popupMenu = new PopupMenu(new Shell(), itemName, enabled);
+ String strRet = popupMenu.open();
+ if (strRet.equals(itemName[0])) {
+ Clipboard clipboard = new Clipboard(compositeCss.getDisplay());
+ clipboard.setContents(new Object[] { cssListCon.getItem(index) },
+ new Transfer[] { TextTransfer.getInstance() });
+ } else if (strRet.equals(itemName[1])) {
+ getAndViewFile(cssListCon.getSelectionIndex());
+ }
+ }
+
+ private void getAndViewFile(int index) {
+ try {
+ PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(
+ cssListCon.getItem(index));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementLabelAndColorProvider.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementLabelAndColorProvider.java
index 958f80e..ebf626d 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementLabelAndColorProvider.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementLabelAndColorProvider.java
@@ -9,7 +9,6 @@
* Kentarou FUKUDA - initial API and implementation
*******************************************************************************/
-
package org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.impl;
import java.util.Enumeration;
@@ -25,65 +24,69 @@
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
+public class ElementLabelAndColorProvider extends LabelProvider implements
+ ITableLabelProvider, IColorProvider {
-public class ElementLabelAndColorProvider extends LabelProvider implements ITableLabelProvider, IColorProvider {
+ private static String CATEGORY[];
- private static String CATEGORY[];
+ // TODO more sets
+ private static int[][] BG_COLORS = { { 153, 255, 0 }, { 51, 204, 255 },
+ { 255, 153, 0 }, { 255, 128, 255 }, { 153, 51, 255 },
+ { 0, 255, 153 } };
- // TODO more sets
- private static int[][] BG_COLORS = { { 153, 255, 0 }, { 51, 204, 255 }, { 255, 153, 0 }, { 255, 128, 255 },
- { 153, 51, 255 }, { 0, 255, 153 } };
+ public ElementLabelAndColorProvider() {
+ // if (ParamSystem.isUseInternal()) {
+ IElementViewerInfoProvider[] providers = ElementInfoProviderExtension
+ .getProviders();
+ HashSet<String> tmpS = new HashSet<String>();
+ for (int i = 0; i < providers.length; i++) {
+ Enumeration<String> keys = providers[i].getCategories();
+ while (keys.hasMoreElements()) {
+ tmpS.add((String) keys.nextElement());
+ }
+ }
+ CATEGORY = new String[tmpS.size()];
+ tmpS.toArray(CATEGORY);
+ }
- public ElementLabelAndColorProvider() {
- // if (ParamSystem.isUseInternal()) {
- IElementViewerInfoProvider[] providers = ElementInfoProviderExtension.getProviders();
- HashSet<String> tmpS = new HashSet<String>();
- for (int i = 0; i < providers.length; i++) {
- Enumeration keys = providers[i].getCategories();
- while (keys.hasMoreElements()) {
- tmpS.add((String) keys.nextElement());
- }
- }
- CATEGORY = new String[tmpS.size()];
- tmpS.toArray(CATEGORY);
- }
+ public Image getColumnImage(Object arg0, int arg1) {
+ return null;
+ }
- public Image getColumnImage(Object arg0, int arg1) {
- return null;
- }
+ public String getColumnText(Object arg0, int arg1) {
+ VisualizationAttributeInfo eleInfo = (VisualizationAttributeInfo) arg0;
+ switch (arg1) {
+ case 0:
+ return eleInfo.getCategory();
+ case 1:
+ return eleInfo.getAttributeValue();
+ case 2:
+ return eleInfo.getTagName();
+ case 3:
+ return eleInfo.getDescription();
+ }
+ return null;
+ }
- public String getColumnText(Object arg0, int arg1) {
- VisualizationAttributeInfo eleInfo = (VisualizationAttributeInfo) arg0;
- switch (arg1) {
- case 0:
- return eleInfo.getCategory();
- case 1:
- return eleInfo.getAttributeValue();
- case 2:
- return eleInfo.getTagName();
- case 3:
- return eleInfo.getDescription();
- }
- return null;
- }
+ public Color getForeground(Object arg0) {
+ return null;
+ }
- public Color getForeground(Object arg0) {
- return null;
- }
+ public Color getBackground(Object arg0) {
+ VisualizationAttributeInfo eleInfo = (VisualizationAttributeInfo) arg0;
- public Color getBackground(Object arg0) {
- VisualizationAttributeInfo eleInfo = (VisualizationAttributeInfo) arg0;
-
- for (int i = 0; i < CATEGORY.length; i++) {
- if (eleInfo.getCategory().equals(CATEGORY[i])) {
- // return Display.getCurrent().getSystemColor(
- // backColor[i % backColor.length]);
- // System.out.println(i);
- return new Color(Display.getCurrent(), new RGB(BG_COLORS[i % BG_COLORS.length][0], BG_COLORS[i
- % BG_COLORS.length][1], BG_COLORS[i % BG_COLORS.length][2]));
- }
- }
- return null;
- }
+ for (int i = 0; i < CATEGORY.length; i++) {
+ if (eleInfo.getCategory().equals(CATEGORY[i])) {
+ // return Display.getCurrent().getSystemColor(
+ // backColor[i % backColor.length]);
+ // System.out.println(i);
+ return new Color(Display.getCurrent(), new RGB(BG_COLORS[i
+ % BG_COLORS.length][0],
+ BG_COLORS[i % BG_COLORS.length][1], BG_COLORS[i
+ % BG_COLORS.length][2]));
+ }
+ }
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementViewerJFace.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementViewerJFace.java
index 0584837..52045a6 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementViewerJFace.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ElementViewerJFace.java
@@ -43,299 +43,316 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.PlatformUI;
-
public class ElementViewerJFace {
private IHighlightElementListener prb;
- private int[] sortModeArray;
+ private int[] sortModeArray;
- private Composite elementViewerComposite;
+ private Composite elementViewerComposite;
- private TableViewer viewer;
+ private TableViewer viewer;
- private TableColumn categoryCol;
+ private TableColumn categoryCol;
- private TableColumn descCol;
+ private TableColumn descCol;
- private final static String COL_CATEGORY = "Category";
+ private final static String COL_CATEGORY = "Category";
- private final static String COL_ID_STRING = "Value";
+ private final static String COL_ID_STRING = "Value";
- private final static String COL_TAG_NAME = "Tag Name";
+ private final static String COL_TAG_NAME = "Tag Name";
- private final static String COL_DESCRIPTION = "Description";
+ private final static String COL_DESCRIPTION = "Description";
- private String strHelpUrl;
+ private String strHelpUrl;
- public ElementViewerJFace(Composite parent, IHighlightElementListener _prb) {
+ public ElementViewerJFace(Composite parent, IHighlightElementListener _prb) {
- prb = _prb;
- elementViewerComposite = new Composite(parent, SWT.NULL);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- elementViewerComposite.setLayout(gridLayout);
- elementViewerComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
- final Table table = new Table(elementViewerComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL
- | SWT.FULL_SELECTION | SWT.BORDER);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
+ prb = _prb;
+ elementViewerComposite = new Composite(parent, SWT.NULL);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ elementViewerComposite.setLayout(gridLayout);
+ elementViewerComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ final Table table = new Table(elementViewerComposite, SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
+ table.setLayoutData(new GridData(GridData.FILL_BOTH));
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
- sortModeArray = new int[4];
- categoryCol = new TableColumn(table, SWT.LEFT);
- categoryCol.setText(COL_CATEGORY);
- sortModeArray[0] = 0;
- TableColumn idCol = new TableColumn(table, SWT.LEFT);
- idCol.setText(COL_ID_STRING);
- idCol.setWidth(150);
- sortModeArray[1] = 0;
- TableColumn tagCol = new TableColumn(table, SWT.LEFT);
- tagCol.setText(COL_TAG_NAME);
- tagCol.setWidth(100);
- sortModeArray[2] = 0;
- descCol = new TableColumn(table, SWT.LEFT);
- descCol.setText(COL_DESCRIPTION);
- sortModeArray[3] = 0;
+ sortModeArray = new int[4];
+ categoryCol = new TableColumn(table, SWT.LEFT);
+ categoryCol.setText(COL_CATEGORY);
+ sortModeArray[0] = 0;
+ TableColumn idCol = new TableColumn(table, SWT.LEFT);
+ idCol.setText(COL_ID_STRING);
+ idCol.setWidth(150);
+ sortModeArray[1] = 0;
+ TableColumn tagCol = new TableColumn(table, SWT.LEFT);
+ tagCol.setText(COL_TAG_NAME);
+ tagCol.setWidth(100);
+ sortModeArray[2] = 0;
+ descCol = new TableColumn(table, SWT.LEFT);
+ descCol.setText(COL_DESCRIPTION);
+ sortModeArray[3] = 0;
- table.addMouseListener(new MouseAdapter() {
- public void mouseUp(MouseEvent arg0) {
- if (arg0.stateMask == SWT.BUTTON3) {
- if (table.getSelectionIndex() >= 0)
- openPopupMenu();
- }
- }
- });
- viewer = new TableViewer(table);
+ table.addMouseListener(new MouseAdapter() {
+ public void mouseUp(MouseEvent arg0) {
+ if (arg0.stateMask == SWT.BUTTON3) {
+ if (table.getSelectionIndex() >= 0)
+ openPopupMenu();
+ }
+ }
+ });
+ viewer = new TableViewer(table);
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent arg0) {
- List list = new ArrayList();
- for (Iterator i = ((IStructuredSelection) arg0.getSelection()).iterator(); i.hasNext();) {
- list.add(i.next());
- }
- if (list.size() > 0) {
- viewerSelected(list);
- }
- }
- });
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(SelectionChangedEvent arg0) {
+ List<VisualizationAttributeInfo> list = new ArrayList<VisualizationAttributeInfo>();
+ for (Iterator i = ((IStructuredSelection) arg0.getSelection())
+ .iterator(); i.hasNext();) {
+ Object tmpO = i.next();
+ if (tmpO instanceof VisualizationAttributeInfo) {
+ list.add((VisualizationAttributeInfo) tmpO);
+ }
+ }
+ if (list.size() > 0) {
+ viewerSelected(list);
+ }
+ }
+ });
- categoryCol.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- toggleCurrentSortMode(0);
- if (sortModeArray[0] == -2) {
- sortByNodeId();
- } else {
- viewer.setSorter(new ViewerSorter() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- int iRes;
- if (e1 == null) {
- iRes = -1;
- } else if (e2 == null) {
- iRes = 1;
- } else {
- String str1, str2;
- str1 = ((VisualizationAttributeInfo) e1).getCategory();
- str2 = ((VisualizationAttributeInfo) e2).getCategory();
- if (str1.equals("")) {
- return 1;
- } else if (str2.equals("")) {
- return -1;
- }
- iRes = str1.compareToIgnoreCase(str2);
- }
- return iRes * sortModeArray[0];
- }
- });
- }
- }
- });
+ categoryCol.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ toggleCurrentSortMode(0);
+ if (sortModeArray[0] == -2) {
+ sortByNodeId();
+ } else {
+ viewer.setSorter(new ViewerSorter() {
+ public int compare(Viewer iviewer, Object e1, Object e2) {
+ int iRes;
+ if (e1 == null) {
+ iRes = -1;
+ } else if (e2 == null) {
+ iRes = 1;
+ } else {
+ String str1, str2;
+ str1 = ((VisualizationAttributeInfo) e1)
+ .getCategory();
+ str2 = ((VisualizationAttributeInfo) e2)
+ .getCategory();
+ if (str1.equals("")) {
+ return 1;
+ } else if (str2.equals("")) {
+ return -1;
+ }
+ iRes = str1.compareToIgnoreCase(str2);
+ }
+ return iRes * sortModeArray[0];
+ }
+ });
+ }
+ }
+ });
- idCol.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- toggleCurrentSortMode(1);
- if (sortModeArray[1] == -2) {
- sortByNodeId();
- } else {
- viewer.setSorter(new ViewerSorter() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- int iRes;
- if (e1 == null) {
- iRes = -1;
- } else if (e2 == null) {
- iRes = 1;
- } else {
- iRes = ((VisualizationAttributeInfo) e1).getAttributeValue().compareToIgnoreCase(
- ((VisualizationAttributeInfo) e2).getAttributeValue());
- }
- return iRes * sortModeArray[1];
- }
- });
- }
- }
- });
+ idCol.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ toggleCurrentSortMode(1);
+ if (sortModeArray[1] == -2) {
+ sortByNodeId();
+ } else {
+ viewer.setSorter(new ViewerSorter() {
+ public int compare(Viewer iviewer, Object e1, Object e2) {
+ int iRes;
+ if (e1 == null) {
+ iRes = -1;
+ } else if (e2 == null) {
+ iRes = 1;
+ } else {
+ iRes = ((VisualizationAttributeInfo) e1)
+ .getAttributeValue()
+ .compareToIgnoreCase(
+ ((VisualizationAttributeInfo) e2)
+ .getAttributeValue());
+ }
+ return iRes * sortModeArray[1];
+ }
+ });
+ }
+ }
+ });
- tagCol.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- toggleCurrentSortMode(2);
- if (sortModeArray[2] == -2) {
- sortByNodeId();
- } else {
- viewer.setSorter(new ViewerSorter() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- int iRes;
- if (e1 == null) {
- iRes = -1;
- } else if (e2 == null) {
- iRes = 1;
- } else {
- iRes = ((VisualizationAttributeInfo) e1).getTagName().compareToIgnoreCase(
- ((VisualizationAttributeInfo) e2).getTagName());
- }
- return iRes * sortModeArray[2];
- }
- });
- }
- }
- });
+ tagCol.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ toggleCurrentSortMode(2);
+ if (sortModeArray[2] == -2) {
+ sortByNodeId();
+ } else {
+ viewer.setSorter(new ViewerSorter() {
+ public int compare(Viewer iviewer, Object e1, Object e2) {
+ int iRes;
+ if (e1 == null) {
+ iRes = -1;
+ } else if (e2 == null) {
+ iRes = 1;
+ } else {
+ iRes = ((VisualizationAttributeInfo) e1)
+ .getTagName()
+ .compareToIgnoreCase(
+ ((VisualizationAttributeInfo) e2)
+ .getTagName());
+ }
+ return iRes * sortModeArray[2];
+ }
+ });
+ }
+ }
+ });
- descCol.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- toggleCurrentSortMode(3);
- if (sortModeArray[3] == -2) {
- sortByNodeId();
- } else {
- viewer.setSorter(new ViewerSorter() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- int iRes;
- if (e1 == null) {
- iRes = -1;
- } else if (e2 == null) {
- iRes = 1;
- } else {
- String str1, str2;
- str1 = ((VisualizationAttributeInfo) e1).getDescription();
- str2 = ((VisualizationAttributeInfo) e2).getDescription();
- if (str1.equals("")) {
- return 1;
- } else if (str2.equals("")) {
- return -1;
- }
- iRes = str1.compareToIgnoreCase(str2);
- }
- return iRes * sortModeArray[3];
- }
- });
- }
- }
- });
+ descCol.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ toggleCurrentSortMode(3);
+ if (sortModeArray[3] == -2) {
+ sortByNodeId();
+ } else {
+ viewer.setSorter(new ViewerSorter() {
+ public int compare(Viewer iviewer, Object e1, Object e2) {
+ int iRes;
+ if (e1 == null) {
+ iRes = -1;
+ } else if (e2 == null) {
+ iRes = 1;
+ } else {
+ String str1, str2;
+ str1 = ((VisualizationAttributeInfo) e1)
+ .getDescription();
+ str2 = ((VisualizationAttributeInfo) e2)
+ .getDescription();
+ if (str1.equals("")) {
+ return 1;
+ } else if (str2.equals("")) {
+ return -1;
+ }
+ iRes = str1.compareToIgnoreCase(str2);
+ }
+ return iRes * sortModeArray[3];
+ }
+ });
+ }
+ }
+ });
- }
+ }
- private void viewerSelected(List list) {
- prb.clearHighlight();
- VisualizationAttributeInfo selected = null;
+ private void viewerSelected(List<VisualizationAttributeInfo> list) {
+ prb.clearHighlight();
+ VisualizationAttributeInfo selected = null;
- Vector<HighlightTargetId> tmpV = new Vector<HighlightTargetId>();
-
- for (int i = 0; i < list.size(); i++) {
- selected = (VisualizationAttributeInfo) list.get(i);
- tmpV.add(new HighlightTargetId(selected.getNodeId(),selected.getNodeId()));
- if (i==0){
- strHelpUrl = selected.getHelpUrl();
- }else if (!strHelpUrl.equals(selected.getHelpUrl())){
- strHelpUrl = "";
- }
- }
+ Vector<HighlightTargetId> tmpV = new Vector<HighlightTargetId>();
- prb.highlight(tmpV);
-
- IModelService dataSource = ModelServiceUtils.getActiveModelService();
- if(dataSource!=null && dataSource instanceof IWebBrowserACTF){
- ((IWebBrowserACTF)dataSource).hightlightElementByAttribute(selected.getAttribtueName(), selected.getAttributeValue());
- }
-
- }
+ for (int i = 0; i < list.size(); i++) {
+ selected = list.get(i);
+ tmpV.add(new HighlightTargetId(selected.getNodeId(), selected
+ .getNodeId()));
+ if (i == 0) {
+ strHelpUrl = selected.getHelpUrl();
+ } else if (!strHelpUrl.equals(selected.getHelpUrl())) {
+ strHelpUrl = "";
+ }
+ }
- private void toggleCurrentSortMode(int sortKind) {
- switch (sortModeArray[sortKind]) {
- case -2:
- sortModeArray[sortKind] = 1;
- break;
- case -1:
- sortModeArray[sortKind] = -2;
- break;
- case 0:
- sortModeArray[sortKind] = 1;
- break;
- case 1:
- sortModeArray[sortKind] = -1;
- break;
- }
- }
+ prb.highlight(tmpV);
- private void sortByNodeId() {
- viewer.setSorter(new ViewerSorter() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- int iRes;
- if (e1 == null) {
- iRes = -1;
- } else if (e2 == null) {
- iRes = 1;
- } else {
- iRes = ((VisualizationAttributeInfo) e1).getNodeId()
- - ((VisualizationAttributeInfo) e2).getNodeId();
- }
- return iRes;
- }
- });
- }
+ IModelService dataSource = ModelServiceUtils.getActiveModelService();
+ if (dataSource != null && dataSource instanceof IWebBrowserACTF) {
+ ((IWebBrowserACTF) dataSource).hightlightElementByAttribute(
+ selected.getAttribtueName(), selected.getAttributeValue());
+ }
- private void openPopupMenu() {
- String[] itemName = new String[2];
- itemName[0] = "Select";
- itemName[1] = "View Help...";
- boolean[] enabled = new boolean[2];
- enabled[0] = true;
- enabled[1] = true;
- if (strHelpUrl.equals("")){
- enabled[1] = false;
- }
- PopupMenu popupMenu = new PopupMenu(new Shell(), itemName, enabled);
- String strRet = popupMenu.open();
- if (strRet.equals(itemName[1])) {
- PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(strHelpUrl);
- }
- }
+ }
- /**
- * @return
- */
- public Composite getComposite() {
- return elementViewerComposite;
- }
+ private void toggleCurrentSortMode(int sortKind) {
+ switch (sortModeArray[sortKind]) {
+ case -2:
+ sortModeArray[sortKind] = 1;
+ break;
+ case -1:
+ sortModeArray[sortKind] = -2;
+ break;
+ case 0:
+ sortModeArray[sortKind] = 1;
+ break;
+ case 1:
+ sortModeArray[sortKind] = -1;
+ break;
+ }
+ }
- public void setContentProvider(IStructuredContentProvider contentProvider) {
- viewer.setContentProvider(contentProvider);
- }
+ private void sortByNodeId() {
+ viewer.setSorter(new ViewerSorter() {
+ public int compare(Viewer iviewer, Object e1, Object e2) {
+ int iRes;
+ if (e1 == null) {
+ iRes = -1;
+ } else if (e2 == null) {
+ iRes = 1;
+ } else {
+ iRes = ((VisualizationAttributeInfo) e1).getNodeId()
+ - ((VisualizationAttributeInfo) e2).getNodeId();
+ }
+ return iRes;
+ }
+ });
+ }
- public void setLabelProvider(ITableLabelProvider labelProvider) {
- viewer.setLabelProvider(labelProvider);
- }
+ private void openPopupMenu() {
+ String[] itemName = new String[2];
+ itemName[0] = "Select";
+ itemName[1] = "View Help...";
+ boolean[] enabled = new boolean[2];
+ enabled[0] = true;
+ enabled[1] = true;
+ if (strHelpUrl.equals("")) {
+ enabled[1] = false;
+ }
+ PopupMenu popupMenu = new PopupMenu(new Shell(), itemName, enabled);
+ String strRet = popupMenu.open();
+ if (strRet.equals(itemName[1])) {
+ PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(
+ strHelpUrl);
+ }
+ }
- public void setElementList(List eleList) {
- viewer.setInput(eleList);
- }
+ /**
+ * @return
+ */
+ public Composite getComposite() {
+ return elementViewerComposite;
+ }
- public void setCategoryColWidth(int width) {
- categoryCol.setWidth(width);
- if (width == 0)
- categoryCol.setResizable(false);
- }
+ public void setContentProvider(IStructuredContentProvider contentProvider) {
+ viewer.setContentProvider(contentProvider);
+ }
- public void setDescColWidth(int width) {
- descCol.setWidth(width);
- if (width == 0)
- descCol.setResizable(false);
- }
+ public void setLabelProvider(ITableLabelProvider labelProvider) {
+ viewer.setLabelProvider(labelProvider);
+ }
+
+ public void setElementList(List<VisualizationAttributeInfo> eleList) {
+ viewer.setInput(eleList);
+ }
+
+ public void setCategoryColWidth(int width) {
+ categoryCol.setWidth(width);
+ if (width == 0)
+ categoryCol.setResizable(false);
+ }
+
+ public void setDescColWidth(int width) {
+ descCol.setWidth(width);
+ if (width == 0)
+ descCol.setResizable(false);
+ }
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ViewerPanelJFace.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ViewerPanelJFace.java
index db3c541..cc2d95d 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ViewerPanelJFace.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/ViewerPanelJFace.java
@@ -18,6 +18,7 @@
import org.eclipse.actf.model.ui.util.ModelServiceUtils;
import org.eclipse.actf.visualization.engines.blind.BlindVizResourceUtil;
import org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.IHighlightElementListener;
+import org.eclipse.actf.visualization.internal.engines.blind.html.util.VisualizationAttributeInfo;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@@ -37,7 +38,7 @@
public class ViewerPanelJFace implements IViewerPanel {
private Shell shell;
- private List idList;
+ private List<VisualizationAttributeInfo> idList;
private IHighlightElementListener prb;
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/VisualizeStyleInfoManager.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/VisualizeStyleInfoManager.java
index 6614dfb..ff8b872 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/VisualizeStyleInfoManager.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/ui/elementViewer/impl/VisualizeStyleInfoManager.java
@@ -14,8 +14,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-
-
public class VisualizeStyleInfoManager {
private static VisualizeStyleInfoManager INSTANCE;
@@ -40,8 +38,9 @@
}
public void fireVisualizeStyleInfoUpdate(VisualizeStyleInfo styleInfo) {
- for (Iterator i = listeners.iterator(); i.hasNext();) {
- ((IVisualizeStyleInfoListener) i.next()).update(styleInfo);
+ for (Iterator<IVisualizeStyleInfoListener> i = listeners.iterator(); i
+ .hasNext();) {
+ (i.next()).update(styleInfo);
}
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/eval/HtmlErrorLogListener.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/HtmlErrorLogListener.java
similarity index 98%
rename from plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/eval/HtmlErrorLogListener.java
rename to plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/HtmlErrorLogListener.java
index 05c2ce3..185738e 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/eval/HtmlErrorLogListener.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/HtmlErrorLogListener.java
@@ -9,7 +9,7 @@
* Kentarou FUKUDA - initial API and implementation
*******************************************************************************/
-package org.eclipse.actf.visualization.engines.blind.html.eval;
+package org.eclipse.actf.visualization.engines.blind.html.util;
import java.util.Vector;
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/Id2LineViaAccId.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/Id2LineViaAccId.java
deleted file mode 100644
index fbfb592..0000000
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/Id2LineViaAccId.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * 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.engines.blind.html.util;
-
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.actf.visualization.util.html2view.Html2ViewMapData;
-
-public class Id2LineViaAccId {
- private Map<Integer, Integer> id2AccId;
-
- private Vector<Html2ViewMapData> html2ViewMapDataV;
-
- // TODO
- private boolean is1base = true;
-
- public Id2LineViaAccId(Map<Integer, Integer> id2AccId,
- Vector<Html2ViewMapData> html2ViewMapDataV) {
- this(id2AccId, html2ViewMapDataV, true);
- }
-
- public Id2LineViaAccId(Map<Integer, Integer> id2AccId,
- Vector<Html2ViewMapData> html2ViewMapDataV, boolean is1base) {
- this.id2AccId = id2AccId;
- this.html2ViewMapDataV = html2ViewMapDataV;
- this.is1base = is1base;
- }
-
- public int getLine(int nodeId) {
- int result = -1;
- Integer id = new Integer(nodeId);
-
- if (id2AccId.containsKey(id)) {
- int accId = id2AccId.get(id).intValue();
- if (accId > -1 && accId < html2ViewMapDataV.size()) {
- Html2ViewMapData tmpData = html2ViewMapDataV.get(accId);
- result = tmpData.getStartLine();// ? +1 ?
- }
- }
-
- return (result);
- }
-
- public Html2ViewMapData getViewMapData(int nodeId) {
- return (getViewMapData(new Integer(nodeId)));
- }
-
- public Html2ViewMapData getViewMapData(Integer nodeId) {
- Html2ViewMapData result = null;
- if (id2AccId.containsKey(nodeId)) {
- int accId = id2AccId.get(nodeId).intValue();
- if (accId > -1 && accId < html2ViewMapDataV.size()) {
- result = html2ViewMapDataV.get(accId);
- }
- }
- return (result);
- }
-
- public boolean is1base() {
- return is1base;
- }
-
-}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/Id2LineViaActfId.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/Id2LineViaActfId.java
new file mode 100644
index 0000000..05beab0
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/Id2LineViaActfId.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * 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.engines.blind.html.util;
+
+import java.util.Map;
+import java.util.Vector;
+
+import org.eclipse.actf.visualization.util.html2view.Html2ViewMapData;
+
+/**
+ * Utility class for mapping information between HTML IDs and line number of
+ * source HTML. This class uses ACTF_ID to create the mapping information.
+ */
+public class Id2LineViaActfId {
+ private Map<Integer, Integer> id2ActfId;
+
+ private Vector<Html2ViewMapData> html2ViewMapDataV;
+
+ // TODO
+ private boolean is1base = true;
+
+ /**
+ * Constructor of the class.
+ *
+ * @param id2AccId
+ * mapping information between ID and ACTF_ID
+ * @param html2ViewMapDataV
+ * mapping information between ACTF_ID and line number. ACTF_ID
+ * is used as index of Vector.
+ */
+ public Id2LineViaActfId(Map<Integer, Integer> id2AccId,
+ Vector<Html2ViewMapData> html2ViewMapDataV) {
+ this(id2AccId, html2ViewMapDataV, true);
+ }
+
+ /**
+ * Constructor of the class.
+ *
+ * @param id2AccId
+ * mapping information between ID and ACTF_ID
+ * @param html2ViewMapDataV
+ * mapping information between ACTF_ID and line number. ACTF_ID
+ * is used as index of Vector.
+ * @param is1base
+ * true if line number starts from 1<br>
+ * false if line number starts from 0
+ */
+ public Id2LineViaActfId(Map<Integer, Integer> id2AccId,
+ Vector<Html2ViewMapData> html2ViewMapDataV, boolean is1base) {
+ this.id2ActfId = id2AccId;
+ this.html2ViewMapDataV = html2ViewMapDataV;
+ this.is1base = is1base;
+ }
+
+ /**
+ * Get corresponding line number from ID
+ *
+ * @param nodeId
+ * target ID
+ * @return line number
+ */
+ public int getLine(int nodeId) {
+ int result = -1;
+ Integer id = new Integer(nodeId);
+
+ if (id2ActfId.containsKey(id)) {
+ int accId = id2ActfId.get(id).intValue();
+ if (accId > -1 && accId < html2ViewMapDataV.size()) {
+ Html2ViewMapData tmpData = html2ViewMapDataV.get(accId);
+ result = tmpData.getStartLine();// ? +1 ?
+ }
+ }
+
+ return (result);
+ }
+
+ /**
+ * Get corresponding {@link Html2ViewMapData} of target ID
+ *
+ * @param nodeId
+ * target ID
+ * @return corresponding {@link Html2ViewMapData}
+ */
+ public Html2ViewMapData getViewMapData(int nodeId) {
+ return (getViewMapData(new Integer(nodeId)));
+ }
+
+ /**
+ * Get corresponding {@link Html2ViewMapData} of target ID
+ *
+ * @param nodeId
+ * target ID
+ * @return corresponding {@link Html2ViewMapData}
+ */
+ public Html2ViewMapData getViewMapData(Integer nodeId) {
+ Html2ViewMapData result = null;
+ if (id2ActfId.containsKey(nodeId)) {
+ int accId = id2ActfId.get(nodeId).intValue();
+ if (accId > -1 && accId < html2ViewMapDataV.size()) {
+ result = html2ViewMapDataV.get(accId);
+ }
+ }
+ return (result);
+ }
+
+ /**
+ * @return true if line number starts from 1
+ */
+ public boolean is1base() {
+ return is1base;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/VisualizeReportUtil.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/VisualizeReportUtil.java
index 9ae2edb..0af5405 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/VisualizeReportUtil.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/util/VisualizeReportUtil.java
@@ -6,6 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
+ * Hironobu TAKAGI - initial API and implementation
* Kentarou FUKUDA - initial API and implementation
*******************************************************************************/
@@ -34,10 +35,21 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+/**
+ * Utility class for visualization report
+ */
public class VisualizeReportUtil {
// move from VisualizeEngine
+ /**
+ * Create overall evaluation result HTML
+ *
+ * @param targetFile
+ * target file to save evaluation result HTML
+ * @param pageEval
+ * target evaluation result
+ */
public static void createReport(File targetFile, PageEvaluation pageEval) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
@@ -109,14 +121,26 @@
}
+ /**
+ * Append rating table and title into report HTML
+ *
+ * @param pageEval
+ * target evaluation result
+ * @param imageDir
+ * image directory
+ * @param document
+ * report HTML {@link Document}
+ * @param target
+ * target Node to append evaluation result
+ */
public static void appendRatingTableAndTitle(PageEvaluation pageEval,
- String imageBriefDir, Document document, Node target) {
+ String imageDir, Document document, Node target) {
String[] ratingStr = pageEval.getAllResult();
Element p = document.createElement("div");
Element img = document.createElement("img");
- img.setAttribute("src", imageBriefDir + pageEval.getRatingIcon());
+ img.setAttribute("src", imageDir + pageEval.getRatingIcon());
img.setAttribute("alt", "");
p.appendChild(img);
@@ -158,6 +182,15 @@
target.appendChild(table);
}
+ /**
+ * Visualize {@link IProblemItem} into visualization result HTML by using
+ * exclamation icon with error message as alt text.
+ *
+ * @param resultDoc
+ * visualization result HTML to add error icons
+ * @param problem
+ * target problem information
+ */
public static void visualizeError(Document resultDoc, IProblemItem problem) {
Element imageElem = (Element) problem.getTargetNode();
if (imageElem != null) {
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/eval/BlindProblem.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/BlindProblem.java
similarity index 70%
rename from plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/eval/BlindProblem.java
rename to plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/BlindProblem.java
index 8bf1754..5bc9daa 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/eval/BlindProblem.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/BlindProblem.java
@@ -10,92 +10,28 @@
* Kentarou FUKUDA - initial API and implementation
*******************************************************************************/
-package org.eclipse.actf.visualization.engines.blind.html.eval;
+package org.eclipse.actf.visualization.internal.engines.blind.html;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
-import org.eclipse.actf.visualization.engines.blind.html.util.Id2LineViaAccId;
+import org.eclipse.actf.visualization.engines.blind.html.IBlindProblem;
+import org.eclipse.actf.visualization.engines.blind.html.util.Id2LineViaActfId;
import org.eclipse.actf.visualization.eval.problem.HighlightTargetId;
import org.eclipse.actf.visualization.eval.problem.HighlightTargetSourceInfo;
import org.eclipse.actf.visualization.eval.problem.IProblemItem;
import org.eclipse.actf.visualization.eval.problem.ProblemItemImpl;
import org.eclipse.actf.visualization.util.html2view.Html2ViewMapData;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-public class BlindProblem extends ProblemItemImpl implements IProblemItem {
-
- public static final int NO_ALT_IMG = 0;
-
- public static final int NO_ALT_INPUT = 1;
-
- public static final int NO_ALT_AREA = 2;
-
- public static final int WRONG_ALT_IMG = 4;
-
- public static final int WRONG_ALT_INPUT = 5;// TODO
-
- public static final int WRONG_ALT_AREA = 6;
-
- public static final int NO_DEST_LINK = 8;
-
- public static final int REDUNDANT_ALT = 9;
-
- public static final int NO_SKIPTOMAIN_LINK = 10;// without structure
-
- public static final int TOO_LESS_STRUCTURE = 12;
-
- public static final int NO_TEXT_INTRAPAGELINK = 14;
-
- public static final int WRONG_TEXT = 15;
-
- public static final int NO_ID_INPUT = 16; // TODO
-
- public static final int TOOFAR_SKIPTOMAIN_LINK = 17;
-
- public static final int NO_DEST_SKIP_LINK = 18;
-
- public static final int WRONG_SKIP_LINK_TEXT = 19;
-
- public static final int NO_SKIPTOMAIN_WITH_STRUCTURE = 20;
-
- public static final int ALERT_NO_SKIPTOMAIN_NO_STRUCTURE = 21;
-
- public static final int LESS_STRUCTURE_WITH_SKIPLINK = 22;
-
- public static final int LESS_STRUCTURE_WITH_HEADING = 23;
-
- public static final int LESS_STRUCTURE_WITH_BOTH = 24;
-
- public static final int NO_TEXT_WITH_TITLE_INTRAPAGELINK = 25;
-
- public static final int WRONG_SKIP_LINK_TITLE = 26;
-
- public static final int ALERT_WRONG_ALT = 27;
-
- public static final int ALERT_REDUNDANT_TEXT = 28; // TODO
-
- public static final int SEPARATE_DBCS_ALT_IMG = 29;
-
- public static final int SEPARATE_DBCS_ALT_INPUT = 30; // TODO
-
- public static final int SEPARATE_DBCS_ALT_AREA = 31;
-
- public static final int ALERT_NO_DEST_INTRA_LINK = 33;
-
- public static final int ALERT_SPELL_OUT = 34;
-
- public static final int INVISIBLE_INTRAPAGE_LINK = 35;
-
- public static final int NO_VALUE_INPUT_BUTTON = 36;
-
- public static final int SEPARATE_DBCS_INPUT_VALUE = 37;
-
- public static final int NUM_PROBLEMS = 38;// max id+1
-
- // ////////////////////////////////////////////////////
+/**
+ * Implementation of {@link IProblemItem} for detected problems through blind
+ * visualization
+ */
+public class BlindProblem extends ProblemItemImpl implements IBlindProblem {
private List<Node> nodeList = null;
@@ -107,6 +43,9 @@
/**
* Constructor for BlindProblem.
+ *
+ * @param _subtype
+ * subType of problem
*/
public BlindProblem(int _subtype) {
this(_subtype, "");
@@ -114,6 +53,11 @@
/**
* Constructor for BlindProblem.
+ *
+ * @param _subtype
+ * subType of problem
+ * @param targetString
+ * target String to be embedded to error description
*/
public BlindProblem(int _subtype, String targetString) {
super("B_" + Integer.toString(_subtype));
@@ -123,7 +67,6 @@
nodeList = new Vector<Node>();
setTargetString(targetString);
- // for HPB? use ReportUtil?
switch (_subtype) {
case WRONG_ALT_IMG:
case WRONG_ALT_INPUT:
@@ -149,9 +92,7 @@
}
/**
- * Returns the node.
- *
- * @return Node
+ * @return target Node in visualization result {@link Document}
*/
public Node getTargetNodeInResultDoc() {
if (nodeList.size() > 0) {
@@ -162,57 +103,55 @@
}
/**
- * Sets the node.
+ * Set target {@link Node}
*
* @param node
- * The node to set
+ * target Node
*/
public void setNode(Node node) {
nodeList.add(0, node);
}
/**
- * Adds the node.
+ * Add additional target {@link Node}
*
* @param node
- * The node to set
+ * additional target Node
*/
public void addNode(Node node) {
nodeList.add(node);
}
/**
- * Sets the node.
+ * Sets target {@link Node} and ID of Node
*
* @param node
- * The node to set
+ * target Node
+ * @param id
+ * target ID
*/
public void setNode(Node node, int id) {
nodeList.add(0, node);
this.nodeId = id;
}
- /**
- * @see java.lang.Object#toString()
- */
public String toString() {
return "node=" + nodeId + ":" + getDescription();
}
/**
- * Returns the nodeList.
- *
- * @return List
+ * @return List of target {@link Node}
*/
public List<Node> getNodeList() {
return nodeList;
}
/**
- * Sets the nodeId.
+ * Sets the ID of target {@link Node}.
*
* @param nodeId
- * The nodeId to set
+ * target Node ID
+ * @return true if former target Node ID was not set yet
*/
public boolean setNodeId(int nodeId) {
if (this.nodeId == -1) {
@@ -223,6 +162,11 @@
}
}
+ /**
+ * Add {@link HighlightTargetId}
+ *
+ * @param target
+ */
public void addNodeIds(HighlightTargetId target) {
isMulti = true;
idsList.add(target);
@@ -255,7 +199,10 @@
return result;
}
- public void setLineNumber(Id2LineViaAccId id2line) {
+ /**
+ * @param id2line
+ */
+ public void setLineNumber(Id2LineViaActfId id2line) {
switch (subType) {
case WRONG_TEXT:
@@ -339,8 +286,4 @@
}
}
}
-
- public int getProblemSubType() {
- return (subType);
- }
}
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java
index 10e2b19..628684c 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java
@@ -15,9 +15,10 @@
import java.util.Vector;
import org.eclipse.actf.visualization.engines.blind.TextChecker;
+import org.eclipse.actf.visualization.engines.blind.html.IBlindProblem;
import org.eclipse.actf.visualization.engines.blind.html.VisualizeEngine;
-import org.eclipse.actf.visualization.engines.blind.html.eval.BlindProblem;
import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.internal.engines.blind.html.BlindProblem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -121,7 +122,7 @@
if (!areaE.hasAttribute("alt")) {
if (areaE.hasAttribute("href")) {
- prob = new BlindProblem(BlindProblem.NO_ALT_AREA,
+ prob = new BlindProblem(IBlindProblem.NO_ALT_AREA,
mapEl.getAttribute("name") + " , href=\""
+ areaE.getAttribute("href") + "\"");
prob.setTargetNode(mapData.getOrigNode(areaE));
@@ -131,12 +132,12 @@
if (alt.length() > 0) {
if (textChecker.isInappropriateAlt(alt)) {
prob = new BlindProblem(
- BlindProblem.WRONG_ALT_AREA, alt);
+ IBlindProblem.WRONG_ALT_AREA, alt);
} else if (textChecker
.isSeparatedJapaneseChars(alt)) {
prob = new BlindProblem(
- BlindProblem.SEPARATE_DBCS_ALT_AREA,
+ IBlindProblem.SEPARATE_DBCS_ALT_AREA,
alt);
}
@@ -144,7 +145,7 @@
} else {
if (areaE.hasAttribute("href")) {
prob = new BlindProblem(
- BlindProblem.WRONG_ALT_AREA, alt);
+ IBlindProblem.WRONG_ALT_AREA, alt);
}
}
if (prob != null) {
@@ -165,7 +166,7 @@
idObj = mapData.getIdOfNode(areaE);
- if (checkItems[prob.getProblemSubType()]) {
+ if (checkItems[prob.getSubType()]) {
Element errorImg = doc.createElement("img");
errorImg.setAttribute("alt", "error icon");
errorImg.setAttribute("title", prob
@@ -197,29 +198,29 @@
BlindProblem prob = null;
if (!img.hasAttribute("alt")) {
- prob = new BlindProblem(BlindProblem.NO_ALT_IMG, img
+ prob = new BlindProblem(IBlindProblem.NO_ALT_IMG, img
.getAttribute("src"));
noAltError = true;
} else {
altS = img.getAttribute("alt");
if (altS.length() > 0) {
if (textChecker.isInappropriateAlt(altS)) {
- prob = new BlindProblem(BlindProblem.WRONG_ALT_IMG, altS);
+ prob = new BlindProblem(IBlindProblem.WRONG_ALT_IMG, altS);
} else if (textChecker.isSeparatedJapaneseChars(altS)) {
- prob = new BlindProblem(BlindProblem.SEPARATE_DBCS_ALT_IMG,
+ prob = new BlindProblem(IBlindProblem.SEPARATE_DBCS_ALT_IMG,
altS);
} else {
switch (textChecker.checkInappropriateAlt(altS)) {
case 3:
- prob = new BlindProblem(BlindProblem.ALERT_SPELL_OUT,
+ prob = new BlindProblem(IBlindProblem.ALERT_SPELL_OUT,
altS);
break;
case 2:
- prob = new BlindProblem(BlindProblem.WRONG_ALT_IMG,
+ prob = new BlindProblem(IBlindProblem.WRONG_ALT_IMG,
altS);
break;
case 1:
- prob = new BlindProblem(BlindProblem.ALERT_WRONG_ALT,
+ prob = new BlindProblem(IBlindProblem.ALERT_WRONG_ALT,
altS);
break;
case 0:
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/LinkAnalyzer.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/LinkAnalyzer.java
index d8cbf62..bc47f72 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/LinkAnalyzer.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/LinkAnalyzer.java
@@ -22,13 +22,14 @@
import java.util.Vector;
import org.eclipse.actf.visualization.engines.blind.ParamBlind;
-import org.eclipse.actf.visualization.engines.blind.html.eval.BlindProblem;
+import org.eclipse.actf.visualization.engines.blind.html.IBlindProblem;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacket;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacketCollection;
import org.eclipse.actf.visualization.eval.html.HtmlTagUtil;
import org.eclipse.actf.visualization.eval.html.statistics.PageData;
import org.eclipse.actf.visualization.eval.problem.HighlightTargetId;
import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.internal.engines.blind.html.BlindProblem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -131,7 +132,7 @@
words += textCounter.getWordCount(linkTitleOrg);
if (words > 0) {
prob = new BlindProblem(
- BlindProblem.NO_TEXT_WITH_TITLE_INTRAPAGELINK,
+ IBlindProblem.NO_TEXT_WITH_TITLE_INTRAPAGELINK,
linkTitle);
prob.setTargetNode(mapData.getOrigNode(curEl));
@@ -167,13 +168,13 @@
} else {
if (linkTitle.matches(WRONG_SKIPLINK_DEFINITION)) {
prob = new BlindProblem(
- BlindProblem.WRONG_SKIP_LINK_TITLE,
+ IBlindProblem.WRONG_SKIP_LINK_TITLE,
linkText);
}
if (linkText.matches(WRONG_SKIPLINK_DEFINITION)) {
prob = new BlindProblem(
- BlindProblem.WRONG_SKIP_LINK_TEXT,
+ IBlindProblem.WRONG_SKIP_LINK_TEXT,
linkText);
}
}
@@ -186,7 +187,7 @@
// TODO append text -> result?
} else {
prob = new BlindProblem(
- BlindProblem.NO_TEXT_INTRAPAGELINK, href);
+ IBlindProblem.NO_TEXT_INTRAPAGELINK, href);
if (!(curEl.hasAttribute("onclick") || curEl
.hasAttribute("onmouseover"))) {
@@ -233,7 +234,7 @@
if (invisibleIdSet.contains(idS)) {
// System.out.println(idS);
BlindProblem prob = new BlindProblem(
- BlindProblem.INVISIBLE_INTRAPAGE_LINK, "\""
+ IBlindProblem.INVISIBLE_INTRAPAGE_LINK, "\""
+ HtmlTagUtil.getTextAltDescendant(lel)
+ "\"(href=#" + href + ", id=" + idS + ") ");
prob.setTargetNode(mapData.getOrigNode(lel));
@@ -289,10 +290,10 @@
if (skipLinkMap.containsKey(lel)) {
if (href.matches(".*top.*") || toTop) {// TBD accuracy
prob = new BlindProblem(
- BlindProblem.ALERT_NO_DEST_INTRA_LINK, href);
+ IBlindProblem.ALERT_NO_DEST_INTRA_LINK, href);
} else {
prob = new BlindProblem(
- BlindProblem.NO_DEST_SKIP_LINK, href);
+ IBlindProblem.NO_DEST_SKIP_LINK, href);
// TODO onclick?
intralinkErrorCount++;
skiplinkErrorCount++;
@@ -302,9 +303,9 @@
} else {
if (href.matches(".*top.*") || toTop) {// TBD accuracy
prob = new BlindProblem(
- BlindProblem.ALERT_NO_DEST_INTRA_LINK, href);
+ IBlindProblem.ALERT_NO_DEST_INTRA_LINK, href);
} else {
- prob = new BlindProblem(BlindProblem.NO_DEST_LINK,
+ prob = new BlindProblem(IBlindProblem.NO_DEST_LINK,
href);
if (!(lel.hasAttribute("onClick") || lel
.hasAttribute("onmouseover"))) {
@@ -462,26 +463,26 @@
if (headingCount > 0 || forwardIntraLinkCount > 0) {
if (maxTime >= MIN_MAX_TIME_TO_ELIMINATE_SKIP_LINK) {
problemV.add(new BlindProblem(
- BlindProblem.NO_SKIPTOMAIN_WITH_STRUCTURE));
+ IBlindProblem.NO_SKIPTOMAIN_WITH_STRUCTURE));
}
} else {
if (maxTime < MIN_MAX_TIME_TO_ELIMINATE_SKIP_LINK) {
// if max time is less than 90 sec, skip link can be
// eliminated.
problemV.add(new BlindProblem(
- BlindProblem.ALERT_NO_SKIPTOMAIN_NO_STRUCTURE, ""
+ IBlindProblem.ALERT_NO_SKIPTOMAIN_NO_STRUCTURE, ""
+ maxTime));
// return true;
} else {
problemV.add(new BlindProblem(
- BlindProblem.NO_SKIPTOMAIN_LINK));
+ IBlindProblem.NO_SKIPTOMAIN_LINK));
}
}
} else if (minSkipLinkTime >= MAX_SKIPLINK_REACHING_TIME) {
// TODO remove this problem if the page has skip link at top of the page
BlindProblem prob = new BlindProblem(
- BlindProblem.TOOFAR_SKIPTOMAIN_LINK, minSkipLinkTime + " ");
+ IBlindProblem.TOOFAR_SKIPTOMAIN_LINK, minSkipLinkTime + " ");
Integer idObj = mapData.getIdOfNode(skipLinkNodeInfo.getNode());
if (idObj != null) {
prob.setNode(skipLinkNodeInfo.getNode(), idObj.intValue());
@@ -498,17 +499,17 @@
if (headingCount > 0) {
if (forwardIntraLinkCount > 0) {
tmpBP = new BlindProblem(
- BlindProblem.LESS_STRUCTURE_WITH_BOTH);
+ IBlindProblem.LESS_STRUCTURE_WITH_BOTH);
} else {
tmpBP = new BlindProblem(
- BlindProblem.LESS_STRUCTURE_WITH_HEADING);
+ IBlindProblem.LESS_STRUCTURE_WITH_HEADING);
}
} else {
if (forwardIntraLinkCount > 0) {
tmpBP = new BlindProblem(
- BlindProblem.LESS_STRUCTURE_WITH_SKIPLINK);
+ IBlindProblem.LESS_STRUCTURE_WITH_SKIPLINK);
} else {
- tmpBP = new BlindProblem(BlindProblem.TOO_LESS_STRUCTURE);
+ tmpBP = new BlindProblem(IBlindProblem.TOO_LESS_STRUCTURE);
}
}
for (int i = 0; i < overTimeCount; i++) {
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java
index 3216284..5219a70 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java
@@ -18,11 +18,12 @@
import org.eclipse.actf.visualization.engines.blind.ParamBlind;
import org.eclipse.actf.visualization.engines.blind.TextChecker;
-import org.eclipse.actf.visualization.engines.blind.html.eval.BlindProblem;
+import org.eclipse.actf.visualization.engines.blind.html.IBlindProblem;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacket;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacketCollection;
import org.eclipse.actf.visualization.eval.html.HtmlTagUtil;
import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.internal.engines.blind.html.BlindProblem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -132,7 +133,7 @@
// check inappropritate text
if (textChecker.isSeparatedJapaneseChars(curText)) {
BlindProblem prob = new BlindProblem(
- BlindProblem.WRONG_TEXT, curText);
+ IBlindProblem.WRONG_TEXT, curText);
prob.setNode(p.getNode());
prob.setTargetNode(mapData.getOrigNode(p.getNode()));
problems.add(prob);
@@ -159,7 +160,7 @@
curText = removePeriod(curText, curNode);
BlindProblem prob = new BlindProblem(
- BlindProblem.REDUNDANT_ALT, "\""
+ IBlindProblem.REDUNDANT_ALT, "\""
+ prevText + "\" & \""
+ curText + "\"");
prob.setNode(prevNode);
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/VisualizeViewUtil.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/VisualizeViewUtil.java
index 41079f4..3a11ace 100644
--- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/VisualizeViewUtil.java
+++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/VisualizeViewUtil.java
@@ -22,12 +22,13 @@
import java.util.Set;
import org.eclipse.actf.visualization.engines.blind.BlindVizResourceUtil;
+import org.eclipse.actf.visualization.engines.blind.html.IBlindProblem;
import org.eclipse.actf.visualization.engines.blind.html.VisualizeEngine;
-import org.eclipse.actf.visualization.engines.blind.html.eval.BlindProblem;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacket;
import org.eclipse.actf.visualization.engines.voicebrowser.IPacketCollection;
import org.eclipse.actf.visualization.eval.problem.HighlightTargetId;
import org.eclipse.actf.visualization.eval.problem.IProblemItem;
+import org.eclipse.actf.visualization.internal.engines.blind.html.BlindProblem;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -300,12 +301,12 @@
Node node = prob.getTargetNodeInResultDoc();
Integer idObj = mapData.getIdOfNode(node);
- int subType = prob.getProblemSubType();
+ int subType = prob.getSubType();
switch (subType) {
- case BlindProblem.WRONG_ALT_AREA:
- case BlindProblem.NO_ALT_AREA:
- case BlindProblem.TOO_LESS_STRUCTURE:
- case BlindProblem.NO_SKIPTOMAIN_LINK:
+ case IBlindProblem.WRONG_ALT_AREA:
+ case IBlindProblem.NO_ALT_AREA:
+ case IBlindProblem.TOO_LESS_STRUCTURE:
+ case IBlindProblem.NO_SKIPTOMAIN_LINK:
break;
default:
if (idObj != null) {
@@ -332,9 +333,9 @@
}
}
- switch (prob.getProblemSubType()) {
- case BlindProblem.NO_ALT_IMG:
- case BlindProblem.WRONG_ALT_IMG:
+ switch (prob.getSubType()) {
+ case IBlindProblem.NO_ALT_IMG:
+ case IBlindProblem.WRONG_ALT_IMG:
Element el = (Element) node;
Node replacement = mapData.getReplacement(el);
if (replacement != null) {
@@ -344,7 +345,7 @@
baseUrlS);
el.appendChild(img);
break;
- case BlindProblem.REDUNDANT_ALT:
+ case IBlindProblem.REDUNDANT_ALT:
int startId = -1;
int endId = -1;
try {
@@ -370,20 +371,20 @@
prob.addNodeIds(new HighlightTargetId(endId, endId));
break;
- case BlindProblem.NO_DEST_LINK:
- case BlindProblem.NO_TEXT_INTRAPAGELINK:
- case BlindProblem.NO_DEST_SKIP_LINK:
- case BlindProblem.WRONG_SKIP_LINK_TEXT:
- case BlindProblem.TOOFAR_SKIPTOMAIN_LINK:
- case BlindProblem.NO_TEXT_WITH_TITLE_INTRAPAGELINK:
- case BlindProblem.INVISIBLE_INTRAPAGE_LINK:
- case BlindProblem.WRONG_SKIP_LINK_TITLE:
+ case IBlindProblem.NO_DEST_LINK:
+ case IBlindProblem.NO_TEXT_INTRAPAGELINK:
+ case IBlindProblem.NO_DEST_SKIP_LINK:
+ case IBlindProblem.WRONG_SKIP_LINK_TEXT:
+ case IBlindProblem.TOOFAR_SKIPTOMAIN_LINK:
+ case IBlindProblem.NO_TEXT_WITH_TITLE_INTRAPAGELINK:
+ case IBlindProblem.INVISIBLE_INTRAPAGE_LINK:
+ case IBlindProblem.WRONG_SKIP_LINK_TITLE:
Element element = (Element) node;
Element image = createErrorImageElement(element, prob, idObj,
baseUrlS);
element.appendChild(image);
break;
- case BlindProblem.WRONG_TEXT:
+ case IBlindProblem.WRONG_TEXT:
// Node node = prob.getNode();
Element image2 = createErrorImageElement(node, prob, idObj,
baseUrlS);
@@ -393,8 +394,8 @@
node.getParentNode().insertBefore(image2, node);
}
break;
- case BlindProblem.NO_VALUE_INPUT_BUTTON:
- case BlindProblem.SEPARATE_DBCS_INPUT_VALUE:
+ case IBlindProblem.NO_VALUE_INPUT_BUTTON:
+ case IBlindProblem.SEPARATE_DBCS_INPUT_VALUE:
Element image3 = createErrorImageElement(node, prob, idObj,
baseUrlS);
node.getParentNode().insertBefore(image3, node);