[jboss-svn-commits] JBL Code SVN: r35469 - in labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client: ruleeditor and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Oct 8 11:34:22 EDT 2010


Author: jervisliu
Date: 2010-10-08 11:34:20 -0400 (Fri, 08 Oct 2010)
New Revision: 35469

Removed:
   labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/CategoriesPanel.java
   labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/DeploymentPanel.java
   labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesPanel.java
   labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/QAPanel.java
Modified:
   labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesTree.java
   labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/DiscussionWidget.java
Log:
Remove unused classes. 

Deleted: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/CategoriesPanel.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/CategoriesPanel.java	2010-10-08 15:11:02 UTC (rev 35468)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/CategoriesPanel.java	2010-10-08 15:34:20 UTC (rev 35469)
@@ -1,217 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * 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.drools.guvnor.client.explorer;
-
-import org.drools.guvnor.client.common.GenericCallback;
-import org.drools.guvnor.client.rpc.*;
-import org.drools.guvnor.client.ruleeditor.MultiViewRow;
-import org.drools.guvnor.client.rulelist.AssetItemGrid;
-import org.drools.guvnor.client.rulelist.AssetItemGridDataLoader;
-import org.drools.guvnor.client.rulelist.EditItemEvent;
-import org.drools.guvnor.client.security.Capabilities;
-import org.drools.guvnor.client.messages.Constants;
-
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.core.client.GWT;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Toolbar;
-import com.gwtext.client.widgets.ToolbarMenuButton;
-import com.gwtext.client.widgets.event.SplitButtonListenerAdapter;
-import com.gwtext.client.widgets.menu.Menu;
-import com.gwtext.client.widgets.tree.TreeNode;
-import com.gwtext.client.widgets.tree.TreePanel;
-import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
-
-/**
- * @author Anton Arhipov
- */
-public class CategoriesPanel extends GenericPanel {
-    private static Constants constants = GWT.create(Constants.class);
-
-
-
-    /** Table set up for the inboxes */
-    static {
-            TableConfig conf = new TableConfig();
-            conf.headers = new String[2];
-            conf.headers[0] = constants.Name();// "Name ";
-            conf.headers[1] = constants.Date();//"Date ";
-            conf.headerTypes = new String[2];
-            conf.headerTypes[0] = "class java.lang.String";
-            conf.headerTypes[1] = "class java.util.Calendar";
-            conf.rowsPerPage = 500;
-            AssetItemGrid.registerTableConf(conf, ExplorerNodeConfig.RECENT_EDITED_ID);
-            AssetItemGrid.registerTableConf(conf, ExplorerNodeConfig.RECENT_VIEWED_ID);
-
-            conf = new TableConfig();
-            conf.headers = new String[3];
-            conf.headers[0] = constants.Name();
-            conf.headers[1] = constants.Date();
-            conf.headers[2] = constants.From();
-            conf.headerTypes = new String[3];
-            conf.headerTypes[0] = "class java.lang.String";
-            conf.headerTypes[1] = "class java.util.Calendar";
-            conf.headerTypes[2] = "class java.lang.String";
-            conf.rowsPerPage = 500;
-
-            AssetItemGrid.registerTableConf(conf, ExplorerNodeConfig.INCOMING_ID);
-    }
-
-
-    public CategoriesPanel(ExplorerViewCenterPanel tabbedPanel) {
-        super(constants.Browse(), tabbedPanel);
-        setIconCls("nav-categories"); //NON-NLS
-
-        
-        Toolbar rulesToolBar = new Toolbar();
-
-        final ToolbarMenuButton menuButton = new ToolbarMenuButton(constants.CreateNew(), /*RulesNewMenu.getMenu( this )*/ new Menu() );
-        rulesToolBar.addButton( menuButton );
-        menuButton.addListener( new SplitButtonListenerAdapter() {
-
-            public void onClick(Button button,
-                                EventObject e) {
-                menuButton.showMenu();
-            }
-        } );
-        
-        VerticalPanel rulesPanel = new VerticalPanel();
-        if (ExplorerLayoutManager.shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
-            rulesPanel.add(rulesToolBar);
-        }
-
-        TreePanel categoryTree = basicTreeStructure(/*ExplorerNodeConfig.getRulesStructure()*/new TreeNode(), new TreePanelListenerAdapter() {
-            public void onClick(final TreeNode self, EventObject e) {
-                
-                //this refreshes the list.
-                if (self.getAttribute("id").equals(ExplorerNodeConfig.CATEGORY_ID)) {  //NON-NLS
-                    self.getParentNode().replaceChild(/*ExplorerNodeConfig.getCategoriesStructure()*/new TreeNode(), self);
-                } else if (self.getAttribute("id").equals(ExplorerNodeConfig.STATES_ID)) {   //NON-NLS
-                    self.getParentNode().replaceChild(/*ExplorerNodeConfig.getStatesStructure()*/new TreeNode(), self);
-                } else if (self.getAttribute("id").equals("FIND")) {     //NON-NLS
-                    centertabbedPanel.openFind();
-                } else if (self.getAttribute("id").startsWith("inbox")) {
-                	Boolean open = (Boolean) self.getAttributeAsObject("open");
-                	if (open == null || open) {
-                		openInbox(self.getText(), (String)self.getUserObject());
-                	}
-                } else {
-                    openStateOrCategory(self);
-                }
-
-            }
-        });
-
-
-        rulesPanel.add(categoryTree);
-        rulesPanel.setWidth("100%");
-        add(rulesPanel);
-    }
-
-    /**
-     * Show the inbox of the given name.
-     */
-    private void openInbox(String title, final String inboxName) {
-        if (!centertabbedPanel.showIfOpen(inboxName)) {
-            AssetItemGrid g = new AssetItemGrid(createEditEvent(), inboxName, new AssetItemGridDataLoader() {
-                public void loadData(int startRow, int numberOfRows, GenericCallback<TableDataResult> cb) {
-                    RepositoryServiceFactory.getService().loadInbox(inboxName, cb);
-                }
-            });
-            centertabbedPanel.addTab(title, g, inboxName);
-        }
-    }
-
-    /**
-     * open a state or category !
-     */
-    private void openStateOrCategory(TreeNode self) {
-        final String key = (String) self.getUserObject();
-        final boolean isState = key.startsWith("-");
-
-        if (!centertabbedPanel.showIfOpen(key)) {
-            final AssetItemGrid list = new AssetItemGrid(createEditEvent(),
-                    AssetItemGrid.RULE_LIST_TABLE_ID,
-                    new AssetItemGridDataLoader() {
-                        public void loadData(int skip, int numberOfRows, GenericCallback cb) {
-                            if (isState) {
-                                RepositoryServiceFactory.getService().
-                                        loadRuleListForState(key.substring(1), skip,
-                                                numberOfRows, AssetItemGrid.RULE_LIST_TABLE_ID, cb);
-                            } else {
-                                RepositoryServiceFactory.getService().
-                                        loadRuleListForCategories(key, skip, numberOfRows,
-                                                AssetItemGrid.RULE_LIST_TABLE_ID, cb);
-                            }
-                        }
-                    },
-                    (isState) ? null : GWT.getModuleBaseURL() + "feed/category?name=" + key + "&viewUrl=" + getSelfURL());
-           final ServerPushNotification push = new ServerPushNotification() {
-                public void messageReceived(PushResponse response) {
-                    if (!isState) {
-                        if (response.messageType.equals("categoryChange") && response.message.equals(key)) {
-                            list.refreshGrid();
-                        }
-                    } else {
-                        if (response.messageType.equals("statusChange") && ("-" + response.message).equals(key)) {
-                            list.refreshGrid();
-                        }
-                    }
-                }
-            };
-            PushClient.instance().subscribe(push);
-            list.addUnloadListener(new Command() {
-                public void execute() {
-                    PushClient.instance().unsubscribe(push);
-                }
-            });
-
-            centertabbedPanel.addTab(((isState) ? constants.Status() : constants.CategoryColon()) + self.getText(), list, key);
-        }
-    }
-
-    private EditItemEvent createEditEvent() {
-        return new EditItemEvent() {
-            public void open(String uuid) {
-                centertabbedPanel.openAsset(uuid);
-            }
-
-            public void open(MultiViewRow[] rows) {
-                for ( MultiViewRow row: rows) {
-                    centertabbedPanel.openAsset( row.uuid );
-                }
-            }
-        };
-    }
-
-
-    /**
-     * The URL that will be used to open up assets in a feed.
-     * (by tacking asset id on the end, of course !). 
-     */
-    public static String getSelfURL() {
-        String selfURL = Window.Location.getHref();
-        if (selfURL.contains("#")) {
-            selfURL = selfURL.substring(0, selfURL.indexOf("#"));
-        }
-        return selfURL;
-    }
-
-}

