Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
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.messages.Constants;
 
 import  com.google.gwt.core.client.GWT;
 import  com.google.gwt.user.client.ui.Frame;
 import  com.google.gwt.user.client.ui.VerticalPanel;
 import  com.gwtext.client.core.EventObject;
 import  com.gwtext.client.widgets.tree.TreeNode;
 import  com.gwtext.client.widgets.tree.TreePanel;
 import  com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;

Author(s):
Anton Arhipov
 
 public class AdministrationPanel extends GenericPanel {
     private static Constants constants = GWT.create(Constants.class);
 
     public AdministrationPanel(ExplorerViewCenterPanel tabbedPanel) {
 		super(.Administration(), tabbedPanel);
 		setIconCls("nav-admin"); //NON-NLS
 
 		TreePanel adminTree = basicTreeStructure(ExplorerNodeConfig
 				.getAdminStructure(), new TreePanelListenerAdapter() {
 			public void onClick(TreeNode self, EventObject e) {
 
 				int id = Integer.parseInt(self.getAttribute("id"));
 				switch (id) {
 				case 0:
 					if (!.showIfOpen("catman")) //NON-NLS
 						.addTab(.CategoryManager(), true,
 								new CategoryManager(), "catman"); //NON-NLS
 					break;
 				case 1:
 					if (!.showIfOpen("archman"))  //NON-NLS
 						.addTab(.ArchivedManager(), true,
 								"archman");      //NON-NLS
 					break;
 
 				case 2:
 					if (!.showIfOpen("stateman")) //NON-NLS
 						.addTab(.StateManager(), true,
 								new StateManager(), "stateman");
 					break;
 				case 3:
 					if (!.showIfOpen("bakman"))
 						.addTab(.ImportExport(), true,
 								new BackupManager(), "bakman");
 					break;
 
 				case 4:
 					if (!.showIfOpen("errorLog"))
 						.addTab(.EventLog(), true,
 								new LogViewer(), "errorLog");
 					break;
 				case 5:
 					if (!.showIfOpen("securityPermissions"))
 						.addTab(.UserPermissionMappings(),
 								truenew PermissionViewer(),
 								"securityPermissions");
 					break;
 				case 6:
 					Frame aboutFrame = new Frame("version.txt");  //NON-NLS
 
 					FormStylePopup aboutPop = new FormStylePopup();
                     aboutPop.setWidth(600);
 					aboutPop.setTitle(.About());
 					String hhurl = GWT.getModuleBaseURL() + "webdav";
 					aboutPop.addAttribute(.WebDAVURL(), new SmallLabel("<b>"
 							+ hhurl + "</b>"));
 					aboutPop.addAttribute(.Version() + ":"aboutFrame);
 					aboutPop.show();
 					break;
                                    case 7:
                                        if (!.showIfOpen("ruleVerifierManager"))
						.addTab(.RulesVerificationManager(),
								truenew RuleVerifierManager(),
								"ruleVerifierManager");
                                        break;
				}
			}
		});
		adminTree.setRootVisible(false);
		VerticalPanel adminPanel = new VerticalPanel();
		adminPanel.add(adminTree);
		adminPanel.setWidth("100%");
		add(adminPanel);
	}
New to GrepCode? Check out our FAQ X