private static Console console;
+ private static boolean testingMode;
+
private final Vector pendingVariables = new Vector();
private final HashMap idToPaintable = new HashMap();
console = new NullConsole();
}
- if (isTestingMode()) {
+ if (checkTestingMode()) {
usePaintableIdsInDOM = true;
initializeTestingTools(getTestServerUri(), this);
}
return $wnd.itmill.testingToolsUri;
}-*/;
- private native static boolean isTestingMode()
+ /**
+ * Method to check if application is in testing mode. Can be used after
+ * application init.
+ *
+ * @return true if in testing mode
+ */
+ public static boolean isTestingMode() {
+ return testingMode;
+ }
+
+ /**
+ * Check is application is run in testing mode.
+ *
+ * @return true if in testing mode
+ */
+ private native static boolean checkTestingMode()
/*-{
- return $wnd.itmill.testingToolsUri ? true : false;
+ @com.itmill.toolkit.terminal.gwt.client.ApplicationConnection::testingMode = $wnd.itmill.testingToolsUri ? true : false;
+ return @com.itmill.toolkit.terminal.gwt.client.ApplicationConnection::testingMode;
}-*/;
private native static void initializeTestingTools(String testServerUri,
public void showSuggestions(Collection currentSuggestions,
int currentPage, int totalSuggestions) {
+
+ if (ApplicationConnection.isTestingMode()) {
+ // Add TT anchor point
+ DOM.setElementProperty(getElement(), "id", paintableId
+ + "_OPTIONLIST");
+ }
+
menu.setSuggestions(currentSuggestions);
final int x = IFilterSelect.this.getAbsoluteLeft();
int y = tb.getAbsoluteTop();