Deleted: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/DeploymentPanel.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/DeploymentPanel.java	2010-10-08 15:11:02 UTC (rev 35468)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/DeploymentPanel.java	2010-10-08 15:34:20 UTC (rev 35469)
@@ -1,218 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * 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.drools.guvnor.client.explorer;
-
-import org.drools.guvnor.client.common.GenericCallback;
-import org.drools.guvnor.client.messages.Constants;
-import org.drools.guvnor.client.packages.SnapshotView;
-import org.drools.guvnor.client.rpc.PackageConfigData;
-import org.drools.guvnor.client.rpc.RepositoryServiceFactory;
-import org.drools.guvnor.client.rpc.SnapshotInfo;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.data.Node;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Toolbar;
-import com.gwtext.client.widgets.ToolbarMenuButton;
-import com.gwtext.client.widgets.event.PanelListenerAdapter;
-import com.gwtext.client.widgets.event.SplitButtonListenerAdapter;
-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;
-import com.gwtext.client.widgets.tree.TreeNode;
-import com.gwtext.client.widgets.tree.TreePanel;
-import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
-
-/**
- * @author Anton Arhipov
- */
-public class DeploymentPanel extends GenericPanel {
-
-    private boolean deploymentPackagesLoaded = false;
-    private static Constants constants = ((Constants) GWT.create(Constants.class));
-
-    public DeploymentPanel(ExplorerViewCenterPanel tabbedPanel) {
-        super(constants.PackageSnapshots(), tabbedPanel);
-        setIconCls("nav-deployment"); //NON-NLS
-
-        final VerticalPanel deploymentPanel = new VerticalPanel();
-        Toolbar deployToolbar = new Toolbar();
-        final ToolbarMenuButton menuButton = new ToolbarMenuButton(constants.Deploy(), deploymentMenu());
-        deployToolbar.addButton( menuButton );
-        deploymentPanel.add(deployToolbar);
-        deploymentPanel.setWidth("100%");
-
-        menuButton.addListener( new SplitButtonListenerAdapter() {
-            public void onClick(Button button,
-                                EventObject e) {
-                menuButton.showMenu();
-            }
-        } );
-
-        addListener(new PanelListenerAdapter() {
-            public void onExpand(Panel panel) {
-                if (!deploymentPackagesLoaded) {
-                    deploymentPanel.add(deploymentExplorer());
-                    deploymentPackagesLoaded = true;
-                }
-            }
-        });
-
-        add(deploymentPanel);
-
-    }
-
-    private Menu deploymentMenu() {
-        Menu m = new Menu();
-
-        Item nds = new Item(constants.NewDeploymentSnapshot(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                SnapshotView.showNewSnapshot(null);
-            }
-        });
-        nds.setIcon("images/snapshot_small.gif"); //NON-NLS
-        m.addItem(nds);
-
-        Item rebuild = new Item(constants.RebuildAllSnapshotBinaries(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                SnapshotView.rebuildBinaries();
-            }
-        });
-        rebuild.setIcon("images/refresh.gif");             //NON-NLS
-        m.addItem(rebuild);
-
-        return m;
-    }
-
-    private Widget deploymentExplorer() {
-
-        final TreeNode root = new TreeNode(constants.PackageSnapshots());
-        root.setIcon("images/silk/chart_organisation.gif"); //NON-NLS
-        root.setId("snapshotRoot");                         //NON-NLS
-
-        final TreePanel panel = genericExplorerWidget(root);
-
-
-        deploymentListPackages(root);
-
-        panel.addListener(new TreePanelListenerAdapter() {
-
-            public void onCollapseNode(TreeNode node) {
-                Node[] children = node.getChildNodes();
-
-                for (Node child : children) {
-                    node.removeChild(child);
-                }
-
-                if (node.getId().equals("snapshotRoot")) {
-                    deploymentListPackages(root);
-                } else {
-                    node.appendChild(new TreeNode(constants.PleaseWaitDotDotDot()));
-                }
-            }
-
-			public void onExpandNode(final TreeNode node) {
-				if (node.getId().equals("snapshotRoot")) { // NON-NLS
-					return;
-				}
-				final PackageConfigData conf = (PackageConfigData) node.getUserObject();
-				if (conf != null) {
-					RepositoryServiceFactory.getService().listSnapshots(conf.name,
-							new GenericCallback<SnapshotInfo[]>() {
-								public void onSuccess(SnapshotInfo[] snaps) {
-									for (final SnapshotInfo snapInfo : snaps) {
-										TreeNode snap = new TreeNode();
-										snap.setTooltip(snapInfo.comment);
-										snap.setText(snapInfo.name);
-										snap.setUserObject(new Object[] { snapInfo, conf });
-										node.appendChild(snap);
-									}
-									node.removeChild(node.getFirstChild());
-								}
-							});
-				}
-			}
-
-            public void onClick(TreeNode node, EventObject e) {
-
-                if (node.getUserObject() instanceof Object[]) {
-//                	Node[] children = node.getParentNode().getChildNodes();
-//                	for(Node n : children) {
-//                		n.remove();
-//                	}
-                    Object[] o = (Object[]) node.getUserObject();
-                    final String snapName = ((SnapshotInfo) o[0]).name;
-                    PackageConfigData conf = (PackageConfigData) o[1];
-                    RepositoryServiceFactory.getService().listSnapshots(conf.name, new GenericCallback<SnapshotInfo[]>() {
-                        public void onSuccess(SnapshotInfo[] a) {
-                            for(SnapshotInfo snap : a) {
-                            	if (snap.name.equals(snapName)) {
-                            		centertabbedPanel.openSnapshot(snap);
-                            		return;
-                            	}
-                            }
-                        }
-                    });
-
-                }
-            }
-        });
-
-        //return PackagesPanel.wrapScroll(panel);
-        return null;
-    }
-
-	private void deploymentListPackages(final TreeNode root) {
-		RepositoryServiceFactory.getService().listPackages(new GenericCallback<PackageConfigData[]>() {
-			public void onSuccess(PackageConfigData[] values) {
-				PackageHierarchy ph = new PackageHierarchy();
-
-				for (PackageConfigData val : values) {
-					ph.addPackage(val);
-				}
-				for (PackageHierarchy.Folder hf : ph.root.children) {
-					buildDeploymentTree(root, hf);
-				}
-				root.expand();
-			}
-		});
-	}
-
-    private void buildDeploymentTree(TreeNode root, PackageHierarchy.Folder fldr) {
-        if (fldr.conf != null) {
-            TreeNode pkg = new TreeNode(fldr.conf.name);
-            pkg.setIcon("images/snapshot_small.gif");
-            pkg.setUserObject(fldr.conf);
-            pkg.appendChild(new TreeNode(constants.PleaseWaitDotDotDot()));
-            root.appendChild(pkg);
-        } else {
-            TreeNode tn = new TreeNode();
-            tn.setText(fldr.name);
-            tn.setIcon("images/empty_package.gif"); //NON-NLS
-            root.appendChild(tn);
-            for (PackageHierarchy.Folder c : fldr.children) {
-                buildDeploymentTree(tn, c);
-            }
-        }
-    }
-
-}

