[jbpm-commits] JBoss JBPM SVN: r3675 - in projects/gwt-console/trunk: war/src/main/java/org/jboss/bpm/console/client and 6 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Jan 19 09:06:26 EST 2009
Author: heiko.braun at jboss.com
Date: 2009-01-19 09:06:26 -0500 (Mon, 19 Jan 2009)
New Revision: 3675
Modified:
projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/Editor.java
projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/View.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java
Log:
Restore layout: View are opened in workspace TabPanel as well
Modified: projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -22,13 +22,10 @@
package org.jboss.bpm.console.client;
import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.layout.FitLayout;
-import com.gwtext.client.widgets.layout.BorderLayout;
-import com.gwtext.client.widgets.layout.BorderLayoutData;
-import com.gwtext.client.core.RegionPosition;
+import java.util.List;
+import java.util.ArrayList;
+
/**
* An editor can be plugged into a {@link org.jboss.bpm.console.client.Workspace}
*
@@ -37,62 +34,14 @@
public abstract class Editor extends Panel
{
protected ApplicationContext appContext;
- private TabPanel tabPanel;
+ protected List<String> managedTabs;
public Editor(ApplicationContext applicationContext)
{
super();
this.appContext = applicationContext;
+ this.managedTabs = new ArrayList<String>();
this.setPaddings(10);
-
- // -------
- this.tabPanel = new TabPanel();
- this.tabPanel.setResizeTabs(true);
- this.tabPanel.setMinTabWidth(115);
- this.tabPanel.setTabWidth(135);
- this.tabPanel.setEnableTabScroll(true);
- this.tabPanel.setAutoScroll(true);
- this.tabPanel.setPlain(true);
- this.tabPanel.setActiveTab(0);
- this.tabPanel.setBorder(false);
-
- // -------
-
- Panel panel = new Panel();
- panel.setBorder(false);
- panel.setPaddings(10);
- panel.setLayout(new FitLayout());
-
- panel.setWidth(UIConstants.EDITOR_WIDTH);
- panel.setHeight(500);
-
- // -------
-
- Panel borderPanel = new Panel();
- borderPanel.setBorder(false);
- borderPanel.setLayout(new BorderLayout());
-
- //add east panel
- /*Panel eastPanel = new Panel();
- eastPanel.setHtml("<p>east panel</p>");
- eastPanel.setTitle("East Side");
- eastPanel.setCollapsible(true);
- eastPanel.setWidth(225);
-
- BorderLayoutData eastData = new BorderLayoutData(RegionPosition.EAST);
- eastData.setSplit(false);
- eastData.setMinSize(75);
- eastData.setMaxSize(100);
- eastData.setMargins(new Margins(0, 0, 5, 0));
-
- borderPanel.add(eastPanel, eastData);*/
-
- // add center panel
- borderPanel.add(tabPanel, new BorderLayoutData(RegionPosition.CENTER));
-
- panel.add(borderPanel);
-
- this.add(panel);
}
public abstract String getEditorId();
@@ -105,41 +54,44 @@
public boolean hasView(String viewId)
{
- boolean b = false;
final String tabId = viewId + ".tab";
-
- Component[] tabs = tabPanel.getItems();
- for (int i = 0; i < tabs.length; i++)
- {
- Component tab = tabs[i];
- if (tab.getId().equals(tabId))
- {
- b = true;
- break;
- }
- }
-
- return b;
+ return appContext.getWorkpace().hasItem(tabId);
}
public void showView(String viewId)
{
final String tabId = viewId + ".tab";
- this.tabPanel.setActiveTab(tabId);
+ appContext.getWorkpace().setActiveTab(tabId);
}
public void addView(View view, boolean closable)
{
- view.setId(view.getViewId() + ".tab");
+ String tabId = view.getViewId() + ".tab";
+
+ view.setId(tabId); // tabId != viewId
view.setClosable(closable);
view.setIconCls(view.getIconCSS());
view.setAutoScroll(true);
- this.tabPanel.add(view);
- this.tabPanel.setActiveTab(view.getId());
+ appContext.getWorkpace().add(view);
+ appContext.getWorkpace().setActiveTab(view.getId());
+ managedTabs.add(tabId);
+
}
+ public void closeViews()
+ {
+ for(String tabId : managedTabs)
+ {
+ Panel tab = appContext.getWorkpace().getItem(tabId);
+ if(tab!=null)
+ {
+ tab.collapse();
+ }
+ }
+ }
+
class WrapperPanel extends Panel
{
public WrapperPanel(String id)
Modified: projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/View.java
===================================================================
--- projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/View.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/plugin/src/main/java/org/jboss/bpm/console/client/View.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -37,6 +37,7 @@
{
super();
this.mainMenu = main;
+ this.setPaddings(10);
}
public abstract String getViewId();
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -71,6 +71,7 @@
mainPanel.setLayout(new FitLayout());
mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
+ mainPanel.setAutoWidth(false);
return mainPanel;
}
@@ -103,7 +104,7 @@
launcher.launch(this, workspace);
borderPanel.add(workspace, new BorderLayoutData(RegionPosition.CENTER));
-
+
// ------------------------------------------
mainPanel.add(borderPanel);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -91,15 +91,16 @@
public void onExamine(int row)
{
ProcessDefinitionRef proc = row2ProcessMap.get(row);
- launchView(proc);
+ launchInstanceView(proc);
}
- public void launchView(ProcessDefinitionRef proc)
- {
- String editorId = ProcessEditor.ID;
- Editor editor = (Editor) ComponentMgr.getComponent(editorId);
- if (editor.hasView(editorId))
- editor.showView(editorId);
+ public void launchInstanceView(ProcessDefinitionRef proc)
+ {
+ String viewId = ProcessInstanceListView.createWidgetID(proc);
+ Editor editor = (Editor) ComponentMgr.getComponent(ProcessEditor.ID);
+
+ if (editor.hasView(viewId))
+ editor.showView(viewId);
else
editor.addView(new ProcessInstanceListView(proc, view), true);
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -79,7 +79,7 @@
Panel outerFormPanel = new Panel();
outerFormPanel.setBorder(false);
- outerFormPanel.setPaddings(10, 0, 0, 0);
+ outerFormPanel.setPaddings(10);
final FormPanel formPanel = new FormPanel();
formPanel.setFrame(true);
@@ -142,28 +142,8 @@
outerFormPanel.add(formPanel);
- // ----------------------------------
-
- final View defaultView = new View(appContext)
- {
-
- public String getViewId()
- {
- return getEditorId() + ".defaultView";
- }
-
- public String getIconCSS()
- {
- return "";
- }
- };
-
- defaultView.setBorder(false);
- defaultView.setTitle("Process definitions");
- defaultView.add(processDefinitionList);
- defaultView.add(outerFormPanel);
-
- addView(defaultView, false);
+ this.add(processDefinitionList);
+ this.add(outerFormPanel);
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListView.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListView.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -81,7 +81,7 @@
}
};
- instanceList = new ProcessInstanceList(modelModificationCallback, proc, "Active", view);
+ instanceList = new ProcessInstanceList(modelModificationCallback, proc, "Process Instances", view);
// ---------------
@@ -91,13 +91,13 @@
tabPanel.setActiveTab(0);
tabPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
- PaddedPanel tabPadding = new PaddedPanel(tabPanel, 10, 0, 0, 0);
+ PaddedPanel tabPadding = new PaddedPanel(tabPanel, 10);
// ----------------------------------------
detailsForm = new ProcessInstanceDetailForm(view, modelModificationCallback);
- modelListeners.addListener((ModelChangeListener) detailsForm);
+ modelListeners.addListener(detailsForm);
// ----------------
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportView.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportView.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -67,6 +67,9 @@
public void onRender(Component component)
{
+ Panel panel = new Panel(definitionName +" Report");
+ panel.setPaddings(10);
+
final String reportUrl = view.getUrlBuilder().getDefinitionReportUrl(definitionName);
ConsoleLog.debug("Report resource:" + reportUrl);
@@ -111,8 +114,10 @@
p.add(new Separator());
p.add(refreshBtn);
- add(p);
- add(birtPanel);
+ panel.add(p);
+ panel.add(birtPanel);
+
+ add(panel);
}
}
);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -50,8 +50,8 @@
super(applicationContext);
this.setId(ID);
- this.setPaddings(10);
-
+ this.setPaddings(10);
+
// -------------------------------------
this.setLayout(new VerticalLayout(10));
@@ -60,6 +60,9 @@
{
public void onRender(Component component)
{
+
+ Panel panel = new Panel("Report Overview");
+ panel.setPaddings(10);
final String reportUrl = applicationContext.getUrlBuilder().getOverviewReportUrl();
ConsoleLog.debug("Report resource:" + reportUrl);
@@ -105,28 +108,10 @@
toolsPanel.add(new Separator());
toolsPanel.add(refreshBtn);
- final View defaultView = new View(appContext)
- {
+ panel.add(toolsPanel);
+ panel.add(birtPanel);
- public String getViewId()
- {
- return getEditorId() + ".defaultView";
- }
-
- public String getIconCSS()
- {
- return "";
- }
- };
-
- defaultView.setBorder(false);
- defaultView.setTitle("Metric Overview");
-
-
- defaultView.add(toolsPanel);
- defaultView.add(birtPanel);
-
- addView(defaultView, false);
+ add(panel);
}
}
);
@@ -231,11 +216,7 @@
}
);
- TreeNode export = new TreeNode("Export stats");
- export.setExpanded(true);
-
root.appendChild(overview);
- root.appendChild(export);
setRootVisible(true);
setRootNode(root);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -61,7 +61,7 @@
this.setId(ID);
this.setLayout(new ColumnLayout());
- this.setWidth(UIConstants.EDITOR_WIDTH);
+ this.setWidth(UIConstants.EDITOR_WIDTH);
this.addListener(
new PanelListenerAdapter()
@@ -104,14 +104,14 @@
{
if (!initialized)
{
-
+
tabPanel = new TabPanel();
tabPanel.setPaddings(10);
tabPanel.setPlain(true);
tabPanel.setActiveTab(0);
tabPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
- PaddedPanel tabPadding = new PaddedPanel(tabPanel, 10, 0, 0, 0);
+ PaddedPanel tabPadding = new PaddedPanel(tabPanel, 10);
// ----------------------------------
@@ -124,7 +124,7 @@
}
};
- taskList = new TaskList(modelModificationCallback, "Task overview", appContext);
+ taskList = new TaskList(modelModificationCallback, "Task List", appContext);
final RowSelectionModel sm = new RowSelectionModel(true);
sm.addListener(
new RowSelectionListenerAdapter()
@@ -153,30 +153,11 @@
// -------
- final View defaultView = new View(appContext)
- {
+ this.add(taskList);
+ this.add(tabPadding);
- public String getViewId()
- {
- return getEditorId() + ".defaultView";
- }
-
- public String getIconCSS()
- {
- return "";
- }
- };
-
- defaultView.setBorder(false);
- defaultView.setTitle("Task list");
-
- defaultView.add(taskList);
- defaultView.add(tabPadding);
-
// -------
- addView(defaultView, false);
-
doLayout();
initialized = true;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -34,6 +34,7 @@
import com.gwtext.client.widgets.event.PanelListenerAdapter;
import com.gwtext.client.widgets.grid.*;
import com.gwtext.client.widgets.grid.event.GridCellListener;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.model.DTOParser;
@@ -47,237 +48,234 @@
*/
public class TaskList extends Panel
{
- private Map<Integer, TaskRef> row2taskref = new HashMap<Integer, TaskRef>();
- private ApplicationContext mainView;
- private GridPanel grid;
- private GroupingStore store;
- private String title;
- private RowSelectionModel rowSelectionModel;
- public static final int PAGE_SIZE = 15;
- private int selectedRowIndex = -1;
+ private Map<Integer, TaskRef> row2taskref = new HashMap<Integer, TaskRef>();
+ private MainView appContext;
+ private GridPanel grid;
+ private GroupingStore store;
+ private String title;
+ private RowSelectionModel rowSelectionModel;
+ public static final int PAGE_SIZE = 15;
+ private int selectedRowIndex = -1;
- private ModelModificationCallback modelModificationCallback;
+ private ModelModificationCallback modelModificationCallback;
- public TaskList(ModelModificationCallback callback, String titleName, final ApplicationContext view)
- {
- this.mainView = view;
- //this.title = titleName;
- this.modelModificationCallback = callback;
+ public TaskList(ModelModificationCallback callback, String titleName, final ApplicationContext appContext)
+ {
+ this.title = titleName;
+ this.modelModificationCallback = callback;
- this.setPaddings(10, 0,0,0);
- this.setHeader(false);
- this.setBorder(false);
- this.setFrame(false);
- this.setIconCls("bpm-task-icon");
+ this.setPaddings(10);
+ this.setHeader(false);
+ this.setBorder(false);
+ this.setFrame(false);
+ this.setIconCls("bpm-task-icon");
- String resourceUrl = view.getUrlBuilder().getTaskListByActorURL(view.getAuthentication().getUsername());
- DataProxy dataProxy = new ScriptTagProxy(resourceUrl, 1000 * 10);
+ String resourceUrl = appContext.getUrlBuilder().getTaskListByActorURL(appContext.getAuthentication().getUsername());
+ DataProxy dataProxy = new ScriptTagProxy(resourceUrl, 1000*10);
- final Reader reader = createReader();
+ final Reader reader = createReader();
- store = new GroupingStore();
- store.setReader(reader);
- store.setDataProxy(dataProxy);
- store.setSortInfo(new SortState("id", SortDir.ASC));
- store.setGroupField("currentState");
- store.addStoreListener(new ListViewStoreListener(this));
+ store = new GroupingStore();
+ store.setReader(reader);
+ store.setDataProxy(dataProxy);
+ store.setSortInfo(new SortState("id", SortDir.ASC));
+ store.setGroupField("currentState");
+ store.addStoreListener( new ListViewStoreListener(this) );
- // PanelListener will lazy load store data.
- // Store.onLoad() callback will populate the grid
- // and add it to the container panel.
- this.addListener(
- new PanelListenerAdapter()
- {
- public boolean doBeforeRender(Component component)
- {
- modelModificationCallback.onStaleModel();
- return true;
- }
- }
- );
- }
+ // PanelListener will lazy load store data.
+ // Store.onLoad() callback will populate the grid
+ // and add it to the container panel.
+ this.addListener(
+ new PanelListenerAdapter()
+ {
+ public boolean doBeforeRender(Component component)
+ {
+ modelModificationCallback.onStaleModel();
+ return true;
+ }
+ }
+ );
+ }
- protected void onRecordsLoaded(Record[] records)
- {
- try
- {
- int i = 0;
- for (Record r : records)
+ protected void onRecordsLoaded(Record[] records)
+ {
+ try
{
- TaskRef ref = transform(r);
- row2taskref.put(i, ref);
- i++;
+ int i=0;
+ for(Record r : records)
+ {
+ TaskRef ref = transform(r);
+ row2taskref.put(i, ref);
+ i++;
+ }
}
- }
- catch (Throwable e)
- {
- ConsoleLog.error("Failed to parse task ref", e);
- }
+ catch (Throwable e)
+ {
+ ConsoleLog.error("Failed to parse task ref", e);
+ }
- ConsoleLog.debug("Loaded " + row2taskref.size() + " tasks");
- }
+ ConsoleLog.debug("Loaded " + row2taskref.size() + " tasks");
+ }
- public static TaskRef transform(Record r)
- {
- JavaScriptObject js = r.getDataAsJsObject();
- JSONObject jso = new JSONObject(js);
- TaskRef ref = DTOParser.parseTaskReference(jso);
- return ref;
- }
+ public static TaskRef transform(Record r)
+ {
+ JavaScriptObject js = r.getDataAsJsObject();
+ JSONObject jso = new JSONObject(js);
+ TaskRef ref = DTOParser.parseTaskReference(jso);
+ return ref;
+ }
- private ColumnModel createColumnModel()
- {
- final ColumnModel columnModel = new ColumnModel(
- new ColumnConfig[]
- {
- new ColumnConfig("ID", "id", 35, true),
- new ColumnConfig("Task Name", "name", 290, true, null, "expand"),
- new ColumnConfig("Assigned to", "actor", 75, true),
- new ColumnConfig("State", "currentState", 50, true)
+ private ColumnModel createColumnModel()
+ {
+ final ColumnModel columnModel = new ColumnModel(
+ new ColumnConfig[]
+ {
+ new ColumnConfig("ID", "id", 35, true),
+ new ColumnConfig("Task Name", "name", 290, true, null, "expand"),
+ new ColumnConfig("Assigned to", "actor", 75, true),
+ new ColumnConfig("State", "currentState", 50, true)
+ }
+ );
+ return columnModel;
+ }
+
+ private JsonReader createReader()
+ {
+ final RecordDef recordDef = new RecordDef(
+ new FieldDef[]{
+ new IntegerFieldDef("id"),
+ new StringFieldDef("name"),
+ new StringFieldDef("actor"),
+ new StringFieldDef("currentState")
}
- );
- return columnModel;
- }
+ );
- private JsonReader createReader()
- {
- final RecordDef recordDef = new RecordDef(
- new FieldDef[]{
- new IntegerFieldDef("id"),
- new StringFieldDef("name"),
- new StringFieldDef("actor"),
- new StringFieldDef("currentState")
- }
- );
+ final JsonReader reader = new JsonReader(recordDef);
+ reader.setRoot("tasks");
+ reader.setTotalProperty("totalCount");
+ reader.setId("id");
+ return reader;
+ }
- final JsonReader reader = new JsonReader(recordDef);
- reader.setRoot("tasks");
- reader.setTotalProperty("totalCount");
- reader.setId("id");
- return reader;
- }
+ private class ListViewStoreListener extends StoreListenerAdapter
+ {
- private class ListViewStoreListener extends StoreListenerAdapter
- {
+ Panel containerPanel;
- Panel containerPanel;
+ public ListViewStoreListener(Panel containerPanel)
+ {
+ this.containerPanel = containerPanel;
+ }
- public ListViewStoreListener(Panel containerPanel)
- {
- this.containerPanel = containerPanel;
- }
+ /**
+ * load callback will push records to implementation
+ * and (!) add the grid to the container panel.
+ */
+ public void onLoad(Store store, Record[] records)
+ {
- /**
- * load callback will push records to implementation
- * and (!) add the grid to the container panel.
- */
- public void onLoad(Store store, Record[] records)
- {
+ onRecordsLoaded(records);
- onRecordsLoaded(records);
+ grid = assembleGrid();
- grid = assembleGrid();
+ containerPanel.clear();
+ containerPanel.add(grid);
+ containerPanel.doLayout();
+ }
- containerPanel.clear();
- containerPanel.add(grid);
- containerPanel.doLayout();
- }
+ public void onLoadException(Throwable throwable)
+ {
+ ConsoleLog.error("Failed to load remote data", throwable);
+ }
- public void onLoadException(Throwable throwable)
- {
- ConsoleLog.error("Failed to load remote data", throwable);
- }
+ }
- }
+ private GridPanel assembleGrid()
+ {
+ final ColumnModel columnModel = createColumnModel();
- private GridPanel assembleGrid()
- {
- final ColumnModel columnModel = createColumnModel();
+ GridPanel grid = new GridPanel();
+ grid.setStore(store);
+ grid.setColumnModel(columnModel);
+ grid.setFrame(true);
+ grid.setStripeRows(true);
+ grid.setAutoExpandColumn("name");
+ grid.setTitle(title);
- GridPanel grid = new GridPanel();
- grid.setStore(store);
- grid.setColumnModel(columnModel);
- grid.setFrame(true);
- grid.setBorder(false);
- grid.setStripeRows(true);
- grid.setAutoExpandColumn("name");
- //grid.setTitle(title);
+ GroupingView gridView = new GroupingView();
+ gridView.setForceFit(true);
+ gridView.setGroupTextTpl("{text} ({[values.rs.length]} {[values.rs.length > 1 ? \"Items\" : \"Item\"]})");
- GroupingView gridView = new GroupingView();
- gridView.setForceFit(true);
- gridView.setGroupTextTpl("{text} ({[values.rs.length]} {[values.rs.length > 1 ? \"Items\" : \"Item\"]})");
-
- if (rowSelectionModel != null)
- {
- grid.setSelectionModel(rowSelectionModel);
- grid.doOnRender(new Function()
+ if(rowSelectionModel!=null)
{
- public void execute()
- {
- if (-1 == selectedRowIndex)
- rowSelectionModel.selectFirstRow();
- else
- rowSelectionModel.selectRow(selectedRowIndex);
- }
- }, 10);
- }
- grid.setView(gridView);
- grid.setFrame(true);
- grid.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
- grid.setHeight(250);
- grid.setEnableHdMenu(false);
+ grid.setSelectionModel(rowSelectionModel);
+ grid.doOnRender(new Function() {
+ public void execute()
+ {
+ if(-1==selectedRowIndex)
+ rowSelectionModel.selectFirstRow();
+ else
+ rowSelectionModel.selectRow(selectedRowIndex);
+ }
+ }, 10);
+ }
+ grid.setView(gridView);
+ grid.setFrame(true);
+ grid.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
+ grid.setHeight(250);
+ grid.setEnableHdMenu(false);
- grid.setBottomToolbar(createToolbar(store));
+ grid.setBottomToolbar(createToolbar(store));
- return grid;
- }
+ return grid;
+ }
- private PagingToolbar createToolbar(final Store store)
- {
- PagingToolbar pagingToolbar = new PagingToolbar(store);
- pagingToolbar.setPageSize(PAGE_SIZE);
- pagingToolbar.setDisplayInfo(true);
- pagingToolbar.setDisplayMsg("{0} - {1} of {2}");
+ private PagingToolbar createToolbar(final Store store)
+ {
+ PagingToolbar pagingToolbar = new PagingToolbar(store);
+ pagingToolbar.setPageSize(PAGE_SIZE);
+ pagingToolbar.setDisplayInfo(true);
+ pagingToolbar.setDisplayMsg("{0} - {1} of {2}");
- pagingToolbar.addSeparator();
- pagingToolbar.addSpacer();
+ pagingToolbar.addSeparator();
+ pagingToolbar.addSpacer();
- return pagingToolbar;
- }
+ return pagingToolbar;
+ }
- public void reloadStore()
- {
- ConsoleLog.debug("Reload " + this.getId());
- store.load(0, PAGE_SIZE);
- }
+ public void reloadStore()
+ {
+ ConsoleLog.debug("Reload " + this.getId());
+ store.load(0, PAGE_SIZE);
+ }
- public GridPanel getGrid()
- {
- return grid;
- }
+ public GridPanel getGrid()
+ {
+ return grid;
+ }
- public void setRowSelectionModel(RowSelectionModel model)
- {
- this.rowSelectionModel = model;
- }
+ public void setRowSelectionModel(RowSelectionModel model)
+ {
+ this.rowSelectionModel = model;
+ }
- public class ListViewCellListener implements GridCellListener
- {
- public void onCellClick(GridPanel grid, int rowIndex, int colindex, EventObject e)
- {
- selectedRowIndex = rowIndex;
- }
+ public class ListViewCellListener implements GridCellListener
+ {
+ public void onCellClick(GridPanel grid, int rowIndex, int colindex, EventObject e)
+ {
+ selectedRowIndex = rowIndex;
+ }
- public void onCellContextMenu(GridPanel gridPanel, int i, int i1, EventObject eventObject)
- {
+ public void onCellContextMenu(GridPanel gridPanel, int i, int i1, EventObject eventObject)
+ {
- }
+ }
- public void onCellDblClick(GridPanel gridPanel, int i, int i1, EventObject eventObject)
- {
+ public void onCellDblClick(GridPanel gridPanel, int i, int i1, EventObject eventObject)
+ {
- }
- }
+ }
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -74,14 +74,14 @@
super();
this.modelModificationCallback = callback;
- //this.title = titleName;
+ this.title = titleName;
this.view = view;
this.resourceUrl = resourceUrl;
this.setId(getId() + "(" + titleName + ")");
// ----------------------------------------
- this.setPaddings(10, 0, 0, 0);
+ this.setPaddings(10);
this.setHeader(false);
this.setBorder(false);
this.setFrame(false);
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-01-19 14:06:26 UTC (rev 3675)
@@ -1,3 +1,3 @@
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
-org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
+org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
Modified: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java 2009-01-19 14:00:29 UTC (rev 3674)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java 2009-01-19 14:06:26 UTC (rev 3675)
@@ -155,7 +155,7 @@
ProcessDefinitionRef testPd = getTestProcessDefinition(processDefinitions);
assertNotNull("No test definition given: " +processDefinitions, testPd);
- list.launchView(testPd); // will create an instance editor
+ list.launchInstanceView(testPd); // will create an instance editor
// lookup instance editor
String editorId = ProcessInstanceListView.createWidgetID(testPd);
More information about the jbpm-commits
mailing list