[jboss-svn-commits] JBL Code SVN: r33933 - labs/jbossrules/trunk/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jul 16 05:47:19 EDT 2010


Author: dennyxu
Date: 2010-07-16 05:47:18 -0400 (Fri, 16 Jul 2010)
New Revision: 33933

Modified:
   labs/jbossrules/trunk/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions/EditConnectionAction.java
Log:
JBIDE-6618: Edit Repository connection popmenu should only be appear for the selection of repository location

Modified: labs/jbossrules/trunk/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions/EditConnectionAction.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions/EditConnectionAction.java	2010-07-16 07:12:34 UTC (rev 33932)
+++ labs/jbossrules/trunk/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions/EditConnectionAction.java	2010-07-16 09:47:18 UTC (rev 33933)
@@ -64,63 +64,6 @@
 	    dialog.create();
 	    dialog.open();
 	    
-//		String repositoryLoc = null;
-//		String fullPath = null;
-		
-//		if (selectedNode != null) {
-//			repositoryLoc = selectedNode.getGuvnorRepository().getLocation();
-//			fullPath = selectedNode.getFullPath();
-//		} else {
-//			if (selectedFile == null
-//		       || props == null) {
-//				return;
-//			}
-//			repositoryLoc = props.getRepository();
-//			fullPath = props.getFullpath();
-//		}
-//		
-//		IResponse response = null;
-//		try {
-//			IWebDavClient client = WebDavServerCache.getWebDavClient(repositoryLoc);
-//			if (client == null) {
-//				client = WebDavClientFactory.createClient(new URL(repositoryLoc));
-//				WebDavServerCache.cacheWebDavClient(repositoryLoc, client);
-//			}
-//			InputStream ins = null;
-//			try {
-//				response = client.getResourceVersions(fullPath);
-//				ins = response.getInputStream();
-//			} catch (WebDavException wde) {
-//				if (wde.getErrorCode() != IResponse.SC_UNAUTHORIZED) {
-//					// If not an authentication failure, we don't know what to do with it
-//					throw wde;
-//				}
-//				boolean retry = PlatformUtils.getInstance().
-//									authenticateForServer(repositoryLoc, client); 
-//				if (retry) {
-//					response = client.getResourceVersions(fullPath);
-//					ins = response.getInputStream();
-//				}
-//			}
-//			if (ins != null) {
-//				Properties verProps = new Properties();
-//				verProps.load(ins);
-//				ResourceHistoryView view = PlatformUtils.getResourceHistoryView();
-//				if (view != null) {
-//					view.setEntries(repositoryLoc, fullPath, verProps);
-//				}
-//			}
-//		} catch (Exception e) {
-//			Activator.getDefault().displayError(IStatus.ERROR, e.getMessage(), e, true);
-//		} finally {
-//			if (response != null) {
-//				try {
-//					response.close();
-//				} catch (IOException ioe) {
-//					Activator.getDefault().writeLog(IStatus.ERROR, ioe.getMessage(), ioe);
-//				}
-//			}
-//		}
 	}
 
 	/*
@@ -140,9 +83,12 @@
 			return;
 		}
 		
-		if (sel.getFirstElement() instanceof TreeParent) {
-				rep = ((TreeParent)sel.getFirstElement()).getGuvnorRepository();
+		if (sel.getFirstElement() instanceof TreeObject) {
+			if (((TreeObject)sel.getFirstElement()).getNodeType() == TreeObject.Type.REPOSITORY) {
+				rep = ((TreeObject)sel.getFirstElement()).getGuvnorRepository();
 				action.setEnabled(true);
+			}
 		}
+		
 	}
 }



More information about the jboss-svn-commits mailing list