Deleted: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesPanel.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesPanel.java	2010-10-08 15:11:02 UTC (rev 35468)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesPanel.java	2010-10-08 15:34:20 UTC (rev 35469)
@@ -1,417 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * 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.drools.guvnor.client.explorer;
-
-import org.drools.guvnor.client.common.AssetFormats;
-import org.drools.guvnor.client.common.GenericCallback;
-import org.drools.guvnor.client.common.LoadingPopup;
-import org.drools.guvnor.client.common.RulePackageSelector;
-import org.drools.guvnor.client.messages.Constants;
-import org.drools.guvnor.client.packages.NewPackageWizard;
-import org.drools.guvnor.client.rpc.PackageConfigData;
-import org.drools.guvnor.client.rpc.PushClient;
-import org.drools.guvnor.client.rpc.PushResponse;
-import org.drools.guvnor.client.rpc.RepositoryServiceFactory;
-import org.drools.guvnor.client.rpc.ServerPushNotification;
-import org.drools.guvnor.client.rpc.TableDataResult;
-import org.drools.guvnor.client.ruleeditor.MultiViewRow;
-import org.drools.guvnor.client.rulelist.AssetItemGrid;
-import org.drools.guvnor.client.rulelist.AssetItemGridDataLoader;
-import org.drools.guvnor.client.rulelist.EditItemEvent;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.WindowResizeListener;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.data.Node;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Toolbar;
-import com.gwtext.client.widgets.ToolbarMenuButton;
-import com.gwtext.client.widgets.event.PanelListenerAdapter;
-import com.gwtext.client.widgets.event.SplitButtonListenerAdapter;
-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;
-import com.gwtext.client.widgets.tree.TreeNode;
-import com.gwtext.client.widgets.tree.TreePanel;
-import com.gwtext.client.widgets.tree.event.TreePanelListener;
-import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
-
-/**
- * @author Anton Arhipov
- */
-public class PackagesPanel extends GenericPanel {
-
-    private VerticalPanel packagesPanel;
-    private boolean packagesLoaded = false;
-    private static final Constants constants = ((Constants) GWT.create(Constants.class));
-
-    public PackagesPanel(ExplorerViewCenterPanel tabbedPanel) {
-        super(constants.KnowledgeBases(), tabbedPanel);
-        setIconCls("nav-packages"); //NON-NLS
-
-        Toolbar pkgToolbar = new Toolbar();
-        final ToolbarMenuButton menuButton = new ToolbarMenuButton(constants.CreateNew(), packageNewMenu());
-        pkgToolbar.addButton( menuButton );
-
-        menuButton.addListener( new SplitButtonListenerAdapter() {
-
-            public void onClick(Button button,
-                                EventObject e) {
-                menuButton.showMenu();
-            }
-        } );
-        
-        packagesPanel = new VerticalPanel();
-        packagesPanel.setWidth("100%");
-        packagesPanel.add(pkgToolbar);
-
-        //these panels are lazy loaded to easy startup wait time.
-        addListener(new PanelListenerAdapter() {
-        	public void onExpand(Panel panel) {
-                loadPackageList();
-            }
-        });
-
-        add(packagesPanel);
-
-    }
-
-    public void loadPackageList() {
-        if (!packagesLoaded) {
-            packagesPanel.add(packageExplorer(centertabbedPanel));
-            packagesLoaded = true;
-        }
-    }
-
-    //TODO: move it to separate class
-    private Menu packageNewMenu() {
-        Menu m = new Menu();
-        m.addItem(new Item(constants.NewPackage1(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                NewPackageWizard wiz = new NewPackageWizard(new Command() {
-                    public void execute() {
-                        refreshPackageTree();
-                    }
-                });
-                wiz.show();
-            }
-        }, "images/new_package.gif")); //NON-NLS
-
-        //SubPackage are currently not used.
-//        m.addItem(new Item(constants.NewSubPackage(), new BaseItemListenerAdapter() {
-//            public void onClick(BaseItem item, EventObject e) {
-//                NewSubPackageWizard wiz = new NewSubPackageWizard(new Command() {
-//                    public void execute() {
-//                        refreshPackageTree();
-//                    }
-//                });
-//                wiz.show();
-//            }
-//        }, "images/new_package.gif")); //NON-NLS
-        
-        m.addItem(new Item(constants.NewWorkingSet(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.WORKING_SET, constants.NewWorkingSet(), false);
-            }
-        }, "images/new_package.gif"));          //NON-NLS
-        
-        m.addItem(new Item(constants.NewRule(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(null, constants.NewRule(), true);
-            }
-        }, "images/rule_asset.gif"));          //NON-NLS
-
-        m.addItem(new Item(constants.UploadPOJOModelJar(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.MODEL, constants.NewModelArchiveJar(), false);
-            }
-        }, "images/model_asset.gif"));              //NON-NLS
-
-        m.addItem(new Item(constants.NewDeclarativeModel(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.DRL_MODEL, constants.NewDeclarativeModelUsingGuidedEditor(), false);
-            }
-        }, "images/model_asset.gif")); //NON-NLS
-
-        if (Preferences.getBooleanPref("flex-bpel-editor")) {
-			m.addItem(new Item(constants.NewBPELPackage(),
-					new BaseItemListenerAdapter() {
-						public void onClick(BaseItem item, EventObject e) {
-							launchWizard(AssetFormats.BPEL_PACKAGE, constants
-									.CreateANewBPELPackage(), false);
-						}
-					}, "images/model_asset.gif")); // NON-NLS
-		}
-
-        m.addItem(new Item(constants.NewFunction(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.FUNCTION, constants.CreateANewFunction(), false);
-            }
-        }, "images/function_assets.gif")); //NON-NLS
-
-
-        m.addItem(new Item(constants.NewDSL(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.DSL, constants.CreateANewDSLConfiguration(), false);
-            }
-        }, "images/dsl.gif"));   //NON-NLS
-
-
-        m.addItem(new Item(constants.NewRuleFlow(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.RULE_FLOW_RF, constants.CreateANewRuleFlow(), false);
-            }
-        }, "images/ruleflow_small.gif")); //NON-NLS
-        
-        m.addItem(new Item(constants.NewEnumeration(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.ENUMERATION, constants.CreateANewEnumerationDropDownMapping(), false);
-            }
-        }, "images/new_enumeration.gif")); //NON-NLS
-
-        m.addItem(new Item(constants.NewTestScenario(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.TEST_SCENARIO, constants.CreateATestScenario(), false);
-            }
-        }, "images/test_manager.gif")); //NON-NLS
-
-        m.addItem(new Item(constants.NewFile(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard("*", constants.CreateAFile(), false);
-            }
-        }, "images/new_file.gif")); //NON-NLS
-
-
-        m.addItem(new Item(constants.RebuildAllPackageBinariesQ(), new BaseItemListenerAdapter() {
-            public void onClick(BaseItem item, EventObject e) {
-                if (Window.confirm(constants.RebuildConfirmWarning())) {
-                    LoadingPopup.showMessage(constants.RebuildingPackageBinaries());
-                    RepositoryServiceFactory.getService().rebuildPackages(new GenericCallback<Void>() {
-                        public void onSuccess(Void data) {
-                            LoadingPopup.close();
-                        }
-                    });
-                }
-
-            }
-        }, "images/refresh.gif")); //NON-NLS
-
-        m.addItem(new Item(constants.NewRuleTemplate(), new BaseItemListenerAdapter() {
-            @Override
-            public void onClick(BaseItem item, EventObject e) {
-                launchWizard(AssetFormats.RULE_TEMPLATE, constants.NewRuleTemplate(), true);
-            }
-        }, "images/new_template.gif")); //NON-NLS
-        
-        return m;
-    }
-
-    private void refreshPackageTree() {
-        packagesPanel.remove(1);
-        packagesPanel.add(packageExplorer(centertabbedPanel));
-    }
-
-	private Widget packageExplorer(final ExplorerViewCenterPanel tabPanel) {
-		TreeNode rootNode = new TreeNode(constants.Admin());
-
-		TreeNode packageRootNode = new TreeNode(constants.Packages());
-		packageRootNode.setAttribute("icon", "images/silk/chart_organisation.gif"); // NON-NLS
-		loadPackages(packageRootNode);
-
-		/*
-		 * TreeNode globalRootNode = new TreeNode("Global area");
-		 * globalRootNode.setAttribute("icon",
-		 * "images/silk/chart_organisation.gif"); //NON-NLS
-		 * globalRootNode.setAttribute("id", "globalarea");
-		 */
-		loadGlobal(rootNode);
-
-		rootNode.appendChild(packageRootNode);
-		// rootNode.appendChild(globalRootNode);
-
-		final TreePanel panel = genericExplorerWidget(rootNode);
-		panel.setRootVisible(false);
-
-		TreePanelListener treePanelListener = new TreePanelListenerAdapter() {
-			public void onClick(TreeNode node, EventObject e) {
-				if (node.getUserObject() instanceof PackageConfigData
-						&& !"global".equals(((PackageConfigData) node.getUserObject()).name)) {
-					PackageConfigData pc = (PackageConfigData) node.getUserObject();
-					RulePackageSelector.currentlySelectedPackage = pc.name;
-
-					String uuid = pc.uuid;
-					centertabbedPanel.openPackageEditor(uuid, new Command() {
-						public void execute() {
-							// refresh the package tree.
-							refreshPackageTree();
-						}
-					});
-				} else if (node.getUserObject() instanceof Object[]) {
-					Object[] uo = (Object[]) node.getUserObject();
-					final String[] fmts = (String[]) uo[0];
-					final PackageConfigData pc = (PackageConfigData) node.getParentNode().getUserObject();
-					RulePackageSelector.currentlySelectedPackage = pc.name;
-					String key = key(fmts, pc);
-					if (!centertabbedPanel.showIfOpen(key)) {
-
-						final AssetItemGrid list = new AssetItemGrid(new EditItemEvent() {
-							public void open(String uuid) {
-								centertabbedPanel.openAsset(uuid);
-							}
-
-							public void open(MultiViewRow[] rows) {
-								centertabbedPanel.openAssets(rows);
-							}
-						}, AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID, new AssetItemGridDataLoader() {
-							public void loadData(int startRow, int numberOfRows, GenericCallback<TableDataResult> cb) {
-								RepositoryServiceFactory.getService().listAssets(pc.uuid, fmts, startRow, numberOfRows,
-										AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID, cb);
-							}
-						}, GWT.getModuleBaseURL() + "feed/package?name=" + pc.name + "&viewUrl="
-								+ CategoriesPanel.getSelfURL() + "&status=*");
-						tabPanel.addTab(uo[1] + " [" + pc.name + "]", list, key);
-
-						final ServerPushNotification sub = new ServerPushNotification() {
-							public void messageReceived(PushResponse response) {
-								if (response.messageType.equals("packageChange") && response.message.equals(pc.name)) {
-									list.refreshGrid();
-								}
-							}
-						};
-						PushClient.instance().subscribe(sub);
-						list.addUnloadListener(new Command() {
-							public void execute() {
-								PushClient.instance().unsubscribe(sub);
-							}
-						});
-					}
-				}
-			}
-
-
-            @Override
-            public void onCollapseNode(final TreeNode node) {
-                if (node.getText().equals(constants.Packages())) {
-                    Node[] children = node.getChildNodes();
-                    for (Node child : children) {
-                        node.removeChild(child);
-                    }
-                    loadPackages(node);
-                }
-            }
-
-
-        };
-        // register listener
-        panel.addListener(treePanelListener);
-
-        final ScrollPanel scp = wrapScroll(panel);
-
-
-        return scp;
-    }
-
-    public static ScrollPanel wrapScroll(TreePanel panel) {
-        final ScrollPanel scp = new ScrollPanel(panel);
-
-
-        Window.addWindowResizeListener(new WindowResizeListener() {
-            public void onWindowResized(int width, int height) {
-                scp.setHeight((int) (Window.getClientHeight() / 1.8) + "px"); //NON-NLS
-            }
-        });
-        scp.setHeight((int) (Window.getClientHeight() / 1.8) + "px"); //NON-NLS
-        return scp;
-    }
-
-    private void loadPackages(final TreeNode root) {
-        RepositoryServiceFactory.getService().listPackages(
-                new GenericCallback<PackageConfigData[]>() {
-                    public void onSuccess(PackageConfigData[] value) {
-                        PackageHierarchy ph = new PackageHierarchy();
-
-                        for (PackageConfigData val : value) {
-                            ph.addPackage(val);
-                        }
-
-                        for (PackageHierarchy.Folder hf : ph.root.children) {
-                            buildPkgTree(root, hf);
-                        }
-
-                        //root.expand();
-                    }
-                });
-    }
-
-    private void loadGlobal(final TreeNode root) {
-        RepositoryServiceFactory.getService().loadGlobalPackage(
-                new GenericCallback<PackageConfigData>() {
-                    public void onSuccess(PackageConfigData value) {
-
-                                TreeNode globalRootNode = /*ExplorerNodeConfig.getPackageItemStructure("Global Area", value.uuid)*/new TreeNode();
-                                globalRootNode.setUserObject(value);
-                                
-                                globalRootNode.setAttribute("icon", "images/silk/chart_organisation.gif");   //NON-NLS
-                                globalRootNode.setAttribute("id", "globalarea");
-                        		
-                                root.appendChild(globalRootNode);
-
-                    }
-                });
-    }
-    
-    private void buildPkgTree(TreeNode root, PackageHierarchy.Folder fldr) {
-        if (fldr.conf != null) {
-            root.appendChild(loadPackage(fldr.name, fldr.conf));
-        } else {
-            TreeNode tn = new TreeNode();
-            tn.setText(fldr.name);
-            tn.setIcon("images/empty_package.gif"); //NON-NLS
-            root.appendChild(tn);
-            for (PackageHierarchy.Folder c : fldr.children) {
-                buildPkgTree(tn, c);
-            }
-        }
-    }
-
-    private TreeNode loadPackage(String name, PackageConfigData conf) {
-        TreeNode pn = /*ExplorerNodeConfig.getPackageItemStructure(name, conf.uuid)*/new TreeNode();
-//        TreeNode wsNode = new TreeNode(constants.WorkingSets(), "images/workingset.gif");
-//        ExplorerNodeConfig.getWorkingSetItemsStructure(wsNode, conf.workingsets);
-//        pn.appendChild(wsNode);
-        pn.setUserObject(conf);
-        return pn;
-    }
-
-    public static String key(String[] fmts, PackageConfigData userObject) {
-        String key = userObject.uuid;
-        for (String fmt : fmts) {
-            key = key + fmt;
-        }
-        if (fmts.length == 0) {
-            key = key + "[0]";
-        }
-        return key;
-    }
-}

Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesTree.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesTree.java	2010-10-08 15:11:02 UTC (rev 35468)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/PackagesTree.java	2010-10-08 15:34:20 UTC (rev 35469)
@@ -214,7 +214,7 @@
 								AssetItemGrid.PACKAGEVIEW_LIST_TABLE_ID, cb);
 					}
 				}, GWT.getModuleBaseURL() + "feed/package?name=" + pc.name + "&viewUrl="
