X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=server%2Fplugins%2Forg.argeo.jcr.ui.explorer%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fjcr%2Fui%2Fexplorer%2Futils%2FGenericNodeDoubleClickListener.java;h=4dff3b435768d17aded326756b21ae03ade7d170;hb=fc4c9f53197bc7c0a9a30bc6c55cfd1c162ebd9a;hp=da13a236602abe0e10b427804a650a1f01d0d9a5;hpb=ae696952b94054d3b9ec8ab05c02fc82d11607bf;p=lgpl%2Fargeo-commons.git diff --git a/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java b/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java index da13a2366..4dff3b435 100644 --- a/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java +++ b/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * 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.argeo.jcr.ui.explorer.utils; import javax.jcr.Node; @@ -44,13 +59,17 @@ public class GenericNodeDoubleClickListener implements IDoubleClickListener { .getFirstElement(); if (obj instanceof RepositoryNode) { RepositoryNode rpNode = (RepositoryNode) obj; - if (rpNode.getChildren().length == 0) { + if (!rpNode.isConnected()) { rpNode.login(); nodeViewer.refresh(obj); } // else do nothing } else if (obj instanceof WorkspaceNode) { - ((WorkspaceNode) obj).login(); + WorkspaceNode wn = (WorkspaceNode) obj; + if (wn.isConnected()) + wn.logout(); + else + wn.login(); nodeViewer.refresh(obj); } else if (obj instanceof SingleJcrNode) { SingleJcrNode sjn = (SingleJcrNode) obj;