kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1587 discussions
Author: vjrj_
Date: 2011-09-27 21:40:16 +0200 (Tue, 27 Sep 2011)
New Revision: 1538
Added:
trunk/src/test/java/cc/kune/selenium/chat/
trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java
trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/
trunk/src/test/java/cc/kune/tasks/
trunk/src/test/java/org/ourproject/kune/platf/client/
Modified:
trunk/src/main/java/cc/kune/chat/client/ChatClient.java
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java
trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
trunk/src/main/java/cc/kune/core/client/auth/Register.java
trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/PageObject.java
trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
Log:
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClient.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClient.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClient.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -23,40 +23,41 @@
import com.calclab.emite.xep.muc.client.Room;
public interface ChatClient {
+ public static final String CHAT_CLIENT_ICON_ID = "k-chat-icon-id";
- void addNewBuddie(String shortName);
+ void addNewBuddie(String shortName);
- void chat(String shortName);
+ void chat(String shortName);
- void chat(XmppURI jid);
+ void chat(XmppURI jid);
- void doLogin();
+ void doLogin();
- boolean isBuddie(String shortName);
+ boolean isBuddie(String shortName);
- boolean isBuddie(XmppURI jid);
+ boolean isBuddie(XmppURI jid);
- boolean isLoggedIn();
+ boolean isLoggedIn();
- Room joinRoom(String roomName, String userAlias);
+ Room joinRoom(String roomName, String userAlias);
- Room joinRoom(String roomName, String subject, String userAlias);
+ Room joinRoom(String roomName, String subject, String userAlias);
- void login(XmppURI uri, String passwd);
+ void login(XmppURI uri, String passwd);
- /**
- * @return true if loggin is needed
- */
- boolean loginIfNecessary();
+ /**
+ * @return true if loggin is needed
+ */
+ boolean loginIfNecessary();
- void logout();
+ void logout();
- XmppURI roomUriFrom(String shortName);
+ XmppURI roomUriFrom(String shortName);
- void setAvatar(String photoBinary);
+ void setAvatar(String photoBinary);
- void show();
+ void show();
- XmppURI uriFrom(String shortName);
+ XmppURI uriFrom(String shortName);
}
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -123,7 +123,6 @@
}
- protected static final String CHAT_CLIENT_ICON_ID = "k-chat-icon-id";
private static final String CHAT_TITLE = "Chat ;)";
private final ChatClientAction action;
Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -53,7 +53,7 @@
descriptor.putValue(ParentWidget.PARENT_UI, this);
final String id = descriptor.getId();
if (id != null) {
- iconLabel.ensureDebugId(id);
+ iconLabel.setId(id);
}
initWidget(iconLabel);
iconLabel.getFocus().addClickHandler(new ClickHandler() {
Modified: trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -126,6 +126,10 @@
return flow.remove(w);
}
+ public void setId(final String id) {
+ self.ensureDebugId(id);
+ }
+
public void setLabelText(final String text) {
label.setText(text);
}
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -19,6 +19,7 @@
*/
package cc.kune.common.client.ui.dialogs;
+import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.PopupTopPanel;
import cc.kune.common.client.utils.TextUtils;
@@ -252,6 +253,7 @@
}
public void showCentered() {
+ Tooltip.hideCurrent();
popup.showCentered();
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/Register.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/Register.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/auth/Register.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -19,11 +19,12 @@
*/
package cc.kune.core.client.auth;
-
public interface Register {
- void doRegister();
+ String WELCOME_ID = "k-user-reg-welcome-msg-id";
- void hide();
+ void doRegister();
+ void hide();
+
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -31,7 +31,6 @@
import cc.kune.core.client.errors.UserRegistrationException;
import cc.kune.core.client.events.NewUserRegisteredEvent;
import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.notify.msgs.UserNotifyEvent;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.rpcservices.UserServiceAsync;
import cc.kune.core.client.state.Session;
@@ -213,26 +212,22 @@
}
private void showWelcolmeDialog() {
- getEventBus().fireEvent(
- new UserNotifyEvent(
- NotifyLevel.info,
- i18n.t("Welcome"),
- i18n.t("Thanks for joining this site. "
- + "Now you can actively participate in this site. "
- + "You can also use your personal space to publish contents. "
- + "Note: your email is not verified, please follow the instructions you will receive by email."),
- true));
+ NotifyUser.info(
+ i18n.t("Welcome"),
+ i18n.t("Thanks for joining this site. "
+ + "Now you can actively participate in this site. "
+ + "You can also use your personal space to publish contents. "
+ + "Note: your email is not verified, please follow the instructions you will receive by email."),
+ Register.WELCOME_ID, true);
}
private void showWelcolmeDialogNoHomepage() {
- getEventBus().fireEvent(
- new UserNotifyEvent(
- NotifyLevel.info,
- i18n.t("Welcome"),
- i18n.t("Thanks for joining this site"
- + "Now you can actively participate in this site. "
- + "Note: your email is not verified, please follow the instructions you will receive by email."),
- true));
+ NotifyUser.info(
+ i18n.t("Welcome"),
+ i18n.t("Thanks for joining this site"
+ + "Now you can actively participate in this site. "
+ + "Note: your email is not verified, please follow the instructions you will receive by email."),
+ Register.WELCOME_ID, true);
}
};
userServiceProvider.get().createUser(user, wantHomepage, callback);
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -20,7 +20,6 @@
package cc.kune.core.client.auth;
import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.common.client.ui.dialogs.MessageToolbar;
import cc.kune.common.client.utils.OnAcceptCallback;
@@ -133,7 +132,6 @@
@Override
public void show() {
super.show();
- Tooltip.hideCurrent();
KuneUiUtils.focusOnField(getNickname());
}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -21,7 +21,6 @@
import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.common.client.ui.dialogs.BasicTopDialog;
import cc.kune.common.client.ui.dialogs.BasicTopDialog.Builder;
@@ -296,7 +295,6 @@
@Override
public void show() {
- Tooltip.hideCurrent();
dialog.showCentered();
}
Modified: trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -46,6 +46,7 @@
@Override
public void beforeClickOn(final WebElement element, final WebDriver driver) {
+ SeleniumUtils.hightlight(element, driver);
slow();
}
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -35,6 +35,7 @@
import cc.kune.core.client.state.TokenUtils;
import cc.kune.core.client.sub.SubtitlesWidget;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.selenium.chat.ChatPageObject;
import cc.kune.selenium.login.EntityHeaderPageObject;
import cc.kune.selenium.login.LoginPageObject;
import cc.kune.selenium.login.RegisterPageObject;
@@ -47,6 +48,7 @@
private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
public static boolean mustCloseFinally = false;
private final String baseUrl;
+ protected final ChatPageObject chat;
protected final EntityHeaderPageObject entityHeader;
private final Injector injector;
protected LoginPageObject login;
@@ -61,10 +63,12 @@
login = injector.getInstance(LoginPageObject.class);
register = injector.getInstance(RegisterPageObject.class);
entityHeader = injector.getInstance(EntityHeaderPageObject.class);
+ chat = injector.getInstance(ChatPageObject.class);
final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
PageFactory.initElements(locator, login);
PageFactory.initElements(locator, register);
PageFactory.initElements(locator, entityHeader);
+ PageFactory.initElements(locator, chat);
}
@BeforeSuite
Modified: trunk/src/test/java/cc/kune/selenium/PageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -25,7 +25,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
@@ -87,12 +86,14 @@
}
public void hightlight(final WebElement element) {
- final JavascriptExecutor js = (JavascriptExecutor) webdriver;
- final String script = "window.jQuery('#" + element.getAttribute("id") + "').addClass('k-outline');"
- + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
- + "\").removeClass(\"k-outline\")', 700);";
- // LOG.info("High: " + script);
- js.executeScript(script);
+ SeleniumUtils.hightlight(element, webdriver);
+ // final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+ // final String script = "window.jQuery('#" + element.getAttribute("id") +
+ // "').addClass('k-outline');"
+ // + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
+ // + "\").removeClass(\"k-outline\")', 700);";
+ // // LOG.info("High: " + script);
+ // js.executeScript(script);
}
public boolean isElementPresent(final String id) {
Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -32,6 +32,7 @@
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
+import cc.kune.selenium.chat.ChatPageObject;
import cc.kune.selenium.login.EntityHeaderPageObject;
import cc.kune.selenium.login.LoginPageObject;
import cc.kune.selenium.login.RegisterPageObject;
@@ -60,6 +61,7 @@
bind(LoginPageObject.class).in(Singleton.class);
bind(RegisterPageObject.class).in(Singleton.class);
bind(EntityHeaderPageObject.class).in(Singleton.class);
+ bind(ChatPageObject.class).in(Singleton.class);
}
@SuppressWarnings("unused")
Modified: trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -1,9 +1,21 @@
package cc.kune.selenium;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
import org.testng.Assert;
public class SeleniumUtils {
+ public static void hightlight(final WebElement element, final WebDriver webdriver) {
+ final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+ final String script = "window.jQuery('#" + element.getAttribute("id") + "').addClass('k-outline');"
+ + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
+ + "\").removeClass(\"k-outline\")', 700);";
+ // LOG.info("High: " + script);
+ js.executeScript(script);
+ }
+
public static void sleep(final int milliseconds) {
try {
Thread.sleep(milliseconds);
Added: trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -0,0 +1,89 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.chat;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ByIdOrName;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+import com.calclab.hablar.core.client.Idify;
+
+public class ChatPageObject extends PageObject {
+
+ public static final String DEF_TESTING_USER = "some.testing.user(a)gmail.com";
+ @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-addToRoster" + SeleniumConstants.INPUT)
+ private WebElement addToRoster;
+ @FindBy(id = SeleniumConstants.GWTDEV + ChatClient.CHAT_CLIENT_ICON_ID)
+ private WebElement chatIcon;
+ @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-jabberId")
+ private WebElement jid;
+ @FindBy(id = SeleniumConstants.GWTDEV + "HablarOpenChat-openAction")
+ private WebElement openChat;
+ @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-open")
+ private WebElement openChatBtn;
+
+ // Duplicate in Hablar (we need a common PageObject)
+ public WebElement getHeader(final String uri) {
+ final String pageId = Idify.uriId(uri);
+ final String headerId = "gwt-debug-HeaderWidget-Chat-" + pageId;
+ return findElement(new ByIdOrName(headerId));
+ }
+
+ public WebElement getList(final String uri) {
+ final String pageId = Idify.uriId(uri);
+ final String id = "gwt-debug-ChatWidget-list-Chat-" + pageId;
+ return findElement(new ByIdOrName(id));
+ }
+
+ public WebElement getPage(final String uri) {
+ final String pageId = Idify.uriId(uri);
+ final String headerId = "gwt-debug-ChatWidget-Chat-" + pageId;
+ return findElement(new ByIdOrName(headerId));
+ }
+
+ public WebElement getSend(final String uri) {
+ final String pageId = Idify.uriId(uri);
+ final String id = "gwt-debug-ChatWidget-send-Chat-" + pageId;
+ return findElement(new ByIdOrName(id));
+ }
+
+ public WebElement getTalkBox(final String uri) {
+ final String pageId = Idify.uriId(uri);
+ final String id = "gwt-debug-ChatWidget-talkBox-Chat-" + pageId;
+ return findElement(new ByIdOrName(id));
+ }
+
+ public void openChat(final XmppURI uri) {
+ openChat.click();
+ jid.sendKeys(uri.toString());
+ addToRoster.click();
+ openChatBtn.click();
+ }
+
+ public void show() {
+ chatIcon.click();
+ }
+
+}
Added: trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.chat;
+
+import org.testng.annotations.Test;
+
+import cc.kune.selenium.KuneSeleniumTest;
+
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+
+public class ChatSeleniumTests extends KuneSeleniumTest {
+
+ @Test
+ public void basicChat() {
+ // 15 chars, the limit, so we don't use shortName
+ login();
+ showSubtitle("Chat with your buddies", "compatible with gmail and similars");
+ chat.show();
+ final XmppURI jid = XmppURI.jid(ChatPageObject.DEF_TESTING_USER);
+ final String jids = jid.toString();
+ chat.openChat(jid);
+ // chat.getPage(jids).click();
+ chat.getTalkBox(jids).sendKeys("Helloo... ;)");
+ chat.getSend(jids).click();
+ chat.getTalkBox(jids).sendKeys("I'm just testing");
+ chat.getSend(jids).click();
+ }
+
+}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -47,9 +47,9 @@
public void createOne() {
assertIsDisconnected();
- hightlight(signInLink);
+ // hightlight(signInLink);
signInLink.click();
- hightlight(createOneLink);
+ // hightlight(createOneLink);
createOneLink.click();
}
@@ -60,7 +60,7 @@
clearField(passwd);
hightlight(passwd);
passwd.sendKeys(password);
- hightlight(signInButton);
+ // hightlight(signInButton);
if (withReturn) {
passwd.sendKeys(Keys.RETURN);
} else {
@@ -90,7 +90,7 @@
public void signIn(final String username, final String password, final boolean withReturn) {
assertIsDisconnected();
- hightlight(signInLink);
+ // hightlight(signInLink);
moveMouseTo(signInLink);
signInLink.click();
fillSigInInForm(username, password, withReturn);
Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -23,6 +23,7 @@
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
+import cc.kune.core.client.auth.Register;
import cc.kune.core.client.auth.RegisterForm;
import cc.kune.core.client.auth.RegisterPanel;
import cc.kune.selenium.tools.SeleniumConstants;
@@ -39,6 +40,8 @@
private WebElement registerButton;
@FindBy(id = RegisterForm.NICK_FIELD + SeleniumConstants.INPUT)
private WebElement shortName;
+ @FindBy(id = SeleniumConstants.GWTDEV + Register.WELCOME_ID)
+ private WebElement welcome;
public RegisterPageObject() {
// i18n = new I18nHelper(LoginMessages.class);
@@ -66,4 +69,8 @@
}
}
+ public WebElement getWelcomeMsg() {
+ return welcome;
+ }
+
}
Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-09-27 19:40:16 UTC (rev 1538)
@@ -30,15 +30,17 @@
final String email) {
// 15 chars, the limit, so we don't use shortName
final String prefix = getTempString();
- showSubtitle("User registration", "to get full access to this site");
+ showSubtitle("User registration", "to get full access to this site tools/contents");
login.createOne();
register.fillRegisterForm(prefix, prefix + longName, passwd, prefix + email, false);
login.assertIsConnectedAs(prefix);
sleep(1000);
entityHeader.waitForEntityTitle(prefix + longName);
- login.logout();
+ register.getWelcomeMsg().click();
+ chat.show();
+ sleep(3000);
+ // login.logout();
}
-
// @Test(dataProvider = "correctlogin")
// public void signIn(final String user, final String passwd) {
// login.assertIsDisconnected();
1
0
Author: vjrj_
Date: 2011-09-27 15:13:59 +0200 (Tue, 27 Sep 2011)
New Revision: 1537
Added:
trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/
trunk/src/main/java/org/ourproject/kune/workspace/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/
trunk/src/test/java/org/ourproject/kune/workspace/
Modified:
trunk/INSTALL
trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/PageObject.java
trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
Log:
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
CLOSED - # 129: Add some simple mail lib utility in serverside
http://kune.ourproject.org/issues/ticket/129
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/INSTALL 2011-09-27 13:13:59 UTC (rev 1537)
@@ -84,6 +84,10 @@
Install and run a openfire jabber server (see Appendix A for proper configuration of openfire).
+===Configure your SMTP server===
+
+See Appendix C for more info.
+
===Wave in a Box===
Follow "Federation configuration" from:
Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -56,6 +56,12 @@
private static final int WIDTH_NOT_DEFINED = -1;
+ public static void hideCurrent() {
+ if (current != null) {
+ current.hide();
+ }
+ }
+
public static Tooltip to(final Widget widget, final String text) {
final Tooltip tip = new Tooltip();
tip.to(widget);
@@ -90,6 +96,7 @@
private Widget ofWidget;
private final Label textLabel;
private final TooltipTimers timers;
+
@UiField
InlineLabel title;
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -20,6 +20,7 @@
package cc.kune.core.client.auth;
import cc.kune.common.client.notify.NotifyLevelImages;
+import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.common.client.ui.dialogs.MessageToolbar;
import cc.kune.common.client.utils.OnAcceptCallback;
@@ -132,6 +133,7 @@
@Override
public void show() {
super.show();
+ Tooltip.hideCurrent();
KuneUiUtils.focusOnField(getNickname());
}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -21,6 +21,7 @@
import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.notify.NotifyLevelImages;
+import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.common.client.ui.dialogs.BasicTopDialog;
import cc.kune.common.client.ui.dialogs.BasicTopDialog.Builder;
@@ -295,6 +296,7 @@
@Override
public void show() {
+ Tooltip.hideCurrent();
dialog.showCentered();
}
Modified: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -2,6 +2,7 @@
import cc.kune.common.client.utils.Base64Utils;
import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.state.StateManager;
import com.google.gwt.event.shared.EventBus;
@@ -44,12 +45,19 @@
public void show(final String token) {
final String[] params = token.split("\\|");
+ final int len = params.length;
getView().setTitleText(new String(Base64Utils.fromBase64(params[0])));
- getView().setDescription(new String(Base64Utils.fromBase64(params[1])));
+ if (len > 1) {
+ getView().setDescription(new String(Base64Utils.fromBase64(params[1])));
+ }
getView().show(new SimpleCallback() {
@Override
public void onCallback() {
- stateManager.gotoHistoryToken(params[2]);
+ if (len > 2 && TextUtils.notEmpty(params[2])) {
+ stateManager.gotoHistoryToken(params[2]);
+ } else {
+ stateManager.gotoHistoryToken("");
+ }
}
});
}
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2011-09-27 13:13:59 UTC (rev 1537)
@@ -1,4 +1,4 @@
-CHARSET "UTF-8 "; body {
+CHARSET "UTF-8 "; body {
background-color: transparent;
color: black;
font-family: 'Ubuntu', Arial;
@@ -944,7 +944,7 @@
border-color: #CCCCCC !important;
background: inherits !important;
kfilter: alpha(opacity =
- 60) !important;
+ 60) !important;
-moz-opacity: 0.60 !important;
-khtml-opacity: 0.60 !important;
opacity: 0.60 !important;
@@ -1230,7 +1230,7 @@
-moz-border-radius-bottomleft: 5px;
border-bottom-left-radius: 5px;
kfilter: alpha(opacity =
- 90);
+ 90);
-moz-opacity: 0.90;
-khtml-opacity: 0.90;
opacity: 0.90;
@@ -1520,4 +1520,10 @@
-webkit-border-top-left-radius: 5px;
-moz-border-radius-topleft: 5px;
border-top-left-radius: 5px;
-}
\ No newline at end of file
+}
+
+.k-outline {
+ -moz-outline-radius: 5px;
+ outline: #f90 solid 2px !important;
+ outline-offset: -2px !important;
+}
Modified: trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -4,13 +4,12 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.events.WebDriverEventListener;
-import org.testng.Assert;
public class CustomWebDriverEventListener implements WebDriverEventListener {
@Override
public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
- sleep(200);
+ sleep(400);
}
@Override
@@ -34,7 +33,7 @@
@Override
public void afterNavigateTo(final String url, final WebDriver driver) {
- slow();
+ sleep(500);
}
@Override
@@ -56,7 +55,6 @@
@Override
public void beforeNavigateBack(final WebDriver driver) {
- ;
}
@Override
@@ -75,15 +73,11 @@
public void onException(final Throwable throwable, final WebDriver driver) {
}
- public void sleep(final int milliseconds) {
- try {
- Thread.sleep(milliseconds);
- } catch (final InterruptedException e) {
- Assert.fail("Exception in sleep method", e);
- }
+ private void sleep(final int milliseconds) {
+ SeleniumUtils.sleep(milliseconds);
}
private void slow() {
- sleep(500);
+ sleep(1000);
}
}
\ No newline at end of file
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -26,15 +26,12 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
-import org.testng.Assert;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.DataProvider;
-import cc.kune.core.client.auth.AnonUsersManager;
-import cc.kune.core.client.state.SiteTokens;
import cc.kune.core.client.state.TokenUtils;
import cc.kune.core.client.sub.SubtitlesWidget;
import cc.kune.core.shared.domain.utils.StateToken;
@@ -48,7 +45,7 @@
public class KuneSeleniumDefaults {
private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
- public static boolean mustCloseFinally = true;
+ public static boolean mustCloseFinally = false;
private final String baseUrl;
protected final EntityHeaderPageObject entityHeader;
private final Injector injector;
@@ -57,9 +54,8 @@
private final WebDriver webdriver;
public KuneSeleniumDefaults() {
- baseUrl = "http://kune.beta.iepala.es/ws/?locale=en#";
- // baseUrl =
- // "http://127.0.0.1:8888/ws/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:99…";
+ // baseUrl = "http://kune.beta.iepala.es/ws/?locale=en#";
+ baseUrl = "http://127.0.0.1:8888/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:9997#";
injector = Guice.createInjector(new SeleniumModule());
webdriver = injector.getInstance(WebDriver.class);
login = injector.getInstance(LoginPageObject.class);
@@ -76,7 +72,6 @@
resize();
LOG.info("Going home");
home();
- webdriver.findElement(By.id(SeleniumConstants.GWTDEV + AnonUsersManager.ANON_MESSAGE_CLOSE_ICON)).click();
}
@BeforeMethod
@@ -134,6 +129,7 @@
public void home() {
assert baseUrl != null;
webdriver.get(baseUrl);
+ login.getAnonMsg().click();
}
public void open(final String url) {
@@ -146,17 +142,22 @@
js.executeScript("window.resizeTo(840,770); window.moveTo(0,0);");
}
+ public void showSubtitle(final String title) {
+ showSubtitle(title, "", "");
+ }
+
+ public void showSubtitle(final String title, final String description) {
+ showSubtitle(title, description, "");
+ }
+
public void showSubtitle(final String title, final String description, final String token) {
- gotoToken(TokenUtils.subtitle("User sign in", "", SiteTokens.SIGNIN));
+ gotoToken(TokenUtils.subtitle(title, description, token));
sleep(3000);
webdriver.findElement(By.id(SeleniumConstants.GWTDEV + SubtitlesWidget.SUBTITLE_MANAGER_ID)).click();
}
public void sleep(final int milliseconds) {
- try {
- Thread.sleep(milliseconds);
- } catch (final InterruptedException e) {
- Assert.fail("Exception in sleep method", e);
- }
+ SeleniumUtils.sleep(milliseconds);
}
+
}
Modified: trunk/src/test/java/cc/kune/selenium/PageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -25,6 +25,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
@@ -85,6 +86,15 @@
return webdriver.getWindowHandles();
}
+ public void hightlight(final WebElement element) {
+ final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+ final String script = "window.jQuery('#" + element.getAttribute("id") + "').addClass('k-outline');"
+ + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
+ + "\").removeClass(\"k-outline\")', 700);";
+ // LOG.info("High: " + script);
+ js.executeScript(script);
+ }
+
public boolean isElementPresent(final String id) {
final Wait<WebDriver> wait = new WebDriverWait(webdriver, 5);
final WebElement element = wait.until(visibilityOfElementLocated(By.id(id)));
@@ -112,6 +122,7 @@
public void moveMouseTo(final WebElement element) {
final Actions actions = new Actions(webdriver);
actions.moveToElement(element);
+ sleep(1000);
}
public Navigation navigate() {
@@ -122,6 +133,10 @@
webdriver.quit();
}
+ public void sleep(final int milliseconds) {
+ SeleniumUtils.sleep(milliseconds);
+ }
+
public TargetLocator switchTo() {
return webdriver.switchTo();
}
Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -46,9 +46,8 @@
@Override
protected void configure() {
-
- final RemoteWebDriver driver = createChromeDriver();
- // final WebDriver driver = creatFirefoxDriver();
+ // final RemoteWebDriver driver = createChromeDriver();
+ final WebDriver driver = creatFirefoxDriver();
final EventFiringWebDriver wrap = new EventFiringWebDriver(driver);
wrap.register(new CustomWebDriverEventListener());
@@ -81,9 +80,9 @@
private FirefoxDriver creatFirefoxDriver() {
// http://code.google.com/p/selenium/wiki/FirefoxDriver
+ System.setProperty("webdriver.firefox.useExisting", "true");
final ProfilesIni allProfiles = new ProfilesIni();
final FirefoxProfile profile = allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
- // System.setProperty("webdriver.firefox.useExisting", "true");
// final FirefoxProfile profile = allProfiles.getProfile("76tp2vh0.ff5");
final FirefoxDriver driver = new FirefoxDriver(profile);
return driver;
Added: trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -0,0 +1,15 @@
+package cc.kune.selenium;
+
+import org.testng.Assert;
+
+public class SeleniumUtils {
+
+ public static void sleep(final int milliseconds) {
+ try {
+ Thread.sleep(milliseconds);
+ } catch (final InterruptedException e) {
+ Assert.fail("Exception in sleep method", e);
+ }
+ }
+
+}
Modified: trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -30,6 +30,7 @@
}
public void logout() {
+ hightlight(signOutLink);
signOutLink.click();
assertIsDisconnected();
}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -23,12 +23,15 @@
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
+import cc.kune.core.client.auth.AnonUsersManager;
import cc.kune.core.client.auth.SignInForm;
import cc.kune.core.client.auth.SignInPanel;
import cc.kune.selenium.tools.SeleniumConstants;
public class LoginPageObject extends AbstractLoginObject {
+ @FindBy(id = SeleniumConstants.GWTDEV + AnonUsersManager.ANON_MESSAGE_CLOSE_ICON)
+ private WebElement anonWelcome;
@FindBy(id = SeleniumConstants.GWTDEV + SignInPanel.CREATE_ONE)
protected WebElement createOneLink;
@FindBy(id = SignInForm.PASSWORD_FIELD_ID + SeleniumConstants.INPUT)
@@ -42,11 +45,22 @@
// i18n = new I18nHelper(LoginMessages.class);
}
+ public void createOne() {
+ assertIsDisconnected();
+ hightlight(signInLink);
+ signInLink.click();
+ hightlight(createOneLink);
+ createOneLink.click();
+ }
+
public void fillSigInInForm(final String username, final String password, final boolean withReturn) {
clearField(user);
+ hightlight(user);
user.sendKeys(username);
clearField(passwd);
+ hightlight(passwd);
passwd.sendKeys(password);
+ hightlight(signInButton);
if (withReturn) {
passwd.sendKeys(Keys.RETURN);
} else {
@@ -54,6 +68,10 @@
}
}
+ public WebElement getAnonMsg() {
+ return anonWelcome;
+ }
+
public WebElement getHeader() {
return signInLink;
}
@@ -62,19 +80,24 @@
return getHeader();
}
+ public void high() {
+ hightlight(signInLink);
+ }
+
public void signIn(final String username, final String password) {
- signIn(username, password, true);
+ signIn(username, password, false);
}
public void signIn(final String username, final String password, final boolean withReturn) {
assertIsDisconnected();
+ hightlight(signInLink);
moveMouseTo(signInLink);
signInLink.click();
fillSigInInForm(username, password, withReturn);
}
public void signInDefUser() {
- signIn(SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_PASSWD, false);
+ signIn(SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_PASSWD, true);
}
}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -21,11 +21,15 @@
import org.testng.annotations.Test;
-import cc.kune.core.client.state.SiteTokens;
import cc.kune.selenium.KuneSeleniumTest;
public class LoginSeleniumTests extends KuneSeleniumTest {
+ @Test
+ public void high() {
+ login.high();
+ }
+
@Test(dataProvider = "correctlogin")
public void severalsSignInSingOut(final String user, final String passwd) {
login.assertIsDisconnected();
@@ -43,6 +47,7 @@
@Test(dataProvider = "correctlogin")
public void signIn(final String user, final String passwd) {
login.assertIsDisconnected();
+ showSubtitle("User sign in", "to get full access to this site");
login.signIn(user, passwd);
login.assertIsConnectedAs(user);
login.logout();
@@ -59,7 +64,6 @@
@Test(dataProvider = "correctlogin")
public void signInWithToken(final String user, final String passwd) {
login.assertIsDisconnected();
- showSubtitle("User sign in", "", SiteTokens.SIGNIN);
login.fillSigInInForm(user, passwd, true);
login.assertIsConnectedAs(user);
login.logout();
Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -47,13 +47,18 @@
public void fillRegisterForm(final String nick, final String name, final String pass, final String em,
final boolean withReturn) {
clearField(shortName);
+ hightlight(shortName);
shortName.sendKeys(nick);
clearField(longName);
+ hightlight(longName);
longName.sendKeys(name);
clearField(passwd);
+ hightlight(passwd);
passwd.sendKeys(pass);
clearField(email);
+ hightlight(email);
email.sendKeys(em);
+ hightlight(registerButton);
if (withReturn) {
email.sendKeys(Keys.RETURN);
} else {
Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-09-26 22:39:06 UTC (rev 1536)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-09-27 13:13:59 UTC (rev 1537)
@@ -30,9 +30,8 @@
final String email) {
// 15 chars, the limit, so we don't use shortName
final String prefix = getTempString();
- login.assertIsDisconnected();
- login.signInLink.click();
- login.createOneLink.click();
+ showSubtitle("User registration", "to get full access to this site");
+ login.createOne();
register.fillRegisterForm(prefix, prefix + longName, passwd, prefix + email, false);
login.assertIsConnectedAs(prefix);
sleep(1000);
1
0
r1536 - in trunk: . src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/mail src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/properties src/main/resources
by Vicente J. Ruiz Jurado 26 Sep '11
by Vicente J. Ruiz Jurado 26 Sep '11
26 Sep '11
Author: vjrj_
Date: 2011-09-27 00:39:06 +0200 (Tue, 27 Sep 2011)
New Revision: 1536
Added:
trunk/src/main/java/cc/kune/core/server/mail/MailService.java
trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java
Removed:
trunk/src/main/java/cc/kune/core/server/mail/MailManager.java
trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java
Modified:
trunk/.classpath
trunk/INSTALL
trunk/pom.xml
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
trunk/src/main/resources/kune.properties
Log:
NEW - # 128: Remove /ws/ prefix in kune URL
http://kune.ourproject.org/issues/ticket/128
CLOSED - # 129: Add some simple mail lib utility in serverside
http://kune.ourproject.org/issues/ticket/129
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/.classpath 2011-09-26 22:39:06 UTC (rev 1536)
@@ -3,13 +3,14 @@
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
<classpathentry kind="output" path="target/kune-0.1.0-SNAPSHOT/WEB-INF/classes"/>
+ <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/inject/javax.inject/1/javax.inject-1.jar" sourcepath="M2_REPO/javax/inject/javax.inject/1/javax.inject-1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar" sourcepath="M2_REPO/javax/transaction/jta/1.1/jta-1.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4.4/mail-1.4.4.jar" sourcepath="M2_REPO/javax/mail/mail/1.4.4/mail-1.4.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" sourcepath="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar" sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/google/appengine/appengine-api-1.0-sdk/1.3.1/appengine-api-1.0-sdk-1.3.1.jar"/>
<classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.2/box-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.2/box-src-0.3.2.jar"/>
@@ -34,7 +35,6 @@
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.2/communication-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.2/concurrencycontrol-src-0.3.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0.jar" sourcepath="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0-sources.jar"/>
@@ -59,7 +59,6 @@
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-crawler/0.5/gwtp-crawler-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-crawler/0.5/gwtp-crawler-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-dispatch-client/0.5/gwtp-dispatch-client-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-dispatch-client/0.5/gwtp-dispatch-client-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-dispatch-server/0.5/gwtp-dispatch-server-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-dispatch-server/0.5/gwtp-dispatch-server-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-dispatch-shared/0.5/gwtp-dispatch-shared-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-dispatch-shared/0.5/gwtp-dispatch-shared-0.5-sources.jar"/>
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/INSTALL 2011-09-26 22:39:06 UTC (rev 1536)
@@ -289,3 +289,16 @@
Allow from all
</Location>
</VirtualHost>
+
+==Appendix C: Configure your SMTP mail server==
+
+You should configure a SMTP server for use by Kune. See kune.site.smtp.* in kune.properties and check that your email system works propertly. For instance test something like:
+
+ echo "Bests," | mailx -s "Testing mail in kune instalation" PUT_HERE@YOUR_EMAIL # or something similar
+
+http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#ProtocolSMTP
+http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailSending
+
+And:
+http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html
+for more specific configuration parameters that maybe you need with your smtp server.
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/pom.xml 2011-09-26 22:39:06 UTC (rev 1536)
@@ -235,6 +235,14 @@
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.gwtplatform</groupId>
+ <artifactId>gwtp-crawler-service</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.gwtplatform</groupId>
+ <artifactId>gwtp-crawler</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -638,6 +646,12 @@
<version>0.6.3-compat</version>
</dependency>
<!-- end gwtupload -->
+ <!-- others -->
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4.4</version>
+ </dependency>
</dependencies>
<!-- <dependency> -->
@@ -958,7 +972,8 @@
</modules>
<copyWebapp>true</copyWebapp>
<compileReport>false</compileReport>
- <localWorkers>1</localWorkers><!-- Using all workers can temporarily hang the mouse and isn't much faster -->
+ <localWorkers>1</localWorkers><!-- Using all workers can temporarily
+ hang the mouse and isn't much faster -->
<extraJvmArgs>-Xmx1024m</extraJvmArgs>
</configuration>
<executions>
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -49,6 +49,8 @@
import cc.kune.core.server.content.CreationServiceDefault;
import cc.kune.core.server.content.XMLActionReader;
import cc.kune.core.server.i18n.I18nTranslationServiceDefault;
+import cc.kune.core.server.mail.MailService;
+import cc.kune.core.server.mail.MailServiceDefault;
import cc.kune.core.server.manager.ExtMediaDescripManager;
import cc.kune.core.server.manager.FileManager;
import cc.kune.core.server.manager.GroupManager;
@@ -158,6 +160,7 @@
bind(StateService.class).to(StateServiceDefault.class);
bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
bind(KuneWaveService.class).to(KuneWaveServiceDefault.class);
+ bind(MailService.class).to(MailServiceDefault.class);
bind(XMLActionReader.class);
}
Deleted: trunk/src/main/java/cc/kune/core/server/mail/MailManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailManager.java 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailManager.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -1,35 +0,0 @@
-package cc.kune.core.server.mail;
-
-import cc.kune.core.server.mail.MailManagerDefault.FormatedString;
-
-public interface MailManager {
-
- /**
- * @param subject
- * the email subject
- * @param body
- * the body of the email in html format
- * @param from
- * the sender
- * @param to
- * the recipients
- * @return true if sender (also we can change this interface if it's more
- * useful to return other thing)
- */
- boolean sendHtml(FormatedString subject, FormatedString body, String from, String... to);
-
- /**
- * @param subject
- * the email subject
- * @param body
- * the body of the email in text format
- * @param from
- * the sender
- * @param to
- * the recipient
- * @return true if sender (also we can change this interface if it's more
- * useful to return other thing)
- */
- boolean sendPlain(FormatedString subject, FormatedString body, String from, String... to);
-
-}
Deleted: trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -1,34 +0,0 @@
-package cc.kune.core.server.mail;
-
-public class MailManagerDefault implements MailManager {
-
- public static class FormatedString {
-
- private final String string;
-
- public FormatedString(final String template, final Object... args) {
- string = String.format(template, args);
- }
-
- public String getString() {
- return string;
- }
- }
-
- public MailManagerDefault(final String mailServer, final String otherConfigurableMailServerParams) {
- }
-
- @Override
- public boolean sendHtml(final FormatedString subject, final FormatedString body, final String from,
- final String... to) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean sendPlain(final FormatedString subject, final FormatedString body, final String from,
- final String... to) {
- // TODO Auto-generated method stub
- return false;
- }
-}
Copied: trunk/src/main/java/cc/kune/core/server/mail/MailService.java (from rev 1534, trunk/src/main/java/cc/kune/core/server/mail/MailManager.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailService.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailService.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -0,0 +1,60 @@
+package cc.kune.core.server.mail;
+
+import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
+
+public interface MailService {
+
+ /**
+ * Sends html email with default site "from"
+ *
+ * @param subject
+ * the email subject
+ * @param body
+ * the body of the email in html format
+ * @param to
+ * the recipient
+ */
+ void sendHtml(FormatedString subject, FormatedString body, String to);
+
+ /**
+ * Sends html email
+ *
+ * @param subject
+ * the email subject
+ * @param body
+ * the body of the email in html format
+ * @param from
+ * the sender
+ * @param tos
+ * the recipients
+ */
+ void sendHtml(FormatedString subject, FormatedString body, String from, String... tos);
+
+ /**
+ *
+ * Sends email with default site "from"
+ *
+ * @param subject
+ * the email subject
+ * @param body
+ * the body of the email in text format
+ * @param to
+ * the recipient
+ */
+ void sendPlain(FormatedString subject, FormatedString body, String to);
+
+ /**
+ * Sends plain email
+ *
+ * @param subject
+ * the email subject
+ * @param body
+ * the body of the email in text format
+ * @param from
+ * the sender
+ * @param tos
+ * the recipients
+ */
+ void sendPlain(FormatedString subject, FormatedString body, String from, String... tos);
+
+}
Copied: trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java (from rev 1534, trunk/src/main/java/cc/kune/core/server/mail/MailManagerDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -0,0 +1,106 @@
+package cc.kune.core.server.mail;
+
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.client.errors.DefaultException;
+import cc.kune.core.server.properties.KuneProperties;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+@Singleton
+public class MailServiceDefault implements MailService {
+
+ public static class FormatedString {
+
+ private final String string;
+
+ public FormatedString(final String template, final Object... args) {
+ string = String.format(template, args);
+ }
+
+ public String getString() {
+ return string;
+ }
+ }
+
+ Log log = LogFactory.getLog(MailServiceDefault.class);
+ private final Properties props;
+ private final String smtpDefaultFrom;
+ private final boolean smtpSkip;
+
+ @Inject
+ public MailServiceDefault(final KuneProperties kuneProperties) {
+ final String smtpServer = kuneProperties.get(KuneProperties.SITE_SMTP_HOST);
+ smtpDefaultFrom = kuneProperties.get(KuneProperties.SITE_SMTP_DEFAULT_FROM);
+ smtpSkip = kuneProperties.getBoolean(KuneProperties.SITE_SMTP_SKIP);
+ props = System.getProperties();
+ props.put("mail.smtp.host", smtpServer);
+ }
+
+ private void send(final FormatedString subject, final FormatedString body, final boolean isHtml,
+ final String from, final String... tos) {
+ if (smtpSkip) {
+ return;
+ }
+
+ // Get session
+ final Session session = Session.getDefaultInstance(props, null);
+
+ // Define message
+ final MimeMessage message = new MimeMessage(session);
+ try {
+ message.setFrom(new InternetAddress(from));
+ for (final String to : tos) {
+ message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
+ }
+ final String formatedSubject = subject.getString();
+ message.setSubject(formatedSubject);
+ final String formatedBody = body.getString();
+ if (isHtml) {
+ message.setContent(formatedBody, "text/html");
+ } else {
+ message.setText(formatedBody);
+ }
+ // Send message
+ Transport.send(message);
+ } catch (final AddressException e) {
+ } catch (final MessagingException e) {
+ log.error("Error sending the email", e);
+ throw new DefaultException("Error sending an email");
+ }
+ }
+
+ @Override
+ public void sendHtml(final FormatedString subject, final FormatedString body, final String to) {
+ send(subject, body, true, smtpDefaultFrom, to);
+ }
+
+ @Override
+ public void sendHtml(final FormatedString subject, final FormatedString body, final String from,
+ final String... tos) {
+ send(subject, body, true, from, tos);
+ }
+
+ @Override
+ public void sendPlain(final FormatedString subject, final FormatedString body, final String to) {
+ send(subject, body, false, smtpDefaultFrom, to);
+ }
+
+ @Override
+ public void sendPlain(final FormatedString subject, final FormatedString body, final String from,
+ final String... tos) {
+ send(subject, body, false, from, tos);
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -44,6 +44,8 @@
import cc.kune.core.client.errors.GroupShortNameInUseException;
import cc.kune.core.client.errors.I18nNotFoundException;
import cc.kune.core.client.errors.UserRegistrationException;
+import cc.kune.core.server.mail.MailService;
+import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.I18nCountryManager;
import cc.kune.core.server.manager.I18nLanguageManager;
@@ -80,6 +82,7 @@
private final I18nTranslationService i18n;
private final KuneWaveService kuneWaveManager;
private final I18nLanguageManager languageManager;
+ private final MailService mailService;
private final ParticipantUtils participantUtils;
private final KuneBasicProperties properties;
private final UserFinder userFinder;
@@ -94,7 +97,7 @@
final I18nTranslationService i18n, final CustomUserRegistrationServlet waveUserRegister,
final AccountStore waveAccountStore, final KuneWaveService kuneWaveManager,
final ParticipantUtils participantUtils, final KuneBasicProperties properties,
- final GroupManager groupManager) {
+ final GroupManager groupManager, final MailService mailService) {
super(provider, User.class);
this.userFinder = finder;
this.languageManager = languageManager;
@@ -108,6 +111,7 @@
this.participantUtils = participantUtils;
this.properties = properties;
this.groupManager = groupManager;
+ this.mailService = mailService;
}
private void checkIfEmailAreInUse(final String email) {
@@ -174,6 +178,7 @@
// Is this necessary? try to remove (used when we were setting the def
// content
// contentManager.save(userGroup.getDefaultContent());
+ mailService.sendPlain(new FormatedString("Welcome", ""), new FormatedString("welcome"), email);
return user;
} catch (final RuntimeException e) {
try {
Modified: trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-09-26 22:39:06 UTC (rev 1536)
@@ -49,6 +49,9 @@
String SITE_LOGO_URL = "kune.sitelogourl";
String SITE_NAME = "kune.default.site.name";
String SITE_SHORTNAME = "kune.default.site.shortName";
+ String SITE_SMTP_DEFAULT_FROM = "kune.site.smtp.defaultfrom";
+ String SITE_SMTP_HOST = "kune.site.smtp.host";
+ String SITE_SMTP_SKIP = "kune.site.smtp.skip";
String SITE_URL = "kune.siteurl";
String SITE_USER_AVAILABLE_TOOLS = "kune.tools.userSiteAvailableTools";
String SITE_USER_REGIST_ENABLED_TOOLS = "kune.tools.userRegisEnabledTools";
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-09-26 20:24:14 UTC (rev 1535)
+++ trunk/src/main/resources/kune.properties 2011-09-26 22:39:06 UTC (rev 1536)
@@ -12,6 +12,12 @@
kune.default.site.shortName = site
kune.site.domain = localhost
+# Email
+kune.site.smtp.host = localhost
+kune.site.smtp.defaultfrom = noreply@localhost
+# If we should avoid the use of smtp (use only for avoid emails during development)
+kune.site.smtp.skip = true
+
### licenses
kune.default.license = by-sa-v3.0
1
0
Author: vjrj_
Date: 2011-09-26 22:24:14 +0200 (Mon, 26 Sep 2011)
New Revision: 1535
Added:
trunk/src/main/java/cc/kune/core/shared/FileConstants.java
trunk/src/main/webapp/static/
trunk/src/main/webapp/ws.html
Removed:
trunk/src/main/java/cc/kune/core/client/services/FileConstants.java
trunk/src/main/java/cc/kune/core/public/ws.html
trunk/src/main/java/cc/kune/wave/public/static/
trunk/src/main/java/org/ourproject/kune/gallery/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/
trunk/src/main/java/org/ourproject/kune/workspace/client/
Modified:
trunk/script/kune client -no-server.launch
trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java
trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.ui.xml
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/client/state/TokenUtils.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java
trunk/src/main/java/cc/kune/core/client/ui/DefaultFormUtils.java
trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManagerAbstract.java
trunk/src/main/java/cc/kune/core/server/manager/file/UserLogoDownloadManager.java
trunk/src/main/java/cc/kune/core/shared/SearcherConstants.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java
trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.ui.xml
trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java
trunk/src/main/resources/kune.properties
trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
Log:
NEW - # 128: Remove /ws/ prefix in kune URL
http://kune.ourproject.org/issues/ticket/128
NEW - # 81: Minor CSS issues in chrommium
http://kune.ourproject.org/issues/ticket/81
Modified: trunk/script/kune client -no-server.launch
===================================================================
--- trunk/script/kune client -no-server.launch 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/script/kune client -no-server.launch 2011-09-26 20:24:14 UTC (rev 1535)
@@ -7,7 +7,7 @@
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="cc.kune.Kune"/>
</listAttribute>
-<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/ws/?locale=en&log_level=INFO"/>
+<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/?locale=en&log_level=INFO"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/kune"/>
</listAttribute>
@@ -20,7 +20,7 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war /home/vjrj/proyectos/dev/kune/trunk/target/kune-0.1.0-SNAPSHOT -startupUrl /ws/?locale=en&log_level=INFO -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 cc.kune.Kune"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war /home/vjrj/proyectos/dev/kune/trunk/target/kune-0.1.0-SNAPSHOT -startupUrl /?locale=en&log_level=INFO -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 cc.kune.Kune"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="kune"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
</launchConfiguration>
Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -170,10 +170,6 @@
Tooltip.current.hide();
}
Tooltip.current = this;
- Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(),
- Window.getClientHeight(), ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(),
- ofWidget.getOffsetWidth(), ofWidget.getOffsetHeight(), Tooltip.this.getWidth(),
- Tooltip.this.getHeight()));
if (width != WIDTH_NOT_DEFINED) {
tooltip.getElement().getStyle().setWidth(width, Unit.PX);
} else if (tooltip.getOffsetWidth() > 430) {
@@ -181,9 +177,17 @@
} else {
tooltip.getElement().getStyle().clearWidth();
}
+ showAt();
}
}
+ private void showAt() {
+ Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(),
+ Window.getClientHeight(), ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(),
+ ofWidget.getOffsetWidth(), ofWidget.getOffsetHeight(), Tooltip.this.getWidth(),
+ Tooltip.this.getHeight()));
+ }
+
protected void showAt(final TooltipPosition position) {
this.setPopupPosition(position.getLeft(), position.getTop());
switch (position.getArrowPosition()) {
Modified: trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -166,6 +166,7 @@
// text = text.replaceAll("\'", "'");
result = result.replaceAll("<", "<");
result = result.replaceAll(">", ">");
+ result = result.replaceAll("—", "—");
}
return result;
}
@@ -245,6 +246,7 @@
result = result.replaceAll("'", "\'");
result = result.replaceAll("<", "<");
result = result.replaceAll(">", ">");
+ result = result.replaceAll("—", "—");
return result;
}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -201,7 +201,6 @@
@Override
public void execute() {
stateManager.setRetrievedStateAndGo(state);
- NotifyUser.info("Test", true);
groupOptions.showTooltip();
}
});
Modified: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties 2011-09-26 20:24:14 UTC (rev 1535)
@@ -201,7 +201,7 @@
selectACreativeCommonsLicenseRecommendedForCulturalWorks = Select a Creative Commons license (recommended for cultural works)
otherKindOfLicenses = Other kind of licenses
useTheGnuLicensesRecommendedForFreeSoftwareWorksAndOtherKindOfLicenses = Use the GNU licenses (recommended for free software works) and other kind of licenses
-withACreativeCommonsLicenseYouKeepYourCopyrightButAllowPeopleToCopyAndDistributeYourWorkProvidedThey = With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit � and only on the conditions you specify here. What do you want to do?
+withACreativeCommonsLicenseYouKeepYourCopyrightButAllowPeopleToCopyAndDistributeYourWorkProvidedThey = With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit — and only on the conditions you specify here. What do you want to do?
allowAnyUsesOfYourWorkIncludingCommercial = Allow any uses of your work, including commercial?
allowModificationsOfYourWork = Allow modifications of your work?
yes = Yes
@@ -211,7 +211,7 @@
theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkAsWellAsMakeDerivativeWorksBasedOnIt = The licensor permits others to copy, distribute, display and perform the work, as well as make derivative works based on it
yesAsLongAsOtherShareAlike = Yes, as long as other share alike
theLicensorPermitsOthersToDistributeDerivativeWorksOnlyUnderTheSameLicenseOrOneCompatibleWithTheOneT = The licensor permits others to distribute derivative works only under the same license or one compatible with the one that governs the licensor's work
-theLicensorPermitsOthersToCopyDistributeDisplayAndPerformOnlyUnalteredCopiesOfTheWorkNotDerivativeWo = The licensor permits others to copy, distribute, display and perform only unaltered copies of the work � not derivative works based on it
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformOnlyUnalteredCopiesOfTheWorkNotDerivativeWo = The licensor permits others to copy, distribute, display and perform only unaltered copies of the work — not derivative works based on it
thisIsACopyleftLicense = This is a copyleft license.
thisIsNotACopyleftLicense = This is not a copyleft license.
thisIsAppropriateForFreeCulturalWorks = This is appropriate for free cultural works.
Deleted: trunk/src/main/java/cc/kune/core/client/services/FileConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/FileConstants.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/services/FileConstants.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.core.client.services;
-
-public final class FileConstants {
-
- public final static String DOWNLOAD = "download";
- public final static String FILENAME = "filename";
- public final static String GROUP_LOGO_FIELD = "k-glogov-ff";
- public final static String HASH = "hash";
- public final static String IMGSIZE = "imgsize";
- public final static int LOGO_DEF_HEIGHT = 60;
- public final static int LOGO_DEF_WIDTH = 468;
- public final static int LOGO_MIN_HEIGHT = 28;
- public final static int LOGO_MIN_WIDTH = 468;
- public final static String TOKEN = "token";
- public final static String TYPE_ID = "typeid";
- public final static String USER_LOGO_FIELD = "k-ulogov-ff";
- public final static String USERNAME = "username";
-
- private FileConstants() {
- }
-}
Modified: trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -22,25 +22,17 @@
import cc.kune.common.client.utils.Url;
import cc.kune.common.client.utils.UrlParam;
import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.UserSimpleDTO;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.inject.Inject;
public class FileDownloadUtils {
- public static final String AVATARDOWNLOADSERVLET = "servlets/UserLogoDownloadManager";
- private static final String BACKDOWNLOADSERVLET = "servlets/EntityBackgroundDownloadManager";
- private static final String DOWNLOADSERVLET = "servlets/FileDownloadManager";
- protected static final String GROUP_NO_AVATAR_IMAGE = "images/group-def-icon.png";
- private static final String LOGODOWNLOADSERVLET = "servlets/EntityLogoDownloadManager";
- protected static final String PERSON_NO_AVATAR_IMAGE = "images/unknown.jpg";
- public static final String WORLD_AVATAR_IMAGE = "images/world-90.gif";
-
private final ImageUtils imageUtils;
private final Session session;
@@ -51,7 +43,7 @@
}
private String calculateUrl(final StateToken token, final boolean download, final boolean useHash) {
- final Url url = new Url(GWT.getModuleBaseURL() + DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
+ final Url url = new Url(FileConstants.DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
token.toString()));
if (download) {
url.add(new UrlParam(FileConstants.DOWNLOAD, download));
@@ -71,18 +63,20 @@
}
public String getBackgroundImageUrl(final StateToken token) {
- return new Url(GWT.getModuleBaseURL() + BACKDOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
- token.toString())).toString();
+ return new Url(FileConstants.BACKDOWNLOADSERVLET,
+ new UrlParam(FileConstants.TOKEN, token.toString())).toString();
}
public String getBackgroundResizedUrl(final StateToken token, final ImageSize imageSize) {
- return new Url(GWT.getModuleBaseURL() + BACKDOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
- token.toString()), new UrlParam(FileConstants.IMGSIZE, imageSize.toString())).toString();
+ return new Url(FileConstants.BACKDOWNLOADSERVLET,
+ new UrlParam(FileConstants.TOKEN, token.toString()), new UrlParam(FileConstants.IMGSIZE,
+ imageSize.toString())).toString();
}
public String getGroupLogo(final GroupDTO group) {
return group.hasLogo() ? getLogoImageUrl(group.getStateToken())
- : group.isPersonal() ? PERSON_NO_AVATAR_IMAGE : GROUP_NO_AVATAR_IMAGE;
+ : group.isPersonal() ? FileConstants.PERSON_NO_AVATAR_IMAGE
+ : FileConstants.GROUP_NO_AVATAR_IMAGE;
}
public String getImageResizedUrl(final StateToken token, final ImageSize imageSize) {
@@ -106,8 +100,8 @@
}
public String getLogoImageUrl(final StateToken token) {
- return new Url(GWT.getModuleBaseURL() + LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
- token.toString())).toString();
+ return new Url(FileConstants.LOGODOWNLOADSERVLET,
+ new UrlParam(FileConstants.TOKEN, token.toString())).toString();
}
public String getUrl(final StateToken token) {
@@ -115,11 +109,10 @@
}
public String getUserAvatar(final String username) {
- return new Url(GWT.getModuleBaseURL() + AVATARDOWNLOADSERVLET, new UrlParam(FileConstants.USERNAME,
- username)).toString();
+ return new Url(FileConstants.AVATARDOWNLOADSERVLET, new UrlParam(FileConstants.USERNAME, username)).toString();
}
public String getUserAvatar(final UserSimpleDTO user) {
- return user.hasLogo() ? getLogoImageUrl(user.getStateToken()) : PERSON_NO_AVATAR_IMAGE;
+ return user.hasLogo() ? getLogoImageUrl(user.getStateToken()) : FileConstants.PERSON_NO_AVATAR_IMAGE;
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.ui.xml 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.ui.xml 2011-09-26 20:24:14 UTC (rev 1535)
@@ -16,7 +16,7 @@
</ui:style>
<g:FlowPanel styleName="{style.panel}" ui:field="flow">
- <g:Frame styleName="{style.frame}" url="about.html"
+ <g:Frame styleName="{style.frame}" url="ws/about.html"
ui:field="frame" />
</g:FlowPanel>
</ui:UiBinder>
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -137,7 +137,7 @@
@Override
public void gotoHistoryToken(final String token) {
- Log.debug("StateManager: history goto-string-token :" + token);
+ Log.debug("StateManager: history goto-string-token: " + token);
history.newItem(token);
}
Modified: trunk/src/main/java/cc/kune/core/client/state/TokenUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/TokenUtils.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/state/TokenUtils.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -19,13 +19,30 @@
*/
package cc.kune.core.client.state;
+import cc.kune.common.client.utils.Base64Utils;
+
public class TokenUtils {
- public static String addRedirect(final String token, final String redirect) {
- return new StringBuffer().append(token).append("(").append(redirect).append(")").toString();
+ public static String addRedirect(final String token, final String redirect) {
+ return new StringBuffer().append(token).append("(").append(redirect).append(")").toString();
+ }
+
+ private static String compose(final String... params) {
+ final StringBuffer sb = new StringBuffer();
+ for (final String param : params) {
+ sb.append(param).append("|");
}
+ return sb.toString().replaceAll("\\|$", "");
+ }
- public static String preview(final String token) {
- return addRedirect(SiteTokens.PREVIEW, token);
- }
+ public static String preview(final String token) {
+ return addRedirect(SiteTokens.PREVIEW, token);
+ }
+
+ public static String subtitle(final String title, final String description, final String redirect) {
+ return addRedirect(
+ SiteTokens.SUBTITLES,
+ compose(Base64Utils.toBase64(title.getBytes()), Base64Utils.toBase64(description.getBytes()),
+ redirect));
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -1,6 +1,7 @@
package cc.kune.core.client.sub;
import cc.kune.common.client.utils.Base64Utils;
+import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.core.client.state.StateManager;
import com.google.gwt.event.shared.EventBus;
@@ -24,7 +25,7 @@
void setTitleText(String text);
- void show();
+ void show(final SimpleCallback atShowEnd);
}
private final StateManager stateManager;
@@ -45,7 +46,11 @@
final String[] params = token.split("\\|");
getView().setTitleText(new String(Base64Utils.fromBase64(params[0])));
getView().setDescription(new String(Base64Utils.fromBase64(params[1])));
- getView().show();
- stateManager.gotoHistoryToken(params[2]);
+ getView().show(new SimpleCallback() {
+ @Override
+ public void onCallback() {
+ stateManager.gotoHistoryToken(params[2]);
+ }
+ });
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -5,6 +5,7 @@
import org.adamtacy.client.ui.effects.examples.Show;
import org.adamtacy.client.ui.effects.examples.SlideRight;
+import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.core.client.sub.SubtitlesManager.SubtitlesView;
import com.google.gwt.core.client.GWT;
@@ -30,12 +31,14 @@
private static SubtitlesWidgetUiBinder uiBinder = GWT.create(SubtitlesWidgetUiBinder.class);
+ private SimpleCallback callback;
@UiField
InlineLabel description;
private final PopupPanel popup;
private boolean showing;
@UiField
InlineLabel title;
+
private final Widget widget;
public SubtitlesWidget() {
@@ -57,6 +60,7 @@
@Override
public void onEffectCompleted(final EffectCompletedEvent event) {
popup.hide();
+ callback.onCallback();
}
});
showing = false;
@@ -91,9 +95,11 @@
}
@Override
- public void show() {
+ public void show(final SimpleCallback callback) {
+ this.callback = callback;
popup.setWidget(widget);
setSize(Window.getClientWidth(), Window.getClientHeight());
+ popup.sinkEvents(Event.MOUSEEVENTS);
popup.show();
final Show showAtIni = new Show(popup.getElement());
showAtIni.setDuration(3);
@@ -101,7 +107,6 @@
final SlideRight slideAtIni = new SlideRight(popup.getElement());
slideAtIni.setDuration(3);
slideAtIni.play();
- popup.sinkEvents(Event.MOUSEEVENTS);
this.showing = true;
}
Modified: trunk/src/main/java/cc/kune/core/client/ui/DefaultFormUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ui/DefaultFormUtils.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/ui/DefaultFormUtils.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -44,8 +44,6 @@
if (radioTip != null && tooltip == null) {
tooltip = Tooltip.to(radio, radioTip);
tooltip.setWidth(300);
- tooltip.show();
- tooltip.hide();
}
}
});
Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -25,9 +25,9 @@
import cc.kune.common.client.actions.ui.bind.GuiProvider;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.client.ws.entheader.EntityHeaderPresenter.EntityHeaderView;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.gspace.client.GSpaceArmor;
Deleted: trunk/src/main/java/cc/kune/core/public/ws.html
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.html 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/public/ws.html 2011-09-26 20:24:14 UTC (rev 1535)
@@ -1,261 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<title>Kune</title>
-<script type="text/javascript" language="javascript"
- src="/ws/ws.nocache.js"></script>
-<meta name="emite.httpBase" content="/http-bind/" />
-<meta name="emite.host" content="localhost" />
-<meta name="emite.searchHost" content="search.localhost" />
-<!--<meta name="emite.session" content="login" />-->
-<meta name="hablar.roomService" content="rooms.localhost" />
-<meta name="hablar.login" content="false" />
-<meta name="hablar.hasVCard" content="false" />
-<meta name="hablar.search" content="false" />
-<meta name="hablar.hasSound" content="false" />
-<meta name="hablar.hasCopyToClipboard" content="true" />
-<!--<meta name="hablar.hasLogger" content="true" />-->
-<meta name="hablar.hasSignals" content="false" />
-<meta name="hablar.roster" content="true" />
-<meta name="hablar.dockRoster" content="left" />
-<meta name="hablar.icons" content="alt" />
-<meta name="hablar.layout" content="tabs" />
-<meta name="hablar.inline" content="vertical_dock_div" />
-<meta name="hablar.width" content="550px" />
-<meta name="hablar.height" content="400px" />
-<link rel="shortcut icon" href="favicon.ico" />
-<link rel="stylesheet" type="text/css"
- href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
-<!-- FIXME: make something local -->
-<script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
-<script>
- WebFont.load({
- google : {
- families : [ 'Ubuntu' ]
- }
- });
-</script>
-<link
- href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic'
- rel='stylesheet' type='text/css'>
-<!-- <link href='http://fonts.googleapis.com/css?family=Inconsolata'
- rel='stylesheet' type='text/css'> -->
-<link type="text/css" rel="stylesheet" href="gxt/css/gxt-all.css">
-<link type="text/css" rel="stylesheet" href="gxt/css/gxt-gray.css">
-<link type="text/css" rel="stylesheet"
- href="gxt-custom/css/gxt-op-common.css">
-<link type="text/css" rel="stylesheet" href="kune-hablar.css">
-<link type="text/css" rel="stylesheet" href="kune-chat.css">
-<link type="text/css" rel="stylesheet" href="kune-common.css">
-<link type="text/css" rel="stylesheet"
- href="fontface/ubuntufontface.css">
-<link type="text/css" rel="stylesheet" href="kune-message.css">
-<link type="text/css" rel="stylesheet" href="/others/splash/style/permalink.css">
-<link type="text/css" rel="stylesheet" href="/others/splash/style/stuff.css">
-<link type="text/css" rel="stylesheet" href="/others/splash/style/main.css">
-<link type="text/css" rel="stylesheet" href="ws.css">
-<script type="text/javascript" src="/others/splash/js/gadget.js"></script>
-<script type="text/javascript" src="/others/splash/js/rpc.js"></script>
-<script type="text/javascript" src="/others/splash/js/common_client.js"></script>
-<script type="text/javascript" src="/others/splash/js/permalink_client.js"></script>
-<script type="text/javascript" src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
-
-<style type="text/css">
-
-body {
- background-color: white;
- color: black;
- font-family: 'Ubuntu', Arial;
- font-size: small;
- overflow: hidden;
-}
-
-#kuneloading {
- position: absolute;
- left: 2%;
- top: 2%;
- z-index: 20001;
- height: auto;
- border: solid 2px #ccc;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- background-color: white;
-}
-
-#kuneloading a {
- color: #225588;
-}
-
-#kuneloading .kuneloading-indicator {
- color: #444;
- font: bold 13px tahoma, arial, helvetica;
- padding: 3px 3px 8px;
- margin: 0;
- height: auto;
-}
-
-#kuneloading-msg {
- font: normal 10px arial, tahoma, sans-serif;
-}
-
-#k-home-prewrap {
- margin-top: -22px;
-}
-
-#k-home-wrapper {
- margin-left: auto;
- margin-right: auto;
- position: relative;
- width: 665px;
- min-width: 320px;
-}
-
-#k-home-ini {
- clear: both;
- font-size: 28px;
- color: #69312f;
- text-align: justify;
- padding: 27px 0;
- line-height: 1.3em;
-}
-
-#k-home-ini a {
- color: #803000;
- font-weight: bold;
-}
-
-#k-home-ini strong {
- font-weight: bold;
-}
-
-#k-home-stats {
- font-size: 22px;
- color: #c87137;
- font-weight: bold;
-}
-
-#k-home-table {
- display: table;
-}
-
-#k-home-header {
- display: table-row;
-}
-
-#k-home-logo {
- display: table-cell;
- margin: 50px 0 22px 0;
- float: right;
-}
-
-#k-home-summary {
- display: table-cell;
- font-size: 32px;
- color: #dd8a3d;
- font-weight: bold;
- white-space: nowrap;
- float: left;
-}
-
-#k-home-summary li {
- padding-left: 41px;
- background-repeat: no-repeat;
- background-position: 0 .2em;
- line-height: 45px;
-}
-
-#k-home-row {
- display: table-row;
-}
-
-#k-home-left {
- display: table-cell;
-}
-
-#k-home-right {
- display: table-cell;
-}
-
-.banner {
- margin: 30px;
-}
-</style>
-<!--[if IE 6]>
- <link type="text/css" rel="stylesheet" href="ie6.css">
-<![endif]-->
-</head>
-<body>
- <!-- Banner for wave errors -->
- <div class="banner" id="banner"></div>
- <!-- Autocomplete user/pass -->
- <form method="post" action="javascript:void(0)" style="display: none">
- <input type="text" id="address" name="address" value="" /> <input
- type="password" id="password" name="password" value="" /> <input
- type="submit" value="Login" id="login" /> <input type="submit"
- class="wiab le button" name="signIn" id="signIn" value="Sign in">
- </form>
- <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
- <noscript>
- <div
- style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
- Your web browser must have JavaScript enabled in order for this
- application to display correctly.</div>
- </noscript>
- <iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
- <iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
- <div id="kuneinitialcurtain"></div>
- <div id="kuneloading">
- <div class="kuneloading-indicator">
- <img src="images/kune-anim-g.gif" width="35" height="35"
- alt="kune-loading"
- style="margin-right: 3px; float: left; vertical-align: top;" />kune <br />
- <span id="kuneloading-msg">Starting...</span>
- </div>
- </div>
- <div id="k-home-prewrap">
- <div id="k-home-wrapper">
- <div id="k-home-table">
- <div id="k-home-header">
- <div id="k-home-logo">
- <img src="logo-big-home.png" alt="" />
- </div>
- <div id="k-home-summary">
- <ul>
- <li style="background-image: url(images/kune-intro-user.png);">Comunicate with others</li>
- <li style="background-image: url(images/kune-intro-group.png);">Work in collaboration</li>
- <li style="background-image: url(images/kune-intro-world.png);">And share with the world</li>
- </ul>
- </div>
- <!-- k-home-summary -->
- </div>
- <!-- div home-header -->
- <div id="k-home-row">
- <div id="k-home-left">
- <div id="k-home-ini">
- Welcome! This site is a Kune node. Kune, which means
- "together" in esperanto, it's a network of interconnected
- sites like this one, where you can <strong>communicate,
- share, collaborate with others and create your web
- spaces easily</strong>. <a href="#signin">Join!</a>
- </div>
- <!-- div home-ini -->
- <div id="k-home-stats" style="display: none;">Latests
- groups created</div>
- </div>
- <!-- div k-home-left -->
- <div id="k-home-right">
- <!-- div home-stats -->
- </div>
- <!-- div k-home-right -->
- </div>
- <!-- div k-home-row -->
- </div>
- <!-- div home-table -->
- </div>
- <!-- home-wrapper -->
- </div>
- <!-- home-prewrap -->
-</body>
-</html>
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -73,13 +73,15 @@
public class KuneRackModule implements RackModule {
public static final Log LOG = LogFactory.getLog(KuneRackModule.class);
private final Module configModule;
+ private final String suffix;
public KuneRackModule() {
- this("development", null);
+ this("development", "/ws", null);
}
- public KuneRackModule(final String jpaUnit, final Scope sessionScope) {
+ public KuneRackModule(final String jpaUnit, final String suffix, final Scope sessionScope) {
+ this.suffix = suffix;
final SystemConfiguration sysConf = new SystemConfiguration();
final String kuneConfig = sysConf.getString("kune.server.config");
@@ -135,22 +137,24 @@
builder.at(".*").install(new GuiceFilter());
// NOTE: Commented this while testing Wave
- // builder.at("^/$").install(new RedirectFilter("/ws/"));
- builder.at("^/ws").install(new RedirectFilter("/ws/"));
+ // builder.at("^/$").install(new RedirectFilter(KUNE_PREFIX + "/"));
+ builder.at("^" + suffix + "").install(new RedirectFilter(suffix + "/"));
- builder.at("^/ws/$").install(new ListenerFilter(KuneApplicationListener.class),
- new ForwardFilter("/ws/ws.html"));
+ builder.at("^" + suffix + "/$").install(new ListenerFilter(KuneApplicationListener.class),
+ new ForwardFilter(suffix + "/ws.html"));
- builder.installGWTServices("^/ws/", SiteService.class, GroupService.class, ContentService.class,
- UserService.class, SocialNetworkService.class, I18nService.class, ListsService.class);
- builder.installRESTServices("^/ws/json/", TestJSONService.class, GroupJSONService.class,
+ builder.installGWTServices("^" + suffix + "/", SiteService.class, GroupService.class,
+ ContentService.class, UserService.class, SocialNetworkService.class, I18nService.class,
+ ListsService.class);
+ builder.installRESTServices("^" + suffix + "/json/", TestJSONService.class, GroupJSONService.class,
UserJSONService.class, I18nTranslationJSONService.class, ContentJSONService.class);
- builder.installServlet("^/ws/servlets/", FileUploadManager.class, FileDownloadManager.class,
- EntityLogoUploadManager.class, EntityLogoDownloadManager.class, FileGwtUploadServlet.class,
- EntityBackgroundDownloadManager.class, EntityBackgroundUploadManager.class,
- UserLogoDownloadManager.class);
+ builder.installServlet("^" + suffix + "/servlets/", FileUploadManager.class,
+ FileDownloadManager.class, EntityLogoUploadManager.class, EntityLogoDownloadManager.class,
+ FileGwtUploadServlet.class, EntityBackgroundDownloadManager.class,
+ EntityBackgroundUploadManager.class, UserLogoDownloadManager.class);
- builder.at("^/ws/(.*)$").install(new ForwardFilter("^/ws/(.*)$", "/ws/{0}"));
+ builder.at("^" + suffix + "/(.*)$").install(
+ new ForwardFilter("^" + suffix + "/(.*)$", suffix + "/{0}"));
}
private void installGuiceModules(final RackBuilder builder) {
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -33,10 +33,10 @@
import org.apache.commons.logging.LogFactory;
import cc.kune.core.client.errors.ContentNotFoundException;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.client.services.ImageSize;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.domain.Group;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -28,8 +28,8 @@
import javax.servlet.http.HttpServletResponse;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.domain.Group;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -29,12 +29,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.i18n.I18nTranslationService;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -33,7 +33,6 @@
import org.apache.commons.logging.LogFactory;
import cc.kune.core.client.errors.ContentNotFoundException;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.client.services.ImageSize;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
@@ -41,6 +40,7 @@
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.content.ContentUtils;
import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.domain.BasicMimeType;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -30,8 +30,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import com.google.inject.servlet.RequestScoped;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManagerAbstract.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManagerAbstract.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManagerAbstract.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -38,8 +38,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import com.google.inject.Inject;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/UserLogoDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/UserLogoDownloadManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/UserLogoDownloadManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -28,8 +28,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import cc.kune.core.client.services.FileConstants;
import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.domain.Group;
Copied: trunk/src/main/java/cc/kune/core/shared/FileConstants.java (from rev 1531, trunk/src/main/java/cc/kune/core/client/services/FileConstants.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/FileConstants.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.core.shared;
+
+public final class FileConstants {
+
+ public final static String ASITE_PREFIX = "ws/";
+ public final static String AVATARDOWNLOADSERVLET = ASITE_PREFIX + "servlets/UserLogoDownloadManager";
+ public final static String BACKDOWNLOADSERVLET = ASITE_PREFIX
+ + "servlets/EntityBackgroundDownloadManager";
+ public final static String DOWNLOAD = "download";
+ public static final String DOWNLOADSERVLET = ASITE_PREFIX + "servlets/FileDownloadManager";
+ public final static String FILENAME = "filename";
+ public final static String GROUP_LOGO_FIELD = "k-glogov-ff";
+ public static final String GROUP_NO_AVATAR_IMAGE = ASITE_PREFIX + "images/group-def-icon.png";
+ public final static String HASH = "hash";
+ public final static String IMGSIZE = "imgsize";
+ public final static int LOGO_DEF_HEIGHT = 60;
+ public final static int LOGO_DEF_WIDTH = 468;
+ public final static int LOGO_MIN_HEIGHT = 28;
+ public final static int LOGO_MIN_WIDTH = 468;
+ public static final String LOGODOWNLOADSERVLET = ASITE_PREFIX + "servlets/EntityLogoDownloadManager";
+ public final static String PERSON_NO_AVATAR_IMAGE = ASITE_PREFIX + "images/unknown.jpg";
+ public final static String TOKEN = "token";
+ public final static String TYPE_ID = "typeid";
+ public final static String USER_LOGO_FIELD = "k-ulogov-ff";
+ public final static String USERNAME = "username";
+ public final static String WORLD_AVATAR_IMAGE = ASITE_PREFIX + "images/world-90.gif";
+
+ public FileConstants() {
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/shared/SearcherConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/SearcherConstants.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/core/shared/SearcherConstants.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -21,21 +21,27 @@
public final class SearcherConstants {
- public final static String CONTENT_DATA_PROXY_URL = "/ws/json/ContentJSONService/search";
- public final static String CONTENT_TEMPLATE_TEXT_PREFIX = "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img src=\"";
- public final static String CONTENT_TEMPLATE_TEXT_SUFFIX = "\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>";
+ // public final static String CONTENT_DATA_PROXY_URL =
+ // "/ws/json/ContentJSONService/search";
+ // public final static String CONTENT_TEMPLATE_TEXT_PREFIX =
+ // "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img src=\"";
+ // public final static String CONTENT_TEMPLATE_TEXT_SUFFIX =
+ // "\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>";
public final static String GROUP_DATA_PROXY_URL = "/ws/json/GroupJSONService/search";
+ // public final static String I18N_JSON_SERVICE =
+ // "/ws/json/I18nTranslationJSONService/search";
public final static String GROUP_PARAM = "group";
- public final static String I18N_JSON_SERVICE = "/ws/json/I18nTranslationJSONService/search";
- public final static String I18N_JSON_SERVICE_TRANSLATED = "/ws/json/I18nTranslationJSONService/searchtranslated";
public final static String LIMIT_PARAM = "limit";
public final static String MIMETYPE_PARAM = "mimetype";
public final static String MIMETYPE2_PARAM = "mimetype2";
public final static String QUERY_PARAM = "query";
public final static String START_PARAM = "start";
- public final static String USER_DATA_PROXY_URL = "/ws/json/UserJSONService/search";
+ // public final static String I18N_JSON_SERVICE_TRANSLATED =
+ // "/ws/json/I18nTranslationJSONService/searchtranslated";
+ // public final static String USER_DATA_PROXY_URL =
+ // "/ws/json/UserJSONService/search";
public static final String WILDCARD = "*";
private SearcherConstants() {
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -16,7 +16,7 @@
@Inject
public I18nTranslateRecomendPanel(final I18nTranslationService i18n) {
tabTitle = new Label(i18n.t("Recommendations"));
- recommFrame = new Frame("i18n-recom.html");
+ recommFrame = new Frame("ws/i18n-recom.html");
// recommFrame.setHeight("auto");
recommFrame.setStyleName("k-i18n-recommend");
initWidget(recommFrame);
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -27,10 +27,11 @@
import cc.kune.common.client.utils.OnAcceptCallback;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.EntityOptionsView;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
@@ -38,10 +39,11 @@
public class EntityOptLogoPanel extends Composite implements EntityOptLogoView {
- public static final String ICON_UPLD_SERVLET = "servlets/EntityLogoUploadManager";
- private final EntityUploaderForm uploader;
+ public static final String ICON_UPLD_SERVLET = GWT.getModuleBaseURL()
+ + "servlets/EntityLogoUploadManager";
private final I18nTranslationService i18n;
private final IconLabel tabTitle;
+ private final EntityUploaderForm uploader;
public EntityOptLogoPanel(final EventBus eventBus, final I18nTranslationService i18n,
final String panelId, final String buttonId, final String inputId, final NavResources res) {
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -86,7 +86,7 @@
}
public void onSubmitFailed(final String responseText) {
- NotifyUser.error(i18n.t("Error setting the logo", responseText));
+ NotifyUser.error(i18n.t("Error setting the logo"));
}
protected abstract void setState();
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -25,7 +25,7 @@
import gwtupload.client.IUploader.OnFinishUploaderHandler;
import gwtupload.client.IUploader.OnStartUploaderHandler;
import gwtupload.client.MultiUploader;
-import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.FileConstants;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -20,7 +20,7 @@
package cc.kune.gspace.client.options.logo;
import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.gwt.event.shared.EventBus;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -20,7 +20,7 @@
package cc.kune.gspace.client.options.logo;
import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.gwt.event.shared.EventBus;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -34,6 +34,7 @@
import cc.kune.gspace.client.options.logo.EntityUploaderForm;
import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
@@ -47,7 +48,8 @@
public class EntityOptStylePanel extends FlowPanel implements EntityOptStyleView {
- public static final String ICON_UPLD_SERVLET = "servlets/EntityBackgroundUploadManager";
+ public static final String ICON_UPLD_SERVLET = GWT.getModuleBaseURL()
+ + "servlets/EntityBackgroundUploadManager";
private final Label backgroundLabel;
private final Image backImage;
private final String changeImage;
Modified: trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -26,6 +26,7 @@
import cc.kune.gspace.client.GSpaceArmor;
import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter.EntityLicenseView;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
@@ -81,7 +82,7 @@
public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
final String licenseText = i18n.t("© [%s], under license: [%s]", groupName, licenseDTO.getLongName());
// KuneUiUtils.setQuickTip(licenseLabel, licenseText);
- licenseImage.setUrl(licenseDTO.getImageUrl());
+ licenseImage.setUrl(GWT.getModuleBaseURL() + licenseDTO.getImageUrl());
tooltip.setText(licenseText);
}
}
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.ui.xml 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.ui.xml 2011-09-26 20:24:14 UTC (rev 1535)
@@ -1,22 +1,36 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
+
+ <ui:style>
+ @if user.agent safari {
+ .k-msg-width {
+ width: 0px;
+ }
+ }
+
+ @elif user.agent gecko1_8 {
+ .k-msg-width {
+ width: auto;
+ }
+ }
+ </ui:style>
<ui:with field='img'
- type='cc.kune.msgs.client.resources.UserMessageImages' />
+ type='cc.kune.msgs.client.resources.UserMessageImages'/>
<g:HorizontalPanel verticalAlignment="ALIGN_MIDDLE"
- height="42px" addStyleNames="k-msg, k-3corners">
+ height="42px" addStyleNames="k-msg, k-3corners, {style.k-msg-width}">
<g:SimplePanel addStyleNames="k-msg-icon">
- <g:Image width="100%" ui:field="icon" height="100%" />
+ <g:Image width="100%" ui:field="icon" height="100%"/>
</g:SimplePanel>
<g:Cell width="100%">
<g:InlineHTML ui:field="label" width="100%"
- styleName="k-msg-label" />
+ styleName="k-msg-label"/>
</g:Cell>
<g:PushButton ui:field="close" styleName="k-msg-close"
width="22px">
- <g:upFace image='{img.remove}' />
- <g:downFace image='{img.removeOver}' />
- <g:upHoveringFace image='{img.removeGrey}' />
+ <g:upFace image='{img.remove}'/>
+ <g:downFace image='{img.removeOver}'/>
+ <g:upHoveringFace image='{img.removeGrey}'/>
</g:PushButton>
</g:HorizontalPanel>
</ui:UiBinder>
Modified: trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -26,12 +26,14 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.shared.FileConstants;
import com.google.inject.Inject;
/**
* The Class KuneWaveProfileManager is a workaround to show avatars in kune
- * while the Wave part is more mature (see in the future RemoteProfileManagerImpl)
+ * while the Wave part is more mature (see in the future
+ * RemoteProfileManagerImpl)
*
*/
public class KuneWaveProfileManager extends AbstractProfileManager<ProfileImpl> implements
@@ -51,14 +53,14 @@
}
final String address = profile.getAddress();
if (address.equals(localDomain) || address.equals("@")) {
- updateProfileAvatar(profile, FileDownloadUtils.WORLD_AVATAR_IMAGE);
+ updateProfileAvatar(profile, FileConstants.WORLD_AVATAR_IMAGE);
} else if (address.contains(Session.get().getDomain())) {
updateProfileAvatar(profile, downloadUtils.getUserAvatar(address.split("@")[0]));
}
}
@Override
- public ProfileImpl getProfile(ParticipantId participantId) {
+ public ProfileImpl getProfile(final ParticipantId participantId) {
ProfileImpl profile = profiles.get(participantId.getAddress());
if (profile == null) {
Modified: trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -26,8 +26,7 @@
import cc.kune.common.client.utils.Url;
import cc.kune.common.client.utils.UrlParam;
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.shared.FileConstants;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -151,10 +150,10 @@
private String getAvatarUrl(final String address) {
String avatar = "";
if (address.contains(domain)) {
- avatar = new Url("/ws/" + FileDownloadUtils.AVATARDOWNLOADSERVLET, new UrlParam(
- FileConstants.USERNAME, address.split("@")[0])).toString();
+ avatar = new Url(FileConstants.AVATARDOWNLOADSERVLET, new UrlParam(FileConstants.USERNAME,
+ address.split("@")[0])).toString();
} else {
- avatar = "/others/unknown.jpg";
+ avatar = FileConstants.PERSON_NO_AVATAR_IMAGE;
}
return avatar;
}
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/main/resources/kune.properties 2011-09-26 20:24:14 UTC (rev 1535)
@@ -4,7 +4,7 @@
kune.siteurl = http://localhost:8080
-kune.sitelogourl = images/kune-logo-16px.png
+kune.sitelogourl = ws/images/kune-logo-16px.png
# Every kune site have a group with this name:
Copied: trunk/src/main/webapp/static (from rev 1531, trunk/src/main/java/cc/kune/wave/public/static)
Added: trunk/src/main/webapp/ws.html
===================================================================
--- trunk/src/main/webapp/ws.html (rev 0)
+++ trunk/src/main/webapp/ws.html 2011-09-26 20:24:14 UTC (rev 1535)
@@ -0,0 +1,261 @@
+<!doctype html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<title>Kune</title>
+<script type="text/javascript" language="javascript"
+ src="ws/ws.nocache.js"></script>
+<meta name="emite.httpBase" content="/http-bind/" />
+<meta name="emite.host" content="localhost" />
+<meta name="emite.searchHost" content="search.localhost" />
+<!--<meta name="emite.session" content="login" />-->
+<meta name="hablar.roomService" content="rooms.localhost" />
+<meta name="hablar.login" content="false" />
+<meta name="hablar.hasVCard" content="false" />
+<meta name="hablar.search" content="false" />
+<meta name="hablar.hasSound" content="false" />
+<meta name="hablar.hasCopyToClipboard" content="true" />
+<!--<meta name="hablar.hasLogger" content="true" />-->
+<meta name="hablar.hasSignals" content="false" />
+<meta name="hablar.roster" content="true" />
+<meta name="hablar.dockRoster" content="left" />
+<meta name="hablar.icons" content="alt" />
+<meta name="hablar.layout" content="tabs" />
+<meta name="hablar.inline" content="vertical_dock_div" />
+<meta name="hablar.width" content="550px" />
+<meta name="hablar.height" content="400px" />
+<link rel="shortcut icon" href="ws/favicon.ico" />
+<link rel="stylesheet" type="text/css"
+ href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
+<!-- FIXME: make something local -->
+<script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
+<script>
+ WebFont.load({
+ google : {
+ families : [ 'Ubuntu' ]
+ }
+ });
+</script>
+<link
+ href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic'
+ rel='stylesheet' type='text/css'>
+<!-- <link href='http://fonts.googleapis.com/css?family=Inconsolata'
+ rel='stylesheet' type='text/css'> -->
+<link type="text/css" rel="stylesheet" href="ws/gxt/css/gxt-all.css">
+<link type="text/css" rel="stylesheet" href="ws/gxt/css/gxt-gray.css">
+<link type="text/css" rel="stylesheet"
+ href="ws/gxt-custom/css/gxt-op-common.css">
+<link type="text/css" rel="stylesheet" href="ws/kune-hablar.css">
+<link type="text/css" rel="stylesheet" href="ws/kune-chat.css">
+<link type="text/css" rel="stylesheet" href="ws/kune-common.css">
+<link type="text/css" rel="stylesheet"
+ href="ws/fontface/ubuntufontface.css">
+<link type="text/css" rel="stylesheet" href="ws/kune-message.css">
+<link type="text/css" rel="stylesheet" href="others/splash/style/permalink.css">
+<link type="text/css" rel="stylesheet" href="others/splash/style/stuff.css">
+<link type="text/css" rel="stylesheet" href="others/splash/style/main.css">
+<link type="text/css" rel="stylesheet" href="ws/ws.css">
+<script type="text/javascript" src="others/splash/js/gadget.js"></script>
+<script type="text/javascript" src="others/splash/js/rpc.js"></script>
+<script type="text/javascript" src="others/splash/js/common_client.js"></script>
+<script type="text/javascript" src="others/splash/js/permalink_client.js"></script>
+<script type="text/javascript" src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
+
+<style type="text/css">
+
+body {
+ background-color: white;
+ color: black;
+ font-family: 'Ubuntu', Arial;
+ font-size: small;
+ overflow: hidden;
+}
+
+#kuneloading {
+ position: absolute;
+ left: 2%;
+ top: 2%;
+ z-index: 20001;
+ height: auto;
+ border: solid 2px #ccc;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ background-color: white;
+}
+
+#kuneloading a {
+ color: #225588;
+}
+
+#kuneloading .kuneloading-indicator {
+ color: #444;
+ font: bold 13px tahoma, arial, helvetica;
+ padding: 3px 3px 8px;
+ margin: 0;
+ height: auto;
+}
+
+#kuneloading-msg {
+ font: normal 10px arial, tahoma, sans-serif;
+}
+
+#k-home-prewrap {
+ margin-top: -22px;
+}
+
+#k-home-wrapper {
+ margin-left: auto;
+ margin-right: auto;
+ position: relative;
+ width: 665px;
+ min-width: 320px;
+}
+
+#k-home-ini {
+ clear: both;
+ font-size: 28px;
+ color: #69312f;
+ text-align: justify;
+ padding: 27px 0;
+ line-height: 1.3em;
+}
+
+#k-home-ini a {
+ color: #803000;
+ font-weight: bold;
+}
+
+#k-home-ini strong {
+ font-weight: bold;
+}
+
+#k-home-stats {
+ font-size: 22px;
+ color: #c87137;
+ font-weight: bold;
+}
+
+#k-home-table {
+ display: table;
+}
+
+#k-home-header {
+ display: table-row;
+}
+
+#k-home-logo {
+ display: table-cell;
+ margin: 50px 0 22px 0;
+ float: right;
+}
+
+#k-home-summary {
+ display: table-cell;
+ font-size: 32px;
+ color: #dd8a3d;
+ font-weight: bold;
+ white-space: nowrap;
+ float: left;
+}
+
+#k-home-summary li {
+ padding-left: 41px;
+ background-repeat: no-repeat;
+ background-position: 0 .2em;
+ line-height: 45px;
+}
+
+#k-home-row {
+ display: table-row;
+}
+
+#k-home-left {
+ display: table-cell;
+}
+
+#k-home-right {
+ display: table-cell;
+}
+
+.banner {
+ margin: 30px;
+}
+</style>
+<!--[if IE 6]>
+ <link type="text/css" rel="stylesheet" href="ie6.css">
+<![endif]-->
+</head>
+<body>
+ <!-- Banner for wave errors -->
+ <div class="banner" id="banner"></div>
+ <!-- Autocomplete user/pass -->
+ <form method="post" action="javascript:void(0)" style="display: none">
+ <input type="text" id="address" name="address" value="" /> <input
+ type="password" id="password" name="password" value="" /> <input
+ type="submit" value="Login" id="login" /> <input type="submit"
+ class="wiab le button" name="signIn" id="signIn" value="Sign in">
+ </form>
+ <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+ <noscript>
+ <div
+ style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
+ Your web browser must have JavaScript enabled in order for this
+ application to display correctly.</div>
+ </noscript>
+ <iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
+ <iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
+ <div id="kuneinitialcurtain"></div>
+ <div id="kuneloading">
+ <div class="kuneloading-indicator">
+ <img src="ws/images/kune-anim-g.gif" width="35" height="35"
+ alt="kune-loading"
+ style="margin-right: 3px; float: left; vertical-align: top;" />kune <br />
+ <span id="kuneloading-msg">Starting...</span>
+ </div>
+ </div>
+ <div id="k-home-prewrap">
+ <div id="k-home-wrapper">
+ <div id="k-home-table">
+ <div id="k-home-header">
+ <div id="k-home-logo">
+ <img src="ws/logo-big-home.png" alt="" />
+ </div>
+ <div id="k-home-summary">
+ <ul>
+ <li style="background-image: url(ws/images/kune-intro-user.png);">Comunicate with others</li>
+ <li style="background-image: url(ws/images/kune-intro-group.png);">Work in collaboration</li>
+ <li style="background-image: url(ws/images/kune-intro-world.png);">And share with the world</li>
+ </ul>
+ </div>
+ <!-- k-home-summary -->
+ </div>
+ <!-- div home-header -->
+ <div id="k-home-row">
+ <div id="k-home-left">
+ <div id="k-home-ini">
+ Welcome! This site is a Kune node. Kune, which means
+ "together" in esperanto, it's a network of interconnected
+ sites like this one, where you can <strong>communicate,
+ share, collaborate with others and create your web
+ spaces easily</strong>. <a href="#signin">Join!</a>
+ </div>
+ <!-- div home-ini -->
+ <div id="k-home-stats" style="display: none;">Latests
+ groups created</div>
+ </div>
+ <!-- div k-home-left -->
+ <div id="k-home-right">
+ <!-- div home-stats -->
+ </div>
+ <!-- div k-home-right -->
+ </div>
+ <!-- div k-home-row -->
+ </div>
+ <!-- div home-table -->
+ </div>
+ <!-- home-wrapper -->
+ </div>
+ <!-- home-prewrap -->
+</body>
+</html>
Modified: trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -10,6 +10,7 @@
@Override
public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
+ sleep(200);
}
@Override
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -34,6 +34,9 @@
import org.testng.annotations.DataProvider;
import cc.kune.core.client.auth.AnonUsersManager;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.TokenUtils;
+import cc.kune.core.client.sub.SubtitlesWidget;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.selenium.login.EntityHeaderPageObject;
import cc.kune.selenium.login.LoginPageObject;
@@ -54,8 +57,9 @@
private final WebDriver webdriver;
public KuneSeleniumDefaults() {
- // baseUrl = "http://kune.beta.iepala.es/ws/?locale=en#";
- baseUrl = "http://127.0.0.1:8888/ws/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:99…";
+ baseUrl = "http://kune.beta.iepala.es/ws/?locale=en#";
+ // baseUrl =
+ // "http://127.0.0.1:8888/ws/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:99…";
injector = Guice.createInjector(new SeleniumModule());
webdriver = injector.getInstance(WebDriver.class);
login = injector.getInstance(LoginPageObject.class);
@@ -142,6 +146,12 @@
js.executeScript("window.resizeTo(840,770); window.moveTo(0,0);");
}
+ public void showSubtitle(final String title, final String description, final String token) {
+ gotoToken(TokenUtils.subtitle("User sign in", "", SiteTokens.SIGNIN));
+ sleep(3000);
+ webdriver.findElement(By.id(SeleniumConstants.GWTDEV + SubtitlesWidget.SUBTITLE_MANAGER_ID)).click();
+ }
+
public void sleep(final int milliseconds) {
try {
Thread.sleep(milliseconds);
Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -47,8 +47,8 @@
@Override
protected void configure() {
- // final RemoteWebDriver driver = createChromeDriver();
- final WebDriver driver = creatFirefoxDriver();
+ final RemoteWebDriver driver = createChromeDriver();
+ // final WebDriver driver = creatFirefoxDriver();
final EventFiringWebDriver wrap = new EventFiringWebDriver(driver);
wrap.register(new CustomWebDriverEventListener());
@@ -69,7 +69,11 @@
System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
// http://peter.sh/experiments/chromium-command-line-switches/
- capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"));
+ capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"
+ // ,
+ // "--load-extension=/home/YOURUSER/.config/chromium/Default/Extensions/jpjpnpmbddbjkfaccnmhnkdgjideieim/1.0.9738_0/"
+ // (tests with the gwt extension)
+ ));
capabilities.setCapability("chrome.binary", "/usr/bin/chromium-browser");
final ChromeDriver driver = new ChromeDriver(capabilities);
return driver;
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-26 16:00:47 UTC (rev 1534)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-26 20:24:14 UTC (rev 1535)
@@ -59,7 +59,7 @@
@Test(dataProvider = "correctlogin")
public void signInWithToken(final String user, final String passwd) {
login.assertIsDisconnected();
- gotoToken(SiteTokens.SIGNIN);
+ showSubtitle("User sign in", "", SiteTokens.SIGNIN);
login.fillSigInInForm(user, passwd, true);
login.assertIsConnectedAs(user);
login.logout();
1
0
26 Sep '11
Author: vjrj_
Date: 2011-09-26 18:00:47 +0200 (Mon, 26 Sep 2011)
New Revision: 1534
Modified:
kune-sandbox/src/cc/kune/sandbox/client/KuneSandboxEntryPoint.java
kune-sandbox/war/kune-common.css
kune-sandbox/war/ws.css
Log:
NEW - # 127: Generate some screencast while doing automate testing
http://kune.ourproject.org/issues/ticket/127
Modified: kune-sandbox/src/cc/kune/sandbox/client/KuneSandboxEntryPoint.java
===================================================================
--- kune-sandbox/src/cc/kune/sandbox/client/KuneSandboxEntryPoint.java 2011-09-26 12:45:04 UTC (rev 1533)
+++ kune-sandbox/src/cc/kune/sandbox/client/KuneSandboxEntryPoint.java 2011-09-26 16:00:47 UTC (rev 1534)
@@ -9,8 +9,8 @@
import cc.kune.common.client.ui.dialogs.PromptTopDialog;
import cc.kune.common.client.ui.dialogs.PromptTopDialog.Builder;
import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.sub.SubtitlesWidget;
import cc.kune.gspace.client.GSpaceArmorImpl;
-import cc.kune.gspace.client.i18n.I18nTranslatorForm;
import cc.kune.gspace.client.tool.selector.ToolSelectorItemPanel;
import cc.kune.gspace.client.tool.selector.ToolSelectorPanel;
import cc.kune.msgs.client.CloseCallback;
@@ -19,12 +19,8 @@
import cc.kune.msgs.client.UserMessagesPresenter;
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.KeyPressEvent;
-import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
@@ -41,226 +37,235 @@
*/
public class KuneSandboxEntryPoint implements EntryPoint {
- private PopupBottomPanel pop;
+ private PopupBottomPanel pop;
- /**
- * This is the entry point method.
- */
- @Override
- public void onModuleLoad() {
- testUserMessages();
- // testDialogs();
- // testToolpanel();
- // toolSelector.addWidget(new Label("Test"));
- // testTooltips();
- // testBarButtons();
+ /**
+ * This is the entry point method.
+ */
+ @Override
+ public void onModuleLoad() {
+ testUserMessages();
+ // testDialogs();
+ // testToolpanel();
+ // toolSelector.addWidget(new Label("Test"));
+ // testTooltips();
+ // testBarButtons();
- // testPromptDialog();
+ // testPromptDialog();
- // testAvatarDecorators();
- //testI18nForm();
- }
+ // testAvatarDecorators();
- private void testI18nForm() {
- I18nTranslatorForm form = new I18nTranslatorForm();
- form.setInfo("Translate this ñalsk fañ añlkds añslkdjfa ajalda ", "Take care of puntuation as ñlkasjd", "test");
- form.getBlurTraslation().addBlurHandler(new BlurHandler() {
+ // testSubWidget();
+ }
- @Override
- public void onBlur(BlurEvent event) {
+ private void testSubWidget() {
+ // String title = new String("Some big title áéÃóú!");
+ // String bTitle = Base64Utils.toBase64(title.getBytes());
+ // String descr = new String("Some big description áéÃóú");
+ // String bDescr = Base64Utils.toBase64(descr.getBytes());
+ //
+ // final SubtitlesWidget sub = new SubtitlesWidget();
+ // sub.setTitleText(new String(Base64Utils.fromBase64(bTitle)));
+ // sub.setDescription(new String(Base64Utils.fromBase64(bDescr)));
+ // sub.setSize(Window.getClientWidth() + "px", Window.getClientHeight() +
+ // "px");
+ // Button btn = new Button("Click me");
+ // btn.addClickHandler(new ClickHandler() {
+ // @Override
+ // public void onClick(ClickEvent event) {
+ //
+ // sub.show();
+ // }
+ // });
+ // RootPanel.get().add(btn);
+ // RootPanel.get().add(sub);
+ }
- }
- });
- form.getKeysTraslation().addKeyPressHandler(new KeyPressHandler() {
+ private void testAvatarDecorators() {
+ // BasicThumb thumb = new
+ // BasicThumb("http://kune.beta.iepala.es/others/unknown.jpg", 50, "kk",
+ // 50, false, new ClickHandler() {
+ // @Override
+ // public void onClick(ClickEvent event) {
+ // }
+ // });
+ // CoreResources res = GWT.create(CoreResources.class);
+ // AvatarDecorator avatarDecorator = new AvatarDecorator(res, thumb);
+ // avatarDecorator.setBusy();
+ // RootPanel.get().add(avatarDecorator);
+ }
- @Override
- public void onKeyPress(KeyPressEvent event) {
+ private void testPromptDialog() {
+ Builder builder = new PromptTopDialog.Builder("kkj-kk", "Some ask text?", false, true);
+ builder.width("200px").height("200px").firstButtonTitle("Create").sndButtonTitle("Cancel");
+ builder.regex(TextUtils.UNIX_NAME).regexText(
+ "The name must contain only characters, numbers and dashes");
+ PromptTopDialog diag = builder.build();
+ diag.showCentered();
+ diag.focusOnTextBox();
+ diag.getFirstBtn().addClickHandler(new ClickHandler() {
- }
- });
- RootPanel.get().add(form);
- }
+ @Override
+ public void onClick(ClickEvent event) {
+ Window.alert("ok");
+ }
+ });
+ }
- private void testAvatarDecorators() {
- // BasicThumb thumb = new
- // BasicThumb("http://kune.beta.iepala.es/others/unknown.jpg", 50, "kk",
- // 50, false, new ClickHandler() {
- // @Override
- // public void onClick(ClickEvent event) {
- // }
- // });
- // CoreResources res = GWT.create(CoreResources.class);
- // AvatarDecorator avatarDecorator = new AvatarDecorator(res, thumb);
- // avatarDecorator.setBusy();
- // RootPanel.get().add(avatarDecorator);
- }
+ private void testBarButtons() {
+ Button btn1 = new Button("Btn 1");
+ Button btn2 = new Button("Btn 2");
+ Button btn3 = new Button("Btn 3");
+ btn1.addStyleName("k-button");
+ btn1.addStyleName("k-button-left");
+ btn2.addStyleName("k-button");
+ btn2.addStyleName("k-button-center");
+ btn3.addStyleName("k-button");
+ btn3.addStyleName("k-button-right");
+ btn1.addStyleName("kune-Margin-Large-t");
+ btn2.addStyleName("kune-Margin-Large-t");
+ btn3.addStyleName("kune-Margin-Large-t");
+ btn1.addStyleName("k-fl");
+ btn2.addStyleName("k-fl");
+ btn3.addStyleName("k-fl");
+ FlowPanel vp = new FlowPanel();
+ vp.add(btn1);
+ vp.add(btn2);
+ vp.add(btn3);
+ RootPanel.get().add(vp);
+ }
- private void testPromptDialog() {
- Builder builder = new PromptTopDialog.Builder("kkj-kk", "Some ask text?", false, true);
- builder.width("200px").height("200px").firstButtonTitle("Create").sndButtonTitle("Cancel");
- builder.regex(TextUtils.UNIX_NAME).regexText("The name must contain only characters, numbers and dashes");
- PromptTopDialog diag = builder.build();
- diag.showCentered();
- diag.focusOnTextBox();
- diag.getFirstBtn().addClickHandler(new ClickHandler() {
+ private void testTooltips() {
+ final AbsolutePanel panel = new AbsolutePanel();
+ final Button button = new Button("Btn 1");
+ final Button button2 = new Button("Btn 2");
+ final Button button3 = new Button("Btn 3");
+ final Button button4 = new Button("Btn 4");
+ int clientWidth = Window.getClientWidth();
+ int clientHeight = Window.getClientHeight();
+ panel.setSize(String.valueOf(clientWidth - 10) + "px", String.valueOf(clientHeight - 10) + "px");
+ panel.add(button, 5, 5);
+ panel.add(button2, clientWidth - 60, 5);
+ panel.add(button3, 5, clientHeight - 40);
+ panel.add(button4, clientWidth - 60, clientHeight - 40);
+ Tooltip.to(button, "Some tooltip");
+ Tooltip.to(button2, "Some tooltip");
+ Tooltip.to(button3, "Some tooltip");
+ Tooltip.to(button4, "Some tooltip");
+ // DOM.setElementProperty(button2.getElement(), "position", "relative");
+ RootPanel.get().add(panel);
+ }
- @Override
- public void onClick(ClickEvent event) {
- Window.alert("ok");
- }
- });
- }
+ private void testToolpanel() {
+ ToolSelectorPanel toolSelector = new ToolSelectorPanel(new GSpaceArmorImpl(null), null);
+ ToolSelectorItemPanel toolItem1 = new ToolSelectorItemPanel();
+ toolItem1.getLabel().setText("documents");
+ ToolSelectorItemPanel toolItem2 = new ToolSelectorItemPanel();
+ toolItem2.getLabel().setText("something very longgggggg");
+ ToolSelectorItemPanel toolItem3 = new ToolSelectorItemPanel();
+ toolItem3.getLabel().setText("media");
+ toolSelector.addItem(toolItem1);
+ toolSelector.addItem(toolItem2);
+ toolSelector.addItem(toolItem3);
+ toolItem1.setSelected(true);
+ toolItem2.setSelected(false);
+ toolItem3.setSelected(false);
+ toolSelector.asWidget().setWidth("200px");
+ RootPanel.get().add(toolSelector.asWidget());
+ }
- private void testBarButtons() {
- Button btn1 = new Button("Btn 1");
- Button btn2 = new Button("Btn 2");
- Button btn3 = new Button("Btn 3");
- btn1.addStyleName("k-button");
- btn1.addStyleName("k-button-left");
- btn2.addStyleName("k-button");
- btn2.addStyleName("k-button-center");
- btn3.addStyleName("k-button");
- btn3.addStyleName("k-button-right");
- btn1.addStyleName("kune-Margin-Large-t");
- btn2.addStyleName("kune-Margin-Large-t");
- btn3.addStyleName("kune-Margin-Large-t");
- btn1.addStyleName("k-fl");
- btn2.addStyleName("k-fl");
- btn3.addStyleName("k-fl");
- FlowPanel vp = new FlowPanel();
- vp.add(btn1);
- vp.add(btn2);
- vp.add(btn3);
- RootPanel.get().add(vp);
- }
+ private void postAdd(final PopupBottomPanel pop) {
+ pop.setCenterPosition();
+ }
- private void testTooltips() {
- final AbsolutePanel panel = new AbsolutePanel();
- final Button button = new Button("Btn 1");
- final Button button2 = new Button("Btn 2");
- final Button button3 = new Button("Btn 3");
- final Button button4 = new Button("Btn 4");
- int clientWidth = Window.getClientWidth();
- int clientHeight = Window.getClientHeight();
- panel.setSize(String.valueOf(clientWidth - 10) + "px", String.valueOf(clientHeight - 10) + "px");
- panel.add(button, 5, 5);
- panel.add(button2, clientWidth - 60, 5);
- panel.add(button3, 5, clientHeight - 40);
- panel.add(button4, clientWidth - 60, clientHeight - 40);
- Tooltip.to(button, "Some tooltip");
- Tooltip.to(button2, "Some tooltip");
- Tooltip.to(button3, "Some tooltip");
- Tooltip.to(button4, "Some tooltip");
- // DOM.setElementProperty(button2.getElement(), "position", "relative");
- RootPanel.get().add(panel);
- }
+ private void postAdd(final PopupTopPanel pop) {
+ pop.setCenterPosition();
+ }
- private void testToolpanel() {
- ToolSelectorPanel toolSelector = new ToolSelectorPanel(new GSpaceArmorImpl(null), null);
- ToolSelectorItemPanel toolItem1 = new ToolSelectorItemPanel();
- toolItem1.getLabel().setText("documents");
- ToolSelectorItemPanel toolItem2 = new ToolSelectorItemPanel();
- toolItem2.getLabel().setText("something very longgggggg");
- ToolSelectorItemPanel toolItem3 = new ToolSelectorItemPanel();
- toolItem3.getLabel().setText("media");
- toolSelector.addItem(toolItem1);
- toolSelector.addItem(toolItem2);
- toolSelector.addItem(toolItem3);
- toolItem1.setSelected(true);
- toolItem2.setSelected(false);
- toolItem3.setSelected(false);
- toolSelector.asWidget().setWidth("200px");
- RootPanel.get().add(toolSelector.asWidget());
- }
+ private void testDialogs() {
+ final PopupTopPanel pop2 = new PopupTopPanel(false, true);
+ pop2.setGlassEnabled(true);
+ final BasicDialog dialog = new BasicDialog();
+ pop2.add(dialog);
- private void postAdd(final PopupBottomPanel pop) {
- pop.setCenterPosition();
- }
+ dialog.getTitleText().setText("Title");
+ dialog.setFirstBtnText("Accept");
+ dialog.setSecondBtnText("Cancel");
+ dialog.setFirstBtnTabIndex(2);
+ dialog.setSecondBtnTabIndex(3);
+ final VerticalPanel sPanel = new VerticalPanel();
+ sPanel.add(new Label("lo que sea"));
+ final Button btn = new Button("lo que sea");
+ btn.setTabIndex(1);
+ btn.setFocus(true);
+ sPanel.add(btn);
+ sPanel.setSize("300px", "150px");
+ dialog.getInnerPanel().add((IsWidget) sPanel);
+ final Label label = new Label("Test label");
+ // final NotifyLevelImages levelImg =
+ // GWT.create(NotifyLevelImages.class);
+ // dialog.getBottomPanel().add(new MessagePanel(levelImg, "kk"));
+ final MaskWidget mask = new MaskWidget();
- private void postAdd(final PopupTopPanel pop) {
- pop.setCenterPosition();
- }
+ RootPanel.get().add(label);
+ pop2.showNear(label);
+ // final String zIndex = DOM.getStyleAttribute(pop2.getElement(),
+ // "zIndex");
+ DOM.setStyleAttribute(pop.getElement(), "zIndex", "10000");
+ mask.mask(pop2, "JAarrrrr!");
+ }
- private void testDialogs() {
- final PopupTopPanel pop2 = new PopupTopPanel(false, true);
- pop2.setGlassEnabled(true);
- final BasicDialog dialog = new BasicDialog();
- pop2.add(dialog);
+ private void testUserMessages() {
+ final UserMessagesPanel panel = new UserMessagesPanel();
+ UserMessage.setFadeMills(3000);
+ UserMessage.setCloseTitle("Close message");
+ panel.setWidth("422px");
+ final UserMessagesPresenter presenter = new UserMessagesPresenter();
+ presenter.init(panel);
- dialog.getTitleText().setText("Title");
- dialog.setFirstBtnText("Accept");
- dialog.setSecondBtnText("Cancel");
- dialog.setFirstBtnTabIndex(2);
- dialog.setSecondBtnTabIndex(3);
- final VerticalPanel sPanel = new VerticalPanel();
- sPanel.add(new Label("lo que sea"));
- final Button btn = new Button("lo que sea");
- btn.setTabIndex(1);
- btn.setFocus(true);
- sPanel.add(btn);
- sPanel.setSize("300px", "150px");
- dialog.getInnerPanel().add((IsWidget) sPanel);
- final Label label = new Label("Test label");
- // final NotifyLevelImages levelImg =
- // GWT.create(NotifyLevelImages.class);
- // dialog.getBottomPanel().add(new MessagePanel(levelImg, "kk"));
- final MaskWidget mask = new MaskWidget();
+ pop = new PopupBottomPanel();
+ final CloseCallback closeCalback = new CloseCallback() {
+ @Override
+ public void onClose() {
+ pop.setCenterPosition();
+ }
+ };
+ presenter.add(NotifyLevel.info, "Title", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit",
+ "", false, closeCalback);
+ postAdd(pop);
+ presenter.add(NotifyLevel.error, "Title",
+ "Lorem ipsum dolor sit amet, consectetuer adipiscing elit", "", false, closeCalback);
+ pop.add(panel);
- RootPanel.get().add(label);
- pop2.showNear(label);
- // final String zIndex = DOM.getStyleAttribute(pop2.getElement(),
- // "zIndex");
- DOM.setStyleAttribute(pop.getElement(), "zIndex", "10000");
- mask.mask(pop2, "JAarrrrr!");
- }
+ postAdd(pop);
- private void testUserMessages() {
- final UserMessagesPanel panel = new UserMessagesPanel();
- UserMessage.setFadeMills(3000);
- UserMessage.setCloseTitle("Close message");
- panel.setWidth("422px");
- final UserMessagesPresenter presenter = new UserMessagesPresenter();
- presenter.init(panel);
-
- pop = new PopupBottomPanel();
- final CloseCallback closeCalback = new CloseCallback() {
- @Override
- public void onClose() {
- pop.setCenterPosition();
- }
- };
- presenter.add(NotifyLevel.info, "Title", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit", "", false,
- closeCalback);
+ final Timer time = new Timer() {
+ @Override
+ public void run() {
+ presenter.add(
+ NotifyLevel.error,
+ "",
+ "Lorem <a href='/'>ipsum</a> dolor sit amet, consectetuer adipiscing elit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit",
+ "", true, closeCalback);
postAdd(pop);
- presenter.add(NotifyLevel.error, "Title", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit", "",
- false, closeCalback);
- pop.add(panel);
-
+ }
+ };
+ final Timer time2 = new Timer() {
+ @Override
+ public void run() {
+ presenter.add(NotifyLevel.important, "", "Lorem ", "", false, closeCalback);
postAdd(pop);
+ presenter.add(NotifyLevel.important, "Title", "Lorem ", "", true, closeCalback);
+ presenter.add(NotifyLevel.important, "", "Lorem ", "", true, closeCalback);
+ presenter.add(NotifyLevel.important, "", "Lorem ", "", false, closeCalback);
+ presenter.add(NotifyLevel.important, "", "Lorem ", "", false, closeCalback);
+ presenter.add(NotifyLevel.important, "", "Lorem ", "", false, closeCalback);
+ postAdd(pop);
+ }
+ };
+ time.schedule(1000);
+ time2.schedule(5000);
+ pop.show();
- final Timer time = new Timer() {
- @Override
- public void run() {
- presenter.add(
- NotifyLevel.error,
- "",
- "Lorem <a href='/'>ipsum</a> dolor sit amet, consectetuer adipiscing elit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit",
- "", true, closeCalback);
- postAdd(pop);
- }
- };
- final Timer time2 = new Timer() {
- @Override
- public void run() {
- presenter.add(NotifyLevel.important, "", "Lorem ", "", false, closeCalback);
- postAdd(pop);
- presenter.add(NotifyLevel.important, "Title", "Lorem ", "", true, closeCalback);
- postAdd(pop);
- }
- };
- time.schedule(1000);
- time2.schedule(5000);
- pop.show();
-
- }
+ }
}
Modified: kune-sandbox/war/kune-common.css
===================================================================
--- kune-sandbox/war/kune-common.css 2011-09-26 12:45:04 UTC (rev 1533)
+++ kune-sandbox/war/kune-common.css 2011-09-26 16:00:47 UTC (rev 1534)
@@ -1,412 +1,709 @@
+/* Here the styles of cc.kune.commom (reused by other projects like gadgets and so on) */
.k-popup-top-centered {
-
+
}
.k-popup-bottom-centered { /* z-index:100000; */
-
+
}
.k-floatleft,.k-fl {
- float: left;
+ float: left;
}
.k-floatright,.k-fr {
- float: right;
+ float: right;
}
.k-pointer {
- cursor: pointer;
- cursor: hand;
+ cursor: pointer;
+ cursor: hand;
}
.k-opacity80 {
- kfilter: alpha(opacity = 80);
- -moz-opacity: 0.80;
- -khtml-opacity: 0.80;
- opacity: 0.80;
+ kfilter: alpha(opacity =
+ 80);
+ -moz-opacity: 0.80;
+ -khtml-opacity: 0.80;
+ opacity: 0.80;
}
.k-opacity90 {
- kfilter: alpha(opacity = 90);
- -moz-opacity: 0.90;
- -khtml-opacity: 0.90;
- opacity: 0.90;
+ kfilter: alpha(opacity =
+ 90);
+ -moz-opacity: 0.90;
+ -khtml-opacity: 0.90;
+ opacity: 0.90;
}
.k-opacity95 {
- kfilter: alpha(opacity = 95);
- -moz-opacity: 0.95;
- -khtml-opacity: 0.95;
- opacity: 0.95;
+ kfilter: alpha(opacity =
+ 95);
+ -moz-opacity: 0.95;
+ -khtml-opacity: 0.95;
+ opacity: 0.95;
}
.gwt-PopupPanelGlass {
- background-color: #f7ebe3 !important;
- kfilter: alpha(opacity = 68) !important;
- -moz-opacity: 0.68 !important;
- -khtml-opacity: 0.68 !important;
- opacity: 0.68 !important;
+ background-color: #f7ebe3 !important;
+ kfilter: alpha(opacity =
+ 68) !important;
+ -moz-opacity: 0.68 !important;
+ -khtml-opacity: 0.68 !important;
+ opacity: 0.68 !important;
}
+.k-box-3shadow {
+ -webkit-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5);
+ box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5);
+}
+
.k-box-5shadow {
- -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
- -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
- box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
+ -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
+ box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}
.k-box-10shadow {
- -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
- -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
- box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
+ -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}
.k-bottom-5corners {
- -webkit-border-bottom-right-radius: 5px;
- -moz-border-radius-bottomright: 5px;
- border-bottom-right-radius: 5px;
- -webkit-border-bottom-left-radius: 5px;
- -moz-border-radius-bottomleft: 5px;
- border-bottom-left-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ border-bottom-left-radius: 5px;
}
.k-bottom-10corners {
- -webkit-border-bottom-right-radius: 10px;
- -moz-border-radius-bottomright: 10px;
- border-bottom-right-radius: 10px;
- -webkit-border-bottom-left-radius: 10px;
- -moz-border-radius-bottomleft: 10px;
- border-bottom-left-radius: 10px;
+ -webkit-border-bottom-right-radius: 10px;
+ -moz-border-radius-bottomright: 10px;
+ border-bottom-right-radius: 10px;
+ -webkit-border-bottom-left-radius: 10px;
+ -moz-border-radius-bottomleft: 10px;
+ border-bottom-left-radius: 10px;
}
.k-top-5corners {
- -webkit-border-top-right-radius: 5px;
- -moz-border-radius-topright: 5px;
- border-top-right-radius: 5px;
- -webkit-border-top-left-radius: 5px;
- -moz-border-radius-topleft: 5px;
- border-top-left-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-left-radius: 5px;
}
.k-top-10corners {
- -webkit-border-top-right-radius: 10px;
- -moz-border-radius-topright: 10px;
- border-top-right-radius: 10px;
- -webkit-border-top-left-radius: 10px;
- -moz-border-radius-topleft: 10px;
- border-top-left-radius: 10px;
+ -webkit-border-top-right-radius: 10px;
+ -moz-border-radius-topright: 10px;
+ border-top-right-radius: 10px;
+ -webkit-border-top-left-radius: 10px;
+ -moz-border-radius-topleft: 10px;
+ border-top-left-radius: 10px;
}
.k-2corners {
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ border-radius: 2px;
}
.k-3corners {
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
}
.k-5corners {
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
}
.k-10corners {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
}
.k-dialog-outerp {
- background-color: #552200;
- border-top: 4px solid #000;
- padding: 22px 4px 3px 4px;
+ background-color: #552200;
+ border-top: 4px solid #000;
+ /* padding: 22px 4px 3px 4px; */
}
.k-dialog-title {
- color: #552200;
- font-size: 20px;
- font-weight: bold;
- margin: 5px 0 0 12px;
+ margin: 5px;
}
+.k-dialog-title div {
+ color: #552200;
+ font-size: 20px;
+ font-weight: bold;
+ line-height: 0.7;
+ padding: 0 0 6px 5px;
+}
+
.k-dialog-innerp {
- background-color: #FFFFFF;
- border: solid 1px #F2F2F2;
- margin: 34px 16px 20px 16px;
+ background-color: #FFFFFF;
+ border: solid 1px #F2F2F2;
+ margin: 29px 8px 0;
+ padding: 8px 11px 13px;
}
.k-dialog-btn-area {
- padding:0 15px 15px 15px;
- margin-bottom:30px;
+ padding: 0 15px 15px 15px;
+ margin-bottom: 0 -5px 30px -5px;
}
-.k-dialog-btn-area div {
- margin: 10px
+.k-dialog-btn-area button {
+ margin: 10px 5px;
}
-.k-dialog-innerp table {
- margin: 5px;
+.k-dialog-btn-area div { /* margin: 10px */
+
}
.k-dialog-btn {
- text-shadow: 1px 1px 1px #FFFFFF;
- font-weight: bold;
+ text-shadow: 1px 1px 1px #FFFFFF;
+ font-weight: bold;
+ -moz-user-select: none;
+ -khtml-user-select: none;
}
+.k-dialog-close-btn {
+ background-color: #a05a2c !important;
+ color: #181817 !important;
+ border: 0 none !important;
+ position: relative;
+ top: -26px;
+ height: 17px !important;
+ left: 1px;
+}
+
.k-dialog-firstBtn {
- float: left;
+ float: left;
}
.k-dialog-secondBtn {
- float: right;
+ float: right;
}
.k-z100000 {
- z-index: 100000;
+ z-index: 100000;
}
.k-z10000 {
- z-index: 10000;
+ z-index: 10000;
}
.k-z1000 {
- z-index: 1000;
+ z-index: 1000;
}
.oc-user-msg {
- background-color: #FFCC00;
- padding: 3px;
+ background-color: #FFCC00;
+ padding: 3px;
}
.oc-user-msg-popup {
- padding: 0px;
- border: 0px;
+ padding: 0px;
+ border: 0px;
}
.oc-floatleft {
- float: left;
+ float: left;
}
.oc-floatright {
- float: right;
+ float: right;
}
+.oc-clean,.k-clear,.oc-clear,.k-clean {
+ clear: both;
+}
+
.x-toolbar {
- background: none !important;
- border-color: transparent !important;
+ background: none !important;
+ border-color: transparent !important;
}
.oc-testico {
- background-image: url(/common/img/ico.png) !important;
- -moz-background-clip: border;
- -moz-background-inline-policy: continuous;
- -moz-background-origin: padding;
- background-attachment: scroll;
- background-color: transparent;
- background-position: 0 0;
- background-repeat: no-repeat;
- height: 16px;
- widows: 16px;
+ background-image: url(images/ico.png) !important;
+ -moz-background-clip: border;
+ -moz-background-inline-policy: continuous;
+ -moz-background-origin: padding;
+ background-attachment: scroll;
+ background-color: transparent;
+ background-position: 0 0;
+ background-repeat: no-repeat;
+ height: 16px;
+ widows: 16px;
}
-.oc-ico-pad {
- padding-left: 20px;
- white-space: normal;
-}
-
.oc-tb-spacer {
- margin: 2px;
- width: 2px;
+ margin: 2px;
+ width: 2px;
}
.oc-tb-bottom-line {
- border-bottom-color: rgb(208, 208, 208);
- border-bottom-style: solid;
- border-bottom-width: 1px;
+ border-bottom-color: rgb(208, 208, 208);
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
}
.oc-blank-toolbar {
- background: #FFF none repeat scroll 0% 50%;
+ background: #FFF none repeat scroll 0% 50%;
}
.oc-tb-sep {
- padding-top: 4px;
- padding-left: 5px;
+ padding-top: 4px;
+ padding-left: 5px;
}
.oc-transp .x-panel-body {
- background: transparent;
+ background: transparent;
}
.oc-menu {
- cursor: default;
- -moz-user-select: none;
- -khtml-user-select: none;
- -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
- -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
- border: 1 px solid #BBBBBB;
+ cursor: default;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
+ border: 1 px solid #BBBBBB;
+ font: 16px 'Ubuntu', arial;
+ /* font-weight: bold; */
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ border-bottom-left-radius: 5px;
+ background-color: #280b0b;
}
+.gwt-PopupPanel .oc-menu {
+ border: 2px solid #552200;
+ background-color: #280b0b;
+}
+
+.oc-menu .gwt-MenuBar-vertical,.gwt-MenuBar-vertical {
+ background-color: #704f4f;
+ border: 2px solid #552200;
+ padding: 3px;
+ font: 16px 'Ubuntu', arial;
+ color: white;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ border-bottom-left-radius: 5px;
+ kfilter: alpha(opacity = 90);
+ -moz-opacity: 0.90;
+ -khtml-opacity: 0.90;
+ opacity: 0.90;
+}
+
+.gwt-MenuBar .gwt-MenuItem-selected {
+ background-color: #c87137 !important;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+.gwt-MenuBar .gwt-MenuItem {
+ padding: 4px 4px 3px !important;
+}
+
+.oc-noselect {
+ -moz-user-select: none;
+ -khtml-user-select: none;
+}
+
.oc-menu .gwt-MenuItem {
- cursor: default;
- -moz-user-select: none;
- -khtml-user-select: none;
+ cursor: pointer;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ /* background-color: #c87137; */
+ color: white;
}
.oc-button {
- padding: 2px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- text-decoration: none;
- vertical-align: middle;
- background-color: #F2F2F2;
+ padding: 2px;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+ text-decoration: none;
+ vertical-align: middle;
+ background-color: #F2F2F2;
+ white-space: nowrap;
+ margin-right: 3px;
}
.oc-button:hover {
- border: 2px orange solid;
- background: #f0f0f0;
- color: #855585;
+ border: 2px orange solid;
+ background: #f0f0f0;
+ color: #855585;
}
.oc-button:active {
- border-top-color: #ffffff;
- background: #ffffff;
+ border-top-color: #ffffff;
+ background: #ffffff;
}
#oc-mshortcut {
- position: absolute;
- right: 10px;
+ position: absolute;
+ right: 10px;
}
#oc-mshortcut-hidden {
- visibility: hidden;
+ visibility: hidden;
}
#oc-mshortcut a {
- text-decoration: none;
- color: black;
+ text-decoration: none;
+ color: black;
}
.oc-user-msg {
- background-color: #FFCC00;
- padding: 3px;
+ background-color: #FFCC00;
+ padding: 3px;
}
.oc-user-msg-popup {
- padding: 0px;
- border: 0px;
+ padding: 0px;
+ border: 0px;
}
.oc-floatleft {
- float: left;
+ float: left;
}
.oc-floatright {
- float: right;
+ float: right;
}
.x-toolbar {
- background: none !important;
- border-color: transparent !important;
+ background: none !important;
+ border-color: transparent !important;
}
.oc-testico {
- background-image: url(/common/img/ico.png) !important;
- -moz-background-clip: border;
- -moz-background-inline-policy: continuous;
- -moz-background-origin: padding;
- background-attachment: scroll;
- background-color: transparent;
- background-position: 0 0;
- background-repeat: no-repeat;
- height: 16px;
- widows: 16px;
+ background-image: url(images/ico.png) !important;
+ -moz-background-clip: border;
+ -moz-background-inline-policy: continuous;
+ -moz-background-origin: padding;
+ background-attachment: scroll;
+ background-color: transparent;
+ background-position: 0 0;
+ background-repeat: no-repeat;
+ height: 16px;
+ widows: 16px;
}
-.oc-ico-pad {
- padding-left: 20px;
- white-space: normal;
+.oc-ico-pad { /* padding-right: 20px; */
+ white-space: normal;
}
.oc-tb-spacer {
- margin: 2px;
- width: 2px;
+ margin: 2px;
+ width: 2px;
}
.oc-tb-bottom-line {
- border-bottom-color: rgb(208, 208, 208);
- border-bottom-style: solid;
- border-bottom-width: 1px;
+ border-bottom-color: rgb(208, 208, 208);
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
}
.oc-blank-toolbar {
- background: #FFF none repeat scroll 0% 50%;
+ background: #FFF none repeat scroll 0% 50%;
}
.oc-tb-sep {
- padding-top: 4px;
- padding-left: 5px;
+ padding-top: 4px;
+ padding-left: 5px;
}
.oc-transp .x-panel-body {
- background: transparent;
+ background: transparent;
}
-.oc-menu {
- cursor: default;
- -moz-user-select: none;
- -khtml-user-select: none;
- -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
- -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
- border: 1 px solid #BBBBBB;
+#oc-mshortcut {
+ position: absolute;
+ right: 10px;
}
-.oc-menu .gwt-MenuItem {
- cursor: default;
- -moz-user-select: none;
- -khtml-user-select: none;
+#oc-mshortcut-hidden {
+ visibility: hidden;
}
-.oc-button {
- padding: 2px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- text-decoration: none;
- vertical-align: middle;
- background-color: #F2F2F2;
+#oc-mshortcut a {
+ text-decoration: none;
+ color: black;
}
-.oc-button:hover {
- border: 2px orange solid;
- background: #f0f0f0;
- color: #855585;
+.k-no-backimage,.k-no-backimage td {
+ background-image: none !important;
}
-.oc-button:active {
- border-top-color: #ffffff;
- background: #ffffff;
+.k-nobackcolor {
+ background-color: transparent !important;
}
-#oc-mshortcut {
- position: absolute;
- right: 10px;
+.k-noborder {
+ border: 0px !important;
}
-#oc-mshortcut-hidden {
- visibility: hidden;
+.k-space-nowrap {
+ white-space: nowrap;
}
-#oc-mshortcut a {
- text-decoration: none;
- color: black;
+.k-iconlabel-text {
+ vertical-align: top;
+ padding-left: 3px;
+ padding-right: 3px;
+ /* float: left; */
}
-.k-no-backimage,.k-no-backimage td {
- background-image: none;
-}
\ No newline at end of file
+.k-menuimtem-title {
+ color: white;
+ font-size: 15px;
+ font-weight: bold;
+ padding: 2px 3px 2px 0;
+}
+
+.k-tb-sep {
+ border-left: 1px solid #B3B3B3;
+ height: 10px;
+ margin-top: 4px;
+}
+
+.k-iconlabel-left {
+ float: left;
+}
+
+.k-iconlabel-right { /* float: left; */ /* margin-left: 5px; */
+
+}
+
+.gwt-MenuBar-vertical .subMenuIcon-selected {
+ background: none repeat scroll 0 0 #808080;
+}
+
+.gwt-Button {
+ background: url("images/hborder.png") repeat-x scroll 0 -27px
+ transparent;
+}
+
+/* tooltips, adaptation of http://jonrohan.me/guide/css/creating-triangles-in-css/ */
+.k-tooltip {
+ background-color: #FEFFF1;
+ border: 2px solid #666666;
+ line-height: 1.3em;
+ padding: 5px;
+}
+
+.k-tooltip-arrow-border {
+ border-style: solid;
+ border-width: 7px;
+ height: 0;
+ width: 0;
+ position: absolute;
+}
+
+.k-tooltip-arrow-border-n {
+ border-color: transparent transparent #666666 transparent;
+}
+
+.k-tooltip-arrow-border-s {
+ border-color: #666666 transparent transparent transparent;
+}
+
+.k-tooltip-arrow {
+ border-style: solid;
+ border-width: 7px;
+ height: 0;
+ width: 0;
+ position: absolute;
+}
+
+.k-tooltip-arrow-n {
+ border-color: transparent transparent #FEFFF1 transparent;
+}
+
+.k-tooltip-arrow-s {
+ border-color: #FEFFF1 transparent transparent transparent;
+}
+
+/* IE6 */
+.k-tooltip-arrow {
+ _border-left-color: pink;
+ _border-bottom-color: pink;
+ _border-right-color: pink;
+ _filter: chroma(color = pink);
+}
+
+/* end tooltip */
+/* tabbar */
+.gwt-DecoratedTabBar {
+
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarFirst {
+ width: 5px; /* first tab distance from the left */
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarRest {
+
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem {
+ border-collapse: collapse;
+ margin-left: 6px;
+}
+
+.gwt-DecoratedTabBar .tabTopCenter {
+ padding: 0px;
+ background: #e3e3e3;
+}
+
+.gwt-DecoratedTabBar .tabTopLeft,.gwt-DecoratedTabBar .tabTopRight {
+ padding: 0px;
+ zoom: 1;
+}
+
+.gwt-DecoratedTabBar .tabTopLeftInner,.gwt-DecoratedTabBar .tabTopRightInner
+ {
+ width: 6px;
+ height: 6px;
+}
+
+.gwt-DecoratedTabBar .tabTopLeft {
+ background: url(images/corner.png) no-repeat 0px -55px;
+ -background: url(images/corner_ie6.png) no-repeat 0px -55px;
+}
+
+.gwt-DecoratedTabBar .tabTopRight {
+ background: url(images/corner.png) no-repeat -6px -55px;
+ -background: url(images/corner_ie6.png) no-repeat -6px -55px;
+}
+
+* html .gwt-DecoratedTabBar .tabTopLeftInner,* html .gwt-DecoratedTabBar .tabTopRightInner
+ {
+ width: 6px;
+ height: 6px;
+ overflow: hidden;
+}
+
+.gwt-DecoratedTabBar .tabMiddleLeft,.gwt-DecoratedTabBar .tabMiddleRight
+ {
+ width: 6px;
+ padding: 0px;
+ background: #e3e3e3 url(images/hborder.png) repeat-x 0px -1463px;
+}
+
+.gwt-DecoratedTabBar .tabMiddleLeftInner,.gwt-DecoratedTabBar .tabMiddleRightInner
+ {
+ width: 1px;
+ height: 1px;
+}
+
+.gwt-DecoratedTabBar .tabMiddleCenter {
+ padding: 0px 4px 2px 4px;
+ cursor: pointer;
+ cursor: hand;
+ color: black;
+ font-weight: bold;
+ text-align: center;
+ background: #e3e3e3 url(images/hborder.png) repeat-x 0px -1463px;
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopCenter {
+ background: #747474;
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopLeft {
+ background-position: 0px -61px;
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopRight {
+ background-position: -6px -61px;
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleLeft,.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleRight
+ {
+ background: #bcbcbc url(images/hborder.png) repeat-x 0px -2511px;
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleCenter {
+ cursor: default;
+ background: #bcbcbc url(images/hborder.png) repeat-x 0px -2511px;
+ color: white;
+}
+
+.gwt-DecoratedTabBar .gwt-TabBarItem-disabled .tabMiddleCenter {
+ cursor: default;
+ color: #999999;
+}
+
+/* End tabbar */
+.k-editableLabel {
+ font-weight: bold;
+ padding: 3px
+}
+
+.k-editableLabel-high {
+ font-weight: bold;
+ background-color: #FFFBC1;
+ color: black !important;
+}
+
+.k-editableLabel-high span {
+ background-color: #FFFBC1;
+ color: black !important;
+}
+
+.k-btn-min {
+ min-width: 19px !important;
+}
+
+.k-overflow-y-scroll {
+ overflow-y: scroll;
+}
+
+.k-overflow-y-auto {
+ overflow-y: auto;
+}
+
+.k-overflow-x-scroll {
+ overflow-x: scroll;
+}
+
+.k-tab-panel {
+ padding: 10px;
+ background-color: #F2F0F0;
+ border: 1px solid #D0D0D0;
+}
+
+.k-line-through {
+ text-decoration: line-through;
+ color: gray;
+}
+
+.gwt-TextArea {
+ border: 1px solid #BBBBBB;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
Modified: kune-sandbox/war/ws.css
===================================================================
--- kune-sandbox/war/ws.css 2011-09-26 12:45:04 UTC (rev 1533)
+++ kune-sandbox/war/ws.css 2011-09-26 16:00:47 UTC (rev 1534)
@@ -1,5 +1,5 @@
-CHARSET "UTF-8 "; body {
- background-color: white;
+CHARSET "UTF-8 "; body {
+ background-color: transparent;
color: black;
font-family: 'Ubuntu', Arial;
font-size: small;
@@ -270,14 +270,16 @@
}
-.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger {
+.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger,.gwt-SplitLayoutPanel-HDragger
+ {
background-color: transparent;
background: url("images/spliter-top.png") no-repeat scroll center bottom
transparent;
cursor: col-resize;
}
-.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-VDragger {
+.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-VDragger,.gwt-SplitLayoutPanel-VDragger
+ {
background-color: white;
background: none;
cursor: row-resize;
@@ -319,8 +321,25 @@
padding: 0 1px 0 1px;
margin: 0 0 -2px;
outline: 0 none;
+ float: left;
}
+.k-space-sel-inbox-count {
+ border: none 5px #000000;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ background-color: #99BB00;
+ color: white;
+ font-size: 10px;
+ padding: 0 0.5em;
+ cursor: pointer;
+}
+
+.k-space-sel-inbox-count-blink {
+ background-color: #ff2a2a;
+}
+
.k-sitebar-logo {
margin-top: 2px;
}
@@ -450,10 +469,41 @@
margin-right: 20px;
}
+.kune-Margin-20-b {
+ margin-bottom: 20px;
+}
+
.kune-Margin-20-l {
margin-left: 20px;
}
+.kune-Margin-10-trbl {
+ margin: 10px;
+}
+
+.kune-Margin-10-lr {
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+.kune-Margin-10-tl {
+ margin-top: 10px;
+ margin-left: 10px;
+}
+
+.kune-Margin-10-tb {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+.kune-Margin-10-t {
+ margin-top: 10px;
+}
+
+.kune-Margin-10-r {
+ margin-right: 10px;
+}
+
.kune-Margin-Large-trbl {
margin: 10px;
}
@@ -481,6 +531,10 @@
margin-right: 10px;
}
+.kune-Margin-Large-b {
+ margin-bottom: 10px;
+}
+
.kune-Margin-Large-l {
margin-left: 10px;
}
@@ -690,7 +744,8 @@
.k-error-tb {
background: #FFB380 none repeat scroll 0% 50%;
/* color: #250; */
- padding: 10px;
+ padding: 7px 10px;
+ margin: 16px -20px -10px -20px;
}
.k-error-tb img {
@@ -795,7 +850,8 @@
white-space: nowrap;
}
*/
-.k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button {
+.k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button,.gwt-FileUpload,button.gwt-Button
+ {
font: 13px 'Ubuntu', arial;
border: 2px solid #CCCCCC;
cursor: pointer;
@@ -816,7 +872,7 @@
height: 28px;
}
-.k-sn-mainpanel .x-btn button:hover,.k-sn-mainpanel button:hover,button.k-button:hover
+.k-sn-mainpanel .x-btn button:hover,.k-sn-mainpanel button:hover,button.k-button:hover,button.gwt-Button:hover
{
border: 2px orange solid;
outline: 0 none;
@@ -830,8 +886,7 @@
}
.k-sn-mainpanel .x-btn button:active,.k-sn-mainpanel button:active,button.k-button:active
- {
- border-top-color: #ffffff;
+ { /* border-top-color: #ffffff; */
background: #ffffff;
}
@@ -841,6 +896,8 @@
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
+ margin-left: 0px !important;
+ margin-right: 0px !important;
}
.k-button-right {
@@ -851,6 +908,7 @@
-webkit-border-bottom-left-radius: 0px !important;
-moz-border-radius-bottomleft: 0px !important;
border-bottom-left-radius: 0px !important;
+ margin-left: 0px !important;
}
.k-button-left {
@@ -861,6 +919,7 @@
-webkit-border-bottom-right-radius: 0px !important;
-moz-border-radius-bottomright: 0px !important;
border-bottom-right-radius: 0px !important;
+ margin-right: 0px !important;
}
button.k-button-center:hover {
@@ -879,6 +938,18 @@
outline: 0 none;
}
+button[disabled]:active,button[disabled],input[type="reset"][disabled]:active,input[type="reset"][disabled],input[type="button"][disabled]:active,input[type="button"][disabled],select[disabled]>input[type="button"],select[disabled]>input[type="button"]:active,input[type="submit"][disabled]:active,input[type="submit"][disabled],.k-button-disabled,button.k-button-disabled
+ {
+ color: gray !important;
+ border-color: #CCCCCC !important;
+ background: inherits !important;
+ kfilter: alpha(opacity =
+ 60) !important;
+ -moz-opacity: 0.60 !important;
+ -khtml-opacity: 0.60 !important;
+ opacity: 0.60 !important;
+}
+
/* end buttons */
.k-sn-collabslabel {
@@ -894,18 +965,19 @@
.k-sn-novisible-label {
padding: 10px;
+ width: auto !important;
}
-.k-sn-adminspanel { /* background-color: #a05a2c; */
+.k-sn-1st-panel { /* background-color: #a05a2c; */
border-bottom: 2px solid #F7EBE3;
border-top: 2px solid #F7EBE3;
}
-.k-sn-collabspanel {
- background-color: #d38d5f;
+.k-sn-2nd-spanel {
+
}
-.k-sn-pendingspanel { /* background-color: #a05a2c; */
+.k-sn-3rd-panel {
}
@@ -1016,13 +1088,17 @@
.k-elogo-l-l {
font-size: 46px;
+ line-height: 1em;
}
.k-elogo-l-m {
- font-size: 167%;
+ /* Right now the limit of size is 50 chars see EntityHeaderPresenter */
+ font-size: 181%;
+ line-height: 1.2em;
}
.k-elogo-l-s {
+ /* Not used because the limit is 50 chars (see Group.java) */
font-size: 108%;
}
@@ -1082,7 +1158,7 @@
}
.k-tool-panel {
- background-color: #DEAA87;
+
}
.k-tool-item {
@@ -1092,7 +1168,7 @@
}
.k-tool-item-focus {
- background-color: #d38d5f;
+
}
.k-tool-item-nofocus {
@@ -1100,20 +1176,28 @@
}
.k-tool-item-selected {
- background-color: #C87137;
+
}
.k-tool-item-notselected {
- background-color: inherits;
+
}
.k-def-docbtn span {
font-size: 13px !important;
}
+.k-empty-folder-panel {
+ padding: 10px;
+ width: auto;
+ height: auto;
+}
+
.k-empty-msg {
- font-size: 16px;
+ font-size: 18px;
+ /* font-weight: bold; */
font-style: italic;
+ color: #A05A2C;
}
button.k-ent-header-btn {
@@ -1145,7 +1229,8 @@
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-left-radius: 5px;
- kfilter: alpha(opacity = 90);
+ kfilter: alpha(opacity =
+ 90);
-moz-opacity: 0.90;
-khtml-opacity: 0.90;
opacity: 0.90;
@@ -1173,6 +1258,9 @@
padding-left: 1px;
color: #B3B3B3;
background: transparent;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
}
.k-sitebarsearch-img {
@@ -1297,4 +1385,139 @@
color: #999999;
}
-/* end Decorated tabbar */
\ No newline at end of file
+/* end Decorated tabbar */
+.k-waveHolder {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+
+.GWTUpld,table.GWTUpld td {
+ font-family: inherits !important;
+ font-size: 14px !important;
+}
+
+.GWTUpld .DecoratedFileUpload .gwt-Button,.GWTUpld .DecoratedFileUpload .gwt-Anchor,.GWTUpld .DecoratedFileUpload .gwt-Label
+ {
+ font-size: 14px !important;
+ white-space: nowrap;
+}
+
+.x-form-check-wrap {
+ height: inherit;;
+ line-height: inherit;
+}
+
+.k-info-links {
+ text-decoration: underline;
+ color: gray;
+ cursor: pointer;
+}
+
+/*
+ * These attributes are required to make a paragraph look like a list-item
+ * across browsers. (copied from Editor.css)
+ */
+.simulated-li {
+ display: list-item;
+ list-style-type: disc;
+ list-style-position: outside;
+}
+
+.numbered {
+ list-style-type: decimal;
+}
+
+.bullet-type-0 {
+ list-style-type: disc;
+}
+
+.bullet-type-1 {
+ list-style-type: circle;
+}
+
+.bullet-type-2 {
+ list-style-type: square;
+}
+
+.k-drop-allowed {
+ border: solid 2px transparent;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+}
+
+button.k-drop-allowed-hover,.k-drop-allowed-hover {
+ border: dashed 2px #3a9fd6 !important;
+}
+
+.k-link-icon {
+ background-image: url(images/link.gif) !important;
+}
+
+.k-options-icon {
+ background-image: url(images/emblem-system.gif) !important;
+}
+
+.k-copyleft-icon {
+ background-image: url(images/copyleft.png) !important;
+}
+
+.k-picture-icon {
+ background-image: url(images/picture.png) !important;
+}
+
+.k-film-icon {
+ background-image: url(images/film.png) !important;
+}
+
+.k-specialchars-icon {
+ background-image: url(images/specialchars.png) !important;
+}
+
+.k-info-icon {
+ background-image: url(images/info.gif) !important;
+}
+
+.k-newgroup-icon {
+ background-image: url(images/kune-icon16.png) !important;
+}
+
+.k-colors-icon {
+ background-image: url(images/colors.gif) !important;
+}
+
+.k-i18n-recommend {
+ border: 1px solid gray;
+ background-color: #F2F2F2;
+}
+
+.k-tabs .gwt-TabLayoutPanelTab {
+ background-color: #d38d5f;
+ color: #552200;
+ height: 20px !important;
+ margin: 0 2px;
+ padding: 2px;
+ cursor: pointer;
+ font-weight: bold;
+}
+
+.k-tabs .gwt-TabLayoutPanelTab-selected {
+ background-color: #552200;
+ color: #FFF;
+}
+
+.k-tabpanel-aditionalpadding {
+ padding-bottom: 27px !important;
+}
+
+.k-tabs .gwt-TabLayoutPanel,.k-tabs .gwt-TabLayoutPanelTab {
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-left-radius: 5px;
+}
\ No newline at end of file
1
0
Author: vjrj_
Date: 2011-09-26 14:45:04 +0200 (Mon, 26 Sep 2011)
New Revision: 1533
Added:
trunk/src/main/java/cc/kune/common/client/utils/Base64Utils.java
trunk/src/main/java/cc/kune/core/client/events/SndClickEvent.java
trunk/src/main/java/cc/kune/core/client/sub/
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.ui.xml
Removed:
trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java
Modified:
trunk/.classpath
trunk/pom.xml
trunk/script/mvn-eclipse.sh
trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java
trunk/src/main/java/cc/kune/chat/client/snd/KuneSoundManager.java
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
trunk/src/main/java/cc/kune/core/client/state/HistoryTokenCallback.java
trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
trunk/src/main/java/cc/kune/core/client/state/SiteTokens.java
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java
trunk/src/main/resources/kune.properties
trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java
Log:
NEW - # 127: Generate some screencast while doing automate testing
http://kune.ourproject.org/issues/ticket/127
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/.classpath 2011-09-26 12:45:04 UTC (rev 1533)
@@ -11,19 +11,19 @@
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/appengine/appengine-api-1.0-sdk/1.3.1/appengine-api-1.0-sdk-1.3.1.jar"/>
<classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.2-SNAPSHOT/box-0.3.2-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.2-SNAPSHOT/box-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.2/box-0.3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.2/box-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
<classpathentry kind="var" path="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar" sourcepath="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.2-SNAPSHOT/client-0.3.2-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.2-SNAPSHOT/client-common-0.3.2-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.2-SNAPSHOT/client-common-src-0.3.2-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.2-SNAPSHOT/client-scheduler-src-0.3.2-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.2-SNAPSHOT/client-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.2/client-0.3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.2/client-common-0.3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.2/client-common-src-0.3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.2/client-scheduler-src-0.3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.2/client-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.2-SNAPSHOT/common-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.2/common-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
@@ -32,8 +32,8 @@
<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.2-SNAPSHOT/communication-src-0.3.2-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.2-SNAPSHOT/concurrencycontrol-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.2/communication-src-0.3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.2/concurrencycontrol-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
@@ -55,10 +55,8 @@
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/log/gwt-log/gwt-log/3.0.1/gwt-log-3.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.2-SNAPSHOT/gwt-util-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.2/gwt-util-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/gwtextux/gwtextux/0.4.0.924/gwtextux-0.4.0.924.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-crawler/0.5/gwtp-crawler-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-crawler/0.5/gwtp-crawler-0.5-sources.jar"/>
@@ -113,16 +111,16 @@
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.2-SNAPSHOT/media-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.2/media-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.2-SNAPSHOT/model-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.2/model-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16.jar" sourcepath="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.2-SNAPSHOT/proto-msg-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.2/proto-msg-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0-sources.jar"/>
@@ -144,16 +142,14 @@
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/testng/testng/6.2.1/testng-6.2.1.jar" sourcepath="M2_REPO/org/testng/testng/6.2.1/testng-6.2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5.jar" sourcepath="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.2-SNAPSHOT/util-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.2/util-src-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.2-SNAPSHOT/waveinabox-server-0.3-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.2/waveinabox-server-0.3-0.3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.3.4.O/xpp3_min-1.1.3.4.O.jar"/>
<classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2.jar" sourcepath="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1.jar" sourcepath="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-
<classpathentry kind="src" path=".apt_generated" including="**/*.java"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
-</classpath>
+</classpath>
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/pom.xml 2011-09-26 12:45:04 UTC (rev 1533)
@@ -115,30 +115,6 @@
<url>http://kune.ourproject.org/mavenrepo/</url>
</repository>
<repository>
- <id>xwiki-releases</id>
- <name>XWiki Maven2 Remote Repository for Releases</name>
- <url>http://maven.xwiki.org/releases</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>xwiki</id>
- <name>XWiki Repository</name>
- <url>http://maven.xwiki.org/snapshots</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- <checksumPolicy>warn</checksumPolicy>
- </snapshots>
- </repository>
- <repository>
<id>tigase</id>
<name>Tigase Repository</name>
<url>http://maven.tigase.org</url>
@@ -271,16 +247,6 @@
<artifactId>gxt-uibinder</artifactId> <version>0.6</version> </dependency> -->
<!-- cc -->
<dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
- <version>2.0.5</version>
- </dependency>
- <dependency>
- <groupId>com.gwtextux</groupId>
- <artifactId>gwtextux</artifactId>
- <version>0.4.0.924</version>
- </dependency>
- <dependency>
<groupId>com.allen_sauer.gwt.log.gwt-log</groupId>
<artifactId>gwt-log</artifactId>
<version>3.0.1</version>
@@ -308,14 +274,6 @@
<artifactId>jmagick</artifactId>
<version>6.2.6-0</version>
</dependency>
- <dependency>
- <groupId>org.xwiki.platform</groupId>
- <artifactId>xwiki-web-gwt-dom</artifactId>
- <version>2.3-rc-1</version>
- <!-- <version>2.0-SNAPSHOT-g164</version> -->
- <!-- <version>2.0-SNAPSHOT</version> -->
- <!-- <version>2.0-SNAPSHOT-g20s</version> -->
- </dependency>
<!-- xmpp -->
<dependency>
<groupId>com.calclab.emite</groupId>
Modified: trunk/script/mvn-eclipse.sh
===================================================================
--- trunk/script/mvn-eclipse.sh 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/script/mvn-eclipse.sh 2011-09-26 12:45:04 UTC (rev 1533)
@@ -1,3 +1,4 @@
+#mvn eclipse:eclipse -Dgwt.compiler.skip=true -o
mvn eclipse:eclipse -Dgwt.compiler.skip=true
RESULT=$?
perl -p -i -e 's/<\/classpath>//g' .classpath
Modified: trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -20,7 +20,7 @@
package cc.kune.chat.client;
import cc.kune.chat.client.ChatClientDefault.ChatClientAction;
-import cc.kune.chat.client.snd.SndClickEvent;
+import cc.kune.core.client.events.SndClickEvent;
import com.calclab.hablar.core.client.mvp.HablarEventBus;
import com.calclab.hablar.signals.client.SignalPreferences;
Modified: trunk/src/main/java/cc/kune/chat/client/snd/KuneSoundManager.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/snd/KuneSoundManager.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/chat/client/snd/KuneSoundManager.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -19,6 +19,8 @@
*/
package cc.kune.chat.client.snd;
+import cc.kune.core.client.events.SndClickEvent;
+
import com.calclab.hablar.signals.sound.client.SoundManager;
import com.calclab.hablar.signals.sound.client.SoundSignalsConfig;
import com.google.gwt.event.shared.EventBus;
Deleted: trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -1,74 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.chat.client.snd;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class SndClickEvent extends GwtEvent<SndClickEvent.SndClickHandler> {
-
- public interface HasSndClickHandlers extends HasHandlers {
- HandlerRegistration addSndClickHandler(SndClickHandler handler);
- }
-
- public interface SndClickHandler extends EventHandler {
- public void onClick(SndClickEvent event);
- }
-
- private static final Type<SndClickHandler> TYPE = new Type<SndClickHandler>();
-
- public static void fire(final HasHandlers source) {
- source.fireEvent(new SndClickEvent());
- }
-
- public static Type<SndClickHandler> getType() {
- return TYPE;
- }
-
- public SndClickEvent() {
- }
-
- @Override
- protected void dispatch(final SndClickHandler handler) {
- handler.onClick(this);
- }
-
- @Override
- public boolean equals(final Object obj) {
- return super.equals(obj);
- }
-
- @Override
- public Type<SndClickHandler> getAssociatedType() {
- return TYPE;
- }
-
- @Override
- public int hashCode() {
- return super.hashCode();
- }
-
- @Override
- public String toString() {
- return "SndClickEvent[" + "]";
- }
-}
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -49,13 +49,14 @@
import cc.kune.core.client.state.SiteTokenListeners;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.client.state.TokenMatcher;
+import cc.kune.core.client.sub.SubtitlesManager;
import cc.kune.core.client.ws.CorePresenter;
import cc.kune.core.client.ws.entheader.EntityHeaderPresenter;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.docs.client.DocsGinModule;
import cc.kune.docs.client.DocsGinjector;
+import cc.kune.events.client.EventsGinModule;
import cc.kune.events.client.EventsGinjector;
-import cc.kune.events.client.EventsGinModule;
import cc.kune.gspace.client.GSpaceGinModule;
import cc.kune.gspace.client.GSpaceGinjector;
import cc.kune.lists.client.ListsGinModule;
@@ -143,6 +144,8 @@
StateManager getStateManager();
+ AsyncProvider<SubtitlesManager> getSubtitlesPresenter();
+
TokenMatcher getTokenMatcher();
AsyncProvider<UserConfirmPresenter> getUserConfirmPresenter();
@@ -152,4 +155,5 @@
WaveParts getWaveParts();
XMLActionsParser getXmlActionsParser();
+
}
Added: trunk/src/main/java/cc/kune/common/client/utils/Base64Utils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/Base64Utils.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/Base64Utils.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.common.client.utils;
+
+/**
+ * A utility to decode and encode byte arrays as Strings, using only "safe"
+ * characters.
+ */
+public class Base64Utils {
+
+ /**
+ * An array mapping size but values to the characters that will be used to
+ * represent them. Note that this is not identical to the set of characters
+ * used by MIME-Base64.
+ */
+ private static final char[] base64Chars = new char[] {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+ 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b',
+ 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3',
+ '4', '5', '6', '7', '8', '9', '$', '_'};
+
+ /**
+ * An array mapping legal base 64 characters [a-zA-Z0-9$_] to their associated
+ * 6-bit values. The source indices will be given by 7-bit ASCII characters,
+ * thus the array size needs to be 128 (actually 123 would suffice for the
+ * given set of characters in use).
+ */
+ private static final byte[] base64Values = new byte[128];
+
+ /**
+ * Initialize the base 64 encoder values.
+ */
+ static {
+ // Invert the mapping (i -> base64Chars[i])
+ for (int i = 0; i < base64Chars.length; i++) {
+ base64Values[base64Chars[i]] = (byte) i;
+ }
+ }
+
+ /**
+ * Decode a base64 string into a byte array.
+ *
+ * @param data the encoded data.
+ * @return a byte array.
+ * @see #fromBase64(String)
+ */
+ public static byte[] fromBase64(String data) {
+ if (data == null) {
+ return null;
+ }
+
+ int len = data.length();
+ assert (len % 4) == 0;
+
+ if (len == 0) {
+ return new byte[0];
+ }
+
+ char[] chars = new char[len];
+ data.getChars(0, len, chars, 0);
+
+ int olen = 3 * (len / 4);
+ if (chars[len - 2] == '=') {
+ --olen;
+ }
+ if (chars[len - 1] == '=') {
+ --olen;
+ }
+
+ byte[] bytes = new byte[olen];
+
+ int iidx = 0;
+ int oidx = 0;
+ while (iidx < len) {
+ int c0 = base64Values[chars[iidx++] & 0xff];
+ int c1 = base64Values[chars[iidx++] & 0xff];
+ int c2 = base64Values[chars[iidx++] & 0xff];
+ int c3 = base64Values[chars[iidx++] & 0xff];
+ int c24 = (c0 << 18) | (c1 << 12) | (c2 << 6) | c3;
+
+ bytes[oidx++] = (byte) (c24 >> 16);
+ if (oidx == olen) {
+ break;
+ }
+ bytes[oidx++] = (byte) (c24 >> 8);
+ if (oidx == olen) {
+ break;
+ }
+ bytes[oidx++] = (byte) c24;
+ }
+
+ return bytes;
+ }
+
+ /**
+ * Decode a base64 string into a long value.
+ */
+ public static long longFromBase64(String value) {
+ int pos = 0;
+ long longVal = base64Values[value.charAt(pos++)];
+ int len = value.length();
+ while (pos < len) {
+ longVal <<= 6;
+ longVal |= base64Values[value.charAt(pos++)];
+ }
+ return longVal;
+ }
+
+ /**
+ * Converts a byte array into a base 64 encoded string. Null is encoded as
+ * null, and an empty array is encoded as an empty string. Otherwise, the byte
+ * data is read 3 bytes at a time, with bytes off the end of the array padded
+ * with zeros. Each 24-bit chunk is encoded as 4 characters from the sequence
+ * [A-Za-z0-9$_]. If one of the source positions consists entirely of padding
+ * zeros, an '=' character is used instead.
+ *
+ * @param data a byte array, which may be null or empty
+ * @return a String
+ */
+ public static String toBase64(byte[] data) {
+ if (data == null) {
+ return null;
+ }
+
+ int len = data.length;
+ if (len == 0) {
+ return "";
+ }
+
+ int olen = 4 * ((len + 2) / 3);
+ char[] chars = new char[olen];
+
+ int iidx = 0;
+ int oidx = 0;
+ int charsLeft = len;
+ while (charsLeft > 0) {
+ int b0 = data[iidx++] & 0xff;
+ int b1 = (charsLeft > 1) ? data[iidx++] & 0xff : 0;
+ int b2 = (charsLeft > 2) ? data[iidx++] & 0xff : 0;
+ int b24 = (b0 << 16) | (b1 << 8) | b2;
+
+ int c0 = (b24 >> 18) & 0x3f;
+ int c1 = (b24 >> 12) & 0x3f;
+ int c2 = (b24 >> 6) & 0x3f;
+ int c3 = b24 & 0x3f;
+
+ chars[oidx++] = base64Chars[c0];
+ chars[oidx++] = base64Chars[c1];
+ chars[oidx++] = (charsLeft > 1) ? base64Chars[c2] : '=';
+ chars[oidx++] = (charsLeft > 2) ? base64Chars[c3] : '=';
+
+ charsLeft -= 3;
+ }
+
+ return new String(chars);
+ }
+
+ /**
+ * Return a string containing a base-64 encoded version of the given long
+ * value. Leading groups of all zero bits are omitted.
+ */
+ public static String toBase64(long value) {
+ // Convert to ints early to avoid need for long ops
+ int low = (int) (value & 0xffffffff);
+ int high = (int) (value >> 32);
+
+ StringBuilder sb = new StringBuilder();
+ boolean haveNonZero = base64Append(sb, (high >> 28) & 0xf, false);
+ haveNonZero = base64Append(sb, (high >> 22) & 0x3f, haveNonZero);
+ haveNonZero = base64Append(sb, (high >> 16) & 0x3f, haveNonZero);
+ haveNonZero = base64Append(sb, (high >> 10) & 0x3f, haveNonZero);
+ haveNonZero = base64Append(sb, (high >> 4) & 0x3f, haveNonZero);
+ int v = ((high & 0xf) << 2) | ((low >> 30) & 0x3);
+ haveNonZero = base64Append(sb, v, haveNonZero);
+ haveNonZero = base64Append(sb, (low >> 24) & 0x3f, haveNonZero);
+ haveNonZero = base64Append(sb, (low >> 18) & 0x3f, haveNonZero);
+ haveNonZero = base64Append(sb, (low >> 12) & 0x3f, haveNonZero);
+ base64Append(sb, (low >> 6) & 0x3f, haveNonZero);
+ base64Append(sb, low & 0x3f, true);
+
+ return sb.toString();
+ }
+
+ private static boolean base64Append(StringBuilder sb, int digit,
+ boolean haveNonZero) {
+ if (digit > 0) {
+ haveNonZero = true;
+ }
+ if (haveNonZero) {
+ sb.append(base64Chars[digit]);
+ }
+ return haveNonZero;
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -102,6 +102,8 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.core.client.state.StateManagerDefault;
import cc.kune.core.client.state.TokenMatcher;
+import cc.kune.core.client.sub.SubtitlesManager;
+import cc.kune.core.client.sub.SubtitlesWidget;
import cc.kune.core.client.ws.CorePresenter;
import cc.kune.core.client.ws.CoreViewImpl;
import cc.kune.core.client.ws.entheader.EntityHeader;
@@ -175,6 +177,8 @@
RegisterPresenter.RegisterProxy.class);
bindPresenter(UserConfirmPresenter.class, UserConfirmPresenter.UserConfirmView.class,
UserConfirmPanel.class, UserConfirmPresenter.UserConfirmProxy.class);
+ bindPresenter(SubtitlesManager.class, SubtitlesManager.SubtitlesView.class,
+ SubtitlesWidget.class, SubtitlesManager.SubtitlesProxy.class);
bind(UserPassAutocompleteManager.class).to(UserPassAutocompleteManagerImpl.class).in(Singleton.class);
bind(SignIn.class).to(SignInPresenter.class).in(Singleton.class);
Copied: trunk/src/main/java/cc/kune/core/client/events/SndClickEvent.java (from rev 1531, trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/SndClickEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/SndClickEvent.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -0,0 +1,74 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class SndClickEvent extends GwtEvent<SndClickEvent.SndClickHandler> {
+
+ public interface HasSndClickHandlers extends HasHandlers {
+ HandlerRegistration addSndClickHandler(SndClickHandler handler);
+ }
+
+ public interface SndClickHandler extends EventHandler {
+ public void onClick(SndClickEvent event);
+ }
+
+ private static final Type<SndClickHandler> TYPE = new Type<SndClickHandler>();
+
+ public static void fire(final HasHandlers source) {
+ source.fireEvent(new SndClickEvent());
+ }
+
+ public static Type<SndClickHandler> getType() {
+ return TYPE;
+ }
+
+ public SndClickEvent() {
+ }
+
+ @Override
+ protected void dispatch(final SndClickHandler handler) {
+ handler.onClick(this);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public Type<SndClickHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return "SndClickEvent[" + "]";
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -86,7 +86,7 @@
this.groupOptions = groupOptions;
stateManager.addSiteToken(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
doNewGroup();
}
});
Modified: trunk/src/main/java/cc/kune/core/client/state/HistoryTokenCallback.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/HistoryTokenCallback.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/core/client/state/HistoryTokenCallback.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -21,6 +21,6 @@
public interface HistoryTokenCallback {
- void onHistoryToken();
+ void onHistoryToken(String token);
}
Modified: trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -27,6 +27,7 @@
import cc.kune.core.client.sitebar.AboutKuneDialog;
import cc.kune.core.client.sitebar.spaces.Space;
import cc.kune.core.client.sitebar.spaces.SpaceSelectEvent;
+import cc.kune.core.client.sub.SubtitlesManager;
import cc.kune.gspace.client.i18n.I18nTranslator;
import com.google.gwt.event.shared.EventBus;
@@ -40,56 +41,58 @@
private final Provider<NewGroup> newGroup;
private final Provider<Register> register;
private final Provider<SignIn> signIn;
+ private final Provider<SubtitlesManager> subProvider;
private final Provider<I18nTranslator> translator;
@Inject
public SiteTokenListeners(final Session session, final EventBus eventBus,
final Provider<SignIn> signIn, final Provider<Register> register,
final Provider<NewGroup> newGroup, final Provider<AboutKuneDialog> aboutKuneDialog,
- final Provider<I18nTranslator> translator) {
+ final Provider<I18nTranslator> translator, final Provider<SubtitlesManager> subProvider) {
this.eventBus = eventBus;
this.signIn = signIn;
this.register = register;
this.newGroup = newGroup;
this.aboutKuneDialog = aboutKuneDialog;
this.translator = translator;
+ this.subProvider = subProvider;
putValues();
}
private void putValues() {
put(SiteTokens.HOME, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
SpaceSelectEvent.fire(eventBus, Space.homeSpace);
}
});
put(SiteTokens.WAVEINBOX, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
SpaceSelectEvent.fire(eventBus, Space.userSpace);
}
});
put(SiteTokens.SIGNIN, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
signIn.get().showSignInDialog();
}
});
put(SiteTokens.REGISTER, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
register.get().doRegister();
}
});
put(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
newGroup.get().doNewGroup();
}
});
put(SiteTokens.ABOUTKUNE, new HistoryTokenCallback() {
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
// FIXME, something to come back
aboutKuneDialog.get().showCentered();
}
@@ -97,9 +100,15 @@
put(SiteTokens.TRANSLATE, new HistoryTokenCallback() {
// FIXME, something to come back
@Override
- public void onHistoryToken() {
+ public void onHistoryToken(final String token) {
translator.get().show();
}
});
+ put(SiteTokens.SUBTITLES, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ subProvider.get().show(token);
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/core/client/state/SiteTokens.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SiteTokens.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/core/client/state/SiteTokens.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -28,26 +28,28 @@
*
*/
public final class SiteTokens {
- public static final String ABOUTKUNE = "about";
- public final static String GROUP_HOME = "";
- public final static String HOME = "home";
- public final static String NEWGROUP = "newgroup";
- public static final String PREVIEW = "preview";
- public final static String REGISTER = "register";
- public final static String SIGNIN = "signin";
- public final static String TRANSLATE = "translate";
- public final static String WAVEINBOX = "inbox";
+ public static final String ABOUTKUNE = "about";
+ public final static String GROUP_HOME = "";
+ public final static String HOME = "home";
+ public final static String NEWGROUP = "newgroup";
+ public static final String PREVIEW = "preview";
+ public final static String REGISTER = "register";
+ public final static String SIGNIN = "signin";
+ public final static String SUBTITLES = "sub";
+ public final static String TRANSLATE = "translate";
+ public final static String WAVEINBOX = "inbox";
- @Inject
- public SiteTokens(final ReservedWordsRegistryDTO reserverdWords) {
- reserverdWords.add(ABOUTKUNE);
- reserverdWords.add(GROUP_HOME);
- reserverdWords.add(HOME);
- reserverdWords.add(NEWGROUP);
- reserverdWords.add(PREVIEW);
- reserverdWords.add(REGISTER);
- reserverdWords.add(SIGNIN);
- reserverdWords.add(TRANSLATE);
- reserverdWords.add(WAVEINBOX);
- }
+ @Inject
+ public SiteTokens(final ReservedWordsRegistryDTO reserverdWords) {
+ reserverdWords.add(ABOUTKUNE);
+ reserverdWords.add(GROUP_HOME);
+ reserverdWords.add(HOME);
+ reserverdWords.add(NEWGROUP);
+ reserverdWords.add(PREVIEW);
+ reserverdWords.add(REGISTER);
+ reserverdWords.add(SIGNIN);
+ reserverdWords.add(TRANSLATE);
+ reserverdWords.add(WAVEINBOX);
+ reserverdWords.add(SUBTITLES);
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -266,8 +266,11 @@
SpaceConfEvent.fire(eventBus, Space.groupSpace, sndToken);
SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(sndToken));
onHistoryChanged(new StateToken(sndToken));
+ } else if (firstToken.equals(SiteTokens.SUBTITLES)) {
+ siteTokens.get(SiteTokens.SUBTITLES).onHistoryToken(
+ tokenMatcher.getRedirect(newHistoryToken).getRight());
} else if (firstToken.equals(SiteTokens.NEWGROUP)) {
- siteTokens.get(SiteTokens.NEWGROUP).onHistoryToken();
+ siteTokens.get(SiteTokens.NEWGROUP).onHistoryToken(newHistoryToken);
} else if (firstToken.equals(SiteTokens.SIGNIN)) {
if (session.isLogged()) {
// We are logged, then redirect:
@@ -275,7 +278,7 @@
processHistoryToken(sndToken);
} else {
// We have to loggin
- siteTokens.get(SiteTokens.SIGNIN).onHistoryToken();
+ siteTokens.get(SiteTokens.SIGNIN).onHistoryToken(newHistoryToken);
}
}
} else if (tokenMatcher.isWaveToken(newHistoryToken)) {
@@ -312,7 +315,7 @@
// SpaceSelectEvent.fire(eventBus, Space.groupSpace);
}
// Fire the listener of this #hash token
- tokenListener.onHistoryToken();
+ tokenListener.onHistoryToken(newHistoryToken);
}
} else {
resumedHistoryToken = newHistoryToken;
Added: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -0,0 +1,51 @@
+package cc.kune.core.client.sub;
+
+import cc.kune.common.client.utils.Base64Utils;
+import cc.kune.core.client.state.StateManager;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class SubtitlesManager extends
+ Presenter<SubtitlesManager.SubtitlesView, SubtitlesManager.SubtitlesProxy> {
+
+ @ProxyCodeSplit
+ public interface SubtitlesProxy extends Proxy<SubtitlesManager> {
+ }
+
+ public interface SubtitlesView extends View {
+
+ void setDescription(String descr);
+
+ void setTitleText(String text);
+
+ void show();
+
+ }
+ private final StateManager stateManager;
+
+ @Inject
+ public SubtitlesManager(final EventBus eventBus, final SubtitlesView view, final SubtitlesProxy proxy,
+ final StateManager stateManager) {
+ super(eventBus, view, proxy);
+ this.stateManager = stateManager;
+ }
+
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
+
+ public void show(final String token) {
+ final String[] params = token.split("\\|");
+ getView().setTitleText(new String(Base64Utils.fromBase64(params[0])));
+ getView().setDescription(new String(Base64Utils.fromBase64(params[1])));
+ getView().show();
+ stateManager.gotoHistoryToken(params[2]);
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -0,0 +1,108 @@
+package cc.kune.core.client.sub;
+
+import org.adamtacy.client.ui.effects.events.EffectCompletedEvent;
+import org.adamtacy.client.ui.effects.events.EffectCompletedHandler;
+import org.adamtacy.client.ui.effects.examples.Show;
+import org.adamtacy.client.ui.effects.examples.SlideRight;
+
+import cc.kune.core.client.sub.SubtitlesManager.SubtitlesView;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.logical.shared.ResizeEvent;
+import com.google.gwt.event.logical.shared.ResizeHandler;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class SubtitlesWidget extends ViewImpl implements SubtitlesView {
+
+ interface SubtitlesWidgetUiBinder extends UiBinder<Widget, SubtitlesWidget> {
+ }
+
+ public static final String SUBTITLE_MANAGER_ID = "k-subt-widget";
+
+ private static SubtitlesWidgetUiBinder uiBinder = GWT.create(SubtitlesWidgetUiBinder.class);
+
+ @UiField
+ InlineLabel description;
+ private final PopupPanel popup;
+ private boolean showing;
+ @UiField
+ InlineLabel title;
+ private final Widget widget;
+
+ public SubtitlesWidget() {
+ popup = new PopupPanel(false, false);
+ popup.ensureDebugId(SUBTITLE_MANAGER_ID);
+ widget = uiBinder.createAndBindUi(this);
+ popup.addDomHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ if (showing) {
+ final SlideRight slideAtEnd = new SlideRight(popup.getElement());
+ slideAtEnd.invert();
+ slideAtEnd.setDuration(2);
+ slideAtEnd.play();
+ // final Fade fadeAtEnd = new Fade(popup.getElement());
+ // fadeAtEnd.setDuration(2);
+ // fadeAtEnd.play();
+ slideAtEnd.addEffectCompletedHandler(new EffectCompletedHandler() {
+ @Override
+ public void onEffectCompleted(final EffectCompletedEvent event) {
+ popup.hide();
+ }
+ });
+ showing = false;
+ }
+ }
+ }, ClickEvent.getType());
+ Window.addResizeHandler(new ResizeHandler() {
+ @Override
+ public void onResize(final ResizeEvent event) {
+ setSize(event.getWidth(), event.getHeight());
+ }
+ });
+ }
+
+ @Override
+ public Widget asWidget() {
+ return popup;
+ }
+
+ @Override
+ public void setDescription(final String descr) {
+ description.setText(descr);
+ }
+
+ private void setSize(final int width, final int height) {
+ popup.setSize(width + "px", height + "px");
+ }
+
+ @Override
+ public void setTitleText(final String text) {
+ title.setText(text);
+ }
+
+ @Override
+ public void show() {
+ popup.setWidget(widget);
+ setSize(Window.getClientWidth(), Window.getClientHeight());
+ popup.show();
+ final Show showAtIni = new Show(popup.getElement());
+ showAtIni.setDuration(3);
+ showAtIni.play();
+ final SlideRight slideAtIni = new SlideRight(popup.getElement());
+ slideAtIni.setDuration(3);
+ slideAtIni.play();
+ popup.sinkEvents(Event.MOUSEEVENTS);
+ this.showing = true;
+ }
+
+}
Added: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.ui.xml 2011-09-26 12:45:04 UTC (rev 1533)
@@ -0,0 +1,80 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:style>
+ .mask {
+
+ }
+
+ .k-subtitles-title {
+ font-size: 48px;
+ color: #FFF; /* #C87137; */
+ font-weight: bold;
+ float: left;
+ padding-left: 40px;
+ }
+
+ .k-subtitles-panel {
+ background: none repeat scroll 0 0 #69312F;
+ border-radius: 0px 5px 50px 0px;
+ display: table;
+ position: relative;
+ overflow: hidden;
+ }
+
+ .k-sutitles-child-panel {
+ top: 50%;
+ display: table-cell;
+ vertical-align: middle;
+ }
+
+ .k-sutitles-center-panel {
+ position: relative;
+ top: -50%;
+ }
+
+ .k-subtitles-description {
+ clear: both;
+ float: left;
+ font-size: 36px;
+ color: white;
+ padding-left: 40px;
+ }
+
+ /* http://stackoverflow.com/questions/637921/opacity-of-background-but-not-the… */
+ .k-subtitles-mask {
+ background-color: rgb(255, 255, 255);
+ -moz-opacity: 0.78 !important;
+ -khtml-opacity: 0.78 !important;
+ opacity: 0.78 !important;
+ }
+ </ui:style>
+
+
+ <g:LayoutPanel width="100%" height="100%" ui:field="mainPanel">
+ <g:layer left="0px" width="100.0pct" top="0px" height="100.0pct">
+ <g:SimplePanel styleName="{style.mask}" ui:field="frame"
+ width="100%" height="100%"/>
+ </g:layer>
+ <g:layer left="0px" width="100.0pct" top="0px" height="100.0pct">
+ <g:HTMLPanel ui:field="mask" styleName="{style.k-subtitles-mask}"
+ width="100%" height="100%"/>
+ </g:layer>
+ <g:layer left="0" width="90%" height="120px" bottom="80px">
+ <g:FlowPanel width="100%" height="120px" ui:field="messagePanel"
+ addStyleNames="{style.k-subtitles-panel}">
+ <g:FlowPanel styleName="{style.k-sutitles-child-panel}">
+ <g:FlowPanel styleName="{style.k-sutitles-center-panel}">
+ <g:SimplePanel addStyleNames="k-subtitles-icon">
+ <g:Image ui:field="icon"/>
+ </g:SimplePanel>
+ <g:InlineLabel ui:field="title"
+ addStyleNames="{style.k-subtitles-title}"/>
+ <g:InlineLabel ui:field="description"
+ addStyleNames="{style.k-subtitles-description}"/>
+ </g:FlowPanel>
+ </g:FlowPanel>
+ </g:FlowPanel>
+ </g:layer>
+ </g:LayoutPanel>
+</ui:UiBinder>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -7,8 +7,8 @@
import org.waveprotocol.box.webclient.search.Search;
import org.waveprotocol.box.webclient.search.Search.Listener;
-import cc.kune.chat.client.snd.SndClickEvent;
import cc.kune.core.client.events.NewUserRegisteredEvent;
+import cc.kune.core.client.events.SndClickEvent;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.UserSignInOrSignOutEvent;
import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/main/resources/kune.properties 2011-09-26 12:45:04 UTC (rev 1533)
@@ -36,8 +36,8 @@
### Other params
-# Reserved words to avoid it's use in the client side for user and group names
-kune.server.names.reservedwords = root,adm,kune,fuck
+# Reserved words to avoid it's use in the client side for user and group names (see client tokens used in SiteTokens)
+kune.server.names.reservedwords = root,adm,kune,fuck,about,home,newgroup,preview,register,signin,translate,inbox,sub
# If defined create a copy of this wave as welcome to new users
# kune.site.welcomewave = w+rtackLTkDCA
Modified: trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java 2011-09-24 18:53:50 UTC (rev 1532)
+++ trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java 2011-09-26 12:45:04 UTC (rev 1533)
@@ -43,248 +43,277 @@
public class StateManagerDefaultTest {
- private static final String HASH = "someUserHash";
- private BeforeActionListener beforeChangeListener1;
- private BeforeActionListener beforeChangeListener2;
- private ContentCache contentProvider;
- private EventBusTester eventBus;
- private GroupChangedHandler groupChangeHandler;
- private HistoryWrapper history;
- private Session session;
- private SiteTokenListeners siteTokens;
- private StateAbstractDTO state;
- private StateChangedHandler stateChangeHandler;
- private StateManagerDefault stateManager;
- private TokenMatcher tokenMatcher;
- private ToolChangedHandler toolChangeHandler;
+ private static final String HASH = "someUserHash";
+ private BeforeActionListener beforeChangeListener1;
+ private BeforeActionListener beforeChangeListener2;
+ private ContentCache contentProvider;
+ private EventBusTester eventBus;
+ private GroupChangedHandler groupChangeHandler;
+ private HistoryWrapper history;
+ private Session session;
+ private SiteTokenListeners siteTokens;
+ private StateAbstractDTO state;
+ private StateChangedHandler stateChangeHandler;
+ private StateManagerDefault stateManager;
+ private TokenMatcher tokenMatcher;
+ private ToolChangedHandler toolChangeHandler;
- @Before
- public void before() {
- contentProvider = Mockito.mock(ContentCache.class);
- session = Mockito.mock(Session.class);
- history = Mockito.mock(HistoryWrapper.class);
- tokenMatcher = Mockito.mock(TokenMatcher.class);
- siteTokens = Mockito.mock(SiteTokenListeners.class);
- eventBus = new EventBusTester();
- Mockito.when(session.getUserHash()).thenReturn(HASH);
- Mockito.doAnswer(new Answer<Object>() {
- @Override
- public Object answer(final InvocationOnMock invocation) throws Throwable {
- eventBus.addHandler(UserSignInEvent.getType(), (UserSignInHandler) invocation.getArguments()[1]);
- return null;
- }
- }).when(session).onUserSignIn(anyBoolean(), (UserSignInHandler) Mockito.anyObject());
- Mockito.doAnswer(new Answer<Object>() {
- @Override
- public Object answer(final InvocationOnMock invocation) throws Throwable {
- eventBus.addHandler(UserSignOutEvent.getType(), (UserSignOutHandler) invocation.getArguments()[1]);
- return null;
- }
- }).when(session).onUserSignOut(anyBoolean(), (UserSignOutHandler) Mockito.anyObject());
- Mockito.doAnswer(new Answer<Object>() {
- @Override
- public Object answer(final InvocationOnMock invocation) throws Throwable {
- eventBus.addHandler(AppStartEvent.getType(), (AppStartHandler) invocation.getArguments()[1]);
- return null;
- }
- }).when(session).onAppStart(anyBoolean(), (AppStartHandler) Mockito.anyObject());
- state = Mockito.mock(StateAbstractDTO.class);
- stateManager = new StateManagerDefault(contentProvider, session, history, tokenMatcher, eventBus, siteTokens);
- stateChangeHandler = Mockito.mock(StateChangedHandler.class);
- groupChangeHandler = Mockito.mock(GroupChangedHandler.class);
- toolChangeHandler = Mockito.mock(ToolChangedHandler.class);
- beforeChangeListener1 = Mockito.mock(BeforeActionListener.class);
- beforeChangeListener2 = Mockito.mock(BeforeActionListener.class);
- eventBus.addHandler(StateChangedEvent.getType(), stateChangeHandler);
- eventBus.addHandler(GroupChangedEvent.getType(), groupChangeHandler);
- eventBus.addHandler(ToolChangedEvent.getType(), toolChangeHandler);
- // new NotifyUser(null, null);
- }
+ @Before
+ public void before() {
+ contentProvider = Mockito.mock(ContentCache.class);
+ session = Mockito.mock(Session.class);
+ history = Mockito.mock(HistoryWrapper.class);
+ tokenMatcher = Mockito.mock(TokenMatcher.class);
+ siteTokens = Mockito.mock(SiteTokenListeners.class);
+ eventBus = new EventBusTester();
+ Mockito.when(session.getUserHash()).thenReturn(HASH);
+ Mockito.doAnswer(new Answer<Object>() {
+ @Override
+ public Object answer(final InvocationOnMock invocation) throws Throwable {
+ eventBus.addHandler(UserSignInEvent.getType(), (UserSignInHandler) invocation.getArguments()[1]);
+ return null;
+ }
+ }).when(session).onUserSignIn(anyBoolean(), (UserSignInHandler) Mockito.anyObject());
+ Mockito.doAnswer(new Answer<Object>() {
+ @Override
+ public Object answer(final InvocationOnMock invocation) throws Throwable {
+ eventBus.addHandler(UserSignOutEvent.getType(),
+ (UserSignOutHandler) invocation.getArguments()[1]);
+ return null;
+ }
+ }).when(session).onUserSignOut(anyBoolean(), (UserSignOutHandler) Mockito.anyObject());
+ Mockito.doAnswer(new Answer<Object>() {
+ @Override
+ public Object answer(final InvocationOnMock invocation) throws Throwable {
+ eventBus.addHandler(AppStartEvent.getType(), (AppStartHandler) invocation.getArguments()[1]);
+ return null;
+ }
+ }).when(session).onAppStart(anyBoolean(), (AppStartHandler) Mockito.anyObject());
+ state = Mockito.mock(StateAbstractDTO.class);
+ stateManager = new StateManagerDefault(contentProvider, session, history, tokenMatcher, eventBus,
+ siteTokens);
+ stateChangeHandler = Mockito.mock(StateChangedHandler.class);
+ groupChangeHandler = Mockito.mock(GroupChangedHandler.class);
+ toolChangeHandler = Mockito.mock(ToolChangedHandler.class);
+ beforeChangeListener1 = Mockito.mock(BeforeActionListener.class);
+ beforeChangeListener2 = Mockito.mock(BeforeActionListener.class);
+ eventBus.addHandler(StateChangedEvent.getType(), stateChangeHandler);
+ eventBus.addHandler(GroupChangedEvent.getType(), groupChangeHandler);
+ eventBus.addHandler(ToolChangedEvent.getType(), toolChangeHandler);
+ // new NotifyUser(null, null);
+ }
- @Test
- public void changeGroupWithNoTool() {
- changeState("group1", "group2");
- Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged((StateChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- }
+ @Test
+ public void changeGroupWithNoTool() {
+ changeState("group1", "group2");
+ Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+ (StateChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ }
- private void changeState(final String... tokens) {
- for (final String token : tokens) {
- Mockito.when(state.getStateToken()).thenReturn(new StateToken(token));
- stateManager.setState(state);
- }
+ private void changeState(final String... tokens) {
+ for (final String token : tokens) {
+ Mockito.when(state.getStateToken()).thenReturn(new StateToken(token));
+ stateManager.setState(state);
}
+ }
- @Test
- public void changeStateWithDifferentAndGroupsToolsMustFireListener() {
- changeState("group2.tool1", "group1.tool2");
- Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged((StateChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged((ToolChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("", "group2"));
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("group2", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("tool1", "tool2"));
- }
+ @Test
+ public void changeStateWithDifferentAndGroupsToolsMustFireListener() {
+ changeState("group2.tool1", "group1.tool2");
+ Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+ (StateChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
+ (ToolChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("", "group2"));
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("group2", "group1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent("tool1", "tool2"));
+ }
- @Test
- public void changeStateWithDifferentGroupsMustFireListener() {
- changeState("group1.tool1", "group2.tool1");
- // assertTrue(stateChangeListener.isCalled(2));
- // assertTrue(groupChangeListener.isCalledWithEquals("", "group1",
- // "group1", "group2"));
- // assertTrue(toolChangeListener.isCalledWithEquals("", "tool1"));
- Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged((StateChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged((ToolChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("", "group1"));
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("group1", "group2"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ @Test
+ public void changeStateWithDifferentGroupsMustFireListener() {
+ changeState("group1.tool1", "group2.tool1");
+ // assertTrue(stateChangeListener.isCalled(2));
+ // assertTrue(groupChangeListener.isCalledWithEquals("", "group1",
+ // "group1", "group2"));
+ // assertTrue(toolChangeListener.isCalledWithEquals("", "tool1"));
+ Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+ (StateChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ (ToolChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("", "group1"));
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("group1", "group2"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
- }
+ }
- @Test
- public void changeStateWithDifferentToolsMustFireListener() {
- changeState("group1.tool1", "group1.tool2");
- Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged((StateChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged((ToolChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("tool1", "tool2"));
- }
+ @Test
+ public void changeStateWithDifferentToolsMustFireListener() {
+ changeState("group1.tool1", "group1.tool2");
+ Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+ (StateChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
+ (ToolChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("", "group1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent("tool1", "tool2"));
+ }
- @Test
- public void changeToNoTool() {
- changeState("group1.tool1", "group1");
- Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged((StateChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged((ToolChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("tool1", ""));
- }
+ @Test
+ public void changeToNoTool() {
+ changeState("group1.tool1", "group1");
+ Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+ (StateChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
+ (ToolChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("", "group1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("tool1", ""));
+ }
- @Test
- public void changeToSameToken() {
- changeState("group1.tool1", "group1.tool1");
- Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged((StateChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged((GroupChangedEvent) Mockito.anyObject());
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged((ToolChangedEvent) Mockito.anyObject());
- Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(new GroupChangedEvent("", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
- }
+ @Test
+ public void changeToSameToken() {
+ changeState("group1.tool1", "group1.tool1");
+ Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+ (StateChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ (GroupChangedEvent) Mockito.anyObject());
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ (ToolChangedEvent) Mockito.anyObject());
+ Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+ new GroupChangedEvent("", "group1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ }
- private String confBeforeStateChangeListeners(final boolean value, final boolean value2) {
- stateManager.addBeforeStateChangeListener(beforeChangeListener1);
- stateManager.addBeforeStateChangeListener(beforeChangeListener2);
- final String newToken = "something";
- Mockito.when(beforeChangeListener1.beforeAction()).thenReturn(value);
- Mockito.when(beforeChangeListener2.beforeAction()).thenReturn(value2);
- return newToken;
- }
+ private String confBeforeStateChangeListeners(final boolean value, final boolean value2) {
+ stateManager.addBeforeStateChangeListener(beforeChangeListener1);
+ stateManager.addBeforeStateChangeListener(beforeChangeListener2);
+ final String newToken = "something";
+ Mockito.when(beforeChangeListener1.beforeAction()).thenReturn(value);
+ Mockito.when(beforeChangeListener2.beforeAction()).thenReturn(value2);
+ return newToken;
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void getDefGroup() {
- stateManager.processHistoryToken("site.docs");
- verifyGetServerContent();
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void getDefGroup() {
+ stateManager.processHistoryToken("site.docs");
+ verifyGetServerContent();
+ }
- public void getWaveToken() {
- stateManager.processHistoryToken("example.com/w+abcd/~/conv+root/b+45kg");
- }
+ public void getWaveToken() {
+ stateManager.processHistoryToken("example.com/w+abcd/~/conv+root/b+45kg");
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void normalStartLoggedUser() {
- // When a user enter reload state, also if the application is starting
- // (and the user was logged)
- Mockito.when(history.getToken()).thenReturn("");
- stateManager.refreshCurrentState();
- verifyGetServerContent();
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void normalStartLoggedUser() {
+ // When a user enter reload state, also if the application is starting
+ // (and the user was logged)
+ Mockito.when(history.getToken()).thenReturn("");
+ stateManager.refreshCurrentState();
+ verifyGetServerContent();
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void oneBeforeStateChangeListenerAddAndRemove() {
- final String newToken = confBeforeStateChangeListeners(false, false);
- stateManager.processHistoryToken(newToken);
- removeBeforeStateChangeListener();
- stateManager.processHistoryToken(newToken);
- verifyGetServerContent();
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void oneBeforeStateChangeListenerAddAndRemove() {
+ final String newToken = confBeforeStateChangeListeners(false, false);
+ stateManager.processHistoryToken(newToken);
+ removeBeforeStateChangeListener();
+ stateManager.processHistoryToken(newToken);
+ verifyGetServerContent();
+ }
- @Test
- public void oneBeforeStateChangeListenerFalseAndResume() {
- final String token = confBeforeStateChangeListeners(false, true);
- stateManager.processHistoryToken(token);
- Mockito.verify(history, Mockito.never()).newItem(token);
- removeBeforeStateChangeListener();
- stateManager.resumeTokenChange();
- Mockito.verify(history, Mockito.times(1)).newItem(token);
- }
+ @Test
+ public void oneBeforeStateChangeListenerFalseAndResume() {
+ final String token = confBeforeStateChangeListeners(false, true);
+ stateManager.processHistoryToken(token);
+ Mockito.verify(history, Mockito.never()).newItem(token);
+ removeBeforeStateChangeListener();
+ stateManager.resumeTokenChange();
+ Mockito.verify(history, Mockito.times(1)).newItem(token);
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void oneBeforeStateChangeListenerReturnFalse() {
- stateManager.processHistoryToken(confBeforeStateChangeListeners(true, false));
- Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
- (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void oneBeforeStateChangeListenerReturnFalse() {
+ stateManager.processHistoryToken(confBeforeStateChangeListeners(true, false));
+ Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
+ (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void oneBeforeStateChangeListenerReturnFalseWithTwo() {
- stateManager.processHistoryToken(confBeforeStateChangeListeners(false, false));
- Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
- (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void oneBeforeStateChangeListenerReturnFalseWithTwo() {
+ stateManager.processHistoryToken(confBeforeStateChangeListeners(false, false));
+ Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
+ (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void oneBeforeStateChangeListenerReturnTrue() {
- stateManager.processHistoryToken(confBeforeStateChangeListeners(true, true));
- verifyGetServerContent();
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void oneBeforeStateChangeListenerReturnTrue() {
+ stateManager.processHistoryToken(confBeforeStateChangeListeners(true, true));
+ verifyGetServerContent();
+ }
- private void removeBeforeStateChangeListener() {
- stateManager.removeBeforeStateChangeListener(beforeChangeListener1);
- stateManager.removeBeforeStateChangeListener(beforeChangeListener2);
- }
+ private void removeBeforeStateChangeListener() {
+ stateManager.removeBeforeStateChangeListener(beforeChangeListener1);
+ stateManager.removeBeforeStateChangeListener(beforeChangeListener2);
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void siteTokenFirstLoadDefContentAndFireListener() {
- final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
- final String token = SiteTokens.SIGNIN;
- stateManager.addSiteToken(token, listener);
- Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
- stateManager.processHistoryToken(token);
- Mockito.verify(listener, Mockito.times(1)).onHistoryToken();
- verifyGetServerContent();
- }
+ @SuppressWarnings("unchecked")
+ @Test
+ public void siteTokenFirstLoadDefContentAndFireListener() {
+ final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
+ final String token = SiteTokens.SIGNIN;
+ stateManager.addSiteToken(token, listener);
+ Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
+ stateManager.processHistoryToken(token);
+ Mockito.verify(listener, Mockito.times(1)).onHistoryToken(Mockito.anyString());
+ verifyGetServerContent();
+ }
- @Test
- public void siteTokenTest() {
- final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
- stateManager.addSiteToken(SiteTokens.SIGNIN, listener);
- Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
- stateManager.processHistoryToken("signIn");
- Mockito.verify(listener, Mockito.times(1)).onHistoryToken();
- }
+ @Test
+ public void siteTokenTest() {
+ final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
+ stateManager.addSiteToken(SiteTokens.SIGNIN, listener);
+ Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
+ stateManager.processHistoryToken("signIn");
+ Mockito.verify(listener, Mockito.times(1)).onHistoryToken(Mockito.anyString());
+ }
- @Test
- public void startMustLoadContent() {
- final InitDataDTO initData = Mockito.mock(InitDataDTO.class);
- Mockito.when(history.getToken()).thenReturn("");
- eventBus.fireEvent(new AppStartEvent(initData));
- verifyGetServerContent();
- }
+ @Test
+ public void startMustLoadContent() {
+ final InitDataDTO initData = Mockito.mock(InitDataDTO.class);
+ Mockito.when(history.getToken()).thenReturn("");
+ eventBus.fireEvent(new AppStartEvent(initData));
+ verifyGetServerContent();
+ }
- private void verifyGetServerContent() {
- Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
- (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
- }
+ private void verifyGetServerContent() {
+ Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
+ (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+ }
}
1
0
Author: vjrj_
Date: 2011-09-24 20:53:50 +0200 (Sat, 24 Sep 2011)
New Revision: 1532
Added:
trunk/src/test/java/testsuites/FaultyTestSuite.java
Removed:
trunk/src/main/java/cc/kune/meets/
trunk/src/main/java/org/ourproject/kune/app/
trunk/src/main/java/org/ourproject/kune/gallery/client/
trunk/src/main/java/org/ourproject/kune/platf/client/actions/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/
trunk/src/main/java/org/ourproject/kune/workspace/KuneWorkspace.gwt.xml
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/
trunk/src/main/java/org/ourproject/kune/workspace/public/
trunk/src/test/java/cc/kune/tasks/server/
trunk/src/test/java/org/FaultyTestSuite.java
trunk/src/test/java/org/ourproject/kune/gallery/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/
trunk/src/test/java/org/ourproject/kune/workspace/client/
Log:
And some clean-up of org.ourproject package
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/KuneWorkspace.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/KuneWorkspace.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
+++ trunk/src/main/java/org/ourproject/kune/workspace/KuneWorkspace.gwt.xml 2011-09-24 18:53:50 UTC (rev 1532)
@@ -1,18 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<module>
- <inherits name="cc.kune.core.Core" />
- <inherits name='org.ourproject.kune.platf.KunePlatform' />
- <inherits name="org.ourproject.kune.chat.KuneChat" />
- <inherits name="com.google.gwt.core.Core" />
- <stylesheet src="js/ext/resources/css/ext-all.css" />
- <script src="js/ext/adapter/ext/ext-base.js" />
- <script src="js/ext/ext-all.js" />
- <inherits name="com.gwtext.GwtExt" />
- <inherits name="com.calclab.suco.Suco" />
-<!-- <inherits name="com.calclab.emiteuimodule.EmiteUIModule" />-->
- <inherits name="com.gwtextux.GwtExtUx" />
- <inherits name="com.gwtextux.UploadDialog" />
- <inherits name="com.gwtextux.ToastWindow" />
-<!-- <inherits name="com.google.gwt.wave.Wave" />-->
- <source path='client' excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java"/>
-</module>
\ No newline at end of file
Deleted: trunk/src/test/java/org/FaultyTestSuite.java
===================================================================
--- trunk/src/test/java/org/FaultyTestSuite.java 2011-09-24 18:46:13 UTC (rev 1531)
+++ trunk/src/test/java/org/FaultyTestSuite.java 2011-09-24 18:53:50 UTC (rev 1532)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-/**
- * A Test Suite to test (only) some tests that fails
- *
- */
-(a)RunWith(Suite.class)
-@SuiteClasses({})
-public class FaultyTestSuite {
-
-}
Copied: trunk/src/test/java/testsuites/FaultyTestSuite.java (from rev 1528, trunk/src/test/java/org/FaultyTestSuite.java)
===================================================================
--- trunk/src/test/java/testsuites/FaultyTestSuite.java (rev 0)
+++ trunk/src/test/java/testsuites/FaultyTestSuite.java 2011-09-24 18:53:50 UTC (rev 1532)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package testsuites;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * A Test Suite to test (only) some tests that fails
+ *
+ */
+(a)RunWith(Suite.class)
+@SuiteClasses({})
+public class FaultyTestSuite {
+
+}
1
0
Author: vjrj_
Date: 2011-09-24 20:46:13 +0200 (Sat, 24 Sep 2011)
New Revision: 1531
Added:
trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
trunk/src/test/java/cc/kune/selenium/PageObjectModule.java
trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
Removed:
trunk/src/main/java/org/ourproject/kune/app/public/
trunk/src/main/java/org/ourproject/kune/chat/
trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/
trunk/src/main/java/org/ourproject/kune/gallery/client/ctx/
trunk/src/main/java/org/ourproject/kune/gallery/public/
trunk/src/main/java/org/ourproject/kune/gallery/server/
trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/client/View.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/
trunk/src/main/java/org/ourproject/kune/platf/client/app/
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/
trunk/src/main/java/org/ourproject/kune/platf/client/services/
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/form/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/imgchooser/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/palette/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/inserttable/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/
trunk/src/main/java/org/ourproject/kune/platf/public/
trunk/src/main/java/org/ourproject/kune/wiki/
trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/
trunk/src/main/java/org/ourproject/kune/workspace/client/hello/
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/
trunk/src/main/java/org/ourproject/kune/workspace/client/search/
trunk/src/main/java/org/ourproject/kune/workspace/client/site/
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/
trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java
trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java
trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java
trunk/src/test/java/org/ourproject/kune/gallery/server/
trunk/src/test/java/org/ourproject/kune/platf/client/actions/
trunk/src/test/java/org/ourproject/kune/platf/client/dto/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/saving/
trunk/src/test/java/org/ourproject/kune/platf/client/utils/
trunk/src/test/java/org/ourproject/kune/workspace/client/entityheader/
trunk/src/test/java/org/ourproject/kune/workspace/client/socialnet/
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java
trunk/src/main/java/cc/kune/common/client/actions/Action.java
trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java
trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/PageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java
Log:
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
And some clean-up of org.ourproject package
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/.classpath 2011-09-24 18:46:13 UTC (rev 1531)
@@ -154,5 +154,6 @@
<classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2.jar" sourcepath="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1.jar" sourcepath="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+
<classpathentry kind="src" path=".apt_generated" including="**/*.java"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
</classpath>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/pom.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -562,17 +562,17 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>waveinabox-server-0.3</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>proto-msg</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>gwt-util-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -582,67 +582,67 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>model-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>common-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>util-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>concurrencycontrol-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-scheduler-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>media-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>communication-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.findbugs</groupId>
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -255,7 +255,7 @@
chatIcon.setId(CHAT_CLIENT_ICON_ID);
chatIcon.setStyles("k-no-backimage, k-btn-sitebar, k-chat-icon");
chatIcon.putValue(Action.NAME, i18n.t(CHAT_TITLE));
- chatIcon.putValue(Action.SHORT_DESCRIPTION, i18n.t("Show/hide the chat window"));
+ chatIcon.putValue(Action.TOOLTIP, i18n.t("Show/hide the chat window"));
final KeyStroke shortcut = Shortcut.getShortcut(false, true, false, false, Character.valueOf('C'));
shorcutRegister.put(shortcut, action);
action.setShortcut(shortcut);
Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -71,7 +71,7 @@
}
});
putValue(Action.NAME, i18n.t("Group's public room"));
- putValue(Action.SHORT_DESCRIPTION, i18n.t("Enter to this group public chat room"));
+ putValue(Action.TOOLTIP, i18n.t("Enter to this group public chat room"));
putValue(Action.SMALL_ICON, res.groupChat());
setInviteMembersImpl(false);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -40,17 +40,17 @@
public AbstractExtendedAction(final String text, final String tooltip, final String iconCls) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
super.putValue(Action.SMALL_ICON, iconCls);
}
public AbstractExtendedAction withIcon(final ImageResource icon) {
- super.putValue(Action.SHORT_DESCRIPTION, icon);
+ super.putValue(Action.TOOLTIP, icon);
return this;
}
public AbstractExtendedAction withIconCls(final String icon) {
- super.putValue(Action.SHORT_DESCRIPTION, icon);
+ super.putValue(Action.TOOLTIP, icon);
return this;
}
@@ -60,7 +60,7 @@
}
public AbstractExtendedAction withToolTip(final String tooltip) {
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
return this;
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/common/client/actions/Action.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/Action.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/Action.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -87,7 +87,7 @@
* A key to access the short description for the action (the short description
* is typically used as the tool tip text).
*/
- String SHORT_DESCRIPTION = "ShortDescription";
+ String TOOLTIP = "ShortDescription";
/**
* A key to access the icon for the action.
@@ -129,7 +129,7 @@
/**
* Sets the value associated with the specified key and sends a
* {@link PropertyChangeEvent} to all registered listeners. The standard keys
- * are defined in this interface: {@link #NAME}, {@link #SHORT_DESCRIPTION},
+ * are defined in this interface: {@link #NAME}, {@link #TOOLTIP},
* {@link #LONG_DESCRIPTION}, {@link #SMALL_ICON}, {@link #ACTION_COMMAND_KEY}
* , {@link #ACCELERATOR_KEY} and {@link #MNEMONIC_KEY}. Any existing value
* associated with the key will be overwritten.
Modified: trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -25,20 +25,20 @@
public BaseAction(final String text, final String tooltip) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
}
public BaseAction(final String text, final String tooltip, final ImageResource icon) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
super.putValue(Action.SMALL_ICON, icon);
}
public BaseAction(final String text, final String tooltip, final String icon) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
super.putValue(Action.SMALL_ICON, icon);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -75,7 +75,7 @@
private void configureProperties() {
setText((String) (descriptor.getValue(Action.NAME)));
- setToolTipText((String) (descriptor.getValue(Action.SHORT_DESCRIPTION)));
+ setToolTipText((String) (descriptor.getValue(Action.TOOLTIP)));
setIcon(descriptor.getValue(Action.SMALL_ICON));
setEnabled((Boolean) descriptor.getValue(AbstractAction.ENABLED));
setVisible((Boolean) descriptor.getValue(GuiActionDescrip.VISIBLE));
@@ -97,7 +97,7 @@
setText((String) newValue);
} else if (event.getPropertyName().equals(Action.SMALL_ICON)) {
setIcon(newValue);
- } else if (event.getPropertyName().equals(Action.SHORT_DESCRIPTION)) {
+ } else if (event.getPropertyName().equals(Action.TOOLTIP)) {
setToolTipText((String) newValue);
} else if (event.getPropertyName().equals(GuiActionDescrip.VISIBLE)) {
setVisible((Boolean) newValue);
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -253,7 +253,7 @@
@Override
public String toString() {
final String name = (String) getValue(Action.NAME);
- final String tooltip = (String) getValue(Action.SHORT_DESCRIPTION);
+ final String tooltip = (String) getValue(Action.TOOLTIP);
return "[GuiActionDescrip: " + getClass().getName() + (name == null ? "" : " " + name)
+ (tooltip == null ? "" : " " + tooltip) + "]";
}
@@ -308,7 +308,7 @@
@Override
public GuiActionDescrip withToolTip(final String tooltip) {
- putValue(Action.SHORT_DESCRIPTION, tooltip);
+ putValue(Action.TOOLTIP, tooltip);
return this;
}
}
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -61,11 +61,9 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, title, closeable));
}
- public static void error(final String message, final String title, final String id,
+ public static void error(final String title, final String message, final String id,
final boolean closeable) {
- final UserNotifyEvent event = new UserNotifyEvent(NotifyLevel.error, message, id, closeable);
- event.setId(id);
- eventBus.fireEvent(event);
+ sendEventImpl(title, message, id, closeable, NotifyLevel.error);
}
public static void hideProgress() {
@@ -84,6 +82,11 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, message, closeable));
}
+ public static void info(final String title, final String message, final String id,
+ final boolean closeable) {
+ sendEventImpl(title, message, id, closeable, NotifyLevel.info);
+ }
+
public static void init(final EventBus eventBus, final I18nTranslationService i18n) {
NotifyUser.eventBus = eventBus;
NotifyUser.i18n = i18n;
@@ -106,6 +109,13 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.log, message));
}
+ private static void sendEventImpl(final String title, final String message, final String id,
+ final boolean closeable, final NotifyLevel level) {
+ final UserNotifyEvent event = new UserNotifyEvent(level, title, message, closeable);
+ event.setId(id);
+ eventBus.fireEvent(event);
+ }
+
public static void showAlertMessage(final String title, final String message) {
showAlertMessage(title, message, onOk);
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -15,6 +15,8 @@
public class AnonUsersManager {
+ public static final String ANON_MESSAGE_CLOSE_ICON = "k-anon-um-close-btn";
+
@Inject
public AnonUsersManager(final Session session, final CookiesManager cookiesManager,
final I18nTranslationService i18n) {
@@ -31,11 +33,12 @@
final String signin = TextUtils.generateHtmlLink("#" + SiteTokens.SIGNIN,
i18n.tWithNT("sign in", "register, in lowercase"), false);
NotifyUser.info(
+ "",
i18n.tWithNT(
"You did not sign-in, so you can just see some public contents in this website, "
+ "but not edit or collaborate with others. Please [%s] or [%s] in order to get full access to this site tools and contents",
"This will be something like 'Please register or sign in', but instead of %s some links",
- register, signin), true);
+ register, signin), ANON_MESSAGE_CLOSE_ICON, true);
} else {
if (Boolean.valueOf(anonCookie)) {
// Registered already: we set the cookie for some big period again
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -40,6 +40,9 @@
super();
this.stateManager = stateManager;
putValue(Action.NAME, i18n.t("Create New Group"));
+ putValue(Action.TOOLTIP,
+ i18n.t("Create a new group for your initiative or organization "
+ + "(NGO, collective, academic group...)"));
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -46,6 +46,8 @@
super();
this.stateManager = stateManager;
putValue(Action.NAME, i18n.t("Sign in to collaborate"));
+ putValue(Action.TOOLTIP,
+ i18n.t("Please sign in or register to get full access to this site tools and contents"));
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -53,7 +53,7 @@
false, true, false);
this.signIn = signIn;
putValue(NAME, i18n.t("Participate"));
- putValue(SHORT_DESCRIPTION, i18n.t("Request to participate in this group"));
+ putValue(TOOLTIP, i18n.t("Request to participate in this group"));
putValue(Action.SMALL_ICON, res.addGreen());
putValue(Action.STYLES, "k-sn-join");
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -45,7 +45,7 @@
super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Editor,
true, false, true);
putValue(NAME, i18n.t("Leave this group"));
- putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
+ putValue(TOOLTIP, i18n.t("Do not participate anymore in this group"));
putValue(Action.SMALL_ICON, res.del());
putValue(Action.STYLES, "k-sn-join");
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -55,7 +55,7 @@
this.i18n = i18n;
this.snServiceProvider = snServiceProvider;
putValue(NAME, i18n.t("Leave this group"));
- putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
+ putValue(TOOLTIP, i18n.t("Do not participate anymore in this group"));
putValue(Action.SMALL_ICON, res.del());
putValue(Action.STYLES, "k-sn-join");
}
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -93,7 +93,7 @@
this.closeCallback = closeCallback;
initWidget(uiBinder.createAndBindUi(this));
if (TextUtils.notEmpty(id)) {
- super.ensureDebugId(id);
+ close.ensureDebugId(id);
}
if (TextUtils.notEmpty(message)) {
if (TextUtils.notEmpty(title)) {
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,7 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<module>
- <inherits name="cc.kune.core.Core" />
- <inherits name='org.ourproject.kune.platf.KunePlatform' />
- <inherits name='org.ourproject.kune.workspace.KuneWorkspace' />
- <source path="client" />
-</module>
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,111 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.gallery.client;
-
-import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_ALBUM;
-import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_ROOT;
-import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_UPLOADEDFILE;
-
-import org.ourproject.kune.gallery.client.cnt.GalleryViewer;
-import org.ourproject.kune.workspace.client.OldAbstractFoldableContentActions;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.editor.ContentEditor;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.upload.FileUploader;
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.core.client.cnt.ContentActionRegistry;
-import cc.kune.core.client.errors.ErrorHandler;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class GalleryClientActions extends OldAbstractFoldableContentActions {
- public GalleryClientActions(final I18nUITranslationService i18n,
- final ContextNavigator contextNavigator, final Session session, final StateManager stateManager,
- final SchedulerManager deferredCommandWrapper,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<FileUploader> fileUploaderProvider,
- final ContentActionRegistry contentActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<ContentEditor> textEditorProvider, final ErrorHandler errorHandler,
- final GalleryViewer documentViewer, final GSpaceBackManager wsBackManager) {
- super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
- contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
- fileDownloadProvider, textEditorProvider, documentViewer, entityLogo, wsBackManager);
- }
-
- @Override
- protected void createActions() {
- final String[] all = { TYPE_ROOT, TYPE_ALBUM, TYPE_UPLOADEDFILE };
- final String[] containers = { TYPE_ROOT, TYPE_ALBUM };
- final String[] contentsModerated = { TYPE_UPLOADEDFILE };
- final String[] containersNoRoot = { TYPE_ALBUM };
- final String[] contents = { TYPE_UPLOADEDFILE };
-
- final String parentMenuTitle = i18n.t("File");
- final String parentMenuTitleCtx = i18n.t("Album");
-
- createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New sub-album"),
- parentMenuTitleCtx, i18n.t("New"), i18n.t("New sub-album"), Position.ctx, TYPE_ALBUM);
- createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New album"),
- parentMenuTitleCtx, i18n.t("New"), i18n.t("New album"), Position.ctx, TYPE_ROOT);
-
- createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
- createContentModeratedActions(parentMenuTitle, contentsModerated);
- createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
-
- // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
- // createSetAsDefContent(parentMenuTitleCtx);
-
- createRefreshCntAction(parentMenuTitle, contents);
- createRefreshCxtAction(parentMenuTitleCtx, containers);
-
- createSetAsDefContent(parentMenuTitle, contents);
- // createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
-
- // createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
- // i18n.t("Upload some files (images, PDFs, ...)"), null, containers);
-
- createDownloadActions(TYPE_UPLOADEDFILE);
-
- createGoAction(all);
-
- createGoHomeAction(containers);
-
- // createTranslateAction(TYPE_ALBUM, TYPE_UPLOADEDFILE);
-
- createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
- createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
- createShowDeletedItems(parentMenuTitleCtx, all);
- }
-
- @Override
- protected void createPostSessionInitActions() {
- super.createUploadMediaAction(TYPE_ALBUM);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.gallery.client;
-
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.tool.OldFoldableAbstractClientTool;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.themes.GSpaceThemeManager;
-import cc.kune.gspace.client.tool.selector.ToolSelector;
-
-public class GalleryClientTool extends OldFoldableAbstractClientTool {
- public static final String NAME = "gallery";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_ALBUM = NAME + "." + "album";
- public static final String TYPE_UPLOADEDFILE = NAME + "." + OldFoldableAbstractClientTool.UPLOADEDFILE_SUFFIX;
-
- public GalleryClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
- final GSpaceThemeManager wsThemePresenter, final WorkspaceSkeleton ws,
- final ContentCapabilitiesRegistry cntCapabReg) {
- super(NAME, i18n.t("gallery"), toolSelector, wsThemePresenter, ws, cntCapabReg);
-
- // registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
- registerAuthorableTypes(TYPE_UPLOADEDFILE);
- registerDragableTypes(TYPE_ALBUM, TYPE_UPLOADEDFILE);
- registerDropableTypes(TYPE_ROOT, TYPE_ALBUM);
- registerPublishModerableTypes(TYPE_UPLOADEDFILE);
- registerRateableTypes(TYPE_UPLOADEDFILE);
- registerRenamableTypes(TYPE_ALBUM, TYPE_UPLOADEDFILE);
- registerTageableTypes(TYPE_UPLOADEDFILE);
- // registerTranslatableTypes();
-
- registerIcons();
- }
-
- public String getName() {
- return NAME;
- }
-
- private void registerIcons() {
- registerContentTypeIcon(TYPE_ALBUM, "images/nav/gallery.png");
- registerUploadTypesAndMimes(TYPE_UPLOADEDFILE);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.gallery.client;
-
-public interface GalleryMessages {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<module>
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name="cc.kune.core.Core" />
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.i18n.I18N' />
- <inherits name="com.google.gwt.user.UserAgent" />
- <inherits name="org.ourproject.kune.platf.RichText" />
- <inherits name="org.ourproject.kune.workspace.KuneWorkspace" />
- <inherits name="com.google.gwt.resources.Resources" />
- <public path="public" />
- <inherits name="com.google.gwt.user.UserAgent" />
- <!-- RTE css inject -->
- <!-- See gwt-user: com/google/gwt/user/RichText.gwt.xml -->
- <!-- IE-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplIE6">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="ie6" />
- <when-property-is name="user.agent" value="ie8" />
- </any>
- </replace-with>
- <!-- Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="gecko1_8" />
- </replace-with>
- <!-- Old Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOldMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="gecko" />
- </replace-with>
- <!-- Safari-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplSafari">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="safari" />
- </any>
- </replace-with>
- <!-- Opera-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplOpera">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="opera" />
- </any>
- </replace-with>
- <inherits name="com.calclab.suco.Suco" />
- <inherits name="com.gwtext.GwtExt" />
-<!-- <inherits name="com.calclab.emiteuimodule.EmiteUIModule" />-->
- <inherits name="org.xwiki.gwt.dom.DOM" />
- <inherits name="com.calclab.suco.Suco"/>
- <source path='client' excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java"/>
-</module>
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,60 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<!-- Copyright 2008 Google Inc. -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
-<!-- may not use this file except in compliance with the License. You may -->
-<!-- may obtain a copy of the License at -->
-<!-- -->
-<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
-<!-- -->
-<!-- Unless required by applicable law or agreed to in writing, software -->
-<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
-<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
-<!-- implied. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-
-<!-- Deferred binding rules for browser selection. -->
-<!-- -->
-<module>
- <inherits name="com.google.gwt.core.Core" />
- <inherits name="com.google.gwt.user.UserAgent" />
-
- <!-- IE-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplIE6">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="ie6" />
- <when-property-is name="user.agent" value="ie8" />
- </replace-with>
-
- <!-- Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="gecko1_8" />
- <when-property-is name="user.agent" value="gecko" />
- </any>
- </replace-with>
-
- <!-- Safari-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplSafari">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="safari" />
- </any>
- </replace-with>
-
- <!-- Opera-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOpera">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="opera" />
- </any>
- </replace-with>
-</module>
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/View.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/View.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/View.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client;
-
-import com.google.gwt.user.client.ui.IsWidget;
-
-/**
- * For make tests without dependencies to gwt. Use casting to use the widget.
- * Use #{@link com.gwtplatform.mvp.client.View} 0r #{@link IsWidget}
- */
-@Deprecated
-public interface View {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-import com.google.gwt.resources.client.ImageResource;
-
-public abstract class AbstractExtendedAction extends OldAbstractAction {
- public static final String NO_TEXT = null;
- public static final ImageResource NO_ICON = null;
-
- public AbstractExtendedAction() {
- super();
- }
-
- public AbstractExtendedAction(final String text) {
- this(text, null, null);
- }
-
- public AbstractExtendedAction(final String text, final ImageResource icon) {
- this(text, null, icon);
- }
-
- public AbstractExtendedAction(final String text, final String tooltip, final ImageResource icon) {
- super();
- super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
- super.putValue(Action.SMALL_ICON, icon);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,159 +0,0 @@
-/* Action.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * Provides a convenient central point of control for some task that can be
- * triggered by more than one control in a Swing user interface (for example, a
- * menu item and a toolbar button).
- *
- * @author Ronald Veldema (rveldema(a)cs.vu.nl)
- * @author Adapted version for GWT (C) The kune development team
- * @author Andrew Selkirk
- */
-public interface Action extends ActionListener {
-
- /**
- * A key to access the default property for the action (this is not used).
- */
- String DEFAULT = "Default";
-
- /**
- * A key to access the long description for the action.
- */
- String LONG_DESCRIPTION = "LongDescription";
-
- /**
- * A key to access the name for the action.
- */
- String NAME = "Name";
-
- /**
- * A key to access the enabled property for the action.
- */
- String ENABLED = "enabled";
-
- /**
- * A key to access the short description for the action (the short
- * description is typically used as the tool tip text).
- */
- String SHORT_DESCRIPTION = "ShortDescription";
-
- /**
- * A key to access the icon for the action.
- */
- String SMALL_ICON = "SmallIcon";
-
- /**
- * A key to access the KeyStroke used as the accelerator for the action.
- */
- String ACCELERATOR_KEY = "AcceleratorKey";
-
- /**
- * A key to access the action command string for the action.
- */
- String ACTION_COMMAND_KEY = "ActionCommandKey";
-
- /**
- * A key to access the mnemonic for the action.
- */
- String MNEMONIC_KEY = "MnemonicKey";
-
- /**
- * Registers a listener to receive notification whenever one of the action's
- * properties is modified.
- *
- * @param listener
- * the listener.
- */
- void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Returns the value associated with the specified key.
- *
- * @param key
- * the key (not <code>null</code>).
- *
- * @return The value associated with the specified key, or <code>null</code>
- * if the key is not found.
- */
- Object getValue(String key);
-
- /**
- * Returns the flag that indicates whether or not this action is enabled.
- *
- * @return The flag.
- */
- boolean isEnabled();
-
- /**
- * Sets the value associated with the specified key and sends a
- * {@link PropertyChangeEvent} to all registered listeners. The standard
- * keys are defined in this interface: {@link #NAME},
- * {@link #SHORT_DESCRIPTION}, {@link #LONG_DESCRIPTION},
- * {@link #SMALL_ICON}, {@link #ACTION_COMMAND_KEY},
- * {@link #ACCELERATOR_KEY} and {@link #MNEMONIC_KEY}. Any existing value
- * associated with the key will be overwritten.
- *
- * @param key
- * the key (not <code>null</code>).
- * @param value
- * the value (<code>null</code> permitted).
- */
- void putValue(String key, Object value);
-
- /**
- * Deregisters a listener so that it no longer receives notification of
- * changes to the action's properties.
- *
- * @param listener
- * the listener.
- */
- void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Sets the flag that indicates whether or not this action is enabled. If
- * the value changes, a {@link java.beans.PropertyChangeEvent} is sent to
- * all registered listeners.
- *
- * @param b
- * the new value of the flag.
- */
- void setEnabled(boolean b);
-
-} // Action
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-public interface ActionAddCondition<T> {
- boolean mustBeAdded(T param);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-public interface ActionCheckedCondition {
- boolean mustBeChecked();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.ArrayList;
-
-@Deprecated
-public class ActionCollection<T> extends ArrayList<ActionDescriptor<T>> {
-
- private static final long serialVersionUID = -3308296009308246636L;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,501 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
-
-import cc.kune.core.client.services.ImageDescriptor;
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-/**
- * The Class ActionDescriptor.
- */
-@Deprecated
-public class ActionDescriptor<T> {
-
- public static final int NO_POSITION = -1;
-
- /** The access rol. */
- private AccessRolDTO accessRol;
-
- /** The must be added condition. */
- private ActionAddCondition<T> addCondition;
-
- /** The confirmation text. */
- private String confirmationText;
-
- /** The confirmation title. */
- private String confirmationTitle;
-
- /** The enable condition. */
- private ActionEnableCondition<T> enableCondition;
-
- /** The icon cls. */
- private String iconCls;
-
- /** The icon descriptor. */
- private ImageDescriptor iconDescriptor;
-
- /** The icon url. */
- private String iconUrl;
-
- /** The id. */
- private String id;
-
- /** The must be authenticated. */
- private boolean mustBeAuthenticated;
-
- /** The must be confirmed. */
- private boolean mustBeConfirmed;
-
- /** The on not confirmed. */
- private Listener<T> onNotConfirmed;
-
- /** The on perform call. */
- private final Listener<T> onPerformCall;
-
- private int position = NO_POSITION;
-
- private ShortcutDescriptor shortcut;
-
- /** The text description. */
- private String textDescription;
-
- /** The tool tip. */
- private String toolTip;
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall) {
- this.accessRol = accessRolDTO;
- this.onPerformCall = onPerformCall;
- this.mustBeConfirmed = false;
- this.onNotConfirmed = null;
- this.mustBeAuthenticated = true;
- }
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall,
- final ActionAddCondition<T> addCondition) {
- this(accessRolDTO, onPerformCall);
- this.addCondition = addCondition;
- }
-
- /**
- * Instantiates a new action descriptor.
- *
- * @param accessRolDTO
- * the access rol dto
- * @param onPerformCall
- * the on perform call
- * @param enableCondition
- * the enable condition
- */
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- this(accessRolDTO, onPerformCall);
- this.enableCondition = enableCondition;
- }
-
- /**
- * Instantiates a new action descriptor.
- *
- * @param accessRolDTO
- * the access rol dto
- * @param onPerformCall
- * the on perform call
- */
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener0 onPerformCall) {
- this(accessRolDTO, new Listener<T>() {
- @Override
- public void onEvent(final T parameter) {
- onPerformCall.onEvent();
- }
- });
- }
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener0 onPerformCall,
- final ActionAddCondition<T> addCondition) {
- this(accessRolDTO, onPerformCall);
- this.addCondition = addCondition;
- }
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener0 onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- this(accessRolDTO, onPerformCall);
- this.enableCondition = enableCondition;
- }
-
- public ActionDescriptor(final ActionDescriptor<T> copy) {
- this(copy.getAccessRol(), copy.getOnPerformCall());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setAddCondition(copy.getAddCondition());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:22
- setConfirmationText(copy.getConfirmationText());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:22
- setConfirmationTitle(copy.getConfirmationTitle());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setEnableCondition(copy.getEnableCondition());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setIconCls(copy.getIconCls());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setIconDescriptor(copy.getIconDescriptor());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setIconUrl(copy.getIconUrl());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setMustBeAuthenticated(copy.mustBeAuthenticated());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setMustBeConfirmed(copy.mustBeConfirmed());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setOnNotConfirmed(copy.getOnNotConfirmed());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setPosition(copy.getPosition());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setShortcut(copy.getShortcut());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setTextDescription(copy.getTextDescription());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setToolTip(copy.getToolTip());
- }
-
- /**
- * Fire on not confirmed.
- *
- * @param parameter
- * the parameter
- */
- @SuppressWarnings("unchecked")
- public void fireOnNotConfirmed(final Object parameter) {
- if (onNotConfirmed != null) {
- onNotConfirmed.onEvent((T) parameter);
- }
- }
-
- /**
- * Fire on perform call.
- *
- * @param parameter
- * the parameter
- */
- @SuppressWarnings("unchecked")
- public void fireOnPerformCall(final Object parameter) {
- onPerformCall.onEvent((T) parameter);
- }
-
- /**
- * Gets the access rol.
- *
- * @return the access rol
- */
- public AccessRolDTO getAccessRol() {
- return accessRol;
- }
-
- private ActionAddCondition<T> getAddCondition() {
- return addCondition;
- }
-
- /**
- * Gets the confirmation text.
- *
- * @return the confirmation text
- */
- public String getConfirmationText() {
- return confirmationText;
- }
-
- /**
- * Gets the confirmation title.
- *
- * @return the confirmation title
- */
- public String getConfirmationTitle() {
- return confirmationTitle;
- }
-
- private ActionEnableCondition<T> getEnableCondition() {
- return enableCondition;
- }
-
- public String getIconCls() {
- return iconCls;
- }
-
- /**
- * Gets the icon descriptor.
- *
- * @return the icon descriptor
- */
- public ImageDescriptor getIconDescriptor() {
- return iconDescriptor;
- }
-
- /**
- * Gets the icon url.
- *
- * @return the icon url
- */
- public String getIconUrl() {
- return iconUrl;
- }
-
- /**
- * Gets the DOM unique id (used for debug)
- *
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- private Listener<T> getOnNotConfirmed() {
- return onNotConfirmed;
- }
-
- private Listener<T> getOnPerformCall() {
- return onPerformCall;
- }
-
- /**
- * Get the index position where this action will be inserted
- *
- * @param position
- */
- public int getPosition() {
- return position;
- }
-
- public ShortcutDescriptor getShortcut() {
- return shortcut;
- }
-
- public String getShortcutToS() {
- return shortcut == null ? "" : shortcut.toString();
- }
-
- /**
- * Gets the text.
- *
- * @return the text
- */
- public String getText() {
- return textDescription;
- }
-
- private String getTextDescription() {
- return textDescription;
- }
-
- /**
- * Gets the tool tip.
- *
- * @return the tool tip
- */
- public String getToolTip() {
- return toolTip;
- }
-
- public boolean hasShortcut() {
- return shortcut != null;
- }
-
- public boolean mustBeAdded(final T item) {
- return addCondition != null ? addCondition.mustBeAdded(item) : true;
- }
-
- /**
- * Must be authenticated.
- *
- * @return true, if successful
- */
- public boolean mustBeAuthenticated() {
- return mustBeAuthenticated;
- }
-
- /**
- * Checks if is must be confirmed.
- *
- * @return true, if is must be confirmed
- */
- public boolean mustBeConfirmed() {
- return mustBeConfirmed;
- }
-
- public boolean mustBeEnabled(final T item) {
- return enableCondition != null ? enableCondition.mustBeEnabled(item) : true;
- }
-
- /**
- * Sets the access rol.
- *
- * @param accessRol
- * the new access rol
- */
- public void setAccessRol(final AccessRolDTO accessRol) {
- this.accessRol = accessRol;
- }
-
- /**
- * Sets the add condition.
- *
- * @param addCondition
- * the new add condition
- */
- public void setAddCondition(final ActionAddCondition<T> addCondition) {
- this.addCondition = addCondition;
- }
-
- /**
- * Sets the confirmation text.
- *
- * @param confirmationText
- * the new confirmation text
- */
- public void setConfirmationText(final String confirmationText) {
- this.confirmationText = confirmationText;
- }
-
- /**
- * Sets the confirmation title.
- *
- * @param confirmationTitle
- * the new confirmation title
- */
- public void setConfirmationTitle(final String confirmationTitle) {
- this.confirmationTitle = confirmationTitle;
- }
-
- /**
- * Sets the enable condition.
- *
- * @param enableCondition
- * the new enable condition
- */
- public void setEnableCondition(final ActionEnableCondition<T> enableCondition) {
- this.enableCondition = enableCondition;
- }
-
- public void setIconCls(final String iconCls) {
- this.iconCls = iconCls;
- }
-
- /**
- * Sets the icon descriptor.
- *
- * @param iconDescriptor
- * the new icon descriptor
- */
- public void setIconDescriptor(final ImageDescriptor iconDescriptor) {
- this.iconDescriptor = iconDescriptor;
- }
-
- /**
- * Sets the icon url.
- *
- * @param iconUrl
- * the new icon url
- */
- public void setIconUrl(final String iconUrl) {
- this.iconUrl = iconUrl;
- }
-
- /**
- * Sets the DOM unique id (used for debug)
- *
- * @param id
- * the new id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * Sets the must be authenticated.
- *
- * @param mustBeAuthenticated
- * the new must be authenticated
- */
- public void setMustBeAuthenticated(final boolean mustBeAuthenticated) {
- this.mustBeAuthenticated = mustBeAuthenticated;
- }
-
- /**
- * Sets the must be confirmed.
- *
- * @param mustBeConfirmed
- * the new must be confirmed
- */
- public void setMustBeConfirmed(final boolean mustBeConfirmed) {
- this.mustBeConfirmed = mustBeConfirmed;
- }
-
- private void setOnNotConfirmed(final Listener<T> onNotConfirmed) {
- this.onNotConfirmed = onNotConfirmed;
- }
-
- /**
- * Index position where this action will be inserted
- *
- * @param position
- */
- public void setPosition(final int position) {
- this.position = position;
- }
-
- public void setShortcut(final ShortcutDescriptor shortcut) {
- this.shortcut = shortcut;
- }
-
- /**
- * Sets the text description.
- *
- * @param textDescription
- * the new text description
- */
- public void setTextDescription(final String textDescription) {
- this.textDescription = textDescription;
- }
-
- /**
- * Sets the tool tip.
- *
- * @param toolTip
- * the new tool tip
- */
- public void setToolTip(final String toolTip) {
- this.toolTip = toolTip;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-public interface ActionEnableCondition<T> {
- boolean mustBeEnabled(T param);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,69 +0,0 @@
-/* ActionEvent.java -- an action has been triggered
- Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import com.google.gwt.user.client.Event;
-
-/**
- * This event is generated when an action on a component (such as a button
- * press) occurs.
- *
- * @author Aaron M. Renn (arenn(a)urbanophile.com)
- * @author Adapted version for GWT (C) The kune development team
- * @see ActionListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class ActionEvent {
-
- private final Event event;
- private final Object source;
-
- public ActionEvent(final Object source, final Event event) {
- this.source = source;
- this.event = event;
- }
-
- public Event getEvent() {
- return event;
- }
-
- public Object getSource() {
- return source;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import com.allen_sauer.gwt.log.client.Log;
-
-/**
- * And action description and a item (for instance a StateToken, a XmmpURI) over
- * the action takes place
- *
- * @param <T>
- */
-public class ActionItem<T> {
-
- ActionDescriptor<T> action;
- T item;
-
- public ActionItem(final ActionDescriptor<T> action, final T item) {
- this.action = action;
- this.item = item;
- }
-
- public ActionDescriptor<T> getAction() {
- return action;
- }
-
- public T getItem() {
- return item;
- }
-
- public boolean mustBeAdded() {
- return action.mustBeAdded(getItem());
- }
-
- public boolean mustBeEnabled() {
- return action.mustBeEnabled(getItem());
- }
-
- public boolean mustBePressed() {
- if (action instanceof ActionToolbarPushButtonDescriptor<?>) {
- final ActionPressedCondition<T> mustIniPressed = ((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed();
- return mustIniPressed == null ? false : mustIniPressed.mustBePressed(getItem());
- } else {
- Log.error("This action is not a push button");
- return false;
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class ActionItemCollection<T> extends ArrayList<ActionItem<T>> {
-
- private static final long serialVersionUID = 1127359948648860754L;
-
- @Override
- public boolean add(final ActionItem<T> actionItem) {
- ActionDescriptor<T> action = actionItem.getAction();
- int position = action.getPosition();
- if (position == ActionDescriptor.NO_POSITION) {
- super.add(actionItem);
- } else {
- try {
- super.add(position, actionItem);
- return true;
- } catch (IndexOutOfBoundsException e) {
- Log.error("Trying to add an action in a position out of bounds");
- super.add(actionItem);
- }
- }
- return false;
- }
-
- @Override
- public boolean addAll(final Collection<? extends ActionItem<T>> actionItems) {
- for (ActionItem<T> actionItem : actionItems) {
- add(actionItem);
- }
- return true;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,57 +0,0 @@
-/* ActionListener.java -- listens for action events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * This interface is for classes that listen for action events.
- *
- * @author Aaron M. Renn (arenn(a)urbanophile.com)
- * @author Adapted version for GWT (C) The kune development team
- * @see ActionEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface ActionListener extends EventListener {
- /**
- * This method is invoked when an action occurs.
- *
- * @param event
- * the <code>ActionEvent</code> that occurred
- */
- void actionPerformed(ActionEvent event);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionManager {
-
- public ActionManager() {
- }
-
- public void doAction(final ActionItem<?> actionItem) {
- final ActionDescriptor<?> action = actionItem.getAction();
- final Object item = actionItem.getItem();
- if (action.mustBeConfirmed()) {
- OldNotifyUser.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() {
- public void onEvent() {
- fire(action, item);
- }
- }, new Listener0() {
- public void onEvent() {
- action.fireOnNotConfirmed(item);
- }
- });
- } else {
- fire(action, item);
- }
- }
-
- private void fire(final ActionDescriptor<?> action, final Object parameter) {
- action.fireOnPerformCall(parameter);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-
-public class ActionMenuItemDescriptor<T> extends ActionDescriptor<T> {
-
- public ActionMenuItemDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall) {
- super(accessRolDTO, onPerformCall);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-public interface ActionPressedCondition<T> {
- boolean mustBePressed(T param);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,116 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-import cc.kune.core.shared.domain.utils.AccessRights;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class ActionRegistry<T> {
- private static final String GENERIC = "kgenacts";
-
- private final HashMap<String, ActionCollection<T>> actions;
-
- public ActionRegistry() {
- actions = new HashMap<String, ActionCollection<T>>();
- }
-
- public void addAction(final ActionDescriptor<T> action) {
- addAction(action, GENERIC);
- }
-
- public void addAction(final ActionDescriptor<T> action, final String... typeIds) {
- assert action != null;
- for (final String typeId : typeIds) {
- String text = action.getText();
- Log.debug("Registering action " + (text == null ? "with icon" : "'" + text + "'") + " for " + typeId);
- final ActionCollection<T> actionColl = getActions(typeId);
- actionColl.add(action);
- }
- }
-
- public ActionItemCollection<T> getCurrentActions(final T item, final boolean isLogged, final AccessRights rights,
- final boolean toolbarItems) {
- return getCurrentActions(item, GENERIC, isLogged, rights, toolbarItems);
- }
-
- public ActionItemCollection<T> getCurrentActions(final T item, final String typeId, final boolean isLogged,
- final AccessRights rights, final boolean toolbarItems) {
- final ActionItemCollection<T> collection = new ActionItemCollection<T>();
-
- for (final ActionDescriptor<T> action : getActions(typeId)) {
- if (mustAdd(isLogged, rights, action)) {
- if (toolbarItems) {
- if (action instanceof ActionToolbarButtonDescriptor<?>
- || action instanceof ActionToolbarMenuDescriptor<?>) {
- collection.add(new ActionItem<T>(action, item));
- }
- } else {
- if (action instanceof ActionMenuItemDescriptor<?>
- || action instanceof ActionToolbarMenuAndItemDescriptor<?>
- || action instanceof ActionToolbarButtonAndItemDescriptor<?>) {
- collection.add(new ActionItem<T>(action, item));
- }
- }
- }
- }
- return collection;
- }
-
- public void removeAction(final ActionDescriptor<T> action) {
- removeAction(GENERIC, action);
- }
-
- public void removeAction(final String typeId, final ActionDescriptor<T> action) {
- actions.get(typeId).remove(action);
- }
-
- public int size() {
- return actions.size();
- }
-
- private ActionCollection<T> getActions(final String typeId) {
- ActionCollection<T> actionColl = actions.get(typeId);
- if (actionColl == null) {
- actionColl = new ActionCollection<T>();
- actions.put(typeId, actionColl);
- }
- return actionColl;
- }
-
- private boolean mustAdd(final boolean isLogged, final AccessRights rights, final ActionDescriptor<T> action) {
- if (action.mustBeAuthenticated()) {
- if (!isLogged) {
- return false;
- }
- }
- switch (action.getAccessRol()) {
- case Administrator:
- return rights.isAdministrable();
- case Editor:
- return rights.isEditable();
- case Viewer:
- default:
- return rights.isVisible();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarButtonAndItemDescriptor<T> extends ActionToolbarButtonDescriptor<T> {
-
- public ActionToolbarButtonAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarButtonAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,91 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarButtonDescriptor<T> extends ActionToolbarDescriptor<T> {
-
- private ActionToolbarButtonSeparator leftSeparator;
- private ActionToolbarButtonSeparator rightSeparator;
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
- final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
- final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarButtonSeparator getLeftSeparator() {
- return leftSeparator;
- }
-
- public ActionToolbarButtonSeparator getRightSeparator() {
- return rightSeparator;
- }
-
- public boolean hasLeftSeparator() {
- return leftSeparator != null;
- }
-
- public boolean hasRightSeparator() {
- return rightSeparator != null;
- }
-
- public void setLeftSeparator(final ActionToolbarButtonSeparator leftSeparator) {
- this.leftSeparator = leftSeparator;
- }
-
- public void setRightSeparator(final ActionToolbarButtonSeparator rightSeparator) {
- this.rightSeparator = rightSeparator;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-public enum ActionToolbarButtonSeparator {
- spacer, separator, fill
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,85 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public abstract class ActionToolbarDescriptor<T> extends ActionDescriptor<T> {
-
- private ActionToolbarPosition actionToolbarPosition;
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener<T> onPerformCall) {
- super(accessRolDTO, onPerformCall);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener<T> onPerformCall, final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, onPerformCall, addCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener<T> onPerformCall, final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, onPerformCall, enableCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener0 onPerformCall) {
- super(accessRolDTO, onPerformCall);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener0 onPerformCall, final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, onPerformCall, addCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener0 onPerformCall, final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, onPerformCall, enableCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final ActionDescriptor<T> copy) {
- super(copy);
- }
-
- public ActionToolbarDescriptor(final ActionToolbarDescriptor<T> copy) {
- super(copy);
- this.actionToolbarPosition = copy.getActionPosition();
- }
-
- public ActionToolbarPosition getActionPosition() {
- return actionToolbarPosition;
- }
-
- public void setActionPosition(final ActionToolbarPosition actionToolbarPosition) {
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarMenuAndItemDescriptor<T> extends ActionToolbarMenuDescriptor<T> {
-
- public ActionToolbarMenuAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarMenuAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarMenuCheckItemDescriptor<T> extends ActionToolbarMenuDescriptor<T> {
-
- private final ActionCheckedCondition mustBeChecked;
-
- public ActionToolbarMenuCheckItemDescriptor(final AccessRolDTO accessRol,
- final ActionToolbarPosition toolbarPosition, final Listener0 onPerformCall,
- final ActionCheckedCondition mustBeChecked) {
- super(accessRol, toolbarPosition, onPerformCall);
- this.mustBeChecked = mustBeChecked;
- }
-
- public ActionCheckedCondition getMustBeChecked() {
- return mustBeChecked;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,123 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarMenuDescriptor<T> extends ActionToolbarDescriptor<T> {
-
- private String parentMenuTitle;
- private String parentMenuIconUrl;
- private String parentMenuIconCls;
- private String parentSubMenuTitle;
- private String parentMenuTooltip;
- private boolean topSeparator = false;
- private boolean bottomSeparator = false;
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarMenuDescriptor(final ActionDescriptor<T> copy) {
- super(copy);
- }
-
- public String getParentMenuIconCls() {
- return parentMenuIconCls;
- }
-
- public String getParentMenuIconUrl() {
- return parentMenuIconUrl;
- }
-
- public String getParentMenuTitle() {
- return parentMenuTitle;
- }
-
- public String getParentMenuTooltip() {
- return parentMenuTooltip;
- }
-
- public String getParentSubMenuTitle() {
- return parentSubMenuTitle;
- }
-
- public boolean hasBottomSeparator() {
- return bottomSeparator;
- }
-
- public boolean hasTopSeparator() {
- return topSeparator;
- }
-
- public void setBottomSeparator(final boolean bottomSeparator) {
- this.bottomSeparator = bottomSeparator;
- }
-
- public void setParentMenuIconCls(final String parentMenuIconCls) {
- this.parentMenuIconCls = parentMenuIconCls;
- }
-
- public void setParentMenuIconUrl(final String parentMenuIconUrl) {
- this.parentMenuIconUrl = parentMenuIconUrl;
- }
-
- public void setParentMenuTitle(final String parentMenuTitle) {
- this.parentMenuTitle = parentMenuTitle;
- }
-
- public void setParentMenuTooltip(final String parentMenuTooltip) {
- this.parentMenuTooltip = parentMenuTooltip;
- }
-
- public void setParentSubMenuTitle(final String parentSubMenuTitle) {
- if (parentMenuTitle == null) {
- Log.warn("Please set parentMenuTitle before");
- }
- this.parentSubMenuTitle = parentSubMenuTitle;
- }
-
- public void setTopSeparator(final boolean topSeparator) {
- this.topSeparator = topSeparator;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-
-public class ActionToolbarMenuRadioDescriptor<T> extends ActionToolbarMenuDescriptor<T> {
- private final String group;
- private final RadioMustBeChecked mustBeChecked;
-
- public ActionToolbarMenuRadioDescriptor(final AccessRolDTO accessRol, final ActionToolbarPosition toolbarPosition,
- final Listener<T> onPerformCall, final String group, final RadioMustBeChecked mustBeChecked) {
- super(accessRol, toolbarPosition, onPerformCall);
- this.group = group;
- this.mustBeChecked = mustBeChecked;
- }
-
- public String getGroup() {
- return group;
- }
-
- public boolean mustBeChecked() {
- return mustBeChecked.mustBeChecked();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-public class ActionToolbarPosition {
-
- private final String id;
-
- public ActionToolbarPosition(final String id) {
- this.id = id;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ActionToolbarPosition other = (ActionToolbarPosition) obj;
- if (id == null) {
- if (other.id != null) {
- return false;
- }
- } else if (!id.equals(other.id)) {
- return false;
- }
- return true;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarPushButtonDescriptor<T> extends ActionToolbarButtonDescriptor<T> {
-
- private ActionPressedCondition<T> mustInitialyPressed;
-
- public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionPressedCondition<T> getMustInitialyPressed() {
- return mustInitialyPressed;
- }
-
- public void setMustInitialyPressed(final ActionPressedCondition<T> mustInitialyPressed) {
- this.mustInitialyPressed = mustInitialyPressed;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,135 +0,0 @@
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-/**
- * A base class for implementing the {@link Action} interface.
- *
- * @author Andrew Selkirk
- * @author Adapted version for GWT (C) The kune development team
- */
-public class ChangebleObject {
-
- /**
- * Provides support for property change event notification.
- */
- protected PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
- /**
- * store
- */
- protected HashMap<String, Object> store = new HashMap<String, Object>();
-
- /**
- * Registers a listener to receive {@link PropertyChangeEvent} notifications
- * from this action.
- *
- * @param listener
- * the listener.
- *
- * @see #removePropertyChangeListener(PropertyChangeListener)
- */
- public void addPropertyChangeListener(final PropertyChangeListener listener) {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * Returns an array of the keys for the property values that have been
- * defined via the {@link #putValue(String, Object)} method (or the class
- * constructor).
- *
- * @return An array of keys.
- */
- public Object[] getKeys() {
- return store.keySet().toArray();
- }
-
- /**
- * Returns all registered listeners.
- *
- * @return An array of listeners.
- *
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners() {
- return changeSupport.getPropertyChangeListeners();
- }
-
- /**
- * Returns the value associated with the specified key.
- *
- * @param key
- * the key (not <code>null</code>).
- *
- * @return The value associated with the specified key, or <code>null</code>
- * if the key is not found.
- *
- * @see #putValue(String, Object)
- */
- public Object getValue(final String key) {
- return store.get(key);
- }
-
- /**
- * Sets the value associated with the specified key and sends a
- * {@link java.beans.PropertyChangeEvent} to all registered listeners.
- *
- * Any existing value associated with the key will be overwritten.
- *
- * @param key
- * the key (not <code>null</code>).
- * @param value
- * the value (<code>null</code> permitted).
- */
- public void putValue(final String key, final Object value) {
- final Object old = getValue(key);
- if ((old == null && value != null) || (old != null && !old.equals(value))) {
- store.put(key, value);
- firePropertyChange(key, old, value);
- }
- }
-
- /**
- * Deregisters a listener so that it no longer receives
- * {@link PropertyChangeEvent} notifications from this action.
- *
- * @param listener
- * the listener.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public void removePropertyChangeListener(final PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Sends a {@link PropertyChangeEvent} for the named property to all
- * registered listeners. This private method is called by the
- * {@link #setEnabled(boolean)} method.
- *
- * @param propertyName
- * the property name.
- * @param oldValue
- * the old value of the property.
- * @param newValue
- * the new value of the property.
- */
- protected void firePropertyChange(final String propertyName, final boolean oldValue, final boolean newValue) {
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * Sends a {@link PropertyChangeEvent} for the named property to all
- * registered listeners.
- *
- * @param propertyName
- * the property name.
- * @param oldValue
- * the old value of the property.
- * @param newValue
- * the new value of the property.
- */
- protected void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) {
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,53 +0,0 @@
-/* EventListener.java -- tagging interface for all event listeners
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * Empty interface that is implemented by classes that need to receive events.
- * Subinterfaces define methods that can be called to fire an event
- * notification. Normally the name of these subinterfaces end in
- * <code>Listener</code> and all method described by the subinterface take as
- * argument an subclass of <code>EventObject</code>.
- *
- * @author Tom Tromey (tromey(a)cygnus.com)
- * @author Adapted version for GWT (C) The kune development team
- * @see EventObject
- * @status updated to 1.4
- */
-public interface EventListener {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,74 +0,0 @@
-/* EventListenerProxy.java -- abstract wrapper for event listeners
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * An abstract wrapper for event listeners. This allows subclasses to attach
- * additional parameters to an existing event listener to create a new one.
- * Subclasses are expected to add methods to set and retrieve any attached
- * properties.
- *
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- *
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class EventListenerProxy implements EventListener {
- /** The listener that this proxy wraps. */
- private final EventListener listener;
-
- /**
- * Construct a proxy event listener, given an existing one to augment.
- *
- * @param listener
- * the listener to wrap
- */
- public EventListenerProxy(final EventListener listener) {
- this.listener = listener;
- }
-
- /**
- * Return the wrapped event listener.
- *
- * @return the listener associated with this proxy
- */
- public EventListener getListener() {
- return listener;
- }
-} // class EventListenerProxy
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,235 +0,0 @@
-/* InputMap.java --
- Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Maps {@link KeyStroke}s to arbitrary objects, usually Strings. This is used
- * in combination with ActionMaps.
- *
- * If a component receives an input event, this is looked up in the component's
- * <code>InputMap</code>. The result is an object which serves as a key to the
- * component's <code>ActionMap</code>. Finally the <code>Action</code> that is
- * stored is executed.
- *
- * @author Andrew Selkirk
- * @author Michael Koch
- * @author Adapted version for GWT (C) The kune development team
- *
- * @since 1.3
- */
-public class InputMap {
-
- /**
- * Storage for the KeyStroke --> Object mappings.
- */
- private Map<KeyStroke, OldAbstractAction> inputMap;
-
- /**
- * An optional parent map.
- */
- private InputMap parent;
-
- /**
- * Creates a new <code>InputMap</code> instance. This default instance
- * contains no mappings and has no parent.
- */
- public InputMap() {
- // nothing to do
- }
-
- /**
- * Returns all keys of entries in this <code>InputMap</code> and all its
- * parents.
- *
- * @return An array of keys (may be <code>null</code> or have zero length).
- */
- public KeyStroke[] allKeys() {
- final Set<KeyStroke> set = new HashSet<KeyStroke>();
-
- if (parent != null) {
- final KeyStroke[] parentKeys = parent.allKeys();
- if (parentKeys != null) {
- set.addAll(Arrays.asList(parentKeys));
- }
- }
- if (inputMap != null) {
- set.addAll(inputMap.keySet());
- }
- if (set.isEmpty()) {
- return null;
- }
- final KeyStroke[] array = new KeyStroke[set.size()];
- return set.toArray(array);
- }
-
- /**
- * Clears the entries from this <code>InputMap</code>. The parent map, if
- * there is one, is not cleared.
- */
- public void clear() {
- if (inputMap != null) {
- inputMap.clear();
- }
- }
-
- /**
- * Returns the binding for the specified keystroke, if there is one.
- *
- * @param keystroke
- * the key of the entry (<code>null</code> is ignored).
- *
- * @return The binding associated with the specified keystroke (or
- * <code>null</code>).
- */
- public OldAbstractAction get(final KeyStroke keystroke) {
- OldAbstractAction result = null;
- if (inputMap != null) {
- result = inputMap.get(keystroke);
- }
-
- if (result == null && parent != null) {
- result = parent.get(keystroke);
- }
- return result;
- }
-
- /**
- * Returns the parent of this <code>InputMap</code>. The default value is
- * <code>null</code>.
- *
- * @return The parent map (possibly <code>null</code>).
- *
- * @see #setParent(InputMap)
- */
- public InputMap getParent() {
- return parent;
- }
-
- /**
- * Returns all keys of entries in this <code>InputMap</code>. This does not
- * include keys defined in the parent, if there is one (use the
- * {@link #allKeys()} method for that case). <br>
- * <br>
- * Following the behaviour of the reference implementation, this method will
- * return <code>null</code> when no entries have been added to the map, and
- * a zero length array if entries have been added but subsequently removed
- * (or cleared) from the map.
- *
- * @return An array of keys (may be <code>null</code> or have zero length).
- */
- // @PMD:REVIEWED:ReturnEmptyArrayRatherThanNull: by vjrj on 21/05/09 15:33
- public KeyStroke[] keys() {
- if (inputMap != null) {
- final KeyStroke[] array = new KeyStroke[size()];
- return inputMap.keySet().toArray(array);
- }
- return null;
- }
-
- /**
- * Puts a new entry into the <code>InputMap</code>. If
- * <code>actionMapKey</code> is <code>null</code> any existing entry will be
- * removed.
- *
- * @param keystroke
- * the keystroke for the entry (<code>null</code> is ignored).
- * @param actionMapKey
- * the action (<code>null</code> permitted).
- */
- public void put(final KeyStroke keystroke, final OldAbstractAction actionMapKey) {
- if (keystroke == null) {
- return;
- }
- if (inputMap == null) {
- inputMap = new HashMap<KeyStroke, OldAbstractAction>();
- }
- if (actionMapKey == null) {
- inputMap.remove(keystroke);
- } else {
- inputMap.put(keystroke, actionMapKey);
- }
- }
-
- /**
- * Removes an entry from this <code>InputMap</code>. Note that this will not
- * remove any entry from the parent map, if there is one.
- *
- * @param keystroke
- * the key of the entry to remove (<code>null</code> is ignored).
- */
- public void remove(final KeyStroke keystroke) {
- if (inputMap != null) {
- inputMap.remove(keystroke);
- }
- }
-
- /**
- * Sets a parent for this <code>InputMap</code>. If a parent is specified,
- * the {@link #get(KeyStroke)} method will look in the parent if it cannot
- * find an entry in this map.
- *
- * @param parentMap
- * the new parent (<code>null</code> permitted).
- *
- * @see #getParent()
- */
- public void setParent(final InputMap parentMap) {
- parent = parentMap;
- }
-
- /**
- * Returns the number of entries in this <code>InputMap</code>. This count
- * does not include any entries from the parent map, if there is one.
- *
- * @return The number of entries.
- */
- public int size() {
- int result = 0;
- if (inputMap != null) {
- result = inputMap.size();
- }
- return result;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,535 +0,0 @@
-/* AWTKeyStroke.java -- an immutable key stroke
- Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.ourproject.kune.platf.client.i18n.Resources;
-import org.ourproject.kune.platf.client.shortcuts.Keyboard;
-
-import com.google.gwt.dom.client.NativeEvent;
-import com.google.gwt.event.dom.client.KeyCodes;
-import com.google.gwt.event.dom.client.KeyEvent;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Event;
-
-/**
- * This class mirrors KeyEvents, representing both low-level key presses and key
- * releases, and high level key typed inputs. However, this class forms
- * immutable strokes, and can be efficiently reused via the factory methods for
- * creating them.
- *
- * <p>
- * For backwards compatibility with Swing, this supports a way to build
- * instances of a subclass, using reflection, provided the subclass has a no-arg
- * constructor (of any accessibility).
- *
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Andrew John Hughes (gnu_andrew(a)member.fsf.org)
- * @author Adapted version for GWT (C) The kune development team
- * @see #getKeyStroke(char)
- * @since 1.4
- * @status updated to 1.4
- */
-public class KeyStroke {
-
- /**
- * The cache of recently created keystrokes. This maps KeyStrokes to
- * KeyStrokes in a cache which removes the least recently accessed entry,
- * under the assumption that garbage collection of a new keystroke is easy
- * when we find the old one that it matches in the cache.
- */
- private static final Map<KeyStroke, KeyStroke> CACHE = new HashMap<KeyStroke, KeyStroke>();
-
- /** The most recently generated keystroke, or null. */
- private static KeyStroke recent;
-
- /**
- * A table of keyCode names to values. This is package-private to avoid an
- * accessor method.
- *
- * @see #getKeyStroke(String)
- */
- static final Map<String, Object> VKTABLE = new HashMap<String, Object>();
-
- private static final int VK_UNDEFINED = 0;
- private static final char CHAR_UNDEFINED = '\uffff';
-
- public static int getKeyboardModifiers(final NativeEvent event) {
- return (event.getShiftKey() ? Keyboard.MODIFIER_SHIFT : 0) | (event.getMetaKey() ? Keyboard.MODIFIER_META : 0)
- | (event.getCtrlKey() ? Keyboard.MODIFIER_CTRL : 0) | (event.getAltKey() ? Keyboard.MODIFIER_ALT : 0);
- }
-
- /**
- * Returns a keystroke representing a typed character.
- *
- * @param keyChar
- * the typed character
- * @return the specified keystroke
- */
- public static KeyStroke getKeyStroke(final char keyChar) {
- return getKeyStroke(keyChar, VK_UNDEFINED, 0, false);
- }
-
- /**
- * Returns a keystroke representing a typed character with the given
- * modifiers. Note that keyChar is a <code>Character</code> instead of a
- * <code>char</code> to avoid accidental ambiguity with
- * <code>getKeyStroke(int, int)</code>. The modifiers are the bitwise or of
- * the masks found in InputEvent; the new style (*_DOWN_MASK) is preferred,
- * but the old style will work.
- *
- * @param keyChar
- * the typed character
- * @param modifiers
- * the modifiers, or 0
- * @return the specified keystroke
- * @throws IllegalArgumentException
- * if keyChar is null
- */
- public static KeyStroke getKeyStroke(final Character keyChar, final int modifiers) {
- if (keyChar == null) {
- throw new IllegalArgumentException();
- }
- return getKeyStroke(keyChar.charValue(), VK_UNDEFINED, modifiers, false);
- }
-
- /**
- * Returns a keystroke representing a pressed key event, with the given
- * modifiers. The "virtual key" should be one of the VK_* constants in
- * {@link KeyEvent}. The modifiers are the bitwise or of the masks found in
- * InputEvent; the new style (*_DOWN_MASK) is preferred, but the old style
- * will work.
- *
- * @param keyCode
- * the virtual key
- * @param modifiers
- * the modifiers, or 0
- * @return the specified keystroke
- */
- public static KeyStroke getKeyStroke(final int keyCode, final int modifiers) {
- return getKeyStroke(CHAR_UNDEFINED, keyCode, modifiers, false);
- }
-
- /**
- * Returns a keystroke representing a pressed or released key event, with
- * the given modifiers. The "virtual key" should be one of the VK_*
- * constants in {@link KeyEvent}. The modifiers are the bitwise or of the
- * masks found in InputEvent; the new style (*_DOWN_MASK) is preferred, but
- * the old style will work.
- *
- * @param keyCode
- * the virtual key
- * @param modifiers
- * the modifiers, or 0
- * @param release
- * true if this is a key release instead of a key press
- * @return the specified keystroke
- */
- public static KeyStroke getKeyStroke(final int keyCode, final int modifiers, final boolean release) {
- return getKeyStroke(CHAR_UNDEFINED, keyCode, modifiers, release);
- }
-
- /**
- * Returns a keystroke representing what caused the key event.
- *
- * @param event
- * the key event to convert
- * @return the specified keystroke, or null if the event is invalid
- * @throws NullPointerException
- * if event is null
- */
- public static KeyStroke getKeyStrokeForEvent(final Event event) {
- final int eventModif = getKeyboardModifiers(event);
- final int eventKeyCode = event.getKeyCode();
- // Log.info("key: " + eventKeyCode + " modifier: " + eventModif);
- switch (DOM.eventGetType(event)) {
- case Event.ONKEYDOWN:
- return getKeyStroke(CHAR_UNDEFINED, eventKeyCode, eventModif, false);
- case Event.ONKEYPRESS:
- final char charac = (char) eventKeyCode;
- return getKeyStroke(Character.isLowerCase(charac) ? Character.toUpperCase(charac) : charac, VK_UNDEFINED,
- eventModif, false);
- case Event.ONKEYUP:
- return getKeyStroke(CHAR_UNDEFINED, eventKeyCode, eventModif, false);
- default:
- return null;
- }
- }
-
- /**
- * Gets the appropriate keystroke, creating one if necessary.
- *
- * @param keyChar
- * the keyChar
- * @param keyCode
- * the keyCode
- * @param modifiers
- * the modifiers
- * @param release
- * true for key release
- * @return the specified keystroke
- */
- private static KeyStroke getKeyStroke(final char keyChar, final int keyCode, final int modifiers,
- final boolean release) {
- // Check level 0 cache.
- KeyStroke stroke = recent; // Avoid thread races.
- if (stroke != null && stroke.keyChar == keyChar && stroke.keyCode == keyCode && stroke.modifiers == modifiers
- && stroke.onKeyRelease == release) {
- return stroke;
- }
- stroke = new KeyStroke(keyChar, keyCode, modifiers, release);
- // Check level 1 cache.
- final KeyStroke cached = CACHE.get(stroke);
- if (cached == null) {
- CACHE.put(stroke, stroke);
- } else {
- stroke = cached;
- }
- return recent = stroke;
- }
-
- /**
- * The typed character, or CHAR_UNDEFINED for key presses and releases.
- *
- * @serial the keyChar
- */
- private final char keyChar;
-
- /**
- * The virtual key code, or VK_UNDEFINED for key typed. Package visible for
- * use by Component.
- *
- * @serial the keyCode
- */
- int keyCode;
-
- /**
- * The modifiers in effect. To match Sun, this stores the old style masks
- * for shift, control, alt, meta, and alt-graph (but not button1); as well
- * as the new style of extended modifiers for all modifiers.
- *
- * @serial bitwise or of the *_DOWN_MASK modifiers
- */
- private int modifiers;
-
- /**
- * True if this is a key release; should only be true if keyChar is
- * CHAR_UNDEFINED.
- *
- * @serial true to distinguish key pressed from key released
- */
- private boolean onKeyRelease;
-
- /**
- * Construct a keystroke with default values: it will be interpreted as a
- * key typed event with an invalid character and no modifiers. Client code
- * should use the factory methods instead.
- *
- * @see #getKeyStroke(char)
- * @see #getKeyStroke(Character, int)
- * @see #getKeyStroke(int, int, boolean)
- * @see #getKeyStroke(int, int)
- * @see #getKeyStrokeForEvent(KeyEvent)
- * @see #getKeyStroke(String)
- */
- protected KeyStroke() {
- keyChar = CHAR_UNDEFINED;
- }
-
- /**
- * Construct a keystroke with the given values. Client code should use the
- * factory methods instead.
- *
- * @param keyChar
- * the character entered, if this is a key typed
- * @param keyCode
- * the key pressed or released, or VK_UNDEFINED for key typed
- * @param modifiers
- * the modifier keys for the keystroke, in old or new style
- * @param onKeyRelease
- * true if this is a key release instead of a press
- * @see #getKeyStroke(char)
- * @see #getKeyStroke(Character, int)
- * @see #getKeyStroke(int, int, boolean)
- * @see #getKeyStroke(int, int)
- * @see #getKeyStrokeForEvent(KeyEvent)
- * @see #getKeyStroke(String)
- */
- protected KeyStroke(final char keyChar, final int keyCode, final int modifiers, final boolean onKeyRelease) {
- this.keyChar = keyChar;
- this.keyCode = keyCode;
- // No need to call extend(), as only trusted code calls this
- // constructor.
- this.modifiers = modifiers;
- this.onKeyRelease = onKeyRelease;
- }
-
- /**
- * Tests two keystrokes for equality.
- *
- * @param obj
- * the object to test
- * @return true if it is equal
- */
- @Override
- public final boolean equals(final Object obj) {
- if (!(obj instanceof KeyStroke)) {
- return false;
- }
- final KeyStroke stroke = (KeyStroke) obj;
- return this == obj
- || (keyChar == stroke.keyChar && keyCode == stroke.keyCode && modifiers == stroke.modifiers && onKeyRelease == stroke.onKeyRelease);
- }
-
- /**
- * Returns the character of this keystroke, if it was typed.
- *
- * @return the character value, or CHAR_UNDEFINED
- * @see #getKeyStroke(char)
- */
- public final char getKeyChar() {
- return keyChar;
- }
-
- /**
- * Returns the virtual key code of this keystroke, if it was pressed or
- * released. This will be a VK_* constant from KeyEvent.
- *
- * @return the virtual key code value, or VK_UNDEFINED
- * @see #getKeyStroke(int, int)
- */
- public final int getKeyCode() {
- return keyCode;
- }
-
- /**
- * Returns the AWT event type of this keystroke. This is one of
- * {@link KeyEvent#KEY_TYPED}, {@link KeyEvent#KEY_PRESSED}, or
- * {@link KeyEvent#KEY_RELEASED}.
- *
- * @return the key event type
- */
- public final int getKeyEventType() {
- return keyCode == VK_UNDEFINED ? Event.ONKEYDOWN : onKeyRelease ? Event.ONKEYUP : Event.ONKEYPRESS;
- }
-
- @SuppressWarnings("deprecation")
- public String getKeyText() {
- switch (keyCode) {
- case KeyCodes.KEY_BACKSPACE:
- return translateKey("Backspace");
- // case KeyCodes.KEY_DELETE:
- // return translateKey("Delete");
- case KeyCodes.KEY_DOWN:
- return translateKey("Down");
- case KeyCodes.KEY_END:
- return translateKey("End");
- case KeyCodes.KEY_ENTER:
- return translateKey("Enter");
- case KeyCodes.KEY_ESCAPE:
- return translateKey("Escape");
- case KeyCodes.KEY_HOME:
- return translateKey("Home");
- case KeyCodes.KEY_LEFT:
- return translateKey("Left");
- case KeyCodes.KEY_PAGEDOWN:
- return translateKey("Page Down");
- case KeyCodes.KEY_PAGEUP:
- return translateKey("Page Up");
- case KeyCodes.KEY_RIGHT:
- return translateKey("Right");
- case KeyCodes.KEY_TAB:
- return translateKey("Tab");
- case KeyCodes.KEY_UP:
- return translateKey("Up");
- case Keyboard.KEY_SPACE:
- return translateKey("Space");
- case Keyboard.KEY_F1:
- case Keyboard.KEY_F2:
- case Keyboard.KEY_F3:
- case Keyboard.KEY_F4:
- case Keyboard.KEY_F5:
- case Keyboard.KEY_F6:
- case Keyboard.KEY_F7:
- case Keyboard.KEY_F8:
- case Keyboard.KEY_F9:
- case Keyboard.KEY_F10:
- case Keyboard.KEY_F11:
- case Keyboard.KEY_F12:
- return translateKey("F" + (keyCode - (Keyboard.KEY_F1 - 1)));
- case Keyboard.KEY_COMMA:
- case Keyboard.KEY_PERIOD:
- case Keyboard.KEY_SLASH:
- case Keyboard.KEY_0:
- case Keyboard.KEY_1:
- case Keyboard.KEY_2:
- case Keyboard.KEY_3:
- case Keyboard.KEY_4:
- case Keyboard.KEY_5:
- case Keyboard.KEY_6:
- case Keyboard.KEY_7:
- case Keyboard.KEY_8:
- case Keyboard.KEY_9:
- case Keyboard.KEY_SEMICOLON:
- case Keyboard.KEY_EQUALS:
- case Keyboard.KEY_A:
- case Keyboard.KEY_B:
- case Keyboard.KEY_C:
- case Keyboard.KEY_D:
- case Keyboard.KEY_E:
- case Keyboard.KEY_F:
- case Keyboard.KEY_G:
- case Keyboard.KEY_H:
- case Keyboard.KEY_I:
- case Keyboard.KEY_J:
- case Keyboard.KEY_K:
- case Keyboard.KEY_L:
- case Keyboard.KEY_M:
- case Keyboard.KEY_N:
- case Keyboard.KEY_O:
- case Keyboard.KEY_P:
- case Keyboard.KEY_Q:
- case Keyboard.KEY_R:
- case Keyboard.KEY_S:
- case Keyboard.KEY_T:
- case Keyboard.KEY_U:
- case Keyboard.KEY_V:
- case Keyboard.KEY_W:
- case Keyboard.KEY_X:
- case Keyboard.KEY_Y:
- case Keyboard.KEY_Z:
- case Keyboard.KEY_OPEN_BRACKET:
- case Keyboard.KEY_BACK_SLASH:
- case Keyboard.KEY_CLOSE_BRACKET:
- return String.valueOf(keyCode).toUpperCase();
- default:
- final String charS = String.valueOf(keyChar);
- if (charS == null) {
- return "Unknown keyCode: 0x" + (keyCode < 0 ? "-" : "") + Integer.toHexString(Math.abs(keyCode));
- } else {
- if (" ".equals(charS)) {
- return translateKey("Space");
- } else {
- return charS;
- }
- }
- }
- }
-
- /**
- * Returns the modifiers for this keystroke. This will be a bitwise or of
- * constants from InputEvent; it includes the old style masks for shift,
- * control, alt, meta, and alt-graph (but not button1); as well as the new
- * style of extended modifiers for all modifiers.
- *
- * @return the modifiers
- * @see #getKeyStroke(Character, int)
- * @see #getKeyStroke(int, int)
- */
- public final int getModifiers() {
- return modifiers;
- }
-
- /**
- * Returns a hashcode for this key event. It is not documented, but appears
- * to be: <code>(getKeyChar() + 1) * (getKeyCode() + 1)
- * * (getModifiers() + 1) * 2 + (isOnKeyRelease() ? 1 : 2)</code>.
- *
- * @return the hashcode
- */
- @Override
- public int hashCode() {
- return (keyChar + 1) * (keyCode + 1) * (modifiers + 1) * 2 + (onKeyRelease ? 1 : 2);
- }
-
- /**
- * Tests if this keystroke is a key release.
- *
- * @return true if this is a key release
- * @see #getKeyStroke(int, int, boolean)
- */
- public final boolean isOnKeyRelease() {
- return onKeyRelease;
- }
-
- @Override
- public String toString() {
- String s = " (";
- if ((modifiers & Keyboard.MODIFIER_META) != 0) {
- s += translateKey("Meta") + "+";
- }
- if ((modifiers & Keyboard.MODIFIER_CTRL) != 0) {
- s += translateKey("Ctrl") + "+";
- }
- if ((modifiers & Keyboard.MODIFIER_ALT) != 0) {
- s += translateKey("Alt") + "+";
- }
- if ((modifiers & Keyboard.MODIFIER_SHIFT) != 0) {
- s += translateKey("Shift") + "+";
- }
- /*
- * if ((modifiers & Event.BUTTON_LEFT) != 0) { s +=
- * translateKey("Button1") + "+"; } if ((modifiers & Event.BUTTON_RIGHT)
- * != 0) { s += translateKey("Button2") + "+"; } if ((modifiers &
- * Event.BUTTON_MIDDLE) != 0) { s += translateKey("Button3") + "+"; }
- */
- s += getKeyText() + ")";
- return s;
- }
-
- /**
- * Returns a cached version of the deserialized keystroke, if available.
- *
- * @return a cached replacement if something goes wrong
- */
- protected Object readResolve() {
- final KeyStroke s = CACHE.get(this);
- if (s != null) {
- return s;
- }
- CACHE.put(this, this);
- return this;
- }
-
- private String translateKey(final String keyNameToTranslate) {
- return Resources.i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
- }
-
-} // class KeyStroke
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.Item;
-import com.gwtext.client.widgets.menu.Menu;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
-
-public class MenuItemsContainer<T> {
- private final HashMap<String, Menu> contextMenus;
-
- public MenuItemsContainer() {
- contextMenus = new HashMap<String, Menu>();
- }
-
- public void clear() {
- contextMenus.clear();
- }
-
- public void createItemMenu(final String id, final ActionItemCollection<T> actionCollection,
- final Listener<ActionItem<T>> listener) {
- Scheduler.get().scheduleDeferred(new ScheduledCommand() {
- public void execute() {
- Menu menu = null;
- if (actionCollection != null) {
- menu = new Menu();
- // Remove if when retrieved rights of siblings
- for (final ActionItem<T> actionItem : actionCollection) {
- final ActionDescriptor<T> action = actionItem.getAction();
- if (actionItem.mustBeEnabled()) {
- final Item item = new Item(action.getText());
- item.setIcon(action.getIconUrl());
- menu.addItem(item);
- item.addListener(new BaseItemListenerAdapter() {
- @Override
- public void onClick(final BaseItem item, final EventObject e) {
- listener.onEvent(actionItem);
- }
- });
- }
- }
- }
- contextMenus.put(id, menu);
- }
- });
- }
-
- public Menu get(final String id) {
- return contextMenus.get(id);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,168 +0,0 @@
-/* AbstractAction.java --
- Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-import com.google.gwt.resources.client.ImageResource;
-
-/**
- * A base class for implementing the {@link Action} interface.
- *
- * @author Andrew Selkirk
- * @author Adapted version for GWT (C) The kune development team
- */
-@Deprecated
-public abstract class OldAbstractAction extends ChangebleObject implements Action {
-
- /**
- * A flag that indicates whether or not the action is enabled.
- */
- protected boolean enabled = true;
-
- /**
- * Creates a new action with no properties set.
- */
- public OldAbstractAction() {
- // Nothing to do.
- }
-
- /**
- * Copy constructor used as a substitute of clone
- */
- @SuppressWarnings("unchecked")
- public OldAbstractAction(final OldAbstractAction action) {
- enabled = action.enabled;
- store = (HashMap<String, Object>) action.store.clone();
- }
-
- /**
- * Creates a new action with the specified name. The name is stored as a
- * property with the key {@link Action#NAME}, and no other properties are
- * initialised.
- *
- * @param name
- * the name (<code>null</code> permitted).
- */
- public OldAbstractAction(final String name) {
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:19
- putValue(NAME, name);
- }
-
- /**
- * Creates a new action with the specified name and icon. The name is stored
- * as a property with the key {@link Action#NAME}, the icon is stored as a
- * property with the key {@link Action#SMALL_ICON}, and no other properties
- * are initialised.
- *
- * @param name
- * the name (<code>null</code> permitted).
- * @param icon
- * the icon (<code>null</code> permitted).
- */
- public OldAbstractAction(final String name, final ImageResource icon) {
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:19
- putValue(NAME, name);
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:19
- putValue(SMALL_ICON, icon);
- }
-
- /**
- * Returns the flag that indicates whether or not the action is enabled.
- *
- * @return The flag.
- *
- * @see #setEnabled(boolean)
- */
- @Override
- public boolean isEnabled() {
- return enabled;
- }
-
- @Override
- /**
- * Sets the value associated with the specified key and sends a
- * {@link java.beans.PropertyChangeEvent} to all registered listeners. The
- * standard keys are:
- * <ul>
- * <li>{@link #NAME}</li>
- * <li>{@link #SHORT_DESCRIPTION}</li>
- * <li>{@link #LONG_DESCRIPTION}</li>
- * <li>{@link #SMALL_ICON}</li>
- * <li>{@link #ACTION_COMMAND_KEY}</li>
- * <li>{@link #ACCELERATOR_KEY}</li>
- * <li>{@link #MNEMONIC_KEY}</li>
- * </ul>
- * Any existing value associated with the key will be overwritten.
- *
- * @param key
- * the key (not <code>null</code>).
- * @param value
- * the value (<code>null</code> permitted).
- */
- public void putValue(final String key, final Object value) {
- // TODO Auto-generated method stub
- super.putValue(key, value);
- }
-
- /**
- * Sets the flag that indicates whether or not the action is enabled and, if
- * the value of the flag changed from the previous setting, sends a
- * {@link java.beans.PropertyChangeEvent} to all registered listeners (using
- * the property name 'enabled').
- *
- * @param enabled
- * the new flag value.
- *
- * @see #isEnabled()
- */
- @Override
- public void setEnabled(final boolean enabled) {
- if (enabled != this.enabled) {
- this.enabled = enabled;
- firePropertyChange(ENABLED, !this.enabled, this.enabled);
- }
- }
-
- public void setShortcut(final KeyStroke key) {
- putValue(Action.ACCELERATOR_KEY, key);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,185 +0,0 @@
-/* PropertyChangeEvent.java -- describes a change in a property
- Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * PropertyChangeEvents are fired in the PropertyChange and VetoableChange event
- * classes. They represent the old and new values as well as the source Bean. If
- * the old or new value is a primitive type, it must be wrapped in the
- * appropriate wrapper type (java.lang.Integer for int, etc., etc.).
- *
- * <p>
- * If the old or new values are unknown (although why that would be I do not
- * know), they may be null. Also, if the set of properties itself has changed,
- * the name should be null, and the old and new values may also be null. Right
- * now Sun put in a propagationId, reserved for future use. Read the comments on
- * the constructor and on setPropagationId for more information.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.1
- * @status udpated to 1.4
- */
-public class PropertyChangeEvent {
-
- /**
- * The name of the property that changed, may be null. Package visible for
- * use by PropertyChangeSupport.
- *
- * @serial the changed property name
- */
- final String propertyName;
-
- /**
- * The new value of the property, may be null. Package visible for use by
- * PropertyChangeSupport.
- *
- * @serial the new property value
- */
- final Object newValue;
-
- /**
- * The old value of the property, may be null. Package visible for use by
- * PropertyChangeSupport.
- *
- * @serial the old property value
- */
- final Object oldValue;
-
- /**
- * The propagation ID, reserved for future use. May be null.
- *
- * @see #getPropagationId()
- * @serial the Propagation ID
- */
- private Object propagationId;
-
- private final Object source;
-
- /**
- * Create a new PropertyChangeEvent. Remember that if you received a
- * PropertyChangeEvent and are sending a new one, you should also set the
- * propagation ID from the old PropertyChangeEvent.
- *
- * @param source
- * the Bean containing the property
- * @param propertyName
- * the property's name
- * @param oldVal
- * the old value of the property
- * @param newVal
- * the new value of the property
- * @throws IllegalArgumentException
- * if source is null
- */
- public PropertyChangeEvent(final Object source, final String propertyName, final Object oldVal, final Object newVal) {
- this.source = source;
- this.propertyName = propertyName;
- this.oldValue = oldVal;
- this.newValue = newVal;
- }
-
- /**
- * Get the property's new value. May be null if multiple properties changed.
- *
- * @return the property's new value
- */
- public Object getNewValue() {
- return newValue;
- }
-
- /**
- * Get the property's old value. May be null if multiple properties changed.
- *
- * @return the property's old value
- */
- public Object getOldValue() {
- return oldValue;
- }
-
- /**
- * Get the propagation ID. Right now, it is not used for anything.
- *
- * @return the propagation ID
- * @see #setPropagationId(Object)
- */
- public Object getPropagationId() {
- return propagationId;
- }
-
- /**
- * Get the property name. May be null if multiple properties changed.
- *
- * @return the property name
- */
- public String getPropertyName() {
- return propertyName;
- }
-
- public Object getSource() {
- return source;
- }
-
- /**
- * Set the propagation ID. This is a way for the event to be passed from
- * hand to hand and retain a little extra state. Right now it is unused, but
- * it should be propagated anyway so that future versions of JavaBeans can
- * use it, for God knows what.
- *
- * @param propagationId
- * the propagation ID
- * @see #getPropagationId()
- */
- public void setPropagationId(final Object propagationId) {
- this.propagationId = propagationId;
- }
-
- /**
- * Utility method to rollback a change.
- *
- * @param event
- * the event to rollback
- * @return a new event with old and new swapped
- */
- PropertyChangeEvent rollback() {
- PropertyChangeEvent result = new PropertyChangeEvent(source, propertyName, newValue, oldValue);
- result.propagationId = propagationId;
- return result;
- }
-} // class PropertyChangeEvent
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,58 +0,0 @@
-/* PropertyChangeListener.java -- listen for changes in a bound property
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * PropertyChangeListener allows a class to monitor properties of a Bean for
- * changes. A propertyChange() event will only be fired <em>after</em> the
- * property has changed.
- *
- * @author John Keiser
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PropertyChangeListener extends EventListener {
- /**
- * Fired after a Bean's property has changed.
- *
- * @param e
- * the change (containing the old and new values)
- */
- void propertyChange(PropertyChangeEvent e);
-} // interface PropertyChangeListener
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,99 +0,0 @@
-/* PropertyChangeListenerProxy.java -- adds a name to a property listener
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * This class provides an extension to <code>PropertyChangeListener</code> -
- * associating a name with the listener. This can be used to filter the changes
- * that one is interested in.
- *
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.4
- * @status udpated to 1.4
- */
-public class PropertyChangeListenerProxy extends EventListenerProxy implements PropertyChangeListener {
- /**
- * The name of the property to listen for. Package visible for use by
- * PropertyChangeSupport.
- */
- final String propertyName;
-
- /**
- * Create a new proxy which filters property change events and only passes
- * changes to the named property on to the delegate. A null propertyName or
- * listener does not fail now, but may cause a NullPointerException down the
- * road.
- *
- * @param propertyName
- * the property's name to filter on
- * @param listener
- * the delegate listener
- */
- public PropertyChangeListenerProxy(final String propertyName, final PropertyChangeListener listener) {
- super(listener);
- this.propertyName = propertyName;
- }
-
- /**
- * Gets the name of the property this proxy is filtering on.
- *
- * @return the property name
- */
- public String getPropertyName() {
- return propertyName;
- }
-
- /**
- * Forwards the event on to the delegate if the property name matches.
- *
- * @param event
- * the event to pass on, if it meets the filter
- * @throws NullPointerException
- * if the delegate this was created with is null
- */
- public void propertyChange(final PropertyChangeEvent event) {
- // Note: Sun does not filter, under the assumption that since
- // PropertyChangeSupport unwraps proxys, this method should never be
- // called by normal use of listeners.
- String name = event == null ? null : event.getPropertyName();
- if (name == null ? propertyName == null : name.equals(propertyName)) {
- ((PropertyChangeListener) getListener()).propertyChange(event);
- }
- }
-} // class PropertyChangeListenerProxy
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,440 +0,0 @@
-/* PropertyChangeSupport.java -- support to manage property change listeners
- Copyright (C) 1998, 1999, 2000, 2002, 2005, 2006
- Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.Vector;
-
-/**
- * PropertyChangeSupport makes it easy to fire property change events and handle
- * listeners. It allows chaining of listeners, as well as filtering by property
- * name. In addition, it will serialize only those listeners which are
- * serializable, ignoring the others without problem. This class is thread-safe.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.1
- * @status updated to 1.4
- */
-public class PropertyChangeSupport {
-
- /**
- * Maps property names (String) to named listeners (PropertyChangeSupport).
- * If this is a child instance, this field will be null.
- *
- * @serial the map of property names to named listener managers
- * @since 1.2
- */
- private HashMap<String, PropertyChangeSupport> children;
-
- /**
- * The non-null source object for any generated events.
- *
- * @serial the event source
- */
- private final Object source;
-
- /**
- * The list of all registered property listeners. If this instance was
- * created by user code, this only holds the global listeners (ie. not tied
- * to a name), and may be null. If it was created by this class, as a helper
- * for named properties, then this vector will be non-null, and this
- * instance appears as a value in the <code>children</code> hashtable of
- * another instance, so that the listeners are tied to the key of that
- * hashtable entry.
- */
- private Vector<PropertyChangeListener> listeners;
-
- /**
- * Create a PropertyChangeSupport to work with a specific source bean.
- *
- * @param source
- * the source bean to use
- * @throws NullPointerException
- * if source is null
- */
- public PropertyChangeSupport(final Object source) {
- this.source = source;
- if (source == null) {
- // @PMD:REVIEWED:AvoidThrowingNullPointerException: by vjrj on
- // 21/05/09 14:12
- throw new NullPointerException();
- }
- }
-
- /**
- * Adds a PropertyChangeListener to the list of global listeners. All
- * property change events will be sent to this listener. The listener add is
- * not unique: that is, <em>n</em> adds with the same listener will result
- * in <em>n</em> events being sent to that listener for every property
- * change. Adding a null listener is silently ignored. This method will
- * unwrap a PropertyChangeListenerProxy, registering the underlying delegate
- * to the named property list.
- *
- * @param l
- * the listener to add
- */
- public void addPropertyChangeListener(final PropertyChangeListener l) {
- if (l == null) {
- return;
- }
-
- if (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- addPropertyChangeListener(p.propertyName, (PropertyChangeListener) p.getListener());
- } else {
- if (listeners == null) {
- listeners = new Vector<PropertyChangeListener>();
- }
- listeners.add(l);
- }
- }
-
- /**
- * Adds a PropertyChangeListener listening on the specified property. Events
- * will be sent to the listener only if the property name matches. The
- * listener add is not unique; that is, <em>n</em> adds on a particular
- * property for a particular listener will result in <em>n</em> events being
- * sent to that listener when that property is changed. The effect is
- * cumulative, too; if you are registered to listen to receive events on all
- * property changes, and then you register on a particular property, you
- * will receive change events for that property twice. Adding a null
- * listener is silently ignored. This method will unwrap a
- * PropertyChangeListenerProxy, registering the underlying delegate to the
- * named property list if the names match, and discarding it otherwise.
- *
- * @param propertyName
- * the name of the property to listen on
- * @param l
- * the listener to add
- * @throws NullPointerException
- * if propertyName is null
- */
- // @PMD:REVIEWED:AvoidReassigningParameters: by vjrj on 21/05/09 14:12
- public void addPropertyChangeListener(final String propertyName, PropertyChangeListener l) {
- if (l == null) {
- return;
- }
-
- while (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null : !propertyName.equals(p.propertyName)) {
- return;
- }
- l = (PropertyChangeListener) p.getListener();
- }
- PropertyChangeSupport s = null;
- if (children == null) {
- children = new HashMap<String, PropertyChangeSupport>();
- } else {
- s = children.get(propertyName);
- }
- if (s == null) {
- s = new PropertyChangeSupport(source);
- s.listeners = new Vector<PropertyChangeListener>();
- children.put(propertyName, s);
- }
- s.listeners.add(l);
- }
-
- /**
- * Fire an indexed property change event. This will only fire an event if
- * the old and new values are not equal.
- *
- * @param name
- * the name of the property which changed
- * @param index
- * the index of the property which changed
- * @param oldValue
- * the old value of the property
- * @param newValue
- * the new value of the property
- * @since 1.5
- */
- public void fireIndexedPropertyChange(final String name, final int index, final boolean oldValue,
- final boolean newValue) {
- if (oldValue != newValue) {
- fireIndexedPropertyChange(name, index, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
- }
-
- /**
- * Fire an indexed property change event. This will only fire an event if
- * the old and new values are not equal.
- *
- * @param name
- * the name of the property which changed
- * @param index
- * the index of the property which changed
- * @param oldValue
- * the old value of the property
- * @param newValue
- * the new value of the property
- * @since 1.5
- */
- public void fireIndexedPropertyChange(final String name, final int index, final int oldValue, final int newValue) {
- if (oldValue != newValue) {
- fireIndexedPropertyChange(name, index, Integer.valueOf(oldValue), Integer.valueOf(newValue));
- }
- }
-
- /**
- * Fire a PropertyChangeEvent to all the global listeners, and to all the
- * listeners for the specified property name. This does nothing if old and
- * new values of the event are equal.
- *
- * @param event
- * the event to fire
- * @throws NullPointerException
- * if event is null
- */
- public void firePropertyChange(final PropertyChangeEvent event) {
- if (event.oldValue != null && event.oldValue.equals(event.newValue)) {
- return;
- }
- Vector<PropertyChangeListener> v = listeners; // Be thread-safe.
- if (v != null) {
- int i = v.size();
- while (--i >= 0) {
- (v.get(i)).propertyChange(event);
- }
- }
- final HashMap<String, PropertyChangeSupport> h = children; // Be
- // thread-safe.
- if (h != null && event.propertyName != null) {
- final PropertyChangeSupport s = h.get(event.propertyName);
- if (s != null) {
- v = s.listeners; // Be thread-safe.
- int i = v == null ? 0 : v.size();
- while (--i >= 0) {
- (v.get(i)).propertyChange(event);
- }
- }
- }
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- *
- * @param propertyName
- * the name of the property that changed
- * @param oldVal
- * the old value
- * @param newVal
- * the new value
- */
- public void firePropertyChange(final String propertyName, final boolean oldVal, final boolean newVal) {
- if (oldVal != newVal) {
- firePropertyChange(new PropertyChangeEvent(source, propertyName, Boolean.valueOf(oldVal),
- Boolean.valueOf(newVal)));
- }
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- *
- * @param propertyName
- * the name of the property that changed
- * @param oldVal
- * the old value
- * @param newVal
- * the new value
- */
- public void firePropertyChange(final String propertyName, final int oldVal, final int newVal) {
- if (oldVal != newVal) {
- firePropertyChange(new PropertyChangeEvent(source, propertyName, Integer.valueOf(oldVal),
- Integer.valueOf(newVal)));
- }
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are non-null
- * and equal.
- *
- * @param propertyName
- * the name of the property that changed
- * @param oldVal
- * the old value
- * @param newVal
- * the new value
- */
- public void firePropertyChange(final String propertyName, final Object oldVal, final Object newVal) {
- firePropertyChange(new PropertyChangeEvent(source, propertyName, oldVal, newVal));
- }
-
- /**
- * Returns an array of all registered property change listeners. Those that
- * were registered under a name will be wrapped in a
- * <code>PropertyChangeListenerProxy</code>, so you must check whether the
- * listener is an instance of the proxy class in order to see what name the
- * real listener is registered under. If there are no registered listeners,
- * this returns an empty array.
- *
- * @return the array of registered listeners
- * @see PropertyChangeListenerProxy
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners() {
- final ArrayList<PropertyChangeListener> list = new ArrayList<PropertyChangeListener>();
- if (listeners != null) {
- list.addAll(listeners);
- }
- if (children != null) {
- int i = children.size();
- final Iterator<Entry<String, PropertyChangeSupport>> iter = children.entrySet().iterator();
- while (--i >= 0) {
- final Entry<String, PropertyChangeSupport> e = iter.next();
- final String name = e.getKey();
- final Vector<PropertyChangeListener> v = (e.getValue()).listeners;
- int j = v.size();
- while (--j >= 0) {
- list.add(new PropertyChangeListenerProxy(name, v.get(j)));
- }
- }
- }
- return list.toArray(new PropertyChangeListener[list.size()]);
- }
-
- /**
- * Returns an array of all property change listeners registered under the
- * given property name. If there are no registered listeners, or
- * propertyName is null, this returns an empty array.
- *
- * @return the array of registered listeners
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners(final String propertyName) {
- if (children == null || propertyName == null) {
- return new PropertyChangeListener[0];
- }
- final PropertyChangeSupport s = children.get(propertyName);
- if (s == null) {
- return new PropertyChangeListener[0];
- }
- return s.listeners.toArray(new PropertyChangeListener[s.listeners.size()]);
- }
-
- /**
- * Tell whether the specified property is being listened on or not. This
- * will only return <code>true</code> if there are listeners on all
- * properties or if there is a listener specifically on this property.
- *
- * @param propertyName
- * the property that may be listened on
- * @return whether the property is being listened on
- */
- public boolean hasListeners(final String propertyName) {
- return listeners != null || (children != null && children.get(propertyName) != null);
- }
-
- /**
- * Removes a PropertyChangeListener from the list of global listeners. If
- * any specific properties are being listened on, they must be deregistered
- * by themselves; this will only remove the general listener to all
- * properties. If <code>add()</code> has been called multiple times for a
- * particular listener, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * PropertyChangeListenerProxy, removing the underlying delegate from the
- * named property list.
- *
- * @param l
- * the listener to remove
- */
- public void removePropertyChangeListener(final PropertyChangeListener l) {
- if (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- removePropertyChangeListener(p.propertyName, (PropertyChangeListener) p.getListener());
- } else if (listeners != null) {
- listeners.remove(l);
- if (listeners.isEmpty()) {
- listeners = null;
- }
- }
- }
-
- /**
- * Removes a PropertyChangeListener from listening to a specific property.
- * If <code>add()</code> has been called multiple times for a particular
- * listener on a property, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * PropertyChangeListenerProxy, removing the underlying delegate from the
- * named property list if the names match.
- *
- * @param propertyName
- * the property to stop listening on
- * @param l
- * the listener to remove
- * @throws NullPointerException
- * if propertyName is null
- */
- // @PMD:REVIEWED:AvoidReassigningParameters: by vjrj on 21/05/09 14:12
- public void removePropertyChangeListener(final String propertyName, PropertyChangeListener l) {
- if (children == null) {
- return;
- }
- final PropertyChangeSupport s = children.get(propertyName);
- if (s == null) {
- return;
- }
- while (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null : !propertyName.equals(p.propertyName)) {
- return;
- }
- l = (PropertyChangeListener) p.getListener();
- }
- s.listeners.remove(l);
- if (s.listeners.isEmpty()) {
- children.remove(propertyName);
- if (children.isEmpty()) {
- children = null;
- }
- }
- }
-} // class PropertyChangeSupport
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-public interface RadioMustBeChecked {
- boolean mustBeChecked();
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.shortcuts.Keyboard;
-
-public final class Shortcut {
-
- public static KeyStroke getShortcut(final boolean ctrl, final boolean alt, final boolean shift, final boolean meta,
- final Character character) {
- return KeyStroke.getKeyStroke(character, (ctrl ? Keyboard.MODIFIER_CTRL : 0)
- + (alt ? Keyboard.MODIFIER_ALT : 0) + (shift ? Keyboard.MODIFIER_SHIFT : 0)
- + (meta ? Keyboard.MODIFIER_META : 0));
- }
-
- public static KeyStroke getShortcut(final boolean ctrl, final boolean shift, final Character character) {
- return getShortcut(ctrl, false, shift, false, character);
- }
-
- public static KeyStroke getShortcut(final boolean ctrl, final Character character) {
- return getShortcut(ctrl, false, false, false, character);
- }
-
- private Shortcut() {
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.Event;
-
-public interface AbstractLabel {
-
- HandlerRegistration addClickHandler(final ClickHandler handler);
-
- HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler);
-
- HandlerRegistration addMouseDownHandler(final MouseDownHandler handler);
-
- HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler);
-
- HandlerRegistration addMouseOutHandler(final MouseOutHandler handler);
-
- HandlerRegistration addMouseOverHandler(final MouseOverHandler handler);
-
- HandlerRegistration addMouseUpHandler(final MouseUpHandler handler);
-
- HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler);
-
- void addStyleDependentName(String string);
-
- Element getElement();
-
- String getText();
-
- void onBrowserEvent(final Event event);
-
- void removeStyleDependentName(String string);
-
- void setColor(final String color);
-
- void setStylePrimaryName(String string);
-
- void setText(final String text);
-
- void setTitle(final String title);
-
- void setVisible(boolean visible);
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,147 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import java.util.Map;
-
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.extjs.gxt.ui.client.data.BaseListLoader;
-import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
-import com.extjs.gxt.ui.client.data.HttpProxy;
-import com.extjs.gxt.ui.client.data.JsonLoadResultReader;
-import com.extjs.gxt.ui.client.data.ListLoadResult;
-import com.extjs.gxt.ui.client.data.ModelData;
-import com.extjs.gxt.ui.client.data.ModelType;
-import com.extjs.gxt.ui.client.data.PagingLoadConfig;
-import com.extjs.gxt.ui.client.event.Events;
-import com.extjs.gxt.ui.client.event.GridEvent;
-import com.extjs.gxt.ui.client.event.Listener;
-import com.extjs.gxt.ui.client.store.ListStore;
-import com.extjs.gxt.ui.client.store.Store;
-import com.extjs.gxt.ui.client.store.StoreFilter;
-import com.extjs.gxt.ui.client.widget.grid.Grid;
-import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
-import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
-import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar.PagingToolBarMessages;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.http.client.RequestBuilder;
-
-public class AbstractSearcherPanel {
-
- protected static final int PAGINATION_SIZE = 10;
- protected final I18nTranslationService i18n;
-
- public AbstractSearcherPanel(final I18nTranslationService i18n) {
- this.i18n = i18n;
- }
-
- protected void createPagingToolbar(final Store store, final Grid grid) {
- final PagingToolBar pag = new PagingToolBar(PAGINATION_SIZE);
- final PagingToolBarMessages msgs = new PagingToolBarMessages();
-
- msgs.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of {2}",
- "Respect {} values in translations. "
- + "This will produce: 'Displaying results 1 - 25 of 95465' for instance"));
- msgs.setEmptyMsg(i18n.t("No results to display"));
- msgs.setFirstText(i18n.t("First Page"));
- msgs.setAfterPageText(i18n.tWithNT("of {0}", "Used to show multiple results: '1 of 30'"));
- msgs.setBeforePageText(i18n.t("Page"));
- msgs.setLastText(i18n.t("Last Page"));
- msgs.setNextText(i18n.t("Next Page"));
- msgs.setPrevText(i18n.t("Previous Page"));
- msgs.setRefreshText(i18n.t("Refresh"));
- pag.setMessages(msgs);
- // pag.setStore(store);
- // pag.setDisplayInfo(true);
- // grid.setBottomToolbar(pag);
- grid.setLoadMask(true);
- // grid.setLoadMask(i18n.t("Searching"));
- grid.setSelectionModel(new GridSelectionModel());
- grid.setBorders(false);
- // grid.setFrame(true);
- grid.setStripeRows(true);
- }
-
- protected Store createStore(final ModelType type, final String url, final String id, final Grid grid) {
- final String path = GWT.getHostPageBaseURL() + url;
-
- // use a http proxy to get the data
- final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, path);
- final HttpProxy<String> proxy = new HttpProxy<String>(builder);
-
- // need a loader, proxy, and reader
- final JsonLoadResultReader<ListLoadResult<ModelData>> reader = new JsonLoadResultReader<ListLoadResult<ModelData>>(
- type);
-
- final BaseListLoader<ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadResult<ModelData>>(
- proxy, reader);
- loader.setRemoteSort(true);
-
- final ListStore<ModelData> store = new ListStore<ModelData>(loader);
- grid.addListener(Events.Attach, new Listener<GridEvent<ModelData>>() {
- @Override
- public void handleEvent(final GridEvent<ModelData> be) {
- final PagingLoadConfig config = new BasePagingLoadConfig();
- config.setOffset(0);
- config.setLimit(PAGINATION_SIZE);
-
- final Map<String, Object> state = grid.getState();
- if (state.containsKey("offset")) {
- final int offset = (Integer) state.get("offset");
- final int limit = (Integer) state.get("limit");
- config.setOffset(offset);
- config.setLimit(limit);
- }
- // if (state.containsKey("sortField")) {
- // config.setSortField((String) state.get("sortField"));
- // config.setSortDir(SortDir.valueOf((String) state.get("sortDir")));
- // }
- loader.load(config);
- }
- });
-
- // this goes to Model...
- // reader.setRoot("list");
- // reader.setTotalProperty("size");
- // reader.setId(id);
- // final HttpProxy proxy = new HttpProxy(url, Connection.POST);
- // return new Store(proxy, reader, true);
-
- return store;
- }
-
- protected void query(final Store store, final Grid grid, final String query) {
- // final UrlParam[] newParams = new UrlParam[] { new UrlParam("query",
- // query) };
- // store.setBaseParams(newParams);
- // store.load(0, PAGINATION_SIZE);
- store.clearFilters();
- store.addFilter(new StoreFilter<ModelData>() {
- @Override
- public boolean select(final Store<ModelData> store, final ModelData parent, final ModelData item,
- final String property) {
- // TODO Auto-generated method stub
- return false;
- }
- });
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-import com.google.gwt.user.client.ui.Widget;
-
-public interface AbstractToolbar {
-
- void add(final Widget widget);
-
- void add(final Widget widget, VerticalAlignmentConstant valign);
-
- Widget addFill();
-
- Widget addSeparator();
-
- Widget addSpacer();
-
- int getOffsetHeight();
-
- void insert(final Widget widget, int position);
-
- boolean isAttached();
-
- void remove(final Widget widget);
-
- void removeAll();
-
- void setBlankStyle();
-
- void setHeight(String height);
-
- void setNormalStyle();
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import org.ourproject.kune.platf.client.services.Images;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DisclosurePanel;
-import com.google.gwt.user.client.ui.DisclosurePanelImages;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ContextPropertyPanel extends Composite {
-
- public ContextPropertyPanel(AbstractImagePrototype headerIcon, String tooltip, String headerText, boolean isOpen,
- String debugId, Widget content) {
- this(new IconLabel(headerIcon, headerText), tooltip, isOpen, debugId, content);
- }
-
- public ContextPropertyPanel(String headerText, String tooltip, boolean isOpen, String debugId, Widget content) {
- DisclosurePanelImages images = new DisclosurePanelImages() {
- public AbstractImagePrototype disclosurePanelClosed() {
- return Images.App.getInstance().arrowRightWhite();
- }
-
- public AbstractImagePrototype disclosurePanelOpen() {
- return Images.App.getInstance().arrowDownWhite();
- }
- };
- DisclosurePanel disclosure = new DisclosurePanel(images, headerText, isOpen);
- init(disclosure, tooltip, content, debugId);
- }
-
- public ContextPropertyPanel(Widget header, String tooltip, boolean isOpen, String debugId, Widget content) {
- DisclosurePanel disclosure = new DisclosurePanel(header, isOpen);
- init(disclosure, tooltip, content, debugId);
- }
-
- private void init(DisclosurePanel disclosure, String tooltip, Widget content, String debugId) {
- disclosure.setAnimationEnabled(true);
- disclosure.ensureDebugId(debugId);
- disclosure.setContent(content);
- KuneUiUtils.setQuickTip(disclosure, tooltip);
- initWidget(disclosure);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-public class DefaultGrid {
- public DefaultGrid() {
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,172 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import org.ourproject.kune.platf.client.services.Images;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <p>
- * This panel opens when you click on the arrow or the title (gmail style)
- * </p>
- *
- */
-public class DropDownPanel extends Composite implements ClickHandler {
- private final VerticalPanel vpanel;
- private final HorizontalPanel titleHP;
- private final Label titleLabel;
- private final SimplePanel contentPanel;
- private final Images img;
- private final Image arrowImage;
- private final RoundedPanel outerBorder;
- private String stylePrimaryName;
-
- public DropDownPanel(final Images img) {
- super();
- this.img = img;
- vpanel = new VerticalPanel();
- outerBorder = new RoundedPanel(vpanel, RoundedPanel.ALL);
- titleHP = new HorizontalPanel();
- arrowImage = new Image();
- titleLabel = new Label();
- contentPanel = new SimplePanel();
-
- initWidget(outerBorder);
- vpanel.add(titleHP);
- vpanel.add(contentPanel);
- titleHP.add(arrowImage);
- titleHP.add(titleLabel);
-
- this.stylePrimaryName = "k-dropdownouter";
- outerBorder.setCornerStyleName(stylePrimaryName);
- vpanel.setStylePrimaryName(stylePrimaryName);
- vpanel.setWidth("100%");
- vpanel.setCellWidth(contentPanel, "100%");
- vpanel.setCellWidth(titleHP, "100%");
- titleHP.setStylePrimaryName("k-dropdownlabel");
- img.arrowDownWhite().applyTo(arrowImage);
- titleLabel.setText("");
- contentPanel.setStylePrimaryName("k-dropdowninner");
-
- setContentVisibleImpl(false);
- arrowImage.addClickHandler(this);
- titleLabel.addClickHandler(this);
- }
-
- public DropDownPanel(final Images img, final boolean visible) {
- this(img);
- setContentVisibleImpl(visible);
- }
-
- public DropDownPanel(final Images img, final String headerText, final boolean visible) {
- this(img);
- setContentVisibleImpl(visible);
- setHeaderTextImpl(headerText);
- }
-
- public boolean isContentVisible() {
- return contentPanel.isVisible();
- }
-
- public void onClick(final ClickEvent event) {
- setContentVisible(!isContentVisible());
- }
-
- public void setBorderStylePrimaryName(final String stylePrimaryName) {
- this.stylePrimaryName = stylePrimaryName;
- outerBorder.setCornerStyleName(stylePrimaryName);
- vpanel.setStylePrimaryName(stylePrimaryName);
- }
-
- public void setContent(final Widget widget) {
- contentPanel.setWidget(widget);
- // refresh panel
- setContentVisible(isContentVisible());
- }
-
- public void setContentHeight(final String height) {
- contentPanel.setHeight(height);
- }
-
- public void setContentVisible(final boolean visible) {
- setContentVisibleImpl(visible);
- }
-
- public void setHeaderText(final String text) {
- setHeaderTextImpl(text);
- }
-
- public void setHeaderTitle(final String title) {
- // QuickTips size problems with images
- KuneUiUtils.setQuickTip(arrowImage, title);
- KuneUiUtils.setQuickTip(titleLabel, title);
- }
-
- @Override
- public void setHeight(final String height) {
- super.setHeight(height);
- outerBorder.setHeight(height);
- }
-
- public void setTheme(final String oldTheme, final String newTheme) {
- if (oldTheme != null) {
- // outerBorder.removeStyleDependentName(oldThemeS);
- vpanel.removeStyleDependentName(oldTheme);
- titleHP.removeStyleDependentName(oldTheme);
- contentPanel.removeStyleDependentName(oldTheme);
- }
- outerBorder.setCornerStyleName(stylePrimaryName + "-" + newTheme);
- // outerBorder.addStyleDependentName(newThemeS);
- vpanel.addStyleDependentName(newTheme);
- titleHP.addStyleDependentName(newTheme);
- contentPanel.addStyleDependentName(newTheme);
- }
-
- @Override
- public void setWidth(final String width) {
- super.setWidth(width);
- outerBorder.setWidth(width);
- }
-
- private void setContentVisibleImpl(final boolean visible) {
- if (visible) {
- img.arrowDownWhite().applyTo(arrowImage);
- contentPanel.setVisible(true);
-
- } else {
- img.arrowRightWhite().applyTo(arrowImage);
- contentPanel.setVisible(false);
- }
- }
-
- private void setHeaderTextImpl(final String text) {
- titleLabel.setText(text);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-public interface EditableClickListener {
-
- @Deprecated
- void onEdited(String text);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-
-public class FlowToolbar extends Composite implements AbstractToolbar {
-
- private final HorizontalPanel mainPanel;
- private final FlowPanel childPanel;
-
- public FlowToolbar() {
- super();
- mainPanel = new HorizontalPanel();
- childPanel = new FlowPanel();
- mainPanel.add(childPanel);
- initWidget(mainPanel);
- }
-
- public void add(final Widget widget) {
- childPanel.add(widget);
- }
-
- public void add(final Widget widget, final VerticalAlignmentConstant valign) {
- childPanel.add(widget);
- }
-
- public Widget addFill() {
- final Label emptyLabel = new Label("");
- emptyLabel.addStyleName("kune-floatleft");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSeparator() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-sep");
- emptyLabel.addStyleName("k-toolbar-sep");
- emptyLabel.addStyleName("kune-floatleft");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSpacer() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-spacer");
- emptyLabel.addStyleName("kune-floatleft");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public void insert(final Widget widget, final int position) {
- childPanel.insert(widget, position);
- }
-
- public void remove(final Widget widget) {
- childPanel.remove(widget);
- }
-
- public void removeAll() {
- childPanel.clear();
- }
-
- /**
- * Set the blank style
- */
- public void setBlankStyle() {
- setBasicStyle();
- addStyleName("k-blank-toolbar");
- }
-
- @Override
- public void setHeight(final String height) {
- mainPanel.setHeight(height);
- childPanel.setHeight(height);
- }
-
- /**
- * Set the normal grey style
- */
- public void setNormalStyle() {
- setBasicStyle();
- addStyleName("k-toolbar-bottom-line");
- }
-
- /**
- * Set the transparent style
- */
- public void setTranspStyle() {
- setBasicStyle();
- addStyleName("k-transp");
- }
-
- private void setBasicStyle() {
- setStyleName("x-toolbar");
- addStyleName("x-panel");
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-public interface HasColor {
- void setColor(String color);
-
- String getColor();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.HTML;
-
-final public class HorizontalLine extends HTML {
-
- public HorizontalLine() {
- this.setHTML("<hr noshadow size='1'>");
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,165 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.HasAllMouseHandlers;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveEvent;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverEvent;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpEvent;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelEvent;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Widget;
-
-public class IconHyperlink extends Widget implements AbstractLabel, HasClickHandlers, HasDoubleClickHandlers,
- HasAllMouseHandlers {
-
- private Element anchorElem;
-
- private String targetHistoryToken;
- private final Element link;
- private final Element icon;
-
- public IconHyperlink(final AbstractImagePrototype image) {
- setElement(DOM.createDiv());
- DOM.appendChild(getElement(), anchorElem = DOM.createAnchor());
- setStyleName("kune-IconHyperlink");
- icon = image.createImage().getElement();
- link = DOM.createSpan();
- DOM.appendChild(anchorElem, icon);
- DOM.appendChild(anchorElem, link);
- }
-
- public IconHyperlink(final AbstractImagePrototype image, final String text, final boolean asHTML,
- final String targetHistoryToken) {
- this(image);
- if (asHTML) {
- setLabelHtmlImpl(text);
- } else {
- setLabelTextImpl(text);
- }
- setTargetHistoryTokenImpl(targetHistoryToken);
- }
-
- public IconHyperlink(final AbstractImagePrototype image, final String text, final String targetHistoryToken) {
- this(image);
- setLabelTextImpl(text);
- setTargetHistoryTokenImpl(targetHistoryToken);
- }
-
- public HandlerRegistration addClickHandler(final ClickHandler handler) {
- return addDomHandler(handler, ClickEvent.getType());
- }
-
- public HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
-
- public HandlerRegistration addMouseDownHandler(final MouseDownHandler handler) {
- return addDomHandler(handler, MouseDownEvent.getType());
- }
-
- public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
- return addDomHandler(handler, MouseMoveEvent.getType());
- }
-
- public HandlerRegistration addMouseOutHandler(final MouseOutHandler handler) {
- return addDomHandler(handler, MouseOutEvent.getType());
- }
-
- public HandlerRegistration addMouseOverHandler(final MouseOverHandler handler) {
- return addDomHandler(handler, MouseOverEvent.getType());
- }
-
- public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
- return addDomHandler(handler, MouseUpEvent.getType());
- }
-
- public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
- return addDomHandler(handler, MouseWheelEvent.getType());
- }
-
- public String getTargetHistoryToken() {
- return targetHistoryToken;
- }
-
- public String getText() {
- return DOM.getInnerText(link);
- }
-
- public void setColor(final String color) {
- DOM.setStyleAttribute(link, "color", color);
- }
-
- public void setImage(final AbstractImagePrototype image) {
- DOM.setInnerHTML(icon, image.getHTML());
- }
-
- public void setLabelHTML(final String html) {
- setLabelHtmlImpl(html);
- }
-
- public void setLabelText(final String text) {
- setLabelTextImpl(text);
- }
-
- public void setTargetHistoryToken(final String targetHistoryToken) {
- setTargetHistoryTokenImpl(targetHistoryToken);
- }
-
- public void setText(final String text) {
- setLabelText(text);
- }
-
- @Override
- public void setTitle(final String title) {
- KuneUiUtils.setQuickTip(icon, title);
- KuneUiUtils.setQuickTip(anchorElem, title);
- }
-
- private void setLabelHtmlImpl(final String html) {
- DOM.setInnerHTML(link, html);
- }
-
- private void setLabelTextImpl(final String text) {
- DOM.setInnerText(link, text);
- }
-
- private void setTargetHistoryTokenImpl(final String targetHistoryToken) {
- this.targetHistoryToken = targetHistoryToken;
- DOM.setElementProperty(anchorElem, "href", "#" + targetHistoryToken);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,237 +0,0 @@
-/*
- * Copyright 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- *
- * Adapted by Vicente J. Ruiz Jurado for kune
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.HasAllMouseHandlers;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveEvent;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverEvent;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpEvent;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelEvent;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.HasWordWrap;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * A widget that contains a icon and arbitrary text, <i>not</i> interpreted as
- * HTML.
- *
- * <h3>CSS Style Rules</h3> <ul class='css'> <li>.kune-IconLabel { }</li> </ul>
- *
- * <p>
- * <h3>Example</h3>
- * {@example com.google.gwt.examples.HTMLExample}
- * </p>
- */
-
-public class IconLabel extends Widget implements HasClickHandlers, HasDoubleClickHandlers, HasAllMouseHandlers,
- HasHorizontalAlignment, HasText, HasWordWrap, AbstractLabel {
-
- private HorizontalAlignmentConstant horzAlign;
-
- private Element icon;
-
- private final Element textLabel;
-
- /**
- * Creates an empty label with a icon.
- *
- * @param image
- * the icon to add
- */
- public IconLabel(final AbstractImagePrototype image, final boolean leftIcon) {
- setElement(DOM.createDiv());
- setIconImpl(image);
- textLabel = DOM.createSpan();
- if (leftIcon) {
- setStyleName("kune-IconLabel-l");
- DOM.appendChild(getElement(), icon);
- DOM.appendChild(getElement(), textLabel);
- } else {
- setStyleName("kune-IconLabel-r");
- DOM.appendChild(getElement(), textLabel);
- DOM.appendChild(getElement(), icon);
- }
- }
-
- /**
- * Creates a label with the specified text and a icon in the left.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- */
- public IconLabel(final AbstractImagePrototype image, final String text) {
- this(image, true);
- setTextImpl(text);
- }
-
- /**
- * Creates a label with the specified text and a icon in the left.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- * @param wordWrap
- * <code>false</code> to disable word wrapping
- */
- public IconLabel(final AbstractImagePrototype image, final String text, final boolean wordWrap) {
- this(image, text);
- setWordWrapImpl(wordWrap);
- }
-
- /**
- * Creates a label with the specified text and a icon in the right.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- */
- public IconLabel(final String text, final AbstractImagePrototype image) {
- this(image, false);
- setTextImpl(text);
- }
-
- /**
- * Creates a label with the specified text and a icon in the right.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- * @param wordWrap
- * <code>false</code> to disable word wrapping
- */
- public IconLabel(final String text, final AbstractImagePrototype image, final boolean wordWrap) {
- this(text, image);
- setWordWrapImpl(wordWrap);
- }
-
- public HandlerRegistration addClickHandler(final ClickHandler handler) {
- return addDomHandler(handler, ClickEvent.getType());
- }
-
- public HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
-
- public HandlerRegistration addMouseDownHandler(final MouseDownHandler handler) {
- return addDomHandler(handler, MouseDownEvent.getType());
- }
-
- public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
- return addDomHandler(handler, MouseMoveEvent.getType());
- }
-
- public HandlerRegistration addMouseOutHandler(final MouseOutHandler handler) {
- return addDomHandler(handler, MouseOutEvent.getType());
- }
-
- public HandlerRegistration addMouseOverHandler(final MouseOverHandler handler) {
- return addDomHandler(handler, MouseOverEvent.getType());
- }
-
- public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
- return addDomHandler(handler, MouseUpEvent.getType());
- }
-
- public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
- return addDomHandler(handler, MouseWheelEvent.getType());
- }
-
- public HorizontalAlignmentConstant getHorizontalAlignment() {
- return horzAlign;
- }
-
- public String getText() {
- return DOM.getInnerText(textLabel);
- }
-
- public boolean getWordWrap() {
- return !DOM.getStyleAttribute(textLabel, "whiteSpace").equals("nowrap");
- }
-
- public void setColor(final String color) {
- DOM.setStyleAttribute(textLabel, "color", color);
- }
-
- public void setHorizontalAlignment(final HorizontalAlignmentConstant align) {
- horzAlign = align;
- DOM.setStyleAttribute(textLabel, "textAlign", align.getTextAlignString());
- }
-
- public void setIcon(final AbstractImagePrototype image) {
- setIconImpl(image);
- }
-
- public void setStyleNameToText(final String styleName) {
- DOM.setElementProperty(textLabel.<com.google.gwt.user.client.Element> cast(), "className", styleName);
- }
-
- public void setText(final String text) {
- setTextImpl(text);
- }
-
- @Override
- public void setTitle(final String title) {
- KuneUiUtils.setQuickTip(icon, title);
- KuneUiUtils.setQuickTip(textLabel, title);
- }
-
- public void setWordWrap(final boolean wrap) {
- setWordWrapImpl(wrap);
- }
-
- private Element getImageElement(final AbstractImagePrototype image) {
- return image.createImage().getElement();
- }
-
- private void setIconImpl(final AbstractImagePrototype image) {
- icon = getImageElement(image);
- }
-
- private void setTextImpl(final String text) {
- DOM.setInnerText(textLabel, text);
- }
-
- private void setWordWrapImpl(final boolean wrap) {
- DOM.setStyleAttribute(textLabel, "whiteSpace", wrap ? "normal" : "nowrap");
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,245 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.calclab.suco.client.events.Listener2;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverEvent;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * @author vjrj
- *
- */
-public class IconLabelEditable extends Composite {
-
- private ClickHandler clickHandler;
- private String clickLabel;
- private String currentText;
- private String dblClickLabel;
- private DoubleClickHandler doubleClickHandler;
- // private Event2<String, String> onEditEvent;
- private TextBox editor;
- private HorizontalPanel hpanel;
- private final AbstractLabel label;
- private MouseOutHandler mouseOutHandler;
- private MouseOverHandler mouseOverHandler;
- private List<HandlerRegistration> registrations;
- private boolean useDoubleClick;
-
- public IconLabelEditable() {
- this("");
- }
-
- public IconLabelEditable(final AbstractImagePrototype icon, final String text, final boolean useDoubleClick) { // NO_UCD
- super();
- label = new IconLabel(icon, text);
- init(text, useDoubleClick);
- }
-
- public IconLabelEditable(final AbstractImagePrototype icon, final String text, final String targetToken, // NO_UCD
- final boolean useDoubleClick) {
- super();
- label = new IconHyperlink(icon, text, targetToken);
- init(text, useDoubleClick);
- }
-
- public IconLabelEditable(final String text) {
- this(text, false);
- }
-
- public IconLabelEditable(final String text, final boolean useDoubleClick) { // NO_UCD
- this(text, false, useDoubleClick);
- }
-
- public IconLabelEditable(final String text, final boolean wordWrap, final boolean useDoubleClick) { // NO_UCD
- super();
- label = new LabelWrapper(text, wordWrap);
- init(text, useDoubleClick);
- }
-
- private void afterEdit() {
- final String text = editor.getText();
- // onEditEvent.fire(currentText, text);
- setTextImpl(text);
- editor.setVisible(false);
- editor.setReadOnly(true);
- label.setVisible(true);
- label.removeStyleDependentName("high");
- }
-
- public void edit() {
- showEditor();
- editor.setFocus(true);
- }
-
- public String getText() {
- return label.getText();
- }
-
- private void init(final String text, final boolean useDoubleClick) {
- // this.onEditEvent = new Event2<String, String>("onLabelEdit");
- registrations = new ArrayList<HandlerRegistration>();
- dblClickLabel = "Double click to rename";
- clickLabel = "Click to rename";
- hpanel = new HorizontalPanel();
- hpanel.add((Widget) label);
- initWidget(hpanel);
- this.currentText = text;
- this.useDoubleClick = useDoubleClick;
- label.setStylePrimaryName("kune-EditableLabel");
- doubleClickHandler = new DoubleClickHandler() {
- @Override
- public void onDoubleClick(final DoubleClickEvent event) {
- showEditor();
- }
- };
- clickHandler = new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- showEditor();
- }
- };
- mouseOverHandler = new MouseOverHandler() {
- @Override
- public void onMouseOver(final MouseOverEvent event) {
- label.addStyleDependentName("high");
- }
- };
- mouseOutHandler = new MouseOutHandler() {
- @Override
- public void onMouseOut(final MouseOutEvent event) {
- label.removeStyleDependentName("high");
- }
- };
- setEditableImpl(false);
- }
-
- public void onEdit(final Listener2<String, String> slot) {
- // onEditEvent.add(slot);
- }
-
- private void reset() {
- label.removeStyleDependentName("noneditable");
- label.removeStyleDependentName("editable");
- for (final HandlerRegistration reg : registrations) {
- reg.removeHandler();
- }
- registrations.clear();
- }
-
- /**
- * Sets the text tooltip showed to indicate "click to rename".
- *
- * @param text
- * the new click to rename label
- */
- public void setClickToRenameLabel(final String text) {
- this.clickLabel = text;
- }
-
- /**
- * Sets the text tooltip showed to indicate "double click to rename".
- *
- * @param text
- * the new double click to rename label
- */
- public void setDoubleClickToRenameLabel(final String text) {
- this.dblClickLabel = text;
- }
-
- public void setEditable(final boolean editable) {
- setEditableImpl(editable);
- }
-
- private void setEditableImpl(final boolean editable) {
- reset();
- if (editable) {
- if (useDoubleClick) {
- label.setTitle(dblClickLabel);
- registrations.add(label.addDoubleClickHandler(doubleClickHandler));
- } else {
- label.setTitle(clickLabel);
- registrations.add(label.addClickHandler(clickHandler));
- }
- registrations.add(label.addMouseOverHandler(mouseOverHandler));
- registrations.add(label.addMouseOutHandler(mouseOutHandler));
- label.addStyleDependentName("editable");
- } else {
- label.setTitle(null);
- label.addStyleDependentName("noneditable");
- }
- }
-
- public void setText(final String text) {
- setTextImpl(text);
- }
-
- private void setTextImpl(final String text) {
- this.currentText = text;
- label.setText(text);
- }
-
- private void showEditor() {
- final int hpWidth = hpanel.getParent().getOffsetWidth();
- label.setVisible(false);
- if (editor == null) {
- editor = new TextBox();
- editor.setStyleName("k-eil-edit");
- hpanel.add(editor);
- editor.addBlurHandler(new BlurHandler() {
- @Override
- public void onBlur(final BlurEvent event) {
- afterEdit();
- }
- });
- editor.addChangeHandler(new ChangeHandler() {
- @Override
- public void onChange(final ChangeEvent event) {
- editor.setFocus(false);
- }
- });
- }
- editor.setReadOnly(false);
- editor.setPixelSize(hpWidth < 100 ? 100 : hpWidth - 3, 21);
- editor.setText(currentText);
- editor.setVisible(true);
- editor.setFocus(true);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import cc.kune.common.client.utils.TextUtils;
-
-/**
- * Use TextUtils
- *
- */
-@Deprecated
-public class KuneStringUtils extends TextUtils {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,144 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.widgets.ToolTip;
-import com.gwtext.client.widgets.form.Field;
-
-@Deprecated
-public final class KuneUiUtils {
-
- public enum IconPosition {
- left, right
- }
-
- public static void focusOnField(final Field field) {
- new Timer() {
- @Override
- public void run() {
- field.focus(true);
- }
- }.schedule(50);
- }
-
- public static String genQuickTipLabel(final String labelText, final String tipTitle, final String tipText) {
- String tipHtml = "<span style=\"vertical-align: middle;\" ext:qtip=\"" + tipText + "\"";
- if (tipTitle != null && tipTitle.length() > 0) {
- tipHtml += " ext:qtitle=\"" + tipTitle + "\"";
- }
- tipHtml += ">";
- tipHtml += labelText;
- tipHtml += "</span>";
- return tipHtml;
- }
-
- public static String genQuickTipLabel(final String labelText, final String tipTitle, final String tipText,
- final AbstractImagePrototype icon, final IconPosition iconPosition) {
- String tipHtml = "<span style=\"vertical-align: middle;\" ext:qtip=\"" + tipText + "\"";
- if (tipTitle != null && tipTitle.length() > 0) {
- tipHtml += " ext:qtitle=\"" + tipTitle + "\"";
- }
- tipHtml += ">";
- final Image iconImg = new Image();
- icon.applyTo(iconImg);
- iconImg.setStyleName("vamiddle");
- // setQuickTip(iconImg, tipText, tipTitle);
-
- final ToolTip tooltip = new ToolTip();
- tooltip.setHtml(tipText);
- tooltip.setWidth(250);
- tooltip.applyTo(iconImg.getElement());
-
- if (iconPosition.equals(IconPosition.left)) {
- tipHtml += iconImg.toString();
- tipHtml += " ";
- tipHtml += labelText;
- } else if (iconPosition.equals(IconPosition.right)) {
- tipHtml += labelText;
- tipHtml += " ";
- tipHtml += iconImg.toString();
- }
- tipHtml += "</span>";
- return tipHtml;
- }
-
- public static String genQuickTipWithImage(final String imageResizedUrl, final int size) {
- return new Image(imageResizedUrl).toString();
- }
-
- /**
- * Use widget.setTitle if you don't want to use extjs (but remember that
- * title is limited to 64chars).
- *
- * Bug: extjs quicktips don't work with images or span inside divs (like
- * pushbutton). See: http://extjs.com/forum/showthread.php?t=22293
- * http://extjs.com/forum/showthread.php?t=5200
- *
- * @param element
- * @param tip
- */
- public static void setQuickTip(final Element element, final String tipText) {
- setQuickTip(element, tipText, null);
- }
-
- public static void setQuickTip(final Element element, final String tipText, final String tipTitle) {
- // If we don't want to use ext, use 'title' instead (limited to 64
- // chars)
- if (tipText == null || tipText.length() == 0) {
- DOM.removeElementAttribute(element, "ext:qtip");
- } else {
- final ToolTip tip = new ToolTip();
- tip.setHtml(tipText);
- if (tipTitle != null) {
- tip.setTitle(tipTitle);
- }
- tip.applyTo(element);
- // check size here?
- // String newTip = "<div style='min-width: 35px'>" + tip + "</div>";
- }
- }
-
- public static void setQuickTip(final Widget widget, final String tip) {
- setQuickTip(widget.getElement(), tip);
- }
-
- public static void setQuickTip(final Widget widget, final String tip, final String tipTitle) {
- setQuickTip(widget.getElement(), tip, tipTitle);
- }
-
- /**
- * Disables text selection on element
- *
- * @param element
- */
- public static void setUnselectable(final Element element) {
- Ext.get(element).unselectable();
- }
-
- private KuneUiUtils() {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.Label;
-
-public class LabelWrapper extends Label implements AbstractLabel {
-
- public LabelWrapper() {
- super();
- }
-
- public LabelWrapper(final String text) {
- super(text);
- }
-
- public LabelWrapper(final String text, final boolean wordWrap) {
- super(text, wordWrap);
- }
-
- public HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
-
- public void setColor(final String color) {
- DOM.setStyleAttribute(super.getElement(), "color", color);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.calclab.suco.client.events.Listener;
-
-public class MenuItem<T> {
-
- final String icon;
- final String title;
- private final Listener<T> listener;
-
- public MenuItem(final String icon, final String title, final Listener<T> listener) {
- this.icon = icon;
- this.title = title;
- this.listener = listener;
-
- }
-
- public void fire(final T id) {
- listener.onEvent(id);
- }
-
- public String getIcon() {
- return icon;
- }
-
- public String getTitle() {
- return title;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-/*
- *
- * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
- *
- * (c) 2008-2009 The emite development team (see CREDITS for details)
- * This file is part of emite.
- *
- * This program 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 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import java.util.ArrayList;
-
-public class MenuItemCollection<T> extends ArrayList<MenuItem<T>> {
-
- private static final long serialVersionUID = -4719030300216601947L;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.gwtext.client.widgets.QuickTip;
-import com.gwtext.client.widgets.QuickTips;
-
-public class QuickTipsHelper {
-
- public QuickTipsHelper() {
- QuickTips.init();
- final QuickTip quickTipInstance = QuickTips.getQuickTip();
- quickTipInstance.setInterceptTitles(true);
- quickTipInstance.setDismissDelay(7000);
- quickTipInstance.setHideDelay(400);
- quickTipInstance.setMinWidth(100);
- quickTipInstance.setShowDelay(1500);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,512 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-/*
- * Copyright 2007 Hilbrand Bouwkamp, hs(a)bouwkamp.com
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * The <code>RoundedPanel</code> class adds similar rounded corners, as seen in
- * other Google applications, to a widget. This is done by adding several
- * <code>div</code> Elements around a Widget. The HTML code roughly for a corner
- * height 2 looks as follows:
- *
- * <pre>
- * <div>
- * <div style="margin:0 2px"></div>
- * <div style="margin:0 1px"></div>
- * <div>your widget</div>
- * <div style="margin:0 1px"></div>
- * <div style="margin:0 2px"></div>
- * </div>
- * </pre>
- *
- * To add the rounded corners to a widget start simply wrap your own widget in
- * the <code>RoundedPanel</code> class, for example with all corners rounded:
- *
- * <pre>
- * // all 4 corners are rounded.
- * RoundedPanel rp = new RoundedPanel(yourWidget);
- * // use rp where you would use 'yourWidget' otherwise
- * </pre>
- *
- * Or with custom set corners, like only on the left:
- *
- * <pre>
- * // custom set corners
- * RoundedPanel rp = new RoundedPanel(yourWidget, RoundedPanel.LEFT);
- * // use rp where you would use 'yourWidget' otherwise
- * </pre>
- *
- * By default the height of the corners is 2px. It is possible to set a
- * different height at construction time. The height can be a value between and
- * including 1 and 9. This value doesn't correspond exactly with the height,
- * e.g. 9 is 12px heigh.
- *
- * <pre>
- * // all 4 corners are rounded and height index 5
- * RoundedPanel rp = new RoundedPanel(yourWidget, ALL, 5);
- * // use rp where you would use 'yourWidget' otherwise
- * </pre>
- *
- * Programmatically set the color of the corners with
- * {@link #setCornerColor(String)}:
- *
- * <pre>
- * // all 4 corners are rounded.
- * RoundedPanel rp = new RoundedPanel(yourWidget);
- * rp.setCornerColor("red");
- * </pre>
- *
- * Default the css style name of the rounded corner divs is <code>cbg-RP</code>.
- * Use it to set the colors of the corner. For example:
- *
- * <pre>
- * .cbg-RP { background-color:#c3d9ff; }
- * </pre>
- *
- * A custom style might be needed when the corners are visible only when a panel
- * is selected (see the KitchenSink example modification below). Use the
- * <code>setCornerStyleName</code> method to set the custom style name. For
- * example set a custom style <code>my-RP</code> and add something like the
- * following to the stylesheet:
- *
- * <pre>
- * .selected .my-RP { background-color:#c3d9ff; }
- * </pre>
- *
- * <h3>Adding rounded corners to DialogBox widgets</h3> Adding rounded corners
- * to a <code>DialogBox</code> is somewhat more complicated. The problem with
- * <code>DialogBox</code> is that it uses a private panel and the
- * <code>RoundedPanel</code> should be applied to this private
- * <code>Panel</code>. To add the rounded corners to a <code>DialogBox</code>
- * you have to rewrite the implementation of the <code>DialogBox</code>. For the
- * <code>DialogBox</code> widget this can be done as follows. First create a new
- * class like <code>RoundedDialogBox</code> and copy the code from the original
- * <code>DialogBox</code> (Please take the copyright of this class into
- * account). Next make the following changes to the code:
- *
- * <pre>
- * // Private variable for RoundedPanel
- * private RoundedPanel rp;
- * </pre>
- *
- * In the constructor change:
- *
- * <pre>
- * super.add(panel);
- * </pre>
- *
- * into:
- *
- * <pre>
- * rp = new RoundedPanel(panel);
- * super.add(rp);
- * </pre>
- *
- * Next change the style, otherwise the style of the dialog box is applied to
- * the rounded lines too. Do this by changing the following line:
- *
- * <pre>
- * setStyleName("gwt-DialogBox");
- * </pre>
- *
- * into:
- *
- * <pre>
- * panel.setStyleName("gwt-DialogBox");
- * </pre>
- *
- * In your css add the color of the border, something like:
- *
- * <pre>
- * .cbg-RP { background-color:#AAAAAA; }
- * </pre>
- *
- * There seems to be a problem with the width under IE. The RoundedPanel divs
- * don't follow the width of the dialog. To fix this change the
- * <code>show</code> method as follows:
- *
- * <pre>
- * public void show() {
- * super.show();
- * // (The width must be set after the super.show() otherwise it will be 0).
- * // NOTE: As of GWT 1.1 the .getOffsetWidth() returns 0 at this point.
- * // This is different with earlier versions of GWT. Disable the line will make
- * // the rounded corners work in at least Firefox 1.5, but not in IE.
- * // I'm looking into this issue.
- * rp.setWidth(panel.getOffsetWidth() + "px");
- * }
- * </pre>
- *
- * Now by extending your own dialog class on this <code>RoundedDialogBox</code>
- * instead of the original <code>DialogBox</code> you will have rounded corners
- * around your dialog.
- *
- *
- * @author Hilbrand Bouwkamp(hs(a)bouwkamp.com)
- * @version 1.3
- */
-public class RoundedPanel extends SimplePanel {
-
- private static final String _1PX = "1px";
- private static final String _2PX = "2px";
- private static final String _3PX = "3px";
- private static final String _4PX = "4px";
- private static final String _5PX = "5px";
- private static final String _6PX = "6px";
-
- /**
- * <code>TOPLEFT</code> top left rounded corner
- */
- public final static int TOPLEFT = 1;
-
- /**
- * <code>TOPRIGHT</code> top right rounded corner
- */
- public final static int TOPRIGHT = 2;
-
- /**
- * <code>BOTTOMLEFT</code> bottom left rounded corner
- */
- public final static int BOTTOMLEFT = 4;
-
- /**
- * <code>BOTTOMRIGHT</code> bottom right rounded corner
- */
- public final static int BOTTOMRIGHT = 8;
-
- /**
- * <code>BOTTOM</code> rounded corners at the top
- */
- public final static int TOP = TOPLEFT | TOPRIGHT;
-
- /**
- * <code>TOP</code> rounded corners at the bottom
- */
- public final static int BOTTOM = BOTTOMLEFT | BOTTOMRIGHT;
-
- /**
- * <code>LEFT</code> rounded corners on the left side
- */
- public final static int LEFT = TOPLEFT | BOTTOMLEFT;
-
- /**
- * <code>RIGHT</code> rounded corners on the right side
- */
- public final static int RIGHT = TOPRIGHT | BOTTOMRIGHT;
-
- /**
- * <code>ALL</code> rounded corners on all sides
- */
- public final static int ALL = TOP | BOTTOM;
-
- /**
- * Default border style
- */
- private final static String RPSTYLE = "cbg-RP";
-
- /**
- * Lookup table for corner border width
- */
- private final static String[][] CORNERBORDER = { { _1PX }, { _1PX, _1PX }, { _1PX, _1PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX }, { _1PX, _1PX, _1PX, _2PX, _1PX }, { _1PX, _1PX, _1PX, _1PX, _2PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX, _1PX, _2PX, _1PX }, { _1PX, _1PX, _1PX, _1PX, _1PX, _2PX, _2PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX, _1PX, _1PX, _2PX, _3PX, _1PX } };
-
- /**
- * Lookup table for corner height
- */
- private final static String[][] CORNERHEIGHT = { { _1PX }, { _1PX, _1PX }, { _1PX, _1PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX }, { _2PX, _1PX, _1PX, _1PX, _1PX }, { _2PX, _1PX, _1PX, _1PX, _1PX, _1PX },
- { _2PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX }, { _2PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX },
- { _3PX, _2PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX } };
-
- /**
- * Lookup table for corner margin
- */
- private final static String[][] CORNERMARGIN = { { _1PX }, { _1PX, _2PX }, { _1PX, _2PX, _3PX },
- { _1PX, _2PX, _3PX, _4PX }, { _1PX, _2PX, _3PX, _4PX, _6PX }, { _1PX, _2PX, _3PX, _4PX, _5PX, "7px" },
- { _1PX, _2PX, _3PX, _4PX, _5PX, _6PX, "8px" }, { _1PX, _2PX, _3PX, _4PX, _5PX, _6PX, "8px", "10px" },
- { _1PX, _2PX, _3PX, _4PX, _5PX, _6PX, "7px", "9px", "12px" }, };
-
- /**
- * Element array containing all div elements of the top corner div's.
- */
- protected final Element[] divt;
-
- /**
- * Element array containing all div elements of the bottom corner div's.
- */
- protected final Element[] divb;
-
- /**
- * Index of the corner height.
- */
- protected final int cornerHeight;
-
- /**
- * Index of which corners are set.
- */
- protected final int corners;
-
- private final Element body; // body of widget
- private final Element divElement; // div element containing widget
-
- /**
- * Creates a new <code>RoundedPanel</code> with all corners rounded and
- * height of corners 2px. Use <code>setWidget</code> to add the widget.
- */
- public RoundedPanel() {
- this(ALL, 2);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounding and height
- * of corners 2px but with no widget set. Use <code>setWidget</code> to add
- * widget.
- *
- * Every combination of corners can be set via <code>corners</code>. Use the
- * static constants to set the corners. For example, to create a panel with
- * only rounded corners at the left, use:
- *
- * <code>new RoundedPanel(yourWidget, RoundedPanel.LEFT);</code>
- *
- * @param corners
- * set custom rounded corners
- */
- public RoundedPanel(final int corners) {
- this(corners, 2);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounding and custom
- * height of the corners but with no widget set. Height can be value from 1
- * to 9. The height for a value 5 or higher is actually larger, e.g. for 5
- * the height is 6px. Use {@link #setWidget(Widget)} to add widget.
- *
- * @param corners
- * set custom rounded corners
- * @param cornerHeight
- * height index between and including 1 and 9
- * @throws IndexOutOfBoundsException
- * when cornerHeight below 1 or above 9
- */
- public RoundedPanel(final int corners, final int cornerHeight) {
- super(DOM.createDiv());
- body = getElement();
- if (cornerHeight < 1 || cornerHeight > 9) {
- throw new IndexOutOfBoundsException("RoundedPanel height range between and including 1 and 9");
- }
- this.cornerHeight = cornerHeight;
- divt = new Element[cornerHeight];
- divb = new Element[cornerHeight];
- this.corners = corners;
- if (inMask(corners, TOP)) {
- final int ct = corners & TOP;
-
- for (int i = 0; i < cornerHeight; ++i) {
- divt[i] = addLine(ct, cornerHeight - (i + 1));
- }
- }
- divElement = DOM.createDiv();
- DOM.appendChild(body, divElement);
- if (inMask(corners, BOTTOM)) {
- final int cb = corners & BOTTOM;
-
- for (int i = cornerHeight - 1; i >= 0; --i) {
- divb[i] = addLine(cb, cornerHeight - (i + 1));
- }
- }
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 14:17
- setCornerStyleName(RPSTYLE);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with all corners rounded and
- * height 2px on the widget <code>w</code>.
- *
- * @param w
- * widget to add corners to
- */
- public RoundedPanel(final Widget w) {
- this(w, ALL);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounded corners and
- * height 2px on the widget <code>w</code>.
- *
- * @param w
- * widget to add corners to
- * @param corners
- * set custom rounded corners
- */
- public RoundedPanel(final Widget w, final int corners) {
- this(w, corners, 2);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounded corners and
- * custom height on widget <code>w</code>.
- *
- * @param w
- * widget to add corners to
- * @param corners
- * set custom rounded corners
- * @param cornerHeight
- * height index between and including 1 and 9
- */
- public RoundedPanel(final Widget w, final int corners, final int cornerHeight) {
- this(corners, cornerHeight);
- setWidget(w);
- }
-
- /**
- * <p>
- * Set the bolder color of the rounded corner by setting the background
- * color of the div's.
- * </p>
- *
- * @param borderColor
- * border color
- */
- public void setCornerColor(final String borderColor) {
- if (null != divt[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setStyleAttribute(divt[i], "backgroundColor", borderColor);
- }
- }
- if (null != divb[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setStyleAttribute(divb[i], "backgroundColor", borderColor);
- }
- }
- }
-
- /**
- * Set the css style name of the rounded corners div's. Default the css
- * stylename is <code>cbg-RP</code>. Use it to set the colors of the corner.
- * For example: <code>.cbg-RP { background-color:#c3d9ff; }</code>.
- *
- * A custom style might be needed when the corners are visible only when a
- * panel is selected. Use this method to set the custom style name and add
- * something like the following to the stylesheet:
- *
- * <code>.selected .cbg-RP { background-color:#c3d9ff; }</code> Setting the
- * color is also possible via the method {@link #setCornerColor(String)}.
- *
- * @param style
- * css style name
- */
- public void setCornerStyleName(final String style) {
- if (null != divt[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setElementProperty(divt[i], "className", style);
- }
- }
- if (null != divb[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setElementProperty(divb[i], "className", style);
- }
- }
- }
-
- /**
- * Set the style of the RoundedPanel. In most cases this is not necessary
- * and setting the style on the widget to which the
- * <code>RoundedPanel</code> is applied should be set, as is done when not
- * using the <code>RoundedPanel</code>
- *
- * @param style
- * css style name
- */
- @Override
- public void setStyleName(final String style) {
- DOM.setElementProperty(body, "className", style);
- }
-
- /**
- * Overwrite of parent getContainerElement()
- */
- @Override
- protected Element getContainerElement() {
- return divElement;
- }
-
- /**
- * Creates div element representing part of the rounded corner.
- *
- * @param corner
- * corner mask to set rounded corner
- * @param heightIndex
- * margin width for line
- */
- private Element addLine(final int corner, final int heightIndex) {
- // margin 2 fields : top/bottom right/left => "0 <width>px"
- // margin 4 fields : top right bottom left => "0 <width>px 0 <width>px"
- final String margin = corner == TOP || corner == BOTTOM ? "0 "
- + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : inMask(corner, LEFT) ? "0 0 0 "
- + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : "0 "
- + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] + " 0 0";
- final Element div = DOM.createDiv();
-
- DOM.setStyleAttribute(div, "fontSize", "0px");
- DOM.setStyleAttribute(div, "height", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
- DOM.setStyleAttribute(div, "borderWidth", "0 " + RoundedPanel.CORNERBORDER[cornerHeight - 1][heightIndex]);
- DOM.setStyleAttribute(div, "lineHeight", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
- DOM.setStyleAttribute(div, "margin", margin);
- DOM.setInnerHTML(div, " ");
- DOM.appendChild(body, div);
- return div;
- }
-
- /**
- * Convenience method to check if given <code>input</code> is with the
- * <code>mask</code>.
- *
- * @param input
- * input to check
- * @param mask
- * mask to check against
- * @return true if input within mask
- */
- private boolean inMask(final int input, final int mask) {
- return (input & mask) > 0;
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,107 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class SimpleToolbar extends Composite implements AbstractToolbar {
-
- private final HorizontalPanel childPanel;
- private final HorizontalPanel mainPanel;
-
- public SimpleToolbar() {
- mainPanel = new HorizontalPanel();
- childPanel = new HorizontalPanel();
- mainPanel.add(childPanel);
- initWidget(mainPanel);
- mainPanel.setWidth("100%");
- }
-
- public void add(final Widget widget) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void add(final Widget widget, VerticalAlignmentConstant valign) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, valign);
- }
-
- public Widget addFill() {
- final Label emptyLabel = new Label("");
- this.add(emptyLabel);
- childPanel.setCellWidth(emptyLabel, "100%");
- return emptyLabel;
- }
-
- public Widget addSeparator() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-sep");
- emptyLabel.addStyleName("k-toolbar-sep");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSpacer() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-spacer");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public void insert(final Widget widget, int position) {
- childPanel.insert(widget, position);
- childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void remove(final Widget widget) {
- childPanel.remove(widget);
- }
-
- public void removeAll() {
- childPanel.clear();
- }
-
- public void setBlankStyle() {
- setBasicStyle();
- addStyleName("k-blank-toolbar");
- }
-
- @Override
- public void setHeight(String height) {
- mainPanel.setHeight(height);
- mainPanel.setCellHeight(childPanel, height);
- }
-
- public void setNormalStyle() {
- setBasicStyle();
- addStyleName("k-toolbar-bottom-line");
- }
-
- private void setBasicStyle() {
- setStyleName("x-toolbar");
- addStyleName("x-panel");
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public abstract class AbstractPopupPanel {
-
- private PopupPanel popupPalette;
- protected Widget widget;
-
- private final boolean autoHide;
- private final boolean modal;
-
- public AbstractPopupPanel() {
- this(true, true);
- }
-
- public AbstractPopupPanel(final boolean autohide) {
- this(autohide, false);
- }
-
- public AbstractPopupPanel(final boolean autohide, final boolean modal) {
- this.autoHide = autohide;
- this.modal = modal;
- }
-
- public void addStyleName(final String style) {
- assert popupPalette != null;
- popupPalette.addStyleName(style);
- }
-
- public void hide() {
- if (popupPalette != null) {
- popupPalette.hide();
- }
- }
-
- public boolean isVisible() {
- if (popupPalette != null && popupPalette.isVisible()) {
- return true;
- }
- return false;
- }
-
- public void show(final int left, final int top) {
- popupPalette = new PopupPanel(autoHide, modal);
- popupPalette.addStyleName("k-def-popup");
- if (widget == null) {
- createWidget();
- }
- popupPalette.setWidget(widget);
- popupPalette.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
- public void setPosition(final int offsetWidth, final int offsetHeight) {
- final int maxLeft = Window.getClientWidth() - offsetWidth;
- final int maxTop = Window.getClientHeight() - offsetHeight;
- popupPalette.setPopupPosition(left < maxLeft ? left : maxLeft, top < maxTop ? top : maxTop);
- }
- });
- }
-
- protected abstract void createWidget();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Window;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-
-public class BasicDialog extends Window {
-
- public BasicDialog(final String caption, final boolean modal) {
- this(Ext.generateId(), caption, modal, false);
- }
-
- public BasicDialog(final String caption, final boolean modal, final boolean autoScroll, final int width,
- final int height) {
- this(Ext.generateId(), caption, modal, autoScroll, width, height, width, height);
- }
-
- public BasicDialog(final String caption, final boolean modal, final boolean autoScroll, final int width,
- final int height, final int minWidth, final int minHeight) {
- this(Ext.generateId(), caption, modal, autoScroll, width, height, minWidth, minHeight);
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal) {
- this(id, caption, modal, false);
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll) {
- setId(id);
- setBorder(false);
- setAutoWidth(true);
- // Param values
- setTitle(caption);
- setModal(modal);
- setAutoScroll(autoScroll);
- // Def values
- setShadow(true);
- setPlain(true);
- setClosable(true);
- setCollapsible(true);
- setResizable(true);
- setCloseAction(Window.HIDE);
- setButtonAlign(Position.RIGHT);
- addListener(new WindowListenerAdapter() {
- @Override
- public void onMove(final BoxComponent component, final int x, final int y) {
- checkPosition(component, x, y);
- }
-
- @Override
- public void onShow(final Component component) {
- checkPosition(BasicDialog.this, component.getAbsoluteLeft(), component.getAbsoluteTop());
- }
-
- private void checkPosition(final BoxComponent component, final int x, final int y) {
- if (y < 0) {
- component.setPagePosition(x, 0);
- }
- }
- });
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll,
- final int width, final int height) {
- this(id, caption, modal, autoScroll, width, height, width, height);
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll,
- final int width, final int height, final int minWidth, final int minHeight) {
- this(id, caption, modal, autoScroll);
- setAutoWidth(false);
- // Param values
- setWidth(width);
- setHeight(height);
- setMinWidth(minWidth);
- setMinHeight(minHeight);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.google.gwt.user.client.ui.Widget;
-
-public class BasicPopupPanel extends AbstractPopupPanel {
-
- public BasicPopupPanel() {
- super();
- }
-
- public BasicPopupPanel(final boolean autohide) {
- super(autohide);
- }
-
- public BasicPopupPanel(final boolean autohide, final boolean modal) {
- super(autohide, modal);
- }
-
- public void setWidget(final Widget widget) {
- this.widget = widget;
- }
-
- @Override
- protected void createWidget() {
- // Nothing
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,156 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.PaddedPanel;
-import com.gwtext.client.widgets.form.Field;
-import com.gwtext.client.widgets.form.FieldSet;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.Label;
-import com.gwtext.client.widgets.form.event.FormPanelListener;
-
-public class DefaultForm {
-
- public static final int DEF_FIELD_WIDTH = 200;
- public static final int DEF_SMALL_FIELD_WIDTH = 100;
- public static final int DEF_XSMALL_FIELD_WIDTH = 50;
- public static final int DEF_MEDIUM_FIELD_WIDTH = 150;
- public static final int DEF_FIELD_LABEL_WITH = 75;
-
- private final FormPanel form;
-
- public DefaultForm() {
- this(Position.RIGHT);
- }
-
- public DefaultForm(Position buttonAlign) {
- form = new FormPanel();
- form.setFrame(true);
- form.setPaddings(10);
- form.setBorder(false);
- form.setLabelWidth(DEF_FIELD_LABEL_WITH);
- form.setLabelAlign(Position.RIGHT);
- form.setButtonAlign(buttonAlign);
- form.setHeader(false);
- }
-
- public DefaultForm(String title) {
- this(title, Position.RIGHT);
- }
-
- public DefaultForm(String title, Position buttonAlign) {
- this(buttonAlign);
- form.setTitle(title);
- }
-
- public void add(final Field field) {
- form.add(field);
- }
-
- public void add(final FieldSet fieldset) {
- form.add(fieldset);
- }
-
- public void add(Label label) {
- form.add(label);
- }
-
- public void add(PaddedPanel paddedPanel) {
- form.add(paddedPanel);
- }
-
- public void addButton(final Button button) {
- form.addButton(button);
- }
-
- public void addListener(FormPanelListener listener) {
- form.addListener(listener);
- }
-
- public void addStyleName(final String cls) {
- form.addStyleName(cls);
- }
-
- public Field findField(String id) {
- return form.getForm().findField(id);
- }
-
- public FormPanel getFormPanel() {
- return form;
- }
-
- public void insert(int index, Component component) {
- form.insert(index, component);
- }
-
- public boolean isValid() {
- return form.getForm().isValid();
- }
-
- public void removeStyleName(final String cls) {
- form.removeStyleName(cls);
- }
-
- public void reset() {
- form.getForm().reset();
- }
-
- public void setAutoHeight(final boolean autoHeight) {
- form.setAutoHeight(autoHeight);
- }
-
- public void setAutoWidth(final boolean autoWidth) {
- form.setAutoWidth(autoWidth);
- }
-
- public void setFrame(boolean frame) {
- form.setFrame(frame);
- }
-
- public void setHeight(int height) {
- form.setHeight(height);
- }
-
- public void setHideLabels(boolean hide) {
- form.setHideLabels(hide);
- }
-
- public void setIconCls(String iconCls) {
- form.setIconCls(iconCls);
- }
-
- public void setPaddings(int padding) {
- form.setPaddings(padding);
- }
-
- public void setWidth(int width) {
- form.setWidth(width);
- }
-
- public void validate() {
- final Field[] fields = form.getFields();
- for (Field field : fields) {
- field.validate();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import org.ourproject.kune.platf.client.ui.KuneUiUtils;
-
-import com.gwtext.client.widgets.ToolTip;
-import com.gwtext.client.widgets.form.FieldSet;
-import com.gwtext.client.widgets.form.Radio;
-
-public class DefaultFormUtils {
-
- public static String br() {
- return "<br/>";
- }
-
- public static String brbr() {
- return "<br/><br/>";
- }
-
- public static Radio createRadio(final FieldSet fieldSet, final String radioLabel, final String radioFieldName,
- final String radioTip, final String id) {
- Radio radio = new Radio();
- radio.setName(radioFieldName);
- radio.setAutoCreate(true);
- radio.setHideLabel(true);
- radio.setId(id);
- fieldSet.add(radio);
-
- if (radioTip != null) {
- radio.setBoxLabel(KuneUiUtils.genQuickTipLabel(radioLabel, null, radioTip));
- ToolTip tooltip = new ToolTip();
- tooltip.setHtml(radioTip);
- tooltip.setWidth(250);
- tooltip.applyTo(radio);
- } else {
- radio.setBoxLabel(radioLabel);
- }
- return radio;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.form.Form;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.layout.FormLayout;
-
-public class DefaultTabbedForm {
- private final FormPanel formPanel;
- private final TabPanel tabPanel;
-
- public DefaultTabbedForm(final int width, final int labelWidth) {
- formPanel = new FormPanel();
- formPanel.setFrame(true);
- formPanel.setLabelWidth(labelWidth);
- formPanel.setBorder(false);
- formPanel.setWidth(width);
- formPanel.setButtonAlign(Position.RIGHT);
-
- tabPanel = new TabPanel();
- tabPanel.setActiveTab(0);
- formPanel.add(tabPanel);
- }
-
- public void addButton(final Button button) {
- formPanel.addButton(button);
- }
-
- public void addTab(final String title, final Panel tab) {
- tab.setTitle(title);
- tab.setLayout(new FormLayout());
- tab.setAutoHeight(true);
- tab.setPaddings(10);
- tabPanel.add(tab);
- if (formPanel.isRendered()) {
- formPanel.doLayout();
- }
- }
-
- public Form getForm() {
- return formPanel.getForm();
- }
-
- public Component getPanel() {
- return formPanel;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,93 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.layout.FitLayout;
-
-public class ExtendedDialog extends BasicDialog {
-
- private final Button cancel;
- private final Button firstButton;
-
- public ExtendedDialog(final String dialogId, final String title, final boolean modal,
- final boolean autoscroll, final int width, final int heigth, final String icon,
- final String firstButtonTitle, final String cancelButtonTitle, final Listener0 onFirstButtonClick,
- final Listener0 onCancelButtonClick, final int tabIndexStart) {
- this(dialogId, title, modal, autoscroll, width, heigth, icon, firstButtonTitle, Ext.generateId(),
- cancelButtonTitle, Ext.generateId(), onFirstButtonClick, onCancelButtonClick, tabIndexStart);
- }
-
- public ExtendedDialog(final String dialogId, final String title, final boolean modal,
- final boolean autoscroll, final int width, final int heigth, final String icon,
- final String firstButtonTitle, final String firstButtonId, final String cancelButtonTitle,
- final String cancelButtonId, final Listener0 onFirstButtonClick, final Listener0 onCancelButtonClick,
- final int tabIndexStart) {
- super(dialogId, title, modal, autoscroll, width, heigth);
- setLayout(new FitLayout());
- setCollapsible(false);
- setButtonAlign(Position.RIGHT);
- setIconCls(icon);
-
- firstButton = new Button(firstButtonTitle);
- firstButton.setId(firstButtonId);
- firstButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject event) {
- onFirstButtonClick.onEvent();
- }
- });
-
- firstButton.setTabIndex(tabIndexStart);
-
- cancel = new Button(cancelButtonTitle);
- cancel.setId(cancelButtonId);
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject event) {
- onCancelButtonClick.onEvent();
- }
- });
- cancel.setTabIndex(tabIndexStart + 1);
- addButton(firstButton);
- addButton(cancel);
- }
-
- public Button getCancel() {
- return cancel;
- }
-
- public Button getFirstButton() {
- return firstButton;
- }
-
- public void mask(final String message) {
- getEl().mask(message, "x-mask-loading");
- }
-
- public void unMask() {
- getEl().unmask();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,86 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-@Deprecated
-public class InfoDialog extends BasicDialog {
-
- private final Panel mainPanel;
-
- public InfoDialog(final String dialogId, final String title, final String okButtonText, final String okButtonId,
- final boolean modal, final boolean autoScroll, final int width, final int height) {
- super(dialogId, title, modal, autoScroll, width, height);
- final Button okButton = new Button(okButtonText);
- okButton.setId(okButtonId);
- okButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- destroy();
- }
- });
- mainPanel = new Panel();
- mainPanel.setBorder(false);
- mainPanel.setHeader(false);
- mainPanel.setPaddings(20);
- super.add(mainPanel);
- addButton(okButton);
- }
-
- public InfoDialog(final String dialogId, final String title, final String header, final String text,
- final String okButtonText, final String okButtonId, final boolean modal, final boolean autoScroll,
- final int width, final int height) {
- this(dialogId, title, header, text, okButtonText, okButtonId, modal, autoScroll, width, height, false);
- }
-
- public InfoDialog(final String dialogId, final String title, final String header, final String text,
- final String okButtonText, final String okButtonId, final boolean modal, final boolean autoScroll,
- final int width, final int height, final boolean isHtml) {
- this(dialogId, title, okButtonText, okButtonId, modal, autoScroll, width, height);
-
- final Label headerLabel = new Label(header);
- Widget textLabel;
- if (isHtml) {
- textLabel = new HTML(text);
- } else {
- textLabel = new Label(text);
- }
-
- mainPanel.add(headerLabel);
- mainPanel.add(textLabel);
-
- headerLabel.addStyleName("k-infod-head");
- }
-
- public void add(final Panel panel) {
- mainPanel.add(panel);
- }
-
- public void setMainPanelPaddings(final int padding) {
- mainPanel.setPaddings(padding);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,305 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser;
-
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Toolbar;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-import com.gwtext.client.widgets.layout.FitLayout;
-
-public class WizardDialog implements WizardDialogView {
-
- private final Button backButton;
- private final Button cancelButton;
- private final DeckPanel deck;
- private final BasicDialog dialog;
- private final Button finishButton;
- private final I18nTranslationService i18n;
- private final Panel mainPanel;
- private final Button nextButton;
-
- public WizardDialog(final String dialogId, final String caption, final boolean modal,
- final boolean minimizable, final int width, final int height, final int minWidth,
- final int minHeight, final String backId, final String nextId, final String finishId,
- final String cancelId, final String closeId, final I18nTranslationService i18n,
- final WizardListener listener) {
- dialog = new BasicDialog(dialogId, caption, modal, false, width, height, minWidth, minHeight);
- this.i18n = i18n;
- dialog.setCollapsible(minimizable);
- dialog.setShadow(true);
- dialog.setPlain(true);
- dialog.setCollapsible(false);
- dialog.setResizable(false);
- dialog.setId(dialogId);
-
- backButton = new Button(i18n.tWithNT("« Back", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onBack();
- }
- });
- backButton.setId(backId);
- dialog.addButton(backButton);
-
- nextButton = new Button(i18n.tWithNT("Next »", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onNext();
- }
- });
- nextButton.setId(nextId);
- dialog.addButton(nextButton);
-
- cancelButton = new Button(i18n.tWithNT("Cancel", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onCancel();
- }
- });
- cancelButton.setId(cancelId);
- dialog.addButton(cancelButton);
-
- finishButton = new Button(i18n.tWithNT("Finish", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onFinish();
- }
- });
- finishButton.setId(finishId);
- dialog.addButton(finishButton);
-
- dialog.addListener(new WindowListenerAdapter() {
- @Override
- public void onHide(final Component component) {
- listener.onClose();
- }
- });
- mainPanel = new Panel();
- mainPanel.setLayout(new FitLayout());
- deck = new DeckPanel();
- mainPanel.add(deck);
- }
-
- public WizardDialog(final String dialogId, final String caption, final boolean modal,
- final boolean minimizable, final int width, final int height, final WizardListener listener,
- final I18nTranslationService i18n, final String backId, final String nextId,
- final String finishId, final String cancelId, final String closeId) {
- this(dialogId, caption, modal, minimizable, width, height, width, height, backId, nextId, finishId,
- cancelId, closeId, i18n, listener);
- }
-
- @Override
- public void add(final View view) {
- deck.add(toWidget(view));
- doLayoutIfNeeded();
- }
-
- @Override
- public void center() {
- dialog.center();
- }
-
- @Override
- public void clear() {
- dialog.clear();
- }
-
- private void doLayoutIfNeeded() {
- if (dialog.isRendered()) {
- dialog.doLayout();
- mainPanel.syncSize();
- mainPanel.doLayout();
- }
- }
-
- private int getWidgetCount(final View view) {
- if (view instanceof Widget) {
- return deck.getWidgetIndex((Widget) view);
- } else if (view instanceof DefaultForm) {
- return deck.getWidgetIndex(((DefaultForm) view).getFormPanel());
- }
- return -1;
- }
-
- @Override
- public void hide() {
- dialog.hide();
- }
-
- @Override
- public boolean isCurrentPage(final View view) {
- final int visibleWidgetIndex = deck.getVisibleWidget();
- if (visibleWidgetIndex == -1) {
- return false;
- } else {
- return deck.getWidget(visibleWidgetIndex).equals(toWidget(view));
- }
- }
-
- @Override
- public void mask(final String message) {
- dialog.getEl().mask(message, "x-mask-loading");
- }
-
- @Override
- public void maskProcessing() {
- mask(i18n.t("Processing"));
- }
-
- @Override
- public void remove(final View view) {
- final int count = getWidgetCount(view);
- if (count != -1) {
- deck.remove(count);
- }
- }
-
- public void setBottomToolbar1(final Toolbar toolbar) {
- dialog.setBottomToolbar(toolbar);
- }
-
- @Override
- public void setEnabled(final boolean back, final boolean next, final boolean cancel,
- final boolean finish) {
- setEnabledBackButton(back);
- setEnabledNextButton(next);
- setEnabledCancelButton(cancel);
- setEnabledFinishButton(finish);
- }
-
- @Override
- public void setEnabledBackButton(final boolean enabled) {
- if (enabled) {
- backButton.enable();
- } else {
- backButton.disable();
- }
- }
-
- @Override
- public void setEnabledCancelButton(final boolean enabled) {
- if (enabled) {
- cancelButton.enable();
- } else {
- cancelButton.disable();
- }
- }
-
- @Override
- public void setEnabledFinishButton(final boolean enabled) {
- if (enabled) {
- finishButton.enable();
- } else {
- finishButton.disable();
- }
- }
-
- @Override
- public void setEnabledNextButton(final boolean enabled) {
- if (enabled) {
- nextButton.enable();
- } else {
- nextButton.disable();
- }
- }
-
- @Override
- public void setFinishText(final String text) {
- finishButton.setText(text);
- }
-
- public void setIconCls(final String iconCls) {
- dialog.setIconCls(iconCls);
- }
-
- @Override
- public void setVisible(final boolean back, final boolean next, final boolean cancel,
- final boolean finish) {
- setVisibleBackButton(back);
- setVisibleNextButton(next);
- setVisibleCancelButton(cancel);
- setVisibleFinishButton(finish);
- }
-
- @Override
- public void setVisibleBackButton(final boolean visible) {
- backButton.setVisible(visible);
- }
-
- @Override
- public void setVisibleCancelButton(final boolean visible) {
- cancelButton.setVisible(visible);
- }
-
- @Override
- public void setVisibleFinishButton(final boolean visible) {
- finishButton.setVisible(visible);
- }
-
- @Override
- public void setVisibleNextButton(final boolean visible) {
- nextButton.setVisible(visible);
- }
-
- @Override
- public void show() {
- dialog.show();
- }
-
- @Override
- public void show(final View view) {
- final int count = getWidgetCount(view);
- if (count != -1) {
- deck.showWidget(count);
- dialog.add(mainPanel);
- doLayoutIfNeeded();
- } else {
- OldNotifyUser.error("Widget not found in deck of WizardDialog");
- }
-
- }
-
- private Widget toWidget(final View view) {
- if (view instanceof Widget) {
- return (Widget) view;
- } else if (view instanceof DefaultForm) {
- return ((DefaultForm) view).getFormPanel();
- } else {
- OldNotifyUser.error("Trying to add a unknown element in WizardDialog");
- return null;
- }
- }
-
- @Override
- public void unMask() {
- dialog.getEl().unmask();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface WizardDialogView extends View {
-
- void add(View view);
-
- void center();
-
- void clear();
-
- void hide();
-
- boolean isCurrentPage(View view);
-
- void mask(final String message);
-
- void maskProcessing();
-
- void remove(View view);
-
- void setEnabled(boolean back, boolean next, boolean cancel, boolean finish);
-
- void setEnabledBackButton(final boolean enabled);
-
- void setEnabledCancelButton(final boolean enabled);
-
- void setEnabledFinishButton(final boolean enabled);
-
- void setEnabledNextButton(final boolean enabled);
-
- void setFinishText(final String text);
-
- void setVisible(boolean back, boolean next, boolean cancel, boolean finish);
-
- void setVisibleBackButton(final boolean visible);
-
- void setVisibleCancelButton(final boolean visible);
-
- void setVisibleFinishButton(final boolean visible);
-
- void setVisibleNextButton(final boolean visible);
-
- void show();
-
- void show(View view);
-
- void unMask();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.dialogs;
-
-public interface WizardListener {
-
- void onBack();
-
- void onNext();
-
- void onFinish();
-
- void onCancel();
-
- void onClose();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,733 +0,0 @@
-/*
- * Copyright 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl;
-import org.xwiki.gwt.dom.client.Document;
-import org.xwiki.gwt.dom.client.IFrameElement;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.logical.shared.HasInitializeHandlers;
-import com.google.gwt.event.logical.shared.InitializeEvent;
-import com.google.gwt.event.logical.shared.InitializeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.FocusWidget;
-import com.google.gwt.user.client.ui.HasHTML;
-
-/**
- * A rich text editor that allows complex styling and formatting.
- *
- * Because some browsers do not support rich text editing, and others support
- * only a limited subset of functionality, there are two formatter interfaces,
- * accessed via {@link #getBasicFormatter()} and {@link #getExtendedFormatter()}
- * . A browser that does not support rich text editing at all will return
- * <code>null</code> for both of these, while one that supports only the basic
- * functionality will return <code>null</code> for the latter.
- *
- * <p>
- * <img class='gallery' src='doc-files/RichTextArea.png'/>
- * </p>
- *
- * <h3>CSS Style Rules</h3>
- * <dl>
- * <dt>.gwt-RichTextArea</dt>
- * <dd>Applied to the rich text element.</dd>
- * </dl>
- */
-public class RichTextArea extends FocusWidget implements HasHTML, HasInitializeHandlers {
-
- /**
- * <p>
- * This interface is used to access basic formatting options, when
- * available. If the implementation supports basic formatting, then
- * {@link RichTextArea#getBasicFormatter()} will return an instance of this
- * class.
- * </p>
- * <p>
- * The formatter will format the user selected text in the
- * {@link RichTextArea}. As a result, it will only work reliably if the
- * {@link RichTextArea} is attached, visible to on the page, and has been
- * focused at least once. If you just want to initialize the content of the
- * {@link RichTextArea}, use {@link RichTextArea#setHTML(String)} instead.
- * </p>
- *
- * @deprecated use {@link RichTextArea.Formatter} instead
- */
- @Deprecated
- public interface BasicFormatter {
-
- /**
- * Gets the background color.
- *
- * @return the background color
- */
- String getBackColor();
-
- /**
- * Gets the foreground color.
- *
- * @return the foreground color
- */
- String getForeColor();
-
- /**
- * Is the current region bold?
- *
- * @return true if the current region is bold
- */
- boolean isBold();
-
- /**
- * Is the current region italic?
- *
- * @return true if the current region is italic
- */
- boolean isItalic();
-
- /**
- * Is the current region subscript?
- *
- * @return true if the current region is subscript
- */
- boolean isSubscript();
-
- /**
- * Is the current region superscript?
- *
- * @return true if the current region is superscript
- */
- boolean isSuperscript();
-
- /**
- * Is the current region underlined?
- *
- * @return true if the current region is underlined
- */
- boolean isUnderlined();
-
- /**
- * Selects all the text.
- */
- void selectAll();
-
- /**
- * Sets the background color.
- *
- * @param color
- * the new background color
- */
- void setBackColor(String color);
-
- /**
- * Sets the font name.
- *
- * @param name
- * the new font name
- */
- void setFontName(String name);
-
- /**
- * Sets the font size.
- *
- * @param fontSize
- * the new font size
- */
- void setFontSize(FontSize fontSize);
-
- /**
- * Sets the foreground color.
- *
- * @param color
- * the new foreground color
- */
- void setForeColor(String color);
-
- /**
- * Sets the justification.
- *
- * @param justification
- * the new justification
- */
- void setJustification(Justification justification);
-
- /**
- * Toggles bold.
- */
- void toggleBold();
-
- /**
- * Toggles italic.
- */
- void toggleItalic();
-
- /**
- * Toggles subscript.
- */
- void toggleSubscript();
-
- /**
- * Toggles superscript.
- */
- void toggleSuperscript();
-
- /**
- * Toggles underline.
- */
- void toggleUnderline();
- }
-
- /**
- * <p>
- * This interface is used to access full formatting options, when available.
- * If the implementation supports full formatting, then
- * {@link RichTextArea#getExtendedFormatter()} will return an instance of
- * this class.
- * </p>
- * <p>
- * The formatter will format the user selected text in the
- * {@link RichTextArea}. As a result, it will only work reliably if the
- * {@link RichTextArea} is attached, visible to on the page, and has been
- * focused at least once. If you just want to initialize the content of the
- * {@link RichTextArea}, use {@link RichTextArea#setHTML(String)} instead.
- * </p>
- *
- * @deprecated use {@link RichTextArea.Formatter} instead
- */
- @Deprecated
- public interface ExtendedFormatter extends BasicFormatter {
-
- void copy();
-
- /**
- * Creates a link to the supplied URL.
- *
- * @param url
- * the URL to be linked to
- */
- void createLink(String url);
-
- void cut();
-
- /*
- * delete all text and objects that are selected.
- */
- void delete();
-
- /**
- * Inserts a horizontal rule.
- */
- void insertHorizontalRule();
-
- /**
- * Inserts an image element.
- *
- * @param url
- * the url of the image to be inserted
- */
- void insertImage(String url);
-
- /**
- * Starts an numbered list. Indentation will create nested items.
- */
- void insertOrderedList();
-
- /**
- * Starts an bulleted list. Indentation will create nested items.
- */
- void insertUnorderedList();
-
- /**
- * Is the current region strikethrough?
- *
- * @return true if the current region is strikethrough
- */
- boolean isStrikethrough();
-
- /**
- * Left indent.
- */
- void leftIndent();
-
- void paste();
-
- void redo();
-
- /**
- * Removes all formatting on the selected text.
- */
- void removeFormat();
-
- /**
- * Removes any link from the selected text.
- */
- void removeLink();
-
- /**
- * Right indent.
- */
- void rightIndent();
-
- /**
- * Toggles strikethrough.
- */
- void toggleStrikethrough();
-
- void undo();
- }
-
- /**
- * Font size enumeration. Represents the seven basic HTML font sizes, as
- * defined in CSS.
- */
- public static class FontSize {
-
- /**
- * Represents a Large font.
- */
- public static final FontSize LARGE = new FontSize(5);
-
- /**
- * Represents a Medium font.
- */
- public static final FontSize MEDIUM = new FontSize(4);
-
- /**
- * Represents a Small font.
- */
- public static final FontSize SMALL = new FontSize(3);
-
- /**
- * Represents an X-Large font.
- */
- public static final FontSize X_LARGE = new FontSize(6);
-
- /**
- * Represents an X-Small font.
- */
- public static final FontSize X_SMALL = new FontSize(2);
-
- /**
- * Represents an XX-Large font.
- */
- public static final FontSize XX_LARGE = new FontSize(7);
-
- /**
- * Represents an XX-Small font.
- */
- public static final FontSize XX_SMALL = new FontSize(1);
-
- private final int number;
-
- private FontSize(final int number) {
- this.number = number;
- }
-
- /**
- * Gets the HTML font number associated with this font size.
- *
- * @return an integer from 1 to 7 inclusive
- */
- public int getNumber() {
- return number;
- }
-
- @Override
- public String toString() {
- return Integer.toString(number);
- }
- }
-
- /**
- * <p>
- * This interface is used to access full formatting options, when available.
- * If the implementation supports full formatting, then
- * {@link RichTextArea#getFormatter()} will return an instance of this
- * class.
- * </p>
- * <p>
- * The formatter will format the user selected text in the
- * {@link RichTextArea}. As a result, it will only work reliably if the
- * {@link RichTextArea} is attached, visible to on the page, and has been
- * focused at least once. If you just want to initialize the content of the
- * {@link RichTextArea}, use {@link RichTextArea#setHTML(String)} instead.
- * </p>
- */
- public interface Formatter extends ExtendedFormatter {
- /**
- * Creates a link to the supplied URL.
- *
- * @param url
- * the URL to be linked to
- */
- void createLink(String url);
-
- /**
- * Gets the background color.
- *
- * @return the background color
- */
- String getBackColor();
-
- /**
- * Gets the foreground color.
- *
- * @return the foreground color
- */
- String getForeColor();
-
- /**
- * Inserts a horizontal rule.
- */
- void insertHorizontalRule();
-
- /**
- * Inserts generic html.
- *
- * @param html
- * the HTML to insert
- */
- void insertHTML(String html);
-
- /**
- * Inserts an image element.
- *
- * @param url
- * the url of the image to be inserted
- */
- void insertImage(String url);
-
- /**
- * Starts an numbered list. Indentation will create nested items.
- */
- void insertOrderedList();
-
- /**
- * Starts an bulleted list. Indentation will create nested items.
- */
- void insertUnorderedList();
-
- /**
- * Is the current region bold?
- *
- * @return true if the current region is bold
- */
- boolean isBold();
-
- /**
- * Is the current region italic?
- *
- * @return true if the current region is italic
- */
- boolean isItalic();
-
- /**
- * Is the current region strikethrough?
- *
- * @return true if the current region is strikethrough
- */
- boolean isStrikethrough();
-
- /**
- * Is the current region subscript?
- *
- * @return true if the current region is subscript
- */
- boolean isSubscript();
-
- /**
- * Is the current region superscript?
- *
- * @return true if the current region is superscript
- */
- boolean isSuperscript();
-
- /**
- * Is the current region underlined?
- *
- * @return true if the current region is underlined
- */
- boolean isUnderlined();
-
- /**
- * Left indent.
- */
- void leftIndent();
-
- /**
- * Redo an action that was just undone.
- */
- void redo();
-
- /**
- * Removes all formatting on the selected text.
- */
- void removeFormat();
-
- /**
- * Removes any link from the selected text.
- */
- void removeLink();
-
- /**
- * Right indent.
- */
- void rightIndent();
-
- /**
- * Selects all the text.
- */
- void selectAll();
-
- /**
- * Sets the background color.
- *
- * @param color
- * the new background color
- */
- void setBackColor(String color);
-
- /**
- * Sets the font name.
- *
- * @param name
- * the new font name
- */
- void setFontName(String name);
-
- /**
- * Sets the font size.
- *
- * @param fontSize
- * the new font size
- */
- void setFontSize(FontSize fontSize);
-
- /**
- * Sets the foreground color.
- *
- * @param color
- * the new foreground color
- */
- void setForeColor(String color);
-
- /**
- * Sets the justification.
- *
- * @param justification
- * the new justification
- */
- void setJustification(Justification justification);
-
- /**
- * Toggles bold.
- */
- void toggleBold();
-
- /**
- * Toggles italic.
- */
- void toggleItalic();
-
- /**
- * Toggles strikethrough.
- */
- void toggleStrikethrough();
-
- /**
- * Toggles subscript.
- */
- void toggleSubscript();
-
- /**
- * Toggles superscript.
- */
- void toggleSuperscript();
-
- /**
- * Toggles underline.
- */
- void toggleUnderline();
-
- /**
- * Undo the last action.
- */
- void undo();
- }
-
- /**
- * Justification enumeration. The three values are <code>left</code>,
- * <code>right</code>, <code>center</code>.
- */
- public static class Justification {
-
- /**
- * Center justification.
- */
- public static final Justification CENTER = new Justification("Center");
-
- /**
- * Full justification.
- */
- public static final Justification FULL = new Justification("Full");
-
- /**
- * Left justification.
- */
- public static final Justification LEFT = new Justification("Left");
-
- /**
- * Right justification.
- */
- public static final Justification RIGHT = new Justification("Right");
-
- private final String tag;
-
- private Justification(final String tag) {
- this.tag = tag;
- }
-
- @Override
- public String toString() {
- return "Justify " + tag;
- }
- }
-
- private final RichTextAreaImpl impl = GWT.create(RichTextAreaImpl.class);
-
- /**
- * Creates a new, blank {@link RichTextArea} object with no stylesheet.
- */
- public RichTextArea() {
- setElement(impl.getElement());
- setStyleName("gwt-RichTextArea");
- impl.setOwner(this);
- }
-
- public HandlerRegistration addInitializeHandler(final InitializeHandler handler) {
- return addHandler(handler, InitializeEvent.getType());
- }
-
- /**
- * Gets the basic rich text formatting interface. Note that formatting can
- * only be done when the {@link RichTextArea} is attached, visible on the
- * page, and has been focused by the user.
- *
- * @return <code>null</code> if basic formatting is not supported
- * @deprecated use {@link #getFormatter()} instead
- */
- @Deprecated
- public BasicFormatter getBasicFormatter() {
- return getFormatter();
- }
-
- /**
- * NOTE: If the current browser doesn't support rich text editing this
- * method returns <code>null</code>. You should test the returned value and
- * fail save to an appropriate behavior!<br/>
- * The appropriate test would be: <code><pre>
- * if (rta.isAttached() && rta.getDocument() == null) {
- * // The current browser doesn't support rich text editing.
- * }
- * </pre></code>
- *
- * @return The DOM document being edited with this rich text area.
- *
- * copied from xwiki
- */
- public Document getDocument() {
- if (getElement().getTagName().equalsIgnoreCase("iframe")) {
- return IFrameElement.as(getElement()).getContentDocument().cast();
- } else {
- return null;
- }
- }
-
- /**
- * Gets the full rich text formatting interface. Note that formatting can
- * only be done when the {@link RichTextArea} is attached, visible on the
- * page, and has been focused by the user.
- *
- * @return <code>null</code> if full formatting is not supported
- * @deprecated use {@link #getFormatter()} instead
- */
- @Deprecated
- public ExtendedFormatter getExtendedFormatter() {
- return getFormatter();
- }
-
- /**
- * Gets the rich text formatting interface. Note that formatting can only be
- * done when the {@link RichTextArea} is attached, visible on the page, and
- * has been focused by the user.
- *
- * @return <code>null</code> if full formatting is not supported
- */
- public Formatter getFormatter() {
- if (impl instanceof Formatter) {
- return (Formatter) impl;
- }
- return null;
- }
-
- public String getHTML() {
- return impl.getHTML();
- }
-
- public String getText() {
- return impl.getText();
- }
-
- @Override
- public boolean isEnabled() {
- return impl.isEnabled();
- }
-
- @Override
- public void setEnabled(final boolean enabled) {
- impl.setEnabled(enabled);
- }
-
- @Override
- public void setFocus(final boolean focused) {
- // There are different problems on each browser when you try to focus an
- // unattached rich text iframe, so just cut it off early.
- Log.debug("Focus setted: " + focused);
- if (isAttached()) {
- impl.setFocus(focused);
- }
- }
-
- public void setHTML(final String html) {
- impl.setHTML(html);
- }
-
- public void setText(final String text) {
- impl.setText(text);
- }
-
- @Override
- protected void onAttach() {
- super.onAttach();
- impl.initElement();
- }
-
- @Override
- protected void onDetach() {
- super.onDetach();
- impl.uninitElement();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,65 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
-import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
-import org.ourproject.kune.platf.client.ui.rte.basic.RTEditorPanel;
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditor;
-
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.widgets.Window;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-
-public class TestRTEDialog {
-
- private final RTESavingEditor editor;
- private final BasicDialog dialog;
-
- public TestRTEDialog(final RTESavingEditor editor) {
- this.editor = editor;
- dialog = new BasicDialog("Testing RTE", false, false, 650, 200);
- final VerticalPanel vp = new VerticalPanel();
-
- vp.add((ComplexToolbar) editor.getTopBar());
- vp.add((ComplexToolbar) editor.getSndBar());
- final RTEditorPanel editorPanel = (RTEditorPanel) editor.getEditorArea();
- vp.add(editorPanel);
- vp.setWidth("100%");
- dialog.add(vp);
- dialog.addListener(new WindowListenerAdapter() {
- @Override
- public void onResize(final Window source, final int width, final int height) {
- final int newHeight = height - 26 * 2 - 40;
- editorPanel.adjustSize(newHeight);
- vp.setCellHeight(editorPanel, "" + newHeight);
- }
- });
- }
-
- public void setExtended(final boolean extended) {
- editor.setExtended(extended);
- }
-
- public void show() {
- editor.attach();
- dialog.show();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplIE6;
-
-/**
- * A wrapper used to inject css into RTA. As published in:
- *
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
- * f64c0024d8676a66
- * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
- *
- * FIXME: Only for IE and Mozilla
- *
- */
-public class WrappedRichTextAreaImplIE6 extends RichTextAreaImplIE6 {
-
- @Override
- public native void initElement() /*-{
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
-
- setTimeout($entry(function() {
- if (_this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing == false) {
- return;
- }
-
- // Attempt to set the iframe document's body to 'contentEditable' mode.
- // There's no way to know when the body will actually be available, so
- // keep trying every so often until it is.
- // Note: The body seems to be missing only rarely, so please don't remove
- // this retry loop just because it's hard to reproduce.
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- if (!doc.body) {
- // Retry in 50 ms. Faster would run the risk of pegging the CPU. Slower
- // would increase the probability of a user-visible delay.
- setTimeout(arguments.callee, 50);
- return;
- }
- var ct = "<html><head><style>@import url('" + $wnd.location.protocol + "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- doc.body.contentEditable = true;
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1));
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,86 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla;
-
-/**
- * A wrapper used to inject css into RTA. As published in:
- *
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
- * f64c0024d8676a66
- * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
- *
- * FIXME: Only for IE and Mozilla
- *
- */
-public class WrappedRichTextAreaImplMozilla extends RichTextAreaImplMozilla {
- boolean isFirstFocus;
-
- @Override
- public native void initElement() /*-{
- // Mozilla doesn't allow designMode to be set reliably until the iframe is
- // fully loaded.
- var _this = this;
- var iframe = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitializing()();
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla::isFirstFocus = true;
-
- iframe.onload = $entry(function() {
- // Some Mozillae have the nasty habit of calling onload again when you set
- // designMode, so let's avoid doing it more than once.
- iframe.onload = null;
-
- // patch ccs inject:
-
- var doc = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document;
- head=doc.getElementsByTagName('head')[0];
- link=document.createElement('link');
- link.setAttribute('rel',"stylesheet");
- link.setAttribute('type',"text/css");
- link.setAttribute('href',$wnd.location.protocol + "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" );
- head.appendChild(link);
-
- // -- patch
-
- // Don't set designMode until the RTA is targeted by an event. This is
- // necessary because editing won't work on Mozilla if the iframe is
- // *hidden, but attached*. Waiting for an event gets around this issue.
- //
- // Note: These events will not conflict with the
- // addEventListener('oneventtype', ...) in RichTextAreaImplStandard.
- iframe.contentWindow.onfocus = function() {
- iframe.contentWindow.onfocus = null;
- iframe.contentWindow.onmouseover = null;
- iframe.contentWindow.document.designMode = 'On';
- };
-
- // Issue 1441: we also need to catch the onmouseover event because focus
- // occurs after mouse down, so the cursor will not appear until the user
- // clicks twice, making the RichTextArea look uneditable. Catching the
- // mouseover event allows us to set design mode earlier. The focus event
- // is still needed to handle tab selection.
- iframe.contentWindow.onmouseover = iframe.contentWindow.onfocus;
-
- // Send notification that the iframe has finished loading.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- });
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOpera;
-
-public class WrappedRichTextAreaImplOpera extends RichTextAreaImplOpera {
- public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitializing()();
- setTimeout($entry(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
-
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" +$wnd.location.protocol+ "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }), 1);
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplSafari;
-
-public class WrappedRichTextAreaImplSafari extends RichTextAreaImplSafari {
-
- @Override
- public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitializing()();
- setTimeout($entry(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
-
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" +$wnd.location.protocol+ "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }), 1);
- }-*/;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-public interface EditHtmlAgent {
-
- String getHtml();
-
- void setHtml(String html);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface EditHtmlDialog extends OldAbstractTabbedDialog {
-
- String getHtml();
-
- void setAgent(EditHtmlAgent agent);
-
- void setCancelListener(Listener0 cancelListener);
-
- void setHtml(String html);
-
- void setUpdateListener(Listener<String> updateListener);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-
-import cc.kune.common.client.notify.NotifyLevel;
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.user.client.Window;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class EditHtmlDialogPanel extends OldAbstractTabbedDialogPanel implements EditHtmlDialogView {
-
- public static final String EDIG_HTML_DIALOG_ERROR_ID = "ehtml-dialgo-error";
- public static final String EDIT_HTML_DIALOG = "ehtml-dialog";
- private Button cancel;
- private final EditHtmlGroup editHtmlGroup;
- private final I18nTranslationService i18n;
- private final EditHtmlDialogPresenter presenter;
-
- public EditHtmlDialogPanel(final EditHtmlDialogPresenter presenter, final I18nTranslationService i18n,
- final RTEImgResources resources, final NotifyLevelImages images, final EditHtmlGroup editHtmlGroup) {
- super(EDIT_HTML_DIALOG, i18n.tWithNT("Edit the HTML",
- "Option in a content editor to edit the html internal code (for advance users)"),
- Window.getClientWidth() - 100, HEIGHT + 80, Window.getClientWidth() - 100, HEIGHT + 80, true, images,
- EDIG_HTML_DIALOG_ERROR_ID);
- this.presenter = presenter;
- this.i18n = i18n;
- this.editHtmlGroup = editHtmlGroup;
- // super.setIconCls(RTEImgResources.SUFFIX +
- // resources.edithtml().getName());
- }
-
- @Override
- public void createAndShow() {
- if (cancel == null) {
- cancel = new Button(i18n.t("Cancel"));
- final Button update = new Button(i18n.t("Update"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- update.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onUpdate();
- }
- });
- super.addButton(update);
- super.addButton(cancel);
- }
- editHtmlGroup.createAll();
- super.createAndShow();
- super.setErrorMessage(i18n.t("This option is only for advanced users"), NotifyLevel.info);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class EditHtmlDialogPresenter extends OldAbstractTabbedDialogPresenter implements EditHtmlDialog {
-
- private Listener<String> updateListener;
- private Listener0 cancelListener;
- private EditHtmlAgent agent;
-
- public EditHtmlDialogPresenter() {
- }
-
- public String getHtml() {
- return agent.getHtml();
- }
-
- public void onCancel() {
- if (cancelListener != null) {
- cancelListener.onEvent();
- }
- hide();
- }
-
- public void onUpdate() {
- if (updateListener != null) {
- // FIXME
- updateListener.onEvent(agent.getHtml());
- }
- hide();
- }
-
- public void setAgent(EditHtmlAgent agent) {
- this.agent = agent;
- }
-
- public void setCancelListener(Listener0 cancelListener) {
- this.cancelListener = cancelListener;
- }
-
- public void setHtml(String html) {
- agent.setHtml(html);
- }
-
- public void setUpdateListener(Listener<String> updateListener) {
- this.updateListener = updateListener;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface EditHtmlDialogView extends OldAbstractTabbedDialogView, View {
-
- int HEIGHT = 225;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class EditHtmlGroup extends ProviderCollection {
-
- public EditHtmlGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,148 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.cobogw.gwt.user.client.CSS;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
-
-import cc.kune.core.client.ui.ContentPosition;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.DOM;
-
-public class ImageInfo {
-
- public static final boolean DEF_WRAP_VALUE = true;
- public static final boolean DEF_CLICK_ORIGINAL_VALUE = false;
-
- public static final String SIZE_ORIGINAL = "original";
- public static final String SIZE_FIT = "fit";
- public static final String SIZE_XS = "xs";
- public static final String SIZE_S = "s";
- public static final String SIZE_M = "m";
- public static final String SIZE_L = "l";
- public static final String SIZE_XL = "xl";
-
- public static String[][] sizes = { new String[] { SIZE_ORIGINAL, "Original image size", "" },
- new String[] { SIZE_FIT, "Fit page width", "100%" },
- new String[] { SIZE_XS, "Thumbnail, up to 160 pixels wide", "160px" },
- new String[] { SIZE_S, "Small, up to 320 pixels wide", "320px" },
- new String[] { SIZE_M, "Medium, up to 640 pixels wide", "640px" },
- new String[] { SIZE_L, "Large, up to 1024 pixels wide", "1024px" },
- new String[] { SIZE_XL, "Extra large, up to 1600 pixels wide", "1600px" } };
-
- private String src;
- private boolean wraptext;
- private boolean clickOriginal;
- private String position;
- private String size;
-
- public ImageInfo(final String src, final boolean wraptext, final boolean clickOriginal, final String position,
- final String size) {
- this.src = src;
- this.wraptext = wraptext;
- this.clickOriginal = clickOriginal;
- setPositionImpl(position);
- setSizeImpl(size);
- }
-
- public boolean getClickOriginal() {
- return clickOriginal;
- }
-
- public Element getElement() {
- Element imgElement = getImageElement();
- if (clickOriginal) {
- com.google.gwt.user.client.Element anchor = DOM.createAnchor();
- DOM.setElementProperty(anchor, LinkInfo.HREF, src);
- DOM.setElementProperty(anchor, LinkInfo.TARGET, LinkInfo._BLANK);
- anchor.setInnerHTML(imgElement.getString());
- return anchor;
- } else {
- return imgElement;
- }
- }
-
- public String getPosition() {
- return position;
- }
-
- public String getSize() {
- return size;
- }
-
- public String getSrc() {
- return src;
- }
-
- public boolean isWraptext() {
- return wraptext;
- }
-
- public void setClickOriginal(final boolean clickOriginal) {
- this.clickOriginal = clickOriginal;
- }
-
- public void setPosition(final String position) {
- setPositionImpl(position);
- }
-
- public void setSize(final String size) {
- setSizeImpl(size);
- }
-
- public void setSrc(final String src) {
- this.src = src;
- }
-
- public void setWraptext(final boolean wraptext) {
- this.wraptext = wraptext;
- }
-
- @Override
- public String toString() {
- Element element = getElement();
- return element.getString();
- }
-
- private Element getImageElement() {
- com.google.gwt.user.client.Element img = DOM.createImg();
- DOM.setElementProperty(img, "src", src);
- CSS.setProperty(img, CSS.A.WIDTH, getStyleSize());
- return ContentPosition.setPosition(img, wraptext, position);
- }
-
- private String getStyleSize() {
- for (String[] current : sizes) {
- if (current[0].equals(size)) {
- return current[2];
- }
- }
- return "";
- }
-
- private void setPositionImpl(final String position) {
- this.position = position;
- }
-
- private void setSizeImpl(final String size) {
- this.size = size;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface InsertImageDialog extends OldAbstractTabbedDialog {
-
- void fireOnInsertImage(ImageInfo imageInfo);
-
- ImageInfo getImageInfo();
-
- void reset();
-
- void setOnCreateImage(Listener<ImageInfo> listener);
-
- void setOnInsertImagePressed(Listener0 onInsertLinkPressed);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertImageDialogPanel extends OldAbstractTabbedDialogPanel implements InsertImageDialogView {
-
- private static final String INSERT_IMG_DIALOG = "k-iip-dial";
- private static final String INSERT_IMG_DIALOG_ERROR_ID = "k-iip-err";
- private final InsertImageGroup insertImageGroup;
-
- public InsertImageDialogPanel(final InsertImageDialogPresenter presenter, final I18nTranslationService i18n,
- final NotifyLevelImages images, final InsertImageGroup insertImageGroup) {
- super(INSERT_IMG_DIALOG, i18n.t("Insert Image"), 390, HEIGHT + 100, 390, HEIGHT + 100, true, images,
- INSERT_IMG_DIALOG_ERROR_ID);
- super.setIconCls("k-picture-icon");
- this.insertImageGroup = insertImageGroup;
-
- super.addHideListener(new Listener0() {
- @Override
- public void onEvent() {
- insertImageGroup.resetAll();
- }
- });
-
- final Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onInsert();
- }
- });
-
- final Button cancel = new Button(i18n.t("Cancel"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- addButton(insert);
- addButton(cancel);
- }
-
- @Override
- public void createAndShow() {
- insertImageGroup.createAll();
- super.createAndShow();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import cc.kune.core.client.ui.ContentPosition;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class InsertImageDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertImageDialog {
-
- private Listener<ImageInfo> onCreateListener;
- private ImageInfo imageInfo;
- private Listener0 onInsertPressed;
-
- public InsertImageDialogPresenter() {
- initImageInfo();
- }
-
- public void fireOnInsertImage(final ImageInfo imageInfo) {
- onCreateListener.onEvent(imageInfo);
- super.hide();
- }
-
- public ImageInfo getImageInfo() {
- return imageInfo;
- }
-
- public void reset() {
- initImageInfo();
- }
-
- public void setOnCreateImage(final Listener<ImageInfo> listener) {
- onCreateListener = listener;
- }
-
- public void setOnInsertImagePressed(final Listener0 onInsertPressed) {
- this.onInsertPressed = onInsertPressed;
- }
-
- protected void onCancel() {
- super.hide();
- }
-
- protected void onInsert() {
- onInsertPressed.onEvent();
- }
-
- private void initImageInfo() {
- imageInfo = new ImageInfo("", ImageInfo.DEF_WRAP_VALUE, ImageInfo.DEF_CLICK_ORIGINAL_VALUE,
- ContentPosition.LEFT, ImageInfo.SIZE_ORIGINAL);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface InsertImageDialogView extends OldAbstractTabbedDialogView {
-
- int HEIGHT = 350;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertImageGroup extends ProviderCollection {
-
- public InsertImageGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((InsertImageAbstract) p.get()).reset();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface InsertLinkDialog extends OldAbstractTabbedDialog {
-
- void fireOnInsertLink(LinkInfo linkInfo);
-
- LinkInfo getLinkInfo();
-
- void setLinkInfo(LinkInfo linkInfo);
-
- void setOnCreateLink(Listener<LinkInfo> listener);
-
- void setOnInsertLinkPressed(Listener0 onInsertLinkPressed);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertLinkDialogPanel extends OldAbstractTabbedDialogPanel implements InsertLinkDialogView {
- public static final String TEXT_EDT_INSERT_DIALOG = "k-ted-iep-dialog";
- public static final String TEXT_EDT_INSERT_DIALOG_ERROR_ID = "k-ted-iep-dialog-err";
- private final InsertLinkGroup textEditorInsertElementGroup;
-
- public InsertLinkDialogPanel(final InsertLinkDialogPresenter presenter, final NotifyLevelImages images,
- final I18nTranslationService i18n, final InsertLinkGroup textEditorInsertElementGroup) {
- super(TEXT_EDT_INSERT_DIALOG, i18n.tWithNT("Insert a link",
- "Option in a text editor to insert links and other elements"), 380, HEIGHT + 100, 380, HEIGHT + 100,
- true, images, TEXT_EDT_INSERT_DIALOG_ERROR_ID);
- super.setIconCls("k-link-icon");
- this.textEditorInsertElementGroup = textEditorInsertElementGroup;
- super.addHideListener(new Listener0() {
- @Override
- public void onEvent() {
- textEditorInsertElementGroup.resetAll();
- }
- });
-
- final Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onInsert();
- }
- });
-
- final Button cancel = new Button(i18n.t("Cancel"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- addButton(insert);
- addButton(cancel);
-
- }
-
- @Override
- public void createAndShow() {
- textEditorInsertElementGroup.createAll();
- super.createAndShow();
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class InsertLinkDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertLinkDialog {
-
- private Listener<LinkInfo> onCreateListener;
- private LinkInfo linkInfo;
- private Listener0 onInsertLinkPressed;
-
- public InsertLinkDialogPresenter() {
- linkInfo = new LinkInfo("");
- }
-
- public void fireOnInsertLink(final LinkInfo linkInfo) {
- onCreateListener.onEvent(linkInfo);
- super.hide();
- }
-
- public LinkInfo getLinkInfo() {
- return linkInfo;
- }
-
- public void onCancel() {
- super.hide();
- }
-
- public void setLinkInfo(final LinkInfo linkInfo) {
- this.linkInfo = linkInfo;
- }
-
- public void setOnCreateLink(final Listener<LinkInfo> listener) {
- this.onCreateListener = listener;
- }
-
- public void setOnInsertLinkPressed(final Listener0 onInsertLinkPressed) {
- this.onInsertLinkPressed = onInsertLinkPressed;
- }
-
- protected void onInsert() {
- onInsertLinkPressed.onEvent();
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface InsertLinkDialogView extends OldAbstractTabbedDialogView, View {
-
- int HEIGHT = 350;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertLinkGroup extends ProviderCollection {
-
- public InsertLinkGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((InsertLinkAbstract) p.get()).reset();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,125 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * 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.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
-import org.xwiki.gwt.dom.client.DOMUtils;
-import org.xwiki.gwt.dom.client.Element;
-import org.xwiki.gwt.dom.client.Range;
-
-import com.google.gwt.dom.client.Node;
-
-/**
- * Utility class to perform functions associated to link executables, such as
- * detecting the selected anchor. We have this as static function in a distinct
- * class since there is no way to insert this on both the
- * {@link CreateLinkExecutable} and {@link UnlinkExecutable} hierarchies.
- *
- * @version $Id$
- */
-public class LinkExecutableUtils {
- /**
- * The tag name of the anchor element.
- */
- public static final String ANCHOR_TAG_NAME = "a";
-
- /**
- * Returns the currently selected anchor element in the passed
- * {@link RichTextArea}, as the user perceives the selection. The algorithm
- * used is as follows:
- * <ul>
- * <li>find anchor ancestor of the first leaf of the selection. If the first
- * leaf is the selection start container and the offset is at the end, then
- * eliminate this first leaf and analyze the second</li>
- * <li>find anchor ancestor of the last leaf of the selection. If the last
- * leaf is the end container and the selection starts at its very beginning,
- * skip this and analyze the previous leaf</li>
- * <li>is the two ancestor anchors are not null and are the same, this
- * anchor is the selected anchor</li>
- * </ul>
- *
- * @param rta
- * the rich text area whose selection to test
- * @return the anchor in which the current selection is found
- */
- public static Element getSelectedAnchor(final RichTextArea rta) {
- // there is no wrapping anchor if there is no selection
- if (rta.getDocument().getSelection().getRangeCount() == 0) {
- return null;
- }
- // Find the selected anchor by the following algorithm:
- final Range range = rta.getDocument().getSelection().getRangeAt(0);
- // if the selection is collapsed, we have our answer already
- if (range.isCollapsed()) {
- return (Element) DOMUtils.getInstance().getFirstAncestor(range.getStartContainer(), ANCHOR_TAG_NAME);
- }
- Element foundAncestorStart = null;
- Element foundAncestorEnd = null;
- // get the first leaf of the selection and check it out
- Node firstLeaf = DOMUtils.getInstance().getFirstLeaf(range);
- if (firstLeaf == range.getStartContainer()
- && range.getStartOffset() == DOMUtils.getInstance().getLength(firstLeaf)) {
- firstLeaf = DOMUtils.getInstance().getNextLeaf(firstLeaf);
- }
- foundAncestorStart = (Element) DOMUtils.getInstance().getFirstAncestor(firstLeaf, ANCHOR_TAG_NAME);
- // if no anchor found for start, it's pointless to keep looking, won't
- // find anything
- if (foundAncestorStart == null) {
- return null;
- }
- // check the other end
- Node lastLeaf = DOMUtils.getInstance().getLastLeaf(range);
- if (lastLeaf == range.getEndContainer() && range.getEndOffset() == 0) {
- lastLeaf = DOMUtils.getInstance().getPreviousLeaf(lastLeaf);
- }
- foundAncestorEnd = (Element) DOMUtils.getInstance().getFirstAncestor(lastLeaf, ANCHOR_TAG_NAME);
-
- if (foundAncestorStart == foundAncestorEnd && foundAncestorStart != null) {
- return foundAncestorStart;
- }
-
- return null;
- }
-
- /**
- * Protected constructor.
- */
- protected LinkExecutableUtils() {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,141 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.DOM;
-
-public class LinkInfo {
- public static final String HREF = "href";
- public static final String TITLE = "title";
- public static final String TARGET = "target";
- public static final String _BLANK = "_blank";
- private static final String NO_TARGET = null;
-
- public static LinkInfo parse(final Element element) {
- final String target = element.getAttribute(TARGET);
- return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
- && target.equals(_BLANK));
- }
-
- public static LinkInfo parse(final org.xwiki.gwt.dom.client.Element element) {
- final String target = element.getAttribute(TARGET);
- return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
- && target.equals(_BLANK));
- }
-
- private String text;
- private String title;
- private String href;
- private String target;
-
- public LinkInfo(final String text) {
- this(text, null, "", false);
- }
-
- public LinkInfo(final String text, final String href) {
- this.text = text;
- this.href = href;
- }
-
- public LinkInfo(final String text, final String title, final String href, final boolean inNewWindow) {
- this.text = text;
- this.href = href;
- this.title = title;
- setInNewWindowImpl(inNewWindow);
- }
-
- public Element getElement() {
- final Element anchor = DOM.createAnchor();
- final com.google.gwt.user.client.Element element = (com.google.gwt.user.client.Element) anchor;
- DOM.setElementProperty(element, HREF, href);
- if (getTarget() != NO_TARGET) {
- DOM.setElementProperty(element, TARGET, getTarget());
- }
- if (title != null) {
- DOM.setElementAttribute(element, TITLE, title);
- }
- DOM.setInnerText(element, text);
- return anchor;
- }
-
- public String getHref() {
- return href;
- }
-
- public String getTarget() {
- return target;
- }
-
- public String getText() {
- return text;
- }
-
- public String getTitle() {
- return title;
- }
-
- public boolean inSameWindow() {
- if (target.equals(NO_TARGET)) {
- return false;
- } else {
- return target.equals(_BLANK);
- }
- }
-
- public void setHref(final String href) {
- this.href = href;
- }
-
- public void setInNewWindow(final boolean inNewWindow) {
- setInNewWindowImpl(inNewWindow);
- }
-
- public void setTarget(final String target) {
- setTargetImpl(target);
- }
-
- public void setText(final String text) {
- this.text = text;
- }
-
- public void setTitle(final String title) {
- this.title = title;
- }
-
- @Override
- public String toString() {
- final Element anchor = getElement();
- return anchor.getString();
- }
-
- private void setInNewWindowImpl(final boolean inNewWindow) {
- if (inNewWindow) {
- setTargetImpl(_BLANK);
- } else {
- setTargetImpl(NO_TARGET);
- }
- }
-
- private void setTargetImpl(final String target) {
- this.target = target;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.shared.dto.ExtMediaDescripDTO;
-
-public class ExternalMediaRegistry extends ArrayList<ExtMediaDescripDTO> {
-
- private static final long serialVersionUID = -9109609520119776917L;
- public static final ExtMediaDescripDTO NO_MEDIA = new ExtMediaDescripDTO(null, null, null, null, null, 0, 0);
-
- public ExternalMediaRegistry(final List<ExtMediaDescripDTO> extMediaDescrips) {
- super(extMediaDescrips);
- }
-
- public ExtMediaDescripDTO get(final String url) {
- for (ExtMediaDescripDTO media : this) {
- if (media.is(url)) {
- return media;
- }
-
- }
- return NO_MEDIA;
- }
-
- public String getNames() {
- String names = "";
- for (Iterator<ExtMediaDescripDTO> iterator = this.iterator(); iterator.hasNext();) {
- ExtMediaDescripDTO elem = iterator.next();
- names += TextUtils.generateHtmlLink(elem.getSiteurl(), elem.getName());
- if (iterator.hasNext()) {
- names += ", ";
- }
- }
- return names;
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface InsertMediaDialog extends OldAbstractTabbedDialog {
-
- void fireOnInsertMedia(String html);
-
- void setOnCreate(Listener<String> listener);
-
- void setOnInsertPressed(Listener0 onInsertPressed);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertMediaDialogPanel extends OldAbstractTabbedDialogPanel implements InsertMediaDialogView {
-
- private static final String INSERT_MEDIA_DIALOG = "k-imdp-dialog";
- private static final String INSERT_MEDIA_DIALOG_ERROR_ID = "k-imdp-dialog-err";
- private final InsertMediaGroup insertMediaGroup;
-
- public InsertMediaDialogPanel(final InsertMediaDialogPresenter presenter, final I18nTranslationService i18n,
- final NotifyLevelImages images, final InsertMediaGroup insertMediaGroup) {
- super(INSERT_MEDIA_DIALOG, i18n.t("Insert Media (audio/video)"), 390, HEIGHT + 100, 390, HEIGHT + 100, true,
- images, INSERT_MEDIA_DIALOG_ERROR_ID);
- super.setIconCls("k-film-icon");
- this.insertMediaGroup = insertMediaGroup;
-
- super.addHideListener(new Listener0() {
- @Override
- public void onEvent() {
- insertMediaGroup.resetAll();
- }
- });
-
- final Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onInsert();
- }
- });
-
- final Button cancel = new Button(i18n.t("Cancel"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- addButton(insert);
- addButton(cancel);
- }
-
- @Override
- public void createAndShow() {
- insertMediaGroup.createAll();
- super.createAndShow();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class InsertMediaDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertMediaDialog {
-
- private Listener0 onInsertPressed;
- Listener<String> onCreateListener;
-
- public void fireOnInsertMedia(String html) {
- onCreateListener.onEvent(html);
- super.hide();
- }
-
- public void setOnCreate(Listener<String> listener) {
- onCreateListener = listener;
- }
-
- public void setOnInsertPressed(Listener0 onInsertPressed) {
- this.onInsertPressed = onInsertPressed;
- }
-
- protected void onCancel() {
- super.hide();
- }
-
- protected void onInsert() {
- onInsertPressed.onEvent();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface InsertMediaDialogView extends View {
-
- int HEIGHT = 250;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertMediaGroup extends ProviderCollection {
-
- public InsertMediaGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((InsertMediaAbstract) p.get()).reset();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-
-public interface InsertSpecialCharDialog extends OldAbstractTabbedDialog {
-
- String DEF_LABEL = "Click on a character below to insert it into the document.";
-
- void hide();
-
- void onInsert(char character);
-
- void setOnInsertSpecialChar(Listener<String> listener);
-
- void show();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertSpecialCharDialogPanel extends OldAbstractTabbedDialogPanel implements InsertSpecialCharDialogView {
-
- private static final String INSERT_SPECIAL_CHAR_DIALOG = "iscdp-dial";
- private static final String INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID = "iscdp-err";
- private final InsertSpecialCharGroup insertSpecialCharGroup;
-
- public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter,
- final NotifyLevelImages images, final I18nTranslationService i18n,
- final InsertSpecialCharGroup insertSpecialCharGroup, final RTEImgResources imgResources) {
- super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 495, HEIGHT + 90, 495, HEIGHT + 90, true,
- images, INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID);
- super.setIconCls("k-specialchars-icon");
- this.insertSpecialCharGroup = insertSpecialCharGroup;
- final Button close = new Button(i18n.t("Close"));
- close.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- hide();
- }
- });
- addButton(close);
- }
-
- @Override
- public void createAndShow() {
- insertSpecialCharGroup.createAll();
- super.createAndShow();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-
-public class InsertSpecialCharDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertSpecialCharDialog {
-
- private Listener<String> onInsertSpecialChar;
-
- public void onInsert(char character) {
- hide();
- if (onInsertSpecialChar != null) {
- onInsertSpecialChar.onEvent("" + character);
- }
- }
-
- public void setOnInsertSpecialChar(Listener<String> listener) {
- this.onInsertSpecialChar = listener;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface InsertSpecialCharDialogView extends OldAbstractTabbedDialogView {
-
- int HEIGHT = 315;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertSpecialCharGroup extends ProviderCollection {
-
- public InsertSpecialCharGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-
-public class ActionsModule extends AbstractExtendedModule {
- @Override
- protected void onInstall() {
- // register(NoDecoration.class, new
- // Factory<ParticipateAction>(ParticipateAction.class) {
- // @Override
- // public ParticipateAction create() {
- // return new ParticipateAction(i(Session.class),
- // p(SocialNetworkServiceAsync.class),
- // i(StateManager.class), i(AccessRightsClientManager.class),
- // i(I18nTranslationService.class),
- // i(IconResources.class));
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<UnjoinAction>(UnjoinAction.class) {
- // @Override
- // public UnjoinAction create() {
- // return new UnjoinAction(i(Session.class),
- // p(SocialNetworkServiceAsync.class), i(StateManager.class),
- // i(AccessRightsClientManager.class), i(I18nTranslationService.class),
- // i(IconResources.class));
- // }
- // });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,683 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.actions.ActionCheckedCondition;
-import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
-import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuAndItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
-import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.editor.ContentEditor;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.upload.FileUploader;
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.core.client.cnt.ContentActionRegistry;
-import cc.kune.core.client.cnt.FoldableContent;
-import cc.kune.core.client.errors.ErrorHandler;
-import cc.kune.core.client.errors.SessionExpiredException;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.ContentStatus;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.ContentSimpleDTO;
-import cc.kune.core.shared.dto.InitDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public abstract class OldAbstractFoldableContentActions {
-
- protected enum Position {
- cnt, ctx
- }
-
- public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition(
- "afca-ctn-bottom");
-
- public static final ActionToolbarPosition CONTENT_TOPBAR = new ActionToolbarPosition("afca-ctn-top");
- public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition(
- "afca-ctx-bottom");
- public static final ActionToolbarPosition CONTEXT_TOPBAR = new ActionToolbarPosition("afca-ctx-top");
- private static final String PUBLICATION_MENU = "Publication";
-
- protected final ContentActionRegistry contentActionRegistry;
- protected final Provider<ContentServiceAsync> contentServiceProvider;
- // protected final ContextActionRegistry contextActionRegistry;
- protected final ContextNavigator contextNavigator;
- // protected final Provider<ContextPropEditor> contextPropEditorProvider;
- protected final SchedulerManager deferredCommandWrapper;
- protected final EntityHeader entityLogo;
- protected final ErrorHandler errorHandler;
- protected final Provider<FileDownloadUtils> fileDownloadProvider;
- protected final Provider<FileUploader> fileUploaderProvider;
- protected final FoldableContent foldableContent;
- protected final Provider<GroupServiceAsync> groupServiceProvider;
- protected final I18nUITranslationService i18n;
-
- protected final Session session;
- protected final StateManager stateManager;
- protected final Provider<ContentEditor> textEditorProvider;
-
- private final GSpaceBackManager wsBackManager;
-
- public OldAbstractFoldableContentActions(final Session session, final StateManager stateManager,
- final I18nUITranslationService i18n, final ErrorHandler errorHandler,
- final SchedulerManager deferredCommandWrapper,
- final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<FileUploader> fileUploaderProvider,
- final ContextNavigator contextNavigator,
- final ContentActionRegistry contentActionRegistry,
- // final ContextActionRegistry contextActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider,
- final Provider<ContentEditor> textEditorProvider,
- // final Provider<ContextPropEditor> contextPropEditorProvider,
- final FoldableContent foldableContent, final EntityHeader entityLogo,
- final GSpaceBackManager wsBackManager) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- this.errorHandler = errorHandler;
- this.deferredCommandWrapper = deferredCommandWrapper;
- this.groupServiceProvider = groupServiceProvider;
- this.contentServiceProvider = contentServiceProvider;
- this.fileUploaderProvider = fileUploaderProvider;
- this.contextNavigator = contextNavigator;
- this.contentActionRegistry = contentActionRegistry;
- // this.contextActionRegistry = contextActionRegistry;
- this.fileDownloadProvider = fileDownloadProvider;
- this.textEditorProvider = textEditorProvider;
- // this.contextPropEditorProvider = contextPropEditorProvider;
- this.foldableContent = foldableContent;
- this.entityLogo = entityLogo;
- this.wsBackManager = wsBackManager;
- createActions();
- session.onInitDataReceived(new Listener<InitDataDTO>() {
- @Override
- public void onEvent(final InitDataDTO parameter) {
- createPostSessionInitActions();
- }
- });
- }
-
- protected abstract void createActions();
-
- protected void createContentModeratedActions(final String parentMenuTitle,
- final String... contentsModerated) {
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"),
- ContentStatus.publishedOnline, contentsModerated);
- createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"),
- ContentStatus.editingInProgress, contentsModerated);
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Rejected"), ContentStatus.rejected,
- contentsModerated);
- createSetStatusAction(AccessRolDTO.Editor, i18n.t("Submitted for publish"),
- ContentStatus.submittedForEvaluation, contentsModerated);
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("In the rubbish bin"),
- ContentStatus.inTheDustbin, contentsModerated);
- }
-
- protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- contextNavigator.editItem(stateToken);
- }
- });
- renameCtn.setTextDescription(textDescription);
- renameCtn.setParentMenuTitle(parentMenuTitle);
- renameCtn.setEnableCondition(notDeleted());
-
- // contentActionRegistry.addAction(renameCtn, registerInTypes);
- }
-
- protected void createDelContainerAction(final String text, final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- OldNotifyUser.info("Sorry, in development");
- }
- });
- delContainer.setParentMenuTitle(parentMenuTitle);
- delContainer.setTextDescription(i18n.t(text));
- delContainer.setMustBeConfirmed(true);
- delContainer.setConfirmationTitle(i18n.t("Please confirm"));
- delContainer.setConfirmationText(i18n.t("You will delete it with all its contents. Are you sure?"));
- // contextActionRegistry.addAction(delContainer, registerInTypes);
- }
-
- protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- contentServiceProvider.get().delContent(session.getUserHash(), token,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- session.setCurrentState(state);
- final StateToken parent = token.copy().clearDocument();
- stateManager.gotoStateToken(parent);
- contextNavigator.clear();
- contextNavigator.refreshState();
- }
- });
- }
- });
- delContent.setParentMenuTitle(parentMenuTitle);
- delContent.setTextDescription(textDescription);
- delContent.setMustBeConfirmed(true);
- delContent.setConfirmationTitle(i18n.t("Please confirm"));
- delContent.setConfirmationText(i18n.t("Are you sure?"));
- delContent.setEnableCondition(notDefAndNotDeleted());
- // contentActionRegistry.addAction(delContent, registerInTypes);
- }
-
- protected void createDownloadActions(final String typeUploadedfile) {
- final ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- downloadContent(token);
- }
- });
- download.setMustBeAuthenticated(false);
- download.setTextDescription(i18n.t("Download"));
- download.setToolTip(i18n.t("Download this file"));
- download.setIconUrl("images/nav/download.png");
-
- final ActionMenuItemDescriptor<StateToken> downloadCtx = new ActionMenuItemDescriptor<StateToken>(
- AccessRolDTO.Viewer, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- downloadContent(token);
- }
- });
- downloadCtx.setMustBeAuthenticated(false);
- downloadCtx.setTextDescription(i18n.t("Download"));
- downloadCtx.setIconUrl("images/nav/download.png");
-
- // contentActionRegistry.addAction(download, typeUploadedfile);
- // contextActionRegistry.addAction(downloadCtx, typeUploadedfile);
- }
-
- protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.showProgressProcessing();
- session.check(new AsyncCallbackSimple<Void>() {
- @Override
- public void onSuccess(final Void result) {
- final ContentEditor editor = textEditorProvider.get();
- foldableContent.detach();
- contextNavigator.detach();
- // contextPropEditorProvider.get().attach();
- editor.edit(session.getContentState().getContent(), new Listener<String>() {
- @Override
- public void onEvent(final String html) {
- OldNotifyUser.showProgressSaving();
- contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(final Throwable caught) {
- OldNotifyUser.hideProgress();
- if (caught instanceof SessionExpiredException) {
- errorHandler.doSessionExpired();
- } else {
- OldNotifyUser.error(i18n.t("Error saving document. Retrying..."));
- errorHandler.process(caught);
- editor.onSaveFailed();
- }
- }
-
- @Override
- public void onSuccess(final Void param) {
- OldNotifyUser.hideProgress();
- session.getContentState().setContent(html);
- editor.onSavedSuccessful();
- }
- });
- }
- }, new Listener0() {
- @Override
- public void onEvent() {
- // onClose
- deferredCommandWrapper.addCommand(new ScheduledCommand() {
- @Override
- public void execute() {
- foldableContent.attach();
- // contextPropEditorProvider.get().detach();
- contextNavigator.attach();
- if (session.inSameToken(stateToken)) {
- contextNavigator.refreshState();
- foldableContent.refreshState();
- }
- }
- });
- }
- });
- editor.setFileMenuTitle(fileMenuTitle);
- OldNotifyUser.hideProgress();
- }
- });
- }
- });
- editContent.setTextDescription(i18n.tWithNT("Edit", "used in button"));
- editContent.setIconUrl("images/content_edit.png");
- editContent.setLeftSeparator(ActionToolbarButtonSeparator.spacer);
- editContent.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(editContent, registerInTypes);
- return editContent;
- }
-
- protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
- final ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(
- AccessRolDTO.Viewer, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- stateManager.gotoStateToken(token);
- }
- });
- go.setMustBeAuthenticated(false);
- go.setTextDescription(i18n.t("Open"));
- go.setIconUrl("images/nav/go.png");
- // contextActionRegistry.addAction(go, registerInTypes);
- return go;
- }
-
- protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
- final ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- stateManager.gotoHistoryToken(token.getGroup());
- }
- });
- goGroupHome.setMustBeAuthenticated(false);
- goGroupHome.setIconUrl("images/group-home.png");
- goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
- return !session.getCurrentStateToken().equals(defContentToken);
- }
- });
- goGroupHome.setLeftSeparator(ActionToolbarButtonSeparator.fill);
- // contextActionRegistry.addAction(goGroupHome, registerInTypes);
- return goGroupHome;
- }
-
- protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
- final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
- final String defaultName, final Position position, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
- addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_TOPBAR,
- new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
- contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
- @Override
- public void onSuccess(final StateContainerDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedStateAndGo(state);
- }
- });
- }
- });
- addFolder.setTextDescription(textDescription);
- addFolder.setParentMenuTitle(parentMenuTitle);
- addFolder.setParentSubMenuTitle(parentMenuSubtitle);
- addFolder.setIconUrl(iconUrl);
- register(addFolder, position, registerInTypes);
- }
-
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createNewContentAction(final String typeId,
- final String iconUrl, final String description, final String parentMenuTitle,
- final Position position, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
- @Override
- public void onEvent() {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().addContent(session.getUserHash(),
- session.getCurrentState().getStateToken(), description, typeId,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedStateAndGo(state);
- }
- });
- }
- });
- addContent.setTextDescription(description);
- addContent.setParentMenuTitle(parentMenuTitle);
- addContent.setParentSubMenuTitle(i18n.t("New"));
- addContent.setIconUrl(iconUrl);
- register(addContent, position, registerInTypes);
- return addContent;
- }
-
- protected abstract void createPostSessionInitActions();
-
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- stateManager.refreshCurrentState();
- contextNavigator.selectItem(stateToken);
- }
- });
- refreshCnt.setMustBeAuthenticated(false);
- refreshCnt.setParentMenuTitle(parentMenuTitle);
- refreshCnt.setTextDescription(i18n.t("Refresh"));
- refreshCnt.setIconUrl("images/nav/refresh.png");
- // contentActionRegistry.addAction(refreshCnt, registerInTypes);
- return refreshCnt;
- }
-
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(
- final String parentMenuTitleCtx, final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- stateManager.refreshCurrentState();
- contextNavigator.selectItem(stateToken);
- }
- });
- refreshCtx.setMustBeAuthenticated(false);
- refreshCtx.setParentMenuTitle(parentMenuTitleCtx);
- refreshCtx.setTextDescription(i18n.t("Refresh"));
- refreshCtx.setIconUrl("images/nav/refresh.png");
- // contextActionRegistry.addAction(refreshCtx, registerInTypes);
- return refreshCtx;
- }
-
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(
- final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- contextNavigator.editItem(stateToken);
- }
- });
- renameCtx.setTextDescription(textDescription);
- renameCtx.setParentMenuTitle(parentMenuTitleCtx);
- // contextActionRegistry.addAction(renameCtx, registerInTypes);
- return renameCtx;
- }
-
- protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
- setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator,
- CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
- new AsyncCallbackSimple<ContentSimpleDTO>() {
- @Override
- public void onSuccess(final ContentSimpleDTO defContent) {
- session.getCurrentState().getGroup().setDefaultContent(defContent);
- OldNotifyUser.hideProgress();
- OldNotifyUser.info(i18n.t("Content selected as the group homepage"));
- }
- });
- }
- });
- setAsDefGroupContent.setTextDescription(i18n.t("Set this as the default group page"));
- setAsDefGroupContent.setIconUrl("images/group-home.png");
- setAsDefGroupContent.setEnableCondition(notDefAndNotDeleted());
- setAsDefGroupContent.setParentMenuTitle(parentMenuTitle);
- // contentActionRegistry.addAction(setAsDefGroupContent,
- // registerInTypes);
- return setAsDefGroupContent;
- }
-
- //
- // protected void createSetGroupBackImageAction(final String parentMenuTitle,
- // final String... registerInTypes) {
- // final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupBackImage =
- // new ActionToolbarMenuAndItemDescriptor<StateToken>(
- // AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- // @Override
- // public void onEvent(final StateToken token) {
- // groupServiceProvider.get().setGroupBackImage(session.getUserHash(), token,
- // new AsyncCallbackSimple<GroupDTO>() {
- // @Override
- // public void onSuccess(final GroupDTO newGroup) {
- // if (session.getCurrentState().getGroup().getShortName().equals(
- // newGroup.getShortName())) {
- // session.getCurrentState().setGroup(newGroup);
- // wsBackManager.clearBackImage();
- // wsBackManager.setBackImage(newGroup.getGroupBackImage().getStateToken());
- // }
- // }
- // });
- // }
- // });
- // setGroupBackImage.setParentMenuTitle(parentMenuTitle);
- // setGroupBackImage.setTextDescription(i18n.t("Set this as the group background image"));
- // setGroupBackImage.setIconUrl("images/nav/picture.png");
- // setGroupBackImage.setEnableCondition(new
- // ActionEnableCondition<StateToken>() {
- // @Override
- // public boolean mustBeEnabled(final StateToken token) {
- // return session.getContentState().getMimeType().isImage();
- // }
- // });
- // // contentActionRegistry.addAction(setGroupBackImage, registerInTypes);
- // }
-
- protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
- final ContentStatus status, final String[] contentsModerated) {
- final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
- rol, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- setContentStatus(status, stateToken);
- }
- }, "ContentRadioStatus", new RadioMustBeChecked() {
- @Override
- public boolean mustBeChecked() {
- if (session.getContainerState() instanceof StateContentDTO) {
- final ContentStatus currentStatus = session.getContentState().getStatus();
- return status.equals(currentStatus);
- }
- return false;
- }
- });
- action.setTextDescription(textDescription);
- action.setParentMenuTitle(PUBLICATION_MENU);
- action.setParentMenuIconUrl("images/anybody.png");
- // contentActionRegistry.addAction(action, contentsModerated);
- }
-
- protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
- final ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
- @Override
- public void onEvent() {
- final boolean mustShow = !session.getCurrentUserInfo().getShowDeletedContent();
- session.getCurrentUserInfo().setShowDeletedContent(mustShow);
- if (!mustShow && session.isCurrentStateAContent()
- && session.getContentState().getStatus().equals(ContentStatus.inTheDustbin)) {
- stateManager.gotoHistoryToken(session.getCurrentStateToken().getGroup());
- }
- contextNavigator.clear();
- contextNavigator.refreshState();
- }
- }, new ActionCheckedCondition() {
- @Override
- public boolean mustBeChecked() {
- return session.getShowDeletedContent();
- }
- });
- showDeletedItems.setParentMenuTitle(parentMenuTitle);
- showDeletedItems.setTextDescription("Show deleted items");
- showDeletedItems.setMustBeAuthenticated(true);
- // contextActionRegistry.addAction(showDeletedItems, registerInTypes);
- }
-
- protected ActionToolbarMenuDescriptor<StateToken> createTranslateAction(final String fileMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
- }
- });
- translateContent.setParentMenuTitle(fileMenuTitle);
- translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
- translateContent.setToolTip(i18n.t("Translate this document to other languages"));
- translateContent.setIconUrl("images/language.gif");
- translateContent.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(translateContent, registerInTypes);
- return translateContent;
- }
-
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(
- final String textDescription, final String iconUrl, final String toolTip,
- final String permitedExtensions, final String... registerInTypes) {
- final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
- uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
- CONTEXT_BOTTOMBAR, new Listener0() {
- @Override
- public void onEvent() {
- if (permitedExtensions != null) {
- // FIXME: can't be reset ...
- // fileUploaderProvider.get().setPermittedExtensions(permitedExtensions);
- } else {
- // FIXME: can't be reset ...
- // fileUploaderProvider.get().resetPermittedExtensions();
- }
- fileUploaderProvider.get().show();
- }
- });
- uploadFile.setTextDescription(textDescription);
- uploadFile.setIconUrl(iconUrl);
- uploadFile.setToolTip(toolTip);
- // contextActionRegistry.addAction(uploadFile, registerInTypes);
- return uploadFile;
- }
-
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(
- final String... registerInTypes) {
- final ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia = createUploadAction(
- i18n.t("Upload media"), "images/nav/upload.png",
- i18n.t("Upload some media (images, videos...)"), session.getGalleryPermittedExtensions());
- // contextActionRegistry.addAction(uploadMedia, registerInTypes);
- return uploadMedia;
- }
-
- protected void downloadContent(final StateToken token) {
- fileDownloadProvider.get().downloadFile(token);
- }
-
- private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
- return new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
- session.getCurrentStateToken());
- return isNotDefContentToken && notDeleted().mustBeEnabled(token);
- }
- };
- }
-
- private ActionEnableCondition<StateToken> notDeleted() {
- return new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
- ContentStatus.inTheDustbin));
- return isNotDeleted;
- }
- };
- }
-
- private void register(final ActionToolbarMenuAndItemDescriptor<StateToken> action,
- final Position position, final String... registerInTypes) {
- if (position.equals(Position.ctx)) {
- // contextActionRegistry.addAction(action, registerInTypes);
- } else if (position.equals(Position.cnt)) {
- // contentActionRegistry.addAction(action, registerInTypes);
- }
- }
-
- private void setContentStatus(final ContentStatus status, final StateToken stateToken) {
- final AsyncCallbackSimple<StateAbstractDTO> callback = new AsyncCallbackSimple<StateAbstractDTO>() {
- @Override
- public void onSuccess(final StateAbstractDTO state) {
- if (session.inSameToken(stateToken)) {
- session.setCurrentState(state);
- // publicLink.setState(state);
- foldableContent.refreshState();
- }
- contextNavigator.setItemStatus(stateToken, status);
- }
- };
- if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
- || status.equals(ContentStatus.inTheDustbin)) {
- contentServiceProvider.get().setStatusAsAdmin(session.getUserHash(), stateToken, status, callback);
- } else {
- contentServiceProvider.get().setStatus(session.getUserHash(), stateToken, status, callback);
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,219 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-
-import cc.kune.core.client.registry.AclEditableRegistry;
-import cc.kune.core.client.registry.AuthorableRegistry;
-import cc.kune.core.client.registry.CanBeHomepageRegistry;
-import cc.kune.core.client.registry.ComentableRegistry;
-import cc.kune.core.client.registry.DragableRegistry;
-import cc.kune.core.client.registry.DropableRegistry;
-import cc.kune.core.client.registry.EmailSubscribeAbleRegistry;
-import cc.kune.core.client.registry.LicensableRegistry;
-import cc.kune.core.client.registry.PublishModerableRegistry;
-import cc.kune.core.client.registry.RateableRegistry;
-import cc.kune.core.client.registry.RenamableRegistry;
-import cc.kune.core.client.registry.TageableRegistry;
-import cc.kune.core.client.registry.TranslatableRegistry;
-import cc.kune.core.client.registry.VersionableRegistry;
-import cc.kune.core.client.registry.XmppComentableRegistry;
-import cc.kune.core.client.registry.XmppNotifyCapableRegistry;
-
-import com.calclab.suco.client.ioc.decorator.Singleton;
-import com.calclab.suco.client.ioc.module.Factory;
-
-public class RegistryModule extends AbstractExtendedModule {
-
- @Override
- protected void onInstall() {
-
- register(Singleton.class, new Factory<AclEditableRegistry>(AclEditableRegistry.class) {
- @Override
- public AclEditableRegistry create() {
- return new AclEditableRegistry();
- }
- });
- register(Singleton.class, new Factory<AuthorableRegistry>(AuthorableRegistry.class) {
- @Override
- public AuthorableRegistry create() {
- return new AuthorableRegistry();
- }
- });
- register(Singleton.class, new Factory<CanBeHomepageRegistry>(CanBeHomepageRegistry.class) {
- @Override
- public CanBeHomepageRegistry create() {
- return new CanBeHomepageRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ComentableRegistry>(ComentableRegistry.class) {
- @Override
- public ComentableRegistry create() {
- return new ComentableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<DragableRegistry>(DragableRegistry.class) {
- @Override
- public DragableRegistry create() {
- return new DragableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<DropableRegistry>(DropableRegistry.class) {
- @Override
- public DropableRegistry create() {
- return new DropableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<EmailSubscribeAbleRegistry>(EmailSubscribeAbleRegistry.class) {
- @Override
- public EmailSubscribeAbleRegistry create() {
- return new EmailSubscribeAbleRegistry();
- }
- });
-
- register(Singleton.class, new Factory<LicensableRegistry>(LicensableRegistry.class) {
- @Override
- public LicensableRegistry create() {
- return new LicensableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<PublishModerableRegistry>(PublishModerableRegistry.class) {
- @Override
- public PublishModerableRegistry create() {
- return new PublishModerableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<RateableRegistry>(RateableRegistry.class) {
- @Override
- public RateableRegistry create() {
- return new RateableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<TageableRegistry>(TageableRegistry.class) {
- @Override
- public TageableRegistry create() {
- return new TageableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<RenamableRegistry>(RenamableRegistry.class) {
- @Override
- public RenamableRegistry create() {
- return new RenamableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<TranslatableRegistry>(TranslatableRegistry.class) {
- @Override
- public TranslatableRegistry create() {
- return new TranslatableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<VersionableRegistry>(VersionableRegistry.class) {
- @Override
- public VersionableRegistry create() {
- return new VersionableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<XmppComentableRegistry>(XmppComentableRegistry.class) {
- @Override
- public XmppComentableRegistry create() {
- return new XmppComentableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<XmppNotifyCapableRegistry>(XmppNotifyCapableRegistry.class) {
- @Override
- public XmppNotifyCapableRegistry create() {
- return new XmppNotifyCapableRegistry();
- }
- });
-
- // register(Singleton.class, new
- // Factory<IconsRegistry>(IconsRegistry.class) {
- // @Override
- // public IconsRegistry create() {
- // return new IconsRegistry();
- // }
- // });
-
- // register(Singleton.class, new
- // Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class)
- // {
- // @Override
- // public ContentCapabilitiesRegistry create() {
- // return new ContentCapabilitiesRegistry(i(AuthorableRegistry.class),
- // i(AclEditableRegistry.class),
- // i(OldIconsRegistry.class), i(CanBeHomepageRegistry.class),
- // i(ComentableRegistry.class),
- // i(DragableRegistry.class), i(DropableRegistry.class),
- // i(EmailSubscribeAbleRegistry.class),
- // i(LicensableRegistry.class), i(PublishModerableRegistry.class),
- // i(RateableRegistry.class),
- // i(TageableRegistry.class), i(RenamableRegistry.class),
- // i(TranslatableRegistry.class),
- // i(VersionableRegistry.class), i(XmppComentableRegistry.class),
- // i(XmppNotifyCapableRegistry.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContextActionRegistry>(ContextActionRegistry.class) {
- // @Override
- // public ContextActionRegistry create() {
- // return new ContextActionRegistry();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContentActionRegistry>(ContentActionRegistry.class) {
- // @Override
- // public ContentActionRegistry create() {
- // return new ContentActionRegistry();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<GroupActionRegistry>(GroupActionRegistry.class) {
- // @Override
- // public GroupActionRegistry create() {
- // return new GroupActionRegistry();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<UserActionRegistry>(UserActionRegistry.class) {
- // @Override
- // public UserActionRegistry create() {
- // return new UserActionRegistry();
- // }
- // });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client;
-
-public final class WorkspaceMessages {
-
- private WorkspaceMessages() {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,1113 +0,0 @@
-/*
- *
-// * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-
-public class WorkspaceModule extends AbstractExtendedModule {
- @Override
- protected void onInstall() {
- //
- // register(Singleton.class, new
- // Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
- // @Override
- // public SocialNetworkServiceAsync create() {
- // final SocialNetworkServiceAsync snServiceAsync =
- // (SocialNetworkServiceAsync) GWT.create(SocialNetworkService.class);
- // ((ServiceDefTarget)
- // snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
- // + "SocialNetworkService");
- // return snServiceAsync;
- // }
- // }, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
- // @Override
- // public GroupServiceAsync create() {
- // final GroupServiceAsync groupServiceAsync = (GroupServiceAsync)
- // GWT.create(GroupService.class);
- // ((ServiceDefTarget)
- // groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() +
- // "GroupService");
- // return groupServiceAsync;
- // }
- // }, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
- // @Override
- // public ContentServiceAsync create() {
- // final ContentServiceAsync contentServiceAsync = (ContentServiceAsync)
- // GWT.create(ContentService.class);
- // ((ServiceDefTarget)
- // contentServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() +
- // "ContentService");
- // return contentServiceAsync;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<WorkspaceSkeleton>(WorkspaceSkeleton.class) {
- // @Override
- // public WorkspaceSkeleton create() {
- // return new WorkspaceSkeleton();
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteProgress>(SiteProgress.class) {
- // // @Override
- // // public SiteProgress create() {
- // // final SiteProgressPresenter presenter = new
- // SiteProgressPresenter();
- // // final SiteProgressPanel panel = new SiteProgressPanel(presenter,
- // // p(SitePublicSpaceLink.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // Factory<WorkspaceNotifyUser>(WorkspaceNotifyUser.class) {
- // // @Override
- // // public WorkspaceNotifyUser create() {
- // // return new WorkspaceNotifyUser(i(NotifyUser.class),
- // i(I18nUITranslationService.class),
- // // i(SiteProgress.class), p(ToastMessage.class),
- // p(WorkspaceSkeleton.class));
- // // }
- // // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SitePublicSpaceLink>(SitePublicSpaceLink.class) {
- // // @Override
- // // public SitePublicSpaceLink create() {
- // // final SitePublicSpaceLinkPresenter presenter = new
- // // SitePublicSpaceLinkPresenter(i(StateManager.class),
- // // i(StateTokenUtils.class));
- // // final SitePublicSpaceLinkPanel panel = new
- // // SitePublicSpaceLinkPanel(presenter,
- // // i(WorkspaceSkeleton.class), i(I18nUITranslationService.class),
- // // i(Images.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(Singleton.class, new
- // Factory<StateTokenUtils>(StateTokenUtils.class) {
- // @Override
- // public StateTokenUtils create() {
- // return new StateTokenUtils(i(Session.class));
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<ToastMessage>(ToastMessage.class) {
- // @Override
- // public ToastMessage create() {
- // final ToastMessagePresenter presenter = new ToastMessagePresenter();
- // final ToastMessagePanel panel = new ToastMessagePanel();
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteUserOptions>(SiteUserOptions.class) {
- // // @Override
- // // public SiteUserOptions create() {
- // // final SiteUserOptionsPresenter presenter = new
- // // SiteUserOptionsPresenter(i(Session.class),
- // // i(StateManager.class), p(FileDownloadUtils.class),
- // // $(I18nTranslationService.class),
- // // $(IconResources.class));
- // // final SiteUserOptionsPanel panel = new
- // // SiteUserOptionsPanel(presenter, i(WorkspaceSkeleton.class),
- // // $(GuiBindingsRegister.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteSignInLink>(SiteSignInLink.class) {
- // // @Override
- // // public SiteSignInLink create() {
- // // final SiteSignInLinkPresenter presenter = new
- // // SiteSignInLinkPresenter(i(Session.class));
- // // final SiteSignInLinkPanel panel = new
- // SiteSignInLinkPanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteSignOutLink>(SiteSignOutLink.class) {
- // // @Override
- // // public SiteSignOutLink create() {
- // // final SiteSignOutLinkPresenter presenter = new
- // // SiteSignOutLinkPresenter(i(Session.class),
- // // p(UserServiceAsync.class), p(ErrorHandler.class));
- // // final SiteSignOutLinkPanel panel = new
- // // SiteSignOutLinkPanel(presenter,
- // // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteOptions>(SiteOptions.class) {
- // // @Override
- // // public SiteOptions create() {
- // // final SiteOptionsPresenter presenter = new
- // // SiteOptionsPresenter(i(I18nUITranslationService.class),
- // // i(IconResources.class));
- // // final SiteOptionsPanel panel = new
- // // SiteOptionsPanel(i(WorkspaceSkeleton.class),
- // // i(I18nUITranslationService.class), i(GuiBindingsRegister.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<SiteSearch>(SiteSearch.class) {
- // @Override
- // public SiteSearch create() {
- // final SiteSearchPresenter presenter = new
- // SiteSearchPresenter(p(SiteSearcher.class),
- // i(I18nTranslationService.class));
- // final SiteSearchPanel panel = new SiteSearchPanel(presenter,
- // i(WorkspaceSkeleton.class),
- // i(Images.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<SiteLogo>(SiteLogo.class) {
- // @Override
- // public SiteLogo create() {
- // // final SiteLogoPresenter presenter = new
- // // SiteLogoPresenter(i(Session.class));
- // // final SiteLogoPanel panel = new SiteLogoPanel(presenter,
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // return null;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<EntityHeader>(EntityHeader.class) {
- // @Override
- // public EntityHeader create() {
- // final EntityHeaderPresenter presenter = new
- // EntityHeaderPresenter(i(StateManager.class),
- // i(WsThemeManager.class), i(Session.class));
- // final EntityHeaderPanel panel = new
- // EntityHeaderPanel(i(WorkspaceSkeleton.class),
- // p(FileDownloadUtils.class), i(Images.class),
- // i(GuiBindingsRegister.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<WsBackManager>(WsBackManager.class) {
- // @Override
- // public WsBackManager create() {
- // return new WsBackManagerImpl(i(FileDownloadUtils.class));
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<WsThemeManager>(WsThemeManager.class) {
- // @Override
- // public WsThemeManager create() {
- // final WsThemeManager presenter = new WsThemeManager(i(Session.class),
- // p(GroupServiceAsync.class),
- // i(StateManager.class), i(WsBackManager.class));
- // new WsThemeManagerPanel(presenter, i(WorkspaceSkeleton.class));
- // return presenter;
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<WsThemeSelector>(WsThemeSelector.class) {
- // @Override
- // public WsThemeSelector create() {
- // final WsThemeSelectorPresenter presenter = new
- // WsThemeSelectorPresenter(i(Session.class),
- // i(I18nTranslationService.class));
- // presenter.init(new SimpleGuiItem(i(GuiBindingsRegister.class)));
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<EntityTitle>(EntityTitle.class) {
- // @Override
- // public EntityTitle create() {
- // final EntityTitlePresenter presenter = new
- // EntityTitlePresenter(i(StateManager.class),
- // i(Session.class), i(ContentIconsRegistry.class),
- // i(RenamableRegistry.class),
- // i(RenameAction.class));
- // final EntityTitlePanel panel = new
- // EntityTitlePanel(i(WorkspaceSkeleton.class), presenter);
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<EntitySubTitle>(EntitySubTitle.class) {
- // @Override
- // public EntitySubTitle create() {
- // final EntitySubTitlePresenter presenter = new
- // EntitySubTitlePresenter(
- // i(I18nUITranslationService.class), i(StateManager.class), false,
- // i(AuthorableRegistry.class));
- // final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter,
- // i(WorkspaceSkeleton.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
- // // @Override
- // // public EntityLicensePresenter create() {
- // // final EntityLicensePresenter presenter = new
- // // EntityLicensePresenter(i(StateManager.class));
- // // final EntityLicensePanel panel = new EntityLicensePanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<RateIt>(RateIt.class) {
- // @Override
- // public RateIt create() {
- // final RateItPresenter presenter = new
- // RateItPresenter(i(I18nUITranslationService.class),
- // i(Session.class), p(ContentServiceAsync.class),
- // i(StateManager.class), p(RatePresenter.class),
- // i(ContentCapabilitiesRegistry.class));
- // final RateItPanel panel = new RateItPanel(presenter,
- // i(I18nUITranslationService.class),
- // i(WorkspaceSkeleton.class), i(Images.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<RatePresenter>(RatePresenter.class) {
- // @Override
- // public RatePresenter create() {
- // final RatePresenter presenter = new
- // RatePresenter(i(StateManager.class),
- // i(ContentCapabilitiesRegistry.class));
- // final RatePanel panel = new RatePanel(null, null,
- // i(I18nUITranslationService.class),
- // i(WorkspaceSkeleton.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ActionManager>(ActionManager.class) {
- // @Override
- // public ActionManager create() {
- // return new ActionManager();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
- // @Override
- // public ActionGroupSummaryToolbar create() {
- // final ActionToolbarPanel<StateToken> panel = new
- // ActionToolbarPanel<StateToken>(p(ActionManager.class));
- // final ActionGroupSummaryToolbarPresenter toolbar = new
- // ActionGroupSummaryToolbarPresenter(panel);
- // return toolbar;
- // }
- // }, new
- // Factory<ActionParticipationToolbar>(ActionParticipationToolbar.class)
- // {
- // @Override
- // public ActionParticipationToolbar create() {
- // final ActionToolbarPanel<StateToken> panel = new
- // ActionToolbarPanel<StateToken>(p(ActionManager.class));
- // final ActionParticipationSummaryToolbarPresenter toolbar = new
- // ActionParticipationSummaryToolbarPresenter(
- // panel);
- // return toolbar;
- // }
- // }, new
- // Factory<ActionBuddiesSummaryToolbar>(ActionBuddiesSummaryToolbar.class)
- // {
- // @Override
- // public ActionBuddiesSummaryToolbar create() {
- // final ActionToolbarPanel<UserSimpleDTO> panel = new
- // ActionToolbarPanel<UserSimpleDTO>(
- // p(ActionManager.class));
- // final ActionBuddiesSummaryToolbarPresenter toolbar = new
- // ActionBuddiesSummaryToolbarPresenter(panel);
- // return toolbar;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<GroupMembersSummary>(GroupMembersSummary.class) {
- // // @Override
- // // public GroupMembersSummary create() {
- // // final GroupMembersSummaryPresenter presenter = new
- // // GroupMembersSummaryPresenter(
- // // i(I18nUITranslationService.class), i(StateManager.class),
- // // i(ImageUtils.class),
- // // i(Session.class), p(SocialNetworkServiceAsync.class),
- // // p(GroupServiceAsync.class),
- // // p(GroupLiveSearcher.class), p(ChatEngine.class),
- // // i(GroupActionRegistry.class),
- // // i(ActionGroupSummaryToolbar.class), p(FileDownloadUtils.class),
- // // i(AccessRightsClientManager.class), i(IconResources.class));
- // // final GroupMembersSummaryView view = new
- // // GroupMembersSummaryPanel(presenter,
- // // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class), i(
- // // ActionGroupSummaryToolbar.class).getView());
- // // presenter.init(view);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<AddAsBuddieHeaderButton>(AddAsBuddieHeaderButton.class) {
- // @Override
- // public AddAsBuddieHeaderButton create() {
- // return new AddAsBuddieHeaderButton(p(ChatEngine.class),
- // i(Session.class), i(StateManager.class),
- // i(I18nTranslationService.class), i(IconResources.class),
- // i(EntityHeader.class));
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<BuddiesSummary>(BuddiesSummary.class) {
- // // @Override
- // // public BuddiesSummary create() {
- // // final BuddiesSummaryPresenter presenter = new
- // // BuddiesSummaryPresenter(i(StateManager.class),
- // // i(Session.class), p(UserServiceAsync.class),
- // // i(UserActionRegistry.class),
- // // i(I18nTranslationService.class), p(ChatEngine.class),
- // // i(ActionBuddiesSummaryToolbar.class),
- // // p(FileDownloadUtils.class), i(ImageUtils.class),
- // // p(SocialNetworkServiceAsync.class),
- // // i(GroupActionRegistry.class), i(AccessRightsClientManager.class),
- // // i(IconResources.class));
- // // final BuddiesSummaryPanel panel = new
- // BuddiesSummaryPanel(presenter,
- // // i(WorkspaceSkeleton.class),
- // // i(I18nTranslationService.class), i(ActionManager.class),
- // // i(ActionBuddiesSummaryToolbar.class).getView());
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<ParticipationSummary>(ParticipationSummary.class) {
- // // @Override
- // // public ParticipationSummary create() {
- // // final ParticipationSummaryPresenter presenter = new
- // // ParticipationSummaryPresenter(
- // // i(I18nUITranslationService.class), i(StateManager.class),
- // // i(ImageUtils.class),
- // // i(Session.class), p(SocialNetworkServiceAsync.class),
- // // i(GroupActionRegistry.class),
- // // i(ActionParticipationToolbar.class), p(FileDownloadUtils.class),
- // // i(AccessRightsClientManager.class), i(IconResources.class));
- // // final ParticipationSummaryView view = new
- // // ParticipationSummaryPanel(presenter,
- // // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class), i(
- // // ActionParticipationToolbar.class).getView());
- // // presenter.init(view);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<TagsSummary>(TagsSummary.class) {
- // // @Override
- // // public TagsSummary create() {
- // // final TagsSummaryPresenter presenter = new
- // // TagsSummaryPresenter(i(Session.class),
- // // p(SiteSearcher.class), i(StateManager.class));
- // // final TagsSummaryPanel panel = new TagsSummaryPanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<NoHomePage>(NoHomePage.class) {
- // @Override
- // public NoHomePage create() {
- // final NoHomePagePresenter presenter = new
- // NoHomePagePresenter(i(StateManager.class),
- // p(EntityHeader.class));
- // final NoHomePagePanel panel = new NoHomePagePanel(presenter,
- // i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<GroupOptions>(GroupOptions.class) {
- // @Override
- // public GroupOptions create() {
- // final GroupOptionsPresenter presenter = new
- // GroupOptionsPresenter(i(StateManager.class),
- // i(I18nTranslationService.class), i(IconResources.class));
- // final GroupOptionsPanel panel = new GroupOptionsPanel(presenter,
- // i(EntityHeader.class),
- // i(I18nTranslationService.class), i(NotifyLevelImages.class),
- // i(GroupOptionsCollection.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<UserOptions>(UserOptions.class) {
- // // @Override
- // // public UserOptions create() {
- // // final UserOptionsPresenter presenter = new
- // // UserOptionsPresenter(i(Session.class),
- // // i(StateManager.class), i(I18nTranslationService.class),
- // // i(IconResources.class),
- // // i(SiteUserOptions.class));
- // // final UserOptionsPanel panel = new UserOptionsPanel(presenter,
- // // i(EntityHeader.class),
- // // i(I18nTranslationService.class), i(NotifyLevelImages.class),
- // // i(UserOptionsCollection.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
- // @Override
- // public EntityOptionsToolsConf create() {
- // final GroupOptionsToolsConfPresenter presenter = new
- // GroupOptionsToolsConfPresenter(
- // i(StateManager.class), i(Session.class),
- // i(I18nTranslationService.class),
- // i(GroupOptions.class), p(GroupServiceAsync.class));
- // final EntityOptionsToolsConfPanel panel = new
- // EntityOptionsToolsConfPanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class, new
- // Factory<UserOptionsToolsConf>(UserOptionsToolsConf.class) {
- // @Override
- // public UserOptionsToolsConf create() {
- // final UserOptionsToolsConfPresenter presenter = new
- // UserOptionsToolsConfPresenter(i(Session.class),
- // i(StateManager.class), i(I18nTranslationService.class),
- // i(UserOptions.class),
- // p(GroupServiceAsync.class));
- // final EntityOptionsToolsConfPanel panel = new
- // EntityOptionsToolsConfPanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<GroupOptionsLogo>(GroupOptionsLogo.class) {
- // @Override
- // public GroupOptionsLogo create() {
- // final EntityOptionsLogoPresenter presenter = new
- // GroupOptionsLogoPresenter(i(Session.class),
- // i(EntityHeader.class), i(GroupOptions.class), i(StateManager.class),
- // p(UserServiceAsync.class),
- // p(ChatEngine.class));
- // final GroupOptionsLogoPanel panel = new
- // GroupOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class, new
- // Factory<UserOptionsLogo>(UserOptionsLogo.class) {
- // @Override
- // public UserOptionsLogo create() {
- // final EntityOptionsLogoPresenter presenter = new
- // UserOptionsLogoPresenter(i(Session.class),
- // i(EntityHeader.class), i(UserOptions.class), i(StateManager.class),
- // p(UserServiceAsync.class),
- // p(ChatEngine.class));
- // final UserOptionsLogoPanel panel = new
- // UserOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<GroupOptionsDefLicense>(GroupOptionsDefLicense.class) {
- // @Override
- // public GroupOptionsDefLicense create() {
- // final GroupOptionsDefLicensePresenter presenter = new
- // GroupOptionsDefLicensePresenter(
- // i(GroupOptions.class), i(StateManager.class), i(Session.class),
- // p(LicenseWizard.class),
- // p(LicenseChangeAction.class));
- // final EntityOptionsDefLicensePanel panel = new
- // EntityOptionsDefLicensePanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class, new
- // Factory<UserOptionsDefLicense>(UserOptionsDefLicense.class) {
- // @Override
- // public UserOptionsDefLicense create() {
- // final UserOptionsDefLicensePresenter presenter = new
- // UserOptionsDefLicensePresenter(
- // i(UserOptions.class), i(Session.class), p(LicenseWizard.class),
- // p(LicenseChangeAction.class));
- // final EntityOptionsDefLicensePanel panel = new
- // EntityOptionsDefLicensePanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<GroupOptionsPublicSpaceConf>(
- // GroupOptionsPublicSpaceConf.class) {
- // @Override
- // public GroupOptionsPublicSpaceConf create() {
- // final WsThemeSelector themeSelector = i(WsThemeSelector.class);
- // final GroupOptionsPublicSpaceConfPresenter presenter = new
- // GroupOptionsPublicSpaceConfPresenter(
- // i(Session.class), i(StateManager.class), i(GroupOptions.class),
- // i(WsThemeManager.class),
- // themeSelector, p(GroupServiceAsync.class), i(WsBackManager.class));
- // final EntityOptionsPublicSpaceConfPanel panel = new
- // EntityOptionsPublicSpaceConfPanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class),
- // themeSelector,
- // i(FileDownloadUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class,
- // new
- // Factory<UserOptionsPublicSpaceConf>(UserOptionsPublicSpaceConf.class)
- // {
- // @Override
- // public UserOptionsPublicSpaceConf create() {
- // final WsThemeSelector themeSelector = i(WsThemeSelector.class);
- // final UserOptionsPublicSpaceConfPresenter presenter = new
- // UserOptionsPublicSpaceConfPresenter(
- // i(Session.class), i(StateManager.class), i(UserOptions.class),
- // i(WsThemeManager.class),
- // themeSelector, p(GroupServiceAsync.class), i(WsBackManager.class));
- // final EntityOptionsPublicSpaceConfPanel panel = new
- // EntityOptionsPublicSpaceConfPanel(
- // presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class), themeSelector,
- // i(FileDownloadUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseChangeAction>(LicenseChangeAction.class) {
- // @Override
- // public LicenseChangeAction create() {
- // return new LicenseChangeAction(p(GroupServiceAsync.class),
- // i(Session.class),
- // i(I18nTranslationService.class), i(StateManager.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<RenameAction>(RenameAction.class) {
- // @Override
- // public RenameAction create() {
- // return new RenameAction(i(I18nTranslationService.class),
- // i(Session.class), p(ContentServiceAsync.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizard>(LicenseWizard.class) {
- // @Override
- // public LicenseWizard create() {
- // final LicenseWizardPresenter presenter = new LicenseWizardPresenter(
- // i(LicenseWizardFirstFormView.class),
- // i(LicenseWizardSndFormView.class),
- // i(LicenseWizardTrdFormView.class), i(LicenseWizardFrdFormView.class),
- // i(Session.class));
- // final LicenseWizardPanel panel = new LicenseWizardPanel(presenter,
- // i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardFirstFormView>(LicenseWizardFirstFormView.class)
- // {
- // @Override
- // public LicenseWizardFirstFormView create() {
- // return new LicenseWizardFirstForm(i(I18nTranslationService.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardSndFormView>(LicenseWizardSndFormView.class) {
- // @Override
- // public LicenseWizardSndFormView create() {
- // return new LicenseWizardSndForm(i(I18nTranslationService.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardTrdFormView>(LicenseWizardTrdFormView.class) {
- // @Override
- // public LicenseWizardTrdFormView create() {
- // return new LicenseWizardTrdForm(i(Images.class),
- // i(I18nTranslationService.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardFrdFormView>(LicenseWizardFrdFormView.class) {
- // @Override
- // public LicenseWizardFrdFormView create() {
- // return new LicenseWizardFrdForm(i(I18nTranslationService.class),
- // i(Session.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<FileUploader>(FileUploader.class) {
- // @Override
- // public FileUploader create() {
- // final FileUploaderPresenter presenter = new
- // FileUploaderPresenter(i(Session.class));
- // final FileUploaderDialog panel = new FileUploaderDialog(presenter,
- // i(I18nUITranslationService.class),
- // i(WorkspaceSkeleton.class));
- // presenter.init(panel);
- // return presenter;
- // }
- //
- // @Override
- // public void onAfterCreated(final FileUploader uploader) {
- // i(ContextNavigator.class).addFileUploaderListener(uploader);
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<SiteSearcher>(SiteSearcher.class) {
- // @Override
- // public SiteSearcher create() {
- // final SiteSearcherPresenter presenter = new
- // SiteSearcherPresenter(p(StateManager.class));
- // final SiteSearcherView view = new SiteSearcherPanel(presenter,
- // i(I18nTranslationService.class),
- // i(WorkspaceSkeleton.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<I18nTranslator>(I18nTranslator.class) {
- // @Override
- // public I18nTranslator create() {
- // final I18nTranslatorPresenter presenter = new
- // I18nTranslatorPresenter(i(Session.class),
- // i(I18nServiceAsync.class), i(I18nUITranslationService.class));
- // final I18nTranslatorView view = new I18nTranslatorPanel(presenter,
- // i(I18nTranslationService.class),
- // i(LanguageSelector.class), i(WorkspaceSkeleton.class),
- // i(Images.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteOptionsI18nTranslatorAction>(
- // // SiteOptionsI18nTranslatorAction.class) {
- // // @Override
- // // public SiteOptionsI18nTranslatorAction create() {
- // // return new SiteOptionsI18nTranslatorAction(i(SiteOptions.class),
- // // i(I18nTranslationService.class),
- // // i(IconResources.class), p(I18nTranslator.class));
- // // }
- // // });
- //
- // // register(Singleton.class, new Factory<SignIn>(SignIn.class) {
- // // @Override
- // // public SignIn create() {
- // // final SignInPresenter presenter = new
- // // SignInPresenter(i(Session.class), i(StateManager.class),
- // // i(I18nUITranslationService.class), p(UserServiceAsync.class),
- // // p(Register.class));
- // // final SignInView panel = new SignInPanel(presenter,
- // // i(I18nTranslationService.class),
- // // i(WorkspaceSkeleton.class), i(NotifyLevelImages.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // //
- // // register(Singleton.class, new Factory<Register>(Register.class) {
- // // @Override
- // // public Register create() {
- // // final RegisterPresenter presenter = new
- // // RegisterPresenter(i(Session.class), i(StateManager.class),
- // // i(I18nUITranslationService.class), p(UserServiceAsync.class),
- // // p(SignIn.class));
- // // final RegisterView panel = new RegisterPanel(presenter,
- // // i(I18nTranslationService.class),
- // // i(WorkspaceSkeleton.class), i(Session.class),
- // // i(NotifyLevelImages.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(Singleton.class, new Factory<NewGroup>(NewGroup.class) {
- // // @Override
- // // public NewGroup create() {
- // // final NewGroupPresenter presenter = new
- // // NewGroupPresenter(i(I18nTranslationService.class),
- // // i(Session.class), i(StateManager.class),
- // // p(GroupServiceAsync.class));
- // // final NewGroupPanel view = new NewGroupPanel(presenter,
- // // i(I18nTranslationService.class),
- // // p(LicenseWizard.class), i(NotifyLevelImages.class));
- // // presenter.init(view);
- // // return presenter;
- // // }
- // // });
- //
- // register(Singleton.class, new
- // Factory<UserLiveSearcher>(UserLiveSearcher.class) {
- // @Override
- // public UserLiveSearcher create() {
- // final UserLiveSearcherPresenter presenter = new
- // UserLiveSearcherPresenter();
- // final EntityLiveSearcherView view = new
- // UserLiveSearcherPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<GroupLiveSearcher>(GroupLiveSearcher.class) {
- // @Override
- // public GroupLiveSearcher create() {
- // final GroupLiveSearcherPresenter presenter = new
- // GroupLiveSearcherPresenter();
- // final EntityLiveSearcherView view = new
- // GroupLiveSearchPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // // register(Singleton.class, new
- // // Factory<ToolSelector>(ToolSelector.class) {
- // // @Override
- // // public ToolSelector create() {
- // // final ToolSelectorPresenter presenter = new
- // // ToolSelectorPresenter(i(StateManager.class),
- // // i(WsThemeManager.class));
- // // return presenter;
- // // }
- // // });
- //
- // register(Singleton.class, new
- // Factory<LanguageSelector>(LanguageSelector.class) {
- // @Override
- // public LanguageSelector create() {
- // final LanguageSelectorPresenter presenter = new
- // LanguageSelectorPresenter(i(Session.class));
- // final LanguageSelectorView view = new
- // LanguageSelectorPanel(presenter, i(I18nTranslationService.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // // Register of tokens like "signin", "newgroup", "translate" etcetera
- // i(StateManager.class).addSiteToken(SiteTokens.SIGNIN, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(SignIn.class).showSignInDialog();
- // }
- // });
- //
- // i(StateManager.class).addSiteToken(SiteTokens.REGISTER, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(Register.class).doRegister();
- // }
- // });
- //
- // i(StateManager.class).addSiteToken(SiteTokens.NEWGROUP, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(NewGroup.class).doNewGroup();
- // }
- // });
- //
- // i(StateManager.class).addSiteToken(SiteTokens.TRANSLATE, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(I18nTranslator.class).doShowTranslator();
- // }
- // });
- //
- // // register(NoDecoration.class, new
- // // Factory<ActionContentToolbar>(ActionContentToolbar.class) {
- // // @Override
- // // public ActionContentToolbar create() {
- // // final ActionCntCtxToolbarPanel<StateToken> tbar = new
- // // ActionCntCtxToolbarPanel<StateToken>(
- // // AbstractFoldableContentActions.CONTENT_TOPBAR,
- // // p(ActionManager.class),
- // // i(WorkspaceSkeleton.class));
- // // final ActionContentToolbar toolbar = new
- // // ActionContentToolbarPresenter(tbar);
- // // return toolbar;
- // // }
- // // });
- //
- // // register(Singleton.class, new
- // // Factory<ContentEditor>(ContentEditor.class) {
- // // @Override
- // // public ContentEditor create() {
- // // final ContentEditorPresenter presenter = new
- // // ContentEditorPresenter(i(I18nTranslationService.class),
- // // i(Session.class), i(RTEImgResources.class),
- // // p(InsertLinkDialog.class),
- // // p(ColorWebSafePalette.class), p(EditHtmlDialog.class),
- // // p(InsertImageDialog.class),
- // // p(InsertMediaDialog.class), p(InsertTableDialog.class),
- // // p(InsertSpecialCharDialog.class),
- // // i(SchedulerManager.class), true, i(StateManager.class),
- // // i(SiteSignOutLink.class),
- // // i(WorkspaceSkeleton.class), i(TimerWrapper.class),
- // // i(EntityTitle.class));
- // // final ContentEditorPanel panel = new ContentEditorPanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(GlobalShortcutRegister.class), i(GuiBindingsRegister.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // register(NoDecoration.class, new
- // Factory<ActionContextTopToolbar>(ActionContextTopToolbar.class) {
- // @Override
- // public ActionContextTopToolbar create() {
- // final ActionCntCtxToolbarPanel<StateToken> panel = new
- // ActionCntCtxToolbarPanel<StateToken>(
- // OldAbstractFoldableContentActions.CONTEXT_TOPBAR,
- // p(ActionManager.class),
- // i(WorkspaceSkeleton.class));
- // final ActionContextTopToolbar toolbar = new
- // ActionContextTopToolbar(panel);
- // return toolbar;
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<ActionContextBottomToolbar>(ActionContextBottomToolbar.class)
- // {
- // @Override
- // public ActionContextBottomToolbar create() {
- // final ActionCntCtxToolbarPanel<StateToken> panel = new
- // ActionCntCtxToolbarPanel<StateToken>(
- // OldAbstractFoldableContentActions.CONTEXT_BOTTOMBAR,
- // p(ActionManager.class),
- // i(WorkspaceSkeleton.class));
- // final ActionContextBottomToolbar toolbar = new
- // ActionContextBottomToolbar(panel);
- // return toolbar;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContextNavigator>(ContextNavigator.class) {
- // @Override
- // public ContextNavigator create() {
- // final ContextNavigatorPresenter presenter = new
- // ContextNavigatorPresenter(i(StateManager.class),
- // i(Session.class), i(I18nTranslationService.class),
- // i(ContentIconsRegistry.class),
- // i(ContentCapabilitiesRegistry.class),
- // i(ActionContextTopToolbar.class),
- // i(ActionContextBottomToolbar.class), i(ContextActionRegistry.class),
- // p(FileDownloadUtils.class), true, i(RenameAction.class));
- // final ContextNavigatorPanel panel = new
- // ContextNavigatorPanel(presenter,
- // i(I18nTranslationService.class), i(WorkspaceSkeleton.class),
- // i(ActionManager.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContextPropEditor>(ContextPropEditor.class) {
- // @Override
- // public ContextPropEditor create() {
- // final ContextPropEditorPresenter presenter = new
- // ContextPropEditorPresenter(i(Session.class),
- // i(StateManager.class), i(ContentCapabilitiesRegistry.class),
- // p(TagsSummary.class),
- // p(ContentServiceAsync.class), i(EntitySubTitle.class));
- // final ContextPropEditorView view = new
- // ContextPropEditorPanel(presenter,
- // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class),
- // p(LanguageSelector.class),
- // i(Images.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // register(InsertImageGroup.class, new
- // Factory<InsertImageLocal>(InsertImageLocal.class) {
- // @Override
- // public InsertImageLocal create() {
- // final InsertImageLocalPresenter presenter = new
- // InsertImageLocalPresenter(i(InsertImageDialog.class),
- // i(Session.class));
- // final InsertImageLocalPanel panel = new
- // InsertImageLocalPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class),
- // i(Session.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<MaxMinWorkspace>(MaxMinWorkspace.class) {
- // // @Override
- // // public MaxMinWorkspace create() {
- // // final MaxMinWorkspacePresenter presenter = new
- // // MaxMinWorkspacePresenter(
- // // i(GlobalShortcutRegister.class), i(IconResources.class),
- // // i(I18nTranslationService.class),
- // // i(SiteOptions.class));
- // // final MaxMinWorkspacePanel panel = new
- // // MaxMinWorkspacePanel(i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(InsertLinkGroup.class, new
- // Factory<InsertLinkLocal>(InsertLinkLocal.class) {
- // @Override
- // public InsertLinkLocal create() {
- // final InsertLinkLocalPresenter presenter = new
- // InsertLinkLocalPresenter(i(InsertLinkDialog.class));
- // final InsertLinkLocalPanel panel = new
- // InsertLinkLocalPanel(presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class), i(FileDownloadUtils.class),
- // i(StateTokenUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(InsertMediaGroup.class, new
- // Factory<InsertMediaLocal>(InsertMediaLocal.class) {
- // @Override
- // public InsertMediaLocal create() {
- // final InsertMediaLocalPresenter presenter = new
- // InsertMediaLocalPresenter(i(InsertMediaDialog.class),
- // i(Session.class), p(MediaUtils.class));
- // final InsertMediaLocalPanel panel = new
- // InsertMediaLocalPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- // i(GlobalShortcutRegister.class).enable();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditor;
-
-public interface ContentEditor extends RTESavingEditor {
-
- /**
- * Sets the "File" menu title (some times you want a "Post" or "Wikipage"
- * menu instead of a "File" menu).
- *
- * @param title
- * the new file menu title
- */
- void setFileMenuTitle(String title);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
-import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPanel;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-
-public class ContentEditorPanel extends RTESavingEditorPanel implements ContentEditorView {
-
- public ContentEditorPanel(final ContentEditorPresenter presenter, final I18nUITranslationService i18n,
- final GlobalShortcutRegister globalShortcutReg, final GuiBindingsRegister bindReg) {
- super(presenter, i18n, globalShortcutReg, bindReg);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,174 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor;
-
-import static org.ourproject.kune.platf.client.actions.AbstractExtendedAction.NO_ICON;
-import static org.ourproject.kune.platf.client.actions.AbstractExtendedAction.NO_TEXT;
-
-import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
-import org.ourproject.kune.platf.client.actions.Action;
-import org.ourproject.kune.platf.client.actions.ActionEvent;
-import org.ourproject.kune.platf.client.actions.KeyStroke;
-import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
-import org.ourproject.kune.platf.client.actions.ui.OldMenuItemDescriptor;
-import org.ourproject.kune.platf.client.shortcuts.Keyboard;
-import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
-import org.ourproject.kune.platf.client.ui.rte.basic.RTEditor;
-import org.ourproject.kune.platf.client.ui.rte.basic.RTEditorPanel;
-import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlDialog;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
-import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPresenter;
-import org.ourproject.kune.workspace.client.skel.Toolbar;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.common.client.utils.TimerWrapper;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.resources.client.ImageResource;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Window.ClosingEvent;
-import com.google.gwt.user.client.Window.ClosingHandler;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.event.ContainerListenerAdapter;
-
-public class ContentEditorPresenter extends RTESavingEditorPresenter implements ContentEditor {
-
- public class RenameAction extends AbstractExtendedAction {
- public RenameAction(final String text, final String tooltip, final ImageResource icon) {
- super(text, tooltip, icon);
- }
-
- @Override
- public void actionPerformed(final ActionEvent actionEvent) {
- // entityTitle.edit();
- }
- }
-
- private RTEditorPanel editorPanel;
- // private final EntityTitle entityTitle;
- // private final SiteSignOutLink siteSignOutLink;
- private final I18nTranslationService i18n;
- private ComplexToolbar sndbar;
- private ComplexToolbar topbar;
- private VerticalPanel vpanel;
- private final WorkspaceSkeleton wspace;
-
- public ContentEditorPresenter(final I18nTranslationService i18n, final Session session,
- final RTEImgResources imgResources, final Provider<InsertLinkDialog> insLinkDialog,
- final Provider<ColorWebSafePalette> palette, final Provider<EditHtmlDialog> editHtmlDialog,
- final Provider<InsertImageDialog> insertImageDialog,
- final Provider<InsertMediaDialog> insertMediaDialog,
- final Provider<InsertTableDialog> insertTableDialog,
- final Provider<InsertSpecialCharDialog> insCharDialog, final SchedulerManager deferred,
- final boolean autoSave, final StateManager stateManager, final WorkspaceSkeleton wspace,
- final TimerWrapper timer) {
- super(i18n, session, imgResources, insLinkDialog, palette, editHtmlDialog, insertImageDialog,
- insertMediaDialog, insertTableDialog, insCharDialog, deferred, autoSave, stateManager, timer);
- super.setExtended(true);
- this.i18n = i18n;
-
- // this.entityTitle = entityTitle;
- this.wspace = wspace;
- Window.addWindowClosingHandler(new ClosingHandler() {
- @Override
- public void onWindowClosing(final ClosingEvent event) {
- if (isSavePending()) {
- event.setMessage(i18n.t("You have changes without save. Are you sure?"));
- }
- // onDoSaveAndClose();
- }
- });
- wspace.getEntityWorkspace().addContentListener(new ContainerListenerAdapter() {
- @Override
- public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
- final int rawWidth, final int rawHeight) {
- adjHeight(adjHeight);
- }
- });
-
- }
-
- private void addContentActions() {
- final RenameAction renameAction = new RenameAction(i18n.t("Rename"), NO_TEXT, NO_ICON);
- final OldMenuItemDescriptor renameItem = new OldMenuItemDescriptor(super.getFileMenu(), renameAction);
- renameItem.setLocation(RTEditor.TOPBAR);
- final KeyStroke key = KeyStroke.getKeyStroke(Keyboard.KEY_F2, 0);
- renameAction.putValue(Action.ACCELERATOR_KEY, key);
- super.setActionShortcut(key, renameAction);
- addAction(renameItem);
- }
-
- private void adjHeight(final int height) {
- final int barHeight = sndbar.getOffsetHeight();
- final int newHeight = height - 20 - barHeight;
- // Log.debug("Sndbar height: " + barHeight + " new height: " +
- // newHeight);
- editorPanel.adjustSize(newHeight);
- vpanel.setCellHeight(editorPanel, String.valueOf(newHeight));
- }
-
- @Override
- public void edit(final String html, final Listener<String> onSave, final Listener0 onEditCancelled) {
- super.edit(html, onSave, onEditCancelled);
- final Toolbar contentTopBar = wspace.getEntityWorkspace().getContentTopBar();
- contentTopBar.removeAll();
- contentTopBar.add(topbar);
- wspace.getEntityWorkspace().setContent(vpanel);
- adjHeight(wspace.getEntityWorkspace().getContentHeight());
- // siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
- }
-
- public void init(final ContentEditorView view) {
- super.init(view);
- addContentActions();
- vpanel = new VerticalPanel();
- editorPanel = (RTEditorPanel) super.getEditorArea();
- topbar = ((ComplexToolbar) super.getTopBar());
- sndbar = ((ComplexToolbar) super.getSndBar());
- vpanel.add(sndbar);
- vpanel.add(editorPanel);
- vpanel.setWidth("100%");
- }
-
- @Override
- protected void onCancelConfirmed() {
- wspace.getEntityWorkspace().clearContent();
- super.onCancelConfirmed();
- // siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
- }
-
- @Override
- public void setFileMenuTitle(final String fileMenuTitleNew) {
- super.getFileMenu().setText(fileMenuTitleNew);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorView;
-
-public interface ContentEditorView extends RTESavingEditorView {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-public interface EntityHeader {
-
- void addAction(OldGuiActionDescrip descriptor);
-
- void addWidget(View widget);
-
- /**
- * Refresh the logo from the group info in the client session
- */
- void refreshGroupLogo();
-
- /**
- * Reload the logo from the group reloaded from the server
- */
- void reloadGroupLogoImage();
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-
-public class EntityHeaderButton extends IconLabel implements View {
- public EntityHeaderButton(final AbstractImagePrototype icon, final String text) {
- super(icon, text, false);
- setDefStyle();
- }
-
- public EntityHeaderButton(final String text, final AbstractImagePrototype icon) {
- super(text, icon, false);
- setDefStyle();
- }
-
- private void setDefStyle() {
- addStyleName("kune-Margin-Medium-t");
- addStyleName("kune-pointer");
- addStyleName("kune-floatright");
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,132 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.entityheader;
-
-import java.util.Date;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GSpaceTheme;
-import cc.kune.core.shared.dto.GroupDTO;
-
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class EntityHeaderPanel extends HorizontalPanel implements EntityHeaderView {
-
- private final Provider<FileDownloadUtils> downloadProvider;
- private final EntityTextLogo entityTextLogo;
- private final Images images;
- private final VerticalPanel vpanel;
- private final ComplexToolbar toolbar;
-
- public EntityHeaderPanel(final WorkspaceSkeleton wskel, final Provider<FileDownloadUtils> downloadProvider,
- final Images images, final GuiBindingsRegister bindings) {
- super();
- super.setWidth("100%");
- this.downloadProvider = downloadProvider;
- this.images = images;
- vpanel = new VerticalPanel();
- vpanel.setWidth("100%");
- vpanel.setHorizontalAlignment(ALIGN_RIGHT);
- entityTextLogo = new EntityTextLogo();
- add(entityTextLogo);
- toolbar = new ComplexToolbar(bindings);
- toolbar.setTranspStyle();
- vpanel.add(toolbar);
- add(vpanel);
- wskel.addToEntityMainHeader(this);
- }
-
- public void addAction(final OldGuiActionDescrip descriptor) {
- toolbar.add(descriptor);
- }
-
- public void addWidget(final View view) {
- final Widget widget = (Widget) view;
- vpanel.add(widget);
- }
-
- public void reloadImage(final GroupDTO group) {
- entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache="
- + new Date().getTime());
- }
-
- @Deprecated
- public void setFullLogo(final StateToken stateToken, final boolean clipped) {
- clear();
- final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
- Image logo;
- if (clipped) {
- logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_DEF_WIDTH, FileConstants.LOGO_DEF_HEIGHT);
- } else {
- logo = new Image(imageUrl);
- logo.setWidth(String.valueOf(FileConstants.LOGO_DEF_WIDTH));
- logo.setHeight(String.valueOf(FileConstants.LOGO_DEF_HEIGHT));
- }
- add(logo);
- }
-
- public void setLargeFont() {
- entityTextLogo.setLargeFont();
- }
-
- public void setLogoImage(final StateToken stateToken) {
- entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(stateToken));
- }
-
- public void setLogoImageVisible(final boolean visible) {
- entityTextLogo.setLogoVisible(visible);
- }
-
- public void setLogoText(final String groupName) {
- entityTextLogo.setLogoText(groupName);
- }
-
- public void setMediumFont() {
- entityTextLogo.setMediumFont();
- }
-
- public void setSmallFont() {
- entityTextLogo.setSmallFont();
- }
-
- public void setTheme(final GSpaceTheme oldTheme, final GSpaceTheme newTheme) {
- if (oldTheme != null) {
- entityTextLogo.removeStyleDependentName(oldTheme.toString());
- }
- entityTextLogo.addStyleDependentName(newTheme.toString());
- }
-
- public void showDefUserLogo() {
- entityTextLogo.setLogoImage(images.personAvatarDef());
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,108 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.gspace.client.themes.GSpaceThemeManager;
-
-import com.calclab.suco.client.events.Listener2;
-
-public class EntityHeaderPresenter implements EntityHeader {
- private static final int LARGE_NAME_LIMIT = 20;
- private static final int MEDIUM_NAME_LIMIT = 90;
-
- private final Session session;
- private EntityHeaderView view;
-
- public EntityHeaderPresenter(final StateManager stateManager, final GSpaceThemeManager theme,
- final Session session) {
- this.session = session;
-
- stateManager.onGroupChanged(new Listener2<String, String>() {
- @Override
- public void onEvent(final String oldGroup, final String newGroup) {
- setGroupLogo(session.getCurrentState().getGroup());
- }
- });
- // theme.addOnThemeChanged(new Listener2<GSpaceTheme, GSpaceTheme>() {
- // public void onEvent(final GSpaceTheme oldTheme, final GSpaceTheme
- // newTheme) {
- // view.setTheme(oldTheme, newTheme);
- // }
- // });
- }
-
- @Override
- public void addAction(final OldGuiActionDescrip descriptor) {
- view.addAction(descriptor);
- }
-
- @Override
- public void addWidget(final View widget) {
- view.addWidget(widget);
- }
-
- public void init(final EntityHeaderView view) {
- this.view = view;
- }
-
- @Override
- public void refreshGroupLogo() {
- setGroupLogo(session.getCurrentState().getGroup());
- }
-
- @Override
- public void reloadGroupLogoImage() {
- view.reloadImage(session.getCurrentState().getGroup());
- }
-
- void setGroupLogo(final GroupDTO group) {
- if (group.hasLogo()) {
- setLogoText(group.getLongName());
- view.setLogoImage(group.getStateToken());
- view.setLogoImageVisible(true);
- } else {
- setLogoText(group.getLongName());
- if (group.isPersonal()) {
- view.showDefUserLogo();
- view.setLogoImageVisible(true);
- } else {
- view.setLogoImageVisible(false);
- }
- }
- }
-
- void setLogoText(final String name) {
- final int length = name.length();
- if (length <= LARGE_NAME_LIMIT) {
- view.setLargeFont();
- } else if (length <= MEDIUM_NAME_LIMIT) {
- view.setMediumFont();
- } else {
- view.setSmallFont();
- }
- view.setLogoText(name);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GSpaceTheme;
-import cc.kune.core.shared.dto.GroupDTO;
-
-public interface EntityHeaderView {
-
- void addAction(OldGuiActionDescrip descriptor);
-
- void addWidget(View view);
-
- void reloadImage(GroupDTO group);
-
- void setLargeFont();
-
- void setLogoImage(StateToken stateToken);
-
- void setLogoImageVisible(boolean visible);
-
- void setLogoText(final String groupName);
-
- void setMediumFont();
-
- void setSmallFont();
-
- void setTheme(final GSpaceTheme oldTheme, GSpaceTheme newTheme);
-
- void showDefUserLogo();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.entityheader;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class EntityTextLogo extends VerticalPanel {
-
- public static final String LOGO_NAME = "k-elogop-ln";
- public static final String LOGO_IMAGE = "k-elogop-image";
-
- private static final String _100 = "100%";
- private static final String LOGO_MEDIUM_FONT_STYLE = "k-elogo-l-m";
- private static final String LOGO_SMALL_FONT_STYLE = "k-elogo-l-s";
- private static final String LOGO_LARGE_FONT_STYLE = "k-elogo-l-l";
- private final Label logoLabel;
- private final Image logoImage;
-
- public EntityTextLogo() {
- // Initialize
- super();
- final HorizontalPanel generalHP = new HorizontalPanel();
- final VerticalPanel logoTextVP = new VerticalPanel();
- logoImage = new Image();
- logoLabel = new Label();
- final Label expandCell = new Label("");
-
- logoImage.ensureDebugId(LOGO_IMAGE);
- logoLabel.ensureDebugId(LOGO_NAME);
-
- // Layout
- add(generalHP);
- generalHP.add(logoImage);
- generalHP.add(logoTextVP);
- logoTextVP.add(logoLabel);
-
- // Set properties
-
- expandCell.setStyleName("k-elogop-expand");
- generalHP.setWidth(_100);
- generalHP.setHeight(_100);
- generalHP.setCellWidth(logoTextVP, _100);
- generalHP.setCellHeight(logoTextVP, _100);
- logoTextVP.setWidth(_100);
- logoTextVP.setCellWidth(logoLabel, _100);
- super.setVerticalAlignment(ALIGN_MIDDLE);
- logoTextVP.setVerticalAlignment(ALIGN_MIDDLE);
- generalHP.setVerticalAlignment(ALIGN_MIDDLE);
- setStylePrimaryName("k-entitytextlogo");
- addStyleName("k-entitytextlogo-no-border");
- logoImage.setVisible(false);
- setLogoTextImpl("");
- }
-
- public void setLargeFont() {
- resetFontSize();
- logoLabel.addStyleName(LOGO_LARGE_FONT_STYLE);
- }
-
- public void setLogoImage(final AbstractImagePrototype imageProto) {
- imageProto.applyTo(logoImage);
- }
-
- public void setLogoImage(final String url) {
- Image.prefetch(url);
- logoImage.setUrl(url);
- }
-
- public void setLogoText(final String text) {
- setLogoTextImpl(text);
- }
-
- public void setLogoVisible(final boolean visible) {
- logoImage.setVisible(visible);
- }
-
- public void setMediumFont() {
- resetFontSize();
- logoLabel.addStyleName(LOGO_MEDIUM_FONT_STYLE);
- }
-
- public void setSmallFont() {
- resetFontSize();
- logoLabel.addStyleName(LOGO_SMALL_FONT_STYLE);
- }
-
- private void resetFontSize() {
- logoLabel.removeStyleName(LOGO_LARGE_FONT_STYLE);
- logoLabel.removeStyleName(LOGO_SMALL_FONT_STYLE);
- logoLabel.removeStyleName(LOGO_MEDIUM_FONT_STYLE);
- }
-
- private void setLogoTextImpl(final String text) {
- logoLabel.setText(text);
- }
-}
\ No newline at end of file
Added: trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,88 @@
+package cc.kune.selenium;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.events.WebDriverEventListener;
+import org.testng.Assert;
+
+public class CustomWebDriverEventListener implements WebDriverEventListener {
+
+ @Override
+ public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void afterClickOn(final WebElement element, final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterFindBy(final By by, final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void afterNavigateBack(final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterNavigateForward(final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterNavigateTo(final String url, final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterScript(final String script, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeChangeValueOf(final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeClickOn(final WebElement element, final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void beforeFindBy(final By by, final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeNavigateBack(final WebDriver driver) {
+ ;
+ }
+
+ @Override
+ public void beforeNavigateForward(final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeNavigateTo(final String url, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeScript(final String script, final WebDriver driver) {
+ }
+
+ @Override
+ public void onException(final Throwable throwable, final WebDriver driver) {
+ }
+
+ public void sleep(final int milliseconds) {
+ try {
+ Thread.sleep(milliseconds);
+ } catch (final InterruptedException e) {
+ Assert.fail("Exception in sleep method", e);
+ }
+ }
+
+ private void slow() {
+ sleep(500);
+ }
+}
\ No newline at end of file
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -22,22 +22,23 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
-import org.openqa.selenium.support.events.EventFiringWebDriver;
-import org.openqa.selenium.support.events.WebDriverEventListener;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import org.testng.Assert;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
import org.testng.annotations.DataProvider;
+import cc.kune.core.client.auth.AnonUsersManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.selenium.login.EntityHeaderPageObject;
import cc.kune.selenium.login.LoginPageObject;
-import cc.kune.selenium.tools.GenericWebDriver;
+import cc.kune.selenium.login.RegisterPageObject;
import cc.kune.selenium.tools.SeleniumConstants;
-import cc.kune.selenium.tools.SeleniumModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -45,127 +46,63 @@
public class KuneSeleniumDefaults {
private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
public static boolean mustCloseFinally = true;
- protected EventFiringWebDriver eventFiring;
+ private final String baseUrl;
+ protected final EntityHeaderPageObject entityHeader;
private final Injector injector;
protected LoginPageObject login;
- protected GenericWebDriver webdriver;
+ protected RegisterPageObject register;
+ private final WebDriver webdriver;
public KuneSeleniumDefaults() {
+ // baseUrl = "http://kune.beta.iepala.es/ws/?locale=en#";
+ baseUrl = "http://127.0.0.1:8888/ws/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:99…";
injector = Guice.createInjector(new SeleniumModule());
- webdriver = injector.getInstance(GenericWebDriver.class);
+ webdriver = injector.getInstance(WebDriver.class);
login = injector.getInstance(LoginPageObject.class);
- eventFiring = injector.getInstance(EventFiringWebDriver.class);
- eventFiring.register(new WebDriverEventListener() {
+ register = injector.getInstance(RegisterPageObject.class);
+ entityHeader = injector.getInstance(EntityHeaderPageObject.class);
+ final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
+ PageFactory.initElements(locator, login);
+ PageFactory.initElements(locator, register);
+ PageFactory.initElements(locator, entityHeader);
+ }
- @Override
- public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
+ @BeforeSuite
+ public void beforeClass() {
+ resize();
+ LOG.info("Going home");
+ home();
+ webdriver.findElement(By.id(SeleniumConstants.GWTDEV + AnonUsersManager.ANON_MESSAGE_CLOSE_ICON)).click();
+ }
- @Override
- public void afterClickOn(final WebElement element, final WebDriver driver) {
- sleep(500);
- }
+ @BeforeMethod
+ public void beforeMethods(final ITestContext context) {
+ }
- @Override
- public void afterFindBy(final By by, final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterNavigateBack(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterNavigateForward(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterNavigateTo(final String url, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterScript(final String script, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeChangeValueOf(final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeClickOn(final WebElement element, final WebDriver driver) {
- sleep(500);
- }
-
- @Override
- public void beforeFindBy(final By by, final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeNavigateBack(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeNavigateForward(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeNavigateTo(final String url, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeScript(final String script, final WebDriver driver) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onException(final Throwable throwable, final WebDriver driver) {
- // TODO Auto-generated method stub
-
- }
- });
- final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
- PageFactory.initElements(locator, login);
+ public void close() {
+ webdriver.close();
}
@AfterSuite
public void closeBrowser() {
// We try to only open one window for all our selenium tests
if (mustCloseFinally) {
- webdriver.close();
+ close();
}
}
@DataProvider(name = "correctlogin")
public Object[][] createCorrectLogin() {
// The default correct user/password used in tests
- return new Object[][] { { SeleniumConstants.USERNAME, SeleniumConstants.PASSWD }, };
+ return new Object[][] { { SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_PASSWD } };
}
- // public void moveMouseAt(final Point point) {
- // webtester.moveMouseAt(point);
- // }
+ @DataProvider(name = "correctregister")
+ public Object[][] createCorrectRegister() {
+ // The default correct user/password used in tests
+ return new Object[][] { { SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_LONGNAME,
+ SeleniumConstants.USER_PASSWD, SeleniumConstants.USER_EMAIL } };
+ }
@DataProvider(name = "incorrectlogin")
public Object[][] createIncorrectLogin() {
@@ -174,46 +111,37 @@
{ "test1@localhost", "test" }, { "", "" } };
}
- @BeforeMethod
- public void setupSeleniumModule(final ITestContext context) {
+ public void get(final String url) {
+ webdriver.get(url);
+ }
- // if (!Suco.getComponents().hasProvider(WebDriver.class)) {
- // Suco.install(new SeleniumModule());
- // }
- if (webdriver == null) {
- // final ChromeDriver driver = new ChromeDriver();
- // // final HtmlUnitDriver driver = new HtmlUnitDriver(true);
- //
- // // final ProfilesIni allProfiles = new ProfilesIni();
- // // final FirefoxProfile profile =
- // // allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
- // // final FirefoxDriver driver = new FirefoxDriver(profile);
- //
- // locator = new AjaxElementLocatorFactory(driver,
- // SeleniumConstants.TIMEOUT);
- // webtester = new GenericWebTester(driver,
- // "http://kune.beta.iepala.es/ws/?locale=en#");
- // // webtester = Suco.get(GenericWebTester.class);
- // // login = Suco.get(LoginPageObject.class);
- // login = new LoginPageObject();
- // PageFactory.initElements(locator, login);
- // driver.get("http://kune.beta.iepala.es/ws/?locale=en#");
- // roster = Suco.get(RosterPageObject.class);
- // openChat = Suco.get(OpenChatPageObject.class);
- // search = Suco.get(SearchPageObject.class);
- // chat = Suco.get(ChatPageObject.class);
- // editBuddy = Suco.get(EditBuddyPageObject.class);
- // groupChat = Suco.get(GroupChatPageObject.class);
- // userPage = Suco.get(UserPageObject.class);
- // otherVCardPage = Suco.get(OtherVCardPageObject.class);
- // copyToClipboard = Suco.get(CopyToClipboardPageObject.class);
- // openGroupChat = Suco.get(OpenGroupChatPageObject.class);
- }
- LOG.info("Going home");
+ public String getPageSource() {
+ return webdriver.getPageSource();
+ }
- webdriver.home();
+ public void gotoToken(final StateToken token) {
+ get(baseUrl + token);
}
+ public void gotoToken(final String token) {
+ get(baseUrl + token);
+ }
+
+ public void home() {
+ assert baseUrl != null;
+ webdriver.get(baseUrl);
+ }
+
+ public void open(final String url) {
+ webdriver.get(url);
+ }
+
+ public void resize() {
+ final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+ // 1024,769
+ js.executeScript("window.resizeTo(840,770); window.moveTo(0,0);");
+ }
+
public void sleep(final int milliseconds) {
try {
Thread.sleep(milliseconds);
Modified: trunk/src/test/java/cc/kune/selenium/PageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -19,33 +19,78 @@
*/
package cc.kune.selenium;
+import java.util.List;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebDriver.Navigation;
+import org.openqa.selenium.WebDriver.Options;
+import org.openqa.selenium.WebDriver.TargetLocator;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ByIdOrName;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+import org.openqa.selenium.support.ui.Wait;
+import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
+import com.google.gwt.user.client.ui.UIObject;
import com.google.inject.Inject;
public abstract class PageObject {
- protected static final String GWTDEV = "gwt-debug-";
private static final Log LOG = LogFactory.getLog(PageObject.class.getName());
private static final long[] POLL_INTERVALS = { 10, 20, 30, 40, 50, 50, 50, 50, 100 };
@Inject
private WebDriver webdriver;
- protected WebElement findElement(final By by) {
- return getWebDriver().findElement(by);
+ protected void clearField(final WebElement elem) {
+ elem.sendKeys(Keys.chord(Keys.CONTROL, "a"), Keys.DELETE);
}
- private WebDriver getWebDriver() {
+ public WebElement findElement(final By by) {
+ return webdriver.findElement(by);
+ }
+
+ public List<WebElement> findElements(final By by) {
+ return webdriver.findElements(by);
+ }
+
+ public WebElement getById(final String id) {
+ return webdriver.findElement(By.id(UIObject.DEBUG_ID_PREFIX + id));
+ }
+
+ public String getCurrentUrl() {
+ return webdriver.getCurrentUrl();
+ }
+
+ public String getTitle() {
+ return webdriver.getTitle();
+ }
+
+ protected WebDriver getWebDriver() {
return webdriver;
}
+ public String getWindowHandle() {
+ return webdriver.getWindowHandle();
+ }
+
+ public Set<String> getWindowHandles() {
+ return webdriver.getWindowHandles();
+ }
+
+ public boolean isElementPresent(final String id) {
+ final Wait<WebDriver> wait = new WebDriverWait(webdriver, 5);
+ final WebElement element = wait.until(visibilityOfElementLocated(By.id(id)));
+ return element != null;
+ }
+
public boolean isPresent(final WebElement element) {
// FIXME: find a better way to do this
try {
@@ -56,6 +101,44 @@
}
}
+ public boolean isTextPresent(final String text) {
+ return webdriver.findElement(By.tagName("body")).getText().contains(text);
+ }
+
+ public Options manage() {
+ return webdriver.manage();
+ }
+
+ public void moveMouseTo(final WebElement element) {
+ final Actions actions = new Actions(webdriver);
+ actions.moveToElement(element);
+ }
+
+ public Navigation navigate() {
+ return webdriver.navigate();
+ }
+
+ public void quit() {
+ webdriver.quit();
+ }
+
+ public TargetLocator switchTo() {
+ return webdriver.switchTo();
+ }
+
+ public ExpectedCondition<WebElement> visibilityOfElementLocated(final By locator) {
+ return new ExpectedCondition<WebElement>() {
+ @Override
+ public WebElement apply(final WebDriver driver) {
+ final WebElement toReturn = driver.findElement(locator);
+ if (toReturn.isDisplayed()) {
+ return toReturn;
+ }
+ return null;
+ }
+ };
+ }
+
/**
* Thanks to:
* http://groups.google.com/group/webdriver/browse_frm/thread/6e705242
Copied: trunk/src/test/java/cc/kune/selenium/PageObjectModule.java (from rev 1528, trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObjectModule.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/PageObjectModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium;
+
+import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
+
+import com.google.inject.AbstractModule;
+
+public abstract class PageObjectModule extends AbstractModule {
+ protected <T> void registerPageObject(final Class<T> componentType, final T object,
+ final ElementLocatorFactory locator) {
+ bind(componentType).toInstance(object);
+ PageFactory.initElements(locator, object);
+
+ }
+}
Copied: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java (from rev 1528, trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,87 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium;
+
+import java.util.Arrays;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.firefox.FirefoxProfile;
+import org.openqa.selenium.firefox.internal.ProfilesIni;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.openqa.selenium.support.events.EventFiringWebDriver;
+import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
+import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
+
+import cc.kune.selenium.login.EntityHeaderPageObject;
+import cc.kune.selenium.login.LoginPageObject;
+import cc.kune.selenium.login.RegisterPageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+import com.google.inject.Singleton;
+
+public class SeleniumModule extends PageObjectModule {
+
+ public SeleniumModule() {
+ }
+
+ @Override
+ protected void configure() {
+
+ // final RemoteWebDriver driver = createChromeDriver();
+ final WebDriver driver = creatFirefoxDriver();
+ final EventFiringWebDriver wrap = new EventFiringWebDriver(driver);
+ wrap.register(new CustomWebDriverEventListener());
+
+ bind(WebDriver.class).toInstance(wrap);
+
+ bind(ElementLocatorFactory.class).toInstance(
+ new AjaxElementLocatorFactory(wrap, SeleniumConstants.TIMEOUT));
+
+ // Page Objects here!
+ bind(LoginPageObject.class).in(Singleton.class);
+ bind(RegisterPageObject.class).in(Singleton.class);
+ bind(EntityHeaderPageObject.class).in(Singleton.class);
+ }
+
+ @SuppressWarnings("unused")
+ private RemoteWebDriver createChromeDriver() {
+ // http://code.google.com/p/selenium/wiki/ChromeDriver
+ System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
+ final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
+ // http://peter.sh/experiments/chromium-command-line-switches/
+ capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"));
+ capabilities.setCapability("chrome.binary", "/usr/bin/chromium-browser");
+ final ChromeDriver driver = new ChromeDriver(capabilities);
+ return driver;
+ }
+
+ private FirefoxDriver creatFirefoxDriver() {
+ // http://code.google.com/p/selenium/wiki/FirefoxDriver
+ final ProfilesIni allProfiles = new ProfilesIni();
+ final FirefoxProfile profile = allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
+ // System.setProperty("webdriver.firefox.useExisting", "true");
+ // final FirefoxProfile profile = allProfiles.getProfile("76tp2vh0.ff5");
+ final FirefoxDriver driver = new FirefoxDriver(profile);
+ return driver;
+ }
+}
Added: trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,41 @@
+package cc.kune.selenium.login;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
+import cc.kune.core.client.sitebar.SitebarSignInLink;
+import cc.kune.core.client.sitebar.SitebarSignOutLink;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+public class AbstractLoginObject extends PageObject {
+ @FindBy(id = SeleniumConstants.GWTDEV + SitebarSignInLink.SITE_SIGN_IN)
+ protected WebElement signInLink;
+ @FindBy(id = SeleniumConstants.GWTDEV + SitebarSignOutLink.SITE_SIGN_OUT)
+ protected WebElement signOutLink;
+ @FindBy(id = SeleniumConstants.GWTDEV + SiteUserOptionsPresenter.LOGGED_USER_MENU_ID)
+ protected WebElement userMenu;
+
+ public void assertIsConnectedAs(final String user) {
+ waitFor(userMenu, user);
+ }
+
+ public void assertIsDisconnected() {
+ try {
+ signOutLink.click();
+ } catch (final Exception e) {
+ }
+ waitFor(signInLink);
+ }
+
+ public void logout() {
+ signOutLink.click();
+ assertIsDisconnected();
+ }
+
+ public void signOut() {
+ logout();
+ }
+
+}
Added: trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.login;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.ws.entheader.EntityTextLogo;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+public class EntityHeaderPageObject extends PageObject {
+
+ @FindBy(id = SeleniumConstants.GWTDEV + EntityTextLogo.LOGO_IMAGE)
+ protected WebElement logoImage;
+ @FindBy(id = SeleniumConstants.GWTDEV + EntityTextLogo.LOGO_NAME)
+ protected WebElement logoName;
+
+ public EntityHeaderPageObject() {
+ }
+
+ public void waitForEntityTitle(final String text) {
+ waitFor(logoName, text);
+ }
+}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -25,53 +25,27 @@
import cc.kune.core.client.auth.SignInForm;
import cc.kune.core.client.auth.SignInPanel;
-import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
-import cc.kune.core.client.sitebar.SitebarSignInLink;
-import cc.kune.core.client.sitebar.SitebarSignOutLink;
-import cc.kune.selenium.PageObject;
-import cc.kune.selenium.tools.I18nHelper;
import cc.kune.selenium.tools.SeleniumConstants;
-import com.calclab.hablar.login.client.LoginMessages;
+public class LoginPageObject extends AbstractLoginObject {
-public class LoginPageObject extends PageObject {
-
- private final I18nHelper i18n;
- @FindBy(id = SignInForm.PASSWORD_FIELD_ID + "-input")
+ @FindBy(id = SeleniumConstants.GWTDEV + SignInPanel.CREATE_ONE)
+ protected WebElement createOneLink;
+ @FindBy(id = SignInForm.PASSWORD_FIELD_ID + SeleniumConstants.INPUT)
private WebElement passwd;
- @FindBy(id = GWTDEV + SignInPanel.SIGN_IN_BUTTON_ID)
+ @FindBy(id = SeleniumConstants.GWTDEV + SignInPanel.SIGN_IN_BUTTON_ID)
private WebElement signInButton;
- @FindBy(id = GWTDEV + SitebarSignInLink.SITE_SIGN_IN)
- private WebElement signInLink;
- @FindBy(id = GWTDEV + SitebarSignOutLink.SITE_SIGN_OUT)
- private WebElement signOutLink;
- @FindBy(id = SignInForm.USER_FIELD_ID + "-input")
+ @FindBy(id = SignInForm.USER_FIELD_ID + SeleniumConstants.INPUT)
private WebElement user;
- @FindBy(id = GWTDEV + SiteUserOptionsPresenter.LOGGED_USER_MENU_ID)
- private WebElement userMenu;
public LoginPageObject() {
- i18n = new I18nHelper(LoginMessages.class);
+ // i18n = new I18nHelper(LoginMessages.class);
}
- public void assertIsConnectedAs(final String user) {
- waitFor(userMenu, user);
- }
-
- public void assertIsDisconnected() {
- try {
- signOutLink.click();
- } catch (final Exception e) {
- }
- waitFor(signInLink);
- }
-
public void fillSigInInForm(final String username, final String password, final boolean withReturn) {
- user.clear();
- passwd.clear();
- user.clear();
- passwd.clear();
+ clearField(user);
user.sendKeys(username);
+ clearField(passwd);
passwd.sendKeys(password);
if (withReturn) {
passwd.sendKeys(Keys.RETURN);
@@ -88,27 +62,19 @@
return getHeader();
}
- public void logout() {
- signOutLink.click();
- assertIsDisconnected();
- }
-
public void signIn(final String username, final String password) {
signIn(username, password, true);
}
public void signIn(final String username, final String password, final boolean withReturn) {
assertIsDisconnected();
+ moveMouseTo(signInLink);
signInLink.click();
fillSigInInForm(username, password, withReturn);
}
public void signInDefUser() {
- signIn(SeleniumConstants.USERNAME, SeleniumConstants.PASSWD, false);
+ signIn(SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_PASSWD, false);
}
- public void signOut() {
- logout();
- }
-
}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -59,7 +59,7 @@
@Test(dataProvider = "correctlogin")
public void signInWithToken(final String user, final String passwd) {
login.assertIsDisconnected();
- webdriver.gotoToken(SiteTokens.SIGNIN);
+ gotoToken(SiteTokens.SIGNIN);
login.fillSigInInForm(user, passwd, true);
login.assertIsConnectedAs(user);
login.logout();
Added: trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,64 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.login;
+
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.auth.RegisterForm;
+import cc.kune.core.client.auth.RegisterPanel;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+public class RegisterPageObject extends AbstractLoginObject {
+
+ @FindBy(id = RegisterForm.EMAIL_FIELD + SeleniumConstants.INPUT)
+ private WebElement email;
+ @FindBy(id = RegisterForm.LONGNAME_FIELD + SeleniumConstants.INPUT)
+ private WebElement longName;
+ @FindBy(id = RegisterForm.PASSWORD_FIELD + SeleniumConstants.INPUT)
+ private WebElement passwd;
+ @FindBy(id = SeleniumConstants.GWTDEV + RegisterPanel.REGISTER_BUTTON_ID)
+ private WebElement registerButton;
+ @FindBy(id = RegisterForm.NICK_FIELD + SeleniumConstants.INPUT)
+ private WebElement shortName;
+
+ public RegisterPageObject() {
+ // i18n = new I18nHelper(LoginMessages.class);
+ }
+
+ public void fillRegisterForm(final String nick, final String name, final String pass, final String em,
+ final boolean withReturn) {
+ clearField(shortName);
+ shortName.sendKeys(nick);
+ clearField(longName);
+ longName.sendKeys(name);
+ clearField(passwd);
+ passwd.sendKeys(pass);
+ clearField(email);
+ email.sendKeys(em);
+ if (withReturn) {
+ email.sendKeys(Keys.RETURN);
+ } else {
+ registerButton.click();
+ }
+ }
+
+}
Added: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.login;
+
+import org.testng.annotations.Test;
+
+import cc.kune.selenium.KuneSeleniumTest;
+
+public class RegisterSeleniumTests extends KuneSeleniumTest {
+
+ @Test(dataProvider = "correctregister")
+ public void severalsSignInSingOut(final String shortName, final String longName, final String passwd,
+ final String email) {
+ // 15 chars, the limit, so we don't use shortName
+ final String prefix = getTempString();
+ login.assertIsDisconnected();
+ login.signInLink.click();
+ login.createOneLink.click();
+ register.fillRegisterForm(prefix, prefix + longName, passwd, prefix + email, false);
+ login.assertIsConnectedAs(prefix);
+ sleep(1000);
+ entityHeader.waitForEntityTitle(prefix + longName);
+ login.logout();
+ }
+
+ // @Test(dataProvider = "correctlogin")
+ // public void signIn(final String user, final String passwd) {
+ // login.assertIsDisconnected();
+ // login.signIn(user, passwd);
+ // login.assertIsConnectedAs(user);
+ // login.logout();
+ // login.assertIsDisconnected();
+ // }
+ //
+ // @Test
+ // public void signInIncorrectPasswd() {
+ // login.assertIsDisconnected();
+ // login.signIn("nouser", "nopassword");
+ // login.assertIsDisconnected();
+ // }
+ //
+ // @Test(dataProvider = "correctlogin")
+ // public void signInWithToken(final String user, final String passwd) {
+ // login.assertIsDisconnected();
+ // webdriver.gotoToken(SiteTokens.SIGNIN);
+ // login.fillSigInInForm(user, passwd, true);
+ // login.assertIsConnectedAs(user);
+ // login.logout();
+ // login.assertIsDisconnected();
+ // }
+}
Deleted: trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,150 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.selenium.tools;
-
-import java.util.List;
-import java.util.Set;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Point;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebDriverBackedSelenium;
-import org.openqa.selenium.WebElement;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-
-import com.google.gwt.user.client.ui.UIObject;
-import com.thoughtworks.selenium.Selenium;
-
-public abstract class AbstractWebDriver implements WebDriver {
- private final String baseUrl;
- private final WebDriver driver;
- private final Selenium selenium;
-
- public AbstractWebDriver(final WebDriver driver, final String baseUrl) {
- this.driver = driver;
- this.baseUrl = baseUrl;
- selenium = new WebDriverBackedSelenium(driver, baseUrl);
- selenium.setSpeed("500");
- // driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
-
- // selenium.setTimeout("5000");
- }
-
- @Override
- public void close() {
- driver.close();
- }
-
- @Override
- public WebElement findElement(final By by) {
- return driver.findElement(by);
- }
-
- @Override
- public List<WebElement> findElements(final By by) {
- return driver.findElements(by);
- }
-
- @Override
- public void get(final String url) {
- driver.get(url);
- }
-
- public WebElement getById(final String id) {
- return driver.findElement(By.id(UIObject.DEBUG_ID_PREFIX + id));
- }
-
- @Override
- public String getCurrentUrl() {
- return driver.getCurrentUrl();
- }
-
- @Override
- public String getPageSource() {
- return driver.getPageSource();
- }
-
- @Override
- public String getTitle() {
- return driver.getTitle();
- }
-
- @Override
- public String getWindowHandle() {
- return driver.getWindowHandle();
- }
-
- @Override
- public Set<String> getWindowHandles() {
- return driver.getWindowHandles();
- }
-
- public void gotoToken(final StateToken token) {
- get(baseUrl + token);
- }
-
- public void gotoToken(final String token) {
- get(baseUrl + token);
- }
-
- public void home() {
- assert baseUrl != null;
- driver.get(baseUrl);
- }
-
- public boolean isElementPresent(final String id) {
- // http://stackoverflow.com/questions/5922930/iselementpresent-in-selenium-2-0
- return selenium.isElementPresent(id);
- }
-
- public boolean isTextPresent(final String text) {
- return selenium.isTextPresent(text);
- }
-
- @Override
- public Options manage() {
- return driver.manage();
- }
-
- public void moveMouseAt(final Point point) {
- selenium.mouseMoveAt(String.valueOf(point.getX()), String.valueOf(point.getY()));
- }
-
- @Override
- public Navigation navigate() {
- return driver.navigate();
- }
-
- public void open(final String url) {
- get(url);
- }
-
- @Override
- public void quit() {
- driver.quit();
- }
-
- @Override
- public TargetLocator switchTo() {
- return driver.switchTo();
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.selenium.tools;
-
-import org.openqa.selenium.WebDriver;
-
-import com.google.inject.Inject;
-
-public class GenericWebDriver extends AbstractWebDriver {
-
- @Inject
- public GenericWebDriver(final WebDriver driver) {
- super(driver, "http://kune.beta.iepala.es/ws/?locale=en#");
- }
-
-}
Deleted: trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.selenium.tools;
-
-import org.openqa.selenium.support.PageFactory;
-import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
-
-import com.google.inject.AbstractModule;
-
-public abstract class PageObjectModule extends AbstractModule {
- protected <T> void registerPageObject(final Class<T> componentType, final T object,
- final ElementLocatorFactory locator) {
- bind(componentType).toInstance(object);
- PageFactory.initElements(locator, object);
-
- }
-}
Modified: trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -21,9 +21,13 @@
public final class SeleniumConstants {
public static final String FIREFOX_PROFILE_NAME = "selenium";
- public static final String PASSWD = "easyeasy";
+ public static final String GWTDEV = "gwt-debug-";
+ public static final String INPUT = "-input";
public static final int TIMEOUT = 15;
- public static final String USERNAME = "admin";
+ public static final String USER_EMAIL = "admin(a)example.org";
+ public static final String USER_LONGNAME = "Administrator";
+ public static final String USER_PASSWD = "easyeasy";
+ public static final String USER_SHORNAME = "admin";
SeleniumConstants() {
// Final class
Deleted: trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,87 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.selenium.tools;
-
-import java.util.Arrays;
-
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.firefox.FirefoxProfile;
-import org.openqa.selenium.firefox.internal.ProfilesIni;
-import org.openqa.selenium.remote.DesiredCapabilities;
-import org.openqa.selenium.support.events.EventFiringWebDriver;
-import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
-import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
-
-import cc.kune.selenium.login.LoginPageObject;
-
-import com.google.inject.Singleton;
-
-public class SeleniumModule extends PageObjectModule {
-
- public SeleniumModule() {
- }
-
- @Override
- protected void configure() {
-
- // bind(WebDriver.class).toInstance(creatFirefoxDriver());
- final WebDriver driver = createChromeDriver();
- bind(WebDriver.class).toInstance(driver);
- bind(GenericWebDriver.class).in(Singleton.class);
-
- // "http://127.0.0.1:8888/ws/?locale=en&log_level=INFO&gwt.codesvr=127.0.0.1:99…");
-
- bind(ElementLocatorFactory.class).toInstance(
- new AjaxElementLocatorFactory(driver, SeleniumConstants.TIMEOUT));
-
- final EventFiringWebDriver eventFiring = new EventFiringWebDriver(driver);
- bind(EventFiringWebDriver.class).toInstance(eventFiring);
-
- // Page Objects here!
- bind(LoginPageObject.class).in(Singleton.class);
- }
-
- private WebDriver createChromeDriver() {
- // http://code.google.com/p/selenium/wiki/ChromeDriver
- System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
- final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
- // http://peter.sh/experiments/chromium-command-line-switches/
- capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"));
- capabilities.setCapability("chrome.binary", "/usr/bin/chromium-browser");
- final WebDriver driver = new ChromeDriver(capabilities);
- return driver;
- }
-
- @SuppressWarnings("unused")
- private FirefoxDriver creatFirefoxDriver() {
- // final FirefoxProfile profile = new FirefoxProfile();
- // profile.setPreference("webdriver.firefox.profile",
- // SeleniumConstants.FIREFOX_PROFILE_NAME);
- // profile.setPreference("webdriver.firefox.useExisting",true);
-
- final ProfilesIni allProfiles = new ProfilesIni();
- final FirefoxProfile profile = allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
- // profile.setPreferences("foo.bar", 23);
- final FirefoxDriver driver = new FirefoxDriver(profile);
- return driver;
- }
-}
Deleted: trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,79 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-
-import org.junit.Test;
-
-import cc.kune.common.client.utils.TextUtils;
-
-public class KuneStringUtilsTest {
-
- @Test
- public void testTagNull() {
- final String tagsString = null;
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals(0, tags.size());
- }
-
- @Test
- public void testTagStripsSimple() {
- final String tagsString = "ab cd";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithCommas() {
- final String tagsString = "ab,cd";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithCommasAndSpaces() {
- final String tagsString = "ab, cd";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithQuotes() {
- final String tagsString = "ab \"cd\"";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithSpaces() {
- final String tagsString = " ab cd ";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
-}
Deleted: trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,89 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import cc.kune.common.client.utils.TextUtils;
-
-public class TextUtilsTest {
- @Test
- public void dontRemoveLastSlashIfNoExists() {
- final String text = "ab";
- assertEquals("ab", TextUtils.removeLastSlash(text));
- }
-
- @Test
- public void dontRemoveOtherSlashIfExists() {
- final String text = "/ab";
- assertEquals("/ab", TextUtils.removeLastSlash(text));
- }
-
- @Test
- public void matchDemoEmail() {
- final String email = "test100(a)emitedemo.ourproject.org";
- assertTrue(email.matches(TextUtils.EMAIL_REGEXP));
- }
-
- @Test
- public void matchLocalhostEmail() {
- final String email = "me@localhost";
- assertTrue(email.matches(TextUtils.EMAIL_REGEXP));
- }
-
- @Test
- public void matchSimpleEmail() {
- final String email = "me(a)example.com";
- assertTrue(email.matches(TextUtils.EMAIL_REGEXP));
- }
-
- @Test
- public void matchUrlWithHttp() {
- final String gnuUrl = "http://gnu.org";
- assertTrue(gnuUrl.matches(TextUtils.URL_REGEXP));
- }
-
- @Test
- public void matchUrlWithoutHttp() {
- final String gnuUrl = "gnu.org";
- assertTrue(!gnuUrl.matches(TextUtils.URL_REGEXP));
- }
-
- @Test
- public void notMatchWrongUrl() {
- final String someWrong = "some(a)email.com";
- assertTrue(!someWrong.matches(TextUtils.URL_REGEXP));
- }
-
- @Test
- public void removeLastSlashIfExists() {
- final String text = "/";
- assertEquals("", TextUtils.removeLastSlash(text));
- }
-
- @Test
- public void removeOnlytLastSlashIfExists() {
- final String text = "/ab/cd/";
- assertEquals("/ab/cd", TextUtils.removeLastSlash(text));
- }
-}
1
0
r1530 - in trunk/src/main/java/cc/kune: core/server core/server/auth wave/client
by Vicente J. Ruiz Jurado 23 Sep '11
by Vicente J. Ruiz Jurado 23 Sep '11
23 Sep '11
Author: vjrj_
Date: 2011-09-23 23:10:32 +0200 (Fri, 23 Sep 2011)
New Revision: 1530
Removed:
trunk/src/main/java/cc/kune/core/server/auth/SessionService.java
trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java
Modified:
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java
trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
Log:
CLOSED - # 105: Persist user sessions between restarts
http://kune.ourproject.org/issues/ticket/105
Wave code updated
Some other fixes / improvements
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -39,8 +39,6 @@
import cc.kune.core.server.auth.AuthenticatedMethodInterceptor;
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.auth.AuthorizatedMethodInterceptor;
-import cc.kune.core.server.auth.SessionService;
-import cc.kune.core.server.auth.SessionServiceDefault;
import cc.kune.core.server.auth.SuperAdmin;
import cc.kune.core.server.auth.SuperAdminMethodInterceptor;
import cc.kune.core.server.content.ContainerManager;
@@ -159,7 +157,6 @@
bind(FinderService.class).to(FinderServiceDefault.class);
bind(StateService.class).to(StateServiceDefault.class);
bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
- bind(SessionService.class).to(SessionServiceDefault.class);
bind(KuneWaveService.class).to(KuneWaveServiceDefault.class);
bind(XMLActionReader.class);
}
Modified: trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -41,19 +41,10 @@
Provider<HttpServletRequest> requestProvider;
@Inject
- Provider<SessionService> sessionServiceProvider;
-
- // https://code.google.com/p/google-guice/wiki/Transactions
- // @Inject
- // private UnitOfWork unitOfWork;
- @Inject
UserSessionManager userSessionManager;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
- // https://code.google.com/p/google-guice/wiki/Transactions
- // unitOfWork.end();
- // unitOfWork.begin();
try {
final Object[] arguments = invocation.getArguments();
// Some browsers getCookie returns "null" as String instead of null
@@ -68,22 +59,18 @@
final boolean mandatory = authAnnotation.mandatory();
if (userHash == null && mandatory) {
- // sessionService.getNewSession();
throw new UserMustBeLoggedException();
} else if (userSessionManager.isUserNotLoggedIn() && mandatory) {
- // sessionService.getNewSession();
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
} else if (userSessionManager.isUserNotLoggedIn() && userHash == null) {
// Ok, do nothing
} else if (userSessionManager.isUserNotLoggedIn() && userHash != null) {
- // sessionService.getNewSession();
LOG.info("Session expired (not logged in server)");
throw new SessionExpiredException();
} else if (!userSessionManager.getHash().equals(userHash)) {
final String serverHash = userSessionManager.getHash();
userSessionManager.logout();
- // sessionService.getNewSession();
LOG.info("Session expired (userHash: " + userHash + " different from server hash: " + serverHash
+ ")");
throw new SessionExpiredException();
@@ -91,7 +78,6 @@
final Object result = invocation.proceed();
return result;
} finally {
- // unitOfWork.end();
}
}
Deleted: trunk/src/main/java/cc/kune/core/server/auth/SessionService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SessionService.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/SessionService.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.server.auth;
-
-public interface SessionService {
-
- void setSessionExpiration();
-
- void getNewSession();
-
-}
Deleted: trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -1,69 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.server.auth;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
-@Singleton
-@Deprecated
-public class SessionServiceDefault implements SessionService {
-
- private final Provider<HttpServletRequest> requestProvider;
-
- @Inject
- public SessionServiceDefault(final Provider<HttpServletRequest> requestProvider) {
- this.requestProvider = requestProvider;
- }
-
- @Override
- @Deprecated
- public void getNewSession() {
- // HttpSession session = getSession();
- // if (session != null) {
- // // During tests session == null
- // session.invalidate();
- // }
- // getSession(true);
- setSessionExpiration();
- }
-
- private HttpSession getSession() {
- return requestProvider.get().getSession();
- }
-
- private HttpSession getSession(final boolean create) {
- return requestProvider.get().getSession(create);
- }
-
- @Override
- @Deprecated
- public void setSessionExpiration() {
- // HttpSession session = getSession();
- // if (session != null) {
- // session.setMaxInactiveInterval(Session.SESSION_DURATION / 1000);
- // }
- }
-
-}
Modified: trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -50,8 +50,6 @@
Provider<KuneProperties> kuneProperties;
@Inject
Provider<HttpServletRequest> requestProvider;
- @Inject
- Provider<SessionService> sessionServiceProvider;
private Group siteGroup;
@Inject
UserSessionManager userSessionManager;
Modified: trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneConversation.css 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneConversation.css 2011-09-23 21:10:32 UTC (rev 1530)
@@ -12,11 +12,8 @@
z-index: 0;
}
-@sprite .toolbar {
- gwt-image: 'emptyToolbar';
-}
-
-.fixedThread { /*
+.fixedThread {
+ /*
* Allow scrolling. Also, keep the scrollbar there permanently, so that content does not get
* horizontally resized by the addition and removal of a scrollbar.
*/
@@ -27,4 +24,8 @@
/* left: 0; */ /* right: 0; */ /* bottom: 0; */
/* Layout under siblings (participant panel etc). */
z-index: -1;
-}
\ No newline at end of file
+}
+
+@sprite .toolbar {
+ gwt-image: 'emptyToolbar';
+}
Modified: trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -1,4 +1,5 @@
// @formatter:off
+// @formatter:off
/**
* Copyright 2010 Google Inc.
*
@@ -60,40 +61,40 @@
public final class KuneFullDomRenderer implements RenderingRules<UiBuilder> {
public interface DocRefRenderer {
+ UiBuilder render(ConversationBlip blip,
+ IdentityMap<ConversationThread, UiBuilder> replies);
+
DocRefRenderer EMPTY = new DocRefRenderer() {
@Override
- public UiBuilder render(final ConversationBlip blip,
- final IdentityMap<ConversationThread, UiBuilder> replies) {
+ public UiBuilder render(ConversationBlip blip,
+ IdentityMap<ConversationThread, UiBuilder> replies) {
return UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<div></div>"));
}
};
-
- UiBuilder render(ConversationBlip blip,
- IdentityMap<ConversationThread, UiBuilder> replies);
}
public interface ParticipantsRenderer {
+ UiBuilder render(Conversation c);
+
ParticipantsRenderer EMPTY = new ParticipantsRenderer() {
@Override
- public UiBuilder render(final Conversation c) {
+ public UiBuilder render(Conversation c) {
return UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<div></div>"));
}
};
-
- UiBuilder render(Conversation c);
}
private final ShallowBlipRenderer blipPopulator;
private final DocRefRenderer docRenderer;
+ private final ViewIdMapper viewIdMapper;
+ private final ViewFactory viewFactory;
private final ProfileManager profileManager;
private final ThreadReadStateMonitor readMonitor;
- private final ViewFactory viewFactory;
- private final ViewIdMapper viewIdMapper;
private final boolean showParticipantsPanel;
- public KuneFullDomRenderer(final ShallowBlipRenderer blipPopulator, final DocRefRenderer docRenderer,
- final ProfileManager profileManager, final ViewIdMapper viewIdMapper, final ViewFactory viewFactory,
- final ThreadReadStateMonitor readMonitor, boolean showParticipantsPanel) {
+ public KuneFullDomRenderer(ShallowBlipRenderer blipPopulator, DocRefRenderer docRenderer,
+ ProfileManager profileManager, ViewIdMapper viewIdMapper, ViewFactory viewFactory,
+ ThreadReadStateMonitor readMonitor, boolean showParticipantsPanel) {
this.blipPopulator = blipPopulator;
this.docRenderer = docRenderer;
this.profileManager = profileManager;
@@ -103,10 +104,18 @@
this.showParticipantsPanel = showParticipantsPanel;
}
- public UiBuilder getFirstConversation(final IdentityMap<Conversation, UiBuilder> conversations) {
+ @Override
+ public UiBuilder render(ConversationView wave,
+ IdentityMap<Conversation, UiBuilder> conversations) {
+ // return the first conversation in the view.
+ // TODO(hearnden): select the 'best' conversation.
+ return conversations.isEmpty() ? null : getFirstConversation(conversations);
+ }
+
+ public UiBuilder getFirstConversation(IdentityMap<Conversation, UiBuilder> conversations) {
return conversations.reduce(null, new Reduce<Conversation, UiBuilder, UiBuilder>() {
@Override
- public UiBuilder apply(final UiBuilder soFar, final Conversation key, final UiBuilder item) {
+ public UiBuilder apply(UiBuilder soFar, Conversation key, UiBuilder item) {
// Pick the first rendering (any will do).
return soFar == null ? item : soFar;
}
@@ -114,25 +123,20 @@
}
@Override
- public UiBuilder render(final Conversation conversation, final ParticipantId participant) {
- final Profile profile = profileManager.getProfile(participant);
- final String id = viewIdMapper.participantOf(conversation, participant);
- // Use ParticipantAvatarViewBuilder for avatars.
- // Kune patch
- // final ParticipantNameViewBuilder participantUi = ParticipantNameViewBuilder.create(id);
- final ParticipantAvatarViewBuilder participantUi = ParticipantAvatarViewBuilder.create(id);
- participantUi.setAvatar(profile.getImageUrl());
- participantUi.setName(profile.getFullName());
- return participantUi;
+ public UiBuilder render(Conversation conversation, UiBuilder participantsUi, UiBuilder threadUi) {
+ String id = viewIdMapper.conversationOf(conversation);
+ boolean isTop = !conversation.hasAnchor();
+ return isTop ? viewFactory.createTopConversationView(id, threadUi, participantsUi)
+ : viewFactory.createInlineConversationView(id, threadUi, participantsUi);
}
@Override
- public UiBuilder render(final Conversation conversation, final StringMap<UiBuilder> participantUis) {
- final HtmlClosureCollection participantsUi = new HtmlClosureCollection();
- for (final ParticipantId participant : conversation.getParticipantIds()) {
+ public UiBuilder render(Conversation conversation, StringMap<UiBuilder> participantUis) {
+ HtmlClosureCollection participantsUi = new HtmlClosureCollection();
+ for (ParticipantId participant : conversation.getParticipantIds()) {
participantsUi.add(participantUis.get(participant.getAddress()));
}
- final String id = viewIdMapper.participantsOf(conversation);
+ String id = viewIdMapper.participantsOf(conversation);
// Kune patch (but not used)
return showParticipantsPanel? ParticipantsViewBuilder.create(id, participantsUi): new UiBuilder() {
@Override
@@ -142,112 +146,109 @@
}
@Override
- public UiBuilder render(final Conversation conversation, final UiBuilder participantsUi, final UiBuilder threadUi) {
- final String id = viewIdMapper.conversationOf(conversation);
- final boolean isTop = !conversation.hasAnchor();
- return isTop ? viewFactory.createTopConversationView(id, threadUi, participantsUi)
- : viewFactory.createInlineConversationView(id, threadUi, participantsUi);
+ public UiBuilder render(Conversation conversation, ParticipantId participant) {
+ Profile profile = profileManager.getProfile(participant);
+ String id = viewIdMapper.participantOf(conversation, participant);
+ // Use ParticipantAvatarViewBuilder for avatars.
+ // Kune patch
+ // final ParticipantNameViewBuilder participantUi = ParticipantNameViewBuilder.create(id);
+ ParticipantAvatarViewBuilder participantUi = ParticipantAvatarViewBuilder.create(id);
+ participantUi.setAvatar(profile.getImageUrl());
+ participantUi.setName(profile.getFullName());
+ return participantUi;
}
- /**
- */
@Override
- public UiBuilder render(
- final ConversationBlip blip, final IdentityMap<ConversationThread, UiBuilder> replies) {
- return docRenderer.render(blip, replies);
+ public UiBuilder render(final ConversationThread thread,
+ final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
+ HtmlClosure blipsUi = new HtmlClosure() {
+ @Override
+ public void outputHtml(SafeHtmlBuilder out) {
+ for (ConversationBlip blip : thread.getBlips()) {
+ UiBuilder blipUi = blipUis.get(blip);
+ // Not all blips are rendered.
+ if (blipUi != null) {
+ blipUi.outputHtml(out);
+ }
+ }
+ }
+ };
+ String threadId = viewIdMapper.threadOf(thread);
+ String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
+ UiBuilder builder = null;
+ if (thread.getConversation().getRootThread() == thread) {
+ ReplyBoxViewBuilder replyBoxBuilder =
+ ReplyBoxViewBuilder.create(replyIndicatorId);
+ builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
+ } else {
+ ContinuationIndicatorViewBuilder indicatorBuilder = ContinuationIndicatorViewBuilder.create(
+ replyIndicatorId);
+ InlineThreadViewBuilder inlineBuilder =
+ InlineThreadViewBuilder.create(threadId, blipsUi, indicatorBuilder);
+ int read = readMonitor.getReadCount(thread);
+ int unread = readMonitor.getUnreadCount(thread);
+ inlineBuilder.setTotalBlipCount(read + unread);
+ inlineBuilder.setUnreadBlipCount(unread);
+ builder = inlineBuilder;
+ }
+ return builder;
}
@Override
- public UiBuilder render(final ConversationBlip blip, final UiBuilder document,
+ public UiBuilder render(final ConversationBlip blip, UiBuilder document,
final IdentityMap<ConversationThread, UiBuilder> anchorUis,
final IdentityMap<Conversation, UiBuilder> nestedConversations) {
- final UiBuilder threadsUi = new UiBuilder() {
+ UiBuilder threadsUi = new UiBuilder() {
@Override
- public void outputHtml(final SafeHtmlBuilder out) {
- for (final ConversationThread thread : blip.getReplyThreads()) {
+ public void outputHtml(SafeHtmlBuilder out) {
+ for (ConversationThread thread : blip.getReplyThreads()) {
anchorUis.get(thread).outputHtml(out);
}
}
};
- final UiBuilder convsUi = new UiBuilder() {
+ UiBuilder convsUi = new UiBuilder() {
@Override
- public void outputHtml(final SafeHtmlBuilder out) {
+ public void outputHtml(SafeHtmlBuilder out) {
// Order by conversation id. Ideally, the sort key would be creation
// time, but that is not exposed in the conversation API.
final List<Conversation> ordered = CollectionUtils.newArrayList();
nestedConversations.each(new ProcV<Conversation, UiBuilder>() {
@Override
- public void apply(final Conversation conv, final UiBuilder ui) {
+ public void apply(Conversation conv, UiBuilder ui) {
ordered.add(conv);
}
});
Collections.sort(ordered, new Comparator<Conversation>() {
@Override
- public int compare(final Conversation o1, final Conversation o2) {
+ public int compare(Conversation o1, Conversation o2) {
return o1.getId().compareTo(o2.getId());
}
});
- final List<UiBuilder> orderedUis = CollectionUtils.newArrayList();
- for (final Conversation conv : ordered) {
+ List<UiBuilder> orderedUis = CollectionUtils.newArrayList();
+ for (Conversation conv : ordered) {
nestedConversations.get(conv).outputHtml(out);
}
}
};
- final BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
+ BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
blipPopulator.render(blip, metaUi);
return BlipViewBuilder.create(viewIdMapper.blipOf(blip), metaUi, threadsUi, convsUi);
}
+ /**
+ */
@Override
- public UiBuilder render(final ConversationThread thread,
- final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
- final HtmlClosure blipsUi = new HtmlClosure() {
- @Override
- public void outputHtml(final SafeHtmlBuilder out) {
- for (final ConversationBlip blip : thread.getBlips()) {
- final UiBuilder blipUi = blipUis.get(blip);
- // Not all blips are rendered.
- if (blipUi != null) {
- blipUi.outputHtml(out);
- }
- }
- }
- };
- final String threadId = viewIdMapper.threadOf(thread);
- final String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
- UiBuilder builder = null;
- if (thread.getConversation().getRootThread() == thread) {
- final ReplyBoxViewBuilder replyBoxBuilder =
- ReplyBoxViewBuilder.create(replyIndicatorId);
- builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
- } else {
- final ContinuationIndicatorViewBuilder indicatorBuilder = ContinuationIndicatorViewBuilder.create(
- replyIndicatorId);
- final InlineThreadViewBuilder inlineBuilder =
- InlineThreadViewBuilder.create(threadId, blipsUi, indicatorBuilder);
- final int read = readMonitor.getReadCount(thread);
- final int unread = readMonitor.getUnreadCount(thread);
- inlineBuilder.setTotalBlipCount(read + unread);
- inlineBuilder.setUnreadBlipCount(unread);
- builder = inlineBuilder;
- }
- return builder;
+ public UiBuilder render(
+ ConversationBlip blip, IdentityMap<ConversationThread, UiBuilder> replies) {
+ return docRenderer.render(blip, replies);
}
@Override
- public UiBuilder render(final ConversationThread thread, final UiBuilder threadR) {
- final String id = EscapeUtils.htmlEscape(viewIdMapper.defaultAnchorOf(thread));
+ public UiBuilder render(ConversationThread thread, UiBuilder threadR) {
+ String id = EscapeUtils.htmlEscape(viewIdMapper.defaultAnchorOf(thread));
return AnchorViewBuilder.create(id, threadR);
}
-
- @Override
- public UiBuilder render(final ConversationView wave,
- final IdentityMap<Conversation, UiBuilder> conversations) {
- // return the first conversation in the view.
- // TODO(hearnden): select the 'best' conversation.
- return conversations.isEmpty() ? null : getFirstConversation(conversations);
- }
}
Modified: trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -39,7 +39,7 @@
/**
* Renders waves into HTML DOM, given a renderer that renders waves as HTML
- * closures.
+ * closures. (this is in StatesTwo.java)
*
*/
public final class KuneFullDomWaveRendererImpl implements DomRenderer {
Modified: trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -54,27 +54,27 @@
private final static AsyncHolder<Object> HALT = new AsyncHolder<Object>() {
@Override
- public void call(final Accessor<Object> accessor) {
+ public void call(Accessor<Object> accessor) {
// Never ready, so never notify the accessor.
}
};
+ private final Element wavePanelElement;
+ private final LogicalPanel rootPanel;
+ private final WaveRef waveRef;
private final RemoteViewServiceMultiplexer channel;
- private boolean closed;
private final IdGenerator idGenerator;
+ private final ProfileManager profiles;
+ private final WaveStore waveStore;
private final boolean isNewWave;
private final String localDomain;
- private StageOne one;
- private final ProfileManager profiles;
- private final LogicalPanel rootPanel;
- private final boolean showParticipantsPanel;
- private StageThree three;
+ private boolean closed;
+ private StageOne one;
private StageTwo two;
+ private StageThree three;
private WaveContext wave;
- private final Element wavePanelElement;
- private final WaveRef waveRef;
- private final WaveStore waveStore;
+ private boolean showParticipantsPanel;
/**
* @param wavePanelElement The dom element to become the wave panel
@@ -86,9 +86,9 @@
* @param isNewWave true if the wave is a new client-created wave
* @param idGenerator
*/
- public KuneStagesProvider(final Element wavePanelElement, final LogicalPanel rootPanel, final WaveRef waveRef,
- final RemoteViewServiceMultiplexer channel, final IdGenerator idGenerator, final ProfileManager profiles,
- final WaveStore store, final boolean isNewWave, final String localDomain, final boolean showParticipantsPanel) {
+ public KuneStagesProvider(Element wavePanelElement, LogicalPanel rootPanel, WaveRef waveRef,
+ RemoteViewServiceMultiplexer channel, IdGenerator idGenerator, ProfileManager profiles,
+ WaveStore store, boolean isNewWave, String localDomain, boolean showParticipantsPanel) {
this.wavePanelElement = wavePanelElement;
this.rootPanel = rootPanel;
this.waveRef = waveRef;
@@ -102,46 +102,29 @@
}
@Override
- protected AsyncHolder<StageOne> createStageOneLoader(final StageZero zero) {
+ protected AsyncHolder<StageZero> createStageZeroLoader() {
+ return haltIfClosed(super.createStageZeroLoader());
+ }
+
+ @Override
+ protected AsyncHolder<StageOne> createStageOneLoader(StageZero zero) {
return haltIfClosed(new StageOne.DefaultProvider(zero) {
@Override
- protected LogicalPanel createWaveContainer() {
- return rootPanel;
- }
-
- @Override
protected Element createWaveHolder() {
return wavePanelElement;
}
- });
- }
-
- @Override
- protected AsyncHolder<StageThree> createStageThreeLoader(final StageTwo two) {
- return haltIfClosed(new StageThree.DefaultProvider(this.two = two) {
@Override
- protected void create(final Accessor<StageThree> whenReady) {
- // Prepend an init wave flow onto the stage continuation.
- super.create(new Accessor<StageThree>() {
- @Override
- public void use(final StageThree x) {
- onStageThreeLoaded(x, whenReady);
- }
- });
+ protected LogicalPanel createWaveContainer() {
+ return rootPanel;
}
-
- @Override
- protected String getLocalDomain() {
- return localDomain;
- }
});
}
@Override
- // Kune patch
- protected AsyncHolder<StageTwo> createStageTwoLoader(final StageOne one) {
+ protected AsyncHolder<StageTwo> createStageTwoLoader(StageOne one) {
return haltIfClosed(new StageTwoProvider(
this.one = one, waveRef.getWaveId(), channel, isNewWave, idGenerator, profiles) {
+ // Kune patch
@Override
protected DomRenderer createRenderer() {
return KuneFullDomWaveRendererImpl.create(getConversations(), getProfileManager(),
@@ -159,51 +142,67 @@
}
@Override
- protected AsyncHolder<StageZero> createStageZeroLoader() {
- return haltIfClosed(super.createStageZeroLoader());
+ protected AsyncHolder<StageThree> createStageThreeLoader(final StageTwo two) {
+ return haltIfClosed(new StageThree.DefaultProvider(this.two = two) {
+ @Override
+ protected void create(final Accessor<StageThree> whenReady) {
+ // Prepend an init wave flow onto the stage continuation.
+ super.create(new Accessor<StageThree>() {
+ @Override
+ public void use(StageThree x) {
+ onStageThreeLoaded(x, whenReady);
+ }
+ });
+ }
+
+ @Override
+ protected String getLocalDomain() {
+ return localDomain;
+ }
+ });
}
- public void destroy() {
- if (wave != null) {
- waveStore.remove(wave);
- wave = null;
+ private void onStageThreeLoaded(StageThree x, Accessor<StageThree> whenReady) {
+ if (closed) {
+ // Stop the loading process.
+ return;
}
- if (three != null) {
- three.getEditActions().stopEditing();
- three = null;
+ three = x;
+ if (isNewWave) {
+ initNewWave(x);
+ } else {
+ handleExistingWave(x);
}
- if (two != null) {
- two.getConnector().close();
- two = null;
- }
- if (one != null) {
- one.getWavePanel().destroy();
- one = null;
- }
- closed = true;
+ wave = new WaveContext(
+ two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
+ waveStore.add(wave);
+ whenReady.use(x);
}
- /**
- * @return a halting provider if this stage is closed. Otherwise, returns the
- * given provider.
- */
- @SuppressWarnings("unchecked") // HALT is safe as a holder for any type
- private <T> AsyncHolder<T> haltIfClosed(final AsyncHolder<T> provider) {
- return closed ? (AsyncHolder<T>) HALT : provider;
+ private void initNewWave(StageThree three) {
+ // Do the new-wave flow.
+ ModelAsViewProvider views = two.getModelAsViewProvider();
+ BlipQueueRenderer blipQueue = two.getBlipQueue();
+ ConversationView wave = two.getConversations();
+
+ // Force rendering to finish.
+ blipQueue.flush();
+ BlipView blipUi = views.getBlipView(wave.getRoot().getRootThread().getFirstBlip());
+ three.getEditActions().startEditing(blipUi);
}
- private void handleExistingWave(final StageThree three) {
+ private void handleExistingWave(StageThree three) {
// If there's blip reference then focus on that blip.
- final String documentId = waveRef.getDocumentId();
+ String documentId = waveRef.getDocumentId();
if (documentId != null) {
- final ModelAsViewProvider views = two.getModelAsViewProvider();
- final BlipQueueRenderer blipQueue = two.getBlipQueue();
- final ConversationView wave = two.getConversations();
+ ModelAsViewProvider views = two.getModelAsViewProvider();
+ BlipQueueRenderer blipQueue = two.getBlipQueue();
+ ConversationView wave = two.getConversations();
blipQueue.flush();
// Find conversation
Conversation conversation;
if (waveRef.hasWaveletId()) {
- final String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
+ String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
conversation = wave.getConversation(id);
} else {
// Unspecified wavelet means root.
@@ -211,9 +210,9 @@
}
if (conversation != null) {
// Find selected blip.
- final ConversationBlip blip = wave.getRoot().getBlip(documentId);
+ ConversationBlip blip = wave.getRoot().getBlip(documentId);
if (blip != null) {
- final BlipView blipUi = views.getBlipView(blip);
+ BlipView blipUi = views.getBlipView(blip);
if (blipUi != null) {
two.getStageOne().getFocusFrame().focus(blipUi);
}
@@ -222,32 +221,32 @@
}
}
- private void initNewWave(final StageThree three) {
- // Do the new-wave flow.
- final ModelAsViewProvider views = two.getModelAsViewProvider();
- final BlipQueueRenderer blipQueue = two.getBlipQueue();
- final ConversationView wave = two.getConversations();
-
- // Force rendering to finish.
- blipQueue.flush();
- final BlipView blipUi = views.getBlipView(wave.getRoot().getRootThread().getFirstBlip());
- three.getEditActions().startEditing(blipUi);
- }
-
- private void onStageThreeLoaded(final StageThree x, final Accessor<StageThree> whenReady) {
- if (closed) {
- // Stop the loading process.
- return;
+ public void destroy() {
+ if (wave != null) {
+ waveStore.remove(wave);
+ wave = null;
}
- three = x;
- if (isNewWave) {
- initNewWave(x);
- } else {
- handleExistingWave(x);
+ if (three != null) {
+ three.getEditActions().stopEditing();
+ three = null;
}
- wave = new WaveContext(
- two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
- waveStore.add(wave);
- whenReady.use(x);
+ if (two != null) {
+ two.getConnector().close();
+ two = null;
+ }
+ if (one != null) {
+ one.getWavePanel().destroy();
+ one = null;
+ }
+ closed = true;
}
+
+ /**
+ * @return a halting provider if this stage is closed. Otherwise, returns the
+ * given provider.
+ */
+ @SuppressWarnings("unchecked") // HALT is safe as a holder for any type
+ private <T> AsyncHolder<T> haltIfClosed(AsyncHolder<T> provider) {
+ return closed ? (AsyncHolder<T>) HALT : provider;
+ }
}
Modified: trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -31,7 +31,7 @@
/**
* The Class KuneWaveProfileManager is a workaround to show avatars in kune
- * while the Wave part is more mature
+ * while the Wave part is more mature (see in the future RemoteProfileManagerImpl)
*
*/
public class KuneWaveProfileManager extends AbstractProfileManager<ProfileImpl> implements
@@ -58,7 +58,7 @@
}
@Override
- public ProfileImpl getProfile(final ParticipantId participantId) {
+ public ProfileImpl getProfile(ParticipantId participantId) {
ProfileImpl profile = profiles.get(participantId.getAddress());
if (profile == null) {
@@ -73,4 +73,4 @@
profile.update(profile.getFirstName(), profile.getFullName(), avatar);
}
-}
\ No newline at end of file
+}
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -282,7 +282,7 @@
}
});
- setupConnectionIndicator();
+ //setupConnectionIndicator();
// Done in StateManager
// HistorySupport.init();
1
0
Author: vjrj_
Date: 2011-09-23 19:07:21 +0200 (Fri, 23 Sep 2011)
New Revision: 1529
Added:
trunk/src/main/java/cc/kune/core/server/LogThis.java
trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
Removed:
trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java
Modified:
trunk/
trunk/.classpath
trunk/DEV-GUIDE
trunk/TODO
trunk/pom.xml
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/UserSession.java
trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/RPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
trunk/src/main/java/cc/kune/wave/server/WaveMain.java
trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
Log:
NEW - # 105: Persist user sessions between restarts
http://kune.ourproject.org/issues/ticket/105
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- pmd-eclipse.log
.pmd
www-test
screenlog.0
client
public
target
target-local
Main-compile
.settings
.gwt-cache
repository
derby.log
star-yellow-grey.png
run.sh
tomcat
gwt-out
synccss.sh
.externalToolBuilders
.wtpmodules
www
testRepository
kune-OLD-jcr
KuneApp.launch
KuneApp NOSERVER.launch
old_src
org.ourproject.kune.app.Kune
org.ourproject.kune.iml
org.ourproject.kune.ipr
org.ourproject.kune.iws
nbproject
hibernate.reveng.xml
.gwt-tmp
target-eclipse
.checkstyle
.classpath-bien
pom.xml.*
.gwt
.jdee_sources
.jdee_classpath
prj.el
.factorypath
.apt_generated
target.old
_accounts
_certificates
_deltas
logs
test-output
.recommenders
+ pmd-eclipse.log
.pmd
www-test
screenlog.0
client
public
target
target-local
Main-compile
.settings
.gwt-cache
repository
derby.log
star-yellow-grey.png
run.sh
tomcat
gwt-out
synccss.sh
.externalToolBuilders
.wtpmodules
www
testRepository
kune-OLD-jcr
KuneApp.launch
KuneApp NOSERVER.launch
old_src
org.ourproject.kune.app.Kune
org.ourproject.kune.iml
org.ourproject.kune.ipr
org.ourproject.kune.iws
nbproject
hibernate.reveng.xml
.gwt-tmp
target-eclipse
.checkstyle
.classpath-bien
pom.xml.*
.gwt
.jdee_sources
.jdee_classpath
prj.el
.factorypath
.apt_generated
target.old
_accounts
_certificates
_deltas
logs
test-output
.recommenders
_sessions
chromedriver.log
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/.classpath 2011-09-23 17:07:21 UTC (rev 1529)
@@ -11,19 +11,19 @@
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/appengine/appengine-api-1.0-sdk/1.3.1/appengine-api-1.0-sdk-1.3.1.jar"/>
<classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.1-SNAPSHOT/box-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.1-SNAPSHOT/box-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.2-SNAPSHOT/box-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.2-SNAPSHOT/box-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
<classpathentry kind="var" path="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar" sourcepath="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.1-SNAPSHOT/client-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.1-SNAPSHOT/client-common-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.1-SNAPSHOT/client-common-src-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.1-SNAPSHOT/client-scheduler-src-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.1-SNAPSHOT/client-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.2-SNAPSHOT/client-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.2-SNAPSHOT/client-common-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.2-SNAPSHOT/client-common-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.2-SNAPSHOT/client-scheduler-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.2-SNAPSHOT/client-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.1-SNAPSHOT/common-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.2-SNAPSHOT/common-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
@@ -32,8 +32,8 @@
<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.1-SNAPSHOT/communication-src-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.1-SNAPSHOT/concurrencycontrol-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.2-SNAPSHOT/communication-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.2-SNAPSHOT/concurrencycontrol-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
@@ -55,7 +55,7 @@
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/log/gwt-log/gwt-log/3.0.1/gwt-log-3.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.1-SNAPSHOT/gwt-util-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.2-SNAPSHOT/gwt-util-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtextux/gwtextux/0.4.0.924/gwtextux-0.4.0.924.jar"/>
@@ -113,16 +113,16 @@
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.1-SNAPSHOT/media-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.2-SNAPSHOT/media-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.1-SNAPSHOT/model-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.2-SNAPSHOT/model-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16.jar" sourcepath="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.1-SNAPSHOT/proto-msg-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.2-SNAPSHOT/proto-msg-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0-sources.jar"/>
@@ -144,9 +144,9 @@
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/testng/testng/6.2.1/testng-6.2.1.jar" sourcepath="M2_REPO/org/testng/testng/6.2.1/testng-6.2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5.jar" sourcepath="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.1-SNAPSHOT/util-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.2-SNAPSHOT/util-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.1-SNAPSHOT/waveinabox-server-0.3-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.2-SNAPSHOT/waveinabox-server-0.3-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
@@ -155,4 +155,4 @@
<classpathentry kind="var" path="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1.jar" sourcepath="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path=".apt_generated" including="**/*.java"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
-</classpath>
\ No newline at end of file
+</classpath>
Modified: trunk/DEV-GUIDE
===================================================================
--- trunk/DEV-GUIDE 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/DEV-GUIDE 2011-09-23 17:07:21 UTC (rev 1529)
@@ -307,6 +307,26 @@
See class WaveClientProvider in Kune (in a short term, we should define this in a .gwt.xml not there, but this is a start point).
+== kune maven repo ==
+
+For upload packages you need to configure in .m2/settings.xml something like:
+
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <servers>
+ <server>
+ <id>kune.ourproject.org</id>
+ <username>YOUR_USER_IN_OURPROJECT_ORG</username>
+ </server>
+ </servers>
+</settings>
+
+also you have to
+ ssh-copy-id YOUR_USER_IN_OURPROJECT_ORG(a)ourproject.org
+and access via ssh with that key without problems.
+
+We usually upload new packages to this repo via bin/repopubli.sh
+
==Changelog==
Periodically update the Changelog using svn2cl:
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/TODO 2011-09-23 17:07:21 UTC (rev 1529)
@@ -284,6 +284,11 @@
2007-12-21 10:35:16,197 [btpool0-5] DEBUG - ContentManagerDefault.createContent EXCEPTION => javax.persistence.Entity
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
+** chromium & selenium
+http://www.chromium.org/developers/testing/webdriver-for-chrome
+/usr/bin/chromiumdriver
+chmod og+rx /usr/bin/chromiumdriver
+
** Memory use in demo
http://rimuhosting.com/howto/memory.jsp
Resolving: High Java Memory Usage
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/pom.xml 2011-09-23 17:07:21 UTC (rev 1529)
@@ -562,17 +562,17 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>waveinabox-server-0.3</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>proto-msg</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>gwt-util-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -582,67 +582,67 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>model-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>common-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>util-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>concurrencycontrol-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-scheduler-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>media-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>communication-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sourceforge.findbugs</groupId>
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -87,7 +87,8 @@
@Override
public void configure() {
install(FinderRegistry.init(new JpaPersistModule(jpaUnit)));
- bindInterceptor(Matchers.any(), new NotInObject(), new LoggerMethodInterceptor());
+ bindInterceptor(Matchers.annotatedWith(LogThis.class), new NotInObject(),
+ new LoggerMethodInterceptor());
bindConstant().annotatedWith(PropertiesFileName.class).to(kuneConfig);
if (sessionScope != null) {
bindScope(SessionScoped.class, sessionScope);
Added: trunk/src/main/java/cc/kune/core/server/LogThis.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/LogThis.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/LogThis.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -0,0 +1,14 @@
+package cc.kune.core.server;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * Anotate the classes you want to log via Guice interceptors
+ */
+@BindingAnnotation
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface LogThis {
+}
Modified: trunk/src/main/java/cc/kune/core/server/UserSession.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/UserSession.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/UserSession.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -19,56 +19,35 @@
*/
package cc.kune.core.server;
+import java.io.Serializable;
-import cc.kune.core.server.manager.UserManager;
-import cc.kune.domain.User;
-
-import com.google.inject.Inject;
import com.google.inject.servlet.SessionScoped;
@SessionScoped
-public class UserSession {
- private String userHash;
- private Long userId;
- private final UserManager manager;
+public class UserSession implements Serializable {
- @Inject
- public UserSession(final UserManager manager) {
- this.manager = manager;
- }
+ private static final long serialVersionUID = 4665523798343705868L;
- public String getHash() {
- return userHash;
- }
+ private String userHash;
+ private Long userId;
- public User getUser() {
- return manager.find(userId);
- }
+ public UserSession() {
+ }
- public boolean isUserLoggedIn() {
- return userId != null;
- }
+ public String getHash() {
+ return userHash;
+ }
- public boolean isUserNotLoggedIn() {
- return !isUserLoggedIn();
- }
+ public Long getUserId() {
+ return userId;
+ }
- public void login(final User user, final String newUserHash) {
- setUser(user);
- setHash(newUserHash);
- }
+ public void setHash(final String hash) {
+ this.userHash = hash;
+ }
- public void logout() {
- userId = null;
- userHash = null;
- }
+ public void setUserId(final Long userId) {
+ this.userId = userId;
+ }
- private void setHash(final String hash) {
- this.userHash = hash;
- }
-
- private void setUser(final User user) {
- userId = user.getId();
- }
-
}
Added: trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/UserSessionManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/UserSessionManager.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -0,0 +1,51 @@
+package cc.kune.core.server;
+
+import cc.kune.core.server.manager.UserManager;
+import cc.kune.domain.User;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+@Singleton
+public class UserSessionManager {
+
+ private final UserManager manager;
+ private final Provider<UserSession> userSessionProv;
+
+ @Inject
+ public UserSessionManager(final UserManager manager, final Provider<UserSession> userSessionProv) {
+ this.manager = manager;
+ this.userSessionProv = userSessionProv;
+ }
+
+ public String getHash() {
+ return getUserSession().getHash();
+ }
+
+ public User getUser() {
+ return manager.find(getUserSession().getUserId());
+ }
+
+ private UserSession getUserSession() {
+ return userSessionProv.get();
+ }
+
+ public boolean isUserLoggedIn() {
+ return getUserSession().getUserId() != null;
+ }
+
+ public boolean isUserNotLoggedIn() {
+ return !isUserLoggedIn();
+ }
+
+ public void login(final Long userId, final String newUserHash) {
+ getUserSession().setUserId(userId);
+ getUserSession().setHash(newUserHash);
+ }
+
+ public void logout() {
+ getUserSession().setUserId(null);
+ getUserSession().setHash(null);
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -28,7 +28,7 @@
import cc.kune.core.client.errors.SessionExpiredException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -47,7 +47,7 @@
// @Inject
// private UnitOfWork unitOfWork;
@Inject
- Provider<UserSession> userSessionProvider;
+ UserSessionManager userSessionManager;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
@@ -63,8 +63,6 @@
LOG.info("Method: " + invocation.getMethod().getName());
LOG.info("Userhash received: " + userHash);
LOG.info("--------------------------------------------------------------------------------");
- final UserSession userSession = userSessionProvider.get();
- // final SessionService sessionService = sessionServiceProvider.get();
final Authenticated authAnnotation = invocation.getStaticPart().getAnnotation(Authenticated.class);
final boolean mandatory = authAnnotation.mandatory();
@@ -72,19 +70,19 @@
if (userHash == null && mandatory) {
// sessionService.getNewSession();
throw new UserMustBeLoggedException();
- } else if (userSession.isUserNotLoggedIn() && mandatory) {
+ } else if (userSessionManager.isUserNotLoggedIn() && mandatory) {
// sessionService.getNewSession();
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
- } else if (userSession.isUserNotLoggedIn() && userHash == null) {
+ } else if (userSessionManager.isUserNotLoggedIn() && userHash == null) {
// Ok, do nothing
- } else if (userSession.isUserNotLoggedIn() && userHash != null) {
+ } else if (userSessionManager.isUserNotLoggedIn() && userHash != null) {
// sessionService.getNewSession();
LOG.info("Session expired (not logged in server)");
throw new SessionExpiredException();
- } else if (!userSession.getHash().equals(userHash)) {
- final String serverHash = userSession.getHash();
- userSession.logout();
+ } else if (!userSessionManager.getHash().equals(userHash)) {
+ final String serverHash = userSessionManager.getHash();
+ userSessionManager.logout();
// sessionService.getNewSession();
LOG.info("Session expired (userHash: " + userHash + " different from server hash: " + serverHash
+ ")");
Modified: trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,7 @@
import org.aopalliance.intercept.MethodInvocation;
import cc.kune.core.client.errors.AccessViolationException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessRightsUtils;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.content.ContentUtils;
@@ -49,14 +49,14 @@
@Inject
private Provider<GroupManager> groupManagerProvider;
@Inject
- private Provider<UserSession> userSessionProvider;
+ private Provider<UserSessionManager> userSessionProvider;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
final Object[] arguments = invocation.getArguments();
final StateToken token = (StateToken) arguments[1];
- final UserSession userSession = userSessionProvider.get();
+ final UserSessionManager userSession = userSessionProvider.get();
final GroupManager groupManager = groupManagerProvider.get();
final AccessService accessService = accessServiceProvider.get();
Modified: trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -29,7 +29,7 @@
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.SessionExpiredException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessRightsUtils;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.shared.domain.AccessRol;
@@ -54,7 +54,7 @@
Provider<SessionService> sessionServiceProvider;
private Group siteGroup;
@Inject
- Provider<UserSession> userSessionProvider;
+ UserSessionManager userSessionManager;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
@@ -66,7 +66,6 @@
LOG.info("Method: " + invocation.getMethod().getName());
LOG.info("Userhash received: " + userHash);
LOG.info("--------------------------------------------------------------------------------");
- final UserSession userSession = userSessionProvider.get();
final SuperAdmin authAnnotation = invocation.getStaticPart().getAnnotation(SuperAdmin.class);
final AccessRol rol = authAnnotation.rol();
@@ -78,11 +77,11 @@
if (userHash == null) {
throw new UserMustBeLoggedException();
- } else if (userSession.isUserNotLoggedIn()) {
+ } else if (userSessionManager.isUserNotLoggedIn()) {
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
} else {
- User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
if (!AccessRightsUtils.correctMember(user, siteGroup, rol)) {
throw new AccessViolationException();
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,7 @@
import org.apache.commons.fileupload.FileItem;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
@@ -60,7 +60,7 @@
@Inject
I18nTranslationService i18n;
@Inject
- UserSession userSession;
+ UserSessionManager userSession;
@Override
protected void beforePostStart() {
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -31,7 +31,7 @@
import cc.kune.core.client.errors.NoDefaultContentException;
import cc.kune.core.client.errors.ToolNotFoundException;
import cc.kune.core.client.rpcservices.ContentService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessRightsService;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.access.FinderService;
@@ -68,7 +68,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class ContentRPC implements ContentService, RPC {
@@ -83,18 +82,18 @@
private final AccessRightsService rightsService;
private final StateService stateService;
private final TagUserContentManager tagManager;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSession;
private final KuneWaveManager waveManager;
@Inject
- public ContentRPC(final FinderService finderService, final Provider<UserSession> userSessionProvider,
+ public ContentRPC(final FinderService finderService, final UserSessionManager userSession,
final AccessService accessService, final AccessRightsService rightsService,
final StateService stateService, final CreationService creationService,
final GroupManager groupManager, final ContentManager contentManager,
final ContainerManager containerManager, final TagUserContentManager tagManager,
final Mapper mapper, final ChatManager chatManager, final KuneWaveManager waveManager) {
this.finderService = finderService;
- this.userSessionProvider = userSessionProvider;
+ this.userSession = userSession;
this.accessService = accessService;
this.rightsService = rightsService;
this.stateService = stateService;
@@ -249,7 +248,7 @@
}
private User getCurrentUser() {
- return getUserSession().getUser();
+ return userSession.getUser();
}
public StateContainerDTO getState(final Container container) {
@@ -284,12 +283,8 @@
return getSummaryTags(group);
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
private boolean isUserLoggedIn() {
- return getUserSession().isUserLoggedIn();
+ return userSession.isUserLoggedIn();
}
private void mapContentRightsInstate(final User user, final AccessLists groupAccessList,
Modified: trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -22,7 +22,7 @@
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.GroupService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -41,7 +41,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class GroupRPC implements RPC, GroupService {
@@ -50,13 +49,13 @@
private final GroupManager groupManager;
private final Mapper mapper;
private final ReservedWordsRegistry reserverdWords;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
- public GroupRPC(final Provider<UserSession> userSessionProvider, final GroupManager groupManager,
+ public GroupRPC(final UserSessionManager userSessionManager, final GroupManager groupManager,
final ContentManager contentManager, final Mapper mapper,
final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC) {
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.groupManager = groupManager;
this.contentManager = contentManager;
this.mapper = mapper;
@@ -120,15 +119,10 @@
}
private User getUserLogged() {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
return user;
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated(mandatory = true)
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
Modified: trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -28,7 +28,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.SessionExpiredException;
import cc.kune.core.client.rpcservices.I18nService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.SuperAdmin;
import cc.kune.core.server.manager.I18nLanguageManager;
@@ -49,15 +49,14 @@
private final I18nLanguageManager languageManager;
private final Mapper mapper;
private final Provider<HttpServletRequest> requestProvider;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
public I18nRPC(final Provider<HttpServletRequest> requestProvider,
- final Provider<UserSession> userSessionProvider,
- final I18nTranslationManager i18nTranslationManager, final I18nLanguageManager languageManager,
- final Mapper mapper) {
+ final UserSessionManager userSessionManager, final I18nTranslationManager i18nTranslationManager,
+ final I18nLanguageManager languageManager, final Mapper mapper) {
this.requestProvider = requestProvider;
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.i18nTranslationManager = i18nTranslationManager;
this.languageManager = languageManager;
this.mapper = mapper;
@@ -68,12 +67,11 @@
public I18nLanguageDTO getInitialLanguage(final String localeParam) {
String initLanguage;
I18nLanguage lang;
- final UserSession userSession = getUserSession();
if (localeParam != null) {
initLanguage = localeParam;
} else {
- if (userSession.isUserLoggedIn()) {
- initLanguage = userSession.getUser().getLanguage().getCode();
+ if (userSessionManager.isUserLoggedIn()) {
+ initLanguage = userSessionManager.getUser().getLanguage().getCode();
} else {
final String browserLang = requestProvider.get().getLocale().getLanguage();
if (browserLang != null) {
@@ -134,10 +132,6 @@
return i18nTranslationManager.getTranslation(language, text, noteForTranslators);
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated
@Transactional
Modified: trunk/src/main/java/cc/kune/core/server/rpc/RPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/RPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/RPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -19,6 +19,8 @@
*/
package cc.kune.core.server.rpc;
+import cc.kune.core.server.LogThis;
+
import com.google.inject.Singleton;
/**
@@ -35,6 +37,7 @@
*
*/
@Singleton
+@LogThis
public interface RPC {
}
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -26,7 +26,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.SiteService;
import cc.kune.core.server.InitData;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.manager.ExtMediaDescripManager;
import cc.kune.core.server.manager.I18nCountryManager;
import cc.kune.core.server.manager.I18nLanguageManager;
@@ -45,7 +45,6 @@
import cc.kune.core.shared.dto.UserInfoDTO;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class SiteRPC implements RPC, SiteService {
@@ -61,16 +60,15 @@
private final ServerToolRegistry serverToolRegistry;
private final HashMap<String, GSpaceTheme> siteThemes;
private final UserInfoService userInfoService;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
- // TODO: refactor: too many parameters! refactor to Facade Pattern
@Inject
- public SiteRPC(final Provider<UserSession> userSessionProvider, final UserManager userManager,
+ public SiteRPC(final UserSessionManager userSessionManager, final UserManager userManager,
final UserInfoService userInfoService, final LicenseManager licenseManager, final Mapper mapper,
final KuneProperties kuneProperties, final ChatProperties chatProperties,
final I18nLanguageManager languageManager, final I18nCountryManager countryManager,
final ServerToolRegistry serverToolRegistry, final ExtMediaDescripManager extMediaDescManager) {
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.userInfoService = userInfoService;
this.licenseManager = licenseManager;
this.mapper = mapper;
@@ -93,9 +91,9 @@
@Transactional
public InitDataDTO getInitData(final String userHash) throws DefaultException {
final InitDataDTO dataMapped = mapper.map(data, InitDataDTO.class);
- final UserSession userSession = getUserSession();
- final UserInfo userInfo = userInfoService.buildInfo(userSession.getUser(), userSession.getHash());
+ final UserInfo userInfo = userInfoService.buildInfo(userSessionManager.getUser(),
+ userSessionManager.getHash());
if (userInfo != null) {
dataMapped.setUserInfo(mapper.map(userInfo, UserInfoDTO.class));
}
@@ -120,10 +118,6 @@
return theme;
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
private InitData loadInitData() {
data = new InitData();
data.setSiteUrl(kuneProperties.get(KuneProperties.SITE_URL));
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -21,7 +21,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.SocialNetworkService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -36,7 +36,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class SocialNetworkRPC implements SocialNetworkService, RPC {
@@ -44,13 +43,12 @@
private final GroupManager groupManager;
private final Mapper mapper;
private final SocialNetworkManager socialNetworkManager;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
- public SocialNetworkRPC(final Provider<UserSession> userSessionProvider,
- final GroupManager groupManager, final SocialNetworkManager socialNetworkManager,
- final Mapper mapper) {
- this.userSessionProvider = userSessionProvider;
+ public SocialNetworkRPC(final UserSessionManager userSessionManager, final GroupManager groupManager,
+ final SocialNetworkManager socialNetworkManager, final Mapper mapper) {
+ this.userSessionManager = userSessionManager;
this.groupManager = groupManager;
this.socialNetworkManager = socialNetworkManager;
this.mapper = mapper;
@@ -62,8 +60,7 @@
@Transactional
public SocialNetworkDataDTO acceptJoinGroup(final String hash, final StateToken groupToken,
final String groupToAcceptShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAccept = groupManager.findByShortName(groupToAcceptShortName);
@@ -77,8 +74,7 @@
@Transactional
public SocialNetworkDataDTO addAdminMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
@@ -92,8 +88,7 @@
@Transactional
public SocialNetworkDataDTO addCollabMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
@@ -107,8 +102,7 @@
@Transactional
public SocialNetworkDataDTO addViewerMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
@@ -129,8 +123,7 @@
@Transactional
public SocialNetworkDataDTO deleteMember(final String hash, final StateToken groupToken,
final String groupToDeleleShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToDelete = groupManager.findByShortName(groupToDeleleShortName);
@@ -144,8 +137,7 @@
@Transactional
public SocialNetworkDataDTO denyJoinGroup(final String hash, final StateToken groupToken,
final String groupToDenyShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToDenyJoin = groupManager.findByShortName(groupToDenyShortName);
@@ -165,23 +157,17 @@
@Transactional
public SocialNetworkDataDTO getSocialNetwork(final String hash, final StateToken groupToken)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
return generateResponse(user, group);
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated
@Transactional
public SocialNetworkRequestResult requestJoinGroup(final String hash, final StateToken groupToken)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
return socialNetworkManager.requestToJoin(user, group);
@@ -193,8 +179,7 @@
@Transactional
public SocialNetworkDataDTO setAdminAsCollab(final String hash, final StateToken groupToken,
final String groupToSetCollabShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToSetCollab = groupManager.findByShortName(groupToSetCollabShortName);
@@ -208,8 +193,7 @@
@Transactional
public SocialNetworkDataDTO setCollabAsAdmin(final String hash, final StateToken groupToken,
final String groupToSetAdminShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToSetAdmin = groupManager.findByShortName(groupToSetAdminShortName);
@@ -221,8 +205,7 @@
@Authenticated
@Transactional
public void unJoinGroup(final String hash, final StateToken groupToken) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
socialNetworkManager.unJoinGroup(userLogged.getUserGroup(), group);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -31,6 +31,7 @@
import cc.kune.core.client.errors.UserAuthException;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -63,7 +64,7 @@
private final ReservedWordsRegistry reserverdWords;
private final UserInfoService userInfoService;
private final UserManager userManager;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
private final Boolean useSocketIO;
private final CustomWaveClientServlet waveClientServlet;
private final SessionManager waveSessionManager;
@@ -73,8 +74,8 @@
@Named(CoreSettings.USE_SOCKETIO) final Boolean useSocketIO,
final UserInfoService userInfoService, final Mapper mapper,
final SessionManager waveSessionManager, final CustomWaveClientServlet waveClientServlet,
- final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC) {
- this.userSessionProvider = userSessionProvider;
+ final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC,
+ final UserSessionManager userSessionManager) {
this.userManager = userManager;
this.useSocketIO = useSocketIO;
this.userInfoService = userInfoService;
@@ -83,6 +84,7 @@
this.waveClientServlet = waveClientServlet;
this.reserverdWords = reserverdWords;
this.contentRPC = contentRPC;
+ this.userSessionManager = userSessionManager;
}
@Override
@@ -101,8 +103,7 @@
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
public String getUserAvatarBaser64(final String userHash, final StateToken userToken)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
final Group userGroup = user.getUserGroup();
if (!userGroup.getShortName().equals(userToken.getGroup())) {
throw new AccessViolationException();
@@ -114,10 +115,6 @@
}
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated(mandatory = true)
public WaveClientParams getWaveClientParameters(final String userHash) {
@@ -128,7 +125,7 @@
}
private UserInfoDTO loadUserInfo(final User user) throws DefaultException {
- final UserInfo userInfo = userInfoService.buildInfo(user, getUserSession().getHash());
+ final UserInfo userInfo = userInfoService.buildInfo(user, userSessionManager.getHash());
return mapper.map(userInfo, UserInfoDTO.class);
}
@@ -144,8 +141,7 @@
private UserInfoDTO loginUser(final User user, final String waveToken) throws DefaultException {
if (user != null) {
- // Maybe use terracotta.org for http session clustering
- getUserSession().login(user, waveToken);
+ userSessionManager.login(user.getId(), waveToken);
return loadUserInfo(user);
} else {
throw new UserAuthException();
@@ -156,7 +152,7 @@
@Authenticated
@Transactional
public void logout(final String userHash) throws DefaultException {
- getUserSession().logout();
+ userSessionManager.logout();
// FIXME final SessionService sessionService =
// sessionServiceProvider.get();
// FIXME sessionService.getNewSession();
@@ -173,8 +169,7 @@
@Authenticated
@Transactional
public UserInfoDTO reloadUserInfo(final String userHash) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
return loadUserInfo(user);
}
@@ -184,8 +179,7 @@
@Transactional
public void setBuddiesVisibility(final String userHash, final StateToken groupToken,
final UserSNetVisibility visibility) {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
if (!groupToken.getGroup().equals(user.getShortName())) {
throw new AccessViolationException();
}
@@ -197,7 +191,7 @@
@Transactional
public StateAbstractDTO updateUser(final String userHash, final UserDTO user,
final I18nLanguageSimpleDTO lang) throws DefaultException {
- final Long id = getUserSession().getUser().getId();
+ final Long id = userSessionManager.getUser().getId();
if (!id.equals(user.getId())) {
throw new AccessViolationException();
}
Modified: trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -32,7 +32,7 @@
import java.util.Set;
import cc.kune.core.server.AbstractServerTool;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.ToolConfigurationManager;
@@ -47,26 +47,25 @@
import cc.kune.wave.server.KuneWaveUtils;
import com.google.inject.Inject;
-import com.google.inject.Provider;
public class ListsServerTool extends AbstractServerTool {
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
private final KuneWaveService waveManager;
@Inject
public ListsServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
- final Provider<UserSession> userSessionProvider, final KuneWaveService waveManager) {
+ final UserSessionManager userSessionManager, final KuneWaveService waveManager) {
super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST), Arrays.asList(TYPE_LIST),
Arrays.asList(TYPE_LIST), Arrays.asList(TYPE_ROOT), contentManager, containerManager,
configurationManager, i18n, ServerToolTarget.forGroups);
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.waveManager = waveManager;
}
private Group getUserGroup() {
- return userSessionProvider.get().getUser().getUserGroup();
+ return userSessionManager.getUser().getUserGroup();
}
@Override
Modified: trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -1,7 +1,7 @@
package cc.kune.lists.server.rpc;
import cc.kune.core.client.errors.AccessViolationException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -21,19 +21,18 @@
import cc.kune.lists.shared.ListsConstants;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class ListsRPC implements ListsService, RPC {
private final ContainerManager contentManager;
private final ContentRPC contentRPC;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
- public ListsRPC(final ContentRPC contentRPC, final Provider<UserSession> userSessionProvider,
+ public ListsRPC(final ContentRPC contentRPC, final UserSessionManager userSessionManager,
final ContainerManager contentManager) {
this.contentRPC = contentRPC;
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.contentManager = contentManager;
}
@@ -50,7 +49,7 @@
}
private Group getUserGroup() {
- return userSessionProvider.get().getUser().getUserGroup();
+ return userSessionManager.getUser().getUserGroup();
}
@Override
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,6 @@
import java.util.Date;
import java.util.logging.Logger;
-import org.apache.commons.lang.NotImplementedException;
import org.waveprotocol.box.webclient.client.ClientEvents;
import org.waveprotocol.box.webclient.client.ClientIdGenerator;
import org.waveprotocol.box.webclient.client.DebugMessagePanel;
@@ -34,6 +33,7 @@
import org.waveprotocol.box.webclient.client.Session;
import org.waveprotocol.box.webclient.client.SimpleWaveStore;
import org.waveprotocol.box.webclient.client.WaveWebSocketClient;
+import org.waveprotocol.box.webclient.client.events.Log;
import org.waveprotocol.box.webclient.client.events.NetworkStatusEvent;
import org.waveprotocol.box.webclient.client.events.NetworkStatusEventHandler;
import org.waveprotocol.box.webclient.client.events.WaveCreationEvent;
@@ -47,7 +47,6 @@
import org.waveprotocol.box.webclient.search.SearchPresenter;
import org.waveprotocol.box.webclient.search.SimpleSearch;
import org.waveprotocol.box.webclient.search.WaveStore;
-import org.waveprotocol.box.webclient.util.Log;
import org.waveprotocol.box.webclient.widget.frame.FramedPanel;
import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
import org.waveprotocol.wave.client.account.ProfileManager;
@@ -56,12 +55,16 @@
import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
import org.waveprotocol.wave.client.debug.logger.LogLevel;
import org.waveprotocol.wave.client.widget.common.ImplPanel;
+import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner;
+import org.waveprotocol.wave.client.widget.popup.PopupChrome;
+import org.waveprotocol.wave.client.widget.popup.PopupChromeFactory;
+import org.waveprotocol.wave.client.widget.popup.PopupFactory;
+import org.waveprotocol.wave.client.widget.popup.UniversalPopup;
import org.waveprotocol.wave.model.id.IdGenerator;
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.sitebar.spaces.Space;
@@ -81,9 +84,9 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.inject.Inject;
@@ -103,31 +106,6 @@
* prepared, it is revealed in the banner via a link.
*/
public static class ErrorHandler implements UncaughtExceptionHandler {
- public static void install() {
- GWT.setUncaughtExceptionHandler(new ErrorHandler(GWT.getUncaughtExceptionHandler()));
- }
-
- private static String maybe(final int value, final String otherwise) {
- return value != -1 ? String.valueOf(value) : otherwise;
- }
-
- private static String maybe(final String value, final String otherwise) {
- return value != null ? value : otherwise;
- }
-
- /**
- * Indicates whether an error has already been reported (at most one error
- * is ever reported by this handler).
- */
- private boolean hasFired;
-
- /** Next handler in the handler chain. */
- private final UncaughtExceptionHandler next;
-
- private ErrorHandler(final UncaughtExceptionHandler next) {
- this.next = next;
- }
-
public static void getStackTraceAsync(final Throwable t, final Accessor<SafeHtml> whenReady) {
// TODO: Request stack-trace de-obfuscation. For now, just use the
// javascript stack trace.
@@ -166,6 +144,31 @@
}.schedule(1);
}
+ public static void install() {
+ GWT.setUncaughtExceptionHandler(new ErrorHandler(GWT.getUncaughtExceptionHandler()));
+ }
+
+ private static String maybe(final int value, final String otherwise) {
+ return value != -1 ? String.valueOf(value) : otherwise;
+ }
+
+ private static String maybe(final String value, final String otherwise) {
+ return value != null ? value : otherwise;
+ }
+
+ /**
+ * Indicates whether an error has already been reported (at most one error
+ * is ever reported by this handler).
+ */
+ private boolean hasFired;
+
+ /** Next handler in the handler chain. */
+ private final UncaughtExceptionHandler next;
+
+ private ErrorHandler(final UncaughtExceptionHandler next) {
+ this.next = next;
+ }
+
@Override
public void onUncaughtException(final Throwable e) {
if (!hasFired) {
@@ -175,8 +178,8 @@
getStackTraceAsync(e, new Accessor<SafeHtml>() {
@Override
public void use(final SafeHtml stack) {
- //NotifyUser.error("Oops! Something has gone wrong. Please contact the site admins with <em>more details</em>");
// error.addDetail(stack, null);
+ // REMOTE_LOG.severe(stack.asString().replace("<br>", "\n"));
final String message = stack.asString().replace("<br>", "\n");
REMOTE_LOG.severe(message);
NotifyUser.logError(message);
@@ -194,41 +197,58 @@
}
private static final Binder BINDER = GWT.create(Binder.class);
- static final Log LOG = Log.get(WebClient.class);
+ static Log LOG = Log.get(WebClient.class);
// Use of GWT logging is only intended for sending exception reports to the
// server, nothing else in the client should use java.util.logging.
// Please also see WebClientDemo.gwt.xml.
private static final Logger REMOTE_LOG = Logger.getLogger("REMOTE_LOG");
- // TODO (Yuri Z.) Change the implementation to RemoteProfileManagerImpl when
- // it will be ready.
- private final ProfileManager profiles;
+ /** Creates a popup that warns about network disconnects. */
+ private static UniversalPopup createTurbulencePopup() {
+ final PopupChrome chrome = PopupChromeFactory.createPopupChrome();
+ final UniversalPopup popup =
+ PopupFactory.createPopup(null, new CenterPopupPositioner(), chrome, true);
+ popup.add(new HTML("<div style='color: red; padding: 5px; text-align: center;'>"
+ + "<b>A turbulence detected!<br></br>"
+ + " Please save your last changes to somewhere and reload the wave.</b></div>"));
+ return popup;
+ }
+ private RemoteViewServiceMultiplexer channel;
- @UiField
- SplitLayoutPanel splitPanel;
-
private final EventBus eventBus;
- @UiField
- Style style;
+ private IdGenerator idGenerator;
+ private final InboxCountPresenter inboxCount;
+
+ private final Element loading = new LoadingIndicator().getElement();
+
+ private ParticipantId loggedInUser;
@UiField
- FramedPanel waveFrame;
+ DebugMessagePanel logPanel;
+ private final ProfileManager profiles;
- ImplPanel waveHolder;
- private final Element loading = new LoadingIndicator().getElement();
-
@UiField(provided = true)
final SearchPanelWidget searchPanel;
@UiField
- DebugMessagePanel logPanel;
+ SplitLayoutPanel splitPanel;
+ @UiField
+ Style style;
+
+ private final UniversalPopup turbulencePopup = createTurbulencePopup();
+
/** The wave panel, if a wave is open. */
private KuneStagesProvider wave;
+ @UiField
+ FramedPanel waveFrame;
+
+ ImplPanel waveHolder;
+
private final WaveStore waveStore = new SimpleWaveStore();
/**
@@ -236,18 +256,11 @@
*/
private WaveWebSocketClient websocket;
- private ParticipantId loggedInUser;
-
- private IdGenerator idGenerator;
-
- private RemoteViewServiceMultiplexer channel;
- private final InboxCountPresenter inboxCount;
-
/**
* This is the entry point method.
*/
@Inject
- public WebClient(final EventBus eventBus, KuneWaveProfileManager profiles, InboxCountPresenter inboxCount, TokenMatcher tokenMatcher) {
+ public WebClient(final EventBus eventBus, final KuneWaveProfileManager profiles, final InboxCountPresenter inboxCount, final TokenMatcher tokenMatcher) {
// Window.alert("webclient! " + new Date());
this.eventBus = eventBus;
this.profiles = profiles;
@@ -274,43 +287,31 @@
// Done in StateManager
// HistorySupport.init();
- //createWebSocket();
-
loginImpl();
setupUi();
- if (tokenMatcher.isWaveToken(History.getToken()))
+ if (tokenMatcher.isWaveToken(History.getToken())) {
History.fireCurrentHistoryState();
+ }
LOG.info("SimpleWebClient.onModuleLoad() done");
}
- private void createWebSocket() {
- websocket = new WaveWebSocketClient(useSocketIO(), getWebSocketBaseUrl(GWT.getModuleBaseURL()));
- websocket.connect();
- }
-
@Override
- public void login() {
- loginImpl();
+ public void clear() {
+ // Duplicate below
+ if (wave != null) {
+ wave.destroy();
+ wave = null;
}
-
- @Override
- public void logout() {
- loggedInUser = null;
- channel = null;
- idGenerator = null;
- websocket = null;
- clear();
+ if (waveHolder.isAttached()) {
+ waveHolder.removeFromParent();
}
+}
- private void loginImpl() {
- createWebSocket();
- if (Session.get().isLoggedIn()) {
- loggedInUser = new ParticipantId(Session.get().getAddress());
- idGenerator = ClientIdGenerator.create();
- loginToServer();
- }
+ private void createWebSocket() {
+ websocket = new WaveWebSocketClient(useSocketIO(), getWebSocketBaseUrl(GWT.getModuleBaseURL()));
+ websocket.connect();
}
@Override
@@ -329,25 +330,42 @@
}
@Override
+ public void getStackTraceAsync(final Throwable caught, final Accessor<SafeHtml> accessor) {
+ ErrorHandler.getStackTraceAsync(caught, accessor);
+ }
+
+ @Override
public ImplPanel getWaveHolder() {
return waveHolder;
}
-@Override
-public WaveWebSocketClient getWebSocket() {
- return websocket;
-}
+
+ @Override
+ public WaveWebSocketClient getWebSocket() {
+ return websocket;
+ }
+
/**
* Returns <code>ws://yourhost[:port]/</code>.
*/
// XXX check formatting wrt GPE
private native String getWebSocketBaseUrl(String moduleBase) /*-{
- return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
+ return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
}-*/;
- private native boolean useSocketIO() /*-{
- return !!$wnd.__useSocketIO
- }-*/;
+ @Override
+ public void login() {
+ loginImpl();
+ }
+ private void loginImpl() {
+ createWebSocket();
+ if (Session.get().isLoggedIn()) {
+ loggedInUser = new ParticipantId(Session.get().getAddress());
+ idGenerator = ClientIdGenerator.create();
+ loginToServer();
+ }
+ }
+
/**
*/
private void loginToServer() {
@@ -355,16 +373,15 @@
channel = new RemoteViewServiceMultiplexer(websocket, loggedInUser.getAddress());
}
- public void clear() {
- // Duplicate below
- if (wave != null) {
- wave.destroy();
- wave = null;
+ @Override
+ public void logout() {
+ loggedInUser = null;
+ channel = null;
+ idGenerator = null;
+ websocket = null;
+ clear();
}
- if (waveHolder.isAttached()) {
- waveHolder.removeFromParent();
- }
-}
+
/**
* Shows a wave in a wave panel.
*
@@ -385,6 +402,7 @@
waveFrame.remove(waveHolder);
waveFrame.clear();
waveFrame.add(waveHolder);
+
// Release the display:none.
UIObject.setVisible(waveFrame.getElement(), true);
waveHolder.getElement().appendChild(loading);
@@ -399,7 +417,6 @@
}
});
final String encodedToken = History.getToken();
- // NotifyUser.info("Open Wave: " + encodedToken + " waveRef: " + waveRef.getWaveId(), true);
// Kune patch
if (encodedToken != null && !encodedToken.isEmpty() && !encodedToken.equals(SiteTokens.WAVEINBOX)) {
final WaveRef fromWaveRef = HistorySupport.waveRefFromHistoryToken(encodedToken);
@@ -421,6 +438,9 @@
private void setupConnectionIndicator() {
ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
+
+ boolean isTurbulenceDetected = false;
+
@Override
public void onNetworkStatus(final NetworkStatusEvent event) {
final Element element = Document.get().getElementById("netstatus");
@@ -430,10 +450,16 @@
case RECONNECTED:
element.setInnerText("Online");
element.setClassName("online");
+ isTurbulenceDetected = false;
+ turbulencePopup.hide();
break;
case DISCONNECTED:
element.setInnerText("Offline");
element.setClassName("offline");
+ if (!isTurbulenceDetected) {
+ isTurbulenceDetected = true;
+ turbulencePopup.show();
+ }
break;
case RECONNECTING:
element.setInnerText("Connecting...");
@@ -446,45 +472,47 @@
}
private void setupSearchPanel() {
- // On wave selection, fire an event.
- SearchPresenter.WaveSelectionHandler selectHandler =
- new SearchPresenter.WaveSelectionHandler() {
+ // On wave action fire an event.
+ final SearchPresenter.WaveActionHandler actionHandler =
+ new SearchPresenter.WaveActionHandler() {
@Override
- public void onWaveSelected(WaveId id) {
+ public void onCreateWave() {
+ ClientEvents.get().fireEvent(WaveCreationEvent.CREATE_NEW_WAVE);
+ }
+
+ @Override
+ public void onWaveSelected(final WaveId id) {
ClientEvents.get().fireEvent(new WaveSelectionEvent(WaveRef.of(id)));
}
};
- Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
+ final Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
search.addListener(inboxCount.getSearchListener());
- SearchPresenter.create(search, searchPanel, selectHandler, profiles);
+ SearchPresenter.create(search, searchPanel, actionHandler, profiles);
}
+private void setupUi() {
+ // Set up UI
+ final DockLayoutPanel self = BINDER.createAndBindUi(this);
+ // kune-patch
+ // RootPanel.get("app").add(self);
+ initWidget(self);
+ waveHolder = new ImplPanel("");
+ waveHolder.addStyleName("k-waveHolder");
+ waveFrame.add(waveHolder);
+ // DockLayoutPanel forcibly conflicts with sensible layout control, and
+ // sticks inline styles on elements without permission. They must be
+ // cleared.
+ self.getElement().getStyle().clearPosition();
+ splitPanel.setWidgetMinSize(searchPanel, 300);
-
- private void setupUi() {
- // Set up UI
- final DockLayoutPanel self = BINDER.createAndBindUi(this);
- // kune-patch
- // RootPanel.get("app").add(self);
- initWidget(self);
- waveHolder = new ImplPanel("");
- waveHolder.addStyleName("k-waveHolder");
- waveFrame.add(waveHolder);
- // DockLayoutPanel forcibly conflicts with sensible layout control, and
- // sticks inline styles on elements without permission. They must be
- // cleared.
- self.getElement().getStyle().clearPosition();
- splitPanel.setWidgetMinSize(searchPanel, 300);
-
- if (LogLevel.showDebug()) {
- logPanel.enable();
- } else {
- logPanel.removeFromParent();
- }
-
- setupSearchPanel();
- setupWavePanel();
+ if (LogLevel.showDebug()) {
+ logPanel.enable();
+ } else {
+ logPanel.removeFromParent();
}
+ setupSearchPanel();
+ setupWavePanel();
+}
private void setupWavePanel() {
// Hide the frame until waves start getting opened.
UIObject.setVisible(waveFrame.getElement(), false);
@@ -498,8 +526,7 @@
});
}
- @Override
- public void getStackTraceAsync(Throwable caught, Accessor<SafeHtml> accessor) {
- ErrorHandler.getStackTraceAsync(caught, accessor);
- }
+ private native boolean useSocketIO() /*-{
+ return !!$wnd.__useSocketIO
+ }-*/;
}
Deleted: trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -1,162 +0,0 @@
-/**
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package cc.kune.wave.server;
-
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.waveprotocol.box.server.CoreSettings;
-import org.waveprotocol.box.server.account.AccountData;
-import org.waveprotocol.box.server.persistence.AccountStore;
-import org.waveprotocol.box.server.persistence.PersistenceException;
-import org.waveprotocol.box.server.robots.util.RobotsUtil;
-import org.waveprotocol.box.server.robots.util.RobotsUtil.RobotRegistrationException;
-import org.waveprotocol.wave.model.id.TokenGenerator;
-import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.name.Named;
-import com.google.inject.name.Names;
-import com.google.wave.api.AbstractRobot;
-
-/**
- * The base for robot agents that run on the WIAB server.
- *
- * @author yurize(a)apache.org (Yuri Zelikov)
- */
-@SuppressWarnings("serial")
-public abstract class AbstractBaseRobotAgent extends AbstractRobot {
-
- static class ServerFrontendAddressHolder {
-
- private final List<String> addresses;
-
- @Inject
- ServerFrontendAddressHolder((a)Named(CoreSettings.HTTP_FRONTEND_ADDRESSES) final List<String> addresses) {
- this.addresses = addresses;
- }
-
- List<String> getAddresses() {
- return addresses;
- }
- }
-
- public static final String AGENT_PREFIX_URI = "/agent";
- private static final Logger LOG = Logger.getLogger(AbstractBaseRobotAgent.class.getName());
-
- /** Account store with user and robot accounts. */
- private final AccountStore accountStore;
-
- private final ServerFrontendAddressHolder frontendAddressHolder;
-
- /** The wave server domain. */
- private final String waveDomain;
-
- /**
- * Constructor. Initializes the agent to serve on the URI provided by
- * {@link #getRobotUri()} and ensures that the agent is registered in the
- * Account store.
- *
- * @param injector
- * the injector instance.
- */
- public AbstractBaseRobotAgent(final Injector injector) {
- this(injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))),
- injector.getInstance(AccountStore.class), injector.getInstance(TokenGenerator.class),
- injector.getInstance(ServerFrontendAddressHolder.class));
- }
-
- /**
- * Constructor. Initializes the agent to serve on the URI provided by
- * {@link #getRobotUri()} and ensures that the agent is registered in the
- * Account store.
- */
- AbstractBaseRobotAgent(final String waveDomain, final AccountStore accountStore,
- final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder frontendAddressHolder) {
- this.waveDomain = waveDomain;
- this.accountStore = accountStore;
- this.frontendAddressHolder = frontendAddressHolder;
- ensureRegistered(tokenGenerator, getFrontEndAddress()); // NOPMD by vjrj on
- // 6/07/11 21:15
- }
-
- /**
- * Ensures that the robot agent is registered in the {@link AccountStore}.
- */
- private void ensureRegistered(final TokenGenerator tokenGenerator, final String serverFrontendAddress) {
- ParticipantId robotId = null;
- try {
- robotId = ParticipantId.of(getRobotId() + "@" + waveDomain);
- } catch (final InvalidParticipantAddress e) {
- LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
- return;
- }
- try {
- final String location = "http://" + serverFrontendAddress + getRobotUri();
- // Register this agent in the account store. The registration is forced
- // in order to re-register the agents if the server frontend address has
- // changed.
- final AccountData account = accountStore.getAccount(robotId);
- if ((account == null || (account != null && !account.asRobot().getUrl().equals(location)))) {
- RobotsUtil.registerRobotUri(location, robotId, accountStore, tokenGenerator, true);
- }
-
- } catch (final RobotRegistrationException e) {
- LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
- } catch (final PersistenceException e) {
- LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
- }
- }
-
- /**
- * Returns the account store.
- */
- protected AccountStore getAccountStore() {
- return accountStore;
- }
-
- public String getFrontEndAddress() {
- return frontendAddressHolder.getAddresses().get(0);
- }
-
- /**
- * Returns the robot participant id.
- */
- public abstract String getRobotId();
-
- @Override
- protected String getRobotProfilePageUrl() { // NOPMD by vjrj on 6/07/11 21:15
- return null;
- }
-
- /**
- * Returns the robot URI.
- */
- public abstract String getRobotUri();
-
- /**
- * Returns the wave domain.
- */
- public String getWaveDomain() {
- return waveDomain;
- }
-}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -47,18 +47,22 @@
*
* @author josephg(a)gmail.com (Joseph Gentle)
*/
+@SuppressWarnings("serial")
@Singleton
public final class CustomUserRegistrationServlet extends HttpServlet {
private final AccountStore accountStore;
private final String domain;
+ // private final WelcomeRobot welcomeBot;
private final Log LOG = Log.get(CustomUserRegistrationServlet.class);
@Inject
public CustomUserRegistrationServlet(AccountStore accountStore,
@Named(CoreSettings.WAVE_SERVER_DOMAIN) String domain) {
+ //, WelcomeRobot welcomeBot) {
this.accountStore = accountStore;
this.domain = domain;
+ // this.welcomeBot = welcomeBot;
}
@Override
@@ -113,14 +117,14 @@
if (id.getAddress().indexOf("@") < 1) {
return "Username portion of address cannot be empty";
}
- final String[] usernameSplit = id.getAddress().split("@");
+ String[] usernameSplit = id.getAddress().split("@");
if (usernameSplit.length != 2 || !usernameSplit[0].matches("[\\w\\.]+")) {
return "Only letters (a-z), numbers (0-9), and periods (.) are allowed in Username";
}
if (!id.getDomain().equals(domain)) {
return "You can only create users at the " + domain + " domain";
}
- } catch (final InvalidParticipantAddress e) {
+ } catch (InvalidParticipantAddress e) {
return "Invalid username";
}
@@ -128,7 +132,7 @@
if (accountStore.getAccount(id) != null) {
return "Account already exists";
}
- } catch (final PersistenceException e) {
+ } catch (PersistenceException e) {
LOG.severe("Failed to retreive account data for " + id, e);
return "An unexpected error occured while trying to retrieve account status";
}
@@ -137,16 +141,20 @@
new HumanAccountDataImpl(id, passwordDigest);
try {
accountStore.putAccount(account);
- } catch (final PersistenceException e) {
+ } catch (PersistenceException e) {
LOG.severe("Failed to create new account for " + id, e);
return "An unexpected error occured while trying to create the account";
}
-
+// try {
+ // welcomeBot.greet(account.getId());
+// } catch (IOException e) {
+// LOG.warning("Failed to create a welcome wavelet for " + id, e);
+// }
return null;
}
- private void writeRegistrationPage(final String message, final String responseType, final Locale locale,
- final HttpServletResponse dest) throws IOException {
+ private void writeRegistrationPage(String message, String responseType, Locale locale,
+ HttpServletResponse dest) throws IOException {
dest.setCharacterEncoding("UTF-8");
dest.setContentType("text/html;charset=utf-8");
UserRegistrationPage.write(dest.getWriter(), new GxpContext(locale), domain, message,
Modified: trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,8 +25,7 @@
import javax.annotation.Nonnull;
-import org.waveprotocol.box.server.persistence.AccountStore;
-import org.waveprotocol.wave.model.id.TokenGenerator;
+import org.waveprotocol.box.server.robots.agent.AbstractBaseRobotAgent;
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.id.WaveletId;
import org.waveprotocol.wave.model.wave.ParticipantId;
@@ -51,10 +50,11 @@
super(injector);
}
- public KuneAgent(final String waveDomain, final AccountStore accountStore,
- final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder frontendAddressHolder) {
- super(waveDomain, accountStore, tokenGenerator, frontendAddressHolder);
- }
+ // public KuneAgent(final String waveDomain, final AccountStore accountStore,
+ // final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder
+ // frontendAddressHolder) {
+ // super(waveDomain, accountStore, tokenGenerator, frontendAddressHolder);
+ // }
@Override
public void addGadget(final WaveRef waveName, final String author, final String gadgetUrl) {
Modified: trunk/src/main/java/cc/kune/wave/server/WaveMain.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -39,6 +39,7 @@
import org.waveprotocol.box.server.frontend.ClientFrontend;
import org.waveprotocol.box.server.frontend.ClientFrontendImpl;
import org.waveprotocol.box.server.frontend.WaveClientRpcImpl;
+import org.waveprotocol.box.server.frontend.WaveletInfo;
import org.waveprotocol.box.server.persistence.AccountStore;
import org.waveprotocol.box.server.persistence.PersistenceException;
import org.waveprotocol.box.server.persistence.PersistenceModule;
@@ -46,8 +47,6 @@
import org.waveprotocol.box.server.robots.RobotApiModule;
import org.waveprotocol.box.server.robots.RobotRegistrationServlet;
import org.waveprotocol.box.server.robots.active.ActiveApiServlet;
-import org.waveprotocol.box.server.robots.agent.passwd.PasswordAdminRobot;
-import org.waveprotocol.box.server.robots.agent.passwd.PasswordRobot;
import org.waveprotocol.box.server.robots.dataapi.DataApiOAuthServlet;
import org.waveprotocol.box.server.robots.dataapi.DataApiServlet;
import org.waveprotocol.box.server.robots.passive.RobotsGateway;
@@ -59,6 +58,7 @@
import org.waveprotocol.box.server.rpc.ServerRpcProvider;
import org.waveprotocol.box.server.rpc.SignOutServlet;
import org.waveprotocol.box.server.rpc.UserRegistrationServlet;
+import org.waveprotocol.box.server.rpc.WaveRefServlet;
import org.waveprotocol.box.server.waveserver.WaveBus;
import org.waveprotocol.box.server.waveserver.WaveServerException;
import org.waveprotocol.box.server.waveserver.WaveletProvider;
@@ -87,6 +87,13 @@
*/
public class WaveMain {
+ /**
+ * This is the name of the system property used to find the server config file.
+ */
+ private static final String PROPERTIES_FILE_KEY = "wave.server.config";
+
+ private static final Log LOG = Log.get(WaveMain.class);
+
@SuppressWarnings("serial")
@Singleton
public static class GadgetProxyServlet extends HttpServlet {
@@ -94,8 +101,8 @@
ProxyServlet.Transparent proxyServlet;
@Inject
- public GadgetProxyServlet((a)Named(CoreSettings.GADGET_SERVER_HOSTNAME) final String gadgetServerHostname,
- @Named(CoreSettings.GADGET_SERVER_PORT) final int gadgetServerPort){
+ public GadgetProxyServlet((a)Named(CoreSettings.GADGET_SERVER_HOSTNAME) String gadgetServerHostname,
+ @Named(CoreSettings.GADGET_SERVER_PORT) int gadgetServerPort){
LOG.info("Starting GadgetProxyServlet for " + gadgetServerHostname + ":" + gadgetServerPort);
proxyServlet = new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname,
@@ -103,82 +110,98 @@
}
@Override
- public void init(final ServletConfig config) throws ServletException {
+ public void init(ServletConfig config) throws ServletException {
proxyServlet.init(config);
}
@Override
- public void service(final ServletRequest req, final ServletResponse res) throws ServletException, IOException {
+ public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
proxyServlet.service(req, res);
}
}
- private static final Log LOG = Log.get(WaveMain.class);
+ public static void main(String... args) {
+ try {
+ Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
+ run(coreSettings);
+ return;
+ } catch (PersistenceException e) {
+ LOG.severe("PersistenceException when running server:", e);
+ } catch (ConfigurationException e) {
+ LOG.severe("ConfigurationException when running server:", e);
+ } catch (WaveServerException e) {
+ LOG.severe("WaveServerException when running server:", e);
+ }
+ }
- /**
- * This is the name of the system property used to find the server config file.
- */
- private static final String PROPERTIES_FILE_KEY = "wave.server.config";
+ public static void run(Module coreSettings) throws PersistenceException,
+ ConfigurationException, WaveServerException {
+ Injector settingsInjector = Guice.createInjector(coreSettings);
+ boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
+ Names.named(CoreSettings.ENABLE_FEDERATION)));
- private static Module buildFederationModule(final Injector settingsInjector, final boolean enableFederation)
- throws ConfigurationException {
- Module federationModule;
if (enableFederation) {
- federationModule = settingsInjector.getInstance(XmppFederationModule.class);
- } else {
- federationModule = settingsInjector.getInstance(NoOpFederationModule.class);
+ Module federationSettings =
+ SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class);
+ // This MUST happen first, or bindings will fail if federation is enabled.
+ settingsInjector = settingsInjector.createChildInjector(federationSettings);
}
- return federationModule;
- }
- private static void initializeFederation(final Injector injector) {
- final FederationTransport federationManager = injector.getInstance(FederationTransport.class);
- federationManager.startFederation();
- }
+ Module federationModule = buildFederationModule(settingsInjector, enableFederation);
+ PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
+ Injector injector =
+ settingsInjector.createChildInjector(new ServerModule(enableFederation),
+ new RobotApiModule(), federationModule, persistenceModule);
- private static void initializeFrontend(final Injector injector, final ServerRpcProvider server,
- final WaveBus waveBus) throws WaveServerException {
- final HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
+ ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
+ WaveBus waveBus = injector.getInstance(WaveBus.class);
- final WaveletProvider provider = injector.getInstance(WaveletProvider.class);
- final ClientFrontend frontend =
- ClientFrontendImpl.create(hashFactory, provider, waveBus);
+ String domain =
+ injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
+ if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
+ throw new WaveServerException("Invalid wave domain: " + domain);
+ }
- final ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
- server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
- }
+ initializeServer(injector, domain);
+ initializeServlets(injector, server);
+ initializeRobotAgents(injector, server);
+ initializeRobots(injector, waveBus);
+ initializeFrontend(injector, server, waveBus);
+ initializeFederation(injector);
- private static void initializeRobotAgents(final Injector injector, final ServerRpcProvider server) {
- final PasswordRobot passRobot = new PasswordRobot(injector);
- final PasswordAdminRobot passAdminRobot = new PasswordAdminRobot(injector);
- injector.injectMembers(passRobot);
- server.addServlet(PasswordRobot.ROBOT_URI + "/*", passRobot);
- server.addServlet(PasswordAdminRobot.ROBOT_URI + "/*", passAdminRobot);
+ LOG.info("Starting server");
+ server.startWebSocketServer(injector);
}
- private static void initializeRobots(final Injector injector, final WaveBus waveBus) {
- final RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
- waveBus.subscribe(robotsGateway);
+ private static Module buildFederationModule(Injector settingsInjector, boolean enableFederation)
+ throws ConfigurationException {
+ Module federationModule;
+ if (enableFederation) {
+ federationModule = settingsInjector.getInstance(XmppFederationModule.class);
+ } else {
+ federationModule = settingsInjector.getInstance(NoOpFederationModule.class);
+ }
+ return federationModule;
}
- private static void initializeServer(final Injector injector, final String waveDomain)
+ private static void initializeServer(Injector injector, String waveDomain)
throws PersistenceException, WaveServerException {
- final AccountStore accountStore = injector.getInstance(AccountStore.class);
+ AccountStore accountStore = injector.getInstance(AccountStore.class);
accountStore.initializeAccountStore();
AccountStoreHolder.init(accountStore, waveDomain);
// Initialize the SignerInfoStore.
- final CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
+ CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
if (certPathStore instanceof SignerInfoStore) {
((SignerInfoStore)certPathStore).initializeSignerInfoStore();
}
// Initialize the server.
- final WaveletProvider waveServer = injector.getInstance(WaveletProvider.class);
+ WaveletProvider waveServer = injector.getInstance(WaveletProvider.class);
waveServer.initialize();
}
- private static void initializeServlets(final Injector injector, final ServerRpcProvider server) {
+ private static void initializeServlets(Injector injector, ServerRpcProvider server) {
server.addServlet("/attachment/*", injector.getInstance(AttachmentServlet.class));
server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class));
@@ -194,69 +217,46 @@
server.addServlet("/robot/rpc", injector.getInstance(ActiveApiServlet.class));
server.addServlet("/webclient/remote_logging", injector.getInstance(RemoteLoggingServiceImpl.class));
server.addServlet("/profile/*", injector.getInstance(FetchProfilesServlet.class));
+ server.addServlet("/waveref/*", injector.getInstance(WaveRefServlet.class));
- final String gadgetHostName =
+ String gadgetHostName =
injector
.getInstance(Key.get(String.class, Names.named(CoreSettings.GADGET_SERVER_HOSTNAME)));
- final int port =
+ int port =
injector.getInstance(Key.get(Integer.class, Names.named(CoreSettings.GADGET_SERVER_PORT)));
- final Map<String, String> initParams =
+ Map<String, String> initParams =
Collections.singletonMap("HostHeader", gadgetHostName + ":" + port);
server.addServlet("/gadgets/*", injector.getInstance(GadgetProxyServlet.class), initParams);
//server.addServlet("/", injector.getInstance(WaveClientServlet.class));
}
- public static void main(final String... args) {
- try {
- final Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
- run(coreSettings);
- return;
- } catch (final PersistenceException e) {
- LOG.severe("PersistenceException when running server:", e);
- } catch (final ConfigurationException e) {
- LOG.severe("ConfigurationException when running server:", e);
- } catch (final WaveServerException e) {
- LOG.severe("WaveServerException when running server:", e);
- }
+ private static void initializeRobots(Injector injector, WaveBus waveBus) {
+ RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
+ waveBus.subscribe(robotsGateway);
}
- public static void run(final Module coreSettings) throws PersistenceException,
- ConfigurationException, WaveServerException {
- Injector settingsInjector = Guice.createInjector(coreSettings);
- final boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
- Names.named(CoreSettings.ENABLE_FEDERATION)));
+ private static void initializeRobotAgents(Injector injector, ServerRpcProvider server) {
+ //server.addServlet(PasswordRobot.ROBOT_URI + "/*", injector.getInstance(PasswordRobot.class));
+ //server.addServlet(PasswordAdminRobot.ROBOT_URI + "/*", injector.getInstance(PasswordAdminRobot.class));
+ //server.addServlet(WelcomeRobot.ROBOT_URI + "/*", injector.getInstance(WelcomeRobot.class));
+ }
- if (enableFederation) {
- final Module federationSettings =
- SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class);
- // This MUST happen first, or bindings will fail if federation is enabled.
- settingsInjector = settingsInjector.createChildInjector(federationSettings);
- }
+ private static void initializeFrontend(Injector injector, ServerRpcProvider server,
+ WaveBus waveBus) throws WaveServerException {
+ HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
- final Module federationModule = buildFederationModule(settingsInjector, enableFederation);
- final PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
- final Injector injector =
- settingsInjector.createChildInjector(new ServerModule(enableFederation),
- new RobotApiModule(), federationModule, persistenceModule);
+ WaveletProvider provider = injector.getInstance(WaveletProvider.class);
+ WaveletInfo waveletInfo = WaveletInfo.create(hashFactory, provider);
+ ClientFrontend frontend =
+ ClientFrontendImpl.create(provider, waveBus, waveletInfo);
- final ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
- final WaveBus waveBus = injector.getInstance(WaveBus.class);
+ ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
+ server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
+ }
- final String domain =
- injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
- if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
- throw new WaveServerException("Invalid wave domain: " + domain);
- }
-
- initializeServer(injector, domain);
- initializeServlets(injector, server);
- initializeRobotAgents(injector, server);
- initializeRobots(injector, waveBus);
- initializeFrontend(injector, server, waveBus);
- initializeFederation(injector);
-
- LOG.info("Starting server");
- server.startWebSocketServer(injector);
+ private static void initializeFederation(Injector injector) {
+ FederationTransport federationManager = injector.getInstance(FederationTransport.class);
+ federationManager.startFederation();
}
}
Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.UserService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.core.shared.dto.UserInfoDTO;
@@ -36,7 +36,7 @@
@Inject
KuneBasicProperties properties;
@Inject
- protected UserSession session;
+ protected UserSessionManager session;
protected String token;
@Inject
UserService userService;
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -21,8 +21,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.events.EventFiringWebDriver;
+import org.openqa.selenium.support.events.WebDriverEventListener;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import org.testng.Assert;
import org.testng.ITestContext;
@@ -51,6 +55,96 @@
webdriver = injector.getInstance(GenericWebDriver.class);
login = injector.getInstance(LoginPageObject.class);
eventFiring = injector.getInstance(EventFiringWebDriver.class);
+ eventFiring.register(new WebDriverEventListener() {
+
+ @Override
+ public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterClickOn(final WebElement element, final WebDriver driver) {
+ sleep(500);
+ }
+
+ @Override
+ public void afterFindBy(final By by, final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterNavigateBack(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterNavigateForward(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterNavigateTo(final String url, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterScript(final String script, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeChangeValueOf(final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeClickOn(final WebElement element, final WebDriver driver) {
+ sleep(500);
+ }
+
+ @Override
+ public void beforeFindBy(final By by, final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeNavigateBack(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeNavigateForward(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeNavigateTo(final String url, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeScript(final String script, final WebDriver driver) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onException(final Throwable throwable, final WebDriver driver) {
+ // TODO Auto-generated method stub
+
+ }
+ });
final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
PageFactory.initElements(locator, login);
}
Modified: trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -36,7 +36,6 @@
public abstract class AbstractWebDriver implements WebDriver {
private final String baseUrl;
private final WebDriver driver;
-
private final Selenium selenium;
public AbstractWebDriver(final WebDriver driver, final String baseUrl) {
@@ -44,6 +43,8 @@
this.baseUrl = baseUrl;
selenium = new WebDriverBackedSelenium(driver, baseUrl);
selenium.setSpeed("500");
+ // driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
+
// selenium.setTimeout("5000");
}
Modified: trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -31,13 +31,12 @@
import org.waveprotocol.box.server.account.RobotAccountData;
import org.waveprotocol.box.server.persistence.AccountStore;
import org.waveprotocol.box.server.persistence.PersistenceException;
+import org.waveprotocol.box.server.robots.agent.AbstractBaseRobotAgent.ServerFrontendAddressHolder;
import org.waveprotocol.wave.model.id.TokenGenerator;
import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.wave.server.AbstractBaseRobotAgent.ServerFrontendAddressHolder;
-
import com.google.common.collect.Lists;
import com.google.wave.api.Wavelet;
@@ -67,7 +66,8 @@
Mockito.when(accountRobotData.getUrl()).thenReturn(KuneAgent.ROBOT_URI);
Mockito.when(accountRobotData.getId()).thenReturn(participantId);
Mockito.when(accountRobotData.getConsumerSecret()).thenReturn("someconsumer");
- manager = new KuneAgent("example.com", accountStore, tokenGenerator, frontendAddressHolder);
+ // manager = new KuneAgent("example.com", accountStore, tokenGenerator,
+ // frontendAddressHolder);
}
private String getSiteAdminShortName() {
1
0