[kune-commits] r1085 - in
trunk/src/main/java/org/ourproject/kune/platf/client/ui: .
dialogs/tabbed rte/basic rte/insertlink/email rte/insertlink/ext
vjrj
vjrj at ourproject.org
Mon Mar 23 22:21:48 CET 2009
Author: vjrj
Date: 2009-03-23 22:21:45 +0100 (Mon, 23 Mar 2009)
New Revision: 1085
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
Log:
Incomplete - task RTE Create/Edit link improved
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -27,7 +27,7 @@
public static final String IN_DEVELOPMENT = "In development";
// Original regexp from http://snippets.dzone.com/posts/show/452
- public static final String URL_REGEXP = "((ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
+ public static final String URL_REGEXP = "((ftp|http|https|mailto):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
// Original regexp from http://www.regular-expressions.info/email.html
public static final String EMAIL_REGEXP = "[-!#$%&\'*+/=?_`{|}~a-z0-9^]+(\\.[-!#$%&\'*+/=?_`{|}~a-z0-9^]+)*@(localhost|([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z0-9]([-a-z0-9]*[a-z0-9]))?";
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -28,6 +28,8 @@
public void setErrorMessage(String message, Level level);
+ void activateTab(int index);
+
void addTab(View view);
void show();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -36,7 +36,7 @@
import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.event.WindowListenerAdapter;
-public abstract class AbstractTabbedDialogPanel {
+public abstract class AbstractTabbedDialogPanel implements AbstractTabbedDialogView {
private BasicDialog dialog;
private final String dialogId;
private TabPanel tabPanel;
@@ -67,6 +67,11 @@
buttons = new ArrayList<Button>();
}
+ public void activateTab(int index) {
+ createDialogIfNecessary();
+ tabPanel.activate(index);
+ }
+
/**
* User before show/render
*
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -22,10 +22,14 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-public abstract class AbstractTabbedDialogPresenter {
+public abstract class AbstractTabbedDialogPresenter implements AbstractTabbedDialog {
private AbstractTabbedDialogView view;
+ public void activateTab(int index) {
+ view.activateTab(index);
+ }
+
public void addTab(View tab) {
view.addTab(tab);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -24,6 +24,8 @@
public interface AbstractTabbedDialogView extends View {
+ void activateTab(int index);
+
void addTab(View tab);
void createAndShow();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -603,9 +603,18 @@
}
};
}
- insertElement.setLinkInfo(view.getLinkInfoIfHref());
+ LinkInfo linkInfo = view.getLinkInfoIfHref();
+ insertElement.setLinkInfo(linkInfo);
insertElement.setOnCreateLink(insertLinkListener);
insertElement.show();
+ String href = linkInfo.getHref();
+ if (href.length() > 0) {
+ if (href.startsWith("mailto")) {
+ insertElement.activateTab(2);
+ } else {
+ insertElement.activateTab(1);
+ }
+ }
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -43,8 +43,11 @@
@Override
protected void updateValues(LinkInfo linkInfo) {
super.updateValues(linkInfo);
- if (!linkInfo.getHref().startsWith("mailto")) {
+ String href = linkInfo.getHref();
+ if (!href.startsWith("mailto")) {
hrefField.reset();
+ } else {
+ hrefField.setValue(href.replaceFirst("mailto:\\/\\/", ""));
}
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -88,7 +88,11 @@
if (href != null && !href.equals("")) {
String hrefValue = hrefField.getRawValue();
if (hrefValue != null && hrefValue.length() == 0) {
- hrefField.setValue(href);
+ if (href.startsWith("mailto")) {
+ hrefField.reset();
+ } else {
+ hrefField.setValue(href);
+ }
}
}
}
More information about the kune-commits
mailing list