modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
| 16 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
| 66 +++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalColumn.java
| 27 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
| 73 ++++++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
| 76 ----------
6 files changed, 126 insertions(+), 136 deletions(-)
New commits:
commit ef1a25db284b1ac680f611fbef4426b53e4b8d10
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Mar 1 17:16:39 2011 -0500
Width Handling for Dashboards
- Fix a problem with Dashboard width specification. It seems there is a
Smartgwt javascript issue with, minimally, single String varargs array
handling. Accessing varargs[0] was unreliable. In dev mode this was
more tolerant but the javascript failed silently. Watch out for potential
issues using varargs.
- Added the ability to dragResize widths for dash columns
- Dashboard save() now persists column widths on each save operation
- Now allow independent scrolling of dash columns. This allows a user to
view any portlet combination across the columns.
- Added some null protection in Dashboard getColumns and getColumnWidths.
- played with borders, margins, etc to tweak reals estate and make drag
easier.
- Removed a bunch of debug message center notifications
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
index 622bd28..4c061fb 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
@@ -171,7 +171,7 @@ public class Dashboard implements Serializable {
}
public int getColumns() {
- return configuration.getSimple(CFG_COLUMNS).getIntegerValue();
+ return Integer.valueOf(configuration.getSimpleValue(CFG_COLUMNS,
"1"));
}
public void setColumns(int columns) {
@@ -179,7 +179,7 @@ public class Dashboard implements Serializable {
}
public String[] getColumnWidths() {
- return
configuration.getSimple(CFG_WIDTHS).getStringValue().split(",");
+ return configuration.getSimpleValue(CFG_WIDTHS,
"").split(",");
}
public void setColumnWidths(String... columnWidths) {
@@ -187,11 +187,17 @@ public class Dashboard implements Serializable {
return;
}
- String widths = columnWidths[0];
+ // note - this impl is a little verbose but it avoids a smartgwt javascript
problem with
+ // varargs handling. Not sure how bad the problem is but it definitely occured
with SmartGwt 2.4
+ // when a single String was pssed as the varArg list. Be wary of directly using
varargs array
+ // element 0...
+ StringBuilder sb = new StringBuilder();
+ sb.append(columnWidths[0]);
for (int i = 1; i < columnWidths.length; ++i) {
- widths += ("," + columnWidths[i]);
+ sb.append(",");
+ sb.append(columnWidths[i]);
}
- configuration.put(new PropertySimple(CFG_WIDTHS, widths));
+ configuration.put(new PropertySimple(CFG_WIDTHS, sb));
}
public Configuration getConfiguration() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index cd73f5d..f5f3fc8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -56,7 +56,6 @@ import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
import org.rhq.enterprise.gui.coregui.client.components.form.ColorButtonItem;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIMenuButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu;
@@ -108,8 +107,6 @@ public class DashboardView extends LocatableVLayout {
@Override
protected void onInit() {
if (!isInitialized) {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.oninit()", Severity.Info)); // TODO
-
super.onInit();
this.setWidth100();
@@ -123,8 +120,6 @@ public class DashboardView extends LocatableVLayout {
}
public void rebuild() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.rebuild()", Severity.Info)); // TODO
-
// destroy all of the portlets and recreate from scratch
portalLayout.removeFromParent();
portalLayout.destroy();
@@ -133,48 +128,26 @@ public class DashboardView extends LocatableVLayout {
buildPortlets();
}
- public void redraw() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.redraw()", Severity.Info)); // TODO
- super.redraw();
- }
-
- @Override
- public void draw() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.draw()", Severity.Info)); // TODO
- super.draw();
- }
-
@Override
protected void onDraw() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.onDraw()", Severity.Info)); // TODO
super.onDraw();
setEditMode(editMode);
}
public void buildPortlets() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildPortlets(1)", Severity.Info)); // TODO
-
this.setBackgroundColor(storedDashboard.getConfiguration().getSimpleValue(Dashboard.CFG_BACKGROUND,
"white"));
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildPortlets(2)", Severity.Info)); // TODO
portalLayout = new PortalLayout(extendLocatorId("PortalLayout"), this,
storedDashboard.getColumns(),
storedDashboard.getColumnWidths());
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildPortlets(3)", Severity.Info)); // TODO
portalLayout.setOverflow(Overflow.AUTO);
portalLayout.setWidth100();
portalLayout.setHeight100();
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildPortlets(4)", Severity.Info)); // TODO
-
loadPortletWindows();
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildPortlets(5)", Severity.Info)); // TODO
-
addMember(portalLayout);
-
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildPortlets(6)", Severity.Info)); // TODO
}
protected boolean canEditName() {
@@ -182,8 +155,6 @@ public class DashboardView extends LocatableVLayout {
}
private DynamicForm buildEditForm() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildEditForm(1)", Severity.Info)); // TODO
-
editForm = new LocatableDynamicForm(extendLocatorId("Editor"));
editForm.setMargin(5);
editForm.setAutoWidth();
@@ -192,8 +163,6 @@ public class DashboardView extends LocatableVLayout {
TextItem nameItem = null;
if (dashboardContainer.supportsDashboardNameEdit()) {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildEditForm(2)", Severity.Info)); // TODO
-
nameItem = new TextItem("name",
MSG.common_title_dashboard_name());
nameItem.setValue(storedDashboard.getName());
nameItem.setWrapTitle(false);
@@ -374,23 +343,16 @@ public class DashboardView extends LocatableVLayout {
}
updateRefreshMenu();
this.refreshMenuButton.markForRedraw();
- //this.markForRedraw();
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.buildEditForm(2)", Severity.Info)); // TODO
return editForm;
}
private void loadPortletWindows() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.loadPortletWindows(1)", Severity.Info)); // TODO
-
for (int i = 0; i < storedDashboard.getColumns(); i++) {
for (DashboardPortlet storedPortlet : storedDashboard.getPortlets(i)) {
String locatorId = getPortletLocatorId(portalLayout, storedPortlet);
- CoreGUI.getMessageCenter().notify(
- new Message("------->>
DashboardView.loadPortletWindows(" + locatorId + ")", Severity.Info)); //
TODO
-
PortletWindow portletWindow = new PortletWindow(locatorId, this,
storedPortlet);
portletWindow.setTitle(storedPortlet.getName());
portletWindow.setHeight(storedPortlet.getHeight());
@@ -400,8 +362,6 @@ public class DashboardView extends LocatableVLayout {
portalLayout.addPortletWindow(portletWindow, i);
}
}
-
- CoreGUI.getMessageCenter().notify(new Message("------->>
DashboardView.loadPortletWindows(2)", Severity.Info)); // TODO
}
/**
@@ -503,7 +463,31 @@ public class DashboardView extends LocatableVLayout {
save((AsyncCallback<Dashboard>) null);
}
+ public String[] updatePortalColumnWidths() {
+ int numColumns = storedDashboard.getColumns();
+ int totalPixelWidth = 0;
+ int[] columnPixelWidths = new int[numColumns];
+ for (int i = 0; i < numColumns; ++i) {
+ PortalColumn col = portalLayout.getPortalColumn(i);
+ totalPixelWidth += col.getWidth();
+ columnPixelWidths[i] = col.getWidth();
+ }
+ String[] columnWidths = new String[numColumns];
+ columnWidths[numColumns - 1] = "*";
+ for (int i = 0; i < numColumns - 1; ++i) {
+ columnWidths[i] = String.valueOf(((int) columnPixelWidths[i] * 100 /
totalPixelWidth)) + "%";
+ }
+
+ storedDashboard.setColumnWidths(columnWidths);
+
+ return columnWidths;
+ }
+
public void save(final AsyncCallback<Dashboard> callback) {
+ // a variety of edits (dragResize, add/remove column, etc) can cause column width
changes. Update them
+ // prior to every save.
+ updatePortalColumnWidths();
+
// since we reset storedDashboard after the async update completes, block
modification of the dashboard
// during that interval.
DashboardView.this.disable();
@@ -648,7 +632,7 @@ public class DashboardView extends LocatableVLayout {
}
this.editForm.markForRedraw();
this.portalLayout.show();
- this.portalLayout.markForRedraw(); // TODO
+ this.portalLayout.markForRedraw();
}
public class UpdatePortletRefreshCallback implements AsyncCallback<Subject> {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalColumn.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalColumn.java
index 1eedc08..fcc65b4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalColumn.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalColumn.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.dashboard;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VStack;
@@ -31,14 +32,21 @@ public class PortalColumn extends VStack {
public PortalColumn() {
// leave some space between portlets
- setMembersMargin(6);
- this.setBorder("1px solid #999999");
+ setMembersMargin(4);
+
+ // Provide a visible border for framing of columns (especially when empty) and
add padding to make
+ // the border easier to see for dragging
+ setBorder("2px solid #999999");
+
+ // Allow column specific vertical scrolling to see off-screen portlets. Takes up
real estate but allows
+ // a user to see specific portlets in each column at the same time.
+ setOverflow(Overflow.AUTO);
// enable predefined component animation
setAnimateMembers(true);
setAnimateMemberTime(300);
- // enable drop handling
+ // enable drop handling for moving portlet windows within or between columns
setCanAcceptDrop(true);
// change appearance of drag placeholder and drop indicator
@@ -53,6 +61,19 @@ public class PortalColumn extends VStack {
Canvas placeHolderProperties = new Canvas();
placeHolderProperties.setBorder("2px solid #4A5D75");
setPlaceHolderProperties(placeHolderProperties);
+
+ // Allow column resizing (width only)
+ setCanDragResize(true);
+
+ // Use Left side drag resize because right side seems to conflict with vertical
scroll bars.
+ setResizeFrom("L");
+
+ // Do not use the resize bar. It looks good but does not behave as well as the
border dragging, and does
+ // not seem to play as well with the resize handlers. Maybe in the future...
+ // setShowResizeBar(true);
+
+ // True is the default, just capturing this call here for any future tweaking
+ // setRedrawOnResize(true);
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
index 9a8b0dd..34775a2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
@@ -27,13 +27,15 @@ import java.util.Arrays;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.util.EventHandler;
import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.events.DragResizeStartEvent;
+import com.smartgwt.client.widgets.events.DragResizeStartHandler;
import com.smartgwt.client.widgets.events.DropEvent;
import com.smartgwt.client.widgets.events.DropHandler;
+import com.smartgwt.client.widgets.events.ResizedEvent;
+import com.smartgwt.client.widgets.events.ResizedHandler;
import org.rhq.core.domain.dashboard.Dashboard;
import org.rhq.core.domain.dashboard.DashboardPortlet;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
@@ -44,6 +46,7 @@ import
org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
public class PortalLayout extends LocatableHLayout {
private DashboardView dashboardView;
+ private Integer dragResizeColumnCount;
/**
* @param locatorId
@@ -55,19 +58,24 @@ public class PortalLayout extends LocatableHLayout {
public PortalLayout(String locatorId, DashboardView dashboardView, int numColumns,
String[] columnWidths) {
super(locatorId);
- CoreGUI.getMessageCenter().notify(
- new Message("------->> PortalLayout(numColumns=" + numColumns
+ ",columnWidths="
- + Arrays.toString(columnWidths) + ")")); // TODO
+ if (numColumns < 1) {
+ throw new IllegalArgumentException("Invalid number of columns [" +
numColumns + "]");
+ }
+ if ((null != columnWidths && columnWidths.length > numColumns)) {
+ throw new IllegalArgumentException("Invalid column widths (more widths
than columns) "
+ + Arrays.toString(columnWidths));
+ }
this.dashboardView = dashboardView;
- setMargin(5);
- setMembersMargin(6);
+ setMargin(4);
+ setMembersMargin(4);
+
for (int i = 0; i < numColumns; i++) {
final PortalColumn column = new PortalColumn();
if (null != columnWidths && i < columnWidths.length) {
column.setWidth(columnWidths[i]);
- } else if (i == 0) {
- column.setWidth("30%");
+ } else {
+ column.setWidth("*");
}
final int columnNumber = i;
@@ -129,7 +137,47 @@ public class PortalLayout extends LocatableHLayout {
}
});
- CoreGUI.getMessageCenter().notify(new Message("------->>
PortalLayout() adding column " + i)); // TODO
+ column.addDragResizeStartHandler(new DragResizeStartHandler() {
+
+ @Override
+ public void onDragResizeStart(DragResizeStartEvent event) {
+
+ // When a drag resize starts activate a counter keeping track of the
number of columns that
+ // have been resized. A resize of one column will force a resize of
all columns. After the
+ // last column resize completes, persist the new column widths to the
database.
+ dragResizeColumnCount = 0;
+ }
+ });
+
+ // This handler is called when the resizing is complete (the
DragResizeStopHandler is called
+ // immediately on stop but before all resizing is complete.)
+ column.addResizedHandler(new ResizedHandler() {
+
+ @Override
+ public void onResized(ResizedEvent event) {
+
+ // ignore resizing not related to drag resize (presumable initial
draw)
+ if (null == dragResizeColumnCount) {
+ return;
+ }
+
+ ++dragResizeColumnCount;
+ Canvas[] members = getMembers();
+
+ // ignore resizing prior to all columns being resized as a result of
the drag operation
+ if (dragResizeColumnCount != members.length) {
+ return;
+ }
+
+ // one drag operation results in a save for each column, as they all
get resized
+ // now that they are all resized, save the column widths (save
updates these automatically)
+ save();
+
+ // reset the flag
+ dragResizeColumnCount = null;
+ }
+ });
+
addMember(column);
}
}
@@ -146,6 +194,10 @@ public class PortalLayout extends LocatableHLayout {
return portalColumn;
}
+ public void save() {
+ this.dashboardView.save();
+ }
+
public void save(AsyncCallback<Dashboard> callback) {
this.dashboardView.save(callback);
}
@@ -163,7 +215,6 @@ public class PortalLayout extends LocatableHLayout {
PortletWindow portlet = (PortletWindow) p;
portlet.setWidth(column.getWidth());
-
}
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
index 0f76e5b..2eac777 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
@@ -91,6 +91,7 @@ public class PortletWindow extends LocatableWindow {
};
private ClickHandler refreshHandler = new ClickHandler() {
+ @SuppressWarnings("unchecked")
public void onClick(ClickEvent clickEvent) {
if (PortletWindow.this.view instanceof Table) {
((Table) PortletWindow.this.view).refresh();
@@ -137,7 +138,7 @@ public class PortletWindow extends LocatableWindow {
setCanDrop(true);
setCanDragResize(true);
- // setResizeFrom("B");
+ setResizeFrom("T", "B");
setShowShadow(false);
@@ -166,7 +167,6 @@ public class PortletWindow extends LocatableWindow {
setSettingsClickHandler(settingsHandler);
setHelpClickHandler(helpHandler);
-
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
index df8c9f4..38b4194 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
@@ -48,8 +48,6 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardView;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MessagePortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -89,17 +87,12 @@ public class ActivityView extends LocatableVLayout implements
DashboardContainer
@Override
protected void onInit() {
if (!isInitialized()) {
- CoreGUI.getMessageCenter().notify(new Message("------->>
ActivityView.oninit()", Severity.Info)); // TODO
-
super.onInit();
// first async call to get global permissions
new PermissionsLoader().loadExplicitGlobalPermissions(new
PermissionsLoadedListener() {
public void onPermissionsLoaded(Set<Permission> permissions) {
- CoreGUI.getMessageCenter().notify(
- new Message("------->> ActivityView.oninit(
gotGlobalPerms )", Severity.Info)); // TODO
-
globalPermissions = permissions;
// now make async call to look for customized dash for this user and
entity
@@ -112,9 +105,6 @@ public class ActivityView extends LocatableVLayout implements
DashboardContainer
}
public void onSuccess(final PageList<Dashboard> result) {
- CoreGUI.getMessageCenter().notify(
- new Message("------->> ActivityView.oninit(
gotCriteriaResult )", Severity.Info)); // TODO
-
Dashboard dashboard = result.isEmpty() ?
getDefaultDashboard() : result.get(0);
setDashboard(dashboard);
@@ -131,65 +121,7 @@ public class ActivityView extends LocatableVLayout implements
DashboardContainer
}
}
- @Override
- public void draw() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
ActivityView.draw()", Severity.Info)); // TODO
- super.draw();
- }
-
- @Override
- public void redraw() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
ActivityView.redraw()", Severity.Info)); // TODO
- super.redraw();
- }
-
- @Override
- protected void onDraw() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
ActivityView.onDraw()", Severity.Info)); // TODO
- super.onDraw();
-
- /*
- * If we really had something to do here we'd want to wait until the async
initialization was really over.
- *
- new Timer() {
- final long startTime = System.currentTimeMillis();
-
- public void run() {
- if (isInitialized) {
- CoreGUI.getMessageCenter().notify(new
Message("------->> ActivityView.onDraw( 1 )", Severity.Info)); // TODO
-
- ActivityView.super.onDraw();
- if (!dashboardView.isDrawn()) {
- dashboardView.draw();
- }
- if (!dashboardView.isVisible()) {
- dashboardView.show();
- }
- markForRedraw();
- dashboardView.markForRedraw();
-
- } else {
- long elapsedMillis = System.currentTimeMillis() - startTime;
- if (elapsedMillis < 10000) {
- CoreGUI.getMessageCenter().notify(
- new Message("------->>
ActivityView.onDraw( 2 )", Severity.Info)); // TODO
- schedule(100); // Reschedule the timer.
- } else {
- // give up and just do the draw()
- CoreGUI.getMessageCenter().notify(
- new Message("------->>
ActivityView.onDraw( 3 )", Severity.Info)); // TODO
- ActivityView.super.onDraw();
-
- }
- }
- }
- }.run(); // fire the timer immediately
- */
- }
-
private void setDashboard(Dashboard dashboard) {
- CoreGUI.getMessageCenter().notify(new Message("------->>
ActivityView.setDashboard()", Severity.Info)); // TODO
-
Canvas[] members = getMembers();
removeMembers(members);
@@ -237,23 +169,19 @@ public class ActivityView extends LocatableVLayout implements
DashboardContainer
}
protected Dashboard getDefaultDashboard() {
- CoreGUI.getMessageCenter().notify(new Message("------->>
ActivityView.getDefaultDashboard", Severity.Info)); // TODO
-
Subject sessionSubject = UserSessionManager.getSessionSubject();
ResourceGroup group = groupComposite.getResourceGroup();
Dashboard dashboard = new Dashboard();
- //dashboard.getConfiguration().setProperties(new ArrayList<Property>()); //
replace the LinkedHashMap...
-
dashboard.setName(DASHBOARD_NAME_PREFIX + sessionSubject.getId() + "_"
+ group.getId());
dashboard.setCategory(DashboardCategory.GROUP);
dashboard.setGroup(group);
dashboard.setColumns(2);
// TODO, add real portlets
- // set leftmost column and letthe rest be equally divided
- dashboard.setColumnWidths("40%", "*");
+ // set leftmost column and let the rest be equally divided
+ dashboard.setColumnWidths("40%");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,
"#F1F2F3"));
// Left Column