kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
July 2008
- 1 participants
- 43 discussions
Author: vjrj
Date: 2008-07-18 14:10:54 +0200 (Fri, 18 Jul 2008)
New Revision: 802
Modified:
sandbox3/src/main/java/org/op/client/Sandbox.java
sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java
sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java
Log:
new GridMenuPanel tests
Modified: sandbox3/src/main/java/org/op/client/Sandbox.java
===================================================================
--- sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-18 10:24:57 UTC (rev 801)
+++ sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-18 12:10:54 UTC (rev 802)
@@ -3,7 +3,9 @@
import org.op.client.gridmenu.GridGroup;
import org.op.client.gridmenu.GridItem;
import org.op.client.gridmenu.GridMenu;
+import org.op.client.gridmenu.GridMenuItem;
import org.op.client.gridmenu.GridMenuPanel;
+import org.op.client.gridmenu.GridMenuItem.GridMenuItemListener;
import org.ourproject.kune.platf.client.View;
import com.calclab.suco.client.signal.Slot;
@@ -177,6 +179,7 @@
final GridMenuPanel grid = new GridMenuPanel("Nada", true, true);
grid.getTopBar().addButton(new ToolbarButton("boton"));
grid.getBottomBar().addButton(new ToolbarButton("boton 2"));
+ grid.setEndIconVisible(false);
grid.onDoubleClick(new Slot<String>() {
public void onEvent(final String id) {
Window.alert("Double click, id: " + id);
@@ -197,12 +200,26 @@
item1.setGroup(collab);
item1.setTitleHtml("New fulano");
grid.updateItem(item1);
+ final GridMenuItem menuItem = new GridMenuItem("/arrow_in.png", "operation 1", new GridMenuItemListener() {
+ public void onClick() {
+ Window.alert("click");
+ }
+ });
+ final GridMenuItem menuItem2 = new GridMenuItem("/arrow_out.png", "operation 2", new GridMenuItemListener() {
+ public void onClick() {
+ Window.alert("click");
+ }
+ });
+ final GridMenu menu = new GridMenu();
+ menu.addMenuItem(menuItem);
+ menu.addMenuItem(menuItem2);
final GridItem item4bis = new GridItem(GridGroup.NoGridGroup, "4", "<a href=''>b2</a>", "fulan2",
- "<em>fulane</em>", "<b>k3</b>", "tooltiptitle", "tooptip", new GridMenu());
+ "<em>fulane</em>", "<b>k3</b>", "tooltiptitle", "tooptip", menu);
grid.removeItem(item4bis);
grid.addItem(item4bis);
grid.removeItem(item4bis);
grid.addItem(item4bis);
+
return grid;
}
}
Modified: sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java 2008-07-18 10:24:57 UTC (rev 801)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java 2008-07-18 12:10:54 UTC (rev 802)
@@ -38,15 +38,15 @@
menu = new Menu();
}
- public void addMenuItem(final GridMenuItem menuOpt) {
- final Item menuItem = new Item(menuOpt.getTitle());
- menuItem.setIconCls(menuOpt.getIconCls());
- menu.addItem(menuItem);
- menuItem.addListener(new BaseItemListenerAdapter() {
+ public void addMenuItem(final GridMenuItem menuItem) {
+ final Item item = new Item(menuItem.getTitle());
+ item.setIconCls(menuItem.getIconCls());
+ menu.addItem(item);
+ item.addListener(new BaseItemListenerAdapter() {
public void onClick(final BaseItem item, final EventObject e) {
DeferredCommand.addCommand(new Command() {
public void execute() {
- menuOpt.getListener().onClick();
+ menuItem.getListener().onClick();
}
});
}
@@ -63,7 +63,9 @@
}
public void showMenu(final EventObject e) {
- menu.showAt(e.getXY());
+ if (menu.getItems().length > 0) {
+ menu.showAt(e.getXY());
+ }
}
}
Modified: sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java 2008-07-18 10:24:57 UTC (rev 801)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java 2008-07-18 12:10:54 UTC (rev 802)
@@ -33,7 +33,6 @@
import com.gwtext.client.widgets.grid.GroupingView;
import com.gwtext.client.widgets.grid.Renderer;
import com.gwtext.client.widgets.grid.RowSelectionModel;
-import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
import com.gwtext.client.widgets.grid.event.GridRowListener;
import com.gwtext.client.widgets.layout.FitLayout;
@@ -50,7 +49,7 @@
private static final String END_ICON_HTML = "endIconHtmlField";
private static final String TOOLTIP = "tooltipField";
private static final String TOOLTIPTITLE = "tooltipTitleField";
- private final HashMap<Record, GridMenu> menuMap;
+ private final HashMap<String, GridMenu> menuMap;
private final HashMap<String, Record> recordMap;
private RecordDef recordDef;
private GroupingStore store;
@@ -65,6 +64,7 @@
private final String emptyText;
private final GridDragConfiguration gridDragConfiguration;
private final GridDropConfiguration gridDropConfiguration;
+ private ColumnModel columnModel;
public GridMenuPanel(final String emptyText) {
this(emptyText, null, null, false, false);
@@ -90,7 +90,7 @@
panel = new Panel();
panel.setBorder(false);
panel.setLayout(new FitLayout());
- menuMap = new HashMap<Record, GridMenu>();
+ menuMap = new HashMap<String, GridMenu>();
recordMap = new HashMap<String, Record>();
}
@@ -102,14 +102,14 @@
if (grid == null) {
createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
}
- final Record newRecord = recordDef.createRecord(item.getId(),
+ final String id = item.getId();
+ final Record newRecord = recordDef.createRecord(id,
new Object[] { item.getGroup().getName(), item.getGroup().getTooltipTitle(),
- item.getGroup().getTooltip(), item.getId(), item.getIconHtml(), item.getTitle(),
- item.getTitleHtml(), item.getEndIconHtml(), item.getTooltipTitle(), item.getTooltip() });
- recordMap.put(item.getId(), newRecord);
+ item.getGroup().getTooltip(), id, item.getIconHtml(), item.getTitle(), item.getTitleHtml(),
+ item.getEndIconHtml(), item.getTooltipTitle(), item.getTooltip() });
+ recordMap.put(id, newRecord);
store.addSorted(newRecord);
- // store.groupBy(GROUP);
- menuMap.put(newRecord, item.getMenu());
+ menuMap.put(id, item.getMenu());
sort();
doLayoutIfNeeded();
}
@@ -187,6 +187,14 @@
}
}
+ public void setEndIconVisible(final boolean visible) {
+ if (grid == null) {
+ createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
+ }
+ columnModel.setHidden(2, !visible);
+ doLayoutIfNeeded();
+ }
+
public void setWidth(final int width) {
// Log.info("Grid width: " + width);
grid.setWidth(width - 27);
@@ -199,7 +207,8 @@
}
public void updateItem(final GridItem item) {
- final Record record = recordMap.get(item.getId());
+ final String id = item.getId();
+ final Record record = recordMap.get(id);
if (record != null) {
record.set(GROUP, item.getGroup().getName());
record.set(GROUP_TOOLTIP_TITLE, item.getGroup().getTooltipTitle());
@@ -211,11 +220,11 @@
record.set(TOOLTIPTITLE, item.getTooltipTitle());
record.set(TOOLTIP, item.getTooltip());
store.commitChanges();
- menuMap.put(record, item.getMenu());
+ menuMap.put(id, item.getMenu());
sort();
doLayoutIfNeeded();
} else {
- Log.error("Trying to update a non existing item: " + item.getId());
+ Log.error("Trying to update a non existing item: " + id);
}
}
@@ -305,21 +314,16 @@
};
final ColumnConfig[] columnsConfigs = new ColumnConfig[] {
- new ColumnConfig("Icon", ICON_HTML, 18, false, iconHtmlRenderer, ICON_HTML),
- new ColumnConfig("Title", TITLE_HTML, 24, true, titleHtmlRenderer, TITLE_HTML),
+ new ColumnConfig("Icon", ICON_HTML, 3, false, iconHtmlRenderer, ICON_HTML),
+ new ColumnConfig("Title", TITLE_HTML, 10, true, titleHtmlRenderer, TITLE_HTML),
new ColumnConfig("EndIcon", END_ICON_HTML, 18, false, endIconHtmlRenderer, END_ICON_HTML),
new ColumnConfig(GROUP, GROUP, 0) };
- final ColumnModel columnModel = new ColumnModel(columnsConfigs);
+ columnModel = new ColumnModel(columnsConfigs);
grid.setColumnModel(columnModel);
grid.setAutoExpandColumn(TITLE_HTML);
grid.setSelectionModel(new RowSelectionModel());
- grid.addGridCellListener(new GridCellListenerAdapter() {
- @Override
- public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
- onDoubleClick(rowIndex);
- }
- });
+
grid.addGridRowListener(new GridRowListener() {
public void onRowClick(final GridPanel grid, final int rowIndex, final EventObject e) {
showMenu(rowIndex, e);
@@ -331,14 +335,15 @@
}
public void onRowDblClick(final GridPanel grid, final int rowIndex, final EventObject e) {
- Log.debug("Row double click");
onDoubleClick(rowIndex);
}
private void showMenu(final int rowIndex, final EventObject e) {
final Record record = store.getRecordAt(rowIndex);
- final GridMenu menu = menuMap.get(record);
- menu.showMenu(e);
+ final GridMenu menu = menuMap.get(record.getAsString(ID));
+ if (menu != null) {
+ menu.showMenu(e);
+ }
}
});
grid.stripeRows(true);
1
0
r801 - in sandbox3: . src/main/java/org/op src/main/java/org/op/client src/main/java/org/op/client/gridmenu
by vjrj 18 Jul '08
by vjrj 18 Jul '08
18 Jul '08
Author: vjrj
Date: 2008-07-18 12:24:57 +0200 (Fri, 18 Jul 2008)
New Revision: 801
Added:
sandbox3/src/main/java/org/op/client/gridmenu/
sandbox3/src/main/java/org/op/client/gridmenu/GridDragConfiguration.java
sandbox3/src/main/java/org/op/client/gridmenu/GridDropConfiguration.java
sandbox3/src/main/java/org/op/client/gridmenu/GridGroup.java
sandbox3/src/main/java/org/op/client/gridmenu/GridItem.java
sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java
sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItem.java
sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItemCollection.java
sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java
Modified:
sandbox3/pom.xml
sandbox3/src/main/java/org/op/Sandbox.gwt.xml
sandbox3/src/main/java/org/op/client/Sandbox.java
Log:
new GridMenuPanel tests
Modified: sandbox3/pom.xml
===================================================================
--- sandbox3/pom.xml 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/pom.xml 2008-07-18 10:24:57 UTC (rev 801)
@@ -119,7 +119,7 @@
<dependency>
<groupId>com.allen_sauer.gwt.log.gwt-log</groupId>
<artifactId>gwt-log</artifactId>
- <version>1.5.6</version>
+ <version>2.5.0</version>
</dependency>
<!-- ui -->
Modified: sandbox3/src/main/java/org/op/Sandbox.gwt.xml
===================================================================
--- sandbox3/src/main/java/org/op/Sandbox.gwt.xml 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/Sandbox.gwt.xml 2008-07-18 10:24:57 UTC (rev 801)
@@ -4,6 +4,8 @@
<inherits name="org.ourproject.kune.platf.Kune-Platform" />
+ <inherits name="com.calclab.suco.Suco" />
+
<inherits name='com.gwtext.GwtExt' />
<script src="js/ext/adapter/ext/ext-base.js" />
<script src="js/ext/ext-all.js" />
Modified: sandbox3/src/main/java/org/op/client/Sandbox.java
===================================================================
--- sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -1,13 +1,22 @@
package org.op.client;
+import org.op.client.gridmenu.GridGroup;
+import org.op.client.gridmenu.GridItem;
+import org.op.client.gridmenu.GridMenu;
+import org.op.client.gridmenu.GridMenuPanel;
import org.ourproject.kune.platf.client.View;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MenuBar;
+import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.QuickTips;
+import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.Viewport;
import com.gwtext.client.widgets.layout.FitLayout;
@@ -96,6 +105,12 @@
// form.addTab("Segundo", tab2);
// dialog.add(form.getForm());
+ QuickTips.init(); // extgwt tips
+ // final QuickTip quickTipInstance = QuickTips.getQuickTip();
+ // quickTipInstance.setDismissDelay(8000);
+ // quickTipInstance.setHideDelay(500);
+ // quickTipInstance.setInterceptTitles(true);
+
final Workspace wk = new Workspace();
// EntityCnt ent = new EntityCnt();
@@ -127,7 +142,7 @@
wk.getEntityWorkspace().setContainer(new LabelWrapper(LOREM));
wk.getEntityWorkspace().setContent(new LabelWrapper(LOREM));
wk.getEntitySummary().addInTools(new Label("doc"));
- wk.getEntitySummary().addInSummary(new LabelWrapper(LOREM));
+ // wk.getEntitySummary().addInSummary(new LabelWrapper(LOREM));
wk.getEntityWorkspace().getBottomTitle().addSpacer();
wk.getEntityWorkspace().getBottomTitle().add(new LabelWrapper("Bottom"));
wk.getEntityWorkspace().getTitle().add(new LabelWrapper("Title"));
@@ -148,7 +163,46 @@
wk.getSiteBar().addFill();
wk.getSiteBar().addSeparator();
wk.getSiteBar().add(new LabelWrapper("sitebar-right"));
+
+ final Button button = new Button("kk");
+ button.setTooltip("tooltip");
+ wk.getEntityWorkspace().getContainerTopBar().add(button);
wk.setTheme(WsTheme.def);
wk.setTheme(WsTheme.green);
+ wk.getEntitySummary().addInSummary(createGridSample());
+ // wk.getEntitySummary().addInSummary(new GridGroupingSample());
}
+
+ private GridMenuPanel createGridSample() {
+ final GridMenuPanel grid = new GridMenuPanel("Nada", true, true);
+ grid.getTopBar().addButton(new ToolbarButton("boton"));
+ grid.getBottomBar().addButton(new ToolbarButton("boton 2"));
+ grid.onDoubleClick(new Slot<String>() {
+ public void onEvent(final String id) {
+ Window.alert("Double click, id: " + id);
+ }
+ });
+ final GridGroup admins = new GridGroup("Admins", "Admins Title", "some admin tooltip", true);
+ final GridGroup collab = new GridGroup("Collabs", "Collabs Title", "some collab tooltip", true);
+ final GridItem item1 = new GridItem(admins, "1", "<a href=''>kk</a>", "fulano", "<em>fulano</em>", "<b>kk</b>",
+ "tooltiptitle", "tooptip", new GridMenu());
+ grid.addItem(item1);
+ grid.addItem(new GridItem(admins, "3", "<a href=''>kk</a>", "afulano", "<em>afulano</em>", "<b>k3</b>",
+ "tooltiptitle", "tooptip", new GridMenu()));
+ grid.addItem(new GridItem(collab, "2", "<a href=''>bb</a>", "fulana", "<em>fulana</em>", "<b>k2</b>",
+ "tooltiptitle", "tooptip", new GridMenu()));
+ final GridItem item4 = new GridItem(GridGroup.NoGridGroup, "4", "<a href=''>b2</a>", "fulan2",
+ "<em>fulane</em>", "<b>k3</b>", "tooltiptitle", "tooptip", new GridMenu());
+ grid.addItem(item4);
+ item1.setGroup(collab);
+ item1.setTitleHtml("New fulano");
+ grid.updateItem(item1);
+ final GridItem item4bis = new GridItem(GridGroup.NoGridGroup, "4", "<a href=''>b2</a>", "fulan2",
+ "<em>fulane</em>", "<b>k3</b>", "tooltiptitle", "tooptip", new GridMenu());
+ grid.removeItem(item4bis);
+ grid.addItem(item4bis);
+ grid.removeItem(item4bis);
+ grid.addItem(item4bis);
+ return grid;
+ }
}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridDragConfiguration.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridDragConfiguration.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridDragConfiguration.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,42 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * 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.op.client.gridmenu;
+
+public class GridDragConfiguration {
+
+ private final String ddGroupId;
+ private final String dragMessage;
+
+ public GridDragConfiguration(final String ddGroupId, final String dragMessage) {
+ this.ddGroupId = ddGroupId;
+ this.dragMessage = dragMessage;
+ }
+
+ public String getDdGroupId() {
+ return ddGroupId;
+ }
+
+ public String getDragMessage() {
+ return dragMessage;
+ }
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridDropConfiguration.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridDropConfiguration.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridDropConfiguration.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,50 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * 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.op.client.gridmenu;
+
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Slot;
+
+public class GridDropConfiguration {
+
+ private final String ddGroupId;
+ private final Signal<String> onDrop;
+
+ public GridDropConfiguration(final String ddGroupId, final Slot<String> slot) {
+ this.ddGroupId = ddGroupId;
+ this.onDrop = new Signal<String>("onDrop");
+ this.onDrop(slot);
+ }
+
+ public void fire(final String id) {
+ onDrop.fire(id);
+ }
+
+ public String getDdGroupId() {
+ return ddGroupId;
+ }
+
+ public void onDrop(final Slot<String> slot) {
+ onDrop.add(slot);
+ }
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridGroup.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridGroup.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridGroup.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,41 @@
+package org.op.client.gridmenu;
+
+public class GridGroup {
+
+ public static GridGroup NoGridGroup = new GridGroup("", "", "", false);
+
+ private String name;
+ private String tooltipTitle;
+ private String tooltip;
+
+ public GridGroup(final String name, final String tooltipTitle, final String tooltip, final boolean countVisible) {
+ this.name = name;
+ this.tooltipTitle = tooltipTitle;
+ this.tooltip = tooltip;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getTooltip() {
+ return tooltip;
+ }
+
+ public String getTooltipTitle() {
+ return tooltipTitle;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public void setTooltip(final String tooltip) {
+ this.tooltip = tooltip;
+ }
+
+ public void setTooltipTitle(final String tooltipTitle) {
+ this.tooltipTitle = tooltipTitle;
+ }
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridItem.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridItem.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridItem.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,101 @@
+package org.op.client.gridmenu;
+
+public class GridItem {
+
+ private GridGroup group;
+ private String id;
+ private String iconHtml;
+ private String title;
+ private String titleHtml;
+ private String endIconHtml;
+ private String tooltip;
+ private String tooltipTitle;
+ private GridMenu menu;
+
+ public GridItem(final GridGroup group, final String id, final String iconHtml, final String title,
+ final String titleHtml, final String endIconHtml, final String tooltipTitle, final String tooltip,
+ final GridMenu menu) {
+ this.group = group;
+ this.id = id;
+ this.iconHtml = iconHtml;
+ this.title = title;
+ this.titleHtml = titleHtml;
+ this.endIconHtml = endIconHtml;
+ this.tooltip = tooltip;
+ this.tooltipTitle = tooltipTitle;
+ this.menu = menu;
+ }
+
+ public String getEndIconHtml() {
+ return endIconHtml;
+ }
+
+ public GridGroup getGroup() {
+ return group;
+ }
+
+ public String getIconHtml() {
+ return iconHtml;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public GridMenu getMenu() {
+ return menu;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getTitleHtml() {
+ return titleHtml;
+ }
+
+ public String getTooltip() {
+ return tooltip;
+ }
+
+ public String getTooltipTitle() {
+ return tooltipTitle;
+ }
+
+ public void setEndIconHtml(final String endIconHtml) {
+ this.endIconHtml = endIconHtml;
+ }
+
+ public void setGroup(final GridGroup group) {
+ this.group = group;
+ }
+
+ public void setIconHtml(final String iconHtml) {
+ this.iconHtml = iconHtml;
+ }
+
+ public void setId(final String id) {
+ this.id = id;
+ }
+
+ public void setMenu(final GridMenu menu) {
+ this.menu = menu;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public void setTitleHtml(final String titleHtml) {
+ this.titleHtml = titleHtml;
+ }
+
+ public void setTooltip(final String tooltip) {
+ this.tooltip = tooltip;
+ }
+
+ public void setTooltipTitle(final String tooltipTitle) {
+ this.tooltipTitle = tooltipTitle;
+ }
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridMenu.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,69 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * 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.op.client.gridmenu;
+
+import java.util.Iterator;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class GridMenu {
+ private final Menu menu;
+
+ public GridMenu() {
+ menu = new Menu();
+ }
+
+ public void addMenuItem(final GridMenuItem menuOpt) {
+ final Item menuItem = new Item(menuOpt.getTitle());
+ menuItem.setIconCls(menuOpt.getIconCls());
+ menu.addItem(menuItem);
+ menuItem.addListener(new BaseItemListenerAdapter() {
+ public void onClick(final BaseItem item, final EventObject e) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ menuOpt.getListener().onClick();
+ }
+ });
+ }
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ public void setMenuItemList(final GridMenuItemCollection list) {
+ menu.removeAll();
+ for (final Iterator iterator = list.iterator(); iterator.hasNext();) {
+ final GridMenuItem item = (GridMenuItem) iterator.next();
+ addMenuItem(item);
+ }
+ }
+
+ public void showMenu(final EventObject e) {
+ menu.showAt(e.getXY());
+ }
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItem.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItem.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItem.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,31 @@
+package org.op.client.gridmenu;
+
+public class GridMenuItem {
+
+ public interface GridMenuItemListener {
+ public void onClick();
+ }
+
+ final String iconCls;
+ final String title;
+ final GridMenuItemListener listener;
+
+ public GridMenuItem(final String iconCls, final String title, final GridMenuItemListener listener) {
+ this.iconCls = iconCls;
+ this.title = title;
+ this.listener = listener;
+ }
+
+ public String getIconCls() {
+ return iconCls;
+ }
+
+ public GridMenuItemListener getListener() {
+ return listener;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItemCollection.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItemCollection.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridMenuItemCollection.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,30 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * 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.op.client.gridmenu;
+
+import java.util.ArrayList;
+
+public class GridMenuItemCollection extends ArrayList<GridMenuItem> {
+
+ private static final long serialVersionUID = 1L;
+
+}
Added: sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java
===================================================================
--- sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java 2008-07-12 13:46:02 UTC (rev 800)
+++ sandbox3/src/main/java/org/op/client/gridmenu/GridMenuPanel.java 2008-07-18 10:24:57 UTC (rev 801)
@@ -0,0 +1,406 @@
+package org.op.client.gridmenu;
+
+import java.util.HashMap;
+
+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.ui.Composite;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.SortDir;
+import com.gwtext.client.data.ArrayReader;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.GroupingStore;
+import com.gwtext.client.data.MemoryProxy;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.RecordDef;
+import com.gwtext.client.data.SortState;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.dd.DragData;
+import com.gwtext.client.dd.DragSource;
+import com.gwtext.client.dd.DropTarget;
+import com.gwtext.client.dd.DropTargetConfig;
+import com.gwtext.client.util.Format;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.grid.CellMetadata;
+import com.gwtext.client.widgets.grid.ColumnConfig;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.GridDragData;
+import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.GridView;
+import com.gwtext.client.widgets.grid.GroupingView;
+import com.gwtext.client.widgets.grid.Renderer;
+import com.gwtext.client.widgets.grid.RowSelectionModel;
+import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
+import com.gwtext.client.widgets.grid.event.GridRowListener;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class GridMenuPanel extends Composite {
+ public static final String GRID_MENU_PANEL_DD = "gridMenuPanelDD";
+ public static final int DEFAULT_INITIAL_WIDTH = 150;
+ private static final String GROUP = "groupField";
+ private static final String GROUP_TOOLTIP_TITLE = "groupTooltipTitleField";
+ private static final String GROUP_TOOLTIP = "groupTooltipField";
+ private static final String ID = "idField";
+ private static final String ICON_HTML = "iconHtmlField";
+ private static final String TITLE = "titleField";
+ private static final String TITLE_HTML = "titleHtmlField";
+ private static final String END_ICON_HTML = "endIconHtmlField";
+ private static final String TOOLTIP = "tooltipField";
+ private static final String TOOLTIPTITLE = "tooltipTitleField";
+ private final HashMap<Record, GridMenu> menuMap;
+ private final HashMap<String, Record> recordMap;
+ private RecordDef recordDef;
+ private GroupingStore store;
+ private GridPanel grid;
+ private final Panel panel;
+ private final boolean grouped;
+ private final boolean withCounters;
+ private final Signal<String> onClick;
+ private final Signal<String> onDoubleClick;
+ private Toolbar topBar;
+ private Toolbar bottomBar;
+ private final String emptyText;
+ private final GridDragConfiguration gridDragConfiguration;
+ private final GridDropConfiguration gridDropConfiguration;
+
+ public GridMenuPanel(final String emptyText) {
+ this(emptyText, null, null, false, false);
+ }
+
+ public GridMenuPanel(final String emptyText, final boolean grouped, final boolean withCounters) {
+ this(emptyText, null, null, grouped, withCounters);
+ }
+
+ public GridMenuPanel(final String emptyText, final GridDragConfiguration gridDragConfiguration) {
+ this(emptyText, gridDragConfiguration, null, false, false);
+ }
+
+ public GridMenuPanel(final String emptyText, final GridDragConfiguration gridDragConfiguration,
+ final GridDropConfiguration gridDropConfiguration, final boolean grouped, final boolean withCounters) {
+ this.emptyText = emptyText;
+ this.gridDragConfiguration = gridDragConfiguration;
+ this.gridDropConfiguration = gridDropConfiguration;
+ this.onClick = new Signal<String>("onClick");
+ this.onDoubleClick = new Signal<String>("onDoubleClick");
+ this.grouped = grouped;
+ this.withCounters = withCounters;
+ panel = new Panel();
+ panel.setBorder(false);
+ panel.setLayout(new FitLayout());
+ menuMap = new HashMap<Record, GridMenu>();
+ recordMap = new HashMap<String, Record>();
+ }
+
+ public GridMenuPanel(final String emptyText, final GridDropConfiguration gridDropConfiguration) {
+ this(emptyText, null, gridDropConfiguration, false, false);
+ }
+
+ public void addItem(final GridItem item) {
+ if (grid == null) {
+ createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
+ }
+ final Record newRecord = recordDef.createRecord(item.getId(),
+ new Object[] { item.getGroup().getName(), item.getGroup().getTooltipTitle(),
+ item.getGroup().getTooltip(), item.getId(), item.getIconHtml(), item.getTitle(),
+ item.getTitleHtml(), item.getEndIconHtml(), item.getTooltipTitle(), item.getTooltip() });
+ recordMap.put(item.getId(), newRecord);
+ store.addSorted(newRecord);
+ // store.groupBy(GROUP);
+ menuMap.put(newRecord, item.getMenu());
+ sort();
+ doLayoutIfNeeded();
+ }
+
+ public void confDropInPanel(final Panel panel, final GridDropConfiguration gridDropConfiguration) {
+ // FIXME: This doesn't works :-/
+ // http://extjs.com/forum/showthread.php?t=18105
+ final DropTargetConfig dCfg = new DropTargetConfig();
+ dCfg.setTarget(true);
+ dCfg.setdDdGroup(gridDropConfiguration.getDdGroupId());
+ new DropTarget(panel, dCfg) {
+ @Override
+ public boolean notifyDrop(final DragSource src, final EventObject e, final DragData dragData) {
+ if (dragData instanceof GridDragData) {
+ final GridDragData gridDragData = (GridDragData) dragData;
+ final Record[] records = gridDragData.getSelections();
+ for (int i = 0; i < records.length; i++) {
+ gridDropConfiguration.fire(records[i].getAsString(ID));
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String notifyEnter(final DragSource src, final EventObject e, final DragData data) {
+ return "x-tree-drop-ok-append";
+ }
+
+ @Override
+ public String notifyOver(final DragSource src, final EventObject e, final DragData data) {
+ return "x-tree-drop-ok-append";
+ }
+ };
+ }
+
+ public Toolbar getBottomBar() {
+ if (bottomBar == null) {
+ bottomBar = new Toolbar();
+ panel.setBottomToolbar(bottomBar);
+ }
+ return bottomBar;
+ }
+
+ public Toolbar getTopBar() {
+ if (topBar == null) {
+ topBar = new Toolbar();
+ panel.setTopToolbar(topBar);
+ }
+ return topBar;
+ }
+
+ public void onClick(final Slot<String> slot) {
+ onClick.add(slot);
+ }
+
+ public void onDoubleClick(final Slot<String> slot) {
+ onDoubleClick.add(slot);
+ }
+
+ public void removeAll() {
+ store.removeAll();
+ recordMap.clear();
+ menuMap.clear();
+ }
+
+ public void removeItem(final GridItem item) {
+ final Record record = recordMap.get(item.getId());
+ if (record != null) {
+ menuMap.remove(record);
+ store.remove(record);
+ recordMap.remove(record);
+ doLayoutIfNeeded();
+ } else {
+ Log.error("Trying to remove a non existing item: " + item.getId());
+ }
+ }
+
+ public void setWidth(final int width) {
+ // Log.info("Grid width: " + width);
+ grid.setWidth(width - 27);
+ panel.setWidth(width - 25);
+ doLayoutIfNeeded();
+ }
+
+ public void sort() {
+ store.sort(GROUP);
+ }
+
+ public void updateItem(final GridItem item) {
+ final Record record = recordMap.get(item.getId());
+ if (record != null) {
+ record.set(GROUP, item.getGroup().getName());
+ record.set(GROUP_TOOLTIP_TITLE, item.getGroup().getTooltipTitle());
+ record.set(GROUP_TOOLTIP, item.getGroup().getTooltip());
+ record.set(ICON_HTML, item.getIconHtml());
+ record.set(TITLE, item.getTitle());
+ record.set(TITLE_HTML, item.getTitleHtml());
+ record.set(END_ICON_HTML, item.getEndIconHtml());
+ record.set(TOOLTIPTITLE, item.getTooltipTitle());
+ record.set(TOOLTIP, item.getTooltip());
+ store.commitChanges();
+ menuMap.put(record, item.getMenu());
+ sort();
+ doLayoutIfNeeded();
+ } else {
+ Log.error("Trying to update a non existing item: " + item.getId());
+ }
+ }
+
+ private void configureDrag(final GridDragConfiguration gridDragConfiguration) {
+ // TODO: put this in GDConf
+ grid.setEnableDragDrop(true);
+ grid.setDdGroup(gridDragConfiguration.getDdGroupId());
+ grid.setDragDropText(gridDragConfiguration.getDragMessage());
+ }
+
+ private void configureDrop(final GridDropConfiguration gridDropConfiguration) {
+ // TODO: put this in GDConf
+ grid.setEnableDragDrop(true);
+ grid.setDdGroup(gridDropConfiguration.getDdGroupId());
+ final DropTargetConfig dCfg = new DropTargetConfig();
+ dCfg.setTarget(true);
+ dCfg.setdDdGroup(gridDropConfiguration.getDdGroupId());
+ new DropTarget(grid, dCfg) {
+ @Override
+ public boolean notifyDrop(final DragSource src, final EventObject e, final DragData dragData) {
+ if (dragData instanceof GridDragData) {
+ final GridDragData gridDragData = (GridDragData) dragData;
+ final Record[] records = gridDragData.getSelections();
+ for (int i = 0; i < records.length; i++) {
+ gridDropConfiguration.fire(records[i].getAsString(ID));
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String notifyEnter(final DragSource src, final EventObject e, final DragData data) {
+ return "x-tree-drop-ok-append";
+ }
+
+ @Override
+ public String notifyOver(final DragSource src, final EventObject e, final DragData data) {
+ return "x-tree-drop-ok-append";
+ }
+ };
+ }
+
+ private void createGrid(final String emptyText, final GridDragConfiguration gridDragConfiguration,
+ final GridDropConfiguration gridDropConfiguration) {
+ grid = new GridPanel();
+ final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef(GROUP),
+ new StringFieldDef(GROUP_TOOLTIP_TITLE), new StringFieldDef(GROUP_TOOLTIP), new StringFieldDef(ID),
+ new StringFieldDef(ICON_HTML), new StringFieldDef(TITLE), new StringFieldDef(TITLE_HTML),
+ new StringFieldDef(END_ICON_HTML), new StringFieldDef(TOOLTIPTITLE), new StringFieldDef(TOOLTIP) };
+ recordDef = new RecordDef(fieldDefs);
+
+ final MemoryProxy proxy = new MemoryProxy(new Object[][] {});
+
+ final ArrayReader reader = new ArrayReader(1, recordDef);
+ store = new GroupingStore(proxy, reader);
+ store.setSortInfo(new SortState(GROUP, SortDir.DESC));
+ store.setGroupField(GROUP);
+ store.setGroupOnSort(true);
+ store.load();
+ grid.setStore(store);
+
+ // TODO: Change this with a method that modify the html
+ final String commonTootipHtmlRender = "<span ext:qtitle=\"{1}\" ext:qtip=\"{2}\">{0}</span>";
+
+ final Renderer iconHtmlRenderer = new Renderer() {
+ public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
+ Store store) {
+ return Format.format(commonTootipHtmlRender, new String[] { record.getAsString(ICON_HTML),
+ record.getAsString(TOOLTIPTITLE), record.getAsString(TOOLTIP) });
+ }
+ };
+
+ final Renderer titleHtmlRenderer = new Renderer() {
+ public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
+ Store store) {
+ return Format.format(commonTootipHtmlRender, new String[] { record.getAsString(TITLE_HTML),
+ record.getAsString(TOOLTIPTITLE), record.getAsString(TOOLTIP) });
+ }
+ };
+
+ final Renderer endIconHtmlRenderer = new Renderer() {
+ public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
+ Store store) {
+ return Format.format(commonTootipHtmlRender, new String[] { record.getAsString(END_ICON_HTML),
+ record.getAsString(TOOLTIPTITLE), record.getAsString(TOOLTIP) });
+ }
+ };
+
+ final ColumnConfig[] columnsConfigs = new ColumnConfig[] {
+ new ColumnConfig("Icon", ICON_HTML, 18, false, iconHtmlRenderer, ICON_HTML),
+ new ColumnConfig("Title", TITLE_HTML, 24, true, titleHtmlRenderer, TITLE_HTML),
+ new ColumnConfig("EndIcon", END_ICON_HTML, 18, false, endIconHtmlRenderer, END_ICON_HTML),
+ new ColumnConfig(GROUP, GROUP, 0) };
+ final ColumnModel columnModel = new ColumnModel(columnsConfigs);
+ grid.setColumnModel(columnModel);
+
+ grid.setAutoExpandColumn(TITLE_HTML);
+ grid.setSelectionModel(new RowSelectionModel());
+ grid.addGridCellListener(new GridCellListenerAdapter() {
+ @Override
+ public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
+ onDoubleClick(rowIndex);
+ }
+ });
+ grid.addGridRowListener(new GridRowListener() {
+ public void onRowClick(final GridPanel grid, final int rowIndex, final EventObject e) {
+ showMenu(rowIndex, e);
+ onClick(rowIndex);
+ }
+
+ public void onRowContextMenu(final GridPanel grid, final int rowIndex, final EventObject e) {
+ showMenu(rowIndex, e);
+ }
+
+ public void onRowDblClick(final GridPanel grid, final int rowIndex, final EventObject e) {
+ Log.debug("Row double click");
+ onDoubleClick(rowIndex);
+ }
+
+ private void showMenu(final int rowIndex, final EventObject e) {
+ final Record record = store.getRecordAt(rowIndex);
+ final GridMenu menu = menuMap.get(record);
+ menu.showMenu(e);
+ }
+ });
+ grid.stripeRows(true);
+ grid.setAutoHeight(true);
+
+ if (grouped) {
+ final GroupingView groupView = new GroupingView();
+ groupView.setForceFit(true);
+ // http://www.gwt-ext.com/forum/viewtopic.php?f=7&t=1388&p=6789&hilit=setGroup…
+ if (withCounters) {
+ groupView.setGroupTextTpl("<span ext:qtip=\"{[values.rs[0].data[\"" + GROUP_TOOLTIP
+ + "\"]]}\">{[values.rs[0].data[\"" + GROUP + "\"]]} ({[values.rs.length]})</span>");
+ } else {
+ groupView.setGroupTextTpl("<span ext:qtip=\"{[values.rs[0].data[\"" + GROUP_TOOLTIP
+ + "\"]]}\">{[values.rs[0].data[\"" + GROUP + "\"]]}</span>");
+ }
+ // Other sample with condition:
+ // view.setGroupTextTpl("{text} ({[values.rs.length]}
+ // {[values.rs.length
+ // > 1 ? \"Items\" : \"Item\"]})");
+ groupView.setHideGroupedColumn(true);
+ groupView.setEmptyGroupText(emptyText);
+ groupView.setShowGroupsText(true);
+ groupView.setEnableNoGroups(true);
+ groupView.setEmptyText(emptyText);
+ groupView.setGroupByText(GROUP);
+ groupView.setIgnoreAdd(true);
+ groupView.setEnableGrouping(true);
+ grid.setView(groupView);
+ } else {
+ final GridView view = new GridView();
+ view.setForceFit(true);
+ grid.setView(view);
+ }
+ grid.setHideColumnHeader(true);
+ grid.setBorder(false);
+ grid.setAutoScroll(true);
+ if (gridDropConfiguration != null) {
+ configureDrop(gridDropConfiguration);
+ }
+ if (gridDragConfiguration != null) {
+ configureDrag(gridDragConfiguration);
+ } else {
+ grid.setDraggable(false);
+ }
+ panel.add(grid);
+ initWidget(panel);
+ }
+
+ private void doLayoutIfNeeded() {
+ if (panel.isRendered()) {
+ panel.doLayout();
+ }
+ }
+
+ private void onClick(final int rowIndex) {
+ final Record record = store.getRecordAt(rowIndex);
+ onClick.fire(record.getAsString(ID));
+ }
+
+ private void onDoubleClick(final int rowIndex) {
+ final Record record = store.getRecordAt(rowIndex);
+ onDoubleClick.fire(record.getAsString(ID));
+ }
+}
1
0
Author: vjrj
Date: 2008-07-12 15:46:02 +0200 (Sat, 12 Jul 2008)
New Revision: 800
Added:
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/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java
Modified:
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.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/WorkspacePanel.java
Log:
Workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -6,7 +6,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.workspace.Tags;
+import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.container.Provider;
@@ -27,7 +27,7 @@
builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() {
public DocumentFactory get() {
return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder
- .getInstance(Session.class), builder.getInstance(Tags.class));
+ .getInstance(Session.class), builder.getInstance(TagsSummary.class));
}
}, SingletonScope.class);
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -37,15 +37,15 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Tags;
+import org.ourproject.kune.workspace.client.workspace.TagsSummary;
public class AdminContextPresenter extends AbstractPresenter implements AdminContext {
private AdminContextView view;
private final Session session;
- private final Tags tags;
+ private final TagsSummary tags;
- public AdminContextPresenter(final Session session, final Tags tags) {
+ public AdminContextPresenter(final Session session, final TagsSummary tags) {
this.session = session;
this.tags = tags;
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -52,15 +52,15 @@
import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.workspace.Tags;
+import org.ourproject.kune.workspace.client.workspace.TagsSummary;
public class DocumentFactory {
private final I18nTranslationService i18n;
private final Session session;
- private final Tags tags;
+ private final TagsSummary tags;
- public DocumentFactory(final I18nTranslationService i18n, final Session session, final Tags tags) {
+ public DocumentFactory(final I18nTranslationService i18n, final Session session, final TagsSummary tags) {
this.i18n = i18n;
this.session = session;
this.tags = tags;
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -17,13 +17,22 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.presence.ui.GroupSummaryPanel;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
import org.ourproject.kune.workspace.client.search.SiteSearcherView;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.tags.TagsPresenter;
-import org.ourproject.kune.workspace.client.tags.ui.TagsPanel;
+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.ui.GroupMembersSummaryPanel;
+import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationSummaryPanel;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
+import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
+import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
@@ -40,7 +49,10 @@
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.Tags;
+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.ui.EntityLogo;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
@@ -211,16 +223,45 @@
final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
.getInstance(EntityTitlePresenter.class), builder.getInstance(EntitySubTitlePresenter.class),
builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class),
- builder.getInstance(Tags.class));
+ builder.getInstance(GroupMembersSummary.class),
+ builder.getInstance(ParticipationSummary.class), builder.getInstance(TagsSummary.class),
+ builder.getInstance(GroupSummary.class));
return presenter;
}
}, SingletonScope.class);
- builder.registerProvider(Tags.class, new Provider<Tags>() {
- public Tags get() {
- final TagsPresenter presenter = new TagsPresenter(builder.getProvider(Session.class), builder
- .getProvider(SiteSearcher.class));
- final TagsPanel panel = new TagsPanel(presenter, i18n, ws);
+ builder.registerProvider(GroupMembersSummary.class, new Provider<GroupMembersSummary>() {
+ public GroupMembersSummary get() {
+ final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n);
+ final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(GroupSummary.class, new Provider<GroupSummary>() {
+ public GroupSummary get() {
+ final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
+ final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(ParticipationSummary.class, new Provider<ParticipationSummary>() {
+ public ParticipationSummary get() {
+ final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n);
+ final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(TagsSummary.class, new Provider<TagsSummary>() {
+ public TagsSummary get() {
+ final TagsSummaryPresenter presenter = new TagsSummaryPresenter(builder.getProvider(Session.class),
+ builder.getProvider(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/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -116,7 +116,7 @@
final ParticipationDataDTO userParticipation = socialNet.getUserParticipation();
state.setGroupMembers(groupMembers);
state.setParticipation(userParticipation);
- setSocialNetwork(state);
+ ws.setSocialNetwork(state);
}
}
@@ -150,8 +150,6 @@
workspace.setContent(clientTool.getContent());
workspace.setContext(clientTool.getContext());
workspace.getLicenseComponent().setLicense(state);
- setSocialNetwork(state);
- workspace.getGroupSummaryComponent().setGroupSummary(state);
Site.hideProgress();
}
@@ -171,10 +169,4 @@
}
});
}
-
- private void setSocialNetwork(final StateDTO state) {
- workspace.getGroupMembersComponent().setGroupMembers(state);
- workspace.getParticipationComponent().setParticipation(state);
- }
-
}
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -42,24 +42,15 @@
import org.ourproject.kune.workspace.client.licensefoot.LicensePresenter;
import org.ourproject.kune.workspace.client.licensefoot.LicenseView;
import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel;
-import org.ourproject.kune.workspace.client.presence.ui.GroupSummaryPanel;
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.GroupMembersPresenter;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersView;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationPresenter;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationView;
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.GroupMembersPanel;
-import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationPanel;
import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearchPanel;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
+import org.ourproject.kune.workspace.client.theme.ThemeMenuPanel;
import org.ourproject.kune.workspace.client.theme.ThemeMenuPresenter;
import org.ourproject.kune.workspace.client.theme.ThemeMenuView;
-import org.ourproject.kune.workspace.client.theme.ui.ThemeMenuPanel;
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;
@@ -76,9 +67,6 @@
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.GroupMembersComponent;
-import org.ourproject.kune.workspace.client.workspace.GroupSummaryComponent;
-import org.ourproject.kune.workspace.client.workspace.ParticipationComponent;
import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent;
import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -151,20 +139,6 @@
return presenter;
}
- public static GroupMembersComponent createGroupMembersComponent() {
- final GroupMembersPresenter presenter = new GroupMembersPresenter(i18n);
- final GroupMembersView view = new GroupMembersPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static GroupSummaryComponent createGroupSummaryComponent() {
- final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
- final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme);
- presenter.init(view);
- return presenter;
- }
-
public static I18nTranslatorComponent createI18nTranslatorComponent() {
final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session);
final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
@@ -186,13 +160,6 @@
return presenter;
}
- public static ParticipationComponent createParticipationComponent() {
- final ParticipationPresenter presenter = new ParticipationPresenter(i18n);
- final ParticipationView view = new ParticipationPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
public static ThemeMenuComponent createThemeMenuComponent() {
final ThemeMenuPresenter presenter = new ThemeMenuPresenter();
final ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -37,30 +37,32 @@
private final Session session;
private final I18nTranslationService i18n;
+ @Deprecated
public AcceptJoinGroupAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.workspace = workspace;
- this.stateManager = stateManager;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.workspace = workspace;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
}
public void execute(final String groupShortName) {
- onAcceptJoinGroup(groupShortName);
+ onAcceptJoinGroup(groupShortName);
}
private void onAcceptJoinGroup(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.AcceptJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member accepted"));
- stateManager.setSocialNetwork(result);
- workspace.getGroupMembersComponent().showCollabs();
- }
- });
+ Site.showProgressProcessing();
+ final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
+ server.AcceptJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
+ groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+ public void onSuccess(final SocialNetworkResultDTO result) {
+ Site.hideProgress();
+ Site.info(i18n.t("Member accepted"));
+ stateManager.setSocialNetwork(result);
+ // FIXME
+ // workspace.getGroupMembersComponent().showCollabs();
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -30,6 +30,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.workspace.Workspace;
+@Deprecated
public class AddAdminAction implements Action<String> {
private final Workspace workspace;
@@ -38,29 +39,29 @@
private final I18nTranslationService i18n;
public AddAdminAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void execute(final String groupShortName) {
- onAddAdmin(groupShortName);
+ onAddAdmin(groupShortName);
}
private void onAddAdmin(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.addAdminMember(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 admin"));
- stateManager.setSocialNetwork(result);
- workspace.getGroupMembersComponent().showAdmins();
- }
- });
+ Site.showProgressProcessing();
+ final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
+ server.addAdminMember(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 admin"));
+ stateManager.setSocialNetwork(result);
+ // workspace.getGroupMembersComponent().showAdmins();
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -30,6 +30,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.workspace.Workspace;
+@Deprecated
public class AddCollabAction implements Action<String> {
private final Session session;
@@ -38,28 +39,28 @@
private final I18nTranslationService i18n;
public AddCollabAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void execute(final String groupShortName) {
- onAddCollab(groupShortName);
+ onAddCollab(groupShortName);
}
private void onAddCollab(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.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"));
- stateManager.setSocialNetwork(result);
- workspace.getGroupMembersComponent().showCollabs();
- }
- });
+ Site.showProgressProcessing();
+ final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
+ server.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"));
+ stateManager.setSocialNetwork(result);
+ // workspace.getGroupMembersComponent().showCollabs();
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -30,6 +30,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.workspace.Workspace;
+@Deprecated
public class SetAdminAsCollabAction implements Action<String> {
private final Session session;
@@ -38,28 +39,28 @@
private final I18nTranslationService i18n;
public SetAdminAsCollabAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void execute(final String value) {
- onSetAdminAsCollab(value);
+ onSetAdminAsCollab(value);
}
private void onSetAdminAsCollab(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.setAdminAsCollab(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Type of member changed"));
- stateManager.reload();
- workspace.getGroupMembersComponent().showCollabs();
- }
- });
+ Site.showProgressProcessing();
+ final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
+ server.setAdminAsCollab(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
+ groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+ public void onSuccess(final SocialNetworkResultDTO result) {
+ Site.hideProgress();
+ Site.info(i18n.t("Type of member changed"));
+ stateManager.reload();
+ // workspace.getGroupMembersComponent().showCollabs();
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -30,6 +30,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.workspace.Workspace;
+@Deprecated
public class SetCollabAsAdminAction implements Action<String> {
private final Session session;
@@ -38,30 +39,30 @@
private final I18nTranslationService i18n;
public SetCollabAsAdminAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void execute(final String value) {
- onSetCollabAsAdmin(value);
+ onSetCollabAsAdmin(value);
}
private void onSetCollabAsAdmin(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.setCollabAsAdmin(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Type of member changed"));
- stateManager.setSocialNetwork(result);
- workspace.getGroupMembersComponent().showAdmins();
- workspace.getGroupMembersComponent().showAdmins();
- }
- });
+ Site.showProgressProcessing();
+ final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
+ server.setCollabAsAdmin(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
+ groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+ public void onSuccess(final SocialNetworkResultDTO result) {
+ Site.hideProgress();
+ Site.info(i18n.t("Type of member changed"));
+ stateManager.setSocialNetwork(result);
+ // workspace.getGroupMembersComponent().showAdmins();
+ // workspace.getGroupMembersComponent().showAdmins();
+ }
+ });
}
}
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -20,26 +20,27 @@
package org.ourproject.kune.workspace.client.presence.ui;
import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.services.ColorTheme;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
public class GroupSummaryPanel extends StackedDropDownPanel implements GroupSummaryView {
public GroupSummaryPanel(final AbstractPresenter presenter, final I18nTranslationService i18n,
- final ColorTheme colorTheme) {
- // FIXME
- super(presenter, colorTheme.getSummaryDD(), i18n.t("Group Summary"), i18n
- .t("Some summarized information about current project" + Site.IN_DEVELOPMENT), false);
- setDropDownContentVisible(true);
- setVisible(true);
+ final WorkspaceSkeleton ws) {
+ // FIXME
+ super(presenter, "red", i18n.t("Group Summary"), i18n.t("Some summarized information about current project"
+ + Site.IN_DEVELOPMENT), false);
+ setDropDownContentVisible(true);
+ setVisible(true);
+ ws.getEntitySummary().addInSummary(this);
}
public void setComment(final String comment) {
- super.clear();
- super.addComment(comment);
+ super.clear();
+ super.addComment(comment);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,194 +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 java.util.Iterator;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-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.StateDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersComponent;
-
-public class GroupMembersPresenter extends AbstractPresenter implements GroupMembersComponent, EntityLiveSearchListener {
-
- private GroupMembersView view;
- private final I18nTranslationService i18n;
- private final String adminCategory;
- private final String collabCategory;
- private final String pendigCategory;
- private final MemberAction gotoGroupCommand;
-
- public GroupMembersPresenter(final I18nTranslationService i18n) {
- this.i18n = i18n;
- adminCategory = i18n.t("Admins");
- collabCategory = i18n.t("Collaborators");
- pendigCategory = i18n.t("Pending");
- gotoGroupCommand = new MemberAction(i18n.t("Visit this member homepage"), PlatformEvents.GOTO);
-
- }
-
- public void addCollab(final String groupShortName) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ADD_COLLAB_MEMBER, groupShortName);
- }
-
- public View getView() {
- return view;
- }
-
- public void hide() {
- view.hide();
- }
-
- public void init(final GroupMembersView view) {
- this.view = view;
- }
-
- public void onJoin() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.REQ_JOIN_GROUP, null);
- }
-
- public void onSelection(final String groupShortName, final String groupLongName) {
- view.confirmAddCollab(groupShortName, groupLongName);
- }
-
- public void setGroupMembers(final StateDTO state) {
- if (state.getGroup().getType() == GroupDTO.PERSONAL) {
- hide();
- } else {
- setGroupMembers(state.getGroupMembers(), state.getGroupRights());
- }
- }
-
- public void showAdmins() {
- view.showCategory(adminCategory);
- }
-
- public void showCollabs() {
- view.showCategory(collabCategory);
- }
-
- private void addMembers(final List<GroupDTO> adminsList, final List<GroupDTO> collabList,
- final List<GroupDTO> pendingCollabsList, final int numAdmins, final int numCollaborators,
- final int numPendingCollabs, final boolean isAdmin, final MemberAction[] adminsActions,
- final MemberAction[] collabActions, final MemberAction[] pendingsActions, final MemberAction[] viewerActions) {
- if (numAdmins > 0) {
- view.addCategory(adminCategory, i18n.t("People that can admin this group"));
- iteraList(adminCategory, adminsList, adminsActions);
- }
- if (numCollaborators > 0) {
- view.addCategory(collabCategory, i18n.t("Other people that collaborate with this group"));
- iteraList(collabCategory, collabList, collabActions);
- }
- if (isAdmin) {
- if (numPendingCollabs > 0) {
- view.addCategory(pendigCategory, i18n.t("People pending to be accepted in this group by the admins"),
- GroupMembersView.ICON_ALERT);
- iteraList(pendigCategory, pendingCollabsList, pendingsActions);
- }
- }
-
- }
-
- private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
- return userIsAdmin || userIsCollab;
- }
-
- private void iteraList(final String categoryName, final List<GroupDTO> groupList, final MemberAction[] actions) {
- final Iterator<GroupDTO> iter = groupList.iterator();
- while (iter.hasNext()) {
- final GroupDTO group = iter.next();
- view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions);
- }
- }
-
- private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRightsDTO rights) {
- final AccessListsDTO accessLists = socialNetwork.getAccessLists();
-
- List<GroupDTO> adminsList = accessLists.getAdmins().getList();
- List<GroupDTO> collabList = accessLists.getEditors().getList();
- List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList();
-
- int numAdmins = adminsList.size();
- int numCollaborators = collabList.size();
- int numPendingCollabs = pendingCollabsList.size();
-
- boolean userIsAdmin = rights.isAdministrable();
- boolean userIsCollab = !userIsAdmin && rights.isEditable();
- boolean userCanView = rights.isVisible();
- boolean userIsMember = isMember(userIsAdmin, userIsCollab);
-
- view.setDropDownContentVisible(false);
- view.clear();
-
- if (userIsAdmin) {
- view.addAddMemberLink();
- }
-
- if (!userIsMember) {
- view.addJoinLink();
- } else if (userIsAdmin && numAdmins > 1 || userIsCollab) {
- view.addUnjoinLink();
- }
-
- if (numAdmins == 0 && numCollaborators == 0) {
- view.addComment(i18n.t("This is an orphaned project, if you are interested "
- + "please request to join to work on it"));
- }
-
- if (userCanView) {
- if (rights.isAdministrable()) {
- MemberAction[] adminsActions = {
- new MemberAction(i18n.t("Remove this member"), WorkspaceEvents.DEL_MEMBER),
- new MemberAction(i18n.t("Change to collaborator"), WorkspaceEvents.SET_ADMIN_AS_COLLAB),
- gotoGroupCommand };
- MemberAction[] collabActions = {
- new MemberAction(i18n.t("Remove this member"), WorkspaceEvents.DEL_MEMBER),
- new MemberAction(i18n.t("Change to admin"), WorkspaceEvents.SET_COLLAB_AS_ADMIN),
- gotoGroupCommand };
- MemberAction[] pendingsActions = {
- new MemberAction(i18n.t("Accept this member"), WorkspaceEvents.ACCEPT_JOIN_GROUP),
- new MemberAction(i18n.t("Don't accept this member"), WorkspaceEvents.DENY_JOIN_GROUP),
- gotoGroupCommand };
- MemberAction[] viewerActions = { gotoGroupCommand };
- addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs,
- userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions);
- } else if (rights.isEditable() || rights.isVisible()) {
- MemberAction[] adminsActions = { gotoGroupCommand };
- MemberAction[] collabActions = { gotoGroupCommand };
- MemberAction[] pendingsActions = { gotoGroupCommand };
- MemberAction[] viewerActions = { gotoGroupCommand };
- addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs,
- userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions);
- }
- }
- view.setDropDownContentVisible(true);
- view.show();
- }
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,204 @@
+/*
+ *
+ * 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 java.util.Iterator;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.AbstractPresenter;
+import org.ourproject.kune.platf.client.PlatformEvents;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
+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.StateDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
+
+public class GroupMembersSummaryPresenter extends AbstractPresenter implements GroupMembersSummary,
+ EntityLiveSearchListener {
+
+ private GroupMembersSummaryView view;
+ private final I18nTranslationService i18n;
+ private final String adminCategory;
+ private final String collabCategory;
+ private final String pendigCategory;
+ private final MemberAction gotoGroupCommand;
+
+ public GroupMembersSummaryPresenter(final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ adminCategory = i18n.t("Admins");
+ collabCategory = i18n.t("Collaborators");
+ pendigCategory = i18n.t("Pending");
+ gotoGroupCommand = new MemberAction(i18n.t("Visit this member homepage"), PlatformEvents.GOTO);
+ }
+
+ public void addCollab(final String groupShortName) {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.ADD_COLLAB_MEMBER, groupShortName);
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void hide() {
+ view.hide();
+ }
+
+ public void init(final GroupMembersSummaryView view) {
+ this.view = view;
+ }
+
+ public void onJoin() {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.REQ_JOIN_GROUP, null);
+ }
+
+ public void onSelection(final String groupShortName, final String groupLongName) {
+ view.confirmAddCollab(groupShortName, groupLongName);
+ }
+
+ public void setState(final StateDTO state) {
+ if (state.getGroup().getType() == GroupDTO.PERSONAL) {
+ hide();
+ } else {
+ setGroupMembers(state.getGroupMembers(), state.getGroupRights());
+ }
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+
+ public void showAdmins() {
+ view.showCategory(adminCategory);
+ }
+
+ public void showCollabs() {
+ view.showCategory(collabCategory);
+ }
+
+ private void addMembers(final List<GroupDTO> adminsList, final List<GroupDTO> collabList,
+ final List<GroupDTO> pendingCollabsList, final int numAdmins, final int numCollaborators,
+ final int numPendingCollabs, final boolean isAdmin, final MemberAction[] adminsActions,
+ final MemberAction[] collabActions, final MemberAction[] pendingsActions, final MemberAction[] viewerActions) {
+ if (numAdmins > 0) {
+ view.addCategory(adminCategory, i18n.t("People that can admin this group"));
+ iteraList(adminCategory, adminsList, adminsActions);
+ }
+ if (numCollaborators > 0) {
+ view.addCategory(collabCategory, i18n.t("Other people that collaborate with this group"));
+ iteraList(collabCategory, collabList, collabActions);
+ }
+ if (isAdmin) {
+ if (numPendingCollabs > 0) {
+ view.addCategory(pendigCategory, i18n.t("People pending to be accepted in this group by the admins"),
+ GroupMembersSummaryView.ICON_ALERT);
+ iteraList(pendigCategory, pendingCollabsList, pendingsActions);
+ }
+ }
+
+ }
+
+ private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
+ return userIsAdmin || userIsCollab;
+ }
+
+ private void iteraList(final String categoryName, final List<GroupDTO> groupList, final MemberAction[] actions) {
+ final Iterator<GroupDTO> iter = groupList.iterator();
+ while (iter.hasNext()) {
+ final GroupDTO group = iter.next();
+ view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions);
+ }
+ }
+
+ 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();
+ final int numCollaborators = collabList.size();
+ final int numPendingCollabs = pendingCollabsList.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.addAddMemberLink();
+ }
+
+ if (!userIsMember) {
+ view.addJoinLink();
+ } else if (userIsAdmin && numAdmins > 1 || userIsCollab) {
+ view.addUnjoinLink();
+ }
+
+ if (numAdmins == 0 && numCollaborators == 0) {
+ view.addComment(i18n.t("This is an orphaned project, if you are interested "
+ + "please request to join to work on it"));
+ }
+
+ if (userCanView) {
+ if (rights.isAdministrable()) {
+ new MenuItem("", i18n.t("Remove this member"), new MenuItem.MenuItemListener() {
+ public void onClick() {
+
+ }
+ });
+ final MemberAction[] adminsActions = {
+ new MemberAction(i18n.t("Remove this member"), WorkspaceEvents.DEL_MEMBER),
+ new MemberAction(i18n.t("Change to collaborator"), WorkspaceEvents.SET_ADMIN_AS_COLLAB),
+ gotoGroupCommand };
+ final MemberAction[] collabActions = {
+ new MemberAction(i18n.t("Remove this member"), WorkspaceEvents.DEL_MEMBER),
+ new MemberAction(i18n.t("Change to admin"), WorkspaceEvents.SET_COLLAB_AS_ADMIN),
+ gotoGroupCommand };
+ final MemberAction[] pendingsActions = {
+ new MemberAction(i18n.t("Accept this member"), WorkspaceEvents.ACCEPT_JOIN_GROUP),
+ new MemberAction(i18n.t("Don't accept this member"), WorkspaceEvents.DENY_JOIN_GROUP),
+ gotoGroupCommand };
+ final MemberAction[] viewerActions = { gotoGroupCommand };
+ addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs,
+ userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions);
+ } else if (rights.isEditable() || rights.isVisible()) {
+ final MemberAction[] adminsActions = { gotoGroupCommand };
+ final MemberAction[] collabActions = { gotoGroupCommand };
+ final MemberAction[] pendingsActions = { gotoGroupCommand };
+ final MemberAction[] viewerActions = { gotoGroupCommand };
+ addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs,
+ userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions);
+ }
+ }
+ view.setDropDownContentVisible(true);
+ view.show();
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface GroupMembersSummaryView extends View {
+
+ public static final String ICON_ALERT = "alert";
+
+ void addAddMemberLink();
+
+ void addCategory(String name, String title);
+
+ void addCategory(String name, String title, String iconType);
+
+ void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions);
+
+ void addComment(String comment);
+
+ void addJoinLink();
+
+ void addUnjoinLink();
+
+ void clear();
+
+ void confirmAddCollab(String groupShortName, String groupLongName);
+
+ void hide();
+
+ void setDropDownContentVisible(boolean visible);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+ void show();
+
+ void showCategory(String name);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,54 +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 GroupMembersView extends View {
-
- public static final String ICON_ALERT = "alert";
-
- void clear();
-
- void setDropDownContentVisible(boolean visible);
-
- void addCategory(String name, String title);
-
- void addCategory(String name, String title, String iconType);
-
- void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions);
-
- void addJoinLink();
-
- void addAddMemberLink();
-
- void show();
-
- void hide();
-
- void addUnjoinLink();
-
- void showCategory(String name);
-
- void confirmAddCollab(String groupShortName, String groupLongName);
-
- void addComment(String comment);
-
-}
Modified: 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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -19,22 +19,21 @@
*/
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;
+ this.text = text;
+ this.action = action;
}
public String getAction() {
- return action;
+ return action;
}
public String getText() {
- return text;
+ return text;
}
}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,132 +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 java.util.Iterator;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.workspace.ParticipationComponent;
-
-public class ParticipationPresenter extends AbstractPresenter implements ParticipationComponent {
-
- private ParticipationView view;
-
- private final I18nTranslationService i18n;
-
- private final String admin_subtitle;
-
- private final MemberAction goto_group_command;
-
- public ParticipationPresenter(final I18nTranslationService i18n) {
- this.i18n = i18n;
- admin_subtitle = i18n.t("admin in:");
- goto_group_command = new MemberAction(i18n.t("Visit this group homepage"), PlatformEvents.GOTO);
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final ParticipationView view) {
- this.view = view;
- }
-
- public void setParticipation(final StateDTO state) {
- ParticipationDataDTO participation = state.getParticipation();
- AccessRightsDTO rights = state.getGroupRights();
- view.setDropDownContentVisible(false);
- view.clear();
- MemberAction[] adminsActions = {
- new MemberAction(i18n.t("Don't participate more in this group"), WorkspaceEvents.UNJOIN_GROUP),
- goto_group_command };
- MemberAction[] collabActions = adminsActions;
- MemberAction[] viewerActions = { goto_group_command };
- List<LinkDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
- List<LinkDTO> groupsIsCollab = participation.getGroupsIsCollab();
- boolean userIsAdmin = rights.isAdministrable();
- boolean userIsCollab = !userIsAdmin && rights.isEditable();
- boolean userIsMember = isMember(userIsAdmin, userIsCollab);
- int numAdmins = groupsIsAdmin.size();
- int numCollaborators = groupsIsCollab.size();
- if (numAdmins > 0 || numCollaborators > 0) {
- addParticipants(groupsIsAdmin, groupsIsCollab, numAdmins, numCollaborators, userIsAdmin, userIsMember,
- adminsActions, collabActions, viewerActions);
- view.setDropDownContentVisible(true);
- view.show();
- } else {
- hide();
- }
-
- }
-
- private void addParticipants(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab,
- final int numAdmins, final int numCollaborators, final boolean userIsAdmin, boolean userIsMember,
- final MemberAction[] adminsActions, final MemberAction[] collabActions, final MemberAction[] viewerActions) {
- MemberAction[] actions;
- String collabTitle;
-
- if (!userIsMember) {
- actions = viewerActions;
- } else {
- if (userIsAdmin) {
- actions = adminsActions;
- } else {
- actions = collabActions;
- }
- }
- if (numAdmins > 0) {
- view.addCategory(admin_subtitle, i18n.tWithNT("Administrate these groups", "talking about a person"));
- iteraList(admin_subtitle, groupsIsAdmin, actions);
- collabTitle = i18n.t("and as collaborator in:");
- } else {
- collabTitle = i18n.t("collaborator in:");
- }
- if (numCollaborators > 0) {
- view.addCategory(collabTitle, i18n.t("Collaborate in these groups"));
- iteraList(collabTitle, groupsIsCollab, actions);
- }
-
- }
-
- private void hide() {
- view.hide();
- }
-
- private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
- return userIsAdmin || userIsCollab;
- }
-
- private void iteraList(final String categoryName, final List<LinkDTO> groupList, final MemberAction[] actions) {
- final Iterator<LinkDTO> iter = groupList.iterator();
- while (iter.hasNext()) {
- final LinkDTO group = iter.next();
- view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions);
- }
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,137 @@
+/*
+ *
+ * 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 java.util.Iterator;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.AbstractPresenter;
+import org.ourproject.kune.platf.client.PlatformEvents;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
+
+public class ParticipationSummaryPresenter extends AbstractPresenter implements ParticipationSummary {
+
+ private ParticipationSummaryView view;
+
+ private final I18nTranslationService i18n;
+
+ private final String admin_subtitle;
+
+ private final MemberAction goto_group_command;
+
+ public ParticipationSummaryPresenter(final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ admin_subtitle = i18n.t("admin in:");
+ goto_group_command = new MemberAction(i18n.t("Visit this group homepage"), PlatformEvents.GOTO);
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final ParticipationSummaryView view) {
+ this.view = view;
+ }
+
+ public void setState(final StateDTO state) {
+ final ParticipationDataDTO participation = state.getParticipation();
+ final AccessRightsDTO rights = state.getGroupRights();
+ view.setDropDownContentVisible(false);
+ view.clear();
+ final MemberAction[] adminsActions = {
+ new MemberAction(i18n.t("Don't participate more in this group"), WorkspaceEvents.UNJOIN_GROUP),
+ goto_group_command };
+ final MemberAction[] collabActions = adminsActions;
+ final MemberAction[] viewerActions = { goto_group_command };
+ final List<LinkDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
+ final List<LinkDTO> groupsIsCollab = participation.getGroupsIsCollab();
+ boolean userIsAdmin = rights.isAdministrable();
+ final boolean userIsCollab = !userIsAdmin && rights.isEditable();
+ final boolean userIsMember = isMember(userIsAdmin, userIsCollab);
+ final int numAdmins = groupsIsAdmin.size();
+ final int numCollaborators = groupsIsCollab.size();
+ if (numAdmins > 0 || numCollaborators > 0) {
+ addParticipants(groupsIsAdmin, groupsIsCollab, numAdmins, numCollaborators, userIsAdmin, userIsMember,
+ adminsActions, collabActions, viewerActions);
+ view.setDropDownContentVisible(true);
+ view.show();
+ } else {
+ hide();
+ }
+
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+
+ private void addParticipants(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab,
+ final int numAdmins, final int numCollaborators, final boolean userIsAdmin, boolean userIsMember,
+ final MemberAction[] adminsActions, final MemberAction[] collabActions, final MemberAction[] viewerActions) {
+ MemberAction[] actions;
+ String collabTitle;
+
+ if (!userIsMember) {
+ actions = viewerActions;
+ } else {
+ if (userIsAdmin) {
+ actions = adminsActions;
+ } else {
+ actions = collabActions;
+ }
+ }
+ if (numAdmins > 0) {
+ view.addCategory(admin_subtitle, i18n.tWithNT("Administrate these groups", "talking about a person"));
+ iteraList(admin_subtitle, groupsIsAdmin, actions);
+ collabTitle = i18n.t("and as collaborator in:");
+ } else {
+ collabTitle = i18n.t("collaborator in:");
+ }
+ if (numCollaborators > 0) {
+ view.addCategory(collabTitle, i18n.t("Collaborate in these groups"));
+ iteraList(collabTitle, groupsIsCollab, actions);
+ }
+
+ }
+
+ private void hide() {
+ view.hide();
+ }
+
+ private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
+ return userIsAdmin || userIsCollab;
+ }
+
+ private void iteraList(final String categoryName, final List<LinkDTO> groupList, final MemberAction[] actions) {
+ final Iterator<LinkDTO> iter = groupList.iterator();
+ while (iter.hasNext()) {
+ final LinkDTO group = iter.next();
+ view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions);
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface ParticipationSummaryView extends View {
+
+ void addCategory(String name, String title);
+
+ void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions);
+
+ void clear();
+
+ void hide();
+
+ void setDropDownContentVisible(boolean visible);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+ void show();
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,38 +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 ParticipationView extends View {
-
- void hide();
-
- void addCategory(String name, String title);
-
- void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions);
-
- void show();
-
- void setDropDownContentVisible(boolean visible);
-
- void clear();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -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.PlatformEvents;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.UIConstants;
-import org.ourproject.kune.platf.client.ui.stacks.StackSubItemAction;
-import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersPresenter;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersView;
-import org.ourproject.kune.workspace.client.socialnet.MemberAction;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.gwtext.client.widgets.MessageBox;
-
-public class GroupMembersPanel extends StackedDropDownPanel implements GroupMembersView {
- private static final boolean COUNTS_VISIBLE = true;
- private final Images img = Images.App.getInstance();
- private final GroupMembersPresenter presenter;
- private final I18nTranslationService i18n;
-
- public GroupMembersPanel(final GroupMembersPresenter initPresenter, final I18nTranslationService i18n) {
- super(initPresenter, "#00D4AA", i18n.t("Group members"), i18n
- .t("People and groups collaborating in this group"), COUNTS_VISIBLE);
- presenter = initPresenter;
- this.i18n = i18n;
- }
-
- public void addAddMemberLink() {
- super.addBottomLink(img.addGreen(), i18n.t("Add member"), i18n
- .t("Add a group or a person as member of this group"), WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH,
- presenter);
- }
-
- public void addCategory(final String name, final String title) {
- super.addStackItem(name, title, COUNTS_VISIBLE);
- }
-
- public void addCategory(final String name, final String title, final String iconType) {
- super.addStackItem(name, title, getIcon(iconType), UIConstants.ICON_HORIZ_ALIGN_RIGHT, COUNTS_VISIBLE);
- }
-
- public void addCategoryMember(final String categoryName, final String name, final String title,
- final MemberAction[] memberActions) {
- StackSubItemAction[] subItems = new StackSubItemAction[memberActions.length];
- for (int i = 0; i < memberActions.length; i++) {
- subItems[i] = new StackSubItemAction(getIconFronEvent(memberActions[i].getAction()), memberActions[i]
- .getText(), memberActions[i].getAction());
- }
-
- super.addStackSubItem(categoryName, img.groupDefIcon(), name, title, subItems);
- }
-
- public void addComment(final String comment) {
- super.addComment(comment);
- }
-
- public void addJoinLink() {
- super.addBottomLink(img.addGreen(), i18n.t("Request to join"), i18n.t("Request to participate in this group"),
- WorkspaceEvents.REQ_JOIN_GROUP);
- }
-
- public void addUnjoinLink() {
- super.addBottomLink(img.del(), i18n.t("Unjoin this group"), i18n
- .t("Don't participate more as a member in this group"), WorkspaceEvents.UNJOIN_GROUP);
- }
-
- public void clear() {
- super.clear();
- }
-
- public void confirmAddCollab(final String groupShortName, final String groupLongName) {
- 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 hide() {
- this.setVisible(false);
- }
-
- public void show() {
- this.setVisible(true);
- }
-
- public void showCategory(final String name) {
- super.showStackItem(name);
- }
-
- private AbstractImagePrototype getIcon(final String event) {
- if (event == GroupMembersView.ICON_ALERT) {
- return img.alert();
- }
- throw new IndexOutOfBoundsException("Icon unknown in GroupMemebersPanel");
- }
-
- private AbstractImagePrototype getIconFronEvent(final String event) {
- if (event == WorkspaceEvents.ACCEPT_JOIN_GROUP) {
- return img.accept();
- }
- if (event == WorkspaceEvents.DENY_JOIN_GROUP) {
- return img.cancel();
- }
- if (event == WorkspaceEvents.DEL_MEMBER) {
- return img.del();
- }
- if (event == PlatformEvents.GOTO) {
- return img.groupHome();
- }
- if (event == WorkspaceEvents.SET_ADMIN_AS_COLLAB) {
- return img.arrowDownGreen();
- }
- if (event == WorkspaceEvents.SET_COLLAB_AS_ADMIN) {
- return img.arrowUpGreen();
- }
- throw new IndexOutOfBoundsException("Event unknown in GroupMembersPanel");
- }
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,148 @@
+/*
+ *
+ * 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.PlatformEvents;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.UIConstants;
+import org.ourproject.kune.platf.client.ui.stacks.StackSubItemAction;
+import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel;
+import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.MemberAction;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.gwtext.client.widgets.MessageBox;
+
+public class GroupMembersSummaryPanel extends StackedDropDownPanel implements GroupMembersSummaryView {
+ private static final boolean COUNTS_VISIBLE = true;
+ private final Images img = Images.App.getInstance();
+ private final GroupMembersSummaryPresenter presenter;
+ private final I18nTranslationService i18n;
+
+ public GroupMembersSummaryPanel(final GroupMembersSummaryPresenter initPresenter,
+ final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ super(initPresenter, "#00D4AA", i18n.t("Group members"), i18n
+ .t("People and groups collaborating in this group"), COUNTS_VISIBLE);
+ presenter = initPresenter;
+ this.i18n = i18n;
+ ws.getEntitySummary().addInSummary(this);
+ }
+
+ public void addAddMemberLink() {
+ super.addBottomLink(img.addGreen(), i18n.t("Add member"), i18n
+ .t("Add a group or a person as member of this group"), WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH,
+ presenter);
+ }
+
+ public void addCategory(final String name, final String title) {
+ super.addStackItem(name, title, COUNTS_VISIBLE);
+ }
+
+ public void addCategory(final String name, final String title, final String iconType) {
+ super.addStackItem(name, title, getIcon(iconType), UIConstants.ICON_HORIZ_ALIGN_RIGHT, COUNTS_VISIBLE);
+ }
+
+ public void addCategoryMember(final String categoryName, final String name, final String title,
+ final MemberAction[] memberActions) {
+ final StackSubItemAction[] subItems = new StackSubItemAction[memberActions.length];
+ for (int i = 0; i < memberActions.length; i++) {
+ subItems[i] = new StackSubItemAction(getIconFronEvent(memberActions[i].getAction()), memberActions[i]
+ .getText(), memberActions[i].getAction());
+ }
+
+ super.addStackSubItem(categoryName, img.groupDefIcon(), name, title, subItems);
+ }
+
+ public void addComment(final String comment) {
+ super.addComment(comment);
+ }
+
+ public void addJoinLink() {
+ super.addBottomLink(img.addGreen(), i18n.t("Request to join"), i18n.t("Request to participate in this group"),
+ WorkspaceEvents.REQ_JOIN_GROUP);
+ }
+
+ public void addUnjoinLink() {
+ super.addBottomLink(img.del(), i18n.t("Unjoin this group"), i18n
+ .t("Don't participate more as a member in this group"), WorkspaceEvents.UNJOIN_GROUP);
+ }
+
+ public void clear() {
+ super.clear();
+ }
+
+ 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 hide() {
+ this.setVisible(false);
+ }
+
+ public void show() {
+ this.setVisible(true);
+ }
+
+ public void showCategory(final String name) {
+ super.showStackItem(name);
+ }
+
+ private AbstractImagePrototype getIcon(final String event) {
+ if (event == GroupMembersSummaryView.ICON_ALERT) {
+ return img.alert();
+ }
+ throw new IndexOutOfBoundsException("Icon unknown in GroupMemebersPanel");
+ }
+
+ private AbstractImagePrototype getIconFronEvent(final String event) {
+ if (event == WorkspaceEvents.ACCEPT_JOIN_GROUP) {
+ return img.accept();
+ }
+ if (event == WorkspaceEvents.DENY_JOIN_GROUP) {
+ return img.cancel();
+ }
+ if (event == WorkspaceEvents.DEL_MEMBER) {
+ return img.del();
+ }
+ if (event == PlatformEvents.GOTO) {
+ return img.groupHome();
+ }
+ if (event == WorkspaceEvents.SET_ADMIN_AS_COLLAB) {
+ return img.arrowDownGreen();
+ }
+ if (event == WorkspaceEvents.SET_COLLAB_AS_ADMIN) {
+ return img.arrowUpGreen();
+ }
+ throw new IndexOutOfBoundsException("Event unknown in GroupMembersPanel");
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,94 +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.PlatformEvents;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.UIConstants;
-import org.ourproject.kune.platf.client.ui.stacks.StackSubItemAction;
-import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersView;
-import org.ourproject.kune.workspace.client.socialnet.MemberAction;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationView;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-
-public class ParticipationPanel extends StackedDropDownPanel implements ParticipationView {
-
- private static final boolean COUNTS_VISIBLE = false;
- private final Images img = Images.App.getInstance();
-
- public ParticipationPanel(final AbstractPresenter presenter, final I18nTranslationService i18n) {
- super(presenter, "#00D4AA", i18n.t("Participates as..."), i18n.t("Groups in which participates"),
- COUNTS_VISIBLE);
- }
-
- public void addCategory(final String name, final String title) {
- super.addStackItem(name, title, COUNTS_VISIBLE);
- }
-
- public void addCategory(final String name, final String title, final String iconType) {
- super.addStackItem(name, title, getIcon(iconType), UIConstants.ICON_HORIZ_ALIGN_RIGHT, COUNTS_VISIBLE);
- }
-
- public void addCategoryMember(final String categoryName, final String name, final String title,
- final MemberAction[] memberActions) {
- StackSubItemAction[] subItems = new StackSubItemAction[memberActions.length];
- for (int i = 0; i < memberActions.length; i++) {
- subItems[i] = new StackSubItemAction(getIconFronEvent(memberActions[i].getAction()), memberActions[i]
- .getText(), memberActions[i].getAction());
- }
-
- super.addStackSubItem(categoryName, img.groupDefIcon(), name, title, subItems);
- }
-
- public void clear() {
- super.clear();
- }
-
- public void hide() {
- this.setVisible(false);
- }
-
- public void show() {
- this.setVisible(true);
- }
-
- private AbstractImagePrototype getIcon(final String event) {
- if (event == GroupMembersView.ICON_ALERT) {
- return img.alert();
- }
- throw new IndexOutOfBoundsException("Icon unknown in ParticipationPanelk");
- }
-
- private AbstractImagePrototype getIconFronEvent(final String event) {
- if (event == WorkspaceEvents.UNJOIN_GROUP) {
- return img.del();
- }
- if (event == PlatformEvents.GOTO) {
- return img.groupHome();
- }
- throw new IndexOutOfBoundsException("Event unknown in ParticipationPanel");
- }
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,97 @@
+/*
+ *
+ * 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.PlatformEvents;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.UIConstants;
+import org.ourproject.kune.platf.client.ui.stacks.StackSubItemAction;
+import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel;
+import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.MemberAction;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+
+public class ParticipationSummaryPanel extends StackedDropDownPanel implements ParticipationSummaryView {
+
+ private static final boolean COUNTS_VISIBLE = false;
+ private final Images img = Images.App.getInstance();
+
+ public ParticipationSummaryPanel(final AbstractPresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(presenter, "#00D4AA", i18n.t("Participates as..."), i18n.t("Groups in which participates"),
+ COUNTS_VISIBLE);
+ ws.getEntitySummary().addInSummary(this);
+ }
+
+ public void addCategory(final String name, final String title) {
+ super.addStackItem(name, title, COUNTS_VISIBLE);
+ }
+
+ public void addCategory(final String name, final String title, final String iconType) {
+ super.addStackItem(name, title, getIcon(iconType), UIConstants.ICON_HORIZ_ALIGN_RIGHT, COUNTS_VISIBLE);
+ }
+
+ public void addCategoryMember(final String categoryName, final String name, final String title,
+ final MemberAction[] memberActions) {
+ final StackSubItemAction[] subItems = new StackSubItemAction[memberActions.length];
+ for (int i = 0; i < memberActions.length; i++) {
+ subItems[i] = new StackSubItemAction(getIconFronEvent(memberActions[i].getAction()), memberActions[i]
+ .getText(), memberActions[i].getAction());
+ }
+
+ super.addStackSubItem(categoryName, img.groupDefIcon(), name, title, subItems);
+ }
+
+ public void clear() {
+ super.clear();
+ }
+
+ public void hide() {
+ this.setVisible(false);
+ }
+
+ public void show() {
+ this.setVisible(true);
+ }
+
+ private AbstractImagePrototype getIcon(final String event) {
+ if (event == GroupMembersSummaryView.ICON_ALERT) {
+ return img.alert();
+ }
+ throw new IndexOutOfBoundsException("Icon unknown in ParticipationPanelk");
+ }
+
+ private AbstractImagePrototype getIconFronEvent(final String event) {
+ if (event == WorkspaceEvents.UNJOIN_GROUP) {
+ return img.del();
+ }
+ if (event == PlatformEvents.GOTO) {
+ return img.groupHome();
+ }
+ throw new IndexOutOfBoundsException("Event unknown in ParticipationPanel");
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -22,22 +22,27 @@
import org.ourproject.kune.platf.client.AbstractPresenter;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.workspace.GroupSummaryComponent;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.workspace.GroupSummary;
-public class GroupSummaryPresenter extends AbstractPresenter implements GroupSummaryComponent {
+public class GroupSummaryPresenter extends AbstractPresenter implements GroupSummary {
private GroupSummaryView view;
- public void setGroupSummary(final StateDTO state) {
- view.setComment("Summary about this group (in development)");
- }
-
public View getView() {
- return view;
+ return view;
}
public void init(final GroupSummaryView view) {
- this.view = view;
+ this.view = view;
}
+ public void setState(final StateDTO state) {
+ view.setComment("Summary about this group (in development)");
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -20,9 +20,12 @@
package org.ourproject.kune.workspace.client.summary;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface GroupSummaryView extends View {
void setComment(String comment);
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,72 +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.tags;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.search.SiteSearcher;
-import org.ourproject.kune.workspace.client.search.SiteSearcherType;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.workspace.Tags;
-
-import com.calclab.suco.client.container.Provider;
-
-public class TagsPresenter implements Tags {
-
- private TagsView view;
- private final Provider<SiteSearcher> searcherProvider;
- private final Provider<Session> sessionProvider;
-
- public TagsPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) {
- this.sessionProvider = sessionProvider;
- this.searcherProvider = searcherProvider;
- }
-
- public void doSearchTag(final String name) {
- searcherProvider.get().doSearchOfType(
- "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name,
- SiteSearcherType.content);
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final TagsView view) {
- this.view = view;
- }
-
- public void setGroupTags(final List<TagResultDTO> groupTags) {
- view.setTags(groupTags);
- }
-
- public void setState(final StateDTO state) {
- view.setTags(state.getGroupTags());
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
-}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,85 @@
+/*
+ *
+ * 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.tags;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.DropDownPanel;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class TagsSummaryPanel extends DropDownPanel implements TagsSummaryView {
+
+ private final FlowPanel flowPanel;
+ private final TagsSummaryPresenter presenter;
+ private final Label noTagsLabel;
+ private final I18nTranslationService i18n;
+
+ public TagsSummaryPanel(final TagsSummaryPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ super(i18n.t("Tags"), true);
+ this.i18n = i18n;
+ setHeaderTitle(i18n.t("Keywords or terms associated with this group"));
+ this.presenter = presenter;
+ addStyleName("kune-Margin-Medium-t");
+ flowPanel = new FlowPanel();
+ final VerticalPanel vp = new VerticalPanel();
+ vp.add(flowPanel);
+ vp.setWidth("100%");
+ vp.setCellWidth(flowPanel, "100%");
+ super.setContent(vp);
+ noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag"));
+ ws.getEntitySummary().addInSummary(this);
+ }
+
+ public void setTags(final List<TagResultDTO> groupTags) {
+ flowPanel.clear();
+ if (groupTags.size() == 0) {
+ flowPanel.add(noTagsLabel);
+ } else {
+ for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
+ final TagResultDTO tagResult = iterator.next();
+ final Label label = new Label(tagResult.getName());
+ // i18n pluralization
+ if (tagResult.getCount().intValue() > 1) {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ } else {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ }
+ label.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.doSearchTag(tagResult.getName());
+ }
+ });
+ label.addStyleName("kune-TagsPanel-tag");
+ flowPanel.add(label);
+ }
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java (from rev 798, trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,72 @@
+/*
+ *
+ * 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.tags;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.search.SiteSearcherType;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.workspace.TagsSummary;
+
+import com.calclab.suco.client.container.Provider;
+
+public class TagsSummaryPresenter implements TagsSummary {
+
+ private TagsSummaryView view;
+ private final Provider<SiteSearcher> searcherProvider;
+ private final Provider<Session> sessionProvider;
+
+ public TagsSummaryPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) {
+ this.sessionProvider = sessionProvider;
+ this.searcherProvider = searcherProvider;
+ }
+
+ public void doSearchTag(final String name) {
+ searcherProvider.get().doSearchOfType(
+ "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name,
+ SiteSearcherType.content);
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final TagsSummaryView view) {
+ this.view = view;
+ }
+
+ public void setGroupTags(final List<TagResultDTO> groupTags) {
+ view.setTags(groupTags);
+ }
+
+ public void setState(final StateDTO state) {
+ view.setTags(state.getGroupTags());
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java (from rev 798, trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -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.tags;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface TagsSummaryView extends View {
+
+ void setTags(List<TagResultDTO> groupTags);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -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.tags;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-public interface TagsView extends View {
-
- void setTags(List<TagResultDTO> groupTags);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,87 +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.tags.ui;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.DropDownPanel;
-import org.ourproject.kune.platf.client.ui.KuneUiUtils;
-import org.ourproject.kune.workspace.client.tags.TagsPresenter;
-import org.ourproject.kune.workspace.client.tags.TagsView;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class TagsPanel extends DropDownPanel implements TagsView {
-
- private final FlowPanel flowPanel;
- private final TagsPresenter presenter;
- private final Label noTagsLabel;
- private final I18nTranslationService i18n;
-
- public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
- super(i18n.t("Tags"), true);
- this.i18n = i18n;
- setHeaderTitle(i18n.t("Keywords or terms associated with this group"));
- this.presenter = presenter;
- addStyleName("kune-Margin-Medium-t");
- flowPanel = new FlowPanel();
- final VerticalPanel vp = new VerticalPanel();
- vp.add(flowPanel);
- vp.setWidth("100%");
- vp.setCellWidth(flowPanel, "100%");
- super.setContent(vp);
- noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag"));
- ws.getEntitySummary().addInSummary(this);
- }
-
- public void setTags(final List<TagResultDTO> groupTags) {
- flowPanel.clear();
- if (groupTags.size() == 0) {
- flowPanel.add(noTagsLabel);
- } else {
- for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
- final TagResultDTO tagResult = iterator.next();
- final Label label = new Label(tagResult.getName());
- // i18n pluralization
- if (tagResult.getCount().intValue() > 1) {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
- } else {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
- }
- label.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.doSearchTag(tagResult.getName());
- }
- });
- label.addStyleName("kune-TagsPanel-tag");
- flowPanel.add(label);
- }
- }
- }
-}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.theme;
+
+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.ui.BottomTrayIcon;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.ui.MenuBar;
+
+public class ThemeMenuPanel extends BottomTrayIcon implements ThemeMenuView {
+
+ private final MenuBar themesMB;
+ private final ThemeMenuPresenter presenter;
+ private final ColorTheme colorTheme;
+
+ public ThemeMenuPanel(final ThemeMenuPresenter presenter, final I18nTranslationService i18n,
+ final ColorTheme colorTheme) {
+ super(i18n.t("Select Workspace theme for this group"));
+ this.presenter = presenter;
+ this.colorTheme = colorTheme;
+ themesMB = new MenuBar(true);
+ themesMB.addStyleDependentName("bottomMenu");
+ this.addItem(Images.App.getInstance().themeChoose().getHTML(), true, themesMB);
+ }
+
+ public void setThemes(final String[] themes) {
+ for (int i = 0; i < themes.length; i++) {
+ final String theme = themes[i];
+ colorTheme.setTheme(theme);
+ String themeName = colorTheme.getThemeName();
+ String mainColor = colorTheme.getContentMainBorder();
+ themesMB.addItem("<span style=\"color: " + mainColor + ";\">" + themeName + "</span>", true, new Command() {
+ public void execute() {
+ presenter.chooseTheme(theme);
+ }
+ });
+ }
+ }
+
+ public void setVisible(final boolean visible) {
+ super.setVisible(visible);
+ }
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,66 +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.theme.ui;
-
-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.ui.BottomTrayIcon;
-import org.ourproject.kune.workspace.client.theme.ThemeMenuPresenter;
-import org.ourproject.kune.workspace.client.theme.ThemeMenuView;
-
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.MenuBar;
-
-public class ThemeMenuPanel extends BottomTrayIcon implements ThemeMenuView {
-
- private final MenuBar themesMB;
- private final ThemeMenuPresenter presenter;
- private final ColorTheme colorTheme;
-
- public ThemeMenuPanel(final ThemeMenuPresenter presenter, final I18nTranslationService i18n,
- final ColorTheme colorTheme) {
- super(i18n.t("Select Workspace theme for this group"));
- this.presenter = presenter;
- this.colorTheme = colorTheme;
- themesMB = new MenuBar(true);
- themesMB.addStyleDependentName("bottomMenu");
- this.addItem(Images.App.getInstance().themeChoose().getHTML(), true, themesMB);
- }
-
- public void setThemes(final String[] themes) {
- for (int i = 0; i < themes.length; i++) {
- final String theme = themes[i];
- colorTheme.setTheme(theme);
- String themeName = colorTheme.getThemeName();
- String mainColor = colorTheme.getContentMainBorder();
- themesMB.addItem("<span style=\"color: " + mainColor + ";\">" + themeName + "</span>", true, new Command() {
- public void execute() {
- presenter.chooseTheme(theme);
- }
- });
- }
- }
-
- public void setVisible(final boolean visible) {
- super.setVisible(visible);
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -7,7 +7,10 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.Tags;
+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.ui.EntityLogo;
import com.calclab.suco.client.signal.Slot2;
@@ -19,25 +22,40 @@
private final WsThemePresenter wsThemePresenter;
private final EntityLicensePresenter entityLicensePresenter;
private final EntitySubTitlePresenter entitySubTitlePresenter;
- private final Tags tags;
+ private final TagsSummary tags;
+ private final GroupMembersSummary groupMembersSummary;
+ private final ParticipationSummary participationSummary;
+ private final GroupSummary groupSummary;
public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter,
- final EntityLicensePresenter entityLicensePresenter, final Tags tags) {
+ final EntityLicensePresenter entityLicensePresenter, final GroupMembersSummary groupMembersSummary,
+ final ParticipationSummary participationSummary, final TagsSummary tags, final GroupSummary groupSummary) {
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
this.entitySubTitlePresenter = entitySubTitlePresenter;
this.entityLicensePresenter = entityLicensePresenter;
this.wsThemePresenter = wsThemePresenter;
+ this.groupMembersSummary = groupMembersSummary;
+ this.participationSummary = participationSummary;
this.tags = tags;
+ this.groupSummary = groupSummary;
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
entityLogo.setTheme(oldTheme, newTheme);
+ groupMembersSummary.setTheme(oldTheme, newTheme);
+ participationSummary.setTheme(oldTheme, newTheme);
+ groupSummary.setTheme(oldTheme, newTheme);
tags.setTheme(oldTheme, newTheme);
}
});
}
+ public void setSocialNetwork(final StateDTO state) {
+ groupMembersSummary.setState(state);
+ participationSummary.setState(state);
+ }
+
public void setState(final StateDTO state) {
final GroupDTO group = state.getGroup();
final boolean isAdmin = state.getGroupRights().isAdministrable();
@@ -46,6 +64,8 @@
entityTitlePresenter.setState(state);
entitySubTitlePresenter.setState(state);
entityLicensePresenter.setLicense(state);
+ setSocialNetwork(state);
+ groupSummary.setState(state);
tags.setState(state);
// Only for probes:
wsThemePresenter.setVisible(true);
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,34 +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.platf.client.dto.StateDTO;
-
-public interface GroupMembersComponent extends Component {
-
- public void showCollabs();
-
- public void showAdmins();
-
- public void setGroupMembers(StateDTO state);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface GroupMembersSummary {
+
+ public void setState(StateDTO state);
+
+ public void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+ public void showAdmins();
+
+ public void showCollabs();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -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.workspace;
+
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface GroupSummary {
+
+ void setState(StateDTO state);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,30 +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.platf.client.dto.StateDTO;
-
-public interface GroupSummaryComponent extends Component {
-
- void setGroupSummary(StateDTO state);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,30 +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.platf.client.dto.StateDTO;
-
-public interface ParticipationComponent extends Component {
-
- void setParticipation(StateDTO state);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -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.workspace;
+
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface ParticipationSummary {
+
+ void setState(StateDTO state);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -1,37 +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 java.util.List;
-
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-public interface Tags {
-
- void setGroupTags(List<TagResultDTO> result);
-
- void setState(StateDTO state);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java (from rev 798, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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 java.util.List;
+
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface TagsSummary {
+
+ void setGroupTags(List<TagResultDTO> result);
+
+ void setState(StateDTO state);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+}
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -57,16 +57,10 @@
public GroupLiveSearchComponent getGroupLiveSearchComponent();
- public GroupMembersComponent getGroupMembersComponent();
-
- public GroupSummaryComponent getGroupSummaryComponent();
-
public I18nTranslatorComponent getI18nTranslatorComponent();
public LicenseComponent getLicenseComponent();
- public ParticipationComponent getParticipationComponent();
-
public ThemeMenuComponent getThemeMenuComponent();
public UserLiveSearchComponent getUserLiveSearchComponent();
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -104,14 +104,6 @@
return components.getGroupLiveSearchComponent();
}
- public GroupMembersComponent getGroupMembersComponent() {
- return components.getGroupMembersComponent();
- }
-
- public GroupSummaryComponent getGroupSummaryComponent() {
- return components.getGroupSummaryComponent();
- }
-
public I18nTranslatorComponent getI18nTranslatorComponent() {
return components.getI18nTranslatorComponent();
}
@@ -120,10 +112,6 @@
return components.getLicenseComponent();
}
- public ParticipationComponent getParticipationComponent() {
- return components.getParticipationComponent();
- }
-
public ThemeMenuComponent getThemeMenuComponent() {
return components.getThemeMenuComponent();
}
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -27,9 +27,9 @@
public class WorkspaceUIComponents {
private LicenseComponent license;
private ContentTitleComponent contentTitle;
- private GroupMembersComponent groupMembers;
- private ParticipationComponent participatesInGroups;
- private GroupSummaryComponent groupSummary;
+ private GroupMembersSummary groupMembers;
+ private ParticipationSummary participatesInGroups;
+ private GroupSummary groupSummary;
private ContentSubTitleComponent contentSubTitle;
private ContentBottomToolBarComponent contentBottomToolBar;
private ThemeMenuComponent themeMenu;
@@ -76,20 +76,6 @@
return groupLiveSearch;
}
- public GroupMembersComponent getGroupMembersComponent() {
- if (groupMembers == null) {
- groupMembers = WorkspaceFactory.createGroupMembersComponent();
- }
- return groupMembers;
- }
-
- public GroupSummaryComponent getGroupSummaryComponent() {
- if (groupSummary == null) {
- groupSummary = WorkspaceFactory.createGroupSummaryComponent();
- }
- return groupSummary;
- }
-
public I18nTranslatorComponent getI18nTranslatorComponent() {
if (i18nTranslatorSearch == null) {
i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent();
@@ -104,13 +90,6 @@
return license;
}
- public ParticipationComponent getParticipationComponent() {
- if (participatesInGroups == null) {
- participatesInGroups = WorkspaceFactory.createParticipationComponent();
- }
- return participatesInGroups;
- }
-
public ThemeMenuComponent getThemeMenuComponent() {
if (themeMenu == null) {
themeMenu = WorkspaceFactory.createThemeMenuComponent();
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-11 11:18:26 UTC (rev 799)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-12 13:46:02 UTC (rev 800)
@@ -228,9 +228,6 @@
setContentToolBar(components.getContentToolBarComponent().getView());
setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
setBottom(components.getLicenseComponent().getView());
- setGroupMembers(components.getGroupMembersComponent().getView());
- setParticipation(components.getParticipationComponent().getView());
- setSummary(components.getGroupSummaryComponent().getView());
addBottomIconComponent(components.getThemeMenuComponent().getView());
}
1
0
r799 - in trunk/src/main/java/org/ourproject/kune: platf/client/services platf/client/ui workspace/client/ui/newtmp/themes
by vjrj 11 Jul '08
by vjrj 11 Jul '08
11 Jul '08
Author: vjrj
Date: 2008-07-11 13:18:26 +0200 (Fri, 11 Jul 2008)
New Revision: 799
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
Log:
Workspace refactorization
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-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-11 11:18:26 UTC (rev 799)
@@ -172,7 +172,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
final WsThemePresenter presenter = new WsThemePresenter(builder.getInstance(Session.class));
- final WsThemePanel panel = new WsThemePanel(ws, presenter);
+ final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 11:18:26 UTC (rev 799)
@@ -44,11 +44,11 @@
private final SimplePanel contentPanel;
private final Images img;
private final Image arrowImage;
- private final RoundedBorderDecorator outerBorder;
+ private final RoundedPanel outerBorder;
public DropDownPanel() {
vp = new VerticalPanel();
- outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL);
+ outerBorder = new RoundedPanel(vp, RoundedPanel.ALL);
titleHP = new HorizontalPanel();
arrowImage = new Image();
titleLabel = new Label();
@@ -142,14 +142,14 @@
public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
if (oldTheme != null) {
final String oldThemeS = oldTheme.toString();
- outerBorder.removeStyleDependentName(oldThemeS);
+ // outerBorder.removeStyleDependentName(oldThemeS);
vp.removeStyleDependentName(oldThemeS);
titleHP.removeStyleDependentName(oldThemeS);
contentPanel.removeStyleDependentName(oldThemeS);
}
final String newThemeS = newTheme.toString();
outerBorder.setCornerStyleName("k-dropdownouter-" + newThemeS);
- outerBorder.addStyleDependentName(newThemeS);
+ // outerBorder.addStyleDependentName(newThemeS);
vp.addStyleDependentName(newThemeS);
titleHP.addStyleDependentName(newThemeS);
contentPanel.addStyleDependentName(newThemeS);
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-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-11 11:18:26 UTC (rev 799)
@@ -1,5 +1,6 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.calclab.suco.client.signal.Slot2;
@@ -15,13 +16,15 @@
private final Menu menu;
private final WsThemePresenter presenter;
- public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
+ public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter,
+ final I18nUITranslationService i18n) {
this.presenter = presenter;
menu = new Menu();
menu.setDefaultAlign("br-tr");
super.setMenu(menu);
super.setIcon("images/colors.gif");
+ super.setTooltip(i18n.t("Select Workspace theme for this group"));
ws.getSiteTraybar().addButton(this);
presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
1
0
Author: vjrj
Date: 2008-07-11 12:36:49 +0200 (Fri, 11 Jul 2008)
New Revision: 798
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java
Removed:
trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/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/WorkspacePanel.java
Log:
Workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-11 10:36:49 UTC (rev 798)
@@ -249,3 +249,38 @@
.ytb-spacer {
width: 2px;
}
+
+/* Drop down */
+
+.k-dropdownouter {
+}
+
+.k-dropdownouter-def {
+ background-color: #87501E;
+}
+
+.k-dropdownouter-green {
+ background-color: #00D400;
+}
+
+.k-dropdowninner {
+ margin: 0 3px 1px 3px;
+ background: green;
+ background-color: #FFF;
+ padding: 3px;
+}
+
+.k-dropdownlabel {
+ color: #FFF;
+ cursor: pointer;
+}
+
+.k-dropdownlabel .gwt-Label {
+ margin: 0 5px 0 0;
+ width: 100%;
+}
+
+.k-dropdownlabel img {
+ margin: 0 3px 0 1px;
+}
+
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -28,7 +28,6 @@
import org.ourproject.kune.docs.client.actions.ContentRenameAction;
import org.ourproject.kune.docs.client.actions.ContentSetLanguageAction;
import org.ourproject.kune.docs.client.actions.ContentSetPublishedOnAction;
-import org.ourproject.kune.docs.client.actions.ContentSetTagsAction;
import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.docs.client.actions.GoParentFolderAction;
import org.ourproject.kune.docs.client.actions.RenameTokenAction;
@@ -51,27 +50,26 @@
private final I18nTranslationService i18n;
public DocsClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void configure(final Register register) {
- register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n));
- register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n));
- register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n));
- register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
- register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
- register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
- register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace));
- register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace));
- register.addAction(DocsEvents.SET_TAGS, new ContentSetTagsAction(session, workspace));
- register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
- register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
- register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
- register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction());
- register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction());
+ register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n));
+ register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n));
+ register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n));
+ register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
+ register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
+ register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
+ register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace));
+ register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace));
+ register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
+ register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
+ register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
+ register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction());
+ register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -6,6 +6,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.workspace.Tags;
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.container.Provider;
@@ -25,7 +26,8 @@
public void onLoad(final ModuleBuilder builder) {
builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() {
public DocumentFactory get() {
- return new DocumentFactory(builder.getInstance(I18nUITranslationService.class));
+ return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder
+ .getInstance(Session.class), builder.getInstance(Tags.class));
}
}, SingletonScope.class);
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,60 +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.docs.client.actions;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentService;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class ContentSetTagsAction implements Action<String> {
-
- private final Session session;
- private final Workspace workspace;
-
- public ContentSetTagsAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
- }
-
- public void execute(final String value) {
- onContentsetTags(value);
- }
-
- private void onContentsetTags(final String tags) {
- Site.showProgressProcessing();
- ContentServiceAsync server = ContentService.App.getInstance();
- StateDTO currentState = session.getCurrentState();
- server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
- tags, new AsyncCallbackSimple<List<TagResultDTO>>() {
- public void onSuccess(final List<TagResultDTO> result) {
- workspace.getTagsComponent().setGroupTags(result);
- Site.hideProgress();
- }
- });
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -28,7 +28,6 @@
public static final String REMOVE_AUTHOR = "docs.removeAuthor";
public static final String SET_LANGUAGE = "docs.setLanguage";
public static final String SET_PUBLISHED_ON = "docs.setPublishedOn";
- public static final String SET_TAGS = "docs.setTags";
public static final String RENAME_CONTENT = "docs.setTitle";
public static final String RENAME_TOKEN = "docs.RenameToken";
public static final String DEL_CONTENT = "docs.delContent";
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -30,70 +30,90 @@
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentService;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.workspace.Tags;
public class AdminContextPresenter extends AbstractPresenter implements AdminContext {
private AdminContextView view;
+ private final Session session;
+ private final Tags tags;
- public AdminContextPresenter() {
+ public AdminContextPresenter(final Session session, final Tags tags) {
+ this.session = session;
+ this.tags = tags;
}
- public void init(final AdminContextView view) {
- this.view = view;
+ public void doChangeLanguage(final String langCode) {
+ DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode);
}
- public void setState(final StateDTO content) {
- // In the future check the use of these components by each tool
- I18nLanguageDTO language = content.getLanguage();
- AccessListsDTO accessLists = content.getAccessLists();
- Date publishedOn = content.getPublishedOn();
- String tags = content.getTags();
- List<UserSimpleDTO> authors = content.getAuthors();
-
- if (content.hasDocument()) {
- if (tags != null) {
- view.setTags(tags);
- } else {
- view.removeTagsComponent();
- }
- if (language != null) {
- view.setLanguage(language);
- } else {
- view.removeLangComponent();
- }
- if (authors != null) {
- view.setAuthors(authors);
- } else {
- view.removeAuthorsComponent();
- }
- if (publishedOn != null) {
- view.setPublishedOn(publishedOn);
- } else {
- view.removePublishedOnComponent();
- }
- if (accessLists != null) {
- view.setAccessLists(accessLists);
- } else {
- view.removeAccessListComponent();
- }
- }
+ public View getView() {
+ return view;
}
- public View getView() {
- return view;
+ public void init(final AdminContextView view) {
+ this.view = view;
}
public void setPublishedOn(final Date date) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date);
+ DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date);
}
- public void setTags(final String tags) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_TAGS, tags);
+ public void setState(final StateDTO content) {
+ // In the future check the use of these components by each tool
+ final I18nLanguageDTO language = content.getLanguage();
+ final AccessListsDTO accessLists = content.getAccessLists();
+ final Date publishedOn = content.getPublishedOn();
+ final String tags = content.getTags();
+ final List<UserSimpleDTO> authors = content.getAuthors();
+
+ if (content.hasDocument()) {
+ if (tags != null) {
+ view.setTags(tags);
+ } else {
+ view.removeTagsComponent();
+ }
+ if (language != null) {
+ view.setLanguage(language);
+ } else {
+ view.removeLangComponent();
+ }
+ if (authors != null) {
+ view.setAuthors(authors);
+ } else {
+ view.removeAuthorsComponent();
+ }
+ if (publishedOn != null) {
+ view.setPublishedOn(publishedOn);
+ } else {
+ view.removePublishedOnComponent();
+ }
+ if (accessLists != null) {
+ view.setAccessLists(accessLists);
+ } else {
+ view.removeAccessListComponent();
+ }
+ }
}
- public void doChangeLanguage(final String langCode) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode);
+ public void setTags(final String tagsString) {
+ Site.showProgressProcessing();
+ final ContentServiceAsync server = ContentService.App.getInstance();
+ final StateDTO currentState = session.getCurrentState();
+ server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
+ tagsString, new AsyncCallbackSimple<List<TagResultDTO>>() {
+ public void onSuccess(final List<TagResultDTO> result) {
+ tags.setGroupTags(result);
+ Site.hideProgress();
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -48,65 +48,71 @@
import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
+import org.ourproject.kune.workspace.client.workspace.Tags;
public class DocumentFactory {
private final I18nTranslationService i18n;
+ private final Session session;
+ private final Tags tags;
- public DocumentFactory(final I18nTranslationService i18n) {
- this.i18n = i18n;
+ public DocumentFactory(final I18nTranslationService i18n, final Session session, final Tags tags) {
+ this.i18n = i18n;
+ this.session = session;
+ this.tags = tags;
}
public AdminContext createAdminContext() {
- AdminContextPresenter presenter = new AdminContextPresenter();
- AdminContextView view = new AdminContextPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final AdminContextPresenter presenter = new AdminContextPresenter(session, tags);
+ final AdminContextView view = new AdminContextPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public DocumentContent createDocumentContent(final DocumentContentListener listener) {
- WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel);
- return presenter;
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel);
+ return presenter;
}
public DocumentContext createDocumentContext() {
- WorkspaceDeckPanel view = new WorkspaceDeckPanel();
- DocumentContextPresenter presenter = new DocumentContextPresenter(this, view);
- return presenter;
+ final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
+ final DocumentContextPresenter presenter = new DocumentContextPresenter(this, view);
+ return presenter;
}
public DocumentReader createDocumentReader(final DocumentReaderListener listener) {
- DocumentReaderView view = new DocumentReaderPanel();
- DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
- return presenter;
+ final DocumentReaderView view = new DocumentReaderPanel();
+ final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
+ return presenter;
}
public DocumentReaderControl createDocumentReaderControl(final DocumentReaderListener listener) {
- DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n);
- DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
- return presenter;
+ final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n);
+ final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
+ return presenter;
}
public FolderContext createFolderContext() {
- ContextItems contextItems = WorkspaceFactory.createContextItems();
- FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n);
- return presenter;
+ final ContextItems contextItems = WorkspaceFactory.createContextItems();
+ final FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n);
+ return presenter;
}
public FolderEditor createFolderEditor() {
- FolderEditorPanel view = new FolderEditorPanel();
- FolderEditorPresenter presenter = new FolderEditorPresenter(view);
- return presenter;
+ final FolderEditorPanel view = new FolderEditorPanel();
+ final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
+ return presenter;
}
public FolderViewer createFolderViewer() {
- FolderViewerView view = new FolderViewerPanel();
- FolderViewerPresenter presenter = new FolderViewerPresenter(view);
- return presenter;
+ final FolderViewerView view = new FolderViewerPanel();
+ final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
+ return presenter;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -67,7 +67,7 @@
configurationManager.persist(config);
final String longName = group.getLongName();
final String publicDesc = group.getPublicDesc();
- final Content descriptor = contentManager.createContent(i18n.t("About") + longName, publicDesc == null ? ""
+ final Content descriptor = contentManager.createContent(i18n.t("About [%s]", longName), publicDesc == null ? ""
: publicDesc, user, container);
descriptor.addAuthor(user);
descriptor.setLanguage(user.getLanguage());
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -17,12 +17,16 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
+import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
+import org.ourproject.kune.workspace.client.search.SiteSearcherView;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.tags.TagsPresenter;
+import org.ourproject.kune.workspace.client.tags.ui.TagsPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
@@ -36,6 +40,7 @@
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.Tags;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
@@ -137,9 +142,18 @@
}
}, SingletonScope.class);
+ builder.registerProvider(SiteSearcher.class, new Provider<SiteSearcher>() {
+ public SiteSearcher get() {
+ final SiteSearcherPresenter presenter = new SiteSearcherPresenter();
+ final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
public SiteSearch get() {
- final SiteSearchPresenter presenter = new SiteSearchPresenter();
+ final SiteSearchPresenter presenter = new SiteSearchPresenter(builder.getProvider(SiteSearcher.class));
final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
@@ -192,24 +206,29 @@
}
}, SingletonScope.class);
- builder.registerProvider(SiteBarPresenter.class, new Provider<SiteBarPresenter>() {
- public SiteBarPresenter get() {
- final SiteBarPresenter presenter = new SiteBarPresenter();
- final SiteBarPanel panel = new SiteBarPanel(presenter, i18n, ws);
- presenter.init(panel);
- return presenter;
- }
- }, SingletonScope.class);
-
builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
public WorkspaceManager get() {
final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
.getInstance(EntityTitlePresenter.class), builder.getInstance(EntitySubTitlePresenter.class),
- builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class));
+ builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class),
+ builder.getInstance(Tags.class));
return presenter;
}
}, SingletonScope.class);
+ builder.registerProvider(Tags.class, new Provider<Tags>() {
+ public Tags get() {
+ final TagsPresenter presenter = new TagsPresenter(builder.getProvider(Session.class), builder
+ .getProvider(SiteSearcher.class));
+ final TagsPanel panel = new TagsPanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ // builder.registerProvider(type, new Provider<>() {},
+ // SingletonScope.class);
+
builder.registerProvider(StateManager.class, new Provider<StateManager>() {
public StateManager get() {
final Session session = builder.getInstance(Session.class);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -150,7 +150,6 @@
workspace.setContent(clientTool.getContent());
workspace.setContext(clientTool.getContext());
workspace.getLicenseComponent().setLicense(state);
- workspace.getTagsComponent().setState(state);
setSocialNetwork(state);
workspace.getGroupSummaryComponent().setGroupSummary(state);
Site.hideProgress();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -20,8 +20,8 @@
package org.ourproject.kune.platf.client.ui;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -37,129 +37,127 @@
* </p>
*
*/
-public class DropDownPanel extends Composite implements ClickListener, HasColor {
- private VerticalPanel vp;
- private HorizontalPanel titleHP;
- private Label titleLabel;
- private SimplePanel contentPanel;
- private Images img;
- private Image arrowImage;
- private RoundedBorderDecorator outerBorder;
+public class DropDownPanel extends Composite implements ClickListener {
+ private final VerticalPanel vp;
+ private final HorizontalPanel titleHP;
+ private final Label titleLabel;
+ private final SimplePanel contentPanel;
+ private final Images img;
+ private final Image arrowImage;
+ private final RoundedBorderDecorator outerBorder;
public DropDownPanel() {
- initialize();
- layout();
- setProperties();
- setContentVisible(false);
- arrowImage.addClickListener(this);
- titleLabel.addClickListener(this);
+ vp = new VerticalPanel();
+ outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL);
+ titleHP = new HorizontalPanel();
+ arrowImage = new Image();
+ titleLabel = new Label();
+ contentPanel = new SimplePanel();
+
+ initWidget(outerBorder);
+ vp.add(titleHP);
+ vp.add(contentPanel);
+ titleHP.add(arrowImage);
+ titleHP.add(titleLabel);
+
+ outerBorder.setCornerStyleName("k-dropdownouter");
+ vp.setStylePrimaryName("k-dropdownouter");
+ vp.setWidth("100%");
+ vp.setCellWidth(contentPanel, "100%");
+ vp.setCellWidth(titleHP, "100%");
+ titleHP.setStylePrimaryName("k-dropdownlabel");
+ img = Images.App.getInstance();
+ img.arrowDownWhite().applyTo(arrowImage);
+ titleLabel.setText("");
+ contentPanel.setStylePrimaryName("k-dropdowninner");
+
+ setContentVisible(false);
+ arrowImage.addClickListener(this);
+ titleLabel.addClickListener(this);
}
public DropDownPanel(final boolean visible) {
- this();
- setContentVisible(visible);
+ this();
+ setContentVisible(visible);
}
public DropDownPanel(final String headerText, final boolean visible) {
- this();
- setContentVisible(visible);
- setHeaderText(headerText);
+ this();
+ setContentVisible(visible);
+ setHeaderText(headerText);
}
- public void setContent(final Widget widget) {
- contentPanel.setWidget(widget);
- // refresh panel
- setContentVisible(isContentVisible());
- }
-
- public void setContentVisible(final boolean visible) {
- if (visible) {
- img.arrowDownWhite().applyTo(arrowImage);
- contentPanel.setVisible(true);
-
- } else {
- img.arrowRightWhite().applyTo(arrowImage);
- contentPanel.setVisible(false);
- }
- }
-
public boolean isContentVisible() {
- return contentPanel.isVisible();
+ return contentPanel.isVisible();
}
- public void setHeaderText(final String text) {
- titleLabel.setText(text);
+ public void onClick(final Widget sender) {
+ if (sender == titleHP | sender == arrowImage | sender == titleLabel) {
+ setContentVisible(!isContentVisible());
+ }
}
- public void setHeaderTitle(final String title) {
- // QuickTips size problems with images
- // KuneUiUtils.setQuickTip(arrowImage, title);
- KuneUiUtils.setQuickTip(titleLabel, title);
+ @Deprecated
+ public void setColor(final String color) {
+ // outerBorder.setColor(color);
+ // DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor",
+ // color);
+ // DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color);
+ // DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor",
+ // color);
}
- public void onClick(final Widget sender) {
- if (sender == titleHP | sender == arrowImage | sender == titleLabel) {
- setContentVisible(!isContentVisible());
- }
+ public void setContent(final Widget widget) {
+ contentPanel.setWidget(widget);
+ // refresh panel
+ setContentVisible(isContentVisible());
}
- public void setColor(final String color) {
- outerBorder.setColor(color);
- DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor", color);
- DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color);
- DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor", color);
- }
+ public void setContentVisible(final boolean visible) {
+ if (visible) {
+ img.arrowDownWhite().applyTo(arrowImage);
+ contentPanel.setVisible(true);
- public void setBackgroundColor(final String color) {
- DOM.setStyleAttribute(contentPanel.getElement(), "backgroundColor", color);
+ } else {
+ img.arrowRightWhite().applyTo(arrowImage);
+ contentPanel.setVisible(false);
+ }
}
- public String getColor() {
- return outerBorder.getColor();
+ public void setHeaderText(final String text) {
+ titleLabel.setText(text);
}
- public void setWidth(final String width) {
- super.setWidth(width);
- outerBorder.setWidth(width);
+ public void setHeaderTitle(final String title) {
+ // QuickTips size problems with images
+ KuneUiUtils.setQuickTip(arrowImage, title);
+ KuneUiUtils.setQuickTip(titleLabel, title);
}
public void setHeight(final String height) {
- super.setHeight(height);
- outerBorder.setHeight(height);
+ super.setHeight(height);
+ outerBorder.setHeight(height);
}
- private void initialize() {
- vp = new VerticalPanel();
- outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL);
- titleHP = new HorizontalPanel();
- arrowImage = new Image();
- titleLabel = new Label();
- contentPanel = new SimplePanel();
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ final String oldThemeS = oldTheme.toString();
+ outerBorder.removeStyleDependentName(oldThemeS);
+ vp.removeStyleDependentName(oldThemeS);
+ titleHP.removeStyleDependentName(oldThemeS);
+ contentPanel.removeStyleDependentName(oldThemeS);
+ }
+ final String newThemeS = newTheme.toString();
+ outerBorder.setCornerStyleName("k-dropdownouter-" + newThemeS);
+ outerBorder.addStyleDependentName(newThemeS);
+ vp.addStyleDependentName(newThemeS);
+ titleHP.addStyleDependentName(newThemeS);
+ contentPanel.addStyleDependentName(newThemeS);
}
- private void layout() {
- initWidget(outerBorder);
- vp.add(titleHP);
- vp.add(contentPanel);
- titleHP.add(arrowImage);
- titleHP.add(titleLabel);
+ public void setWidth(final String width) {
+ super.setWidth(width);
+ outerBorder.setWidth(width);
}
- private void setProperties() {
- outerBorder.setCornerStyleName("kune-DropDownOuter");
-
- vp.addStyleName("kune-DropDownOuter");
- vp.setWidth("100%");
- vp.setCellWidth(contentPanel, "100%");
- vp.setCellWidth(titleHP, "100%");
-
- titleHP.addStyleName("kune-DropDownLabel");
-
- img = Images.App.getInstance();
- img.arrowDownWhite().applyTo(arrowImage);
-
- titleLabel.setText("");
-
- contentPanel.addStyleName("kune-DropDownInner");
- }
}
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-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -42,7 +42,6 @@
import org.ourproject.kune.workspace.client.actions.RateContentAction;
import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
-import org.ourproject.kune.workspace.client.actions.ShowSearcherAction;
import org.ourproject.kune.workspace.client.actions.StopAction;
import org.ourproject.kune.workspace.client.actions.UserLoginAction;
import org.ourproject.kune.workspace.client.actions.UserLogoutAction;
@@ -114,7 +113,6 @@
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.SHOW_SEARCHER, new ShowSearcherAction());
register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
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-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -57,9 +57,6 @@
import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearchPanel;
import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
-import org.ourproject.kune.workspace.client.tags.TagsPresenter;
-import org.ourproject.kune.workspace.client.tags.TagsView;
-import org.ourproject.kune.workspace.client.tags.ui.TagsPanel;
import org.ourproject.kune.workspace.client.theme.ThemeMenuPresenter;
import org.ourproject.kune.workspace.client.theme.ThemeMenuView;
import org.ourproject.kune.workspace.client.theme.ui.ThemeMenuPanel;
@@ -82,7 +79,6 @@
import org.ourproject.kune.workspace.client.workspace.GroupMembersComponent;
import org.ourproject.kune.workspace.client.workspace.GroupSummaryComponent;
import org.ourproject.kune.workspace.client.workspace.ParticipationComponent;
-import org.ourproject.kune.workspace.client.workspace.TagsComponent;
import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent;
import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -102,133 +98,126 @@
private static KuneErrorHandler errorHandler;
public static ContentBottomToolBarComponent createContentBottomToolBarComponent() {
- ContentBottomToolBarPresenter presenter = new ContentBottomToolBarPresenter();
- ContentBottomToolBarView view = new ContentBottomToolBarPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final ContentBottomToolBarPresenter presenter = new ContentBottomToolBarPresenter();
+ final ContentBottomToolBarView view = new ContentBottomToolBarPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static ContentSubTitleComponent createContentSubTitleComponent() {
- ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
- ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
+ final ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static ContentTitleComponent createContentTitleComponent() {
- ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler);
- ContentTitleView view = new ContentTitlePanel(presenter);
- presenter.init(view);
- return presenter;
+ final ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler);
+ final ContentTitleView view = new ContentTitlePanel(presenter);
+ presenter.init(view);
+ return presenter;
}
public static ContentToolBarComponent createContentToolBarComponent() {
- ContentToolBarPresenter presenter = new ContentToolBarPresenter();
- ContentToolBarView view = new ContentToolBarPanel(presenter);
- presenter.init(view);
- return presenter;
+ final ContentToolBarPresenter presenter = new ContentToolBarPresenter();
+ final ContentToolBarView view = new ContentToolBarPanel(presenter);
+ presenter.init(view);
+ return presenter;
}
public static ContextItems createContextItems() {
- ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
- ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n);
- presenter.init(panel);
- return presenter;
+ final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
+ final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
}
public static DesktopView createDesktop(final Workspace workspace, final SiteBarListener listener,
- final Session session) {
- return new DesktopPanel(workspace, listener, session, i18n);
+ final Session session) {
+ return new DesktopPanel(workspace, listener, session, i18n);
}
public static TextEditor createDocumentEditor(final TextEditorListener listener) {
- TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
- TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
- presenter.init(panel);
- return presenter;
+ final TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
+ final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
}
public static GroupLiveSearchComponent createGroupLiveSearchComponent() {
- GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter();
- EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter();
+ final EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static GroupMembersComponent createGroupMembersComponent() {
- GroupMembersPresenter presenter = new GroupMembersPresenter(i18n);
- GroupMembersView view = new GroupMembersPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final GroupMembersPresenter presenter = new GroupMembersPresenter(i18n);
+ final GroupMembersView view = new GroupMembersPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static GroupSummaryComponent createGroupSummaryComponent() {
- GroupSummaryPresenter presenter = new GroupSummaryPresenter();
- GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme);
- presenter.init(view);
- return presenter;
+ final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
+ final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme);
+ presenter.init(view);
+ return presenter;
}
public static I18nTranslatorComponent createI18nTranslatorComponent() {
- I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session);
- I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session);
+ final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static LanguageSelectorComponent createLanguageSelectorComponent() {
- LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
- LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
+ final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static LicenseComponent createLicenseComponent() {
- LicensePresenter presenter = new LicensePresenter();
- LicenseView view = new LicensePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final LicensePresenter presenter = new LicensePresenter();
+ final LicenseView view = new LicensePanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static ParticipationComponent createParticipationComponent() {
- ParticipationPresenter presenter = new ParticipationPresenter(i18n);
- ParticipationView view = new ParticipationPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final ParticipationPresenter presenter = new ParticipationPresenter(i18n);
+ final ParticipationView view = new ParticipationPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
- public static TagsComponent createTagsComponent() {
- TagsPresenter presenter = new TagsPresenter(session);
- TagsView view = new TagsPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
public static ThemeMenuComponent createThemeMenuComponent() {
- ThemeMenuPresenter presenter = new ThemeMenuPresenter();
- ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme);
- presenter.init(view);
- return presenter;
+ final ThemeMenuPresenter presenter = new ThemeMenuPresenter();
+ final ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme);
+ presenter.init(view);
+ return presenter;
}
public static UserLiveSearchComponent createUserLiveSearchComponent() {
- UserLiveSearchPresenter presenter = new UserLiveSearchPresenter();
- EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ 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) {
- WorkspaceFactory.session = session;
- WorkspaceFactory.i18n = i18n;
- WorkspaceFactory.colorTheme = colorTheme;
- WorkspaceFactory.errorHandler = errorHandler;
- WorkspacePresenter workspace = new WorkspacePresenter(session);
- WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme);
- workspace.init(view, extensionPointManager);
- return workspace;
+ final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n,
+ final ColorTheme colorTheme, final KuneErrorHandler errorHandler) {
+ WorkspaceFactory.session = session;
+ WorkspaceFactory.i18n = i18n;
+ WorkspaceFactory.colorTheme = colorTheme;
+ WorkspaceFactory.errorHandler = errorHandler;
+ final WorkspacePresenter workspace = new WorkspacePresenter(session);
+ final WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme);
+ workspace.init(view, extensionPointManager);
+ return workspace;
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,49 +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.platf.client.dto.ShowSearcherActionParams;
-import org.ourproject.kune.workspace.client.search.SearchSite;
-import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
-
-public class ShowSearcherAction implements Action<ShowSearcherActionParams> {
-
- public void execute(final ShowSearcherActionParams params) {
- onShowSearcherAction(params.getTermToSearch(), params.getTypeOfSearch());
- }
-
- private void onShowSearcherAction(final String termToSearch, final Integer typeOfSearch) {
- Site.showProgressLoading();
- final SearchSite search = SiteBarFactory.getSearch();
- if (termToSearch != null) {
- if (typeOfSearch != null) {
- search.doSearchOfType(termToSearch, typeOfSearch.intValue());
- } else {
- search.doSearch(termToSearch);
- }
- }
- SearchSitePanel searchPanel = (SearchSitePanel) search.getView();
- searchPanel.show();
- Site.hideProgress();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -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.search;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface SearchSite {
-
- public View getView();
-
- public void doSearch(String termToSearch);
-
- public void doSearchOfType(String termToSearch, int type);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,88 +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.search;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class SearchSitePresenter extends AbstractPresenter implements SearchSite {
-
- private SearchSiteView view;
- private int currentSearch;
- private final HashMap<String, Integer> searchHistory;
-
- public SearchSitePresenter() {
- searchHistory = new HashMap<String, Integer>();
- currentSearch = SearchSiteView.GROUP_USER_SEARCH;
- }
-
- public void init(final SearchSiteView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-
- public void doClose() {
- view.hide();
- }
-
- public void doSearch(final int typeOfSearch) {
- doSearchOfType(view.getComboTextToSearch(), typeOfSearch);
- }
-
- public void doSearchOfType(final String text, final int typeOfSearch) {
- this.currentSearch = typeOfSearch;
- doSearch(text);
- }
-
- public void doSearch(final String text) {
- searchHistory.put(text, null);
- Log.debug("Search History: " + searchHistory.toString());
- view.search(text, currentSearch);
- }
-
- public Object[][] getSearchHistory() {
- Object[][] objs = new Object[searchHistory.size()][1];
- int i = 0;
- for (Iterator<String> iterator = searchHistory.keySet().iterator(); iterator.hasNext();) {
- String search = iterator.next();
- Object[] obj = new Object[] { search };
- objs[i++] = obj;
- }
- return objs;
- }
-
- public void attachIconToBottomBar(final View view) {
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -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.search;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface SearchSiteView extends View {
-
- public static final int GROUP_USER_SEARCH = 1;
- public static final int CONTENT_SEARCH = 2;
-
- void search(String text, int currentSearch);
-
- String getComboTextToSearch();
-
- void hide();
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,28 @@
+/*
+ *
+ * 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.search;
+
+public interface SiteSearcher {
+
+ public void doSearch(String termToSearch);
+
+ public void doSearchOfType(String termToSearch, SiteSearcherType type);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,315 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.KeyboardListener;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.TabPanel;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.event.PanelListenerAdapter;
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
+import com.gwtext.client.widgets.grid.ColumnConfig;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class SiteSearcherPanel extends AbstractSearcherPanel implements SiteSearcherView {
+
+ private final Window dialog;
+ private final SiteSearcherPresenter presenter;
+ private Store groupStore;
+ private ComboBox searchCombo;
+ private Store historyStore;
+ private Store contentStore;
+ private GridPanel groupsGrid;
+ private GridPanel contentGrid;
+ private final WorkspaceSkeleton ws;
+
+ public SiteSearcherPanel(final SiteSearcherPresenter initPresenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(i18n);
+ this.presenter = initPresenter;
+ this.ws = ws;
+ dialog = createDialog();
+ }
+
+ public String getComboTextToSearch() {
+ return searchCombo.getValue();
+ }
+
+ public void hide() {
+ dialog.hide();
+ }
+
+ public void search(final String text, final SiteSearcherType type) {
+ searchCombo.setValue(text);
+ switch (type) {
+ case group_user:
+ query(groupStore, groupsGrid, text);
+ break;
+ case content:
+ query(contentStore, contentGrid, text);
+ break;
+ default:
+ break;
+ }
+ }
+
+ public void show() {
+ dialog.show();
+ dialog.expand();
+ dialog.center();
+ final ToolbarButton toolbarButton = new ToolbarButton();
+ toolbarButton.setTooltip(i18n.t("Show/hide searcher"));
+ toolbarButton.setIcon("images/kune-search-ico-push.gif");
+ toolbarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ } else {
+ dialog.show();
+ }
+ }
+
+ });
+ ws.getSiteTraybar().addButton(toolbarButton);
+ }
+
+ private Window createDialog() {
+ final Panel north = new Panel();
+ north.setHeight(50);
+ north.setBorder(false);
+
+ final TabPanel centerPanel = new TabPanel();
+ centerPanel.setActiveTab(0);
+ centerPanel.setAutoScroll(true);
+ centerPanel.setClosable(false);
+ centerPanel.setBorder(false);
+
+ final BasicDialog dialog = new BasicDialog(i18n.t("Search"), false, false, 500, 400);
+ // dialog.setResizable(false);
+ dialog.setIconCls("search-icon");
+ final Button closeButton = new Button(i18n.tWithNT("Close", "used in button"));
+ closeButton.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doClose();
+ }
+ });
+ dialog.addButton(closeButton);
+
+ final Panel searchPanel = createSearchForm(presenter);
+ final Panel groupsPanel = new Panel("Groups & Users");
+ final Panel contentPanel = new Panel("Content");
+ groupsPanel.setLayout(new FitLayout());
+ contentPanel.setLayout(new FitLayout());
+
+ groupsGrid = createSearchPanel(SiteSearcherType.group_user);
+ contentGrid = createSearchPanel(SiteSearcherType.content);
+ groupsPanel.add(groupsGrid);
+ contentPanel.add(contentGrid);
+ centerPanel.add(groupsPanel);
+ centerPanel.add(contentPanel);
+ dialog.add(searchPanel, new BorderLayoutData(RegionPosition.NORTH));
+ dialog.add(centerPanel, new BorderLayoutData(RegionPosition.CENTER));
+
+ groupsPanel.addListener(new PanelListenerAdapter() {
+ public void onActivate(final Panel panel) {
+ dialog.setTitle(i18n.t("Search users & groups"));
+ presenter.doSearch(SiteSearcherType.group_user);
+ }
+ });
+
+ contentPanel.addListener(new PanelListenerAdapter() {
+ public void onActivate(final Panel panel) {
+ dialog.setTitle(i18n.t("Search contents"));
+ presenter.doSearch(SiteSearcherType.content);
+ }
+ });
+
+ final String panelId = groupsPanel.getId();
+ centerPanel.setActiveItemID(panelId);
+
+ dialog.setCloseAction(Window.HIDE);
+
+ dialog.addListener(new WindowListenerAdapter() {
+ public void onCollapse(final Panel panel) {
+ // dialog.hide();
+ }
+ });
+
+ return dialog;
+ }
+
+ private Panel createSearchForm(final SiteSearcherPresenter presenter) {
+ final Panel searchPanel = new Panel();
+ searchPanel.setBorder(false);
+
+ final HorizontalPanel hp = new HorizontalPanel();
+
+ final FormPanel form = new FormPanel();
+ form.setBorder(false);
+ form.setWidth(330);
+ form.setHideLabels(true);
+
+ historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+
+ searchCombo = new ComboBox();
+ searchCombo.setStore(historyStore);
+ searchCombo.setDisplayField("term");
+ searchCombo.setTypeAhead(false);
+ searchCombo.setLoadingText(i18n.t("Searching..."));
+ searchCombo.setWidth(300);
+ searchCombo.setPageSize(10);
+ searchCombo.setMode(ComboBox.LOCAL);
+ searchCombo.setMinChars(1);
+ searchCombo.setValueField("term");
+ searchCombo.setForceSelection(false);
+ searchCombo.setEditable(true);
+ historyStore.load();
+ searchCombo.addListener(new ComboBoxListenerAdapter() {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ presenter.doSearch(getComboTextToSearch());
+ historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+ searchCombo.setStore(historyStore);
+ historyStore.load();
+ }
+ });
+ searchCombo.addListener(new FieldListenerAdapter() {
+ public void onChange(final Field field, final Object newVal, final Object oldVal) {
+ // Maybe we use...
+ }
+
+ public void onSpecialKey(final Field field, final EventObject e) {
+ switch (e.getKey()) {
+ case KeyboardListener.KEY_ENTER:
+ Log.debug("Enter pressed");
+ Log.debug("field: " + field.getValueAsString());
+ Log.debug("field2: " + getComboTextToSearch());
+ presenter.doSearch(field.getValueAsString());
+ historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+ historyStore.load();
+ searchCombo.setStore(historyStore);
+ break;
+ }
+ e.stopEvent();
+ }
+
+ });
+ form.add(searchCombo);
+
+ final Button searchBtn = new Button(i18n.tWithNT("Search", "used in button"));
+ searchBtn.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doSearch(getComboTextToSearch());
+ }
+ });
+ hp.add(form);
+ hp.add(searchBtn);
+ hp.setSpacing(7);
+ hp.addStyleName("kune-Margin-Large-trbl");
+ searchPanel.add(hp);
+ return searchPanel;
+ }
+
+ private GridPanel createSearchPanel(final SiteSearcherType type) {
+ final String id = "shortName";
+ final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef(id), new StringFieldDef("longName"),
+ new StringFieldDef("link"), new StringFieldDef("iconUrl") };
+ final Store store;
+
+ switch (type) {
+ case group_user:
+ store = groupStore = createStore(fieldDefs, "/kune/json/GroupJSONService/search", id);
+ break;
+ case content:
+ store = contentStore = createStore(fieldDefs, "/kune/json/ContentJSONService/search", id);
+ break;
+ default:
+ throw new RuntimeException("Unknown type of search");
+ }
+
+ final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { new ColumnConfig() {
+ {
+ setDataIndex(id);
+ setWidth(100);
+ }
+ }, new ColumnConfig() {
+ {
+ setDataIndex("longName");
+ setWidth(350);
+ }
+ } });
+
+ // columnModel.setDefaultSortable(true);
+
+ final String gridName = type == SiteSearcherType.group_user ? "group-search" : "content-search";
+
+ final GridPanel grid = new GridPanel(gridName, 474, 250, store, columnModel);
+ createPagingToolbar(store, grid);
+ grid.setHideColumnHeader(true);
+ // final GridView view = new GridView();
+ // view.setForceFit(true);
+ // // view.setEnableRowBody(true);
+ // grid.setView(view);
+
+ grid.addListener(new PanelListenerAdapter() {
+ public void onRender(final Component component) {
+ Log.debug("Loading store");
+ store.load(0, PAGINATION_SIZE);
+ }
+ });
+
+ grid.addGridCellListener(new GridCellListenerAdapter() {
+ public void onCellClick(final GridPanel grid, final int rowIndex, final int colindex, final EventObject e) {
+ final Record record = store.getRecordAt(rowIndex);
+ final String groupShortName = record.getAsString(id);
+ presenter.doGoto(groupShortName);
+ }
+ });
+
+ return grid;
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,82 @@
+/*
+ *
+ * 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.search;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.ourproject.kune.platf.client.AbstractPresenter;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+
+import com.allen_sauer.gwt.log.client.Log;
+
+public class SiteSearcherPresenter extends AbstractPresenter implements SiteSearcher {
+
+ private SiteSearcherView view;
+ private SiteSearcherType currentSearch;
+ private final HashMap<String, Integer> searchHistory;
+
+ public SiteSearcherPresenter() {
+ searchHistory = new HashMap<String, Integer>();
+ currentSearch = SiteSearcherType.group_user;
+ }
+
+ public void doClose() {
+ view.hide();
+ }
+
+ public void doSearch(final SiteSearcherType typeOfSearch) {
+ doSearchOfType(view.getComboTextToSearch(), typeOfSearch);
+ }
+
+ public void doSearch(final String text) {
+ searchHistory.put(text, null);
+ Log.debug("Search History: " + searchHistory.toString());
+ Site.hideProgress();
+ view.search(text, currentSearch);
+ view.show();
+ }
+
+ public void doSearchOfType(final String text, final SiteSearcherType typeOfSearch) {
+ this.currentSearch = typeOfSearch;
+ doSearch(text);
+ }
+
+ public Object[][] getSearchHistory() {
+ final Object[][] objs = new Object[searchHistory.size()][1];
+ int i = 0;
+ for (final Iterator<String> iterator = searchHistory.keySet().iterator(); iterator.hasNext();) {
+ final String search = iterator.next();
+ final Object[] obj = new Object[] { search };
+ objs[i++] = obj;
+ }
+ return objs;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteSearcherView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.search;
+
+public enum SiteSearcherType {
+ group_user, content
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -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.search;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteSearcherView extends View {
+
+ String getComboTextToSearch();
+
+ void hide();
+
+ void search(String text, SiteSearcherType currentSearch);
+
+ void show();
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -33,10 +33,6 @@
import org.ourproject.kune.workspace.client.newgroup.NewGroupListener;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.search.SearchSite;
-import org.ourproject.kune.workspace.client.search.SearchSitePresenter;
-import org.ourproject.kune.workspace.client.search.SearchSiteView;
-import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel;
import org.ourproject.kune.workspace.client.sitebar.bar.SiteBar;
import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarPanel;
@@ -54,75 +50,64 @@
private static SiteMessage siteMessage;
private static Login login;
private static NewGroup newGroup;
- private static SearchSite search;
private static Session session;
private static I18nTranslationService i18n;
public static LicenseChoose createLicenseChoose() {
- List<LicenseDTO> licensesList = session.getLicenses();
- List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>();
+ final List<LicenseDTO> licensesList = session.getLicenses();
+ final List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>();
- for (Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) {
- LicenseDTO license = iterator.next();
- if (!license.isCC()) {
- licensesNonCCList.add(license);
- }
- }
- LicenseChoosePresenter presenter = new LicenseChoosePresenter();
- LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n);
- presenter.init(view, licensesList, licensesNonCCList);
- return presenter;
+ for (final Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) {
+ final LicenseDTO license = iterator.next();
+ if (!license.isCC()) {
+ licensesNonCCList.add(license);
+ }
+ }
+ final LicenseChoosePresenter presenter = new LicenseChoosePresenter();
+ final LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n);
+ presenter.init(view, licensesList, licensesNonCCList);
+ return presenter;
}
public static SiteBar createSiteBar(final SiteBarListener listener, final Session session,
- final I18nTranslationService i18n) {
- SiteBarFactory.session = session;
- SiteBarFactory.i18n = i18n;
- SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n);
- SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n);
- siteBarPresenter.init(siteBarView);
- Site.sitebar = siteBarPresenter;
- return siteBarPresenter;
+ final I18nTranslationService i18n) {
+ SiteBarFactory.session = session;
+ SiteBarFactory.i18n = i18n;
+ final SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n);
+ final SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n);
+ siteBarPresenter.init(siteBarView);
+ Site.sitebar = siteBarPresenter;
+ return siteBarPresenter;
}
public static Login getLoginForm(final LoginListener listener) {
- if (login == null) {
- LoginPresenter presenter = new LoginPresenter(session, listener, i18n);
- LoginPanel view = new LoginPanel(presenter, i18n);
- presenter.init(view);
- login = presenter;
- }
- return login;
+ if (login == null) {
+ final LoginPresenter presenter = new LoginPresenter(session, listener, i18n);
+ final LoginPanel view = new LoginPanel(presenter, i18n);
+ presenter.init(view);
+ login = presenter;
+ }
+ return login;
}
public static NewGroup getNewGroupForm(final NewGroupListener listener) {
- if (newGroup == null) {
- NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n);
- NewGroupPanel view = new NewGroupPanel(presenter, i18n);
- presenter.init(view);
- newGroup = presenter;
- }
- return newGroup;
+ if (newGroup == null) {
+ final NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n);
+ final NewGroupPanel view = new NewGroupPanel(presenter, i18n);
+ presenter.init(view);
+ newGroup = presenter;
+ }
+ return newGroup;
}
- public static SearchSite getSearch() {
- if (search == null) {
- SearchSitePresenter presenter = new SearchSitePresenter();
- SearchSiteView view = new SearchSitePanel(presenter, i18n);
- presenter.init(view);
- search = presenter;
- }
- return search;
- }
-
public static SiteMessage getSiteMessage() {
- if (siteMessage == null) {
- SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
- SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true);
- siteMessagePresenter.init(siteMessageView);
- siteMessage = siteMessagePresenter;
- Site.siteUserMessage = siteMessagePresenter;
- }
- return siteMessage;
+ if (siteMessage == null) {
+ final SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
+ final SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true);
+ siteMessagePresenter.init(siteMessageView);
+ siteMessage = siteMessagePresenter;
+ Site.siteUserMessage = siteMessagePresenter;
+ }
+ return siteMessage;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -29,8 +29,6 @@
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
import org.ourproject.kune.workspace.client.newgroup.NewGroup;
import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.search.SearchSite;
-import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
import org.ourproject.kune.workspace.client.sitebar.login.Login;
@@ -88,7 +86,6 @@
private final Widget progressPanel;
private final Widget progressText;
private final HorizontalPanel publicHP;
- private SearchSitePanel searchPanel;
private final ExtElement extRootBody;
private String publicUrl;
private Timer timeProgressMaxTime;
@@ -338,14 +335,6 @@
DOM.setInnerText(progressText.getElement(), text);
}
- public void showSearchPanel(final String termToSearch) {
- final SearchSite search = SiteBarFactory.getSearch();
- search.doSearch(termToSearch);
- searchPanel = (SearchSitePanel) search.getView();
- searchPanel.show();
- Site.hideProgress();
- }
-
public void unMask() {
extRootBody.unmask();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -49,198 +49,198 @@
private final I18nTranslationService i18n;
public SiteBarPresenter(final SiteBarListener listener, final Session session, final I18nTranslationService i18n) {
- this.listener = listener;
- this.session = session;
- this.i18n = i18n;
+ this.listener = listener;
+ this.session = session;
+ this.i18n = i18n;
}
public void changeState(final StateToken token) {
- listener.onChangeState(token);
+ listener.onChangeState(token);
}
public void doLogin(final String previousToken) {
- this.previousToken = previousToken;
- Site.showProgressProcessing();
- view.showLoginDialog();
- view.centerLoginDialog();
- Site.hideProgress();
+ this.previousToken = previousToken;
+ Site.showProgressProcessing();
+ view.showLoginDialog();
+ view.centerLoginDialog();
+ Site.hideProgress();
}
public void doLogout() {
- AsyncCallback<Object> callback = new AsyncCallback<Object>() {
- public void onFailure(final Throwable caught) {
- Site.hideProgress();
- try {
- throw caught;
- } catch (final SessionExpiredException e) {
- clientUILogout();
- } catch (final UserMustBeLoggedException e) {
- clientUILogout();
- } catch (final Throwable e) {
- GWT.log("Other kind of exception in doLogout", null);
- throw new RuntimeException();
- }
- }
+ final AsyncCallback<Object> callback = new AsyncCallback<Object>() {
+ public void onFailure(final Throwable caught) {
+ Site.hideProgress();
+ try {
+ throw caught;
+ } catch (final SessionExpiredException e) {
+ clientUILogout();
+ } catch (final UserMustBeLoggedException e) {
+ clientUILogout();
+ } catch (final Throwable e) {
+ GWT.log("Other kind of exception in doLogout", null);
+ throw new RuntimeException();
+ }
+ }
- public void onSuccess(final Object arg0) {
- Site.hideProgress();
- clientUILogout();
- }
+ public void onSuccess(final Object arg0) {
+ Site.hideProgress();
+ clientUILogout();
+ }
- private void clientUILogout() {
- view.restoreLoginLink();
- view.resetOptionsSubmenu();
- view.setLogoutLinkVisible(false);
- listener.onUserLoggedOut();
- }
- };
+ private void clientUILogout() {
+ view.restoreLoginLink();
+ view.resetOptionsSubmenu();
+ view.setLogoutLinkVisible(false);
+ listener.onUserLoggedOut();
+ }
+ };
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGOUT, callback);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGOUT, callback);
}
public void doNewGroup(final String previousTokenOrig) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- previousToken = previousTokenOrig;
- if (session.isLogged()) {
- Site.showProgressProcessing();
- view.showNewGroupDialog();
- view.centerNewGroupDialog();
- } else {
- returnToPreviousState();
- Site.info(i18n.t("Sign in or register to create a group"));
- }
- }
- });
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ previousToken = previousTokenOrig;
+ if (session.isLogged()) {
+ Site.showProgressProcessing();
+ view.showNewGroupDialog();
+ view.centerNewGroupDialog();
+ } else {
+ returnToPreviousState();
+ Site.info(i18n.t("Sign in or register to create a group"));
+ }
+ }
+ });
}
public void doSearch(final String termToSearch) {
- view.showSearchPanel(termToSearch);
+ // view.showSearchPanel(termToSearch);
}
public View getView() {
- return view;
+ return view;
}
public void hideProgress() {
- view.hideProgress();
+ view.hideProgress();
}
public void init(final SiteBarView view) {
- this.view = view;
- view.setLogoutLinkVisible(false);
+ this.view = view;
+ view.setLogoutLinkVisible(false);
}
public void mask() {
- view.mask();
+ view.mask();
}
public void mask(final String message) {
- view.mask(message);
+ view.mask(message);
}
public void onHelpInTranslation() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
}
public void onLoginCancelled() {
- view.hideLoginDialog();
- returnToPreviousState();
+ view.hideLoginDialog();
+ returnToPreviousState();
}
public void onLoginClose() {
- if (!session.isLogged()) {
- returnToPreviousState();
- }
+ if (!session.isLogged()) {
+ returnToPreviousState();
+ }
}
public void onNewGroupCancel() {
- view.hideNewGroupDialog();
- returnToPreviousState();
+ view.hideNewGroupDialog();
+ returnToPreviousState();
}
public void onNewGroupClose() {
- returnToPreviousState();
+ returnToPreviousState();
}
public void onNewGroupCreated(final StateToken homePage) {
- view.hideNewGroupDialog();
- changeState(homePage);
+ view.hideNewGroupDialog();
+ changeState(homePage);
}
public void reloadUserInfo(final String userHash) {
- UserServiceAsync siteBarService = UserService.App.getInstance();
- siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() {
- public void onFailure(final Throwable arg0) {
- Site.hideProgress();
- }
+ final UserServiceAsync siteBarService = UserService.App.getInstance();
+ siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() {
+ public void onFailure(final Throwable arg0) {
+ Site.hideProgress();
+ }
- public void onSuccess(final UserInfoDTO response) {
- showLoggedUser(response);
- Site.hideProgress();
- }
- });
+ public void onSuccess(final UserInfoDTO response) {
+ showLoggedUser(response);
+ Site.hideProgress();
+ }
+ });
}
public void setState(final StateDTO state) {
- StateToken token = state.getStateToken();
- if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
- String publicUrl = token.getPublicUrl();
- view.setContentGotoPublicUrl(publicUrl);
- view.setContentPublic(true);
- } else {
- view.setContentPublic(false);
- }
+ final StateToken token = state.getStateToken();
+ if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
+ final String publicUrl = token.getPublicUrl();
+ view.setContentGotoPublicUrl(publicUrl);
+ view.setContentPublic(true);
+ } else {
+ view.setContentPublic(false);
+ }
}
public void showAlertMessage(final String message) {
- view.showAlertMessage(message);
+ view.showAlertMessage(message);
}
public void showLoggedUser(final UserInfoDTO user) {
- if (user == null) {
- view.restoreLoginLink();
- view.setLogoutLinkVisible(false);
- } else {
- view.showLoggedUserName(user.getShortName(), user.getHomePage());
- view.setLogoutLinkVisible(true);
- view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab());
- }
+ if (user == null) {
+ view.restoreLoginLink();
+ view.setLogoutLinkVisible(false);
+ } else {
+ view.showLoggedUserName(user.getShortName(), user.getHomePage());
+ view.setLogoutLinkVisible(true);
+ view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab());
+ }
}
public void showProgress(final String text) {
- view.showProgress(text);
+ view.showProgress(text);
}
public void unMask() {
- view.unMask();
+ view.unMask();
}
public void userLoggedIn(final UserInfoDTO userInfoDTO) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGGED_IN, userInfoDTO);
- view.hideLoginDialog();
- returnToPreviousState();
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGGED_IN, userInfoDTO);
+ view.hideLoginDialog();
+ returnToPreviousState();
}
protected void onSearchFocus() {
- view.setTextSearchBig();
- view.clearSearchText();
+ view.setTextSearchBig();
+ view.clearSearchText();
}
protected void onSearchLostFocus(final String search) {
- if (search.length() == 0) {
- view.setDefaultTextSearch();
- view.setTextSearchSmall();
- }
+ if (search.length() == 0) {
+ view.setDefaultTextSearch();
+ view.setTextSearchSmall();
+ }
}
private void returnToPreviousState() {
- if (this.previousToken != null) {
- listener.onChangeState(new StateToken(this.previousToken));
- this.previousToken = null;
- }
+ if (this.previousToken != null) {
+ listener.onChangeState(new StateToken(this.previousToken));
+ this.previousToken = null;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -28,58 +28,56 @@
public interface SiteBarView extends View {
- void showLoggedUserName(String name, String homePage);
+ public void hideLoginDialog();
- void clearUserName();
+ void centerLoginDialog();
- void setLogo(Image logo);
+ void centerNewGroupDialog();
- void showProgress(String text);
+ void clearSearchText();
- void hideProgress();
+ void clearUserName();
- void clearSearchText();
+ void hideNewGroupDialog();
- void setSearchText(String text);
+ void hideProgress();
- void showLoginDialog();
+ void mask();
- void setLogoutLinkVisible(boolean visible);
+ void mask(String message);
- public void hideLoginDialog();
+ void resetOptionsSubmenu();
void restoreLoginLink();
- void showNewGroupDialog();
+ void setContentGotoPublicUrl(String publicUrl);
- void hideNewGroupDialog();
+ void setContentPublic(boolean visible);
void setDefaultTextSearch();
void setGroupsIsMember(List<LinkDTO> groupsIsAdmin, List<LinkDTO> groupsIsCollab);
- void resetOptionsSubmenu();
+ void setLogo(Image logo);
- void setTextSearchSmall();
+ void setLogoutLinkVisible(boolean visible);
+ void setSearchText(String text);
+
void setTextSearchBig();
- void showSearchPanel(String termToSearch);
+ void setTextSearchSmall();
- void centerLoginDialog();
+ void showAlertMessage(String message);
- void centerNewGroupDialog();
+ void showLoggedUserName(String name, String homePage);
- void showAlertMessage(String message);
+ void showLoginDialog();
- void mask();
+ void showNewGroupDialog();
- void mask(String message);
+ void showProgress(String text);
void unMask();
- void setContentGotoPublicUrl(String publicUrl);
-
- void setContentPublic(boolean visible);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -23,44 +23,50 @@
import java.util.List;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.ShowSearcherActionParams;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.search.SearchSiteView;
-import org.ourproject.kune.workspace.client.workspace.TagsComponent;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.search.SiteSearcherType;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.workspace.Tags;
-public class TagsPresenter implements TagsComponent {
+import com.calclab.suco.client.container.Provider;
+public class TagsPresenter implements Tags {
+
private TagsView view;
- private final Session session;
+ private final Provider<SiteSearcher> searcherProvider;
+ private final Provider<Session> sessionProvider;
- public TagsPresenter(final Session session) {
- this.session = session;
+ public TagsPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) {
+ this.sessionProvider = sessionProvider;
+ this.searcherProvider = searcherProvider;
}
- public void setState(final StateDTO state) {
- view.setTags(state.getGroupTags());
+ public void doSearchTag(final String name) {
+ searcherProvider.get().doSearchOfType(
+ "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name,
+ SiteSearcherType.content);
}
- public void setGroupTags(final List<TagResultDTO> groupTags) {
- view.setTags(groupTags);
+ public View getView() {
+ return view;
}
public void init(final TagsView view) {
- this.view = view;
+ this.view = view;
}
- public View getView() {
- return view;
+ public void setGroupTags(final List<TagResultDTO> groupTags) {
+ view.setTags(groupTags);
}
- public void doSearchTag(final String name) {
- DefaultDispatcher.getInstance().fire(
- WorkspaceEvents.SHOW_SEARCHER,
- new ShowSearcherActionParams("group:" + session.getCurrentState().getGroup().getShortName() + " tag:"
- + name, SearchSiteView.CONTENT_SEARCH));
+ public void setState(final StateDTO state) {
+ view.setTags(state.getGroupTags());
}
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -24,9 +24,12 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface TagsView extends View {
void setTags(List<TagResultDTO> groupTags);
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.tags.TagsPresenter;
import org.ourproject.kune.workspace.client.tags.TagsView;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FlowPanel;
@@ -43,43 +44,44 @@
private final Label noTagsLabel;
private final I18nTranslationService i18n;
- public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n) {
- super(i18n.t("Tags"), true);
- this.i18n = i18n;
- setHeaderTitle(i18n.t("Keywords or terms associated with this group"));
- this.presenter = presenter;
- addStyleName("kune-Margin-Medium-t");
- flowPanel = new FlowPanel();
- VerticalPanel vp = new VerticalPanel();
- vp.add(flowPanel);
- vp.setWidth("100%");
- vp.setCellWidth(flowPanel, "100%");
- super.setContent(vp);
- noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag"));
+ public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ super(i18n.t("Tags"), true);
+ this.i18n = i18n;
+ setHeaderTitle(i18n.t("Keywords or terms associated with this group"));
+ this.presenter = presenter;
+ addStyleName("kune-Margin-Medium-t");
+ flowPanel = new FlowPanel();
+ final VerticalPanel vp = new VerticalPanel();
+ vp.add(flowPanel);
+ vp.setWidth("100%");
+ vp.setCellWidth(flowPanel, "100%");
+ super.setContent(vp);
+ noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag"));
+ ws.getEntitySummary().addInSummary(this);
}
public void setTags(final List<TagResultDTO> groupTags) {
- flowPanel.clear();
- if (groupTags.size() == 0) {
- flowPanel.add(noTagsLabel);
- } else {
- for (Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
- final TagResultDTO tagResult = iterator.next();
- Label label = new Label(tagResult.getName());
- // i18n pluralization
- if (tagResult.getCount().intValue() > 1) {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
- } else {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
- }
- label.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.doSearchTag(tagResult.getName());
- }
- });
- label.addStyleName("kune-TagsPanel-tag");
- flowPanel.add(label);
- }
- }
+ flowPanel.clear();
+ if (groupTags.size() == 0) {
+ flowPanel.add(noTagsLabel);
+ } else {
+ for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
+ final TagResultDTO tagResult = iterator.next();
+ final Label label = new Label(tagResult.getName());
+ // i18n pluralization
+ if (tagResult.getCount().intValue() > 1) {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ } else {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ }
+ label.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.doSearchTag(tagResult.getName());
+ }
+ });
+ label.addStyleName("kune-TagsPanel-tag");
+ flowPanel.add(label);
+ }
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -7,6 +7,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.workspace.Tags;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import com.calclab.suco.client.signal.Slot2;
@@ -18,18 +19,21 @@
private final WsThemePresenter wsThemePresenter;
private final EntityLicensePresenter entityLicensePresenter;
private final EntitySubTitlePresenter entitySubTitlePresenter;
+ private final Tags tags;
public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter,
- final EntityLicensePresenter entityLicensePresenter) {
+ final EntityLicensePresenter entityLicensePresenter, final Tags tags) {
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
this.entitySubTitlePresenter = entitySubTitlePresenter;
this.entityLicensePresenter = entityLicensePresenter;
this.wsThemePresenter = wsThemePresenter;
+ this.tags = tags;
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
entityLogo.setTheme(oldTheme, newTheme);
+ tags.setTheme(oldTheme, newTheme);
}
});
}
@@ -42,11 +46,10 @@
entityTitlePresenter.setState(state);
entitySubTitlePresenter.setState(state);
entityLicensePresenter.setLicense(state);
+ tags.setState(state);
// Only for probes:
wsThemePresenter.setVisible(true);
wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme()));
}
- public void setTheme(final WsTheme theme) {
- }
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,30 +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.ui.newtmp.sitebar;
-
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-
-public class SiteBarPanel implements SiteBarView {
-
- public SiteBarPanel(final SiteBarPresenter presenter, final I18nUITranslationService i18n,
- final WorkspaceSkeleton ws) {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,30 +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.ui.newtmp.sitebar;
-
-public class SiteBarPresenter {
-
- private SiteBarView view;
-
- public void init(final SiteBarView view) {
- this.view = view;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -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.ui.newtmp.sitebar;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface SiteBarView extends View {
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,16 +1,21 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import com.calclab.suco.client.container.Provider;
+
public class SiteSearchPresenter implements SiteSearch {
private SiteSearchView view;
+ private final Provider<SiteSearcher> provider;
- public SiteSearchPresenter() {
+ public SiteSearchPresenter(final Provider<SiteSearcher> provider) {
+ this.provider = provider;
}
public void doSearch(final String termToSearch) {
- // TODO
+ provider.get().doSearch(termToSearch);
}
public View getView() {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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 java.util.List;
+
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface Tags {
+
+ void setGroupTags(List<TagResultDTO> result);
+
+ void setState(StateDTO state);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -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.workspace;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-
-public interface TagsComponent extends Component {
-
- void setState(StateDTO state);
-
- void setGroupTags(List<TagResultDTO> result);
-
-}
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-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -67,8 +67,6 @@
public ParticipationComponent getParticipationComponent();
- public TagsComponent getTagsComponent();
-
public ThemeMenuComponent getThemeMenuComponent();
public UserLiveSearchComponent getUserLiveSearchComponent();
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-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -124,10 +124,6 @@
return components.getParticipationComponent();
}
- public TagsComponent getTagsComponent() {
- return components.getTagsComponent();
- }
-
public ThemeMenuComponent getThemeMenuComponent() {
return components.getThemeMenuComponent();
}
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-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -33,7 +33,6 @@
private ContentSubTitleComponent contentSubTitle;
private ContentBottomToolBarComponent contentBottomToolBar;
private ThemeMenuComponent themeMenu;
- private TagsComponent tags;
private ContentToolBarComponent contentToolBar;
private GroupLiveSearchComponent groupLiveSearch;
private I18nTranslatorComponent i18nTranslatorSearch;
@@ -42,95 +41,88 @@
public WorkspaceUIComponents(final WorkspacePresenter presenter) {
}
- public LicenseComponent getLicenseComponent() {
- if (license == null) {
- license = WorkspaceFactory.createLicenseComponent();
- }
- return license;
+ public ContentBottomToolBarComponent getContentBottomToolBarComponent() {
+ if (contentBottomToolBar == null) {
+ contentBottomToolBar = WorkspaceFactory.createContentBottomToolBarComponent();
+ }
+ return contentBottomToolBar;
}
- public ContentTitleComponent getContentTitleComponent() {
- if (contentTitle == null) {
- contentTitle = WorkspaceFactory.createContentTitleComponent();
- }
- return contentTitle;
+ public ContentSubTitleComponent getContentSubTitleComponent() {
+ if (contentSubTitle == null) {
+ contentSubTitle = WorkspaceFactory.createContentSubTitleComponent();
+ }
+ return contentSubTitle;
}
- public ContentSubTitleComponent getContentSubTitleComponent() {
- if (contentSubTitle == null) {
- contentSubTitle = WorkspaceFactory.createContentSubTitleComponent();
- }
- return contentSubTitle;
+ public ContentTitleComponent getContentTitleComponent() {
+ if (contentTitle == null) {
+ contentTitle = WorkspaceFactory.createContentTitleComponent();
+ }
+ return contentTitle;
}
- public GroupMembersComponent getGroupMembersComponent() {
- if (groupMembers == null) {
- groupMembers = WorkspaceFactory.createGroupMembersComponent();
- }
- return groupMembers;
+ public ContentToolBarComponent getContentToolBarComponent() {
+ if (contentToolBar == null) {
+ contentToolBar = WorkspaceFactory.createContentToolBarComponent();
+ }
+ return contentToolBar;
}
- public GroupSummaryComponent getGroupSummaryComponent() {
- if (groupSummary == null) {
- groupSummary = WorkspaceFactory.createGroupSummaryComponent();
- }
- return groupSummary;
+ public GroupLiveSearchComponent getGroupLiveSearchComponent() {
+ if (groupLiveSearch == null) {
+ groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent();
+ }
+ return groupLiveSearch;
}
- public ParticipationComponent getParticipationComponent() {
- if (participatesInGroups == null) {
- participatesInGroups = WorkspaceFactory.createParticipationComponent();
- }
- return participatesInGroups;
+ public GroupMembersComponent getGroupMembersComponent() {
+ if (groupMembers == null) {
+ groupMembers = WorkspaceFactory.createGroupMembersComponent();
+ }
+ return groupMembers;
}
- public ThemeMenuComponent getThemeMenuComponent() {
- if (themeMenu == null) {
- themeMenu = WorkspaceFactory.createThemeMenuComponent();
- }
- return themeMenu;
+ public GroupSummaryComponent getGroupSummaryComponent() {
+ if (groupSummary == null) {
+ groupSummary = WorkspaceFactory.createGroupSummaryComponent();
+ }
+ return groupSummary;
}
- public TagsComponent getTagsComponent() {
- if (tags == null) {
- tags = WorkspaceFactory.createTagsComponent();
- }
- return tags;
+ public I18nTranslatorComponent getI18nTranslatorComponent() {
+ if (i18nTranslatorSearch == null) {
+ i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent();
+ }
+ return i18nTranslatorSearch;
}
- public ContentBottomToolBarComponent getContentBottomToolBarComponent() {
- if (contentBottomToolBar == null) {
- contentBottomToolBar = WorkspaceFactory.createContentBottomToolBarComponent();
- }
- return contentBottomToolBar;
+ public LicenseComponent getLicenseComponent() {
+ if (license == null) {
+ license = WorkspaceFactory.createLicenseComponent();
+ }
+ return license;
}
- public ContentToolBarComponent getContentToolBarComponent() {
- if (contentToolBar == null) {
- contentToolBar = WorkspaceFactory.createContentToolBarComponent();
- }
- return contentToolBar;
+ public ParticipationComponent getParticipationComponent() {
+ if (participatesInGroups == null) {
+ participatesInGroups = WorkspaceFactory.createParticipationComponent();
+ }
+ return participatesInGroups;
}
- public GroupLiveSearchComponent getGroupLiveSearchComponent() {
- if (groupLiveSearch == null) {
- groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent();
- }
- return groupLiveSearch;
+ public ThemeMenuComponent getThemeMenuComponent() {
+ if (themeMenu == null) {
+ themeMenu = WorkspaceFactory.createThemeMenuComponent();
+ }
+ return themeMenu;
}
public UserLiveSearchComponent getUserLiveSearchComponent() {
- if (userLiveSearch == null) {
- userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent();
- }
- return userLiveSearch;
+ if (userLiveSearch == null) {
+ userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent();
+ }
+ return userLiveSearch;
}
- public I18nTranslatorComponent getI18nTranslatorComponent() {
- if (i18nTranslatorSearch == null) {
- i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent();
- }
- return i18nTranslatorSearch;
- }
-
}
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-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -230,7 +230,6 @@
setBottom(components.getLicenseComponent().getView());
setGroupMembers(components.getGroupMembersComponent().getView());
setParticipation(components.getParticipationComponent().getView());
- setTags(components.getTagsComponent().getView());
setSummary(components.getGroupSummaryComponent().getView());
addBottomIconComponent(components.getThemeMenuComponent().getView());
}
@@ -354,7 +353,7 @@
private void AddDropDown(final DropDownPanel panel, final String color) {
groupDropDownsVP.add(panel);
panel.setWidth("145px");
- panel.setColor(color);
+ // panel.setColor(color);
}
private void adjustSizeContentSP() {
1
0
10 Jul '08
Author: vjrj
Date: 2008-07-10 23:06:19 +0200 (Thu, 10 Jul 2008)
New Revision: 797
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
Log:
Workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 21:06:19 UTC (rev 797)
@@ -2,10 +2,55 @@
background: #FFF none repeat scroll 0% 50%;
}
+.k-sitebar .kune-IconHyperlink {
+ white-space: nowrap;
+}
+
+.k-sitebar .kune-IconHyperlink a:link {
+ cursor: pointer;
+ text-decoration: underline;
+ color: #B3B3B3;
+}
+
+.k-sitebar .kune-IconHyperlink a:hover {
+ text-decoration: underline;
+}
+
+.k-sitebar .kune-IconHyperlink a:visited {
+ color: #B3B3B3;
+}
+
.k-sitebar {
- white-space: nowrap;
+ margin-right: 10px;
+ height: 16px;
}
+.k-sitebar .gwt-TextBox {
+ border: 1px solid #E4A374;
+ margin: 0 15px 0 3px;
+ padding-left: 3px;
+ color: #B3B3B3;
+}
+
+.k-sitebar .gwt-Hyperlink a {
+ white-space: nowrap;
+ color: #B3B3B3;
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+.k-sitebar .gwt-PushButton {
+ cursor: pointer;
+}
+
+.k-sitebar-LabelLink {
+ white-space: nowrap;
+ color: #B3B3B3;
+ margin-left: 3px;
+ cursor: pointer;
+ text-decoration: underline;
+}
+
.k-entity-summary {
border-left-color: #FFF;
border-left-width: 5px;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -26,6 +26,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearch;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -134,6 +137,16 @@
}
}, SingletonScope.class);
+ builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
+ public SiteSearch get() {
+ final SiteSearchPresenter presenter = new SiteSearchPresenter();
+ final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.getInstance(SiteSearch.class);
builder.getInstance(SiteLogo.class);
builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -1,5 +1,6 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.SiteBar;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Image;
@@ -10,7 +11,10 @@
public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
siteLogoImg = new Image();
- ws.getSiteBar().add(siteLogoImg);
+ final SiteBar siteBar = ws.getSiteBar();
+ siteBar.addSpacer();
+ siteBar.addSpacer();
+ siteBar.add(siteLogoImg);
}
public void setSiteLogoUrl(final String siteLogoUrl) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+public interface SiteSearch {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,95 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.SiteBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FocusListener;
+import com.google.gwt.user.client.ui.KeyboardListener;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+public class SiteSearchPanel implements SiteSearchView {
+ private static final String SEARCH_TEXT_WIDTH_SMALL = "120";
+ private static final String SEARCH_TEXT_WIDTH_BIG = "180";
+
+ private final PushButton searchButton;
+ private final TextBox searchTextBox;
+ private final I18nUITranslationService i18n;
+
+ public SiteSearchPanel(final SiteSearchPresenter presenter, final WorkspaceSkeleton ws,
+ final I18nUITranslationService i18n) {
+ this.i18n = i18n;
+ final Images img = Images.App.getInstance();
+ final SiteBar siteBar = ws.getSiteBar();
+ siteBar.addSpacer();
+ siteBar.addSpacer();
+ searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
+ searchTextBox = new TextBox();
+
+ siteBar.add(searchButton);
+ siteBar.addSpacer();
+ siteBar.add(searchTextBox);
+ siteBar.addSpacer();
+
+ setTextSearchSmall();
+ setDefaultTextSearch();
+ searchTextBox.addFocusListener(new FocusListener() {
+ public void onFocus(final Widget arg0) {
+ presenter.onSearchFocus();
+ }
+
+ public void onLostFocus(final Widget arg0) {
+ presenter.onSearchLostFocus(searchTextBox.getText());
+ }
+ });
+
+ searchButton.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ });
+
+ searchTextBox.addKeyboardListener(new KeyboardListener() {
+ public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
+ }
+
+ public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
+ }
+
+ public void onKeyUp(final Widget widget, final char key, final int mod) {
+ if (key == KEY_ENTER) {
+ if (searchTextBox.getText().length() > 0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ }
+ }
+ });
+ }
+
+ public void clearSearchText() {
+ searchTextBox.setText("");
+ }
+
+ public void setDefaultTextSearch() {
+ searchTextBox.setText(i18n.t("Search"));
+ }
+
+ public void setSearchText(final String text) {
+ searchTextBox.setText(text);
+ }
+
+ public void setTextSearchBig() {
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
+ }
+
+ public void setTextSearchSmall() {
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.View;
+
+public class SiteSearchPresenter implements SiteSearch {
+
+ private SiteSearchView view;
+
+ public SiteSearchPresenter() {
+ }
+
+ public void doSearch(final String termToSearch) {
+ // TODO
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteSearchView view) {
+ this.view = view;
+ }
+
+ public void onSearchFocus() {
+ view.setTextSearchBig();
+ view.clearSearchText();
+ }
+
+ public void onSearchLostFocus(final String search) {
+ if (search.length() == 0) {
+ view.setDefaultTextSearch();
+ view.setTextSearchSmall();
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteSearchView extends View {
+
+ void clearSearchText();
+
+ void setDefaultTextSearch();
+
+ void setTextSearchBig();
+
+ void setTextSearchSmall();
+}
1
0
Author: vjrj
Date: 2008-07-10 19:00:24 +0200 (Thu, 10 Jul 2008)
New Revision: 796
Added:
trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
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/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/main/resources/kune.properties
Log:
Workspace refactorization
Added: trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -39,8 +39,6 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.google.gwt.user.client.Window;
@@ -67,10 +65,8 @@
final I18nUITranslationService i18n = kune.getI18N();
// Temporary new ws
- final WsThemePresenter wstheme = kune.getInstance(WsThemePresenter.class);
final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- wstheme.setTheme(WsTheme.def);
ws.show();
ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,107 +24,117 @@
import com.google.gwt.user.client.rpc.IsSerializable;
public class InitDataDTO implements IsSerializable {
+ private UserInfoDTO userInfo;
private ArrayList<LicenseDTO> licenses;
private ArrayList<I18nLanguageSimpleDTO> languages;
private ArrayList<I18nCountryDTO> countries;
private String[] timezones;
- UserInfoDTO userInfo;
private String chatHttpBase;
private String siteDomain;
private String chatDomain;
private String chatRoomHost;
private String defaultWsTheme;
private String[] wsThemes;
+ private String siteLogoUrl;
- public ArrayList<LicenseDTO> getLicenses() {
- return licenses;
+ public String getChatDomain() {
+ return chatDomain;
}
- public void setLicenses(final ArrayList<LicenseDTO> licenses) {
- this.licenses = licenses;
+ public String getChatHttpBase() {
+ return chatHttpBase;
}
- public UserInfoDTO getUserInfo() {
- return userInfo;
+ public String getChatRoomHost() {
+ return chatRoomHost;
}
- public void setUserInfo(final UserInfoDTO currentUser) {
- this.userInfo = currentUser;
+ public ArrayList<I18nCountryDTO> getCountries() {
+ return countries;
}
- public String getChatHttpBase() {
- return chatHttpBase;
+ public String getDefaultWsTheme() {
+ return defaultWsTheme;
}
- public void setChatHttpBase(final String chatHttpBase) {
- this.chatHttpBase = chatHttpBase;
+ public ArrayList<I18nLanguageSimpleDTO> getLanguages() {
+ return languages;
}
- public String getChatDomain() {
- return chatDomain;
+ public ArrayList<LicenseDTO> getLicenses() {
+ return licenses;
}
- public void setChatDomain(final String chatDomain) {
- this.chatDomain = chatDomain;
+ public String getSiteDomain() {
+ return siteDomain;
}
- public String getChatRoomHost() {
- return chatRoomHost;
+ public String getSiteLogoUrl() {
+ return siteLogoUrl;
}
- public void setChatRoomHost(final String chatRoomHost) {
- this.chatRoomHost = chatRoomHost;
+ public String[] getTimezones() {
+ return timezones;
}
+ public UserInfoDTO getUserInfo() {
+ return userInfo;
+ }
+
+ public String[] getWsThemes() {
+ return wsThemes;
+ }
+
public boolean hasUser() {
- return getUserInfo() != null;
+ return getUserInfo() != null;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
+ public void setChatDomain(final String chatDomain) {
+ this.chatDomain = chatDomain;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public void setChatHttpBase(final String chatHttpBase) {
+ this.chatHttpBase = chatHttpBase;
}
- public String[] getWsThemes() {
- return wsThemes;
+ public void setChatRoomHost(final String chatRoomHost) {
+ this.chatRoomHost = chatRoomHost;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
+ public void setCountries(final ArrayList<I18nCountryDTO> countries) {
+ this.countries = countries;
}
- public ArrayList<I18nLanguageSimpleDTO> getLanguages() {
- return languages;
+ public void setDefaultWsTheme(final String defaultWsTheme) {
+ this.defaultWsTheme = defaultWsTheme;
}
public void setLanguages(final ArrayList<I18nLanguageSimpleDTO> languages) {
- this.languages = languages;
+ this.languages = languages;
}
- public ArrayList<I18nCountryDTO> getCountries() {
- return countries;
+ public void setLicenses(final ArrayList<LicenseDTO> licenses) {
+ this.licenses = licenses;
}
- public void setCountries(final ArrayList<I18nCountryDTO> countries) {
- this.countries = countries;
+ public void setSiteDomain(final String siteDomain) {
+ this.siteDomain = siteDomain;
}
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ this.siteLogoUrl = siteLogoUrl;
+ }
+
public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
+ this.timezones = timezones;
}
- public String[] getTimezones() {
- return timezones;
+ public void setUserInfo(final UserInfoDTO currentUser) {
+ this.userInfo = currentUser;
}
- public String getSiteDomain() {
- return siteDomain;
+ public void setWsThemes(final String[] wsThemes) {
+ this.wsThemes = wsThemes;
}
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -23,6 +23,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -122,6 +125,17 @@
final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
+ builder.registerProvider(SiteLogo.class, new Provider<SiteLogo>() {
+ public SiteLogo get() {
+ final SiteLogoPresenter presenter = new SiteLogoPresenter(builder.getInstance(Session.class));
+ final SiteLogoPanel panel = new SiteLogoPanel(presenter, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.getInstance(SiteLogo.class);
+
builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
public EntityLogo get() {
return new EntityLogoPanel(i18n, ws);
@@ -130,7 +144,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
- final WsThemePresenter presenter = new WsThemePresenter();
+ final WsThemePresenter presenter = new WsThemePresenter(builder.getInstance(Session.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter);
presenter.init(panel);
return presenter;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,9 +24,12 @@
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageSimpleDTO;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import com.calclab.suco.client.signal.Slot;
+
public interface Session {
/**
@@ -34,48 +37,36 @@
*/
public static int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
- public List<LicenseDTO> getLicenses();
+ public List<I18nCountryDTO> getCountries();
- public void setLicenses(final List<LicenseDTO> licenses);
+ public Object[][] getCountriesArray();
- public void setCurrent(final StateDTO currentState);
+ public I18nLanguageDTO getCurrentLanguage();
public StateDTO getCurrentState();
- public void setCurrentState(final StateDTO currentState);
-
- public void setDefaultWsTheme(final String defaultWsTheme);
-
- public void setWsThemes(final String[] wsThemes);
-
- public String[] getWsThemes();
-
- public String getDefaultWsTheme();
-
- public boolean isLogged();
-
public List<I18nLanguageSimpleDTO> getLanguages();
- public void setLanguages(final List<I18nLanguageSimpleDTO> languages);
-
- public List<I18nCountryDTO> getCountries();
-
- public void setCountries(final List<I18nCountryDTO> countries);
-
public Object[][] getLanguagesArray();
- public Object[][] getCountriesArray();
+ public List<LicenseDTO> getLicenses();
- public void setTimezones(final String[] timezones);
-
public Object[][] getTimezones();
+ public boolean isLogged();
+
+ public void setCurrent(final StateDTO currentState);
+
public void setCurrentLanguage(final I18nLanguageDTO currentLanguage);
- public I18nLanguageDTO getCurrentLanguage();
+ public void setCurrentState(final StateDTO currentState);
+ public void setInitData(InitDataDTO initData);
+
String getUserHash();
+ void onInitDataReceived(Slot<InitDataDTO> slot);
+
void setUserHash(String userHash);
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -26,9 +26,13 @@
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageSimpleDTO;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Slot;
+
/**
* RESPONSABILITIES: - Store the user's application state - Generates URLable's
* historyTokens
@@ -38,152 +42,123 @@
*/
public class SessionImpl implements Session {
private String userHash;
- private List<LicenseDTO> licenses;
- private List<I18nLanguageSimpleDTO> languages;
- private List<I18nCountryDTO> countries;
private Object[][] languagesArray;
private Object[][] countriesArray;
- private String[] timezones;
private Object[][] timezonesArray;
private StateDTO currentState;
- private String[] wsThemes;
- private String defaultWsTheme;
private I18nLanguageDTO currentLanguage;
+ private InitDataDTO initData;
+ private final Signal<InitDataDTO> onInitDataReceived;
public SessionImpl(final String userHash, final I18nLanguageDTO initialLanguage) {
- this.userHash = userHash;
- currentLanguage = initialLanguage;
- licenses = null;
- languages = null;
- languagesArray = null;
- countries = null;
+ this.userHash = userHash;
+ currentLanguage = initialLanguage;
+ languagesArray = null;
+ this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
}
public List<I18nCountryDTO> getCountries() {
- return countries;
+ return initData.getCountries();
}
public Object[][] getCountriesArray() {
- if (countriesArray == null) {
- countriesArray = mapCountries();
- }
- return countriesArray;
+ if (countriesArray == null) {
+ countriesArray = mapCountries();
+ }
+ return countriesArray;
}
public I18nLanguageDTO getCurrentLanguage() {
- return currentLanguage;
+ return currentLanguage;
}
public StateDTO getCurrentState() {
- return currentState;
+ return currentState;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
- }
-
public List<I18nLanguageSimpleDTO> getLanguages() {
- return languages;
+ return initData.getLanguages();
}
public Object[][] getLanguagesArray() {
- if (languagesArray == null) {
- languagesArray = mapLangs();
- }
- return languagesArray;
+ if (languagesArray == null) {
+ languagesArray = mapLangs();
+ }
+ return languagesArray;
}
public List<LicenseDTO> getLicenses() {
- return licenses;
+ return initData.getLicenses();
}
public Object[][] getTimezones() {
- if (timezonesArray == null) {
- mapTimezones();
- }
- return timezonesArray;
+ if (timezonesArray == null) {
+ mapTimezones();
+ }
+ return timezonesArray;
}
public String getUserHash() {
- return userHash;
+ return userHash;
}
- public String[] getWsThemes() {
- return wsThemes;
- }
-
public boolean isLogged() {
- return userHash != null;
+ return userHash != null;
}
- public void setCountries(final List<I18nCountryDTO> countries) {
- this.countries = countries;
+ public void onInitDataReceived(final Slot<InitDataDTO> slot) {
+ onInitDataReceived.add(slot);
}
public void setCurrent(final StateDTO currentState) {
- this.currentState = currentState;
+ this.currentState = currentState;
}
public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
- this.currentLanguage = currentLanguage;
+ this.currentLanguage = currentLanguage;
}
public void setCurrentState(final StateDTO currentState) {
- this.currentState = currentState;
+ this.currentState = currentState;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public void setInitData(final InitDataDTO initData) {
+ this.initData = initData;
+ onInitDataReceived.fire(initData);
}
- public void setLanguages(final List<I18nLanguageSimpleDTO> languages) {
- this.languages = languages;
- }
-
- public void setLicenses(final List<LicenseDTO> licenses) {
- this.licenses = licenses;
- }
-
- public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
- }
-
public void setUserHash(final String userHash) {
- this.userHash = userHash;
+ this.userHash = userHash;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
- }
-
private Object[][] mapCountries() {
- Object[][] objs = new Object[countries.size()][1];
- int i = 0;
- for (Iterator<I18nCountryDTO> iterator = countries.iterator(); iterator.hasNext();) {
- I18nCountryDTO country = iterator.next();
- Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
- objs[i++] = obj;
- }
- return objs;
+ final Object[][] objs = new Object[getCountries().size()][1];
+ int i = 0;
+ for (final Iterator<I18nCountryDTO> iterator = getCountries().iterator(); iterator.hasNext();) {
+ final I18nCountryDTO country = iterator.next();
+ final Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
+ objs[i++] = obj;
+ }
+ return objs;
}
private Object[][] mapLangs() {
- Object[][] objs = new Object[languages.size()][1];
- int i = 0;
- for (Iterator<I18nLanguageSimpleDTO> iterator = languages.iterator(); iterator.hasNext();) {
- I18nLanguageSimpleDTO language = iterator.next();
- Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
- objs[i++] = obj;
- }
- return objs;
+ final Object[][] objs = new Object[getLanguages().size()][1];
+ int i = 0;
+ for (final Iterator<I18nLanguageSimpleDTO> iterator = getLanguages().iterator(); iterator.hasNext();) {
+ final I18nLanguageSimpleDTO language = iterator.next();
+ final Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
+ objs[i++] = obj;
+ }
+ return objs;
}
private void mapTimezones() {
- timezonesArray = new Object[timezones.length][1];
- for (int i = 0; i < timezones.length; i++) {
- Object[] obj = new Object[] { timezones[i] };
- timezonesArray[i] = obj;
- }
+ timezonesArray = new Object[getTimezones().length][1];
+ for (int i = 0; i < getTimezones().length; i++) {
+ final Object[] obj = new Object[] { getTimezones()[i] };
+ timezonesArray[i] = obj;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -41,7 +41,6 @@
private final ContentProvider provider;
private final Workspace workspace;
private StateDTO oldState;
- private String lastTheme;
private final Session session;
private final HistoryWrapper history;
private final WorkspaceManager ws;
@@ -135,7 +134,6 @@
} else {
workspace.getThemeMenuComponent().setVisible(false);
}
- setWsTheme(group);
workspace.showGroup(group, isAdmin);
final String toolName = state.getToolName();
@@ -180,11 +178,4 @@
workspace.getParticipationComponent().setParticipation(state);
}
- private void setWsTheme(final GroupDTO group) {
- final String nextTheme = group.getWorkspaceTheme();
- if (lastTheme == null || !lastTheme.equals(nextTheme)) {
- workspace.setTheme(nextTheme);
- }
- lastTheme = nextTheme;
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -38,93 +38,102 @@
private String chatRoomHost;
private String defaultWsTheme;
private String[] wsThemes;
+ private String siteLogoUrl;
- public UserInfo getUserInfo() {
- return userInfo;
+ public String getChatDomain() {
+ return chatDomain;
}
- public void setUserInfo(final UserInfo currentUserInfo) {
- this.userInfo = currentUserInfo;
+ public String getChatHttpBase() {
+ return chatHttpBase;
}
- public List<License> getLicenses() {
- return licenses;
+ public String getChatRoomHost() {
+ return chatRoomHost;
}
- public void setLicenses(final List<License> licenses) {
- this.licenses = licenses;
+ public List<I18nCountry> getCountries() {
+ return countries;
}
- public void setChatHttpBase(final String chatHttpBase) {
- this.chatHttpBase = chatHttpBase;
+ public String getDefaultWsTheme() {
+ return defaultWsTheme;
}
- public String getChatHttpBase() {
- return chatHttpBase;
+ public List<I18nLanguage> getLanguages() {
+ return languages;
}
- public void setChatDomain(final String chatDomain) {
- this.chatDomain = chatDomain;
+ public List<License> getLicenses() {
+ return licenses;
}
- public String getChatDomain() {
- return chatDomain;
+ public String getSiteDomain() {
+ return siteDomain;
}
- public void setChatRoomHost(final String chatRoomHost) {
- this.chatRoomHost = chatRoomHost;
+ public String getSiteLogoUrl() {
+ return siteLogoUrl;
}
- public String getChatRoomHost() {
- return chatRoomHost;
+ public String[] getTimezones() {
+ return timezones;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
+ public UserInfo getUserInfo() {
+ return userInfo;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public String[] getWsThemes() {
+ return wsThemes;
}
- public String[] getWsThemes() {
- return wsThemes;
+ public void setChatDomain(final String chatDomain) {
+ this.chatDomain = chatDomain;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
+ public void setChatHttpBase(final String chatHttpBase) {
+ this.chatHttpBase = chatHttpBase;
}
- public List<I18nLanguage> getLanguages() {
- return languages;
+ public void setChatRoomHost(final String chatRoomHost) {
+ this.chatRoomHost = chatRoomHost;
}
+ public void setCountries(final List<I18nCountry> countries) {
+ this.countries = countries;
+ }
+
+ public void setDefaultWsTheme(final String defaultWsTheme) {
+ this.defaultWsTheme = defaultWsTheme;
+ }
+
public void setLanguages(final List<I18nLanguage> languages) {
- this.languages = languages;
+ this.languages = languages;
}
- public List<I18nCountry> getCountries() {
- return countries;
+ public void setLicenses(final List<License> licenses) {
+ this.licenses = licenses;
}
- public void setCountries(final List<I18nCountry> countries) {
- this.countries = countries;
+ public void setSiteDomain(final String siteDomain) {
+ this.siteDomain = siteDomain;
}
- public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ this.siteLogoUrl = siteLogoUrl;
}
- public String[] getTimezones() {
- return timezones;
+ public void setTimezones(final String[] timezones) {
+ this.timezones = timezones;
}
- public String getSiteDomain() {
- return siteDomain;
+ public void setUserInfo(final UserInfo currentUserInfo) {
+ this.userInfo = currentUserInfo;
}
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
+ public void setWsThemes(final String[] wsThemes) {
+ this.wsThemes = wsThemes;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -28,6 +28,7 @@
public String CHAT_ROOM_HOST = "kune.chat.roomHost";
public String WS_THEMES_DEF = "kune.wsthemes.default";
public String WS_THEMES = "kune.wsthemes";
+ public String SITE_LOGO_URL = "kune.sitelogourl";
public String get(String key);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -88,6 +88,7 @@
data.setChatRoomHost(chatProperties.getRoomHost());
data.setWsThemes(this.kuneProperties.get(KuneProperties.WS_THEMES).split(","));
data.setDefaultWsTheme(this.kuneProperties.get(KuneProperties.WS_THEMES_DEF));
+ data.setSiteLogoUrl(kuneProperties.get(KuneProperties.SITE_LOGO_URL));
return mapper.map(data, InitDataDTO.class);
}
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-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -36,7 +36,6 @@
import org.ourproject.kune.workspace.client.actions.DisableRateItAction;
import org.ourproject.kune.workspace.client.actions.EnableRateItAction;
import org.ourproject.kune.workspace.client.actions.InitAction;
-import org.ourproject.kune.workspace.client.actions.InitDataReceivedAction;
import org.ourproject.kune.workspace.client.actions.LoggedInAction;
import org.ourproject.kune.workspace.client.actions.LoggedOutAction;
import org.ourproject.kune.workspace.client.actions.OnlyCheckUserSessionAction;
@@ -74,56 +73,55 @@
private final I18nUITranslationService i18n;
public WorkspaceClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nUITranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- dispacher = DefaultDispatcher.getInstance();
- this.workspace = workspace;
+ final I18nUITranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ dispacher = DefaultDispatcher.getInstance();
+ this.workspace = workspace;
}
public void configure(final Register register) {
- register.addAction(WorkspaceEvents.START_APP, new InitAction(session, dispacher, workspace));
- register.addAction(WorkspaceEvents.STOP_APP, new StopAction(workspace));
- register.addAction(WorkspaceEvents.INIT_DATA_RECEIVED, new InitDataReceivedAction(session, workspace));
- register.addAction(WorkspaceEvents.USER_LOGGED_IN, new LoggedInAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.USER_LOGGED_OUT, new LoggedOutAction(session, stateManager));
- register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
- register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new DetachFromExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
- register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
- workspace, i18n));
- register
- .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
- register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
- i18n));
- register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
- register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
- 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.SHOW_SEARCHER, new ShowSearcherAction());
- register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
- register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
- register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
- register.addAction(WorkspaceEvents.USER_LOGOUT, new UserLogoutAction(session));
- register.addAction(WorkspaceEvents.USER_REGISTER, new UserRegisterAction());
- register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
- register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
- register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
+ register.addAction(WorkspaceEvents.START_APP, new InitAction(session, dispacher, workspace));
+ register.addAction(WorkspaceEvents.STOP_APP, new StopAction(workspace));
+ register.addAction(WorkspaceEvents.USER_LOGGED_IN, new LoggedInAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.USER_LOGGED_OUT, new LoggedOutAction(session, stateManager));
+ register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
+ register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
+ register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
+ new DetachFromExtensibleWidgetAction(workspace));
+ register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
+ register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
+ workspace, i18n));
+ register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
+ workspace, i18n));
+ register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
+ workspace, i18n));
+ register
+ .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
+ register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
+ i18n));
+ register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
+ register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
+ 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.SHOW_SEARCHER, new ShowSearcherAction());
+ register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
+ register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
+ register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
+ register.addAction(WorkspaceEvents.USER_LOGOUT, new UserLogoutAction(session));
+ register.addAction(WorkspaceEvents.USER_REGISTER, new UserRegisterAction());
+ register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
+ register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
+ register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -44,59 +44,55 @@
private final Workspace workspace;
public InitAction(final Session session, final Dispatcher dispatcher, final Workspace workspace) {
- this.session = session;
- this.dispatcher = dispatcher;
- this.workspace = workspace;
+ this.session = session;
+ this.dispatcher = dispatcher;
+ this.workspace = workspace;
}
public void execute(final Object value) {
- PrefetchUtilities.preFetchImpImages();
- getInitData();
- dispatcher.fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
- Timer prefetchTimer = new Timer() {
- public void run() {
- PrefetchUtilities.doTasksDeferred(workspace);
- }
- };
- prefetchTimer.schedule(20000);
+ PrefetchUtilities.preFetchImpImages();
+ getInitData();
+ dispatcher.fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
+ final Timer prefetchTimer = new Timer() {
+ public void run() {
+ PrefetchUtilities.doTasksDeferred(workspace);
+ }
+ };
+ prefetchTimer.schedule(20000);
}
private void getInitData() {
- SiteServiceAsync server = SiteService.App.getInstance();
- server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
- public void onFailure(final Throwable error) {
- Site.error("Error fetching initial data");
- Log.debug(error.getMessage());
- }
+ final SiteServiceAsync server = SiteService.App.getInstance();
+ server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
+ public void onFailure(final Throwable error) {
+ Site.error("Error fetching initial data");
+ Log.debug(error.getMessage());
+ }
- public void onSuccess(final InitDataDTO initData) {
- checkChatDomain(initData.getChatDomain());
- session.setLicenses(initData.getLicenses());
- session.setWsThemes(initData.getWsThemes());
- session.setDefaultWsTheme(initData.getDefaultWsTheme());
- session.setLanguages(initData.getLanguages());
- session.setCountries(initData.getCountries());
- session.setTimezones(initData.getTimezones());
- UserInfoDTO currentUser = initData.getUserInfo();
- dispatcher.fire(WorkspaceEvents.INIT_DATA_RECEIVED, initData);
- if (currentUser == null) {
- dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
- } else {
- dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
- }
- RootPanel.get("kuneinitialcurtain").setVisible(false);
+ public void onSuccess(final InitDataDTO initData) {
+ checkChatDomain(initData.getChatDomain());
+ session.setInitData(initData);
+ final UserInfoDTO currentUser = initData.getUserInfo();
+ // use signals:
+ dispatcher.fire(WorkspaceEvents.INIT_DATA_RECEIVED, initData);
+ if (currentUser == null) {
+ dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
+ } else {
+ dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
+ }
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
- Site.unMask();
- }
+ Site.unMask();
+ }
- private void checkChatDomain(final String chatDomain) {
- String httpDomain = WindowUtils.getLocation().getHostName();
- if (!chatDomain.equals(httpDomain)) {
- Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
- + "). This will produce problems with the chat functionality. "
- + "Check kune.properties on the server.");
- }
- }
- });
+ private void checkChatDomain(final String chatDomain) {
+ final String httpDomain = WindowUtils.getLocation().getHostName();
+ if (!chatDomain.equals(httpDomain)) {
+ Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
+ + "). This will produce problems with the chat functionality. "
+ + "Check kune.properties on the server.");
+ }
+ }
+ });
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,45 +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.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class InitDataReceivedAction implements Action<Object> {
-
- private final Workspace workspace;
- private final Session session;
-
- public InitDataReceivedAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
- }
-
- public void execute(final Object value) {
- onInitDataReceived();
- }
-
- private void onInitDataReceived() {
- workspace.setTheme(session.getDefaultWsTheme());
- workspace.getThemeMenuComponent().setThemes(session.getWsThemes());
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -44,6 +44,7 @@
entityLicensePresenter.setLicense(state);
// Only for probes:
wsThemePresenter.setVisible(true);
+ wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme()));
}
public void setTheme(final WsTheme theme) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+public interface SiteLogo {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Image;
+
+public class SiteLogoPanel implements SiteLogoView {
+
+ private final Image siteLogoImg;
+
+ public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
+ siteLogoImg = new Image();
+ ws.getSiteBar().add(siteLogoImg);
+ }
+
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ siteLogoImg.setUrl(siteLogoUrl);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,29 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class SiteLogoPresenter implements SiteLogo {
+
+ private SiteLogoView view;
+
+ public SiteLogoPresenter(final Session session) {
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setSiteLogoUrl(initData.getSiteLogoUrl());
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteLogoView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteLogoView extends View {
+ void setSiteLogoUrl(String siteLogoUrl);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,6 +24,7 @@
trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
+ trayBar.addFill();
}
public void addInSummary(final Widget widget) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,5 +1,48 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
-public enum WsTheme {
- def, green, blue, grey, purple, red
+public class WsTheme {
+ private final String name;
+
+ public WsTheme(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final WsTheme other = (WsTheme) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (name == null ? 0 : name.hashCode());
+ return result;
+ }
+
+ public String toString() {
+ return name;
+ }
+
}
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-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -13,10 +13,26 @@
public class WsThemePanel extends ToolbarButton implements WsThemeView {
private final Menu menu;
+ private final WsThemePresenter presenter;
public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
+ this.presenter = presenter;
menu = new Menu();
- for (final WsTheme theme : WsTheme.values()) {
+
+ menu.setDefaultAlign("br-tr");
+ super.setMenu(menu);
+ super.setIcon("images/colors.gif");
+ ws.getSiteTraybar().addButton(this);
+ presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ ws.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setThemes(final String[] themes) {
+ for (int i = 0; i < themes.length; i++) {
+ final WsTheme theme = new WsTheme(themes[i]);
final MenuItem item = new MenuItem();
item.setText(theme.toString());
menu.addItem(item);
@@ -27,14 +43,6 @@
}
});
}
- menu.setDefaultAlign("br-tr");
- super.setMenu(menu);
- ws.getSiteTraybar().addButton(this);
- presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- ws.setTheme(oldTheme, newTheme);
- }
- });
}
public void setVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,6 +1,10 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
import com.calclab.suco.client.signal.Signal2;
+import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
public class WsThemePresenter {
@@ -9,8 +13,13 @@
private WsTheme previousTheme;
private final Signal2<WsTheme, WsTheme> onThemeChanged;
- public WsThemePresenter() {
+ public WsThemePresenter(final Session session) {
this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setThemes(initData.getWsThemes());
+ }
+ });
}
public void init(final WsThemeView view) {
@@ -22,7 +31,9 @@
}
public void setTheme(final WsTheme newTheme) {
- onThemeChanged.fire(previousTheme, newTheme);
+ if (previousTheme == null || !previousTheme.equals(newTheme)) {
+ onThemeChanged.fire(previousTheme, newTheme);
+ }
previousTheme = newTheme;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -2,6 +2,8 @@
public interface WsThemeView {
+ void setThemes(String[] themes);
+
void setVisible(boolean visible);
}
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-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -36,7 +36,6 @@
import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.Composite;
@@ -309,27 +308,38 @@
}
public void setTheme(final String theme) {
- colorTheme.setTheme(theme);
- final String mainColor = colorTheme.getContentMainBorder();
- // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
- contentTitleBarBorderDec.setColor(mainColor);
- bottomBorderDecorator.setColor(mainColor);
- DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
- contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
- contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
- DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
- DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
- .getSplitter());
- DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
- groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
- participationPanel.setColor(colorTheme.getParticipationDD());
- groupSummaryPanel.setColor(colorTheme.getSummaryDD());
- tagsPanel.setColor(colorTheme.getTagsDD());
- groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
+ // colorTheme.setTheme(theme);
+ // final String mainColor = colorTheme.getContentMainBorder();
+ // // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
+ // contentTitleBarBorderDec.setColor(mainColor);
+ // bottomBorderDecorator.setColor(mainColor);
+ // DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor",
+ // mainColor);
+ // contentTitlePanel.setColors(colorTheme.getContentTitle(),
+ // colorTheme.getContentTitleText());
+ // contentSubTitlePanel.setColors(mainColor,
+ // colorTheme.getContentSubTitleText());
+ // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
+ // "borderLeftColor", mainColor);
+ // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
+ // "backgroundColor", colorTheme.getContentTitle());
+ // DOM.setStyleAttribute(contentSubTitleBarHP.getElement(),
+ // "backgroundColor", mainColor);
+ // DOM.setStyleAttribute(contentBottomBarHP.getElement(),
+ // "backgroundColor", mainColor);
+ // DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(),
+ // "backgroundColor", colorTheme.getContext());
+ // DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(),
+ // 0), 1), "backgroundColor", colorTheme
+ // .getSplitter());
+ // DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(),
+ // "color", colorTheme.getContentBottomText());
+ // groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
+ // participationPanel.setColor(colorTheme.getParticipationDD());
+ // groupSummaryPanel.setColor(colorTheme.getSummaryDD());
+ // tagsPanel.setColor(colorTheme.getTagsDD());
+ // groupToolsBar.setTabsColors(colorTheme.getToolSelected(),
+ // colorTheme.getToolUnselected());
}
public void setTool(final String toolName) {
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/resources/kune.properties 2008-07-10 17:00:24 UTC (rev 796)
@@ -17,6 +17,8 @@
kune.chat.domain = localhost
kune.chat.roomHost = rooms.localhost
-# Workspace themes (see colorthemes.js)
-kune.wsthemes = defaultKuneTheme,greenKuneTheme,blueKuneTheme,greyKuneTheme,purpleKuneTheme,redKuneTheme
-kune.wsthemes.default = defaultKuneTheme
+# Workspace enabled themes
+kune.wsthemes = def,green,blue,grey,purple,red
+kune.wsthemes.default = def
+
+kune.sitelogourl = images/kune-logo-16px.png
\ No newline at end of file
1
0
10 Jul '08
Author: vjrj
Date: 2008-07-10 04:28:27 +0200 (Thu, 10 Jul 2008)
New Revision: 795
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
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/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
Log:
Better theme support
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 02:28:27 UTC (rev 795)
@@ -14,7 +14,7 @@
.k-EntityTextLogo {
border: 2px solid #F2F2F2;
height: 60px;
- margin-bottom: 4px;
+ margin: 0 0 4px -1px;
overflow: hidden;
width: 468px;
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -47,39 +47,39 @@
private static I18nTranslationService i18n;
public static ChatContent createChatContent(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n) {
- ChatFactory.i18n = i18n;
- WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
- return presenter;
+ ChatFactory.i18n = i18n;
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
+ return presenter;
}
public static ChatContext createChatContext() {
- WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- ChatContextPresenter presenter = new ChatContextPresenter(panel);
- return presenter;
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContextPresenter presenter = new ChatContextPresenter(panel);
+ return presenter;
}
public static ChatInfo createChatInfo(final ChatRoomListener listener) {
- ChatInfoPanel panel = new ChatInfoPanel(listener);
- return panel;
+ final ChatInfoPanel panel = new ChatInfoPanel(listener);
+ return panel;
}
public static ChatRoomControl createChatRoomControlViewer(final ChatRoomListener listener) {
- ChatRoomControlPanel panel = new ChatRoomControlPanel(listener, i18n);
- ChatRoomControlPresenter presenter = new ChatRoomControlPresenter(panel);
- return presenter;
+ final ChatRoomControlPanel panel = new ChatRoomControlPanel(listener, i18n);
+ final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter(panel);
+ return presenter;
}
public static ChatRoom createChatRoomViewer(final ChatRoomListener listener) {
- ChatRoomPanel panel = new ChatRoomPanel();
- ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
- return presenter;
+ final ChatRoomPanel panel = new ChatRoomPanel();
+ final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
+ return presenter;
}
public static RoomsAdmin createRoomsAdmin() {
- ContextItems contextItems = WorkspaceFactory.createContextItems();
- RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n);
- return presenter;
+ final ContextItems contextItems = WorkspaceFactory.createContextItems();
+ final RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n);
+ return presenter;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -38,9 +38,9 @@
import org.ourproject.kune.workspace.client.WorkspaceClientModule;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.google.gwt.user.client.Window;
@@ -67,26 +67,12 @@
final I18nUITranslationService i18n = kune.getI18N();
// Temporary new ws
- final WorkspaceManager wmanager = kune.getInstance(WorkspaceManager.class);
+ final WsThemePresenter wstheme = kune.getInstance(WsThemePresenter.class);
final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- // final com.gwtext.client.widgets.Window dialog = new
- // com.gwtext.client.widgets.Window("gwt-ext new ws 3", 640,
- // 480);
- // final Panel panel = new Panel();
- // panel.setPaddings(5);
- // panel.setLayout(new FitLayout());
- // panel.add(((WorkspaceSkeleton) wsmanager.getView()).getPanel());
- // new Viewport(panel);
- // wsnew.getPanel().setWidth(640);
- // wsnew.getPanel().setHeight(460);
- // panel.setWidth(640);
- // panel.setHeight(460);
- // dialog.add(panel);
- // dialog.show();
- ws.setTheme(WsTheme.def);
+
+ wstheme.setTheme(WsTheme.def);
ws.show();
ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
- wmanager.setTheme(WsTheme.def);
// Testing providers:
platform.install(new PlatformClientModule(session, kune.getProvider(StateManager.class)));
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-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -131,7 +131,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
final WsThemePresenter presenter = new WsThemePresenter();
- final WsThemePanel panel = new WsThemePanel(ws);
+ final WsThemePanel panel = new WsThemePanel(ws, presenter);
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -9,6 +9,8 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
+import com.calclab.suco.client.signal.Slot2;
+
public class WorkspaceManager {
private final EntityLogo entityLogo;
@@ -23,8 +25,13 @@
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
this.entitySubTitlePresenter = entitySubTitlePresenter;
+ this.entityLicensePresenter = entityLicensePresenter;
this.wsThemePresenter = wsThemePresenter;
- this.entityLicensePresenter = entityLicensePresenter;
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ entityLogo.setTheme(oldTheme, newTheme);
+ }
+ });
}
public void setState(final StateDTO state) {
@@ -40,6 +47,5 @@
}
public void setTheme(final WsTheme theme) {
- entityLogo.setTheme(theme);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -33,8 +33,11 @@
return entityWorkspace;
}
- public void setTheme(final WsTheme theme) {
- super.setCls("k-entity-" + theme);
- entityWorkspace.setTheme(theme);
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ super.removeStyle("k-entity-" + oldTheme);
+ }
+ super.addStyle("k-entity-" + newTheme);
+ entityWorkspace.setTheme(oldTheme, newTheme);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -23,7 +23,6 @@
private final RoundedPanel roundedTitle;
private final RoundedPanel roundedBottom;
private final DefaultBorderLayout containerWrap;
- private WsTheme previousTheme;
public EntityWorkspace() {
final Panel titles = new Panel();
@@ -120,23 +119,22 @@
setPanel(content, (Widget) view);
}
- public void setTheme(final WsTheme theme) {
- final String themeS = theme.toString();
- if (previousTheme != null) {
- final String previousThemeS = previousTheme.toString();
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ final String themeS = newTheme.toString();
+ if (oldTheme != null) {
+ final String previousThemeS = oldTheme.toString();
title.removeStyleDependentName(previousThemeS);
subTitle.removeStyleDependentName(previousThemeS);
bottom.removeStyleDependentName(previousThemeS);
super.removeStyle("k-entityworkspace-" + previousThemeS);
container.removeStyleName("k-entity-container-" + previousThemeS);
}
- super.addStyle("k-entityworkspace-" + theme);
- roundedTitle.setCornerStyleName("k-entity-title-rd-" + theme);
- roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + theme);
+ super.addStyle("k-entityworkspace-" + newTheme);
+ roundedTitle.setCornerStyleName("k-entity-title-rd-" + newTheme);
+ roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + newTheme);
title.addStyleDependentName(themeS);
subTitle.addStyleDependentName(themeS);
bottom.addStyleDependentName(themeS);
- container.addStyleName("k-entity-container-" + theme);
- previousTheme = theme;
+ container.addStyleName("k-entity-container-" + newTheme);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -47,8 +47,8 @@
return entity.getEntitySummary().getSiteTraybar();
}
- public void setTheme(final WsTheme theme) {
- entity.setTheme(theme);
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ entity.setTheme(oldTheme, newTheme);
}
public void show() {
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-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -2,6 +2,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.calclab.suco.client.signal.Slot2;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.menu.BaseItem;
@@ -13,7 +14,7 @@
private final Menu menu;
- public WsThemePanel(final WorkspaceSkeleton ws) {
+ public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
menu = new Menu();
for (final WsTheme theme : WsTheme.values()) {
final MenuItem item = new MenuItem();
@@ -22,13 +23,18 @@
item.addListener(new BaseItemListenerAdapter() {
@Override
public void onClick(final BaseItem item, final EventObject e) {
- ws.setTheme(theme);
+ presenter.setTheme(theme);
}
});
}
menu.setDefaultAlign("br-tr");
super.setMenu(menu);
ws.getSiteTraybar().addButton(this);
+ presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ ws.setTheme(oldTheme, newTheme);
+ }
+ });
}
public void setVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -1,14 +1,33 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import com.calclab.suco.client.signal.Signal2;
+import com.calclab.suco.client.signal.Slot2;
+
public class WsThemePresenter {
private WsThemeView view;
+ private WsTheme previousTheme;
+ private final Signal2<WsTheme, WsTheme> onThemeChanged;
+ public WsThemePresenter() {
+ this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
+ }
+
public void init(final WsThemeView view) {
this.view = view;
}
+ public void onThemeChanged(final Slot2<WsTheme, WsTheme> slot) {
+ onThemeChanged.add(slot);
+ }
+
+ public void setTheme(final WsTheme newTheme) {
+ onThemeChanged.fire(previousTheme, newTheme);
+ previousTheme = newTheme;
+ }
+
public void setVisible(final boolean visible) {
view.setVisible(visible);
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -12,6 +12,6 @@
public abstract void setPutYourLogoVisible(final boolean visible);
- public abstract void setTheme(final WsTheme theme);
+ public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -106,8 +106,11 @@
getEntityTextLogo().setPutYourLogoVisible(visible);
}
- public void setTheme(final WsTheme theme) {
- getEntityTextLogo().addStyleDependentName(theme.toString());
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
+ }
+ getEntityTextLogo().addStyleDependentName(newTheme.toString());
}
private EntityTextLogo getEntityTextLogo() {
1
0
Author: vjrj
Date: 2008-07-10 01:43:14 +0200 (Thu, 10 Jul 2008)
New Revision: 794
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
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/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
Log:
gwt-ext workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-09 23:43:14 UTC (rev 794)
@@ -64,20 +64,20 @@
}
.k-entity-title {
- line-height: 22px;
border-left-style: solid;
border-left-width: 2px;
}
.k-entity-title div {
- white-space: nowrap;
+ line-height: 22px;
+ white-space: nowrap;
}
.k-entity-subtitle {
- line-height: 2em;
}
.k-entity-subtitle div {
+ line-height: 22px;
white-space: nowrap;
}
@@ -91,23 +91,35 @@
.k-entity-title-def {
background: #F1BB59 none repeat scroll 0% 50%;
- color: #69312F;
border-left-color: #DD8A3D;
}
+.k-entity-title-def div {
+ color: #69312F;
+}
+
.k-entity-title-green {
background: #AFA none repeat scroll 0% 50%;
- color: #250;
border-left-color: #5FD35F;
}
+.k-entity-title-green div {
+ color: #250;
+}
+
.k-entity-subtitle-def {
background: #DD8A3D none repeat scroll 0% 50%;
+}
+
+.k-entity-subtitle-def div {
color: #FFF;
}
.k-entity-subtitle-green {
background: #5FD35F none repeat scroll 0% 50%;
+}
+
+.k-entity-subtitle-green div {
color: #FFF;
}
@@ -119,6 +131,12 @@
background: #5FD35F;
}
+.k-entitylicensepanel-licensetext {
+ cursor: pointer;
+ margin-left: 5px;
+ text-decoration: underline;
+}
+
.k-entity-container-def div {
background: #FFD09D none repeat scroll 0% 50%;
}
@@ -127,17 +145,23 @@
background: #CFA none repeat scroll 0% 50%;
}
-.k-entity-bottom {
+.k-entity-bottom div {
line-height: 2em;
}
.k-entity-bottom-def {
background: #DD8A3D;
+}
+
+.k-entity-bottom-def div {
color: #FFF;
}
.k-entity-bottom-green {
background: #5FD35F;
+}
+
+.k-entity-bottom-green div {
color: #FFF;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-09 23:43:14 UTC (rev 794)
@@ -165,45 +165,7 @@
}
/* Content titles */
-.kune-ContentTitleBar {
- border-left: 2px solid #DD8A3D;
- width: 100%;
- height: 25px;
- vertical-align: middle;
-}
-.kune-ContentTitleBar .gwt-Label {
- width: 100%;
-}
-
-.kune-ContentTitleBar-l {
- float: left;
-}
-
-.kune-ContentTitleBar-r {
- float: right;
-}
-
-.kune-ContentSubTitleBar {
- vertical-align: middle;
- font-weight: 700;
- width: 100%;
- height: 23px;
-}
-
-.kune-ContentSubTitleBar .gwt-Label {
- width: 100%;
- white-space: nowrap;
-}
-
-.kune-ContentSubTitleBar-l {
- float: left;
-}
-
-.kune-ContentSubTitleBar-r {
- float: right;
-}
-
.kune-ContentToolBarPanel {
background-color: #F2F2F2;
padding: 2px;
@@ -226,12 +188,6 @@
}
-.kune-LicensePanel-licensetext {
- cursor: pointer;
- margin-left: 5px;
- text-decoration: underline;
-}
-
/* Main Content & Context */
.kune-WorkspacePanel-Content {
background-color: #FCFCFC;
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-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -19,9 +19,15 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePanel;
+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.ui.EntityLogo;
@@ -141,10 +147,38 @@
}
}, SingletonScope.class);
+ builder.registerProvider(EntitySubTitlePresenter.class, new Provider<EntitySubTitlePresenter>() {
+ public EntitySubTitlePresenter get() {
+ final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(i18n);
+ final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(EntityLicensePresenter.class, new Provider<EntityLicensePresenter>() {
+ public EntityLicensePresenter get() {
+ final EntityLicensePresenter presenter = new EntityLicensePresenter();
+ final EntityLicensePanel panel = new EntityLicensePanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(SiteBarPresenter.class, new Provider<SiteBarPresenter>() {
+ public SiteBarPresenter get() {
+ final SiteBarPresenter presenter = new SiteBarPresenter();
+ final SiteBarPanel panel = new SiteBarPanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
public WorkspaceManager get() {
final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
- .getInstance(EntityTitlePresenter.class), builder.getInstance(WsThemePresenter.class));
+ .getInstance(EntityTitlePresenter.class), builder.getInstance(EntitySubTitlePresenter.class),
+ builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class));
return presenter;
}
}, SingletonScope.class);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -72,6 +72,10 @@
doLayoutIfNeeded();
}
+ public void addStyle(final String style) {
+ mainPanel.addClass(style);
+ }
+
public Toolbar createBottomBar(final Panel panel) {
return createBottomBar(panel, null);
}
@@ -110,10 +114,15 @@
return mainPanel;
}
+ public void removeStyle(final String style) {
+ mainPanel.removeClass(style);
+ }
+
public void setBorder(final boolean border) {
mainPanel.setBorder(border);
}
+ @Deprecated
public void setCls(final String style) {
mainPanel.setCls(style);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -2,8 +2,10 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
@@ -12,12 +14,17 @@
private final EntityLogo entityLogo;
private final EntityTitlePresenter entityTitlePresenter;
private final WsThemePresenter wsThemePresenter;
+ private final EntityLicensePresenter entityLicensePresenter;
+ private final EntitySubTitlePresenter entitySubTitlePresenter;
public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
- final WsThemePresenter wsThemePresenter) {
+ final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter,
+ final EntityLicensePresenter entityLicensePresenter) {
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
+ this.entitySubTitlePresenter = entitySubTitlePresenter;
this.wsThemePresenter = wsThemePresenter;
+ this.entityLicensePresenter = entityLicensePresenter;
}
public void setState(final StateDTO state) {
@@ -26,12 +33,13 @@
entityLogo.setLogo(group.getLongName());
entityLogo.setPutYourLogoVisible(isAdmin);
entityTitlePresenter.setState(state);
+ entitySubTitlePresenter.setState(state);
+ entityLicensePresenter.setLicense(state);
// Only for probes:
wsThemePresenter.setVisible(true);
}
public void setTheme(final WsTheme theme) {
entityLogo.setTheme(theme);
- entityTitlePresenter.setTheme(theme);
}
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,79 @@
+/*
+ *
+ * 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.ui.newtmp.licensefoot;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class EntityLicensePanel implements EntityLicenseView {
+ private final Label copyright;
+ private final Image image;
+ private final Label license;
+ private final I18nTranslationService i18n;
+
+ public EntityLicensePanel(final EntityLicensePresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ copyright = new Label();
+ image = new Image();
+ license = new Label();
+ final TitleBar bottomTitle = ws.getEntityWorkspace().getBottomTitle();
+ bottomTitle.add(copyright);
+ bottomTitle.add(license);
+ bottomTitle.addSpacer();
+ bottomTitle.addSpacer();
+ bottomTitle.add(image);
+ final ClickListener clickListener = new ClickListener() {
+ public void onClick(Widget arg0) {
+ presenter.onLicenseClick();
+ }
+ };
+
+ license.addClickListener(clickListener);
+ image.addClickListener(clickListener);
+ copyright.setVisible(false);
+ license.setVisible(false);
+ image.setVisible(false);
+
+ copyright.addStyleName("kune-Margin-Large-l");
+ license.setStyleName("k-entitylicensepanel-licensetext");
+ }
+
+ public void openWindow(final String url) {
+ Window.open(url, "_blank", "");
+ }
+
+ public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
+ copyright.setText(i18n.t("© [%s], under license: ", groupName));
+ license.setText(licenseDTO.getLongName());
+ copyright.setVisible(true);
+ license.setVisible(true);
+ image.setVisible(true);
+ image.setUrl(licenseDTO.getImageUrl());
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,50 @@
+/*
+ *
+ * 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.ui.newtmp.licensefoot;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+
+public class EntityLicensePresenter {
+
+ private EntityLicenseView view;
+ private LicenseDTO license;
+
+ public EntityLicensePresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityLicenseView view) {
+ this.view = view;
+ }
+
+ public void onLicenseClick() {
+ view.openWindow(license.getUrl());
+ }
+
+ public void setLicense(final StateDTO state) {
+ this.license = state.getLicense();
+ view.showLicense(state.getGroup().getLongName(), license);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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.ui.newtmp.licensefoot;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+
+public interface EntityLicenseView extends View {
+
+ void showLicense(String groupName, LicenseDTO licenseDTO);
+
+ void openWindow(String url);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.ui.newtmp.sitebar;
+
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+public class SiteBarPanel implements SiteBarView {
+
+ public SiteBarPanel(final SiteBarPresenter presenter, final I18nUITranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.ui.newtmp.sitebar;
+
+public class SiteBarPresenter {
+
+ private SiteBarView view;
+
+ public void init(final SiteBarView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -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.ui.newtmp.sitebar;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteBarView extends View {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -3,38 +3,43 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
public class AbstractBar extends Composite {
- private final HorizontalPanel horPanel;
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
public AbstractBar() {
- horPanel = new HorizontalPanel();
- horPanel.setWidth("100%");
- initWidget(horPanel);
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
}
public void add(final Widget widget) {
- horPanel.add(widget);
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
}
public void addFill() {
final Label emptyLabel = new Label("");
- horPanel.add(emptyLabel);
- horPanel.setCellWidth(emptyLabel, "100%");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
}
public void addSeparator() {
final Label emptyLabel = new Label("");
emptyLabel.setStyleName("ytb-sep");
emptyLabel.addStyleName("k-toolbar-sep");
- horPanel.add(emptyLabel);
+ this.add(emptyLabel);
}
public void addSpacer() {
final Label emptyLabel = new Label("");
emptyLabel.setStyleName("ytb-spacer");
- horPanel.add(emptyLabel);
+ this.add(emptyLabel);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -23,6 +23,7 @@
private final RoundedPanel roundedTitle;
private final RoundedPanel roundedBottom;
private final DefaultBorderLayout containerWrap;
+ private WsTheme previousTheme;
public EntityWorkspace() {
final Panel titles = new Panel();
@@ -121,12 +122,21 @@
public void setTheme(final WsTheme theme) {
final String themeS = theme.toString();
- super.setCls("k-entityworkspace-" + theme);
+ if (previousTheme != null) {
+ final String previousThemeS = previousTheme.toString();
+ title.removeStyleDependentName(previousThemeS);
+ subTitle.removeStyleDependentName(previousThemeS);
+ bottom.removeStyleDependentName(previousThemeS);
+ super.removeStyle("k-entityworkspace-" + previousThemeS);
+ container.removeStyleName("k-entity-container-" + previousThemeS);
+ }
+ super.addStyle("k-entityworkspace-" + theme);
roundedTitle.setCornerStyleName("k-entity-title-rd-" + theme);
roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + theme);
title.addStyleDependentName(themeS);
subTitle.addStyleDependentName(themeS);
bottom.addStyleDependentName(themeS);
- container.setStyleName("k-entity-container-" + theme);
+ container.addStyleName("k-entity-container-" + theme);
+ previousTheme = theme;
}
}
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-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -2,6 +2,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.menu.BaseItem;
import com.gwtext.client.widgets.menu.Menu;
@@ -19,7 +20,8 @@
item.setText(theme.toString());
menu.addItem(item);
item.addListener(new BaseItemListenerAdapter() {
- public void onActivate(final BaseItem item) {
+ @Override
+ public void onClick(final BaseItem item, final EventObject e) {
ws.setTheme(theme);
}
});
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,68 @@
+/*
+ *
+ * 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class EntitySubTitlePanel implements EntitySubTitleView {
+ private final Label subTitleLeftLabel;
+ private final Label subTitleRightLabel;
+
+ public EntitySubTitlePanel(final EntitySubTitlePresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ subTitleLeftLabel = new Label();
+ subTitleRightLabel = new Label();
+
+ final TitleBar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
+ wsSubTitle.add(subTitleLeftLabel);
+ wsSubTitle.addFill();
+ wsSubTitle.add(subTitleRightLabel);
+
+ subTitleRightLabel.setText(i18n.t("Language:"));
+
+ subTitleLeftLabel.addStyleName("kune-Margin-Large-l");
+ subTitleLeftLabel.addStyleName("kune-ft15px");
+ subTitleRightLabel.addStyleName("kune-Margin-Large-r");
+ subTitleRightLabel.addStyleName("kune-ft12px");
+ }
+
+ public void setContentSubTitleLeft(final String subTitle) {
+ subTitleLeftLabel.setText(subTitle);
+ }
+
+ public void setContentSubTitleLeftVisible(final boolean visible) {
+ subTitleLeftLabel.setVisible(visible);
+ }
+
+ public void setContentSubTitleRight(final String subTitle) {
+ subTitleRightLabel.setText(subTitle);
+
+ }
+
+ public void setContentSubTitleRightVisible(final boolean visible) {
+ subTitleRightLabel.setVisible(visible);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,65 @@
+/*
+ *
+ * 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+public class EntitySubTitlePresenter {
+
+ private EntitySubTitleView view;
+ private final I18nTranslationService i18n;
+
+ public EntitySubTitlePresenter(final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntitySubTitleView view) {
+ this.view = view;
+ }
+
+ public void setContentLanguage(final String langName) {
+ view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
+ }
+
+ public void setState(final StateDTO state) {
+ if (state.hasDocument()) {
+ view.setContentSubTitleLeft(i18n.tWithNT("by: [%s]", "used in a list of authors", state.getAuthors().get(0)
+ .getName()));
+ view.setContentSubTitleLeftVisible(true);
+ } else {
+ view.setContentSubTitleLeftVisible(false);
+ }
+ if (state.getLanguage() != null) {
+ final String langName = state.getLanguage().getEnglishName();
+ setContentLanguage(langName);
+ view.setContentSubTitleRightVisible(true);
+ } else {
+ view.setContentSubTitleRightVisible(false);
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntitySubTitleView extends View {
+
+ void setContentSubTitleLeft(String subTitle);
+
+ void setContentSubTitleRight(String subTitle);
+
+ void setContentSubTitleLeftVisible(boolean visible);
+
+ void setContentSubTitleRightVisible(boolean visible);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -24,7 +24,6 @@
import org.ourproject.kune.platf.client.ui.EditableIconLabel;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.google.gwt.user.client.ui.Label;
@@ -48,8 +47,6 @@
titleLabel.addStyleName("kune-ft17px");
dateLabel.addStyleName("kune-Margin-Large-r");
dateLabel.addStyleName("kune-ft12px");
- titleLabel.addStyleName("kune-ContentTitleBar-l");
- dateLabel.addStyleName("kune-ContentTitleBar-r");
}
public void restoreOldTitle() {
@@ -70,10 +67,6 @@
public void setDateVisible(final boolean visible) {
dateLabel.setVisible(visible);
-
}
- public void setTheme(final WsTheme theme) {
-
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -31,7 +31,6 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -90,10 +89,6 @@
}
}
- public void setTheme(final WsTheme theme) {
- view.setTheme(theme);
- }
-
private void setContentDate(final Date publishedOn) {
final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -21,7 +21,6 @@
package org.ourproject.kune.workspace.client.ui.newtmp.title;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface EntityTitleView extends View {
@@ -35,6 +34,4 @@
void setDateVisible(boolean visible);
- void setTheme(WsTheme theme);
-
}
1
0
Author: vjrj
Date: 2008-07-07 16:10:21 +0200 (Mon, 07 Jul 2008)
New Revision: 793
Added:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
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/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java
Modified:
trunk/pom.xml
trunk/script/css-update.sh
trunk/script/deploy_gwt.cmd
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css
trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/main/webapp/WEB-INF/web.xml
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
Log:
gwt-ext workspace refactorization
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/pom.xml 2008-07-07 14:10:21 UTC (rev 793)
@@ -272,17 +272,12 @@
<dependency>
<groupId>com.calclab.emite</groupId>
<artifactId>emite</artifactId>
- <version>0.2.8</version>
+ <version>0.3.0</version>
</dependency>
<dependency>
- <groupId>com.calclab.emite</groupId>
- <artifactId>emiteuimodule</artifactId>
- <version>0.2.8</version>
- </dependency>
- <dependency>
<groupId>com.calclab</groupId>
<artifactId>suco</artifactId>
- <version>0.2.8</version>
+ <version>0.3.0</version>
</dependency>
</dependencies>
<!-- http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/ind… -->
Modified: trunk/script/css-update.sh
===================================================================
--- trunk/script/css-update.sh 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/script/css-update.sh 2008-07-07 14:10:21 UTC (rev 793)
@@ -3,7 +3,7 @@
WEBAPP=src/main/webapp/gwt/org.ourproject.kune.app.Kune
TARGET=target/kune-0.0.4/org.ourproject.kune.app.Kune
-$PWD/script/css-compact-and-tidy.css
+#$PWD/script/css-compact-and-tidy.css
rsync -aC $APPPUB/Kune.html $WEBAPP/Kune.html
rsync -aC $APPPUB/js/ $WEBAPP/js
Modified: trunk/script/deploy_gwt.cmd
===================================================================
--- trunk/script/deploy_gwt.cmd 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/script/deploy_gwt.cmd 2008-07-07 14:10:21 UTC (rev 793)
@@ -1 +1 @@
-copy target\org.ourproject.kune-0.0.4\org.ourproject.kune.Main\* src\main\webapp\gwt\org.ourproject.kune
+copy target\kune-0.0.4\org.ourproject.kune.Main\* src\main\webapp\gwt\org.ourproject.kune
Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-07-07 14:10:21 UTC (rev 793)
@@ -3,18 +3,20 @@
<inherits name='com.google.gwt.user.User' />
<inherits name="org.cafesip.gwtcomp.GWTComponents" />
- <!-- gxt
- <inherits name='com.extjs.gxt.ui.GXT' />
- <stylesheet src="css/ext-all.css" />
- <stylesheet src="css/xtheme-gray.css" />
- -->
-
<!-- gwt-ext -->
<inherits name='com.gwtext.GwtExt' />
<script src="js/ext/adapter/ext/ext-base.js" />
<script src="js/ext/ext-all.js" />
-
+ <!-- kune css -->
+ <!-- when build a unique css with csstidy use all.css -->
+ <!-- <stylesheet src="css/all.css" /> -->
+ <stylesheet src="css/workspace.css" />
+ <stylesheet src="css/chat.css" />
+ <stylesheet src="css/docs.css" />
+ <stylesheet src="css/kune.css" />
+ <stylesheet src="css/kune-new.css" />
+
<inherits name="com.calclab.suco.Suco" />
<inherits name='org.ourproject.kune.platf.Kune-Platform' />
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-07-07 14:10:21 UTC (rev 793)
@@ -17,7 +17,6 @@
<link rel="stylesheet" type="text/css" href="css/kune.css">
-->
-<link rel="stylesheet" type="text/css" href="css/all.css">
<link rel="shortcut icon" href="images/favicon.ico" />
<title>Kune</title>
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -33,6 +33,6 @@
-moz-opacity: 0.2;
opacity: 0.2;
}
-*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;owerflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;owerflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-TagsPanel-tag{float:left;margin-right:5px;cursor:pointer;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}.chat-icon{background-image:url(img/chat.gif)!important;}.group-icon{background-image:url(img/group.gif)!important;}.user-icon{background-image:url(img/user.gif)!important;}.userf-icon{background-image:url(img/userf.gif)!important;}.kune-RoomPanel-HorizDelimiter{white-space:nowrap;color:#B3B3B3;}.kune-MultiRoomPanel-Subject{font-size:108%;color:#2E5492;}.kune-MultiRoomPanel-User{}.kune-MultiRoomPanel-User .kune-IconLabel{overflow:hidden;white-space:nowrap;}.kune-RoomPanel-Conversation{}.kune-RoomPanel-Message{margin:0 7px;}.kune-RoomPanel-EventMessage{font-style:italic;color:#69C;margin:0 5px;}.kune-MultiRoomPanel-EmoticonPalette{background-color:#FFF;border:1px solid #AAA;margin:1px solid red;z-index:10000;position:absolute;}.kune-MultiRoomPanel-EmoticonPalette td{width:30px;height:30px;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
+*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;owerflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-TagsPanel-tag{float:left;margin-right:5px;cursor:pointer;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}.chat-icon{background-image:url(img/chat.gif)!important;}.group-icon{background-image:url(img/group.gif)!important;}.user-icon{background-image:url(img/user.gif)!important;}.userf-icon{background-image:url(img/userf.gif)!important;}.kune-RoomPanel-HorizDelimiter{white-space:nowrap;color:#B3B3B3;}.kune-MultiRoomPanel-Subject{font-size:108%;color:#2E5492;}.kune-MultiRoomPanel-User{}.kune-MultiRoomPanel-User .kune-IconLabel{overflow:hidden;white-space:nowrap;}.kune-RoomPanel-Conversation{}.kune-RoomPanel-Message{margin:0 7px;}.kune-RoomPanel-EventMessage{font-style:italic;color:#69C;margin:0 5px;}.kune-MultiRoomPanel-EmoticonPalette{background-color:#FFF;border:1px solid #AAA;margin:1px solid red;z-index:10000;position:absolute;}.kune-MultiRoomPanel-EmoticonPalette td{width:30px;height:30px;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
background-color: #FFF; */border:1px solid #4D4D4D;background-color:#FFF;margin:5px 0 5px 10px;}.gwt-RichTextToolbar{/* background-color: #F2F2F2;
padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px solid red;}.kune-WebSafePalette td{width:12px;height:10px;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -1,46 +0,0 @@
-.kune-RoomPanel-HorizDelimiter {
- white-space: nowrap;
- color: #B3B3B3;
-}
-
-.kune-MultiRoomPanel-Subject {
- font-size: 108%;
- color: #2E5492;
-}
-
-.kune-MultiRoomPanel-User {
-
-}
-
-.kune-MultiRoomPanel-User .kune-IconLabel {
- overflow: hidden;
- white-space: nowrap;
-}
-
-.kune-RoomPanel-Conversation {
-
-}
-
-.kune-RoomPanel-Message {
- margin: 0 7px;
-}
-
-.kune-RoomPanel-EventMessage {
- font-style: italic;
- color: rgb(102, 153, 204);
- margin: 0 5px;
-}
-
-.kune-MultiRoomPanel-EmoticonPalette {
- background-color: #FFF;
- border: 1px solid #AAA;
- margin: 1px solid red;
- z-index:10000;
- position:absolute;
-}
-
-.kune-MultiRoomPanel-EmoticonPalette td {
- width: 30px;
- height: 30px;
-}
-
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -135,7 +135,7 @@
.kune-WebSafePalette {
background-color: #FFF;
border: 1px solid #AAA;
- margin: 1px solid red;
+ margin: 1px;
}
.kune-WebSafePalette td {
Added: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,182 @@
+.k-site-traybar {
+ background: #FFF none repeat scroll 0% 50%;
+}
+
+.k-sitebar {
+ white-space: nowrap;
+}
+
+.k-entity-summary {
+ border-left-color: #FFF;
+ border-left-width: 5px;
+}
+
+.k-EntityTextLogo {
+ border: 2px solid #F2F2F2;
+ height: 60px;
+ margin-bottom: 4px;
+ overflow: hidden;
+ width: 468px;
+}
+
+.k-entitytextlogo .gwt-Label {
+ font-size: 167%;
+ font-weight: 700;
+ margin: 5px;
+ height: 27px;
+}
+
+.k-entitytextlogo-def .gwt-Label {
+ color: #69312F;
+}
+
+.k-entitytextlogo-green .gwt-Label {
+ color: #000080;
+}
+
+.k-entitytextlogo .gwt-Hyperlink a {
+ color: #CCC;
+ font-size: 85%;
+ margin: 5px;
+ text-decoration: underline;
+ white-space: nowrap;
+ background-color: #FFF;
+}
+
+.k-entity-def .x-layout-split {
+ background: #DD8A3D none repeat scroll 0% 50%;
+}
+
+.k-entity-green .x-layout-split {
+ background: #5FD35F none repeat scroll 0% 50%;
+}
+
+.k-entityworkspace .x-layout-split {
+ background: transparent none repeat scroll 0% 50%;
+}
+
+.k-entityworkspace-def .x-layout-split {
+ background: #DEAA87 none repeat scroll 0% 50%;
+}
+
+.k-entityworkspace-green .x-layout-split {
+ background: #DCE8AB none repeat scroll 0% 50%;
+}
+
+.k-entity-title {
+ line-height: 22px;
+ border-left-style: solid;
+ border-left-width: 2px;
+}
+
+.k-entity-title div {
+ white-space: nowrap;
+}
+
+.k-entity-subtitle {
+ line-height: 2em;
+}
+
+.k-entity-subtitle div {
+ white-space: nowrap;
+}
+
+.k-entity-title-rd-def {
+ background: #DD8A3D;
+}
+
+.k-entity-title-rd-green {
+ background: #5FD35F;
+}
+
+.k-entity-title-def {
+ background: #F1BB59 none repeat scroll 0% 50%;
+ color: #69312F;
+ border-left-color: #DD8A3D;
+}
+
+.k-entity-title-green {
+ background: #AFA none repeat scroll 0% 50%;
+ color: #250;
+ border-left-color: #5FD35F;
+}
+
+.k-entity-subtitle-def {
+ background: #DD8A3D none repeat scroll 0% 50%;
+ color: #FFF;
+}
+
+.k-entity-subtitle-green {
+ background: #5FD35F none repeat scroll 0% 50%;
+ color: #FFF;
+}
+
+.k-entity-bottom-rd-def {
+ background: #DD8A3D;
+}
+
+.k-entity-bottom-rd-green {
+ background: #5FD35F;
+}
+
+.k-entity-container-def div {
+ background: #FFD09D none repeat scroll 0% 50%;
+}
+
+.k-entity-container-green div {
+ background: #CFA none repeat scroll 0% 50%;
+}
+
+.k-entity-bottom {
+ line-height: 2em;
+}
+
+.k-entity-bottom-def {
+ background: #DD8A3D;
+ color: #FFF;
+}
+
+.k-entity-bottom-green {
+ background: #5FD35F;
+ color: #FFF;
+}
+
+.k-toolbar-top-line {
+ border-top-color: rgb( 208, 208, 208 );
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.k-toolbar-bottom-line {
+ border-bottom-color: rgb( 208, 208, 208 );
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+}
+
+.x-toolbar td, .x-toolbar span, .x-toolbar input, .x-toolbar div, .x-toolbar select, .x-toolbar label {
+ white-space: nowrap;
+ font: normal 13px arial, sans;
+ line-height: 19px;
+}
+
+.k-toolbar-sep {
+ padding-top: 4px;
+}
+
+.ytb-sep {
+ background-image: url(../js/ext/resources/images/default/grid/grid-split.gif);
+ background-position: center;
+ background-repeat: no-repeat;
+ display: block;
+ font-size: 1px;
+ height: 16px;
+ width: 4px;
+ overflow: hidden;
+ cursor: default;
+ margin: 0 2px 0;
+ border: 0;
+}
+
+.ytb-spacer {
+ width: 2px;
+}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -175,13 +175,13 @@
.kune-CustomPushButton-up-disabled {
background: transparent url(img/button-bg-soft.gif) repeat-x 0 0;
color: #E0E0E0;
- cursor: normal;
+ cursor: default;
}
.kune-CustomPushButton-down-disabled {
background: transparent url(img/button-bg-soft.gif) repeat-x 0 0;
color: #E0E0E0;
- cursor: normal;
+ cursor: default;
}
.kune-Button-Large-lrSpace {
@@ -396,7 +396,7 @@
.kune-Margin-Large-tb {
margin-top: 10px;
- margin-bottom: : 10px;
+ margin-bottom: 10px;
}
.kune-Margin-Large-t {
@@ -568,5 +568,5 @@
}
.kune-ft26px {
- font-size: 197 %
+ font-size: 197%
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -127,31 +127,6 @@
border-right: 3px solid #DD8A3D;
}
-.kune-EntityTextLogo {
- border: 2px solid #F2F2F2;
- height: 60px;
- margin-bottom: 4px;
- overflow: hidden;
- width: 468px;
-}
-
-.kune-EntityTextLogo .gwt-Label {
- color: #AA4400;
- font-size: 167%;
- font-weight: 700;
- margin: 5px;
- height: 27;
-}
-
-.kune-EntityTextLogo .gwt-Hyperlink a {
- color: #CCC;
- font-size: 85%;
- margin: 5px;
- text-decoration: underline;
- white-space: nowrap;
- background-color: #FFF;
-}
-
.kune-GroupSummaryPanel {
margin: 5px 0 0 5px;
width: 100%;
@@ -383,7 +358,7 @@
background-color: #EEFFAA;
cursor: pointer;
padding: 1px 3px 0 6px;
- owerflow: hidden;
+ overflow: hidden;
}
.kune-StackedDropDownPanel .gwt-StackPanelItem img {
@@ -601,7 +576,7 @@
background: transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;
cursor: pointer;
padding: 3px 10px 1px 20px;
- owerflow: hidden;
+ overflow: hidden;
width: 100%;
}
@@ -853,19 +828,12 @@
}
.kune-Content-Main input[type=text] {
- width: 12.25em; *
- width: 11.9em;
-}
+ width: 12.25em;*width: 11.9em;}
.kune-Content-Main input[type=password] {
- width: 12.25em; *
- width: 11.9em;
-}
+ width: 12.25em;*width: 11.9em;}
-.kune-Content-Main textarea {
- width: 12.25em; *
- width: 11.9em;
-}
+.kune-Content-Main textarea {width: 12.25em;*width: 11.9em;}
.search-icon {
background-image: url(img/search.gif) !important;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -38,10 +38,14 @@
import org.ourproject.kune.workspace.client.WorkspaceClientModule;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
+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.EmiteUIModule;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.ui.Label;
public class ApplicationBuilder {
@@ -62,6 +66,28 @@
final Application application = kune.getInstance(Application.class);
final I18nUITranslationService i18n = kune.getI18N();
+ // Temporary new ws
+ final WorkspaceManager wmanager = kune.getInstance(WorkspaceManager.class);
+ final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
+ // final com.gwtext.client.widgets.Window dialog = new
+ // com.gwtext.client.widgets.Window("gwt-ext new ws 3", 640,
+ // 480);
+ // final Panel panel = new Panel();
+ // panel.setPaddings(5);
+ // panel.setLayout(new FitLayout());
+ // panel.add(((WorkspaceSkeleton) wsmanager.getView()).getPanel());
+ // new Viewport(panel);
+ // wsnew.getPanel().setWidth(640);
+ // wsnew.getPanel().setHeight(460);
+ // panel.setWidth(640);
+ // panel.setHeight(460);
+ // dialog.add(panel);
+ // dialog.show();
+ ws.setTheme(WsTheme.def);
+ ws.show();
+ ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
+ wmanager.setTheme(WsTheme.def);
+
// Testing providers:
platform.install(new PlatformClientModule(session, kune.getProvider(StateManager.class)));
platform.install(new WorkspaceClientModule(session, stateManager, application.getWorkspace(), i18n));
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-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -18,6 +18,14 @@
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+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.ui.EntityLogo;
+import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.modules.Module;
@@ -48,10 +56,10 @@
builder.registerProvider(I18nUITranslationService.class, new Provider<I18nUITranslationService>() {
public I18nUITranslationService get() {
- final I18nUITranslationService translationService = new I18nUITranslationService();
- translationService.setCurrentLanguage(initialLang.getCode());
- translationService.setLexicon(lexicon);
- return translationService;
+ final I18nUITranslationService i18n = new I18nUITranslationService();
+ i18n.setCurrentLanguage(initialLang.getCode());
+ i18n.setLexicon(lexicon);
+ return i18n;
}
}, SingletonScope.class);
@@ -61,16 +69,16 @@
}
}, SingletonScope.class);
+ final I18nUITranslationService i18n = builder.getInstance(I18nUITranslationService.class);
builder.registerProvider(KuneErrorHandler.class, new Provider<KuneErrorHandler>() {
public KuneErrorHandler get() {
- return new KuneErrorHandler(builder.getInstance(Session.class), builder
- .getInstance(I18nUITranslationService.class));
+ return new KuneErrorHandler(builder.getInstance(Session.class), i18n);
}
}, SingletonScope.class);
final KuneErrorHandler errorHandler = builder.getInstance(KuneErrorHandler.class);
AsyncCallbackSimple.init(errorHandler);
- Site.init(builder.getInstance(I18nUITranslationService.class));
+ Site.init(i18n);
builder.registerProvider(ColorTheme.class, new Provider<ColorTheme>() {
public ColorTheme get() {
@@ -95,24 +103,66 @@
final Session session = builder.getInstance(Session.class);
final ExtensibleWidgetsManager extensionPointManager = builder
.getInstance(ExtensibleWidgetsManager.class);
- return new ApplicationDefault(session, extensionPointManager, builder
- .getInstance(I18nUITranslationService.class), builder.getInstance(ColorTheme.class), builder
+ return new ApplicationDefault(session, extensionPointManager, i18n, builder
+ .getInstance(ColorTheme.class), builder.getInstance(KuneErrorHandler.class));
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(WorkspaceSkeleton.class, new Provider<WorkspaceSkeleton>() {
+ public WorkspaceSkeleton get() {
+ return new WorkspaceSkeleton();
+ }
+ }, SingletonScope.class);
+
+ final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
+
+ builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
+ public EntityLogo get() {
+ return new EntityLogoPanel(i18n, ws);
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
+ public WsThemePresenter get() {
+ final WsThemePresenter presenter = new WsThemePresenter();
+ final WsThemePanel panel = new WsThemePanel(ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(EntityTitlePresenter.class, new Provider<EntityTitlePresenter>() {
+ public EntityTitlePresenter get() {
+ final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, builder
.getInstance(KuneErrorHandler.class));
+ final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter);
+ presenter.init(panel);
+ return presenter;
}
}, SingletonScope.class);
+ builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
+ public WorkspaceManager get() {
+ final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
+ .getInstance(EntityTitlePresenter.class), builder.getInstance(WsThemePresenter.class));
+ return presenter;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(StateManager.class, new Provider<StateManager>() {
public StateManager get() {
final Session session = builder.getInstance(Session.class);
final ContentProviderImpl provider = new ContentProviderImpl(ContentService.App.getInstance());
final HistoryWrapper historyWrapper = new HistoryWrapperImpl();
final Application application = builder.getInstance(Application.class);
+ final WorkspaceManager wm = builder.getInstance(WorkspaceManager.class);
final StateManagerDefault stateManager = new StateManagerDefault(provider, application, session,
- historyWrapper);
+ historyWrapper, wm);
History.addHistoryListener(stateManager);
return stateManager;
}
}, SingletonScope.class);
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -33,6 +33,7 @@
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.workspace.Workspace;
public class StateManagerDefault implements StateManager {
@@ -43,37 +44,39 @@
private String lastTheme;
private final Session session;
private final HistoryWrapper history;
+ private final WorkspaceManager ws;
public StateManagerDefault(final ContentProvider provider, final Application app, final Session session,
- final HistoryWrapper history) {
- this.provider = provider;
- this.app = app;
- this.session = session;
- this.history = history;
- this.workspace = app.getWorkspace();
- this.oldState = null;
+ final HistoryWrapper history, final WorkspaceManager ws) {
+ this.provider = provider;
+ this.app = app;
+ this.session = session;
+ this.history = history;
+ this.ws = ws;
+ this.workspace = app.getWorkspace();
+ this.oldState = null;
}
public void onHistoryChanged(final String historyToken) {
- String oldStateEncoded = "";
- if (oldState != null) {
- oldStateEncoded = oldState.getStateToken().getEncoded();
- }
- if (historyToken.equals(Site.NEWGROUP_TOKEN)) {
- Site.doNewGroup(oldStateEncoded);
- } else if (historyToken.equals(Site.LOGIN_TOKEN)) {
- Site.doLogin(oldStateEncoded);
- } else if (historyToken.equals(Site.TRANSLATE_TOKEN)) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
- } else if (historyToken.equals(Site.FIXME_TOKEN)) {
- if (oldState == null) {
- onHistoryChanged(new StateToken());
- } else {
- loadContent(oldState);
- }
- } else {
- onHistoryChanged(new StateToken(historyToken));
- }
+ String oldStateEncoded = "";
+ if (oldState != null) {
+ oldStateEncoded = oldState.getStateToken().getEncoded();
+ }
+ if (historyToken.equals(Site.NEWGROUP_TOKEN)) {
+ Site.doNewGroup(oldStateEncoded);
+ } else if (historyToken.equals(Site.LOGIN_TOKEN)) {
+ Site.doLogin(oldStateEncoded);
+ } else if (historyToken.equals(Site.TRANSLATE_TOKEN)) {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ } else if (historyToken.equals(Site.FIXME_TOKEN)) {
+ if (oldState == null) {
+ onHistoryChanged(new StateToken());
+ } else {
+ loadContent(oldState);
+ }
+ } else {
+ onHistoryChanged(new StateToken(historyToken));
+ }
}
/**
@@ -82,104 +85,106 @@
* </p>
*/
public void reload() {
- onHistoryChanged(history.getToken());
+ onHistoryChanged(history.getToken());
}
public void reloadContextAndTitles() {
- provider.getContent(session.getUserHash(), new StateToken(history.getToken()),
- new AsyncCallbackSimple<StateDTO>() {
- public void onSuccess(final StateDTO newStateDTO) {
- loadContextOnly(newStateDTO);
- oldState = newStateDTO;
- workspace.getContentTitleComponent().setState(oldState);
- workspace.getContentSubTitleComponent().setState(oldState);
- Site.hideProgress();
- }
- });
+ provider.getContent(session.getUserHash(), new StateToken(history.getToken()),
+ new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO newStateDTO) {
+ loadContextOnly(newStateDTO);
+ oldState = newStateDTO;
+ workspace.getContentTitleComponent().setState(oldState);
+ workspace.getContentSubTitleComponent().setState(oldState);
+ Site.hideProgress();
+ }
+ });
}
public void setRetrievedState(final StateDTO content) {
- final StateToken state = content.getStateToken();
- provider.cache(state, content);
- setState(state);
+ final StateToken state = content.getStateToken();
+ provider.cache(state, content);
+ setState(state);
}
public void setSocialNetwork(final SocialNetworkResultDTO socialNet) {
- StateDTO state;
- if (session != null && (state = session.getCurrentState()) != null) {
- // After a SN operation, usually returns a SocialNetworkResultDTO
- // with new SN data and we refresh the state
- // to avoid to reload() again the state
- SocialNetworkDTO groupMembers = socialNet.getGroupMembers();
- ParticipationDataDTO userParticipation = socialNet.getUserParticipation();
- state.setGroupMembers(groupMembers);
- state.setParticipation(userParticipation);
- setSocialNetwork(state);
- }
+ StateDTO state;
+ if (session != null && (state = session.getCurrentState()) != null) {
+ // After a SN operation, usually returns a SocialNetworkResultDTO
+ // with new SN data and we refresh the state
+ // to avoid to reload() again the state
+ final SocialNetworkDTO groupMembers = socialNet.getGroupMembers();
+ final ParticipationDataDTO userParticipation = socialNet.getUserParticipation();
+ state.setGroupMembers(groupMembers);
+ state.setParticipation(userParticipation);
+ setSocialNetwork(state);
+ }
}
public void setState(final StateToken state) {
- history.newItem(state.getEncoded());
+ history.newItem(state.getEncoded());
}
private void loadContent(final StateDTO state) {
- session.setCurrent(state);
- final GroupDTO group = state.getGroup();
- app.setGroupState(group.getShortName());
- boolean isAdmin = state.getGroupRights().isAdministrable();
- if (isAdmin) {
- workspace.getThemeMenuComponent().setVisible(true);
- } else {
- workspace.getThemeMenuComponent().setVisible(false);
- }
- setWsTheme(group);
- workspace.showGroup(group, isAdmin);
- final String toolName = state.getToolName();
- workspace.setTool(toolName);
+ session.setCurrent(state);
+ final GroupDTO group = state.getGroup();
+ app.setGroupState(group.getShortName());
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+ if (isAdmin) {
+ workspace.getThemeMenuComponent().setVisible(true);
+ } else {
+ workspace.getThemeMenuComponent().setVisible(false);
+ }
+ setWsTheme(group);
+ workspace.showGroup(group, isAdmin);
- Site.sitebar.setState(state);
- final ClientTool clientTool = app.getTool(toolName);
- clientTool.setContent(state);
- clientTool.setContext(state);
- workspace.getContentTitleComponent().setState(state);
- workspace.getContentSubTitleComponent().setState(state);
- workspace.getContentBottomToolBarComponent().setRate(state, session.isLogged());
- workspace.setContent(clientTool.getContent());
- workspace.setContext(clientTool.getContext());
- workspace.getLicenseComponent().setLicense(state);
- workspace.getTagsComponent().setState(state);
- setSocialNetwork(state);
- workspace.getGroupSummaryComponent().setGroupSummary(state);
- Site.hideProgress();
+ final String toolName = state.getToolName();
+ workspace.setTool(toolName);
+
+ Site.sitebar.setState(state);
+ final ClientTool clientTool = app.getTool(toolName);
+ clientTool.setContent(state);
+ clientTool.setContext(state);
+ ws.setState(state);
+ workspace.getContentTitleComponent().setState(state);
+ workspace.getContentSubTitleComponent().setState(state);
+ workspace.getContentBottomToolBarComponent().setRate(state, session.isLogged());
+ workspace.setContent(clientTool.getContent());
+ workspace.setContext(clientTool.getContext());
+ workspace.getLicenseComponent().setLicense(state);
+ workspace.getTagsComponent().setState(state);
+ setSocialNetwork(state);
+ workspace.getGroupSummaryComponent().setGroupSummary(state);
+ Site.hideProgress();
}
private void loadContextOnly(final StateDTO state) {
- session.setCurrent(state);
- final String toolName = state.getToolName();
- final ClientTool clientTool = app.getTool(toolName);
- clientTool.setContext(state);
- workspace.setContext(clientTool.getContext());
+ session.setCurrent(state);
+ final String toolName = state.getToolName();
+ final ClientTool clientTool = app.getTool(toolName);
+ clientTool.setContext(state);
+ workspace.setContext(clientTool.getContext());
}
private void onHistoryChanged(final StateToken newState) {
- provider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
- public void onSuccess(final StateDTO newStateDTO) {
- loadContent(newStateDTO);
- oldState = newStateDTO;
- }
- });
+ provider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO newStateDTO) {
+ loadContent(newStateDTO);
+ oldState = newStateDTO;
+ }
+ });
}
private void setSocialNetwork(final StateDTO state) {
- workspace.getGroupMembersComponent().setGroupMembers(state);
- workspace.getParticipationComponent().setParticipation(state);
+ workspace.getGroupMembersComponent().setGroupMembers(state);
+ workspace.getParticipationComponent().setParticipation(state);
}
private void setWsTheme(final GroupDTO group) {
- String nextTheme = group.getWorkspaceTheme();
- if (lastTheme == null || !lastTheme.equals(nextTheme)) {
- workspace.setTheme(nextTheme);
- }
- lastTheme = nextTheme;
+ final String nextTheme = group.getWorkspaceTheme();
+ if (lastTheme == null || !lastTheme.equals(nextTheme)) {
+ workspace.setTheme(nextTheme);
+ }
+ lastTheme = nextTheme;
}
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,125 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.layout.BorderLayout;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+
+public class DefaultBorderLayout {
+
+ public enum Position {
+ NORTH, CENTER, SOUTH, EAST, WEST
+ }
+
+ public static final int DEF_TOOLBAR_HEIGHT = 26;
+
+ private static final int NO_SIZE = -1;
+
+ private static RegionPosition[] regionPositions = new RegionPosition[] { RegionPosition.NORTH,
+ RegionPosition.CENTER, RegionPosition.SOUTH, RegionPosition.EAST, RegionPosition.WEST };
+
+ private final Panel mainPanel;
+
+ public DefaultBorderLayout() {
+ mainPanel = new Panel();
+ mainPanel.setLayout(new BorderLayout());
+ mainPanel.setBorder(false);
+ }
+
+ public void add(final Panel panel, final Position position) {
+ add(panel, position, false);
+ }
+
+ public void add(final Panel panel, final Position position, final boolean split) {
+ add(panel, position, split, NO_SIZE);
+ }
+
+ public void add(final Panel panel, final Position position, final boolean split, final int size) {
+ final RegionPosition regionPosition = regionPositions[position.ordinal()];
+ final BorderLayoutData borderLayoutData = new BorderLayoutData(regionPosition);
+ borderLayoutData.setSplit(split);
+ if (split) {
+ borderLayoutData.setUseSplitTips(true);
+ borderLayoutData.setCollapseModeMini(true);
+ }
+ if (size != NO_SIZE) {
+ switch (position) {
+ case NORTH:
+ case SOUTH:
+ panel.setHeight(size);
+ break;
+ case EAST:
+ case WEST:
+ panel.setWidth(size);
+ }
+ }
+ mainPanel.add(panel, borderLayoutData);
+ doLayoutIfNeeded();
+ }
+
+ public void add(final Panel panel, final Position position, final int size) {
+ add(panel, position, false, size);
+ }
+
+ public void add(final Panel panel, final Widget widget) {
+ panel.add(widget);
+ if (panel.isRendered()) {
+ panel.syncSize();
+ panel.doLayout();
+ }
+ doLayoutIfNeeded();
+ }
+
+ public Toolbar createBottomBar(final Panel panel) {
+ return createBottomBar(panel, null);
+ }
+
+ public Toolbar createBottomBar(final Panel panel, final String cssStyle) {
+ final Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
+ if (cssStyle != null) {
+ bottomToolbar.setCls(cssStyle);
+ }
+ panel.setBottomToolbar(bottomToolbar);
+ return bottomToolbar;
+ }
+
+ public Toolbar createTopBar(final Panel panel) {
+ return createTopBar(panel, null);
+ }
+
+ public Toolbar createTopBar(final Panel panel, final String cssStyle) {
+ final Toolbar topToolbar = new Toolbar();
+ topToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
+ if (cssStyle != null) {
+ topToolbar.setCls(cssStyle);
+ }
+ panel.setTopToolbar(topToolbar);
+ return topToolbar;
+ }
+
+ public void doLayoutIfNeeded() {
+ if (mainPanel.isRendered()) {
+ mainPanel.doLayout();
+ }
+ }
+
+ public Panel getPanel() {
+ return mainPanel;
+ }
+
+ public void setBorder(final boolean border) {
+ mainPanel.setBorder(border);
+ }
+
+ public void setCls(final String style) {
+ mainPanel.setCls(style);
+ }
+
+ public void setPanel(final Panel panel, final Widget widget) {
+ panel.clear();
+ add(panel, widget);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,486 @@
+/*
+ * Copyright 2007 Hilbrand Bouwkamp, hs(a)bouwkamp.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.ourproject.kune.platf.client.ui;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * The <code>RoundedPanel</code> class adds similar rounded corners, as seen
+ * in other Google applications, to a widget. This is done by adding several
+ * <code>div</code> Elements around a Widget. The HTML code roughly for a
+ * corner height 2 looks as follows:
+ *
+ * <pre>
+ * <div>
+ * <div style="margin:0 2px"></div>
+ * <div style="margin:0 1px"></div>
+ * <div>your widget</div>
+ * <div style="margin:0 1px"></div>
+ * <div style="margin:0 2px"></div>
+ * </div>
+ * </pre>
+ *
+ * To add the rounded corners to a widget start simply wrap your own widget in
+ * the <code>RoundedPanel</code> class, for example with all corners rounded:
+ *
+ * <pre>
+ * // all 4 corners are rounded.
+ * RoundedPanel rp = new RoundedPanel(yourWidget);
+ * // use rp where you would use 'yourWidget' otherwise
+ * </pre>
+ *
+ * Or with custom set corners, like only on the left:
+ *
+ * <pre>
+ * // custom set corners
+ * RoundedPanel rp = new RoundedPanel(yourWidget, RoundedPanel.LEFT);
+ * // use rp where you would use 'yourWidget' otherwise
+ * </pre>
+ *
+ * By default the height of the corners is 2px. It is possible to set a
+ * different height at construction time. The height can be a value between and
+ * including 1 and 9. This value doesn't correspond exactly with the height,
+ * e.g. 9 is 12px heigh.
+ *
+ * <pre>
+ * // all 4 corners are rounded and height index 5
+ * RoundedPanel rp = new RoundedPanel(yourWidget, ALL, 5);
+ * // use rp where you would use 'yourWidget' otherwise
+ * </pre>
+ *
+ * Programmatically set the color of the corners with
+ * {@link #setCornerColor(String)}:
+ *
+ * <pre>
+ * // all 4 corners are rounded.
+ * RoundedPanel rp = new RoundedPanel(yourWidget);
+ * rp.setCornerColor("red");
+ * </pre>
+ *
+ * Default the css style name of the rounded corner divs is <code>cbg-RP</code>.
+ * Use it to set the colors of the corner. For example:
+ *
+ * <pre>
+ * .cbg-RP { background-color:#c3d9ff; }
+ * </pre>
+ *
+ * A custom style might be needed when the corners are visible only when a panel
+ * is selected (see the KitchenSink example modification below). Use the
+ * <code>setCornerStyleName</code> method to set the custom style name. For
+ * example set a custom style <code>my-RP</code> and add something like the
+ * following to the stylesheet:
+ *
+ * <pre>
+ * .selected .my-RP { background-color:#c3d9ff; }
+ * </pre>
+ *
+ * <h3>Adding rounded corners to DialogBox widgets</h3>
+ * Adding rounded corners to a <code>DialogBox</code> is somewhat more
+ * complicated. The problem with <code>DialogBox</code> is that it uses a
+ * private panel and the <code>RoundedPanel</code> should be applied to this
+ * private <code>Panel</code>. To add the rounded corners to a
+ * <code>DialogBox</code> you have to rewrite the implementation of the
+ * <code>DialogBox</code>. For the <code>DialogBox</code> widget this can
+ * be done as follows. First create a new class like
+ * <code>RoundedDialogBox</code> and copy the code from the original
+ * <code>DialogBox</code> (Please take the copyright of this class into
+ * account). Next make the following changes to the code:
+ *
+ * <pre>
+ * // Private variable for RoundedPanel
+ * private RoundedPanel rp;
+ * </pre>
+ *
+ * In the constructor change:
+ *
+ * <pre>
+ * super.add(panel);
+ * </pre>
+ *
+ * into:
+ *
+ * <pre>
+ * rp = new RoundedPanel(panel);
+ * super.add(rp);
+ * </pre>
+ *
+ * Next change the style, otherwise the style of the dialog box is applied to
+ * the rounded lines too. Do this by changing the following line:
+ *
+ * <pre>
+ * setStyleName("gwt-DialogBox");
+ * </pre>
+ *
+ * into:
+ *
+ * <pre>
+ * panel.setStyleName("gwt-DialogBox");
+ * </pre>
+ *
+ * In your css add the color of the border, something like:
+ *
+ * <pre>
+ * .cbg-RP { background-color:#AAAAAA; }
+ * </pre>
+ *
+ * There seems to be a problem with the width under IE. The RoundedPanel divs
+ * don't follow the width of the dialog. To fix this change the
+ * <code>show</code> method as follows:
+ *
+ * <pre>
+ * public void show() {
+ * super.show();
+ * // (The width must be set after the super.show() otherwise it will be 0).
+ * // NOTE: As of GWT 1.1 the .getOffsetWidth() returns 0 at this point.
+ * // This is different with earlier versions of GWT. Disable the line will make
+ * // the rounded corners work in at least Firefox 1.5, but not in IE.
+ * // I'm looking into this issue.
+ * rp.setWidth(panel.getOffsetWidth() + "px");
+ * }
+ * </pre>
+ *
+ * Now by extending your own dialog class on this <code>RoundedDialogBox</code>
+ * instead of the original <code>DialogBox</code> you will have rounded
+ * corners around your dialog.
+ *
+ *
+ * @author Hilbrand Bouwkamp(hs(a)bouwkamp.com)
+ * @version 1.3
+ */
+public class RoundedPanel extends SimplePanel {
+
+ /**
+ * <code>TOPLEFT</code> top left rounded corner
+ */
+ public final static int TOPLEFT = 1;
+
+ /**
+ * <code>TOPRIGHT</code> top right rounded corner
+ */
+ public final static int TOPRIGHT = 2;
+
+ /**
+ * <code>BOTTOMLEFT</code> bottom left rounded corner
+ */
+ public final static int BOTTOMLEFT = 4;
+
+ /**
+ * <code>BOTTOMRIGHT</code> bottom right rounded corner
+ */
+ public final static int BOTTOMRIGHT = 8;
+
+ /**
+ * <code>BOTTOM</code> rounded corners at the top
+ */
+ public final static int TOP = TOPLEFT | TOPRIGHT;
+
+ /**
+ * <code>TOP</code> rounded corners at the bottom
+ */
+ public final static int BOTTOM = BOTTOMLEFT | BOTTOMRIGHT;
+
+ /**
+ * <code>LEFT</code> rounded corners on the left side
+ */
+ public final static int LEFT = TOPLEFT | BOTTOMLEFT;
+
+ /**
+ * <code>RIGHT</code> rounded corners on the right side
+ */
+ public final static int RIGHT = TOPRIGHT | BOTTOMRIGHT;
+
+ /**
+ * <code>ALL</code> rounded corners on all sides
+ */
+ public final static int ALL = TOP | BOTTOM;
+
+ /**
+ * Default border style
+ */
+ private final static String RPSTYLE = "cbg-RP";
+
+ /**
+ * Lookup table for corner border width
+ */
+ private final static String[][] CORNERBORDER = { { "1px" }, { "1px", "1px" }, { "1px", "1px", "1px" },
+ { "1px", "1px", "1px", "1px" }, { "1px", "1px", "1px", "2px", "1px" },
+ { "1px", "1px", "1px", "1px", "2px", "1px" }, { "1px", "1px", "1px", "1px", "1px", "2px", "1px" },
+ { "1px", "1px", "1px", "1px", "1px", "2px", "2px", "1px" },
+ { "1px", "1px", "1px", "1px", "1px", "1px", "2px", "3px", "1px" } };
+
+ /**
+ * Lookup table for corner height
+ */
+ private final static String[][] CORNERHEIGHT = { { "1px" }, { "1px", "1px" }, { "1px", "1px", "1px" },
+ { "1px", "1px", "1px", "1px" }, { "2px", "1px", "1px", "1px", "1px" },
+ { "2px", "1px", "1px", "1px", "1px", "1px" }, { "2px", "1px", "1px", "1px", "1px", "1px", "1px" },
+ { "2px", "1px", "1px", "1px", "1px", "1px", "1px", "1px" },
+ { "3px", "2px", "1px", "1px", "1px", "1px", "1px", "1px", "1px" } };
+
+ /**
+ * Lookup table for corner margin
+ */
+ private final static String[][] CORNERMARGIN = { { "1px" }, { "1px", "2px" }, { "1px", "2px", "3px" },
+ { "1px", "2px", "3px", "4px" }, { "1px", "2px", "3px", "4px", "6px" },
+ { "1px", "2px", "3px", "4px", "5px", "7px" }, { "1px", "2px", "3px", "4px", "5px", "6px", "8px" },
+ { "1px", "2px", "3px", "4px", "5px", "6px", "8px", "10px" },
+ { "1px", "2px", "3px", "4px", "5px", "6px", "7px", "9px", "12px" }, };
+
+ /**
+ * Element array containing all div elements of the top corner div's.
+ */
+ protected final Element[] divt;
+
+ /**
+ * Element array containing all div elements of the bottom corner div's.
+ */
+ protected final Element[] divb;
+
+ /**
+ * Index of the corner height.
+ */
+ protected final int cornerHeight;
+
+ /**
+ * Index of which corners are set.
+ */
+ protected final int corners;
+
+ private final Element body; // body of widget
+ private final Element divElement; // div element containing widget
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with all corners rounded and
+ * height of corners 2px. Use <code>setWidget</code> to add the widget.
+ */
+ public RoundedPanel() {
+ this(ALL, 2);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounding and height
+ * of corners 2px but with no widget set. Use <code>setWidget</code> to
+ * add widget.
+ *
+ * Every combination of corners can be set via <code>corners</code>. Use
+ * the static constants to set the corners. For example, to create a panel
+ * with only rounded corners at the left, use:
+ *
+ * <code>new RoundedPanel(yourWidget, RoundedPanel.LEFT);</code>
+ *
+ * @param corners
+ * set custom rounded corners
+ */
+ public RoundedPanel(final int corners) {
+ this(corners, 2);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounding and custom
+ * height of the corners but with no widget set. Height can be value from 1
+ * to 9. The height for a value 5 or higher is actually larger, e.g. for 5
+ * the height is 6px. Use {@link #setWidget(Widget)} to add widget.
+ *
+ * @param corners
+ * set custom rounded corners
+ * @param cornerHeight
+ * height index between and including 1 and 9
+ * @throws IndexOutOfBoundsException
+ * when cornerHeight below 1 or above 9
+ */
+ public RoundedPanel(final int corners, final int cornerHeight) {
+ super(DOM.createDiv());
+ body = getElement();
+ if (cornerHeight < 1 || cornerHeight > 9) {
+ throw new IndexOutOfBoundsException("RoundedPanel height range between and including 1 and 9");
+ }
+ this.cornerHeight = cornerHeight;
+ divt = new Element[cornerHeight];
+ divb = new Element[cornerHeight];
+ this.corners = corners;
+ if (inMask(corners, TOP)) {
+ final int ct = corners & TOP;
+
+ for (int i = 0; i < cornerHeight; ++i) {
+ divt[i] = addLine(ct, cornerHeight - (i + 1));
+ }
+ }
+ divElement = DOM.createDiv();
+ DOM.appendChild(body, divElement);
+ if (inMask(corners, BOTTOM)) {
+ final int cb = corners & BOTTOM;
+
+ for (int i = cornerHeight - 1; i >= 0; --i) {
+ divb[i] = addLine(cb, cornerHeight - (i + 1));
+ }
+ }
+ setCornerStyleName(RPSTYLE);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with all corners rounded and
+ * height 2px on the widget <code>w</code>.
+ *
+ * @param w
+ * widget to add corners to
+ */
+ public RoundedPanel(final Widget w) {
+ this(w, ALL);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounded corners and
+ * height 2px on the widget <code>w</code>.
+ *
+ * @param w
+ * widget to add corners to
+ * @param corners
+ * set custom rounded corners
+ */
+ public RoundedPanel(final Widget w, final int corners) {
+ this(w, corners, 2);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounded corners and
+ * custom height on widget <code>w</code>.
+ *
+ * @param w
+ * widget to add corners to
+ * @param corners
+ * set custom rounded corners
+ * @param cornerHeight
+ * height index between and including 1 and 9
+ */
+ public RoundedPanel(final Widget w, final int corners, final int cornerHeight) {
+ this(corners, cornerHeight);
+ setWidget(w);
+ }
+
+ /**
+ * <p>
+ * Set the bolder color of the rounded corner by setting the background
+ * color of the div's.
+ * </p>
+ *
+ * @param borderColor
+ * border color
+ */
+ public void setCornerColor(final String borderColor) {
+ if (null != divt[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setStyleAttribute(divt[i], "backgroundColor", borderColor);
+ }
+ }
+ if (null != divb[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setStyleAttribute(divb[i], "backgroundColor", borderColor);
+ }
+ }
+ }
+
+ /**
+ * Set the css style name of the rounded corners div's. Default the css
+ * stylename is <code>cbg-RP</code>. Use it to set the colors of the
+ * corner. For example: <code>.cbg-RP { background-color:#c3d9ff; }</code>.
+ *
+ * A custom style might be needed when the corners are visible only when a
+ * panel is selected. Use this method to set the custom style name and add
+ * something like the following to the stylesheet:
+ *
+ * <code>.selected .cbg-RP { background-color:#c3d9ff; }</code> Setting
+ * the color is also possible via the method {@link #setCornerColor(String)}.
+ *
+ * @param style
+ * css style name
+ */
+ public void setCornerStyleName(final String style) {
+ if (null != divt[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setElementProperty(divt[i], "className", style);
+ }
+ }
+ if (null != divb[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setElementProperty(divb[i], "className", style);
+ }
+ }
+ }
+
+ /**
+ * Set the style of the RoundedPanel. In most cases this is not necessary
+ * and setting the style on the widget to which the
+ * <code>RoundedPanel</code> is applied should be set, as is done when not
+ * using the <code>RoundedPanel</code>
+ *
+ * @param style
+ * css style name
+ */
+ public void setStyleName(final String style) {
+ DOM.setElementProperty(body, "className", style);
+ }
+
+ /**
+ * Overwrite of parent getContainerElement()
+ */
+ protected Element getContainerElement() {
+ return divElement;
+ }
+
+ /**
+ * Convenience method to check if given <code>input</code> is with the
+ * <code>mask</code>.
+ *
+ * @param input
+ * input to check
+ * @param mask
+ * mask to check against
+ * @return true if input within mask
+ */
+ protected boolean inMask(final int input, final int mask) {
+ return (input & mask) > 0;
+ }
+
+ /**
+ * Creates div element representing part of the rounded corner.
+ *
+ * @param corner
+ * corner mask to set rounded corner
+ * @param heightIndex
+ * margin width for line
+ */
+ private Element addLine(final int corner, final int heightIndex) {
+ // margin 2 fields : top/bottom right/left => "0 <width>px"
+ // margin 4 fields : top right bottom left => "0 <width>px 0 <width>px"
+ final String margin = corner == TOP || corner == BOTTOM ? "0 "
+ + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : inMask(corner, LEFT) ? "0 0 0 "
+ + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : "0 "
+ + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] + " 0 0";
+ final Element div = DOM.createDiv();
+
+ DOM.setStyleAttribute(div, "fontSize", "0px");
+ DOM.setStyleAttribute(div, "height", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
+ DOM.setStyleAttribute(div, "borderWidth", "0 " + RoundedPanel.CORNERBORDER[cornerHeight - 1][heightIndex]);
+ DOM.setStyleAttribute(div, "lineHeight", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
+ DOM.setStyleAttribute(div, "margin", margin);
+ DOM.setInnerHTML(div, " ");
+ DOM.appendChild(body, div);
+ return div;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -40,97 +40,100 @@
private final Timer saveTimer;
private final I18nTranslationService i18n;
+ @Deprecated
public TextEditorPanel(final TextEditorPresenter presenter, final I18nTranslationService i18n) {
- this.presenter = presenter;
- this.i18n = i18n;
- gwtRTarea = new RichTextArea();
- textEditorToolbar = new TextEditorToolbar(gwtRTarea, presenter, i18n);
- initWidget(gwtRTarea);
+ this.presenter = presenter;
+ this.i18n = i18n;
+ gwtRTarea = new RichTextArea();
+ textEditorToolbar = new TextEditorToolbar(gwtRTarea, presenter, i18n);
+ initWidget(gwtRTarea);
- gwtRTarea.setWidth("97%");
- gwtRTarea.addStyleName("kune-TexEditorPanel-TextArea");
- adjustSize("" + (Window.getClientHeight() - 265));
- Window.addWindowResizeListener(new WindowResizeListener() {
- public void onWindowResized(final int arg0, final int arg1) {
- adjustSize("" + (Window.getClientHeight() - 265));
- }
- });
- saveTimer = new Timer() {
- public void run() {
- presenter.onSave();
- }
- };
+ gwtRTarea.setWidth("97%");
+ gwtRTarea.addStyleName("kune-TexEditorPanel-TextArea");
+ adjustSize("" + (Window.getClientHeight() - 265));
+ Window.addWindowResizeListener(new WindowResizeListener() {
+ public void onWindowResized(final int arg0, final int arg1) {
+ adjustSize("" + (Window.getClientHeight() - 265));
+ }
+ });
+ saveTimer = new Timer() {
+ public void run() {
+ presenter.onSave();
+ }
+ };
}
public void editHTML(final boolean edit) {
- textEditorToolbar.editHTML(edit);
+ textEditorToolbar.editHTML(edit);
}
public String getHTML() {
- return gwtRTarea.getHTML();
+ return gwtRTarea.getHTML();
}
public String getText() {
- return gwtRTarea.getText();
+ return gwtRTarea.getText();
}
public View getToolBar() {
- return this.textEditorToolbar;
+ return this.textEditorToolbar;
}
public void saveTimerCancel() {
- saveTimer.cancel();
+ saveTimer.cancel();
}
public void scheduleSave(final int delayMillis) {
- saveTimer.schedule(delayMillis);
+ saveTimer.schedule(delayMillis);
}
public void setEnabled(final boolean enabled) {
- final String bgColor = enabled ? BACKCOLOR_ENABLED : BACKCOLOR_DISABLED;
- DOM.setStyleAttribute(gwtRTarea.getElement(), "backgroundColor", bgColor);
- gwtRTarea.setEnabled(enabled);
+ final String bgColor = enabled ? BACKCOLOR_ENABLED : BACKCOLOR_DISABLED;
+ DOM.setStyleAttribute(gwtRTarea.getElement(), "backgroundColor", bgColor);
+ gwtRTarea.setEnabled(enabled);
}
public void setEnabledCancelButton(final boolean enabled) {
- textEditorToolbar.setEnabledCloseButton(enabled);
+ textEditorToolbar.setEnabledCloseButton(enabled);
}
public void setEnabledSaveButton(final boolean enabled) {
- textEditorToolbar.setEnabledSaveButton(enabled);
+ textEditorToolbar.setEnabledSaveButton(enabled);
}
public void setHeight(final String height) {
- gwtRTarea.setHeight(height);
+ gwtRTarea.setHeight(height);
}
public void setHTML(final String html) {
- gwtRTarea.setHTML(html);
+ gwtRTarea.setHTML(html);
}
public void setText(final String text) {
- gwtRTarea.setText(text);
+ gwtRTarea.setText(text);
}
public void setTextSaveButton(final String text) {
- textEditorToolbar.setTextSaveButton(text);
+ textEditorToolbar.setTextSaveButton(text);
}
public void showSaveBeforeDialog() {
- MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before close?"), new MessageBox.ConfirmCallback() {
- public void execute(final String btnID) {
- if (btnID.equals("yes")) {
- presenter.onSaveAndClose();
- } else {
- presenter.onCancelConfirmed();
- }
- }
- });
+ MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before close?"), new MessageBox.ConfirmCallback() {
+ public void execute(final String btnID) {
+ if (btnID.equals("yes")) {
+ presenter.onSaveAndClose();
+ } else {
+ presenter.onCancelConfirmed();
+ }
+ }
+ });
}
+ @Deprecated
private void adjustSize(final String height) {
- gwtRTarea.setHeight(height);
+ // While refactoring
+ // gwtRTarea.setHeight(height);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -95,344 +95,344 @@
private final I18nTranslationService i18n;
public SiteBarPanel(final SiteBarPresenter initPresenter, final I18nTranslationService i18n) {
- this.i18n = i18n;
- img = Images.App.getInstance();
+ this.i18n = i18n;
+ img = Images.App.getInstance();
- // Initialize
- siteBarHP = new HorizontalPanel();
+ // Initialize
+ siteBarHP = new HorizontalPanel();
- initWidget(siteBarHP);
- this.presenter = initPresenter;
+ initWidget(siteBarHP);
+ this.presenter = initPresenter;
- progressPanel = RootPanel.get("kuneprogresspanel");
- progressText = RootPanel.get("kuneprogresstext");
+ progressPanel = RootPanel.get("kuneprogresspanel");
+ progressText = RootPanel.get("kuneprogresstext");
- publicHP = new HorizontalPanel();
- gotoPublic = new IconLabel(img.anybody(), i18n.t("Go to Public Space"), false);
- contentNoPublic = new IconLabel(img.anybody(), i18n.t("This content is not public"));
+ publicHP = new HorizontalPanel();
+ gotoPublic = new IconLabel(img.anybody(), i18n.t("Go to Public Space"), false);
+ contentNoPublic = new IconLabel(img.anybody(), i18n.t("This content is not public"));
- final Label expandLabel = new Label("");
- newGroupHyperlink = new Hyperlink();
- final HTML pipeSeparatorHtml = new HTML();
- pipeSeparatorHtml2 = new HTML();
- loginHyperlink = new Hyperlink();
- loggedUserHyperlink = new Hyperlink();
- logoutLabel = new Label();
- HTML spaceSeparator1 = new HTML("<b></b>");
- MenuBar options = new MenuBar();
- optionsSubmenu = new MenuBar(true);
- yourGroupsSubmenu = new MenuBar(true);
- RoundedBorderDecorator optionsButton = new RoundedBorderDecorator(options, RoundedBorderDecorator.ALL,
- RoundedBorderDecorator.SIMPLE);
- HTML spaceSeparator2 = new HTML("<b></b>");
- logoImage = new Image();
+ final Label expandLabel = new Label("");
+ newGroupHyperlink = new Hyperlink();
+ final HTML pipeSeparatorHtml = new HTML();
+ pipeSeparatorHtml2 = new HTML();
+ loginHyperlink = new Hyperlink();
+ loggedUserHyperlink = new Hyperlink();
+ logoutLabel = new Label();
+ final HTML spaceSeparator1 = new HTML("<b></b>");
+ final MenuBar options = new MenuBar();
+ optionsSubmenu = new MenuBar(true);
+ yourGroupsSubmenu = new MenuBar(true);
+ final RoundedBorderDecorator optionsButton = new RoundedBorderDecorator(options, RoundedBorderDecorator.ALL,
+ RoundedBorderDecorator.SIMPLE);
+ final HTML spaceSeparator2 = new HTML("<b></b>");
+ logoImage = new Image();
- // Layout
- siteBarHP.add(publicHP);
- publicHP.add(gotoPublic);
- publicHP.add(contentNoPublic);
- siteBarHP.add(expandLabel);
- siteBarHP.add(loginHyperlink);
- siteBarHP.add(loggedUserHyperlink);
- siteBarHP.add(pipeSeparatorHtml);
- siteBarHP.add(logoutLabel);
- siteBarHP.add(pipeSeparatorHtml2);
- siteBarHP.add(newGroupHyperlink);
- siteBarHP.add(spaceSeparator1);
- siteBarHP.add(optionsButton);
- siteBarHP.add(spaceSeparator2);
- createSearchBox();
- siteBarHP.add(logoImage);
+ // Layout
+ siteBarHP.add(publicHP);
+ publicHP.add(gotoPublic);
+ publicHP.add(contentNoPublic);
+ siteBarHP.add(expandLabel);
+ siteBarHP.add(loginHyperlink);
+ siteBarHP.add(loggedUserHyperlink);
+ siteBarHP.add(pipeSeparatorHtml);
+ siteBarHP.add(logoutLabel);
+ siteBarHP.add(pipeSeparatorHtml2);
+ siteBarHP.add(newGroupHyperlink);
+ siteBarHP.add(spaceSeparator1);
+ siteBarHP.add(optionsButton);
+ siteBarHP.add(spaceSeparator2);
+ createSearchBox();
+ siteBarHP.add(logoImage);
- // Set properties
- siteBarHP.addStyleName("kune-SiteBarPanel");
- siteBarHP.setCellWidth(expandLabel, "100%");
- showProgress(i18n.t("Processing"));
- gotoPublic.addStyleName("kune-Margin-Medium-r");
- setContentPublic(true);
- gotoPublic.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- gotoPublic();
- }
- });
- gotoPublic.setTitle(i18n.t("Leave the workspace and go to the public space of this group")
- + Site.IN_DEVELOPMENT);
- gotoPublic.addStyleName("kune-SiteBarPanel-LabelLink");
- contentNoPublic.addStyleName("kune-Margin-Medium-r");
- newGroupHyperlink.setText(i18n.t("Create New Group"));
- newGroupHyperlink.setTargetHistoryToken(Site.NEWGROUP_TOKEN);
- loggedUserHyperlink.setVisible(false);
- pipeSeparatorHtml.setHTML("|");
- pipeSeparatorHtml.setStyleName("kune-SiteBarPanel-Separator");
- pipeSeparatorHtml2.setHTML("|");
- pipeSeparatorHtml2.setStyleName("kune-SiteBarPanel-Separator");
- loginHyperlink.setText(i18n.t("Sign in to collaborate"));
- loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
- logoutLabel.setText(i18n.t("Sign out"));
- logoutLabel.addStyleName("kune-SiteBarPanel-LabelLink");
- options.addItem(i18n.t("Options"), true, optionsSubmenu);
- options.setStyleName("kune-MenuBar");
- optionsButton.setColor("AAA");
- optionsButton.setHeight("16px");
- createOptionsSubmenu();
- addDefaultItemsToOptions();
+ // Set properties
+ siteBarHP.addStyleName("kune-SiteBarPanel");
+ siteBarHP.setCellWidth(expandLabel, "100%");
+ showProgress(i18n.t("Processing"));
+ gotoPublic.addStyleName("kune-Margin-Medium-r");
+ setContentPublic(true);
+ gotoPublic.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ gotoPublic();
+ }
+ });
+ gotoPublic.setTitle(i18n.t("Leave the workspace and go to the public space of this group")
+ + Site.IN_DEVELOPMENT);
+ gotoPublic.addStyleName("kune-SiteBarPanel-LabelLink");
+ contentNoPublic.addStyleName("kune-Margin-Medium-r");
+ newGroupHyperlink.setText(i18n.t("Create New Group"));
+ newGroupHyperlink.setTargetHistoryToken(Site.NEWGROUP_TOKEN);
+ loggedUserHyperlink.setVisible(false);
+ pipeSeparatorHtml.setHTML("|");
+ pipeSeparatorHtml.setStyleName("kune-SiteBarPanel-Separator");
+ pipeSeparatorHtml2.setHTML("|");
+ pipeSeparatorHtml2.setStyleName("kune-SiteBarPanel-Separator");
+ loginHyperlink.setText(i18n.t("Sign in to collaborate"));
+ loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
+ logoutLabel.setText(i18n.t("Sign out"));
+ logoutLabel.addStyleName("kune-SiteBarPanel-LabelLink");
+ options.addItem(i18n.t("Options"), true, optionsSubmenu);
+ options.setStyleName("kune-MenuBar");
+ optionsButton.setColor("AAA");
+ optionsButton.setHeight("16px");
+ createOptionsSubmenu();
+ addDefaultItemsToOptions();
- spaceSeparator1.setStyleName("kune-SiteBarPanel-SpaceSeparator");
- spaceSeparator2.setStyleName("kune-SiteBarPanel-SpaceSeparator");
+ spaceSeparator1.setStyleName("kune-SiteBarPanel-SpaceSeparator");
+ spaceSeparator2.setStyleName("kune-SiteBarPanel-SpaceSeparator");
- createListeners();
+ createListeners();
- // TODO: externalize this
- img.kuneLogo16px().applyTo(logoImage);
- this.hideProgress();
- extRootBody = new ExtElement(RootPanel.getBodyElement());
+ // TODO: externalize this
+ img.kuneLogo16px().applyTo(logoImage);
+ this.hideProgress();
+ extRootBody = new ExtElement(RootPanel.getBodyElement());
}
public void centerLoginDialog() {
- loginPanel.center();
+ loginPanel.center();
}
public void centerNewGroupDialog() {
- newGroupPanel.center();
+ newGroupPanel.center();
}
public void clearSearchText() {
- searchTextBox.setText("");
+ searchTextBox.setText("");
}
public void clearUserName() {
- loginHyperlink.setText(i18n.t("Sign in to collaborate"));
+ loginHyperlink.setText(i18n.t("Sign in to collaborate"));
}
public void gotoPublic() {
- Window.open(publicUrl, "_blank", "");
+ Window.open(publicUrl, "_blank", "");
}
public void hideLoginDialog() {
- loginPanel.hide();
+ loginPanel.hide();
}
public void hideNewGroupDialog() {
- newGroupPanel.hide();
+ newGroupPanel.hide();
}
public void hideProgress() {
- timeProgressMaxTime.cancel();
- progressPanel.setVisible(false);
- publicHP.setVisible(true);
+ timeProgressMaxTime.cancel();
+ progressPanel.setVisible(false);
+ publicHP.setVisible(true);
}
public void mask() {
- extRootBody.mask();
+ extRootBody.mask();
}
public void mask(final String message) {
- extRootBody.mask(message, "x-mask-loading");
+ extRootBody.mask(message, "x-mask-loading");
}
public void resetOptionsSubmenu() {
- optionsSubmenu.clearItems();
- addDefaultItemsToOptions();
+ optionsSubmenu.clearItems();
+ addDefaultItemsToOptions();
}
public void restoreLoginLink() {
- loginHyperlink.setVisible(true);
- loggedUserHyperlink.setVisible(false);
- loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
+ loginHyperlink.setVisible(true);
+ loggedUserHyperlink.setVisible(false);
+ loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
}
public void setContentGotoPublicUrl(final String publicUrl) {
- this.publicUrl = publicUrl;
+ this.publicUrl = publicUrl;
}
public void setContentPublic(boolean visible) {
- gotoPublic.setVisible(visible);
- contentNoPublic.setVisible(!visible);
+ gotoPublic.setVisible(visible);
+ contentNoPublic.setVisible(!visible);
}
public void setDefaultTextSearch() {
- searchTextBox.setText(i18n.t("Search"));
+ searchTextBox.setText(i18n.t("Search"));
}
public void setGroupsIsMember(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab) {
- optionsSubmenu.clearItems();
- yourGroupsSubmenu.clearItems();
+ optionsSubmenu.clearItems();
+ yourGroupsSubmenu.clearItems();
- int isAdminCount = groupsIsAdmin.size();
- int isCollabCount = groupsIsCollab.size();
- if (isAdminCount > 0 || isCollabCount > 0) {
- optionsSubmenu.addItem(i18n.t("My Groups") + " »", yourGroupsSubmenu);
- for (int i = 0; i < isAdminCount; i++) {
- final LinkDTO link = groupsIsAdmin.get(i);
- addItemToYourGroupSubmenu(link);
- }
- for (int i = 0; i < isCollabCount; i++) {
- final LinkDTO link = groupsIsCollab.get(i);
- addItemToYourGroupSubmenu(link);
- }
- }
- addDefaultItemsToOptions();
+ final int isAdminCount = groupsIsAdmin.size();
+ final int isCollabCount = groupsIsCollab.size();
+ if (isAdminCount > 0 || isCollabCount > 0) {
+ optionsSubmenu.addItem(i18n.t("My Groups") + " »", yourGroupsSubmenu);
+ for (int i = 0; i < isAdminCount; i++) {
+ final LinkDTO link = groupsIsAdmin.get(i);
+ addItemToYourGroupSubmenu(link);
+ }
+ for (int i = 0; i < isCollabCount; i++) {
+ final LinkDTO link = groupsIsCollab.get(i);
+ addItemToYourGroupSubmenu(link);
+ }
+ }
+ addDefaultItemsToOptions();
}
public void setLogo(final Image logo) {
- // TODO
+ // TODO
}
public void setLogoutLinkVisible(final boolean visible) {
- logoutLabel.setVisible(visible);
- pipeSeparatorHtml2.setVisible(visible);
+ logoutLabel.setVisible(visible);
+ pipeSeparatorHtml2.setVisible(visible);
}
public void setSearchText(final String text) {
- searchTextBox.setText(text);
+ searchTextBox.setText(text);
}
public void setTextSearchBig() {
- searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
}
public void setTextSearchSmall() {
- searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
}
public void showAlertMessage(final String message) {
- MessageBox.alert(i18n.t("Alert"), message, new MessageBox.AlertCallback() {
- public void execute() {
- // Do nothing
- }
- });
+ MessageBox.alert(i18n.t("Alert"), message, new MessageBox.AlertCallback() {
+ public void execute() {
+ // Do nothing
+ }
+ });
}
public void showLoggedUserName(final String name, final String homePage) {
- loginHyperlink.setVisible(false);
- loggedUserHyperlink.setVisible(true);
- loggedUserHyperlink.setText(name);
- loggedUserHyperlink.setTargetHistoryToken(homePage);
+ loginHyperlink.setVisible(false);
+ loggedUserHyperlink.setVisible(true);
+ loggedUserHyperlink.setText(name);
+ loggedUserHyperlink.setTargetHistoryToken(homePage);
}
public void showLoginDialog() {
- final Login login = SiteBarFactory.getLoginForm(presenter);
- loginPanel = (LoginPanel) login.getView();
- loginPanel.show();
+ final Login login = SiteBarFactory.getLoginForm(presenter);
+ loginPanel = (LoginPanel) login.getView();
+ loginPanel.show();
}
public void showNewGroupDialog() {
- final NewGroup newGroupForm = SiteBarFactory.getNewGroupForm(presenter);
- newGroupPanel = (NewGroupPanel) newGroupForm.getView();
- newGroupPanel.show();
- Site.hideProgress();
+ final NewGroup newGroupForm = SiteBarFactory.getNewGroupForm(presenter);
+ newGroupPanel = (NewGroupPanel) newGroupForm.getView();
+ newGroupPanel.show();
+ Site.hideProgress();
}
public void showProgress(final String text) {
- if (timeProgressMaxTime == null) {
- timeProgressMaxTime = new Timer() {
- public void run() {
- hideProgress();
- }
- };
- }
- timeProgressMaxTime.schedule(MAX_TIME_PROGRESS_BAR);
- publicHP.setVisible(false);
- progressPanel.setVisible(true);
- DOM.setInnerText(progressText.getElement(), text);
+ if (timeProgressMaxTime == null) {
+ timeProgressMaxTime = new Timer() {
+ public void run() {
+ hideProgress();
+ }
+ };
+ }
+ timeProgressMaxTime.schedule(MAX_TIME_PROGRESS_BAR);
+ publicHP.setVisible(false);
+ progressPanel.setVisible(true);
+ DOM.setInnerText(progressText.getElement(), text);
}
public void showSearchPanel(final String termToSearch) {
- final SearchSite search = SiteBarFactory.getSearch();
- search.doSearch(termToSearch);
- searchPanel = (SearchSitePanel) search.getView();
- searchPanel.show();
- Site.hideProgress();
+ final SearchSite search = SiteBarFactory.getSearch();
+ search.doSearch(termToSearch);
+ searchPanel = (SearchSitePanel) search.getView();
+ searchPanel.show();
+ Site.hideProgress();
}
public void unMask() {
- extRootBody.unmask();
+ extRootBody.unmask();
}
private void addDefaultItemsToOptions() {
- optionsSubmenu.addItem(linkHelpInTrans);
- optionsSubmenu.addItem(linkKuneBugs);
+ optionsSubmenu.addItem(linkHelpInTrans);
+ optionsSubmenu.addItem(linkKuneBugs);
}
private void addItemToYourGroupSubmenu(final LinkDTO link) {
- yourGroupsSubmenu.addItem(link.getShortName(), true, new Command() {
- public void execute() {
- presenter.changeState(new StateToken(link.getLink()));
- }
- });
+ yourGroupsSubmenu.addItem(link.getShortName(), true, new Command() {
+ public void execute() {
+ presenter.changeState(new StateToken(link.getLink()));
+ }
+ });
}
private void createListeners() {
- searchButton.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- Site.showProgressProcessing();
- presenter.doSearch(searchTextBox.getText());
- }
- });
- logoutLabel.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- Site.showProgressProcessing();
- presenter.doLogout();
- }
- });
- searchTextBox.addKeyboardListener(new KeyboardListener() {
- public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
- }
+ searchButton.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ });
+ logoutLabel.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ Site.showProgressProcessing();
+ presenter.doLogout();
+ }
+ });
+ searchTextBox.addKeyboardListener(new KeyboardListener() {
+ public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
+ }
- public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
- }
+ public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
+ }
- public void onKeyUp(final Widget widget, final char key, final int mod) {
- if (key == KEY_ENTER) {
- if (searchTextBox.getText().length() > 0) {
- Site.showProgressProcessing();
- presenter.doSearch(searchTextBox.getText());
- }
- }
- }
- });
+ public void onKeyUp(final Widget widget, final char key, final int mod) {
+ if (key == KEY_ENTER) {
+ if (searchTextBox.getText().length() > 0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ }
+ }
+ });
}
private void createOptionsSubmenu() {
- linkHelpInTrans = new MenuItem(img.language().getHTML() + i18n.t("Help with the translation"), true,
- new Command() {
- public void execute() {
- presenter.onHelpInTranslation();
- }
- });
- linkKuneBugs = new MenuItem(img.kuneIcon16().getHTML() + i18n.t("Report kune bugs"), true, new Command() {
- public void execute() {
- Window.open("http://code.google.com/p/kune/issues/list", "_blank", null);
- }
- });
- // linkHelp = new MenuItem(img.kuneIcon16().getHTML() +
- // i18n.t("Help"), true, new Command() {
- // public void execute() {
- // presenter.changeState(new StateToken("site.docs"));
- // }
- // });
+ linkHelpInTrans = new MenuItem(img.language().getHTML() + i18n.t("Help with the translation"), true,
+ new Command() {
+ public void execute() {
+ presenter.onHelpInTranslation();
+ }
+ });
+ linkKuneBugs = new MenuItem(img.kuneIcon16().getHTML() + i18n.t("Report kune bugs"), true, new Command() {
+ public void execute() {
+ Window.open("http://code.google.com/p/kune/issues/list", "_blank", null);
+ }
+ });
+ // linkHelp = new MenuItem(img.kuneIcon16().getHTML() +
+ // i18n.t("Help"), true, new Command() {
+ // public void execute() {
+ // presenter.changeState(new StateToken("site.docs"));
+ // }
+ // });
}
private void createSearchBox() {
- searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
- searchTextBox = new TextBox();
+ searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
+ searchTextBox = new TextBox();
- siteBarHP.add(searchButton);
- siteBarHP.add(searchTextBox);
+ siteBarHP.add(searchButton);
+ siteBarHP.add(searchTextBox);
- setTextSearchSmall();
- setDefaultTextSearch();
- searchTextBox.addFocusListener(new FocusListener() {
+ setTextSearchSmall();
+ setDefaultTextSearch();
+ searchTextBox.addFocusListener(new FocusListener() {
- public void onFocus(final Widget arg0) {
- presenter.onSearchFocus();
- }
+ public void onFocus(final Widget arg0) {
+ presenter.onSearchFocus();
+ }
- public void onLostFocus(final Widget arg0) {
- presenter.onSearchLostFocus(searchTextBox.getText());
- }
- });
+ public void onLostFocus(final Widget arg0) {
+ presenter.onSearchLostFocus(searchTextBox.getText());
+ }
+ });
}
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.ui.newtmp;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
+
+public class WorkspaceManager {
+
+ private final EntityLogo entityLogo;
+ private final EntityTitlePresenter entityTitlePresenter;
+ private final WsThemePresenter wsThemePresenter;
+
+ public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
+ final WsThemePresenter wsThemePresenter) {
+ this.entityLogo = entityLogo;
+ this.entityTitlePresenter = entityTitlePresenter;
+ this.wsThemePresenter = wsThemePresenter;
+ }
+
+ public void setState(final StateDTO state) {
+ final GroupDTO group = state.getGroup();
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+ entityLogo.setLogo(group.getLongName());
+ entityLogo.setPutYourLogoVisible(isAdmin);
+ entityTitlePresenter.setState(state);
+ // Only for probes:
+ wsThemePresenter.setVisible(true);
+ }
+
+ public void setTheme(final WsTheme theme) {
+ entityLogo.setTheme(theme);
+ entityTitlePresenter.setTheme(theme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,40 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class AbstractBar extends Composite {
+ private final HorizontalPanel horPanel;
+
+ public AbstractBar() {
+ horPanel = new HorizontalPanel();
+ horPanel.setWidth("100%");
+ initWidget(horPanel);
+ }
+
+ public void add(final Widget widget) {
+ horPanel.add(widget);
+ }
+
+ public void addFill() {
+ final Label emptyLabel = new Label("");
+ horPanel.add(emptyLabel);
+ horPanel.setCellWidth(emptyLabel, "100%");
+ }
+
+ public void addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ horPanel.add(emptyLabel);
+ }
+
+ public void addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ horPanel.add(emptyLabel);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,40 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.gwtext.client.widgets.Panel;
+
+public class Entity extends DefaultBorderLayout {
+
+ private final EntityWorkspace entityWorkspace;
+ private final EntitySummary entitySummary;
+ private final Panel entityMainHeader;
+
+ public Entity() {
+ entityMainHeader = new Panel();
+ entityMainHeader.setBorder(false);
+ entitySummary = new EntitySummary();
+ entityWorkspace = new EntityWorkspace();
+ add(entityMainHeader, DefaultBorderLayout.Position.NORTH, 65);
+ add(entityWorkspace.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(entitySummary.getPanel(), DefaultBorderLayout.Position.EAST, true, 150);
+ }
+
+ public Panel getEntityMainHeader() {
+ return entityMainHeader;
+ }
+
+ public EntitySummary getEntitySummary() {
+ return entitySummary;
+ }
+
+ public EntityWorkspace getEntityWorkspace() {
+ return entityWorkspace;
+ }
+
+ public void setTheme(final WsTheme theme) {
+ super.setCls("k-entity-" + theme);
+ entityWorkspace.setTheme(theme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,47 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+
+public class EntitySummary {
+ private final Panel entityTools;
+ private final Panel entitySummary;
+ private final DefaultBorderLayout mainPanel;
+ private final Toolbar trayBar;
+
+ public EntitySummary() {
+ mainPanel = new DefaultBorderLayout();
+ entityTools = new Panel();
+ entitySummary = new Panel();
+ entitySummary.setCls("k-entity-summary");
+ entityTools.setBorder(false);
+ entitySummary.setBorder(false);
+ entityTools.setAutoScroll(false);
+ entitySummary.setAutoScroll(true);
+ trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
+ mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
+ mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
+ }
+
+ public void addInSummary(final Widget widget) {
+ entitySummary.add(widget);
+ mainPanel.doLayoutIfNeeded();
+ }
+
+ public void addInTools(final Widget widget) {
+ entityTools.add(widget);
+ mainPanel.doLayoutIfNeeded();
+ }
+
+ public Panel getPanel() {
+ return mainPanel.getPanel();
+ }
+
+ public Toolbar getSiteTraybar() {
+ return trayBar;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,132 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.AnchorLayout;
+import com.gwtext.client.widgets.layout.AnchorLayoutData;
+
+public class EntityWorkspace extends DefaultBorderLayout {
+ private final Panel content;
+ private final Panel container;
+ private final TitleBar title;
+ private final TitleBar subTitle;
+ private final TitleBar bottom;
+ private final Toolbar contentTopBar;
+ private final Toolbar contentBottomBar;
+ private final Toolbar containerTopBar;
+ private final Toolbar containerBottomBar;
+ private final RoundedPanel roundedTitle;
+ private final RoundedPanel roundedBottom;
+ private final DefaultBorderLayout containerWrap;
+
+ public EntityWorkspace() {
+ final Panel titles = new Panel();
+ titles.setBorder(false);
+ titles.setLayout(new AnchorLayout());
+ final Panel bottomPanel = new Panel();
+ bottomPanel.setBorder(false);
+ bottomPanel.setLayout(new AnchorLayout());
+
+ title = new TitleBar();
+ title.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
+ title.setStylePrimaryName("k-entity-title");
+ subTitle = new TitleBar();
+ subTitle.setStylePrimaryName("k-entity-subtitle");
+ bottom = new TitleBar();
+ bottom.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
+ bottom.setStylePrimaryName("k-entity-bottom");
+
+ roundedTitle = new RoundedPanel(title, RoundedPanel.TOPLEFT, 2);
+ roundedBottom = new RoundedPanel(bottom, RoundedPanel.BOTTOMLEFT, 2);
+
+ titles.add(roundedTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ titles.add(subTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+
+ final DefaultBorderLayout contentWrap = new DefaultBorderLayout();
+ containerWrap = new DefaultBorderLayout();
+ contentWrap.setBorder(true);
+ containerWrap.setBorder(true);
+ content = new Panel();
+ container = new Panel();
+ content.setBorder(false);
+ container.setBorder(false);
+ container.setCollapsible(true);
+ content.setPaddings(5);
+ container.setPaddings(5);
+ content.setAutoScroll(true);
+ container.setAutoScroll(true);
+
+ contentTopBar = new Toolbar();
+ contentBottomBar = new Toolbar();
+ containerTopBar = new Toolbar();
+ containerBottomBar = new Toolbar();
+ contentTopBar.addClass("k-toolbar-bottom-line");
+ contentBottomBar.addClass("k-toolbar-top-line");
+ containerTopBar.addClass("k-toolbar-bottom-line");
+ containerBottomBar.addClass("k-toolbar-top-line");
+ contentWrap.add(contentTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ containerWrap.add(containerTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ contentWrap.add(content, Position.CENTER);
+ containerWrap.add(container, Position.CENTER);
+ contentWrap.add(contentBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+ containerWrap.add(containerBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+
+ add(titles, DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT * 2);
+ add(contentWrap.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(containerWrap.getPanel(), DefaultBorderLayout.Position.EAST, true, 175);
+ add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT);
+ }
+
+ public TitleBar getBottomTitle() {
+ return bottom;
+ }
+
+ public Toolbar getContainerBottomBar() {
+ return containerBottomBar;
+ }
+
+ public Toolbar getContainerTopBar() {
+ return containerTopBar;
+ }
+
+ public Toolbar getContentBottomBar() {
+ return contentBottomBar;
+ }
+
+ public Toolbar getContentTopBar() {
+ return contentTopBar;
+ }
+
+ public TitleBar getSubTitle() {
+ return subTitle;
+ }
+
+ public TitleBar getTitle() {
+ return title;
+ }
+
+ public void setContainer(final View view) {
+ setPanel(container, (Widget) view);
+ }
+
+ public void setContent(final View view) {
+ setPanel(content, (Widget) view);
+ }
+
+ public void setTheme(final WsTheme theme) {
+ final String themeS = theme.toString();
+ super.setCls("k-entityworkspace-" + theme);
+ roundedTitle.setCornerStyleName("k-entity-title-rd-" + theme);
+ roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + theme);
+ title.addStyleDependentName(themeS);
+ subTitle.addStyleDependentName(themeS);
+ bottom.addStyleDependentName(themeS);
+ container.setStyleName("k-entity-container-" + theme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class SiteBar extends Panel {
+
+ private final TitleBar titleBar;
+
+ public SiteBar() {
+ super.setBorder(false);
+ titleBar = new TitleBar();
+ titleBar.setStyleName("k-sitebar");
+ super.add(titleBar);
+ }
+
+ public void add(final Widget widget) {
+ titleBar.add(widget);
+ }
+
+ public void addFill() {
+ titleBar.addFill();
+ }
+
+ public void addSeparator() {
+ titleBar.addSeparator();
+ }
+
+ public void addSpacer() {
+ titleBar.addSpacer();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+public class TitleBar extends AbstractBar {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,52 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class Toolbar {
+ private final Panel container;
+ private final AbstractBar horPanel;
+
+ public Toolbar() {
+ container = new Panel();
+ container.setBorder(false);
+ container.setBodyBorder(false);
+ container.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ container.setWidth("100%");
+ container.setHeader(false);
+ container.setBaseCls("x-toolbar");
+ container.addClass("x-panel");
+ horPanel = new AbstractBar();
+ container.add(horPanel);
+ }
+
+ public void add(final Widget widget) {
+ horPanel.add(widget);
+ if (container.isRendered()) {
+ container.doLayout(false);
+ }
+ }
+
+ public void addClass(final String cls) {
+ container.addClass(cls);
+ }
+
+ public void addFill() {
+ horPanel.addFill();
+ }
+
+ public void addSeparator() {
+ horPanel.addSeparator();
+ }
+
+ public void addSpacer() {
+ horPanel.addSpacer();
+ }
+
+ public Panel getPanel() {
+ return container;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,58 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.Viewport;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class WorkspaceSkeleton {
+ private final Entity entity;
+ private final SiteBar sitebar;
+ private final DefaultBorderLayout mainPanel;
+ private final Panel container;
+
+ public WorkspaceSkeleton() {
+ container = new Panel();
+ container.setLayout(new FitLayout());
+ container.setBorder(false);
+ container.setPaddings(5);
+ mainPanel = new DefaultBorderLayout();
+ sitebar = new SiteBar();
+ entity = new Entity();
+ mainPanel.add(sitebar, DefaultBorderLayout.Position.NORTH, DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ mainPanel.add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
+ container.add(mainPanel.getPanel());
+ }
+
+ public Panel getEntityMainHeader() {
+ return entity.getEntityMainHeader();
+ }
+
+ public EntitySummary getEntitySummary() {
+ return entity.getEntitySummary();
+ }
+
+ public EntityWorkspace getEntityWorkspace() {
+ return entity.getEntityWorkspace();
+ }
+
+ public SiteBar getSiteBar() {
+ return sitebar;
+ }
+
+ public Toolbar getSiteTraybar() {
+ return entity.getEntitySummary().getSiteTraybar();
+ }
+
+ public void setTheme(final WsTheme theme) {
+ entity.setTheme(theme);
+ }
+
+ public void show() {
+ new Viewport(container);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+public enum WsTheme {
+ def, green, blue, grey, purple, red
+}
Added: 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-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.MenuItem;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class WsThemePanel extends ToolbarButton implements WsThemeView {
+
+ private final Menu menu;
+
+ public WsThemePanel(final WorkspaceSkeleton ws) {
+ menu = new Menu();
+ for (final WsTheme theme : WsTheme.values()) {
+ final MenuItem item = new MenuItem();
+ item.setText(theme.toString());
+ menu.addItem(item);
+ item.addListener(new BaseItemListenerAdapter() {
+ public void onActivate(final BaseItem item) {
+ ws.setTheme(theme);
+ }
+ });
+ }
+ menu.setDefaultAlign("br-tr");
+ super.setMenu(menu);
+ ws.getSiteTraybar().addButton(this);
+ }
+
+ public void setVisible(final boolean visible) {
+ menu.setVisible(visible);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+public class WsThemePresenter {
+
+ private WsThemeView view;
+
+ public void init(final WsThemeView view) {
+ this.view = view;
+ }
+
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+public interface WsThemeView {
+
+ void setVisible(boolean visible);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,79 @@
+/*
+ *
+ * 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.ui.EditableClickListener;
+import org.ourproject.kune.platf.client.ui.EditableIconLabel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class EntityTitlePanel implements EntityTitleView {
+ private final EditableIconLabel titleLabel;
+ private final Label dateLabel;
+
+ public EntityTitlePanel(final WorkspaceSkeleton ws, final EntityTitlePresenter presenter) {
+ titleLabel = new EditableIconLabel(new EditableClickListener() {
+ public void onEdited(final String text) {
+ presenter.onTitleRename(text);
+ }
+ });
+ dateLabel = new Label();
+
+ final TitleBar wsTitle = ws.getEntityWorkspace().getTitle();
+ wsTitle.add(titleLabel);
+ wsTitle.addFill();
+ wsTitle.add(dateLabel);
+ titleLabel.addStyleName("kune-Margin-Large-l");
+ titleLabel.addStyleName("kune-ft17px");
+ dateLabel.addStyleName("kune-Margin-Large-r");
+ dateLabel.addStyleName("kune-ft12px");
+ titleLabel.addStyleName("kune-ContentTitleBar-l");
+ dateLabel.addStyleName("kune-ContentTitleBar-r");
+ }
+
+ public void restoreOldTitle() {
+ titleLabel.restoreOldText();
+ }
+
+ public void setContentDate(final String date) {
+ dateLabel.setText(date);
+ }
+
+ public void setContentTitle(final String title) {
+ titleLabel.setText(title);
+ }
+
+ public void setContentTitleEditable(final boolean editable) {
+ titleLabel.setEditable(editable);
+ }
+
+ public void setDateVisible(final boolean visible) {
+ dateLabel.setVisible(visible);
+
+ }
+
+ public void setTheme(final WsTheme theme) {
+
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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.ui.newtmp.title;
+
+import java.util.Date;
+
+import org.ourproject.kune.docs.client.actions.DocsEvents;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.rpc.ParamCallback;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class EntityTitlePresenter {
+
+ private EntityTitleView view;
+ private final I18nTranslationService i18n;
+ private final KuneErrorHandler errorHandler;
+
+ public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler) {
+ this.i18n = i18n;
+ this.errorHandler = errorHandler;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityTitleView view) {
+ this.view = view;
+ }
+
+ public void onTitleRename(final String text) {
+ Site.showProgressSaving();
+ final AsyncCallback<String> callback = new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ view.restoreOldTitle();
+ errorHandler.process(caught);
+ }
+
+ public void onSuccess(final String result) {
+ Site.hideProgress();
+ view.setContentTitle(result);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ }
+ };
+ DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
+ new ParamCallback<String, String>(text, callback));
+ }
+
+ public void setState(final StateDTO state) {
+ if (state.hasDocument()) {
+ setContentTitle(state.getTitle(), state.getContentRights().isEditable());
+ setContentDateVisible(true);
+ setContentDate(state.getPublishedOn());
+ } else {
+ if (state.getFolder().getParentFolderId() == null) {
+ // We translate root folder names (documents, chat room,
+ // etcetera)
+ setContentTitle(i18n.t(state.getTitle()), false);
+ } else {
+ setContentTitle(state.getTitle(), state.getContentRights().isEditable());
+ }
+ setContentDateVisible(false);
+ }
+ }
+
+ public void setTheme(final WsTheme theme) {
+ view.setTheme(theme);
+ }
+
+ private void setContentDate(final Date publishedOn) {
+ final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
+ view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
+ }
+
+ private void setContentDateVisible(final boolean visible) {
+ view.setDateVisible(visible);
+ }
+
+ private void setContentTitle(final String title, final boolean editable) {
+ view.setContentTitle(title);
+ view.setContentTitleEditable(editable);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface EntityTitleView extends View {
+
+ void restoreOldTitle();
+
+ void setContentDate(String date);
+
+ void setContentTitle(String title);
+
+ void setContentTitleEditable(boolean editable);
+
+ void setDateVisible(boolean visible);
+
+ void setTheme(WsTheme theme);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.workspace.ui;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Image;
+
+public interface EntityLogo {
+
+ public abstract void setLogo(final Image image);
+
+ public abstract void setLogo(final String groupName);
+
+ public abstract void setPutYourLogoVisible(final boolean visible);
+
+ public abstract void setTheme(final WsTheme theme);
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,120 @@
+/*
+ *
+ * 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.ui;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class EntityLogoPanel extends SimplePanel implements EntityLogo {
+ class EntityTextLogo extends VerticalPanel {
+
+ private static final int GROUP_NAME_LIMIT_SIZE = 90;
+ private static final String LOGO_SMALL_FONT_SIZE = "108%";
+ private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
+ private final Label defTextLogoLabel;
+ private final Hyperlink defTextPutYourLogoHL;
+ private final HorizontalPanel putYourLogoHP;
+
+ public EntityTextLogo() {
+ // Initialize
+ super();
+ defTextLogoLabel = new Label();
+ final HTML expandCell = new HTML("<b></b>");
+ putYourLogoHP = new HorizontalPanel();
+ defTextPutYourLogoHL = new Hyperlink();
+
+ // Layout
+ add(defTextLogoLabel);
+ add(putYourLogoHP);
+ putYourLogoHP.add(expandCell);
+ putYourLogoHP.add(defTextPutYourLogoHL);
+
+ // Set properties
+ // TODO: Put your logo here functionality
+ defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
+ expandCell.setWidth("100%");
+ putYourLogoHP.setCellWidth(expandCell, "100%");
+ // TODO: link to configure the logo
+ setStylePrimaryName("k-entitytextlogo");
+ setDefaultText("");
+ }
+
+ public void setDefaultText(final String text) {
+ if (text.length() > GROUP_NAME_LIMIT_SIZE) {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
+ } else {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
+ }
+ defTextLogoLabel.setText(text);
+
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ putYourLogoHP.setVisible(visible);
+ }
+
+ }
+
+ private EntityTextLogo entityTextLogo;
+ private final I18nTranslationService i18n;
+
+ public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ ws.getEntityMainHeader().add(this);
+ }
+
+ public void setLogo(final Image image) {
+ clear();
+ add(image);
+ }
+
+ public void setLogo(final String groupName) {
+ clear();
+ add(getEntityTextLogo());
+ entityTextLogo.setDefaultText(groupName);
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ getEntityTextLogo().setPutYourLogoVisible(visible);
+ }
+
+ public void setTheme(final WsTheme theme) {
+ getEntityTextLogo().addStyleDependentName(theme.toString());
+ }
+
+ private EntityTextLogo getEntityTextLogo() {
+ if (entityTextLogo == null) {
+ this.entityTextLogo = new EntityTextLogo();
+ }
+ return entityTextLogo;
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -1,122 +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.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-class GroupLogoPanel extends SimplePanel {
- class EntityTextLogo extends VerticalPanel {
-
- private static final int GROUP_NAME_LIMIT_SIZE = 90;
- private static final String LOGO_SMALL_FONT_SIZE = "108%";
- private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
- private Label defTextLogoLabel = null;
- private Hyperlink defTextPutYourLogoHL = null;
- private final HorizontalPanel putYourLogoHP;
-
- public EntityTextLogo() {
- // Initialize
- super();
- defTextLogoLabel = new Label();
- HTML expandCell = new HTML("<b></b>");
- putYourLogoHP = new HorizontalPanel();
- defTextPutYourLogoHL = new Hyperlink();
-
- // Layout
- add(defTextLogoLabel);
- add(putYourLogoHP);
- putYourLogoHP.add(expandCell);
- putYourLogoHP.add(defTextPutYourLogoHL);
-
- // Set properties
- // TODO: Put your logo here functionality
- defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
- expandCell.setWidth("100%");
- putYourLogoHP.setCellWidth(expandCell, "100%");
- // TODO: link to configure the logo
- addStyleName("kune-EntityTextLogo");
- setDefaultText("");
- }
-
- public void setDefaultText(final String text) {
- if (text.length() > GROUP_NAME_LIMIT_SIZE) {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
- } else {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
- }
- defTextLogoLabel.setText(text);
-
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- putYourLogoHP.setVisible(visible);
-
- }
-
- public void setTextColor(final String color) {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "color", color);
- }
- }
-
- private EntityTextLogo entityTextLogo;
- private final I18nTranslationService i18n;
-
- public GroupLogoPanel(final I18nTranslationService i18n) {
- this.i18n = i18n;
- }
-
- public void setLogo(final Image image) {
- clear();
- add(image);
- }
-
- public void setLogo(final String groupName) {
- clear();
- add(getEntityTextLogo());
- entityTextLogo.setDefaultText(groupName);
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- entityTextLogo.setPutYourLogoVisible(visible);
-
- }
-
- public void setTextColor(final String color) {
- this.entityTextLogo.setTextColor(color);
- }
-
- private EntityTextLogo getEntityTextLogo() {
- if (entityTextLogo == null) {
- this.entityTextLogo = new EntityTextLogo();
- }
- return entityTextLogo;
- }
-
-}
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-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -51,7 +51,7 @@
private static final int DEF_CONTEXT_WIDTH = 175;
private static final Images img = Images.App.getInstance();
- private final GroupLogoPanel groupLogoPanel;
+ // private final EntityLogoPanel groupLogoPanel;
private final HorizontalPanel contentTitleBarHP;
private final HorizontalPanel contentSubTitleBarHP;
private final GroupToolsBar groupToolsBar;
@@ -83,288 +83,288 @@
private final WorkspacePresenter presenter;
public WorkspacePanel(final WorkspacePresenter presenter, final I18nTranslationService i18n,
- final ColorTheme colorTheme) {
- this.presenter = presenter;
- this.colorTheme = colorTheme;
- // Initialize
- final VerticalPanel generalVP = new VerticalPanel();
- initWidget(generalVP);
- groupLogoPanel = new GroupLogoPanel(i18n);
- final HorizontalPanel generalHP = new HorizontalPanel();
- cntcxtVP = new VerticalPanel();
- final VerticalPanel groupNavBarVP = new VerticalPanel();
- groupToolsBar = new GroupToolsBar(colorTheme);
- bottomIconsTrayPanel = new BottomIconsTrayPanel();
- groupDropDownsSP = new ScrollPanel();
- groupDropDownsVP = new VerticalPanel();
- contentTitleBarHP = new HorizontalPanel();
- contentTitleBarBorderDec = new RoundedBorderDecorator(contentTitleBarHP, RoundedBorderDecorator.TOPLEFT);
- contentSubTitleBarHP = new HorizontalPanel();
- contentToolBarHP = new HorizontalPanel();
- cntcxtHSP = new CustomHorizontalSplitPanel(new HorizontalSplitPanelImages() {
- public AbstractImagePrototype horizontalSplitPanelThumb() {
- return img.splitterVertBar();
- }
- });
- cntcxtHSP.addChangeListener(new ChangeListener() {
- public void onChange(final Widget sender) {
- adjustSizeContentSP();
- saveCurrentRightWidgetWidth(cntcxtHSP.getRightWidgetAvailableWidth());
- }
- });
- cntcxtHSP.addSplitterListener(new SplitterListener() {
- public void onStartResizing(final Widget sender) {
- presenter.onSplitterStartResizing(sender);
- }
+ final ColorTheme colorTheme) {
+ this.presenter = presenter;
+ this.colorTheme = colorTheme;
+ // Initialize
+ final VerticalPanel generalVP = new VerticalPanel();
+ initWidget(generalVP);
+ // groupLogoPanel = new EntityLogoPanel(i18n);
+ final HorizontalPanel generalHP = new HorizontalPanel();
+ cntcxtVP = new VerticalPanel();
+ final VerticalPanel groupNavBarVP = new VerticalPanel();
+ groupToolsBar = new GroupToolsBar(colorTheme);
+ bottomIconsTrayPanel = new BottomIconsTrayPanel();
+ groupDropDownsSP = new ScrollPanel();
+ groupDropDownsVP = new VerticalPanel();
+ contentTitleBarHP = new HorizontalPanel();
+ contentTitleBarBorderDec = new RoundedBorderDecorator(contentTitleBarHP, RoundedBorderDecorator.TOPLEFT);
+ contentSubTitleBarHP = new HorizontalPanel();
+ contentToolBarHP = new HorizontalPanel();
+ cntcxtHSP = new CustomHorizontalSplitPanel(new HorizontalSplitPanelImages() {
+ public AbstractImagePrototype horizontalSplitPanelThumb() {
+ return img.splitterVertBar();
+ }
+ });
+ cntcxtHSP.addChangeListener(new ChangeListener() {
+ public void onChange(final Widget sender) {
+ adjustSizeContentSP();
+ saveCurrentRightWidgetWidth(cntcxtHSP.getRightWidgetAvailableWidth());
+ }
+ });
+ cntcxtHSP.addSplitterListener(new SplitterListener() {
+ public void onStartResizing(final Widget sender) {
+ presenter.onSplitterStartResizing(sender);
+ }
- public void onStopResizing(final Widget sender) {
- presenter.onSplitterStopResizing(sender);
- }
- });
- contentVP = new VerticalPanel();
- contextVP = new VerticalPanel();
- contentSP = new ScrollPanel();
- contentBottomToolBarHP = new HorizontalPanel();
- contentBottomBarHP = new HorizontalPanel();
- bottomBorderDecorator = new RoundedBorderDecorator(contentBottomBarHP, RoundedBorderDecorator.BOTTOMLEFT);
+ public void onStopResizing(final Widget sender) {
+ presenter.onSplitterStopResizing(sender);
+ }
+ });
+ contentVP = new VerticalPanel();
+ contextVP = new VerticalPanel();
+ contentSP = new ScrollPanel();
+ contentBottomToolBarHP = new HorizontalPanel();
+ contentBottomBarHP = new HorizontalPanel();
+ bottomBorderDecorator = new RoundedBorderDecorator(contentBottomBarHP, RoundedBorderDecorator.BOTTOMLEFT);
- // Layout
- generalVP.add(groupLogoPanel);
- generalVP.add(generalHP);
- generalHP.add(cntcxtVP);
- generalHP.add(groupNavBarVP);
- groupNavBarVP.add(groupToolsBar);
- groupNavBarVP.add(groupDropDownsSP);
- groupNavBarVP.add(bottomIconsTrayPanel);
- groupDropDownsSP.add(groupDropDownsVP);
- cntcxtVP.add(contentTitleBarBorderDec);
- cntcxtVP.add(contentSubTitleBarHP);
- cntcxtVP.add(cntcxtHSP);
- cntcxtHSP.setLeftWidget(contentVP);
- cntcxtHSP.setRightWidget(contextVP);
- cntcxtVP.add(bottomBorderDecorator);
- contentVP.add(contentToolBarHP);
- contentVP.add(contentSP);
- contentVP.add(contentBottomToolBarHP);
+ // Layout
+ // generalVP.add(groupLogoPanel);
+ generalVP.add(generalHP);
+ generalHP.add(cntcxtVP);
+ generalHP.add(groupNavBarVP);
+ groupNavBarVP.add(groupToolsBar);
+ groupNavBarVP.add(groupDropDownsSP);
+ groupNavBarVP.add(bottomIconsTrayPanel);
+ groupDropDownsSP.add(groupDropDownsVP);
+ cntcxtVP.add(contentTitleBarBorderDec);
+ cntcxtVP.add(contentSubTitleBarHP);
+ cntcxtVP.add(cntcxtHSP);
+ cntcxtHSP.setLeftWidget(contentVP);
+ cntcxtHSP.setRightWidget(contextVP);
+ cntcxtVP.add(bottomBorderDecorator);
+ contentVP.add(contentToolBarHP);
+ contentVP.add(contentSP);
+ contentVP.add(contentBottomToolBarHP);
- contentVP.addStyleName("kune-WorkspacePanel-Content");
- contextVP.addStyleName("kune-WorkspacePanel-Context");
- contentVP.setWidth("100%");
- contextVP.setWidth("100%");
- contextVP.setHeight("100%");
+ contentVP.addStyleName("kune-WorkspacePanel-Content");
+ contextVP.addStyleName("kune-WorkspacePanel-Context");
+ contentVP.setWidth("100%");
+ contextVP.setWidth("100%");
+ contextVP.setHeight("100%");
- // Set properties
- addStyleName("kune-WorkspacePanel");
- setGroupLogo("");
- generalHP.addStyleName("GeneralHP");
- contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder());
- contentTitleBarHP.setWidth("100%");
- contentSubTitleBarHP.setWidth("100%");
- contentTitleBarHP.addStyleName("kune-ContentTitleBar");
- contentSubTitleBarHP.addStyleName("kune-ContentSubTitleBar");
- contentToolBarHP.setWidth("100%");
- cntcxtVP.addStyleName("ContextPanel");
- cntcxtVP.setCellVerticalAlignment(contentTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(contentSubTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(bottomBorderDecorator, VerticalPanel.ALIGN_MIDDLE);
- contentTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentSubTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentBottomToolBarHP.setWidth("100%");
- contentBottomBarHP.addStyleName("kune-ContentBottomBar");
- contentBottomBarHP.addStyleName("kune-ft12px");
- groupDropDownsVP.addStyleName("kune-GroupSummaryPanel");
- bottomBorderDecorator.setColor(colorTheme.getContentMainBorder());
- bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l");
- bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel");
- bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
- bottomIconsTrayPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- previousRightWidgetWidth = DEF_CONTEXT_WIDTH;
+ // Set properties
+ addStyleName("kune-WorkspacePanel");
+ setGroupLogo("");
+ generalHP.addStyleName("GeneralHP");
+ contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder());
+ contentTitleBarHP.setWidth("100%");
+ contentSubTitleBarHP.setWidth("100%");
+ contentTitleBarHP.addStyleName("kune-ContentTitleBar");
+ contentSubTitleBarHP.addStyleName("kune-ContentSubTitleBar");
+ contentToolBarHP.setWidth("100%");
+ cntcxtVP.addStyleName("ContextPanel");
+ cntcxtVP.setCellVerticalAlignment(contentTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
+ cntcxtVP.setCellVerticalAlignment(contentSubTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
+ cntcxtVP.setCellVerticalAlignment(bottomBorderDecorator, VerticalPanel.ALIGN_MIDDLE);
+ contentTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ contentSubTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ contentBottomToolBarHP.setWidth("100%");
+ contentBottomBarHP.addStyleName("kune-ContentBottomBar");
+ contentBottomBarHP.addStyleName("kune-ft12px");
+ groupDropDownsVP.addStyleName("kune-GroupSummaryPanel");
+ bottomBorderDecorator.setColor(colorTheme.getContentMainBorder());
+ bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l");
+ bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel");
+ bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
+ bottomIconsTrayPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ previousRightWidgetWidth = DEF_CONTEXT_WIDTH;
}
public void addBottomIconComponent(final View view) {
- bottomIconsTrayPanel.add((Widget) view);
+ bottomIconsTrayPanel.add((Widget) view);
}
public void addTab(final ToolTrigger trigger) {
- groupToolsBar.addItem(trigger);
+ groupToolsBar.addItem(trigger);
}
public void adjustSize(final int windowWidth, final int windowHeight) {
- final int contentWidth = windowWidth - 184;
- final int contentHeight = windowHeight - 176;
+ final int contentWidth = windowWidth - 184;
+ final int contentHeight = windowHeight - 176;
- // FireLog.debug("w1: " + windowWidth + ", h1: " + windowHeight);
- // FireLog.debug("w2: " + contentWidth + ", h2: " + contentHeight);
- // FireLog.debug("sp1: " + previousRightWidgetWidth);
- cntcxtHSP.setSize("" + contentWidth + "px", "" + contentHeight + "px");
- if (contentWidth > previousRightWidgetWidth) {
- cntcxtHSP.setSplitPosition("" + (contentWidth - previousRightWidgetWidth - 6) + "px");
- saveCurrentRightWidgetWidth(previousRightWidgetWidth);
- } else {
- setDefaultSplitterPosition();
- }
- adjustSizeContentSP();
+ // FireLog.debug("w1: " + windowWidth + ", h1: " + windowHeight);
+ // FireLog.debug("w2: " + contentWidth + ", h2: " + contentHeight);
+ // FireLog.debug("sp1: " + previousRightWidgetWidth);
+ cntcxtHSP.setSize("" + contentWidth + "px", "" + contentHeight + "px");
+ if (contentWidth > previousRightWidgetWidth) {
+ cntcxtHSP.setSplitPosition("" + (contentWidth - previousRightWidgetWidth - 6) + "px");
+ saveCurrentRightWidgetWidth(previousRightWidgetWidth);
+ } else {
+ setDefaultSplitterPosition();
+ }
+ adjustSizeContentSP();
- final int bottomMarginForTray = 35;
- final int distanceFromTop = 89;
- final int groupDropDownsHeight = windowHeight - groupToolsBar.getOffsetHeight() - distanceFromTop
- - bottomMarginForTray;
- groupDropDownsSP.setHeight("" + groupDropDownsHeight + "px");
+ final int bottomMarginForTray = 35;
+ final int distanceFromTop = 89;
+ final int groupDropDownsHeight = windowHeight - groupToolsBar.getOffsetHeight() - distanceFromTop
+ - bottomMarginForTray;
+ groupDropDownsSP.setHeight("" + groupDropDownsHeight + "px");
}
public void registerUIExtensionPoints() {
- presenter.registerExtensibleWidgets(contentToolBarPanel.getExtensionPoints());
- presenter.registerExtensibleWidget(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, bottomIconsTrayPanel);
+ presenter.registerExtensibleWidgets(contentToolBarPanel.getExtensionPoints());
+ presenter.registerExtensibleWidget(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, bottomIconsTrayPanel);
}
public void setBottom(final View view) {
- bottomPanel = (LicensePanel) view;
- contentBottomBarHP.add(bottomPanel);
- contentBottomBarHP.setCellVerticalAlignment(bottomPanel, VerticalPanel.ALIGN_MIDDLE);
+ bottomPanel = (LicensePanel) view;
+ contentBottomBarHP.add(bottomPanel);
+ contentBottomBarHP.setCellVerticalAlignment(bottomPanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setComponents(final WorkspaceUIComponents components) {
- setContentTitle(components.getContentTitleComponent().getView());
- setContentSubTitle(components.getContentSubTitleComponent().getView());
- setContentToolBar(components.getContentToolBarComponent().getView());
- setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
- setBottom(components.getLicenseComponent().getView());
- setGroupMembers(components.getGroupMembersComponent().getView());
- setParticipation(components.getParticipationComponent().getView());
- setTags(components.getTagsComponent().getView());
- setSummary(components.getGroupSummaryComponent().getView());
- addBottomIconComponent(components.getThemeMenuComponent().getView());
+ setContentTitle(components.getContentTitleComponent().getView());
+ setContentSubTitle(components.getContentSubTitleComponent().getView());
+ setContentToolBar(components.getContentToolBarComponent().getView());
+ setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
+ setBottom(components.getLicenseComponent().getView());
+ setGroupMembers(components.getGroupMembersComponent().getView());
+ setParticipation(components.getParticipationComponent().getView());
+ setTags(components.getTagsComponent().getView());
+ setSummary(components.getGroupSummaryComponent().getView());
+ addBottomIconComponent(components.getThemeMenuComponent().getView());
}
public void setContent(final View content) {
- contentSP.clear();
- final Widget widget = (Widget) content;
- contentSP.add(widget);
+ contentSP.clear();
+ final Widget widget = (Widget) content;
+ contentSP.add(widget);
}
public void setContentBottomToolBar(final View view) {
- contentBottomToolBarPanel = (ContentBottomToolBarPanel) view;
- contentBottomToolBarHP.add(contentBottomToolBarPanel);
- contentBottomToolBarHP.setCellVerticalAlignment(contentBottomToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
+ contentBottomToolBarPanel = (ContentBottomToolBarPanel) view;
+ contentBottomToolBarHP.add(contentBottomToolBarPanel);
+ contentBottomToolBarHP.setCellVerticalAlignment(contentBottomToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContentSubTitle(final View view) {
- contentSubTitlePanel = (ContentSubTitlePanel) view;
- contentSubTitleBarHP.add(contentSubTitlePanel);
- contentSubTitleBarHP.setCellVerticalAlignment(contentSubTitlePanel, VerticalPanel.ALIGN_MIDDLE);
+ contentSubTitlePanel = (ContentSubTitlePanel) view;
+ contentSubTitleBarHP.add(contentSubTitlePanel);
+ contentSubTitleBarHP.setCellVerticalAlignment(contentSubTitlePanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContentTitle(final View view) {
- contentTitlePanel = (ContentTitlePanel) view;
- contentTitleBarHP.add(contentTitlePanel);
- contentTitleBarHP.setCellVerticalAlignment(contentTitlePanel, VerticalPanel.ALIGN_MIDDLE);
+ contentTitlePanel = (ContentTitlePanel) view;
+ contentTitleBarHP.add(contentTitlePanel);
+ contentTitleBarHP.setCellVerticalAlignment(contentTitlePanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContentToolBar(final View view) {
- contentToolBarPanel = (ContentToolBarPanel) view;
- contentToolBarHP.add(contentToolBarPanel);
- contentToolBarHP.setCellVerticalAlignment(contentToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
+ contentToolBarPanel = (ContentToolBarPanel) view;
+ contentToolBarHP.add(contentToolBarPanel);
+ contentToolBarHP.setCellVerticalAlignment(contentToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContext(final View contextMenu) {
- contextVP.clear();
- final Widget widget = (Widget) contextMenu;
- contextVP.add(widget);
- widget.setHeight("100%");
- widget.setWidth("100%");
- contextVP.setCellWidth(widget, "100%");
- contextVP.setCellHeight(widget, "100%");
+ contextVP.clear();
+ final Widget widget = (Widget) contextMenu;
+ contextVP.add(widget);
+ widget.setHeight("100%");
+ widget.setWidth("100%");
+ contextVP.setCellWidth(widget, "100%");
+ contextVP.setCellHeight(widget, "100%");
}
public void setGroupLogo(final Image image) {
- groupLogoPanel.setLogo(image);
+ // groupLogoPanel.setLogo(image);
}
public void setGroupLogo(final String groupName) {
- groupLogoPanel.setLogo(groupName);
+ // groupLogoPanel.setLogo(groupName);
}
public void setGroupMembers(final View view) {
- groupMembersPanel = (DropDownPanel) view;
- AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
+ groupMembersPanel = (DropDownPanel) view;
+ AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
}
public void setParticipation(final View view) {
- participationPanel = (DropDownPanel) view;
- AddDropDown(participationPanel, colorTheme.getParticipationDD());
+ participationPanel = (DropDownPanel) view;
+ AddDropDown(participationPanel, colorTheme.getParticipationDD());
}
public void setPutYourLogoVisible(final boolean visible) {
- groupLogoPanel.setPutYourLogoVisible(visible);
+ // groupLogoPanel.setPutYourLogoVisible(visible);
}
public void setSummary(final View view) {
- groupSummaryPanel = (DropDownPanel) view;
- AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
+ groupSummaryPanel = (DropDownPanel) view;
+ AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
}
public void setTags(final View view) {
- tagsPanel = (DropDownPanel) view;
- AddDropDown(tagsPanel, colorTheme.getTagsDD());
+ tagsPanel = (DropDownPanel) view;
+ AddDropDown(tagsPanel, colorTheme.getTagsDD());
}
public void setTheme(final String theme) {
- colorTheme.setTheme(theme);
- final String mainColor = colorTheme.getContentMainBorder();
- groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
- contentTitleBarBorderDec.setColor(mainColor);
- bottomBorderDecorator.setColor(mainColor);
- DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
- contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
- contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
- DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
- DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
- .getSplitter());
- DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
- groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
- participationPanel.setColor(colorTheme.getParticipationDD());
- groupSummaryPanel.setColor(colorTheme.getSummaryDD());
- tagsPanel.setColor(colorTheme.getTagsDD());
- groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
+ colorTheme.setTheme(theme);
+ final String mainColor = colorTheme.getContentMainBorder();
+ // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
+ contentTitleBarBorderDec.setColor(mainColor);
+ bottomBorderDecorator.setColor(mainColor);
+ DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
+ contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
+ contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
+ DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
+ DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
+ DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
+ DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
+ DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
+ DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
+ .getSplitter());
+ DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
+ groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
+ participationPanel.setColor(colorTheme.getParticipationDD());
+ groupSummaryPanel.setColor(colorTheme.getSummaryDD());
+ tagsPanel.setColor(colorTheme.getTagsDD());
+ groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
}
public void setTool(final String toolName) {
- groupToolsBar.selectItem(toolName);
+ groupToolsBar.selectItem(toolName);
}
public void setVisible(final boolean visible) {
- // false: Used when the app stops
- super.setVisible(visible);
+ // false: Used when the app stops
+ super.setVisible(visible);
}
private void AddDropDown(final DropDownPanel panel, final String color) {
- groupDropDownsVP.add(panel);
- panel.setWidth("145px");
- panel.setColor(color);
+ groupDropDownsVP.add(panel);
+ panel.setWidth("145px");
+ panel.setColor(color);
}
private void adjustSizeContentSP() {
- final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
- final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
- if (width > 0 && height > 0) {
- contentSP.setSize("" + width + "px", "" + height + "px");
- } else {
- Log.debug("Can't resize ScrollPanel now");
- }
+ final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
+ final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
+ if (width > 0 && height > 0) {
+ contentSP.setSize("" + width + "px", "" + height + "px");
+ } else {
+ Log.debug("Can't resize ScrollPanel now");
+ }
}
private void saveCurrentRightWidgetWidth(final int newRightWidgetWidth) {
- previousRightWidgetWidth = newRightWidgetWidth;
+ previousRightWidgetWidth = newRightWidgetWidth;
}
private void setDefaultSplitterPosition() {
- final int newLefttWidgetWidth = (int) (cntcxtHSP.getOffsetWidth() * 0.7);
- cntcxtHSP.setSplitPosition(newLefttWidgetWidth + "px");
- saveCurrentRightWidgetWidth(cntcxtHSP.getLeftWidgetAvailableWidth());
+ final int newLefttWidgetWidth = (int) (cntcxtHSP.getOffsetWidth() * 0.7);
+ cntcxtHSP.setSplitPosition(newLefttWidgetWidth + "px");
+ saveCurrentRightWidgetWidth(cntcxtHSP.getLeftWidgetAvailableWidth());
}
// private void logSplitter(final String count) {
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2008-07-07 14:10:21 UTC (rev 793)
@@ -38,7 +38,7 @@
</init-param>
<init-param>
<param-name>remotePort</param-name>
- <param-value>8383</param-value>
+ <param-value>5280</param-value>
</init-param>
</servlet>
<servlet-mapping>
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -6,39 +6,41 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
public class StateManagerTest {
private StateManager stateManager;
private HistoryWrapper history;
- @Before
- public void init() {
- ContentProvider contentProvider = EasyMock.createStrictMock(ContentProvider.class);
- Application application = EasyMock.createStrictMock(Application.class);
- Session session = EasyMock.createStrictMock(Session.class);
- history = EasyMock.createStrictMock(HistoryWrapper.class);
- stateManager = new StateManagerDefault(contentProvider, application, session, history);
- }
-
@Test
- public void normalStartLoggedUser() {
- // When a user enter reload state, also if the application is starting
- // (and the user was logged)
- EasyMock.expect(history.getToken()).andReturn("");
- EasyMock.replay(history);
- stateManager.reload();
- EasyMock.verify(history);
+ public void fixmeToken() {
+ stateManager.onHistoryChanged(Site.FIXME_TOKEN);
}
@Test
public void getDefGroup() {
- stateManager.onHistoryChanged("site.docs");
+ stateManager.onHistoryChanged("site.docs");
}
+ @Before
+ public void init() {
+ final ContentProvider contentProvider = EasyMock.createStrictMock(ContentProvider.class);
+ final Application application = EasyMock.createStrictMock(Application.class);
+ final Session session = EasyMock.createStrictMock(Session.class);
+ history = EasyMock.createStrictMock(HistoryWrapper.class);
+ final WorkspaceManager ws = EasyMock.createStrictMock(WorkspaceManager.class);
+ stateManager = new StateManagerDefault(contentProvider, application, session, history, ws);
+ }
+
@Test
- public void fixmeToken() {
- stateManager.onHistoryChanged(Site.FIXME_TOKEN);
+ public void normalStartLoggedUser() {
+ // When a user enter reload state, also if the application is starting
+ // (and the user was logged)
+ EasyMock.expect(history.getToken()).andReturn("");
+ EasyMock.replay(history);
+ stateManager.reload();
+ EasyMock.verify(history);
}
}
1
0