package com.stormBrain.client;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.ui.RootPanel;
public class SBQuoteService implements Plugin {
private List<String> quotes;
private void init() {
quotes = new ArrayList<String>();
quotes.add("<p>The glow of one warm thought is to me worth more than money.</p><p class=\"autore\">Thomas Jefferson</p>");
quotes.add("<p>We did it Disneyland, in the knowledge that most of the people I talked to thought it would be a financial disaster - closed and forgotten within the first year.</p><p class=\"autore\">Walt Disney</p>");
quotes.add("<p>It is the mark of an educated mind to be able to entertain a thought without accepting it.</p><p class=\"autore\">Aristotle</p>");
quotes.add("<p>Learning without thought is labor lost; thought without learning is perilous.</p><p class=\"autore\">Confucius</p>");
quotes.add("<p>I have always thought the actions of men the best interpreters of their thoughts.</p><p class=\"autore\">John Locke</p>");
quotes.add("<p>A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.</p><p class=\"autore\">Douglas Adams</p>");
quotes.add("<p>Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity.</p><p class=\"autore\">George S. Patton</p>");
quotes.add("<p>Art begins in imitation and ends in innovation.</p><p class=\"autore\">Mason Cooley</p>");
quotes.add("<p>Learning and innovation go hand in hand. The arrogance of success is to think that what you did yesterday will be sufficient for tomorrow.</p><p class=\"autore\">William Pollard</p>");
}
public String getRandomQuote() {
return quotes.get(Random.nextInt(quotes.size()));
}
public void activate() {
RootPanel quotePanel = RootPanel.get("quote");
if(quotePanel != null) {
init();
quotePanel.getElement().setInnerHTML(getRandomQuote());
}
}
}