This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rhbz961564 add attention mode timeout controlled by presenter
- Loading branch information
1 parent
e4fb4d3
commit f91b62c
Showing
8 changed files
with
201 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
zanata-war/src/main/java/org/zanata/webtrans/client/keys/TimedAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2013, Red Hat, Inc. and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.zanata.webtrans.client.keys; | ||
|
||
/** | ||
* Used to pass behaviour for a new timer to a {@link TimerFactory}. | ||
* | ||
* @author David Mason, <a href="mailto:damason@redhat.com">damason@redhat.com</a> | ||
* | ||
*/ | ||
public interface TimedAction | ||
{ | ||
void run(); | ||
} |
55 changes: 55 additions & 0 deletions
55
zanata-war/src/main/java/org/zanata/webtrans/client/keys/Timer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2013, Red Hat, Inc. and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.zanata.webtrans.client.keys; | ||
|
||
/** | ||
* Wraps a {{@link com.google.gwt.user.client.Timer} to allow testing | ||
* in a non-browser environment. | ||
* | ||
* @author David Mason, <a href="mailto:damason@redhat.com">damason@redhat.com</a> | ||
* | ||
*/ | ||
public class Timer | ||
{ | ||
|
||
private com.google.gwt.user.client.Timer timer; | ||
|
||
public Timer(com.google.gwt.user.client.Timer timer) | ||
{ | ||
this.timer = timer; | ||
} | ||
|
||
/** | ||
* @see {{@link com.google.gwt.user.client.Timer#cancel()} | ||
*/ | ||
public void cancel() | ||
{ | ||
timer.cancel(); | ||
} | ||
|
||
/** | ||
* @see {@link com.google.gwt.user.client.Timer#schedule(int)} | ||
*/ | ||
public void schedule(int delayMillis) | ||
{ | ||
timer.schedule(delayMillis); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
zanata-war/src/main/java/org/zanata/webtrans/client/keys/TimerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2013, Red Hat, Inc. and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.zanata.webtrans.client.keys; | ||
|
||
/** | ||
* Factory for wrapped {@link com.google.gwt.user.client.Timer} to allow | ||
* mocking for testing. | ||
* | ||
* @author David Mason, <a href="mailto:damason@redhat.com">damason@redhat.com</a> | ||
* | ||
*/ | ||
public interface TimerFactory | ||
{ | ||
Timer create(TimedAction timedAction); | ||
} |
43 changes: 43 additions & 0 deletions
43
zanata-war/src/main/java/org/zanata/webtrans/client/keys/TimerFactoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2013, Red Hat, Inc. and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.zanata.webtrans.client.keys; | ||
|
||
/** | ||
* @author David Mason, <a href="mailto:damason@redhat.com">damason@redhat.com</a> | ||
* @see TimerFactory | ||
*/ | ||
public class TimerFactoryImpl implements TimerFactory | ||
{ | ||
|
||
@Override | ||
public Timer create(final TimedAction timedAction) | ||
{ | ||
return new Timer(new com.google.gwt.user.client.Timer() | ||
{ | ||
@Override | ||
public void run() | ||
{ | ||
timedAction.run(); | ||
} | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters