r816 - in trunk/src: main/java/org/ourproject/kune/platf/client/app main/java/org/ourproject/kune/platf/client/services main/java/org/ourproject/kune/platf/client/ui main/java/org/ourproject/kune/platf/client/ui/gridmenu main/java/org/ourproject/kune/workspace/client main/java/org/ourproject/kune/workspace/client/actions main/java/org/ourproject/kune/workspace/client/newgroup main/java/org/ourproject/kune/workspace/client/newgroup/ui main/java/org/ourproject/kune/workspace/client/presence/ui
Author: vjrj Date: 2008-07-26 18:44:17 +0200 (Sat, 26 Jul 2008) New Revision: 816 Added: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java Removed: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddGroupLiveSearchAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddUserLiveSearchAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchView.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearchPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanelNew.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryViewNew.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearchPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearchPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearchPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearchComponent.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearchComponent.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearchComponent.java Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java Log: Workspace refactorization Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-07-26 16:44:17 UTC (rev 816) @@ -29,7 +29,6 @@ import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager; import org.ourproject.kune.platf.client.rpc.SiteService; import org.ourproject.kune.platf.client.rpc.SiteServiceAsync; -import org.ourproject.kune.platf.client.services.ColorTheme; import org.ourproject.kune.platf.client.services.I18nTranslationService; import org.ourproject.kune.platf.client.services.KuneErrorHandler; import org.ourproject.kune.platf.client.state.Session; @@ -58,11 +57,10 @@ private StateManager stateManager; public ApplicationDefault(final Session session, final ExtensibleWidgetsManager extensionPointManager, - final I18nTranslationService i18n, final ColorTheme colorTheme, final KuneErrorHandler errorHandler, - final WorkspaceSkeleton ws) { + final I18nTranslationService i18n, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) { this.session = session; this.ws = ws; - workspace = WorkspaceFactory.createWorkspace(session, extensionPointManager, i18n, colorTheme, errorHandler); + workspace = WorkspaceFactory.createWorkspace(session, extensionPointManager, i18n, errorHandler); tools = new HashMap<String, ClientTool>(); this.onApplicationStart = new Signal<Object>("onApplicationStart"); this.onApplicationStop = new Signal<Object>("onApplicationStop"); 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-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-26 16:44:17 UTC (rev 816) @@ -43,12 +43,17 @@ import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView; import org.ourproject.kune.workspace.client.sitebar.rpc.UserService; import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync; -import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanelNew; -import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenterNew; -import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryViewNew; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView; +import org.ourproject.kune.workspace.client.socialnet.GroupLiveSearcherPresenter; +import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel; +import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter; +import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView; import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter; import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView; +import org.ourproject.kune.workspace.client.socialnet.UserLiveSearcherPresenter; +import org.ourproject.kune.workspace.client.socialnet.ui.GroupLiveSearchPanel; import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationSummaryPanel; +import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearcherPanel; import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter; import org.ourproject.kune.workspace.client.summary.GroupSummaryView; import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel; @@ -87,10 +92,12 @@ import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter; import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel; import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter; +import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher; import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary; import org.ourproject.kune.workspace.client.workspace.GroupSummary; import org.ourproject.kune.workspace.client.workspace.ParticipationSummary; import org.ourproject.kune.workspace.client.workspace.TagsSummary; +import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher; import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo; import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel; @@ -196,12 +203,6 @@ final KuneErrorHandler errorHandler = i(KuneErrorHandler.class); AsyncCallbackSimple.init(errorHandler); - builder.registerProvider(ColorTheme.class, new Provider<ColorTheme>() { - public ColorTheme get() { - return new ColorTheme(); - } - }, SingletonScope.class); - builder.registerProvider(KunePlatform.class, new Provider<KunePlatform>() { public KunePlatform get() { return new KunePlatform(); @@ -220,10 +221,8 @@ builder.registerProvider(Application.class, new Provider<Application>() { public Application get() { final Session session = i(Session.class); - final ExtensibleWidgetsManager extensionPointManager = builder - .getInstance(ExtensibleWidgetsManager.class); - return new ApplicationDefault(session, extensionPointManager, i18n, builder - .getInstance(ColorTheme.class), i(KuneErrorHandler.class), ws); + final ExtensibleWidgetsManager extensionPointManager = i(ExtensibleWidgetsManager.class); + return new ApplicationDefault(session, extensionPointManager, i18n, i(KuneErrorHandler.class), ws); } }, SingletonScope.class); @@ -239,8 +238,7 @@ builder.registerProvider(SiteProgress.class, new Provider<SiteProgress>() { public SiteProgress get() { final SiteProgressPresenter presenter = new SiteProgressPresenter(); - final SiteProgressPanel panel = new SiteProgressPanel(presenter, builder - .getProvider(SitePublicSpaceLink.class)); + final SiteProgressPanel panel = new SiteProgressPanel(presenter, p(SitePublicSpaceLink.class)); presenter.init(panel); return presenter; } @@ -330,8 +328,8 @@ builder.registerProvider(SignIn.class, new Provider<SignIn>() { public SignIn get() { - final SignInPresenter presenter = new SignInPresenter(i(Session.class), builder - .getInstance(StateManager.class), i18n, i(UserServiceAsync.class)); + final SignInPresenter presenter = new SignInPresenter(i(Session.class), i(StateManager.class), i18n, + i(UserServiceAsync.class)); final SignInPanel view = new SignInPanel(presenter, i18n, ws); presenter.init(view); return presenter; @@ -358,6 +356,7 @@ }, SingletonScope.class); i(SitePublicSpaceLink.class); + i(SiteMessage.class); i(SiteSignInLink.class); i(SiteSignOutLink.class); i(SiteNewGroupLink.class); @@ -381,8 +380,7 @@ builder.registerProvider(EntityTitlePresenter.class, new Provider<EntityTitlePresenter>() { public EntityTitlePresenter get() { - final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, builder - .getInstance(KuneErrorHandler.class)); + final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, i(KuneErrorHandler.class)); final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter); presenter.init(panel); return presenter; @@ -410,11 +408,9 @@ builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() { public WorkspaceManager get() { final WorkspaceManager presenter = new WorkspaceManager(i(SitePublicSpaceLink.class), - i(EntityLogo.class), i(EntityTitlePresenter.class), builder - .getInstance(EntitySubTitlePresenter.class), builder - .getInstance(WsThemePresenter.class), i(EntityLicensePresenter.class), builder - .getProvider(GroupMembersSummary.class), builder - .getProvider(ParticipationSummary.class), p(TagsSummary.class), p(GroupSummary.class)); + i(EntityLogo.class), i(EntityTitlePresenter.class), i(EntitySubTitlePresenter.class), + i(WsThemePresenter.class), i(EntityLicensePresenter.class), p(GroupMembersSummary.class), + p(ParticipationSummary.class), p(TagsSummary.class), p(GroupSummary.class)); return presenter; } }, SingletonScope.class); @@ -429,12 +425,30 @@ } }, SingletonScope.class); + builder.registerProvider(UserLiveSearcher.class, new Provider<UserLiveSearcher>() { + public UserLiveSearcher get() { + final UserLiveSearcherPresenter presenter = new UserLiveSearcherPresenter(); + final EntityLiveSearcherView view = new UserLiveSearcherPanel(presenter, i18n); + presenter.init(view); + return presenter; + } + }, SingletonScope.class); + + builder.registerProvider(GroupLiveSearcher.class, new Provider<GroupLiveSearcher>() { + public GroupLiveSearcher get() { + final GroupLiveSearcherPresenter presenter = new GroupLiveSearcherPresenter(); + final EntityLiveSearcherView view = new GroupLiveSearchPanel(presenter, i18n); + presenter.init(view); + return presenter; + } + }, SingletonScope.class); + builder.registerProvider(GroupMembersSummary.class, new Provider<GroupMembersSummary>() { public GroupMembersSummary get() { - final GroupMembersSummaryPresenterNew presenter = new GroupMembersSummaryPresenterNew(i18n, + final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n, p(StateManager.class), i(ImageUtils.class), i(Session.class), - p(SocialNetworkServiceAsync.class)); - final GroupMembersSummaryViewNew view = new GroupMembersSummaryPanelNew(presenter, i18n, ws); + p(SocialNetworkServiceAsync.class), p(GroupLiveSearcher.class)); + final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws); presenter.init(view); return presenter; } @@ -462,8 +476,7 @@ builder.registerProvider(TagsSummary.class, new Provider<TagsSummary>() { public TagsSummary get() { - final TagsSummaryPresenter presenter = new TagsSummaryPresenter(p(Session.class), builder - .getProvider(SiteSearcher.class)); + final TagsSummaryPresenter presenter = new TagsSummaryPresenter(p(Session.class), p(SiteSearcher.class)); final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws); presenter.init(panel); return presenter; Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java 2008-07-26 16:44:17 UTC (rev 816) @@ -22,24 +22,42 @@ import java.util.ArrayList; public class KuneStringUtils { - public KuneStringUtils() { + /* + * This method escape only some dangerous html chars + */ + public static String escapeHtmlLight(final String textOrig) { + String text = textOrig; + text = text.replaceAll("&", "&"); + text = text.replaceAll("\"", """); + // text = text.replaceAll("\'", "'"); + text = text.replaceAll("<", "<"); + text = text.replaceAll(">", ">"); + return text; } public static String generateHtmlLink(final String href, final String text) { - return "<a href=\"" + href + "\" target=\"_blank\">" + text + "</a>"; + return "<a href=\"" + href + "\" target=\"_blank\">" + text + "</a>"; } - /* - * This method escape only some dangerous html chars - */ - public static String escapeHtmlLight(final String textOrig) { - String text = textOrig; - text = text.replaceAll("&", "&"); - text = text.replaceAll("\"", """); - // text = text.replaceAll("\'", "'"); - text = text.replaceAll("<", "<"); - text = text.replaceAll(">", ">"); - return text; + public static ArrayList<String> splitTags(final String tagsString) { + final ArrayList<String> tagsList = new ArrayList<String>(); + String tagsCopy = tagsString; + // remove commas and quotes + if (tagsString == null) { + return tagsList; + } + tagsCopy = tagsCopy.replaceAll(",", " "); + tagsCopy = tagsCopy.replaceAll("\"", ""); + tagsCopy = tagsCopy.replaceAll("\'", ""); + final String[] splitted = tagsCopy.split("\\s+"); + for (int i = 0; i < splitted.length; i++) { + String tag = splitted[i]; + tag = tag.replaceAll("\\s$", ""); + if (tag.length() > 0) { + tagsList.add(tag); + } + } + return tagsList; } /* @@ -47,31 +65,16 @@ * widget for instance */ public static String unescapeHtmlLight(final String textOrig) { - String text = textOrig; - text = text.replaceAll("&", "&"); - text = text.replaceAll(""", "\""); - text = text.replaceAll("'", "\'"); - text = text.replaceAll("<", "<"); - text = text.replaceAll(">", ">"); - return text; + String text = textOrig; + text = text.replaceAll("&", "&"); + text = text.replaceAll(""", "\""); + text = text.replaceAll("'", "\'"); + text = text.replaceAll("<", "<"); + text = text.replaceAll(">", ">"); + return text; } - public static ArrayList<String> splitTags(final String tagsString) { - ArrayList<String> tagsList = new ArrayList<String>(); - String tagsCopy = tagsString; - // remove commas and quotes - tagsCopy = tagsCopy.replaceAll(",", " "); - tagsCopy = tagsCopy.replaceAll("\"", ""); - tagsCopy = tagsCopy.replaceAll("\'", ""); - String[] splitted = tagsCopy.split("\\s+"); - for (int i = 0; i < splitted.length; i++) { - String tag = splitted[i]; - tag = tag.replaceAll("\\s$", ""); - if (tag.length() > 0) { - tagsList.add(tag); - } - } - return tagsList; + public KuneStringUtils() { } } Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -5,6 +5,7 @@ import com.allen_sauer.gwt.log.client.Log; import com.calclab.suco.client.signal.Signal; import com.calclab.suco.client.signal.Slot; +import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.Composite; import com.gwtext.client.core.EventObject; import com.gwtext.client.core.SortDir; @@ -210,6 +211,12 @@ } } + public void setDraggable(final boolean draggable) { + createGridIfNeeded(); + DOM.setElementPropertyBoolean(grid.getElement(), "allowDrag", draggable); + doLayoutIfNeeded(); + } + public void setWidth(final int width) { if (grid != null) { grid.setWidth(width - 27); @@ -370,8 +377,9 @@ } }); grid.stripeRows(true); - grid.setAutoWidth(true); - grid.setAutoHeight(true); + grid.setHideColumnHeader(true); + grid.setBorder(false); + grid.setAutoScroll(true); if (grouped) { final GroupingView groupView = new GroupingView(); @@ -405,9 +413,10 @@ view.setForceFit(true); grid.setView(view); } - grid.setHideColumnHeader(true); - grid.setBorder(false); - grid.setAutoScroll(true); + + grid.setAutoWidth(true); + grid.setAutoHeight(true); + if (gridDropConfiguration != null) { configureDrop(gridDropConfiguration); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-26 16:44:17 UTC (rev 816) @@ -26,8 +26,6 @@ import org.ourproject.kune.platf.client.extend.Register; import org.ourproject.kune.platf.client.state.Session; import org.ourproject.kune.platf.client.state.StateManager; -import org.ourproject.kune.workspace.client.actions.AddGroupLiveSearchAction; -import org.ourproject.kune.workspace.client.actions.AddUserLiveSearchAction; import org.ourproject.kune.workspace.client.actions.AttachToExtensibleWidgetAction; import org.ourproject.kune.workspace.client.actions.ClearExtensibleWidgetAction; import org.ourproject.kune.workspace.client.actions.DetachFromExtensibleWidgetAction; @@ -69,8 +67,6 @@ register.addAction(WorkspaceEvents.ENABLE_RATEIT, new EnableRateItAction(workspace)); register.addAction(WorkspaceEvents.DISABLE_RATEIT, new DisableRateItAction(workspace)); register.addAction(WorkspaceEvents.GET_TRANSLATION, new GetTranslationAction(session)); - register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace)); - register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace)); register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n)); register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n)); register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n)); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-07-26 16:44:17 UTC (rev 816) @@ -24,8 +24,6 @@ public static final String RATE_CONTENT = "ws.RateContent"; public static final String ENABLE_RATEIT = "ws.EnableRateIt"; public static final String DISABLE_RATEIT = "ws.DisableRateIt"; - public static final String ADD_MEMBER_GROUPLIVESEARCH = "ws.AddMemberGroupLiveSearch"; - public static final String ADD_USERLIVESEARCH = "ws.AddUserLiveSearch"; public static final String GET_LEXICON = "i18n.getLexicon"; public static final String SHOW_TRANSLATOR = "i18n.ShowTranslator"; public static final String SHOW_SEARCHER = "ws.ShowSearcher"; Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-26 16:44:17 UTC (rev 816) @@ -22,7 +22,6 @@ import org.ourproject.kune.platf.client.app.DesktopView; import org.ourproject.kune.platf.client.app.ui.DesktopPanel; import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager; -import org.ourproject.kune.platf.client.services.ColorTheme; import org.ourproject.kune.platf.client.services.I18nTranslationService; import org.ourproject.kune.platf.client.services.KuneErrorHandler; import org.ourproject.kune.platf.client.state.Session; @@ -43,11 +42,6 @@ import org.ourproject.kune.workspace.client.licensefoot.LicenseView; import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel; import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchView; -import org.ourproject.kune.workspace.client.socialnet.GroupLiveSearchPresenter; -import org.ourproject.kune.workspace.client.socialnet.UserLiveSearchPresenter; -import org.ourproject.kune.workspace.client.socialnet.ui.GroupLiveSearchPanel; -import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearchPanel; import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems; import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel; import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter; @@ -63,8 +57,6 @@ import org.ourproject.kune.workspace.client.workspace.ContentToolBarComponent; import org.ourproject.kune.workspace.client.workspace.ContentToolBarPresenter; import org.ourproject.kune.workspace.client.workspace.ContentToolBarView; -import org.ourproject.kune.workspace.client.workspace.GroupLiveSearchComponent; -import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent; import org.ourproject.kune.workspace.client.workspace.Workspace; import org.ourproject.kune.workspace.client.workspace.WorkspacePresenter; import org.ourproject.kune.workspace.client.workspace.WorkspaceView; @@ -128,13 +120,6 @@ return presenter; } - public static GroupLiveSearchComponent createGroupLiveSearchComponent() { - final GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter(); - final EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n); - presenter.init(view); - return presenter; - } - public static I18nTranslatorComponent createI18nTranslatorComponent() { final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session); final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n); @@ -156,21 +141,14 @@ return presenter; } - public static UserLiveSearchComponent createUserLiveSearchComponent() { - final UserLiveSearchPresenter presenter = new UserLiveSearchPresenter(); - final EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n); - presenter.init(view); - return presenter; - } - public static Workspace createWorkspace(final Session session, final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n, - final ColorTheme colorTheme, final KuneErrorHandler errorHandler) { + final KuneErrorHandler errorHandler) { WorkspaceFactory.session = session; WorkspaceFactory.i18n = i18n; WorkspaceFactory.errorHandler = errorHandler; final WorkspacePresenter workspace = new WorkspacePresenter(session); - final WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme); + final WorkspaceView view = new WorkspacePanel(workspace, i18n); workspace.init(view, extensionPointManager); return workspace; } Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddGroupLiveSearchAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddGroupLiveSearchAction.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddGroupLiveSearchAction.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,44 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.actions; - -import org.ourproject.kune.platf.client.dispatch.Action; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchListener; -import org.ourproject.kune.workspace.client.workspace.GroupLiveSearchComponent; -import org.ourproject.kune.workspace.client.workspace.Workspace; - -public class AddGroupLiveSearchAction implements Action<EntityLiveSearchListener> { - - private final Workspace workspace; - - public AddGroupLiveSearchAction(final Workspace workspace) { - this.workspace = workspace; - } - - public void execute(final EntityLiveSearchListener listener) { - onAddMemberGroupLiveSearchAction(listener); - } - - private void onAddMemberGroupLiveSearchAction(final EntityLiveSearchListener listener) { - GroupLiveSearchComponent groupLiveSearchComponent = workspace.getGroupLiveSearchComponent(); - groupLiveSearchComponent.addListener(listener); - groupLiveSearchComponent.show(); - } -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddUserLiveSearchAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddUserLiveSearchAction.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AddUserLiveSearchAction.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,44 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.actions; - -import org.ourproject.kune.platf.client.dispatch.Action; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchListener; -import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent; -import org.ourproject.kune.workspace.client.workspace.Workspace; - -public class AddUserLiveSearchAction implements Action<EntityLiveSearchListener> { - - private final Workspace workspace; - - public AddUserLiveSearchAction(final Workspace workspace) { - this.workspace = workspace; - } - - public void execute(final EntityLiveSearchListener listener) { - onAddUserLiveSearchAction(listener); - } - - private void onAddUserLiveSearchAction(final EntityLiveSearchListener listener) { - UserLiveSearchComponent userLiveSearchComponent = workspace.getUserLiveSearchComponent(); - userLiveSearchComponent.addListener(listener); - userLiveSearchComponent.show(); - } -} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -60,6 +60,7 @@ Site.showProgressProcessing(); view.show(); view.center(); + Site.hideProgress(); } else { stateManager.setState(previousTokenOrig); Site.info(i18n.t("Sign in or register to create a group")); @@ -102,6 +103,7 @@ final LicenseDTO license = view.getLicense(); final GroupDTO group = new GroupDTO(shortName, longName, publicDesc, getTypeOfGroup()); group.setDefaultLicense(license); + group.setTags(view.getTags()); final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() { public void onFailure(final Throwable caught) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-07-26 16:44:17 UTC (rev 816) @@ -37,6 +37,8 @@ String getShortName(); + String getTags(); + void hide(); void hideMessage(); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -175,6 +175,10 @@ return shortNameField.getValueAsString(); } + public String getTags() { + return tags.getRawValue(); + } + public void hideMessage() { messagesPanel.hide(); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -43,7 +43,8 @@ super.setContentVisible(true); super.setBorderStylePrimaryName("k-dropdownouter-summary"); addStyleName("kune-Margin-Medium-t"); - ws.getEntitySummary().addInSummary(this); + // Disabled while in development + // ws.getEntitySummary().addInSummary(this); } public void setComment(final String comment) { Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchPresenter.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,55 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet; - -import org.ourproject.kune.platf.client.AbstractPresenter; -import org.ourproject.kune.platf.client.View; - -public class EntityLiveSearchPresenter extends AbstractPresenter { - - private EntityLiveSearchView view; - private EntityLiveSearchListener listener; - - public void init(final EntityLiveSearchView view) { - this.view = view; - } - - public View getView() { - return view; - } - - public void addListener(final EntityLiveSearchListener listener) { - this.listener = listener; - } - - public void show() { - view.show(); - } - - public void hide() { - view.hide(); - } - - public void fireListener(final String shortName, final String longName) { - listener.onSelection(shortName, longName); - hide(); - } - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchView.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchView.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,35 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet; - -import org.ourproject.kune.platf.client.View; - -public interface EntityLiveSearchView extends View { - - final public static int SEARCH_GROUPS = 1; - final public static int SEARCH_USERS = 2; - - void show(); - - void hide(); - - void center(); - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchPresenter.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,63 @@ +/* + * + * Copyright (C) 2007-2008 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.socialnet; + +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.platf.client.dto.LinkDTO; +import org.ourproject.kune.workspace.client.workspace.EntityLiveSearcher; + +import com.calclab.suco.client.signal.Signal; +import com.calclab.suco.client.signal.Slot; + +public class EntityLiveSearcherPresenter implements EntityLiveSearcher { + + private EntityLiveSearcherView view; + private Signal<LinkDTO> onSelection; + + public void addListener(final EntityLiveSearchListener listener) { + this.onSelection = new Signal<LinkDTO>("onSelection"); + } + + public View getView() { + return view; + } + + public void init(final EntityLiveSearcherView view) { + this.view = view; + } + + public void onSelection(final LinkDTO link) { + onSelection.fire(link); + view.hide(); + } + + public void onSelectionAdd(final Slot<LinkDTO> slot) { + onSelection.add(slot); + } + + public void onSelectionRemove(final Slot<LinkDTO> slot) { + onSelection.remove(slot); + } + + public void show() { + view.show(); + } + +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchView.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchView.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,35 @@ +/* + * + * Copyright (C) 2007-2008 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.socialnet; + +import org.ourproject.kune.platf.client.View; + +public interface EntityLiveSearcherView extends View { + + final public static int SEARCH_GROUPS = 1; + final public static int SEARCH_USERS = 2; + + void show(); + + void hide(); + + void center(); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearchPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearchPresenter.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearchPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,26 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet; - -import org.ourproject.kune.workspace.client.workspace.GroupLiveSearchComponent; - -public class GroupLiveSearchPresenter extends EntityLiveSearchPresenter implements GroupLiveSearchComponent { - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearchPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearchPresenter.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,26 @@ +/* + * + * Copyright (C) 2007-2008 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.socialnet; + +import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher; + +public class GroupLiveSearcherPresenter extends EntityLiveSearcherPresenter implements GroupLiveSearcher { + +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java (from rev 814, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanelNew.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanelNew.java 2008-07-23 04:36:14 UTC (rev 814) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,119 @@ +package org.ourproject.kune.workspace.client.socialnet; + +import java.util.HashMap; + +import org.ourproject.kune.platf.client.dto.GroupDTO; +import org.ourproject.kune.platf.client.ui.DropDownPanel; +import org.ourproject.kune.platf.client.ui.gridmenu.GridButton; +import org.ourproject.kune.platf.client.ui.gridmenu.GridDragConfiguration; +import org.ourproject.kune.platf.client.ui.gridmenu.GridItem; +import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel; +import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; +import org.ourproject.kune.workspace.client.ui.newtmp.skel.EntitySummary; +import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +import com.calclab.emiteuimodule.client.users.UserGridPanel; +import com.gwtext.client.core.EventObject; +import com.gwtext.client.widgets.BoxComponent; +import com.gwtext.client.widgets.Button; +import com.gwtext.client.widgets.MessageBox; +import com.gwtext.client.widgets.ToolbarButton; +import com.gwtext.client.widgets.event.ButtonListenerAdapter; +import com.gwtext.client.widgets.event.ContainerListenerAdapter; + +public class GroupMembersSummaryPanel extends DropDownPanel implements GroupMembersSummaryView { + private final GridMenuPanel<GroupDTO> gridMenuPanel; + private final I18nUITranslationService i18n; + private final GroupMembersSummaryPresenter presenter; + private final HashMap<GridButton, ToolbarButton> buttonsCache; + + public GroupMembersSummaryPanel(final GroupMembersSummaryPresenter presenter, final I18nUITranslationService i18n, + final WorkspaceSkeleton ws) { + super(true); + this.presenter = presenter; + this.i18n = i18n; + super.setHeaderText(i18n.t("Group members")); + super.setHeaderTitle(i18n.t("People and groups collaborating in this group")); + super.setBorderStylePrimaryName("k-dropdownouter-members"); + super.addStyleName("kune-Margin-Medium-t"); + + final GridDragConfiguration dragConf = new GridDragConfiguration(UserGridPanel.USER_GROUP_DD, i18n + .t("Drop in the chat area to start a chat.") + + "<br/>" + i18n.t("Drop into a room to invite the user to join the chat room")); + gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This is an orphaned project, if you are interested " + + "please request to join to work on it"), dragConf, true, true, false, true, false); + final EntitySummary entitySummary = ws.getEntitySummary(); + entitySummary.addInSummary(this); + entitySummary.addListener(new ContainerListenerAdapter() { + @Override + public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight, + final int rawWidth, final int rawHeight) { + gridMenuPanel.setWidth(adjWidth); + } + }); + this.setContent(gridMenuPanel); + buttonsCache = new HashMap<GridButton, ToolbarButton>(); + } + + public void addButton(final GridButton gridButton) { + // Workaround: gwt-ext don't have toolbar.removeItem method ... + ToolbarButton button = buttonsCache.get(gridButton); + if (button == null) { + button = new ToolbarButton(gridButton.getTitle()); + button.setIcon(gridButton.getIcon()); + button.setTooltip(gridButton.getTooltip()); + button.addListener(new ButtonListenerAdapter() { + public void onClick(final Button button, final EventObject e) { + gridButton.getSlot().onEvent(""); + } + }); + buttonsCache.put(gridButton, button); + } else { + button.setVisible(true); + } + gridMenuPanel.getBottomBar().addButton(button); + } + + public void addItem(final GridItem<GroupDTO> gridItem) { + gridMenuPanel.addItem(gridItem); + } + + public void clear() { + gridMenuPanel.removeAll(); + for (final ToolbarButton button : buttonsCache.values()) { + // Workaround: gwt-ext don't have toolbar.removeItem method ... + // gridMenuPanel.getBottomBar().getEl().removeChild(button.getElement()); + button.setVisible(false); + button.removeFromParent(); + } + } + + public void confirmAddCollab(final String groupShortName, final String groupLongName) { + final String groupName = groupLongName + " (" + groupShortName + ")"; + MessageBox.confirm(i18n.t("Confirm addition of member"), i18n.t("Add [%s] as member?", groupName), + new MessageBox.ConfirmCallback() { + public void execute(final String btnID) { + if (btnID.equals("yes")) { + presenter.addCollab(groupShortName); + } + } + }); + } + + public void setDraggable(final boolean draggable) { + gridMenuPanel.setDraggable(draggable); + } + + public void setDropDownContentVisible(final boolean visible) { + super.setContentVisible(visible); + } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + super.setTheme(oldTheme, newTheme); + } + + public void setVisible(final boolean visible) { + super.setVisible(visible); + } +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanelNew.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanelNew.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanelNew.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,115 +0,0 @@ -package org.ourproject.kune.workspace.client.socialnet; - -import java.util.HashMap; - -import org.ourproject.kune.platf.client.dto.GroupDTO; -import org.ourproject.kune.platf.client.ui.DropDownPanel; -import org.ourproject.kune.platf.client.ui.gridmenu.GridButton; -import org.ourproject.kune.platf.client.ui.gridmenu.GridDragConfiguration; -import org.ourproject.kune.platf.client.ui.gridmenu.GridItem; -import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel; -import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; -import org.ourproject.kune.workspace.client.ui.newtmp.skel.EntitySummary; -import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; -import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; - -import com.calclab.emiteuimodule.client.users.UserGridPanel; -import com.gwtext.client.core.EventObject; -import com.gwtext.client.widgets.BoxComponent; -import com.gwtext.client.widgets.Button; -import com.gwtext.client.widgets.MessageBox; -import com.gwtext.client.widgets.ToolbarButton; -import com.gwtext.client.widgets.event.ButtonListenerAdapter; -import com.gwtext.client.widgets.event.ContainerListenerAdapter; - -public class GroupMembersSummaryPanelNew extends DropDownPanel implements GroupMembersSummaryViewNew { - private final GridMenuPanel<GroupDTO> gridMenuPanel; - private final I18nUITranslationService i18n; - private final GroupMembersSummaryPresenterNew presenter; - private final HashMap<GridButton, ToolbarButton> buttonsCache; - - public GroupMembersSummaryPanelNew(final GroupMembersSummaryPresenterNew presenter, - final I18nUITranslationService i18n, final WorkspaceSkeleton ws) { - super(true); - this.presenter = presenter; - this.i18n = i18n; - super.setHeaderText(i18n.t("Group members")); - super.setHeaderTitle(i18n.t("People and groups collaborating in this group")); - super.setBorderStylePrimaryName("k-dropdownouter-members"); - super.addStyleName("kune-Margin-Medium-t"); - - final GridDragConfiguration dragConf = new GridDragConfiguration(UserGridPanel.USER_GROUP_DD, i18n - .t("Drop in the chat area to start a chat.") - + "<br/>" + i18n.t("Drop into a room to invite the user to join the chat room")); - gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This is an orphaned project, if you are interested " - + "please request to join to work on it"), dragConf, true, true, false, true, false); - final EntitySummary entitySummary = ws.getEntitySummary(); - entitySummary.addInSummary(this); - entitySummary.addListener(new ContainerListenerAdapter() { - @Override - public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight, - final int rawWidth, final int rawHeight) { - gridMenuPanel.setWidth(adjWidth); - } - }); - this.setContent(gridMenuPanel); - buttonsCache = new HashMap<GridButton, ToolbarButton>(); - } - - public void addButton(final GridButton gridButton) { - // Workaround: gwt-ext don't have toolbar.removeItem method ... - ToolbarButton button = buttonsCache.get(gridButton); - if (button == null) { - button = new ToolbarButton(gridButton.getTitle()); - button.setIcon(gridButton.getIcon()); - button.setTooltip(gridButton.getTooltip()); - button.addListener(new ButtonListenerAdapter() { - public void onClick(final Button button, final EventObject e) { - gridButton.getSlot().onEvent(""); - } - }); - buttonsCache.put(gridButton, button); - } else { - button.setVisible(true); - } - gridMenuPanel.getBottomBar().addButton(button); - } - - public void addItem(final GridItem<GroupDTO> gridItem) { - gridMenuPanel.addItem(gridItem); - } - - public void clear() { - gridMenuPanel.removeAll(); - for (final ToolbarButton button : buttonsCache.values()) { - // Workaround: gwt-ext don't have toolbar.removeItem method ... - // gridMenuPanel.getBottomBar().getEl().removeChild(button.getElement()); - button.setVisible(false); - button.removeFromParent(); - } - } - - public void confirmAddCollab(final String groupShortName, final String groupLongName) { - final String groupName = groupLongName + " (" + groupShortName + ")"; - MessageBox.confirm(i18n.t("Confirm addition of member"), i18n.t("Add [%s] as member?", groupName), - new MessageBox.ConfirmCallback() { - public void execute(final String btnID) { - if (btnID.equals("yes")) { - presenter.addCollab(groupShortName); - } - } - }); - } - - public void setDropDownContentVisible(final boolean visible) { - super.setContentVisible(visible); - } - - public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { - super.setTheme(oldTheme, newTheme); - } - - public void setVisible(final boolean visible) { - super.setVisible(visible); - } -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java (from rev 815, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,160 @@ +package org.ourproject.kune.workspace.client.socialnet; + +import java.util.List; + +import org.ourproject.kune.platf.client.dto.AccessListsDTO; +import org.ourproject.kune.platf.client.dto.AccessRightsDTO; +import org.ourproject.kune.platf.client.dto.GroupDTO; +import org.ourproject.kune.platf.client.dto.LinkDTO; +import org.ourproject.kune.platf.client.dto.SocialNetworkDTO; +import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO; +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple; +import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync; +import org.ourproject.kune.platf.client.services.ImageDescriptor; +import org.ourproject.kune.platf.client.services.ImageUtils; +import org.ourproject.kune.platf.client.state.Session; +import org.ourproject.kune.platf.client.state.StateManager; +import org.ourproject.kune.platf.client.ui.gridmenu.GridButton; +import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup; +import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; +import org.ourproject.kune.workspace.client.sitebar.Site; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; +import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher; +import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary; + +import com.calclab.suco.client.container.Provider; +import com.calclab.suco.client.signal.Slot; + +public class GroupMembersSummaryPresenter extends SocialNetworkPresenter implements GroupMembersSummary { + + protected GridButton addMember; + private GroupMembersSummaryView view; + private final I18nUITranslationService i18n; + private final GridGroup adminCategory; + private final GridGroup collabCategory; + private final GridGroup pendigCategory; + private final Session session; + private final Provider<SocialNetworkServiceAsync> snServiceProvider; + + public GroupMembersSummaryPresenter(final I18nUITranslationService i18n, + final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session, + final Provider<SocialNetworkServiceAsync> snServiceProvider, + final Provider<GroupLiveSearcher> groupLiveSearcherProvider) { + super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider); + this.i18n = i18n; + this.session = session; + this.snServiceProvider = snServiceProvider; + final String adminsTitle = i18n.t("Admins"); + final String collabsTitle = i18n.t("Collaborators"); + final String pendingTitle = i18n.t("Pending"); + adminCategory = new GridGroup(adminsTitle, adminsTitle, i18n.t("People that can admin this group"), true); + collabCategory = new GridGroup(collabsTitle, collabsTitle, i18n + .t("Other people that collaborate with this group"), true); + pendigCategory = new GridGroup(pendingTitle, pendingTitle, i18n + .t("People pending to be accepted in this group by the admins"), imageUtils + .getImageHtml(ImageDescriptor.alert), true); + addMember = new GridButton("images/add-green.gif", i18n.t("Add member"), i18n + .t("Add a group or a person as member of this group"), new Slot<String>() { + public void onEvent(final String parameter) { + groupLiveSearcherProvider.get().onSelectionAdd(new Slot<LinkDTO>() { + public void onEvent(final LinkDTO link) { + view.confirmAddCollab(link.getShortName(), link.getLongName()); + groupLiveSearcherProvider.get().onSelectionRemove(this); + } + }); + groupLiveSearcherProvider.get().show(); + } + }); + super.addGroupOperation(gotoMemberMenuItem, false); + } + + public void addCollab(final String groupShortName) { + Site.showProgressProcessing(); + snServiceProvider.get().addCollabMember(session.getUserHash(), + session.getCurrentState().getGroup().getShortName(), groupShortName, + new AsyncCallbackSimple<SocialNetworkResultDTO>() { + public void onSuccess(final SocialNetworkResultDTO result) { + Site.hideProgress(); + Site.info(i18n.t("Member added as collaborator")); + getStateManager().setSocialNetwork(result); + } + + }); + } + + public void hide() { + view.setVisible(false); + } + + public void init(final GroupMembersSummaryView view) { + this.view = view; + } + + public void setState(final StateDTO state) { + if (state.getGroup().getType().equals(GroupDTO.PERSONAL)) { + hide(); + } else { + setGroupMembers(state.getGroupMembers(), state.getGroupRights()); + } + } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + view.setTheme(oldTheme, newTheme); + } + + private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) { + return userIsAdmin || userIsCollab; + } + + @SuppressWarnings("unchecked") + private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRightsDTO rights) { + final AccessListsDTO accessLists = socialNetwork.getAccessLists(); + + final List<GroupDTO> adminsList = accessLists.getAdmins().getList(); + final List<GroupDTO> collabList = accessLists.getEditors().getList(); + final List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList(); + + final int numAdmins = adminsList.size(); + + boolean userIsAdmin = rights.isAdministrable(); + final boolean userIsCollab = !userIsAdmin && rights.isEditable(); + final boolean userCanView = rights.isVisible(); + boolean userIsMember = isMember(userIsAdmin, userIsCollab); + + view.setDropDownContentVisible(false); + view.clear(); + + if (userIsAdmin) { + view.addButton(addMember); + } + + view.setDraggable(session.isLogged()); + + if (!userIsMember) { + view.addButton(requestJoin); + } else if (userIsAdmin && numAdmins > 1 || userIsCollab) { + view.addButton(unJoinButton); + } + + if (userCanView) { + for (final GroupDTO admin : adminsList) { + view + .addItem(createGridItem(adminCategory, admin, rights, changeToCollabMenuItem, + removeMemberMenuItem)); + } + for (final GroupDTO collab : collabList) { + view + .addItem(createGridItem(collabCategory, collab, rights, changeToAdminMenuItem, + removeMemberMenuItem)); + } + for (final GroupDTO pendingCollab : pendingCollabsList) { + view.addItem(createGridItem(pendigCategory, pendingCollab, rights, acceptJoinGroupMenuItem, + denyJoinGroupMenuItem)); + } + } + view.setDropDownContentVisible(true); + view.setVisible(true); + } + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,140 +0,0 @@ -package org.ourproject.kune.workspace.client.socialnet; - -import java.util.List; - -import org.ourproject.kune.platf.client.dto.AccessListsDTO; -import org.ourproject.kune.platf.client.dto.AccessRightsDTO; -import org.ourproject.kune.platf.client.dto.GroupDTO; -import org.ourproject.kune.platf.client.dto.SocialNetworkDTO; -import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO; -import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple; -import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync; -import org.ourproject.kune.platf.client.services.ImageDescriptor; -import org.ourproject.kune.platf.client.services.ImageUtils; -import org.ourproject.kune.platf.client.state.Session; -import org.ourproject.kune.platf.client.state.StateManager; -import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup; -import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; -import org.ourproject.kune.workspace.client.sitebar.Site; -import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; -import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary; - -import com.calclab.suco.client.container.Provider; - -public class GroupMembersSummaryPresenterNew extends SocialNetworkPresenter implements GroupMembersSummary { - - private GroupMembersSummaryViewNew view; - private final I18nUITranslationService i18n; - private final GridGroup adminCategory; - private final GridGroup collabCategory; - private final GridGroup pendigCategory; - private final Session session; - private final Provider<SocialNetworkServiceAsync> snServiceProvider; - - public GroupMembersSummaryPresenterNew(final I18nUITranslationService i18n, - final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session, - final Provider<SocialNetworkServiceAsync> snServiceProvider) { - super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider); - this.i18n = i18n; - this.session = session; - this.snServiceProvider = snServiceProvider; - final String adminsTitle = i18n.t("Admins"); - final String collabsTitle = i18n.t("Collaborators"); - final String pendingTitle = i18n.t("Pending"); - adminCategory = new GridGroup(adminsTitle, adminsTitle, i18n.t("People that can admin this group"), true); - collabCategory = new GridGroup(collabsTitle, collabsTitle, i18n - .t("Other people that collaborate with this group"), true); - pendigCategory = new GridGroup(pendingTitle, pendingTitle, i18n - .t("People pending to be accepted in this group by the admins"), imageUtils - .getImageHtml(ImageDescriptor.alert), true); - super.addGroupOperation(gotoMemberMenuItem, false); - } - - public void addCollab(final String groupShortName) { - Site.showProgressProcessing(); - snServiceProvider.get().addCollabMember(session.getUserHash(), - session.getCurrentState().getGroup().getShortName(), groupShortName, - new AsyncCallbackSimple<SocialNetworkResultDTO>() { - public void onSuccess(final SocialNetworkResultDTO result) { - Site.hideProgress(); - Site.info(i18n.t("Member added as collaborator")); - getStateManager().setSocialNetwork(result); - } - - }); - } - - public void hide() { - view.setVisible(false); - } - - public void init(final GroupMembersSummaryViewNew view) { - this.view = view; - } - - public void setState(final StateDTO state) { - if (state.getGroup().getType().equals(GroupDTO.PERSONAL)) { - hide(); - } else { - setGroupMembers(state.getGroupMembers(), state.getGroupRights()); - } - } - - public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { - view.setTheme(oldTheme, newTheme); - } - - private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) { - return userIsAdmin || userIsCollab; - } - - @SuppressWarnings("unchecked") - private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRightsDTO rights) { - final AccessListsDTO accessLists = socialNetwork.getAccessLists(); - - final List<GroupDTO> adminsList = accessLists.getAdmins().getList(); - final List<GroupDTO> collabList = accessLists.getEditors().getList(); - final List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList(); - - final int numAdmins = adminsList.size(); - - boolean userIsAdmin = rights.isAdministrable(); - final boolean userIsCollab = !userIsAdmin && rights.isEditable(); - final boolean userCanView = rights.isVisible(); - boolean userIsMember = isMember(userIsAdmin, userIsCollab); - - view.setDropDownContentVisible(false); - view.clear(); - - if (userIsAdmin) { - view.addButton(addMember); - } - - if (!userIsMember) { - view.addButton(requestJoin); - } else if (userIsAdmin && numAdmins > 1 || userIsCollab) { - view.addButton(unJoinButton); - } - - if (userCanView) { - for (final GroupDTO admin : adminsList) { - view - .addItem(createGridItem(adminCategory, admin, rights, changeToCollabMenuItem, - removeMemberMenuItem)); - } - for (final GroupDTO collab : collabList) { - view - .addItem(createGridItem(collabCategory, collab, rights, changeToAdminMenuItem, - removeMemberMenuItem)); - } - for (final GroupDTO pendingCollab : pendingCollabsList) { - view.addItem(createGridItem(pendigCategory, pendingCollab, rights, acceptJoinGroupMenuItem, - denyJoinGroupMenuItem)); - } - } - view.setDropDownContentVisible(true); - view.setVisible(true); - } - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java (from rev 804, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryViewNew.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryViewNew.java 2008-07-20 14:38:06 UTC (rev 804) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,26 @@ +package org.ourproject.kune.workspace.client.socialnet; + +import org.ourproject.kune.platf.client.dto.GroupDTO; +import org.ourproject.kune.platf.client.ui.gridmenu.GridButton; +import org.ourproject.kune.platf.client.ui.gridmenu.GridItem; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +public interface GroupMembersSummaryView { + + void addButton(GridButton gridButton); + + void addItem(GridItem<GroupDTO> gridItem); + + void clear(); + + void confirmAddCollab(String groupShortName, String groupLongName); + + void setDraggable(boolean draggable); + + void setDropDownContentVisible(boolean visible); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + + void setVisible(boolean visible); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryViewNew.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryViewNew.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryViewNew.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,22 +0,0 @@ -package org.ourproject.kune.workspace.client.socialnet; - -import org.ourproject.kune.platf.client.dto.GroupDTO; -import org.ourproject.kune.platf.client.ui.gridmenu.GridButton; -import org.ourproject.kune.platf.client.ui.gridmenu.GridItem; -import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; - -public interface GroupMembersSummaryViewNew { - - void addButton(GridButton gridButton); - - void addItem(GridItem<GroupDTO> gridItem); - - void clear(); - - void setDropDownContentVisible(boolean visible); - - void setTheme(WsTheme oldTheme, WsTheme newTheme); - - void setVisible(boolean visible); - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,39 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet; - -public class MemberAction { - - private final String text; - private final String action; - - public MemberAction(final String text, final String action) { - this.text = text; - this.action = action; - } - - public String getAction() { - return action; - } - - public String getText() { - return text; - } -} \ No newline at end of file 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-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -24,7 +24,6 @@ public class SocialNetworkPresenter { - protected GridButton addMember; protected GridButton requestJoin; protected GridButton unJoinButton; protected GridMenuItem<GroupDTO> changeToCollabMenuItem; @@ -86,17 +85,6 @@ } private void createButtons() { - addMember = new GridButton("images/add-green.gif", i18n.t("Add member"), i18n - .t("Add a group or a person as member of this group"), new Slot<String>() { - public void onEvent(final String parameter) { - // TODO - // GroupLiveSearchComponent groupLiveSearchComponent - // = workspace.getGroupLiveSearchComponent(); - // groupLiveSearchComponent.addListener(listener); - // groupLiveSearchComponent.show(); - } - }); - requestJoin = new GridButton("images/add-green.gif", i18n.t("Participate"), i18n .t("Request to participate in this group"), new Slot<String>() { public void onEvent(final String parameter) { Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearchPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearchPresenter.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearchPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,26 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet; - -import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent; - -public class UserLiveSearchPresenter extends EntityLiveSearchPresenter implements UserLiveSearchComponent { - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearchPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearchPresenter.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,26 @@ +/* + * + * Copyright (C) 2007-2008 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.socialnet; + +import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher; + +public class UserLiveSearcherPresenter extends EntityLiveSearcherPresenter implements UserLiveSearcher { + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearchPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearchPanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearchPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,145 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet.ui; - -import org.ourproject.kune.platf.client.AbstractPresenter; -import org.ourproject.kune.platf.client.services.I18nTranslationService; -import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchView; -import org.ourproject.kune.workspace.client.socialnet.GroupLiveSearchPresenter; - -import com.gwtext.client.core.Connection; -import com.gwtext.client.core.Template; -import com.gwtext.client.core.UrlParam; -import com.gwtext.client.data.DataProxy; -import com.gwtext.client.data.FieldDef; -import com.gwtext.client.data.HttpProxy; -import com.gwtext.client.data.JsonReader; -import com.gwtext.client.data.Record; -import com.gwtext.client.data.RecordDef; -import com.gwtext.client.data.Store; -import com.gwtext.client.data.StringFieldDef; -import com.gwtext.client.widgets.form.ComboBox; -import com.gwtext.client.widgets.form.FormPanel; -import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter; - -public class EntityLiveSearchPanel implements EntityLiveSearchView { - - private static final int PAGINATION_SIZE = 10; - private final AbstractPresenter presenter; - private BasicDialog dialog; - private final int searchType; - private FormPanel searchForm; - private final I18nTranslationService i18n; - - public EntityLiveSearchPanel(final AbstractPresenter initPresenter, final int searchType, - final I18nTranslationService i18n) { - this.presenter = initPresenter; - this.searchType = searchType; - this.i18n = i18n; - } - - public void center() { - dialog.center(); - } - - public void hide() { - dialog.hide(); - searchForm.getForm().reset(); - } - - public void show() { - if (dialog == null) { - createGroupSearchDialog(searchType); - } - dialog.show(); - dialog.center(); - // DOM.setStyleAttribute(dialog.getElement(), "zIndex", "10000"); - } - - private void createGroupSearchDialog(final int searchType) { - String title; - if (searchType == EntityLiveSearchView.SEARCH_GROUPS) { - title = i18n.t("Search existing users and groups"); - } else { - title = i18n.t("Search existing users"); - } - dialog = new BasicDialog(title, true, false, 285, 55); - dialog.setClosable(true); - dialog.setCollapsible(false); - - DataProxy dataProxy = null; - switch (searchType) { - case EntityLiveSearchView.SEARCH_GROUPS: - dataProxy = new HttpProxy("/kune/json/GroupJSONService/search", Connection.POST); - break; - case EntityLiveSearchView.SEARCH_USERS: - dataProxy = new HttpProxy("/kune/json/UserJSONService/search", Connection.POST); - break; - default: - break; - } - - JsonReader reader = new JsonReader(new RecordDef(new FieldDef[] { new StringFieldDef("shortName"), - new StringFieldDef("longName"), new StringFieldDef("link"), new StringFieldDef("iconUrl") })); - reader.setRoot("list"); - reader.setTotalProperty("size"); - reader.setId("shortName"); - - final Store store = new Store(dataProxy, reader); - - store.load(new UrlParam[] { new UrlParam("query", "."), new UrlParam("first", 1), - new UrlParam("max", PAGINATION_SIZE) }); - - searchForm = new FormPanel(); - searchForm.setBorder(false); - searchForm.setWidth(275); - searchForm.setHideLabels(true); - - final Template resultTpl = new Template( - "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img alt=\"group logo\" src=\"images/group-def-icon.png\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>"); - ComboBox cb = new ComboBox(); - cb.setStore(store); - cb.setEmptyText(i18n.t("Write here to search")); - cb.setDisplayField("longName"); - cb.setTypeAhead(true); - cb.setLoadingText(i18n.t("Searching...")); - cb.setWidth(268); - cb.setPageSize(PAGINATION_SIZE); - cb.setTpl(resultTpl); - cb.setMode(ComboBox.REMOTE); - cb.setMinChars(2); - cb.setSelectOnFocus(false); - cb.setHideTrigger(true); - cb.setHideLabel(true); - // setTitle(i18n.t("User or group")); - cb.setItemSelector("div.search-item"); - - cb.addListener(new ComboBoxListenerAdapter() { - public void onSelect(final ComboBox comboBox, final Record record, final int index) { - ((GroupLiveSearchPresenter) presenter).fireListener(record.getAsString("shortName"), record - .getAsString("longName")); - } - }); - - searchForm.add(cb); - dialog.add(searchForm); - } -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearchPanel.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearchPanel.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,151 @@ +/* + * + * Copyright (C) 2007-2008 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.socialnet.ui; + +import org.ourproject.kune.platf.client.dto.LinkDTO; +import org.ourproject.kune.platf.client.services.I18nTranslationService; +import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter; + +import com.gwtext.client.core.Connection; +import com.gwtext.client.core.Template; +import com.gwtext.client.core.UrlParam; +import com.gwtext.client.data.DataProxy; +import com.gwtext.client.data.FieldDef; +import com.gwtext.client.data.HttpProxy; +import com.gwtext.client.data.JsonReader; +import com.gwtext.client.data.Record; +import com.gwtext.client.data.RecordDef; +import com.gwtext.client.data.Store; +import com.gwtext.client.data.StringFieldDef; +import com.gwtext.client.widgets.form.ComboBox; +import com.gwtext.client.widgets.form.FormPanel; +import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter; + +public class EntityLiveSearcherPanel implements EntityLiveSearcherView { + + private static final String LONG_NAME_FIELD = "longName"; + private static final String SHORT_NAME_FIELD = "shortName"; + private static final String ICON_URL_FIELD = "iconUrl"; + private static final String LINK_FIELD = "link"; + private static final int PAGINATION_SIZE = 10; + private final EntityLiveSearcherPresenter presenter; + private BasicDialog dialog; + private final int searchType; + private FormPanel searchForm; + private final I18nTranslationService i18n; + + public EntityLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final int searchType, + final I18nTranslationService i18n) { + this.presenter = presenter; + this.searchType = searchType; + this.i18n = i18n; + } + + public void center() { + dialog.center(); + } + + public void hide() { + dialog.hide(); + searchForm.getForm().reset(); + } + + public void show() { + if (dialog == null) { + createGroupSearchDialog(searchType); + } + dialog.show(); + dialog.center(); + } + + private void createGroupSearchDialog(final int searchType) { + String title; + if (searchType == EntityLiveSearcherView.SEARCH_GROUPS) { + title = i18n.t("Search existing users and groups"); + } else { + title = i18n.t("Search existing users"); + } + dialog = new BasicDialog(title, true, false, 285, 55); + dialog.setClosable(true); + dialog.setCollapsible(false); + + DataProxy dataProxy = null; + switch (searchType) { + case EntityLiveSearcherView.SEARCH_GROUPS: + dataProxy = new HttpProxy("/kune/json/GroupJSONService/search", Connection.POST); + break; + case EntityLiveSearcherView.SEARCH_USERS: + dataProxy = new HttpProxy("/kune/json/UserJSONService/search", Connection.POST); + break; + default: + break; + } + + final JsonReader reader = new JsonReader(new RecordDef( + new FieldDef[] { new StringFieldDef(SHORT_NAME_FIELD), new StringFieldDef(LONG_NAME_FIELD), + new StringFieldDef(LINK_FIELD), new StringFieldDef(ICON_URL_FIELD) })); + reader.setRoot("list"); + reader.setTotalProperty("size"); + reader.setId(SHORT_NAME_FIELD); + + final Store store = new Store(dataProxy, reader); + + store.load(new UrlParam[] { new UrlParam("query", "."), new UrlParam("first", 1), + new UrlParam("max", PAGINATION_SIZE) }); + + searchForm = new FormPanel(); + searchForm.setBorder(false); + searchForm.setWidth(275); + searchForm.setHideLabels(true); + + final Template resultTpl = new Template( + "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img alt=\"group logo\" src=\"images/group-def-icon.png\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>"); + final ComboBox cb = new ComboBox(); + cb.setStore(store); + cb.setEmptyText(i18n.t("Write here to search")); + cb.setDisplayField(LONG_NAME_FIELD); + cb.setTypeAhead(true); + cb.setLoadingText(i18n.t("Searching...")); + cb.setWidth(268); + cb.setPageSize(PAGINATION_SIZE); + cb.setTpl(resultTpl); + cb.setMode(ComboBox.REMOTE); + cb.setMinChars(2); + cb.setSelectOnFocus(false); + cb.setHideTrigger(true); + cb.setHideLabel(true); + // setTitle(i18n.t("User or group")); + cb.setItemSelector("div.search-item"); + + cb.addListener(new ComboBoxListenerAdapter() { + public void onSelect(final ComboBox comboBox, final Record record, final int index) { + final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record + .getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record + .getAsString(LINK_FIELD)); + presenter.onSelection(link); + } + }); + + searchForm.add(cb); + dialog.add(searchForm); + } +} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -19,14 +19,14 @@ */ package org.ourproject.kune.workspace.client.socialnet.ui; -import org.ourproject.kune.platf.client.AbstractPresenter; import org.ourproject.kune.platf.client.services.I18nTranslationService; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchView; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter; -public class GroupLiveSearchPanel extends EntityLiveSearchPanel { +public class GroupLiveSearchPanel extends EntityLiveSearcherPanel { - public GroupLiveSearchPanel(final AbstractPresenter presenter, final I18nTranslationService i18n) { - super(presenter, EntityLiveSearchView.SEARCH_GROUPS, i18n); + public GroupLiveSearchPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) { + super(presenter, EntityLiveSearcherView.SEARCH_GROUPS, i18n); } } \ No newline at end of file Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearchPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearchPanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearchPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,32 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.socialnet.ui; - -import org.ourproject.kune.platf.client.AbstractPresenter; -import org.ourproject.kune.platf.client.services.I18nTranslationService; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchView; - -public class UserLiveSearchPanel extends EntityLiveSearchPanel { - - public UserLiveSearchPanel(final AbstractPresenter presenter, final I18nTranslationService i18n) { - super(presenter, EntityLiveSearchView.SEARCH_USERS, i18n); - } - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearchPanel.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearchPanel.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,32 @@ +/* + * + * Copyright (C) 2007-2008 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.socialnet.ui; + +import org.ourproject.kune.platf.client.services.I18nTranslationService; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView; +import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter; + +public class UserLiveSearcherPanel extends EntityLiveSearcherPanel { + + public UserLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) { + super(presenter, EntityLiveSearcherView.SEARCH_USERS, i18n); + } + +} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -49,7 +49,7 @@ } public void setVisible(final boolean visible) { - menu.setVisible(visible); + super.setVisible(visible); } } Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearchComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearchComponent.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearchComponent.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,31 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.workspace; - -import org.ourproject.kune.platf.client.Component; -import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchListener; - -public interface EntityLiveSearchComponent extends Component { - - void addListener(EntityLiveSearchListener presenter); - - void show(); - -} Added: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,34 @@ +/* + * + * Copyright (C) 2007-2008 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.workspace; + +import org.ourproject.kune.platf.client.dto.LinkDTO; + +import com.calclab.suco.client.signal.Slot; + +public interface EntityLiveSearcher { + + void onSelectionAdd(Slot<LinkDTO> slot); + + void onSelectionRemove(Slot<LinkDTO> slot); + + void show(); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearchComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearchComponent.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearchComponent.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,25 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.workspace; - -public interface GroupLiveSearchComponent extends EntityLiveSearchComponent { - -} Added: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,25 @@ +/* + * + * Copyright (C) 2007-2008 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.workspace; + +public interface GroupLiveSearcher extends EntityLiveSearcher { + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearchComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearchComponent.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearchComponent.java 2008-07-26 16:44:17 UTC (rev 816) @@ -1,24 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 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.workspace; - -public interface UserLiveSearchComponent extends EntityLiveSearchComponent { -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearchComponent.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearchComponent.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816) @@ -0,0 +1,24 @@ +/* + * + * Copyright (C) 2007-2008 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.workspace; + +public interface UserLiveSearcher extends EntityLiveSearcher { +} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-26 16:44:17 UTC (rev 816) @@ -55,14 +55,10 @@ public ContentTitleComponent getContentTitleComponent(); - public GroupLiveSearchComponent getGroupLiveSearchComponent(); - public I18nTranslatorComponent getI18nTranslatorComponent(); public LicenseComponent getLicenseComponent(); - public UserLiveSearchComponent getUserLiveSearchComponent(); - public void setContent(WorkspaceComponent contentComponent); public void setContext(WorkspaceComponent contextComponent); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-26 16:44:17 UTC (rev 816) @@ -100,10 +100,6 @@ return components.getContentTitleComponent(); } - public GroupLiveSearchComponent getGroupLiveSearchComponent() { - return components.getGroupLiveSearchComponent(); - } - public I18nTranslatorComponent getI18nTranslatorComponent() { return components.getI18nTranslatorComponent(); } @@ -112,10 +108,6 @@ return components.getLicenseComponent(); } - public UserLiveSearchComponent getUserLiveSearchComponent() { - return components.getUserLiveSearchComponent(); - } - public View getView() { return view; } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-26 16:44:17 UTC (rev 816) @@ -34,9 +34,9 @@ private ContentBottomToolBarComponent contentBottomToolBar; private ThemeMenuComponent themeMenu; private ContentToolBarComponent contentToolBar; - private GroupLiveSearchComponent groupLiveSearch; + private GroupLiveSearcher groupLiveSearcher; private I18nTranslatorComponent i18nTranslatorSearch; - private UserLiveSearchComponent userLiveSearch; + private UserLiveSearcher userLiveSearch; public WorkspaceUIComponents(final WorkspacePresenter presenter) { } @@ -69,13 +69,6 @@ return contentToolBar; } - public GroupLiveSearchComponent getGroupLiveSearchComponent() { - if (groupLiveSearch == null) { - groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent(); - } - return groupLiveSearch; - } - public I18nTranslatorComponent getI18nTranslatorComponent() { if (i18nTranslatorSearch == null) { i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent(); @@ -90,11 +83,4 @@ return license; } - public UserLiveSearchComponent getUserLiveSearchComponent() { - if (userLiveSearch == null) { - userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent(); - } - return userLiveSearch; - } - } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java 2008-07-26 16:44:17 UTC (rev 816) @@ -22,7 +22,6 @@ import java.util.HashMap; import java.util.Iterator; -import org.ourproject.kune.platf.client.services.ColorTheme; import org.ourproject.kune.platf.client.tool.ToolTrigger; import org.ourproject.kune.platf.client.tool.ToolTrigger.TriggerListener; import org.ourproject.kune.platf.client.ui.HasColor; @@ -38,70 +37,70 @@ private static final String ITEM_NOT_SELECTED = "kune-GroupToolsBar-itemNotSelected"; private Widget currentTab; private final HashMap<String, Widget> tabs; - private final ColorTheme colorTheme; - public GroupToolsBar(final ColorTheme colorTheme) { - this.colorTheme = colorTheme; - tabs = new HashMap<String, Widget>(); - currentTab = null; - addStyleName("kune-GroupToolsBar"); + public GroupToolsBar() { + // this.colorTheme = colorTheme; + tabs = new HashMap<String, Widget>(); + currentTab = null; + addStyleName("kune-GroupToolsBar"); } public void addItem(final ToolTrigger trigger) { - final int nextIndex = this.getWidgetCount(); - final Widget menuItem = createItem(nextIndex, trigger); - setTabSelected(menuItem, false); - tabs.put(trigger.getName(), menuItem); - this.add(menuItem); + final int nextIndex = this.getWidgetCount(); + final Widget menuItem = createItem(nextIndex, trigger); + setTabSelected(menuItem, false); + tabs.put(trigger.getName(), menuItem); + this.add(menuItem); } public void selectItem(final String toolName) { - if (currentTab != null) { - setTabSelected(currentTab, false); - } - currentTab = getWidget(toolName); - setTabSelected(currentTab, true); + if (currentTab != null) { + setTabSelected(currentTab, false); + } + currentTab = getWidget(toolName); + setTabSelected(currentTab, true); } public void setTabsColors(final String selectedColor, final String unSelectedColor) { - final Iterator<Widget> iter = tabs.values().iterator(); - while (iter.hasNext()) { - final Widget w = iter.next(); - if (w == currentTab) { - ((HasColor) w).setColor(selectedColor); - } else { - ((HasColor) w).setColor(unSelectedColor); - } - } + final Iterator<Widget> iter = tabs.values().iterator(); + while (iter.hasNext()) { + final Widget w = iter.next(); + if (w == currentTab) { + ((HasColor) w).setColor(selectedColor); + } else { + ((HasColor) w).setColor(unSelectedColor); + } + } } private Widget createItem(final int index, final ToolTrigger trigger) { - final SimplePanel menuItem = new SimplePanel(); - addStyleName("Tab"); - final Hyperlink hl = new Hyperlink(trigger.getLabel(), ""); - trigger.setListener(new TriggerListener() { - public void onStateChanged(final String encoded) { - hl.setTargetHistoryToken(encoded); - } - }); - menuItem.add(hl); - return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT); + final SimplePanel menuItem = new SimplePanel(); + addStyleName("Tab"); + final Hyperlink hl = new Hyperlink(trigger.getLabel(), ""); + trigger.setListener(new TriggerListener() { + public void onStateChanged(final String encoded) { + hl.setTargetHistoryToken(encoded); + } + }); + menuItem.add(hl); + return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT); } private Widget getWidget(final String toolName) { - return tabs.get(toolName); + return tabs.get(toolName); } private void setTabSelected(final Widget tab, final boolean isSelected) { - if (isSelected) { - tab.removeStyleName(ITEM_NOT_SELECTED); - tab.addStyleName(ITEM_SELECTED); - } else { - tab.removeStyleName(ITEM_SELECTED); - tab.addStyleName(ITEM_NOT_SELECTED); - } - String color = isSelected ? colorTheme.getToolSelected() : colorTheme.getToolUnselected(); - ((HasColor) tab).setColor(color); + if (isSelected) { + tab.removeStyleName(ITEM_NOT_SELECTED); + tab.addStyleName(ITEM_SELECTED); + } else { + tab.removeStyleName(ITEM_SELECTED); + tab.addStyleName(ITEM_NOT_SELECTED); + } + // tring color = isSelected ? colorTheme.getToolSelected() : + // colorTheme.getToolUnselected(); + // ((HasColor) tab).setColor(color); } } \ No newline at end of file Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-26 16:44:17 UTC (rev 816) @@ -22,7 +22,6 @@ import org.ourproject.kune.platf.client.View; import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId; -import org.ourproject.kune.platf.client.services.ColorTheme; import org.ourproject.kune.platf.client.services.I18nTranslationService; import org.ourproject.kune.platf.client.services.Images; import org.ourproject.kune.platf.client.tool.ToolTrigger; @@ -66,7 +65,6 @@ private DropDownPanel groupSummaryPanel; private final VerticalPanel cntcxtVP; private final ScrollPanel groupDropDownsSP; - private final ColorTheme colorTheme; private final BottomIconsTrayPanel bottomIconsTrayPanel; private ContentTitlePanel contentTitlePanel; private ContentSubTitlePanel contentSubTitlePanel; @@ -81,10 +79,8 @@ private int previousRightWidgetWidth; private final WorkspacePresenter presenter; - public WorkspacePanel(final WorkspacePresenter presenter, final I18nTranslationService i18n, - final ColorTheme colorTheme) { + public WorkspacePanel(final WorkspacePresenter presenter, final I18nTranslationService i18n) { this.presenter = presenter; - this.colorTheme = colorTheme; // Initialize final VerticalPanel generalVP = new VerticalPanel(); initWidget(generalVP); @@ -92,7 +88,7 @@ final HorizontalPanel generalHP = new HorizontalPanel(); cntcxtVP = new VerticalPanel(); final VerticalPanel groupNavBarVP = new VerticalPanel(); - groupToolsBar = new GroupToolsBar(colorTheme); + groupToolsBar = new GroupToolsBar(); bottomIconsTrayPanel = new BottomIconsTrayPanel(); groupDropDownsSP = new ScrollPanel(); groupDropDownsVP = new VerticalPanel(); @@ -156,7 +152,7 @@ addStyleName("kune-WorkspacePanel"); setGroupLogo(""); generalHP.addStyleName("GeneralHP"); - contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder()); + // contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder()); contentTitleBarHP.setWidth("100%"); contentSubTitleBarHP.setWidth("100%"); contentTitleBarHP.addStyleName("kune-ContentTitleBar"); @@ -172,7 +168,7 @@ contentBottomBarHP.addStyleName("kune-ContentBottomBar"); contentBottomBarHP.addStyleName("kune-ft12px"); groupDropDownsVP.addStyleName("kune-GroupSummaryPanel"); - bottomBorderDecorator.setColor(colorTheme.getContentMainBorder()); + // bottomBorderDecorator.setColor(colorTheme.getContentMainBorder()); bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l"); bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel"); bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); @@ -281,12 +277,12 @@ public void setGroupMembers(final View view) { groupMembersPanel = (DropDownPanel) view; - AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD()); + // AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD()); } public void setParticipation(final View view) { participationPanel = (DropDownPanel) view; - AddDropDown(participationPanel, colorTheme.getParticipationDD()); + // AddDropDown(participationPanel, colorTheme.getParticipationDD()); } public void setPutYourLogoVisible(final boolean visible) { @@ -295,12 +291,12 @@ public void setSummary(final View view) { groupSummaryPanel = (DropDownPanel) view; - AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD()); + // AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD()); } public void setTags(final View view) { tagsPanel = (DropDownPanel) view; - AddDropDown(tagsPanel, colorTheme.getTagsDD()); + // AddDropDown(tagsPanel, colorTheme.getTagsDD()); } public void setTheme(final String theme) { Modified: trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java =================================================================== --- trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java 2008-07-26 11:38:54 UTC (rev 815) +++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java 2008-07-26 16:44:17 UTC (rev 816) @@ -9,43 +9,50 @@ public class KuneStringUtilsTest { @Test + public void testTagNull() { + final String tagsString = null; + final ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); + assertEquals(0, tags.size()); + } + + @Test public void testTagStripsSimple() { - String tagsString = "ab cd"; - ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); - assertEquals("ab", tags.get(0)); - assertEquals("cd", tags.get(1)); + final String tagsString = "ab cd"; + final ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); + assertEquals("ab", tags.get(0)); + assertEquals("cd", tags.get(1)); } @Test - public void testTagStripsWithQuotes() { - String tagsString = "ab \"cd\""; - ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); - assertEquals("ab", tags.get(0)); - assertEquals("cd", tags.get(1)); + public void testTagStripsWithCommas() { + final String tagsString = "ab,cd"; + final ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); + assertEquals("ab", tags.get(0)); + assertEquals("cd", tags.get(1)); } @Test - public void testTagStripsWithSpaces() { - String tagsString = " ab cd "; - ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); - assertEquals("ab", tags.get(0)); - assertEquals("cd", tags.get(1)); + public void testTagStripsWithCommasAndSpaces() { + final String tagsString = "ab, cd"; + final ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); + assertEquals("ab", tags.get(0)); + assertEquals("cd", tags.get(1)); } @Test - public void testTagStripsWithCommas() { - String tagsString = "ab,cd"; - ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); - assertEquals("ab", tags.get(0)); - assertEquals("cd", tags.get(1)); + public void testTagStripsWithQuotes() { + final String tagsString = "ab \"cd\""; + final ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); + assertEquals("ab", tags.get(0)); + assertEquals("cd", tags.get(1)); } @Test - public void testTagStripsWithCommasAndSpaces() { - String tagsString = "ab, cd"; - ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); - assertEquals("ab", tags.get(0)); - assertEquals("cd", tags.get(1)); + public void testTagStripsWithSpaces() { + final String tagsString = " ab cd "; + final ArrayList<String> tags = KuneStringUtils.splitTags(tagsString); + assertEquals("ab", tags.get(0)); + assertEquals("cd", tags.get(1)); } }
participants (1)
-
vjrj