[kune-commits] r964 - in trunk/src/main/java/org/ourproject/kune: platf/server/manager/impl workspace/client/cxt workspace/client/sitebar/sitesearch workspace/client/skel workspace/client/tags workspace/client/title

vjrj vjrj at ourproject.org
Mon Nov 24 12:50:00 CET 2008


Author: vjrj
Date: 2008-11-24 12:49:57 +0100 (Mon, 24 Nov 2008)
New Revision: 964

Modified:
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
Log:
Incomplete - task Use of new ActionDescriptionClass in SocialNetwork

SiteSearch adjusts, EntitySummary UI expand fixes


Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -178,7 +178,7 @@
                 }
                 break;
             case yourbuddies:
-                if (!userBuddies.contains(userLogged.getShortName())) {
+                if (userLogged != userGroup && !userBuddies.contains(userLogged.getShortName())) {
                     socialNetData.setIsBuddiesVisible(false);
                     socialNetData.setUserBuddies(UserBuddiesData.EMPTY);
                 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -35,6 +35,7 @@
 import com.calclab.suco.client.ioc.Provider;
 import com.google.gwt.user.client.ui.ScrollPanel;
 import com.google.gwt.user.client.ui.VerticalPanel;
+import com.gwtext.client.core.EventObject;
 import com.gwtext.client.data.Record;
 import com.gwtext.client.widgets.form.ComboBox;
 import com.gwtext.client.widgets.form.DateField;
@@ -66,9 +67,8 @@
     private ContextPropertyPanel aclComponent;
     private AccessListsPanel accessListsPanel;
 
-    public ContextPropEditorPanel(final ContextPropEditorPresenter presenter,
-            final I18nTranslationService i18n, WorkspaceSkeleton ws, Provider<LanguageSelector> langSelectorProv,
-            Images images) {
+    public ContextPropEditorPanel(final ContextPropEditorPresenter presenter, final I18nTranslationService i18n,
+            WorkspaceSkeleton ws, Provider<LanguageSelector> langSelectorProv, Images images) {
         this.i18n = i18n;
         this.ws = ws;
         this.presenter = presenter;
@@ -243,19 +243,24 @@
         tagsField = new TextArea();
         tagsField.setWidth(FORMS_WIDTH - 10);
         tagsField.setHeight("3em");
+        tagsField.setEnterIsSpecial(true);
         tagsField.addListener(new FieldListenerAdapter() {
             @Override
             public void onChange(final Field field, final Object newVal, final Object oldVal) {
                 presenter.setTags((String) newVal);
             }
         });
+        tagsField.addListener(new FieldListenerAdapter() {
+            @Override
+            public void onSpecialKey(final Field field, final EventObject e) {
+                if (e.getKey() == 13) {
+                    presenter.setTags(tagsField.getRawValue());
+                    e.stopEvent();
+                }
+            }
+        });
         form.add(tagsField);
         return new ContextPropertyPanel(i18n.t("Tags"), i18n.t("Keywords or terms associated with this work"), true,
                 TAGS_PROP, form);
     }
-
-    // private void removeComponent(final String header) {
-    // options.removeStackItem(header);
-    // }
-
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -32,19 +32,21 @@
 import com.google.gwt.user.client.ui.Widget;
 
 public class SiteSearchPanel implements SiteSearchView {
-    private static final String SEARCH_TEXT_WIDTH_SMALL = "120";
-    private static final String SEARCH_TEXT_WIDTH_BIG = "180";
-    private static final String SITE_SEARCH_BUTTON = "kune-ssp-bt";
-    private static final String SITE_SEARCH_TEXTBOX = "kune-ssp-tb";
+    private static final int SEARCH_TEXT_HEIGHT = 15;
+    private static final int SEARCH_TEXT_WIDTH_SMALL = 120;
+    private static final int SEARCH_TEXT_WIDTH_BIG = 180;
+    public static final String SITE_SEARCH_BUTTON = "kune-ssp-searchbt";
+    public static final String SITE_SEARCH_TEXTBOX = "kune-ssp-tbox";
 
     private final PushButton searchButton;
     private final TextBox searchTextBox;
     private final I18nUITranslationService i18n;
+    private final SimpleToolbar siteBar;
 
     public SiteSearchPanel(final SiteSearchPresenter presenter, final WorkspaceSkeleton ws,
             final I18nUITranslationService i18n, Images img) {
         this.i18n = i18n;
-        final SimpleToolbar siteBar = ws.getSiteBar();
+        siteBar = ws.getSiteBar();
         siteBar.addSpacer();
         siteBar.addSpacer();
         searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
@@ -98,6 +100,10 @@
         searchTextBox.setText("");
     }
 
+    public void selectSearchText() {
+        searchTextBox.selectAll();
+    }
+
     public void setDefaultTextSearch() {
         searchTextBox.setText(i18n.t("Search"));
     }
@@ -107,10 +113,10 @@
     }
 
     public void setTextSearchBig() {
-        searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
+        searchTextBox.setPixelSize(SEARCH_TEXT_WIDTH_BIG, 15);
     }
 
     public void setTextSearchSmall() {
-        searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
+        searchTextBox.setPixelSize(SEARCH_TEXT_WIDTH_SMALL, SEARCH_TEXT_HEIGHT);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -34,6 +34,7 @@
 
     public void doSearch(final String termToSearch) {
         provider.get().doSearch(termToSearch);
+        view.setTextSearchSmall();
     }
 
     public View getView() {
@@ -46,7 +47,7 @@
 
     public void onSearchFocus() {
         view.setTextSearchBig();
-        view.clearSearchText();
+        view.selectSearchText();
     }
 
     public void onSearchLostFocus(final String search) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -24,6 +24,8 @@
 
     void clearSearchText();
 
+    void selectSearchText();
+
     void setDefaultTextSearch();
 
     void setTextSearchBig();

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -72,6 +72,10 @@
         childPanel.clear();
     }
 
+    public void setCellWidth(Widget widget, String width) {
+        childPanel.setCellWidth(widget, width);
+    }
+
     public void setCleanStyle() {
         setStyleName("x-toolbar");
         addStyleName("x-panel");

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -53,7 +53,6 @@
 
     public void addInSummary() {
         ws.addInSummary(this);
-        // this.expand();
         doLayoutIfNeeded();
     }
 
@@ -65,6 +64,11 @@
     }
 
     @Override
+    public void expand() {
+        super.expand();
+    }
+
+    @Override
     public void setVisible(final boolean visible) {
         super.setVisible(visible);
         doLayoutIfNeeded();

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -81,6 +81,7 @@
 
     public void setGroupTags(final TagCloudResultDTO tagCloud) {
         setCloud(tagCloud);
+        view.expand();
     }
 
     void setState(final StateContainerDTO state) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -28,6 +28,8 @@
 
     void clear();
 
+    void expand();
+
     void setTheme(WsTheme oldTheme, WsTheme newTheme);
 
     void setVisible(boolean visible);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2008-11-22 19:18:43 UTC (rev 963)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2008-11-24 11:49:57 UTC (rev 964)
@@ -88,17 +88,22 @@
     }
 
     public void setContentDate(final Date publishedOn) {
-        String dateFormat = session.getCurrentLanguage().getDateFormat();
-        final DateTimeFormat fmt;
-        if (dateFormat == null) {
-            fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+        if (publishedOn != null) {
+            String dateFormat = session.getCurrentLanguage().getDateFormat();
+            final DateTimeFormat fmt;
+            if (dateFormat == null) {
+                fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+            } else {
+                String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(publishedOn);
+                String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
+                dateFormat = dateFormat.replaceFirst("MMM", "'" + i18n.t(monthToTranslate) + "'");
+                fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+            }
+            view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
+            setContentDateVisible(true);
         } else {
-            String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(publishedOn);
-            String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
-            dateFormat = dateFormat.replaceFirst("MMM", "'" + i18n.t(monthToTranslate) + "'");
-            fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+            setContentDateVisible(false);
         }
-        view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
     }
 
     /**
@@ -164,12 +169,7 @@
         setContentTitle(state.getTitle(), state.getContentRights().isEditable()
                 && renamableContentRegistry.contains(state.getTypeId()));
         Date publishedOn = state.getPublishedOn();
-        if (publishedOn != null) {
-            setContentDateVisible(true);
-            setContentDate(publishedOn);
-        } else {
-            setContentDateVisible(false);
-        }
+        setContentDate(publishedOn);
         final String contentTypeIcon = iconsRegistry.getContentTypeIcon(state.getTypeId(), state.getMimeType());
         setIcon(contentTypeIcon);
         view.setContentTitleVisible(true);




More information about the kune-commits mailing list