[kune-commits] r836 - in trunk/src: main/java/org/ourproject/kune/platf/client/services main/java/org/ourproject/kune/platf/public/images main/java/org/ourproject/kune/workspace/client/i18n/ui main/java/org/ourproject/kune/workspace/client/socialnet main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel test/java/org/ourproject/kune/platf/integration

vjrj vjrj at ourproject.org
Sat Aug 9 01:16:16 CEST 2008


Author: vjrj
Date: 2008-08-09 01:16:06 +0200 (Sat, 09 Aug 2008)
New Revision: 836

Added:
   trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.gif
   trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.png
   trunk/src/main/java/org/ourproject/kune/platf/public/images/group-def-icon.gif
   trunk/src/main/java/org/ourproject/kune/platf/public/images/kune-preferences.gif
   trunk/src/main/java/org/ourproject/kune/platf/public/images/kuneicon16.gif
Removed:
   trunk/src/main/java/org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif
Modified:
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
Log:
Complete - task 23: SiteBar Menus (options, user menu) 


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-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -632,6 +632,12 @@
 	    }
 	});
 
+	$(StateManager.class).addSiteToken(SiteToken.translate.toString(), new Slot<StateToken>() {
+	    public void onEvent(final StateToken previousStateToken) {
+		$(I18nTranslator.class).doShowTranslator();
+	    }
+	});
+
 	final KunePlatform platform = $(KunePlatform.class);
 	$(Application.class).init(platform.getIndexedTools());
 	$(Application.class).subscribeActions(platform.getActions());

Copied: trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.gif (from rev 827, trunk/src/main/java/org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif)
===================================================================
(Binary files differ)

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: trunk/src/main/java/org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif
===================================================================
(Binary files differ)

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/group-def-icon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/group-def-icon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/kune-preferences.gif
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/kune-preferences.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/kuneicon16.gif
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/kuneicon16.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -171,7 +171,7 @@
 	unTransCenterPanel.add(unTransGrid);
 	transCenterPanel.add(transGrid);
 	final Frame recommFrame = new Frame("html/i18n-recom.html");
-	// recommFrame.setHeight("220");
+	recommFrame.setHeight("auto");
 	recommendationPanel.add(recommFrame);
 
 	center.add(unTransCenterPanel);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -136,20 +136,23 @@
     private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {
 	final CustomMenu<GroupDTO> menu = new CustomMenu<GroupDTO>(group);
 	final String longName = group.getLongName();
-	final String toolTip = i18n.t(group.getType().equals(GroupType.PERSONAL) ? "User nickname: [%s]"
-		: "Group short name: [%s]", group.getShortName());
-	final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageUtils
-		.getImageHtml(ImageDescriptor.groupDefIcon), longName, longName, " ", longName, toolTip, menu);
-	if (!group.getType().equals(GroupType.PERSONAL)) {
+	boolean isPersonal = group.getType().equals(GroupType.PERSONAL);
+	final String toolTip = i18n.t(isPersonal ? "User nickname: [%s]" : "Group short name: [%s]", group
+		.getShortName());
+	final String imageHtml = isPersonal ? imageUtils.getImageHtml(ImageDescriptor.personDef) : imageUtils
+		.getImageHtml(ImageDescriptor.groupDefIcon);
+	final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageHtml,
+		longName, longName, " ", longName, toolTip, menu);
+	if (!isPersonal) {
 	    menu.addMenuItemList(otherOperations);
 	}