-						+ CategoriesPanel.getSelfURL() + "&status=*");
+						+ BrowseTree.getSelfURL() + "&status=*");
 				centertabbedPanel.addTab(node.getText() + " [" + pc.name + "]", list, key);
 
 				final ServerPushNotification sub = new ServerPushNotification() {

Deleted: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/QAPanel.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/QAPanel.java	2010-10-08 15:11:02 UTC (rev 35468)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/QAPanel.java	2010-10-08 15:34:20 UTC (rev 35469)
@@ -1,45 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * 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.drools.guvnor.client.explorer;
-
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.core.client.GWT;
-import com.gwtext.client.widgets.tree.TreeNode;
-import com.gwtext.client.widgets.tree.TreePanel;
-import org.drools.guvnor.client.messages.Constants;
-
-/**
- * @author Anton Arhipov
- */
-public class QAPanel extends GenericPanel {
-    private static Constants constants = ((Constants) GWT.create(Constants.class));
-
-    public QAPanel(ExplorerViewCenterPanel tabbedPanel) {
-
-        super(constants.QA1(), tabbedPanel);
-        setIconCls("nav-qa"); //NON-NLS
-
-        final VerticalPanel qaPanel = new VerticalPanel();
-        qaPanel.setWidth("100%");
-        TreePanel qaTree = genericExplorerWidget(/*ExplorerNodeConfig.getQAStructure(centertabbedPanel)*/new TreeNode());
-        qaTree.setRootVisible(false);
-        qaPanel.add(PackagesPanel.wrapScroll(qaTree));
-        
-        add(qaPanel);
-    }
-
-}

Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/DiscussionWidget.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/DiscussionWidget.java	2010-10-08 15:11:02 UTC (rev 35468)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/DiscussionWidget.java	2010-10-08 15:34:20 UTC (rev 35469)
@@ -22,7 +22,7 @@
 
 import org.drools.guvnor.client.common.GenericCallback;
 import org.drools.guvnor.client.common.SmallLabel;
-import org.drools.guvnor.client.explorer.CategoriesPanel;
+import org.drools.guvnor.client.explorer.BrowseTree;
 import org.drools.guvnor.client.explorer.ExplorerLayoutManager;
 import org.drools.guvnor.client.messages.Constants;
 import org.drools.guvnor.client.rpc.DiscussionRecord;
@@ -169,7 +169,7 @@
         }
 
         String feedURL = GWT.getModuleBaseURL() + "feed/discussion?package=" + asset.metaData.packageName+
-                "&assetName=" + URL.encode(asset.metaData.name) + "&viewUrl=" + CategoriesPanel.getSelfURL();
+                "&assetName=" + URL.encode(asset.metaData.name) + "&viewUrl=" + BrowseTree.getSelfURL();
         hp.add(new HTML("<a href='" + feedURL + "' target='_blank'><img src='images/feed.png'/></a>"));
 
         newCommentLayout.add(hp);



More information about the jboss-svn-commits mailing list