[kune-commits] r797 - in trunk/src/main/java/org/ourproject/kune: app/public/css platf/client/services workspace/client/ui/newtmp/sitebar workspace/client/ui/newtmp/sitebar/sitelogo workspace/client/ui/newtmp/sitebar/sitesearch

vjrj vjrj at ourproject.org
Thu Jul 10 23:06:25 CEST 2008


Author: vjrj
Date: 2008-07-10 23:06:19 +0200 (Thu, 10 Jul 2008)
New Revision: 797

Added:
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java
Modified:
   trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
Log:
Workspace refactorization

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2008-07-10 21:06:19 UTC (rev 797)
@@ -2,10 +2,55 @@
     background: #FFF none repeat scroll 0% 50%;
 }
 
+.k-sitebar .kune-IconHyperlink {
+  white-space: nowrap;
+}
+
+.k-sitebar .kune-IconHyperlink a:link {
+  cursor: pointer;
+  text-decoration: underline;
+  color: #B3B3B3;
+}
+
+.k-sitebar .kune-IconHyperlink a:hover {
+  text-decoration: underline;
+}
+
+.k-sitebar .kune-IconHyperlink a:visited {
+  color: #B3B3B3;
+}
+
 .k-sitebar {
-    white-space: nowrap;
+  margin-right: 10px;
+  height: 16px;
 }
 
+.k-sitebar .gwt-TextBox {
+  border: 1px solid #E4A374;
+  margin: 0 15px 0 3px;
+  padding-left: 3px;
+  color: #B3B3B3;
+}
+
+.k-sitebar .gwt-Hyperlink a {
+  white-space: nowrap;
+  color: #B3B3B3;
+  text-decoration: underline;
+  cursor: pointer;
+}
+
+.k-sitebar .gwt-PushButton {
+  cursor: pointer;
+}
+
+.k-sitebar-LabelLink {
+  white-space: nowrap;
+  color: #B3B3B3;
+  margin-left: 3px;
+  cursor: pointer;
+  text-decoration: underline;
+}
+
 .k-entity-summary {
     border-left-color: #FFF;
     border-left-width: 5px;

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-07-10 21:06:19 UTC (rev 797)
@@ -26,6 +26,9 @@
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearch;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPresenter;
 import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
 import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
 import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -134,6 +137,16 @@
 	    }
 	}, SingletonScope.class);
 
+	builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
+	    public SiteSearch get() {
+		final SiteSearchPresenter presenter = new SiteSearchPresenter();
+		final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
+		presenter.init(panel);
+		return presenter;
+	    }
+	}, SingletonScope.class);
+
+	builder.getInstance(SiteSearch.class);
 	builder.getInstance(SiteLogo.class);
 
 	builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java	2008-07-10 21:06:19 UTC (rev 797)
@@ -1,5 +1,6 @@
 package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
 
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.SiteBar;
 import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
 
 import com.google.gwt.user.client.ui.Image;
@@ -10,7 +11,10 @@
 
     public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
 	siteLogoImg = new Image();
-	ws.getSiteBar().add(siteLogoImg);
+	final SiteBar siteBar = ws.getSiteBar();
+	siteBar.addSpacer();
+	siteBar.addSpacer();
+	siteBar.add(siteLogoImg);
     }
 
     public void setSiteLogoUrl(final String siteLogoUrl) {

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java	2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+public interface SiteSearch {
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java	2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,95 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.SiteBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FocusListener;
+import com.google.gwt.user.client.ui.KeyboardListener;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.TextBox;
+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 final PushButton searchButton;
+    private final TextBox searchTextBox;
+    private final I18nUITranslationService i18n;
+
+    public SiteSearchPanel(final SiteSearchPresenter presenter, final WorkspaceSkeleton ws,
+	    final I18nUITranslationService i18n) {
+	this.i18n = i18n;
+	final Images img = Images.App.getInstance();
+	final SiteBar siteBar = ws.getSiteBar();
+	siteBar.addSpacer();
+	siteBar.addSpacer();
+	searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
+	searchTextBox = new TextBox();
+
+	siteBar.add(searchButton);
+	siteBar.addSpacer();
+	siteBar.add(searchTextBox);
+	siteBar.addSpacer();
+
+	setTextSearchSmall();
+	setDefaultTextSearch();
+	searchTextBox.addFocusListener(new FocusListener() {
+	    public void onFocus(final Widget arg0) {
+		presenter.onSearchFocus();
+	    }
+
+	    public void onLostFocus(final Widget arg0) {
+		presenter.onSearchLostFocus(searchTextBox.getText());
+	    }
+	});
+
+	searchButton.addClickListener(new ClickListener() {
+	    public void onClick(final Widget arg0) {
+		Site.showProgressProcessing();
+		presenter.doSearch(searchTextBox.getText());
+	    }
+	});
+
+	searchTextBox.addKeyboardListener(new KeyboardListener() {
+	    public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
+	    }
+
+	    public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
+	    }
+
+	    public void onKeyUp(final Widget widget, final char key, final int mod) {
+		if (key == KEY_ENTER) {
+		    if (searchTextBox.getText().length() > 0) {
+			Site.showProgressProcessing();
+			presenter.doSearch(searchTextBox.getText());
+		    }
+		}
+	    }
+	});
+    }
+
+    public void clearSearchText() {
+	searchTextBox.setText("");
+    }
+
+    public void setDefaultTextSearch() {
+	searchTextBox.setText(i18n.t("Search"));
+    }
+
+    public void setSearchText(final String text) {
+	searchTextBox.setText(text);
+    }
+
+    public void setTextSearchBig() {
+	searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
+    }
+
+    public void setTextSearchSmall() {
+	searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java	2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.View;
+
+public class SiteSearchPresenter implements SiteSearch {
+
+    private SiteSearchView view;
+
+    public SiteSearchPresenter() {
+    }
+
+    public void doSearch(final String termToSearch) {
+	// TODO
+    }
+
+    public View getView() {
+	return view;
+    }
+
+    public void init(final SiteSearchView view) {
+	this.view = view;
+    }
+
+    public void onSearchFocus() {
+	view.setTextSearchBig();
+	view.clearSearchText();
+    }
+
+    public void onSearchLostFocus(final String search) {
+	if (search.length() == 0) {
+	    view.setDefaultTextSearch();
+	    view.setTextSearchSmall();
+	}
+    }
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java	2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java	2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteSearchView extends View {
+
+    void clearSearchText();
+
+    void setDefaultTextSearch();
+
+    void setTextSearchBig();
+
+    void setTextSearchSmall();
+}




More information about the kune-commits mailing list