-	if (session.isLogged() && !group.getType().equals(GroupType.PERSONAL)) {
+	if (session.isLogged() && !isPersonal) {
 	    menu.addMenuItemList(otherLoggedOperations);
 	}
-	if (group.getType().equals(GroupType.PERSONAL)) {
+	if (isPersonal) {
 	    menu.addMenuItemList(otherOperationsUsers);
 	}
-	if (session.isLogged() && group.getType().equals(GroupType.PERSONAL)) {
+	if (session.isLogged() && isPersonal) {
 	    menu.addMenuItemList(otherLoggedOperationsUsers);
 	}
 

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -16,6 +16,5 @@
 	ws.getSiteBar().addSeparator();
 	ws.getSiteBar().add(newGroupHyperlink);
 	ws.getSiteBar().addSpacer();
-	ws.getSiteBar().addSpacer();
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -20,10 +20,14 @@
     public SiteOptionsPanel(final SiteOptionsPresenter presenter, final WorkspaceSkeleton ws,
 	    final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider) {
 	final PushButton optionsButton = new PushButton("");
-	optionsButton.setText(i18n.t("Options"));
+	// optionsButton.setText(i18n.t("Options"));
+	optionsButton.setHTML("<div style=\"text-align: center;\">" + i18n.t("Options")
+		+ "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" /></div>");
 	optionsButton.setStyleName("k-sitebar-labellink");
 	ws.getSiteBar().addSeparator();
 	ws.getSiteBar().add(optionsButton);
+	ws.getSiteBar().addSpacer();
+	ws.getSiteBar().addSpacer();
 	final Menu optionsMenu = new Menu();
 	optionsButton.addClickListener(new ClickListener() {
 	    public void onClick(final Widget sender) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -15,6 +15,7 @@
 	signInHyperlink.setText(i18n.t("Sign in to collaborate"));
 	signInHyperlink.setTargetHistoryToken(SiteToken.signin.toString());
 	ws.getSiteBar().add(signInHyperlink);
+	ws.getSiteBar().addSpacer();
     }
 
     public void setVisible(final boolean visible) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -35,7 +35,7 @@
 	    }
 	});
 	final Item userPreferences = new Item(i18n.t("Your preferences"));
-	userPreferences.setIcon("");
+	userPreferences.setIcon("images/kune-preferences.gif");
 	userPreferences.addListener(new BaseItemListenerAdapter() {
 	    @Override
 	    public void onClick(final BaseItem item, final EventObject e) {
@@ -51,7 +51,8 @@
     }
 
     public void setLoggedUserName(final String name) {
-	loggedUserMenu.setText(name);
+	loggedUserMenu.setHTML("<div style=\"text-align: center;\">" + name
+		+ "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" /></div>");
     }
 
     public void setParticipation(final MenuItemCollection<GroupDTO> participateInGroups) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -47,11 +47,12 @@
     }
 
     private void addPartipation(final GroupDTO group) {
-	participateInGroups.add(new MenuItem<GroupDTO>("", group.getShortName(), new Slot<GroupDTO>() {
-	    public void onEvent(final GroupDTO param) {
-		stateManager.gotoToken(group.getShortName());
-	    }
-	}));
+	participateInGroups.add(new MenuItem<GroupDTO>("images/group-def-icon.gif", group.getShortName(),
+		new Slot<GroupDTO>() {
+		    public void onEvent(final GroupDTO param) {
+			stateManager.gotoToken(group.getShortName());
+		    }
+		}));
     }
 
     private void onUserSignIn(final UserInfoDTO userInfoDTO) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -39,9 +39,7 @@
 
     public void addInTools(final Widget widget) {
 	entityTools.add(widget);
-	entityTools.expand();
-	// entitySummary.expand();
-	mainPanel.syncSize();
+	entityTools.render(widget.getElement());
 	if (entityTools.isRendered()) {
 	    entityTools.doLayout(false);
 	}

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java	2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java	2008-08-08 23:16:06 UTC (rev 836)
@@ -25,7 +25,7 @@
 			bindScope(SessionScoped.class, Scopes.SINGLETON);
 			// test: use memory
 			// test_db: use mysql
-			bindConstant().annotatedWith(JpaUnit.class).to("test_db");
+			bindConstant().annotatedWith(JpaUnit.class).to("test");
 			bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
 			bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
 		    }




More information about the kune-commits mailing list