Fully remote browsing.
authorjlahoda
Sun, 28 Sep 2014 18:40:42 +0200
changeset 991a0ed58dcfb6c
parent 990 95c67e11516c
child 992 84c64742ad37
Fully remote browsing.
lib/nblibraries.properties
remoting/common/nbproject/genfiles.properties
remoting/common/nbproject/platform.xml
remoting/ide/api/build.xml
remoting/ide/api/nbproject/genfiles.properties
remoting/ide/api/nbproject/project.xml
remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/RemoteIndex.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/Utilities.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.java
remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.java
remoting/ide/browsing/build.xml
remoting/ide/browsing/manifest.mf
remoting/ide/browsing/nbproject/build-impl.xml
remoting/ide/browsing/nbproject/genfiles.properties
remoting/ide/browsing/nbproject/project.properties
remoting/ide/browsing/nbproject/project.xml
remoting/ide/browsing/nbproject/suite.properties
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/Bundle.properties
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/ColoringManager.java
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/Highlighting.java
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/HyperlinkProviderImpl.java
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/Installer.java
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/RemoteEditorKit.java
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/RemoteJavaDataObject.java
remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/class.png
remoting/ide/downloadable/src/org/netbeans/modules/jackpot30/remoting/downloadable/IndexDownloaderImpl.java
remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToSymbol.java
remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java
remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteQuery.java
remoting/ide/nbproject/genfiles.properties
remoting/ide/nbproject/platform.xml
remoting/ide/nbproject/project.properties
remoting/ide/usages/nbproject/genfiles.properties
remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Bundle.properties
remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/MethodOptions.form
remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/MethodOptions.java
remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Nodes.java
remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/RemoteUsages.java
remoting/server/web/resolve.web.api/build.xml
remoting/server/web/resolve.web.api/nbproject/build-impl.xml
remoting/server/web/resolve.web.api/nbproject/genfiles.properties
remoting/server/web/resolve.web.api/src/org/netbeans/modules/jackpot30/resolve/api/ResolveService.java
remoting/server/web/web.main/nbproject/build-impl.xml
remoting/server/web/web.main/nbproject/genfiles.properties
remoting/server/web/web.ui.frontend/public_html/index/ui/script.js
remoting/server/web/web.ui/build.xml
remoting/server/web/web.ui/nbproject/build-impl.xml
remoting/server/web/web.ui/nbproject/genfiles.properties
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/UI.java
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/SemanticHighlighter.java
     1.1 --- a/lib/nblibraries.properties	Sat Aug 30 22:08:25 2014 +0200
     1.2 +++ b/lib/nblibraries.properties	Sun Sep 28 18:40:42 2014 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  libs.CopyLibs.classpath=\
     1.5      ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
     1.6  libs.CopyLibs.displayName=CopyLibs Task
     1.7 -libs.CopyLibs.prop-version=1.0
     1.8 +libs.CopyLibs.prop-version=2.0
     1.9  libs.jopt-simple.classpath=\
    1.10      ${base}/jopt-simple/jopt-simple-3.2.jar
    1.11  libs.jopt-simple.javadoc=\
     2.1 --- a/remoting/common/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
     2.2 +++ b/remoting/common/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
     2.3 @@ -7,5 +7,5 @@
     2.4  nbproject/build-impl.xml.script.CRC32=64b5d2e4
     2.5  nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.49
     2.6  nbproject/platform.xml.data.CRC32=8c462dad
     2.7 -nbproject/platform.xml.script.CRC32=db9e1f43
     2.8 -nbproject/platform.xml.stylesheet.CRC32=df8ac4dd@2.49
     2.9 +nbproject/platform.xml.script.CRC32=6dcbd131
    2.10 +nbproject/platform.xml.stylesheet.CRC32=4e1f53d4@2.61
     3.1 --- a/remoting/common/nbproject/platform.xml	Sat Aug 30 22:08:25 2014 +0200
     3.2 +++ b/remoting/common/nbproject/platform.xml	Sun Sep 28 18:40:42 2014 +0200
     3.3 @@ -17,7 +17,7 @@
     3.4          </pathconvert>
     3.5          <property name="disabled.modules" value=""/>
     3.6          <pathconvert property="module.includes" pathsep="">
     3.7 -            <mapper type="glob" from="${basedir}${file.separator}*" to="(?!\Q*\E)"/>
     3.8 +            <mapper type="glob" from="${basedir}${file.separator}*" to="(?!^\Q*\E$)"/>
     3.9              <path>
    3.10                  <filelist files="${disabled.modules}" dir="."/>
    3.11              </path>
     4.1 --- a/remoting/ide/api/build.xml	Sat Aug 30 22:08:25 2014 +0200
     4.2 +++ b/remoting/ide/api/build.xml	Sun Sep 28 18:40:42 2014 +0200
     4.3 @@ -8,15 +8,15 @@
     4.4      <import file="${suite.dir}/../../findbugs-import.xml"/>
     4.5      
     4.6      <target name="-check-jerig-downloaded">
     4.7 -        <available file="external/jerig-36929ddc99ff.zip" property="jerig.downloaded"/>
     4.8 +        <available file="external/jerig-6142f6ca1038.zip" property="jerig.downloaded"/>
     4.9      </target>
    4.10      <target name="-download-jerig" depends="-check-jerig-downloaded" unless="jerig.downloaded">
    4.11          <mkdir dir="external" />
    4.12 -        <get src="http://kenai.com/downloads/jackpot30/external/jerig-36929ddc99ff.zip" dest="external/jerig-36929ddc99ff.zip" usetimestamp="true"/>
    4.13 +        <get src="http://kenai.com/downloads/jackpot30/external/jerig-6142f6ca1038.zip" dest="external/jerig-6142f6ca1038.zip" usetimestamp="true"/>
    4.14      </target>
    4.15      
    4.16      <target name="files-init" depends="projectized-common.files-init,-download-jerig">
    4.17 -        <unzip src="external/jerig-36929ddc99ff.zip" dest="external" overwrite="false" />
    4.18 +        <unzip src="external/jerig-6142f6ca1038.zip" dest="external" overwrite="false" />
    4.19          <mkdir dir="${cluster}/modules/ext" />
    4.20          <copy  todir="${cluster}/modules/ext">
    4.21              <fileset dir="external" includes="*pojson*.jar" />
     5.1 --- a/remoting/ide/api/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
     5.2 +++ b/remoting/ide/api/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
     5.3 @@ -3,6 +3,6 @@
     5.4  build.xml.stylesheet.CRC32=a56c6a5b@1.47
     5.5  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     5.6  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     5.7 -nbproject/build-impl.xml.data.CRC32=f9a67ab1
     5.8 +nbproject/build-impl.xml.data.CRC32=3d6d68eb
     5.9  nbproject/build-impl.xml.script.CRC32=33cac223
    5.10 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.53
    5.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.63
     6.1 --- a/remoting/ide/api/nbproject/project.xml	Sat Aug 30 22:08:25 2014 +0200
     6.2 +++ b/remoting/ide/api/nbproject/project.xml	Sun Sep 28 18:40:42 2014 +0200
     6.3 @@ -25,6 +25,14 @@
     6.4                      </run-dependency>
     6.5                  </dependency>
     6.6                  <dependency>
     6.7 +                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
     6.8 +                    <build-prerequisite/>
     6.9 +                    <compile-dependency/>
    6.10 +                    <run-dependency>
    6.11 +                        <specification-version>8.8.0.3</specification-version>
    6.12 +                    </run-dependency>
    6.13 +                </dependency>
    6.14 +                <dependency>
    6.15                      <code-name-base>org.netbeans.libs.lucene</code-name-base>
    6.16                      <build-prerequisite/>
    6.17                      <compile-dependency/>
    6.18 @@ -34,6 +42,15 @@
    6.19                      </run-dependency>
    6.20                  </dependency>
    6.21                  <dependency>
    6.22 +                    <code-name-base>org.netbeans.modules.editor</code-name-base>
    6.23 +                    <build-prerequisite/>
    6.24 +                    <compile-dependency/>
    6.25 +                    <run-dependency>
    6.26 +                        <release-version>3</release-version>
    6.27 +                        <specification-version>1.77.0.5.22.43</specification-version>
    6.28 +                    </run-dependency>
    6.29 +                </dependency>
    6.30 +                <dependency>
    6.31                      <code-name-base>org.netbeans.modules.jackpot30.common</code-name-base>
    6.32                      <build-prerequisite/>
    6.33                      <compile-dependency/>
    6.34 @@ -42,6 +59,14 @@
    6.35                      </run-dependency>
    6.36                  </dependency>
    6.37                  <dependency>
    6.38 +                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
    6.39 +                    <build-prerequisite/>
    6.40 +                    <compile-dependency/>
    6.41 +                    <run-dependency>
    6.42 +                        <specification-version>0.130.0.26.2.25.8</specification-version>
    6.43 +                    </run-dependency>
    6.44 +                </dependency>
    6.45 +                <dependency>
    6.46                      <code-name-base>org.netbeans.modules.options.api</code-name-base>
    6.47                      <build-prerequisite/>
    6.48                      <compile-dependency/>
     7.1 --- a/remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/RemoteIndex.java	Sat Aug 30 22:08:25 2014 +0200
     7.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/RemoteIndex.java	Sun Sep 28 18:40:42 2014 +0200
     7.3 @@ -42,6 +42,9 @@
     7.4  
     7.5  package org.netbeans.modules.jackpot30.remoting.api;
     7.6  
     7.7 +import java.io.IOException;
     7.8 +import java.lang.ref.Reference;
     7.9 +import java.lang.ref.SoftReference;
    7.10  import java.net.MalformedURLException;
    7.11  import java.net.URL;
    7.12  import java.util.LinkedList;
    7.13 @@ -49,7 +52,13 @@
    7.14  import java.util.prefs.BackingStoreException;
    7.15  import java.util.prefs.Preferences;
    7.16  import org.codeviation.pojson.Pojson;
    7.17 +import org.netbeans.api.annotations.common.CheckForNull;
    7.18 +import org.netbeans.api.annotations.common.NullAllowed;
    7.19  import org.netbeans.modules.jackpot30.remotingapi.options.Utils;
    7.20 +import org.openide.filesystems.FileObject;
    7.21 +import org.openide.filesystems.FileSystem;
    7.22 +import org.openide.filesystems.FileUtil;
    7.23 +import org.openide.filesystems.URLMapper;
    7.24  import org.openide.util.Exceptions;
    7.25  import org.openide.util.Lookup;
    7.26  import org.openide.util.NbPreferences;
    7.27 @@ -66,12 +75,12 @@
    7.28      public final URL    remote;
    7.29      public final String remoteSegment;
    7.30  
    7.31 -    public static RemoteIndex create(URL localFolder, URL remote, String remoteSegment) {
    7.32 +    public static RemoteIndex create(@NullAllowed URL localFolder, URL remote, String remoteSegment) {
    7.33          return create(true, UseLocalCache.NEVER, localFolder, remote, remoteSegment);
    7.34      }
    7.35  
    7.36 -    public static RemoteIndex create(boolean enabled, UseLocalCache useLocalCache, URL localFolder, URL remote, String remoteSegment) {
    7.37 -        return new RemoteIndex(enabled, useLocalCache, localFolder.toExternalForm(), remote, remoteSegment);
    7.38 +    public static RemoteIndex create(boolean enabled, UseLocalCache useLocalCache, @NullAllowed URL localFolder, URL remote, String remoteSegment) {
    7.39 +        return new RemoteIndex(enabled, useLocalCache, localFolder != null ? localFolder.toExternalForm() : null, remote, remoteSegment);
    7.40      }
    7.41  
    7.42      private RemoteIndex() {//used by Pojson
    7.43 @@ -90,8 +99,41 @@
    7.44          this.remoteSegment = remoteSegment;
    7.45      }
    7.46  
    7.47 -    public URL getLocalFolder() {
    7.48 -        return Utils.fromDisplayName(folder);
    7.49 +    public @CheckForNull URL getLocalFolder() {
    7.50 +        return folder != null ? Utils.fromDisplayName(folder) : null;
    7.51 +    }
    7.52 +
    7.53 +    private Reference<FileSystem> data;
    7.54 +
    7.55 +    public FileObject getFile(String relativePath) {
    7.56 +        if (folder == null) {
    7.57 +            FileSystem fs;
    7.58 +
    7.59 +            synchronized (this) {
    7.60 +                fs = data != null ? data.get() : null;
    7.61 +
    7.62 +                if (fs == null) data = new SoftReference<FileSystem>(fs = FileUtil.createMemoryFileSystem());
    7.63 +            }
    7.64 +
    7.65 +            String remoteRelativePath = relativePath.replace(".java", ".rjava");
    7.66 +
    7.67 +            FileObject result = fs.getRoot().getFileObject(remoteRelativePath);
    7.68 +
    7.69 +            if (result == null) {
    7.70 +                try {
    7.71 +                    result = FileUtil.createData(fs.getRoot(), remoteRelativePath);
    7.72 +                    result.setAttribute("remoteIndex", this);
    7.73 +                    result.setAttribute("relative", relativePath);
    7.74 +                } catch (IOException ex) {
    7.75 +                    Exceptions.printStackTrace(ex);
    7.76 +                }
    7.77 +            }
    7.78 +
    7.79 +            return result;
    7.80 +        }
    7.81 +        FileObject originFolder = URLMapper.findFileObject(getLocalFolder());
    7.82 +
    7.83 +        return originFolder != null ? originFolder.getFileObject(relativePath) : null;
    7.84      }
    7.85  
    7.86      private static final String KEY_REMOTE_INDICES = RemoteIndex.class.getSimpleName();
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remoting/api/Utilities.java	Sun Sep 28 18:40:42 2014 +0200
     8.3 @@ -0,0 +1,266 @@
     8.4 +/*
     8.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     8.6 + *
     8.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
     8.8 + *
     8.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    8.10 + * Other names may be trademarks of their respective owners.
    8.11 + *
    8.12 + * The contents of this file are subject to the terms of either the GNU
    8.13 + * General Public License Version 2 only ("GPL") or the Common
    8.14 + * Development and Distribution License("CDDL") (collectively, the
    8.15 + * "License"). You may not use this file except in compliance with the
    8.16 + * License. You can obtain a copy of the License at
    8.17 + * http://www.netbeans.org/cddl-gplv2.html
    8.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    8.19 + * specific language governing permissions and limitations under the
    8.20 + * License.  When distributing the software, include this License Header
    8.21 + * Notice in each file and include the License file at
    8.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    8.23 + * particular file as subject to the "Classpath" exception as provided
    8.24 + * by Oracle in the GPL Version 2 section of the License file that
    8.25 + * accompanied this code. If applicable, add the following below the
    8.26 + * License Header, with the fields enclosed by brackets [] replaced by
    8.27 + * your own identifying information:
    8.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    8.29 + *
    8.30 + * If you wish your version of this file to be governed by only the CDDL
    8.31 + * or only the GPL Version 2, indicate your decision by adding
    8.32 + * "[Contributor] elects to include this software in this distribution
    8.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    8.34 + * single choice of license, a recipient has the option to distribute
    8.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    8.36 + * to extend the choice of license to its licensees as provided above.
    8.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    8.38 + * Version 2 license, then the option applies only if the new code is
    8.39 + * made subject to such option by the copyright holder.
    8.40 + *
    8.41 + * Contributor(s):
    8.42 + *
    8.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
    8.44 + */
    8.45 +package org.netbeans.modules.jackpot30.remoting.api;
    8.46 +
    8.47 +import java.lang.reflect.Field;
    8.48 +import java.lang.reflect.InvocationTargetException;
    8.49 +import java.lang.reflect.Method;
    8.50 +import java.util.logging.Level;
    8.51 +import java.util.logging.Logger;
    8.52 +import javax.lang.model.element.ElementKind;
    8.53 +import javax.swing.text.Document;
    8.54 +import org.netbeans.api.java.source.ElementHandle;
    8.55 +import org.netbeans.modules.editor.NbEditorUtilities;
    8.56 +import org.openide.filesystems.FileObject;
    8.57 +
    8.58 +/**
    8.59 + *
    8.60 + * @author lahvac
    8.61 + */
    8.62 +public class Utilities {
    8.63 +    private static final Logger LOG = Logger.getLogger(Utilities.class.getName());
    8.64 +
    8.65 +    private Utilities() {}
    8.66 +
    8.67 +    public static final class RemoteSourceDescription {
    8.68 +        public final RemoteIndex idx;
    8.69 +        public final String relative;
    8.70 +        public RemoteSourceDescription(RemoteIndex idx, String relative) {
    8.71 +            this.idx = idx;
    8.72 +            this.relative = relative;
    8.73 +        }
    8.74 +    }
    8.75 +
    8.76 +    public static RemoteSourceDescription remoteSource(Document doc) {
    8.77 +        FileObject file = NbEditorUtilities.getFileObject(doc);
    8.78 +
    8.79 +        if (file == null) return null;
    8.80 +
    8.81 +        return remoteSource(file);
    8.82 +    }
    8.83 +
    8.84 +    public static RemoteSourceDescription remoteSource(FileObject file) {
    8.85 +        Object remoteIndexObj = file.getAttribute("remoteIndex");
    8.86 +        RemoteIndex idx = remoteIndexObj instanceof RemoteIndex ? (RemoteIndex) remoteIndexObj : null;
    8.87 +        Object relativeObj = file.getAttribute("relative");
    8.88 +        String relative = relativeObj instanceof String ? (String) relativeObj : null;
    8.89 +        if (idx != null && relative != null) {
    8.90 +            return new RemoteSourceDescription(idx, relative);
    8.91 +        } else {
    8.92 +            return null;
    8.93 +        }
    8.94 +    }
    8.95 +
    8.96 +    public static String decodeMethodParameterTypes(String signature) {
    8.97 +        StringBuilder name = new StringBuilder();
    8.98 +
    8.99 +        methodParameterTypes(signature, new int[] {0}, name);
   8.100 +        return name.toString();
   8.101 +    }
   8.102 +
   8.103 +    private static char getChar (final String buffer, final int pos) {
   8.104 +        if (pos>=buffer.length()) {
   8.105 +            throw new IllegalStateException ();
   8.106 +        }
   8.107 +        return buffer.charAt(pos);
   8.108 +    }
   8.109 +
   8.110 +    private static String typeArgument (final String jvmTypeId, final int[] pos) {
   8.111 +        char c = getChar (jvmTypeId, pos[0]);
   8.112 +        switch (c) {
   8.113 +            case '*':
   8.114 +                pos[0]++;
   8.115 +                return ""; //XXX?
   8.116 +            case '+':
   8.117 +                pos[0]++;
   8.118 +                return "? extends " + typeSignatureType(jvmTypeId, pos);
   8.119 +            case '-':
   8.120 +                pos[0]++;
   8.121 +                return "? super " + typeSignatureType(jvmTypeId, pos);
   8.122 +            default:
   8.123 +                return typeSignatureType (jvmTypeId, pos);
   8.124 +        }
   8.125 +    }
   8.126 +
   8.127 +
   8.128 +    private static void typeArgumentsList (final String jvmTypeId, final int[] pos, StringBuilder result) {
   8.129 +        char c = getChar (jvmTypeId, pos[0]++);
   8.130 +        if (c != '<') {
   8.131 +            throw new IllegalStateException (jvmTypeId);
   8.132 +        }
   8.133 +        c = getChar (jvmTypeId, pos[0]);
   8.134 +        boolean first = true;
   8.135 +        while (c !='>') {
   8.136 +            if (!first) result.append(", ");
   8.137 +            first = false;
   8.138 +            result.append(typeArgument (jvmTypeId, pos));
   8.139 +            c = getChar (jvmTypeId, pos[0]);
   8.140 +        }
   8.141 +        pos[0]++;
   8.142 +    }
   8.143 +
   8.144 +    static boolean generateSimpleNames = true;
   8.145 +
   8.146 +    private static String typeSignatureType (final String jvmTypeId, final int[] pos) {
   8.147 +        char c = getChar(jvmTypeId, pos[0]++);
   8.148 +        switch (c) {
   8.149 +            case 'B': return "byte";
   8.150 +            case 'C': return "char";
   8.151 +            case 'D': return "double";
   8.152 +            case 'F': return "float";
   8.153 +            case 'I': return "int";
   8.154 +            case 'J': return "long";
   8.155 +            case 'S': return "short";
   8.156 +            case 'V': return "void";
   8.157 +            case 'Z': return "boolean";
   8.158 +            case 'L': {
   8.159 +                StringBuilder builder = new StringBuilder ();
   8.160 +                c = getChar(jvmTypeId, pos[0]++);
   8.161 +                while (c != ';') {
   8.162 +                    if (c == '/' || c == '$') {
   8.163 +                        if (generateSimpleNames) builder.delete(0, builder.length());
   8.164 +                        else builder.append('.');
   8.165 +                    } else {
   8.166 +                        builder.append(c);
   8.167 +                    }
   8.168 +
   8.169 +                    if (c=='<') {
   8.170 +                        pos[0]--;
   8.171 +                        typeArgumentsList (jvmTypeId, pos, builder);
   8.172 +                        builder.append(">");
   8.173 +                    }
   8.174 +                    c = getChar(jvmTypeId, pos[0]++);
   8.175 +                }
   8.176 +                return builder.toString();
   8.177 +            }
   8.178 +            case 'T': {
   8.179 +                StringBuilder builder = new StringBuilder ();
   8.180 +                c = getChar(jvmTypeId, pos[0]++);
   8.181 +                while (c != ';') {
   8.182 +                    builder.append(c);
   8.183 +                    c = getChar(jvmTypeId, pos[0]++);
   8.184 +                }
   8.185 +                return builder.toString();
   8.186 +            }
   8.187 +            case '[':
   8.188 +                return typeSignatureType (jvmTypeId, pos) + "[]";
   8.189 +            default:
   8.190 +                return "<unknown-type>";
   8.191 +        }
   8.192 +    }
   8.193 +
   8.194 +    private static void methodParameterTypes(final String jvmTypeId, final int[] pos, StringBuilder result) {
   8.195 +        char c = getChar (jvmTypeId, pos[0]);
   8.196 +        if (c == '<') {
   8.197 +            do {
   8.198 +                c = getChar (jvmTypeId, pos[0]++);
   8.199 +            } while (c != '>');
   8.200 +            c = getChar (jvmTypeId, pos[0]);
   8.201 +        }
   8.202 +        if (c!='(') {
   8.203 +            throw new IllegalStateException (jvmTypeId);
   8.204 +        }
   8.205 +        pos[0]++;
   8.206 +        c = getChar (jvmTypeId, pos[0]);
   8.207 +        result.append("(");
   8.208 +        boolean first = true;
   8.209 +        while (c != ')') {
   8.210 +            if (!first) result.append(", ");
   8.211 +            first = false;
   8.212 +            result.append(typeSignatureType (jvmTypeId, pos));
   8.213 +            c = getChar (jvmTypeId, pos[0]);
   8.214 +        }
   8.215 +        result.append(")");
   8.216 +    }
   8.217 +
   8.218 +    public static ElementHandle<?> createElementHandle(ElementKind kind, String clazz, String simpleName, String signature) {
   8.219 +        LOG.setLevel(Level.ALL);
   8.220 +        try {
   8.221 +            Class<?> elementHandleAccessor = Class.forName("org.netbeans.modules.java.source.ElementHandleAccessor", false, ElementHandle.class.getClassLoader());
   8.222 +            Field instance = elementHandleAccessor.getDeclaredField("INSTANCE");
   8.223 +            instance.setAccessible(true);
   8.224 +            Method m = elementHandleAccessor.getDeclaredMethod("create", ElementKind.class, String[].class);
   8.225 +            String[] signatures;
   8.226 +            switch (kind) {
   8.227 +                case PACKAGE:
   8.228 +                case CLASS:
   8.229 +                case INTERFACE:
   8.230 +                case ENUM:
   8.231 +                case ANNOTATION_TYPE:
   8.232 +                case OTHER:
   8.233 +                    signatures = new String[] {clazz};
   8.234 +                    break;
   8.235 +                case METHOD:
   8.236 +                case CONSTRUCTOR:
   8.237 +                case FIELD:
   8.238 +                case ENUM_CONSTANT:
   8.239 +                    signatures = new String[] {clazz, simpleName, signature};
   8.240 +                    break;
   8.241 +                case INSTANCE_INIT:
   8.242 +                case STATIC_INIT:
   8.243 +                    signatures = new String[] {clazz, simpleName};
   8.244 +                    break;
   8.245 +                default:
   8.246 +                    kind = ElementKind.OTHER;
   8.247 +                    signatures = new String[] {clazz};
   8.248 +                    break;
   8.249 +            }
   8.250 +            return (ElementHandle<?>) m.invoke(instance.get(null), kind, signatures);
   8.251 +        } catch (IllegalAccessException ex) {
   8.252 +            LOG.log(Level.INFO, null, ex);
   8.253 +        } catch (IllegalArgumentException ex) {
   8.254 +            LOG.log(Level.INFO, null, ex);
   8.255 +        } catch (InvocationTargetException ex) {
   8.256 +            LOG.log(Level.INFO, null, ex);
   8.257 +        } catch (NoSuchMethodException ex) {
   8.258 +            LOG.log(Level.INFO, null, ex);
   8.259 +        } catch (NoSuchFieldException ex) {
   8.260 +            LOG.log(Level.INFO, null, ex);
   8.261 +        } catch (SecurityException ex) {
   8.262 +            LOG.log(Level.INFO, null, ex);
   8.263 +        } catch (ClassNotFoundException ex) {
   8.264 +            LOG.log(Level.INFO, null, ex);
   8.265 +        }
   8.266 +
   8.267 +        return ElementHandle.createTypeElementHandle(ElementKind.CLASS, clazz);
   8.268 +    }
   8.269 +}
     9.1 --- a/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.java	Sat Aug 30 22:08:25 2014 +0200
     9.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/CustomizeRemoteIndex.java	Sun Sep 28 18:40:42 2014 +0200
     9.3 @@ -277,7 +277,8 @@
     9.4  
     9.5      private String tempSubIndexSelection;
     9.6      public void setIndex(RemoteIndex index) {
     9.7 -        folder.setText(Utils.toDisplayName(index.getLocalFolder()));
     9.8 +        URL localFolder = index.getLocalFolder();
     9.9 +        folder.setText(localFolder != null ? Utils.toDisplayName(localFolder) : "");
    9.10          indexURL.setText(index.remote.toExternalForm());
    9.11          tempSubIndexSelection = index.remoteSegment;
    9.12      }
    9.13 @@ -294,7 +295,8 @@
    9.14      
    9.15      public RemoteIndex getIndex() {
    9.16          try {
    9.17 -            return RemoteIndex.create(Utils.fromDisplayName(folder.getText()), new URL(indexURL.getText()), getSubIndexSelectedItem());
    9.18 +            String folderText = folder.getText();
    9.19 +            return RemoteIndex.create(!folderText.isEmpty() ? Utils.fromDisplayName(folderText) : null, new URL(indexURL.getText()), getSubIndexSelectedItem());
    9.20          } catch (MalformedURLException ex) {
    9.21              throw new IllegalStateException(ex);
    9.22          }
    9.23 @@ -309,19 +311,23 @@
    9.24      private void updateErrors() {
    9.25          notificationSupport.clearMessages();
    9.26  
    9.27 -        URL folderURL = Utils.fromDisplayName(folder.getText());
    9.28 -        FileObject folder = URLMapper.findFileObject(folderURL);
    9.29 +        String folderText = folder.getText();
    9.30  
    9.31 -        if (folder == null) {
    9.32 -            notificationSupport.setErrorMessage("Specified directory does not exist.");
    9.33 -            okButton.setEnabled(false);
    9.34 -            return;
    9.35 -        }
    9.36 +        if (!folderText.isEmpty()) {
    9.37 +            URL folderURL = Utils.fromDisplayName(folderText);
    9.38 +            FileObject folder = URLMapper.findFileObject(folderURL);
    9.39  
    9.40 -        if (!folder.isFolder()) {
    9.41 -            notificationSupport.setErrorMessage("Specified directory is not directory.");
    9.42 -            okButton.setEnabled(false);
    9.43 -            return ;
    9.44 +            if (folder == null) {
    9.45 +                notificationSupport.setErrorMessage("Specified directory does not exist.");
    9.46 +                okButton.setEnabled(false);
    9.47 +                return;
    9.48 +            }
    9.49 +
    9.50 +            if (!folder.isFolder()) {
    9.51 +                notificationSupport.setErrorMessage("Specified directory is not directory.");
    9.52 +                okButton.setEnabled(false);
    9.53 +                return ;
    9.54 +            }
    9.55          }
    9.56  
    9.57          if (checkingIndexURL.get()) {
    9.58 @@ -463,6 +469,9 @@
    9.59      private final RequestProcessor.Task indexInfoTask = WORKER.create(new Runnable() {
    9.60  
    9.61          public void run() {
    9.62 +            String localFolder = checkingIndexFolderContentCopy.get();
    9.63 +
    9.64 +            if (!localFolder.isEmpty()) {
    9.65              checkingIndexAgainstFolder.set(true);
    9.66              checkingIndexURLWarning.set(null);
    9.67  
    9.68 @@ -474,7 +483,7 @@
    9.69              
    9.70              String urlText = indexInfoURLContentCopy.get();
    9.71              String subIndex = indexInfoSubIndexCopy.get();
    9.72 -            URL folderURL = Utils.fromDisplayName(checkingIndexFolderContentCopy.get());
    9.73 +            URL folderURL = Utils.fromDisplayName(localFolder);
    9.74              FileObject folder = URLMapper.findFileObject(folderURL);
    9.75  
    9.76              try {
    9.77 @@ -528,6 +537,7 @@
    9.78              } finally {
    9.79                  checkingIndexAgainstFolder.set(false);
    9.80              }
    9.81 +            }
    9.82  
    9.83              //XXX: the index currently does not provide the info anyway...
    9.84  //            IndexInfo info = null;
    10.1 --- a/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.java	Sat Aug 30 22:08:25 2014 +0200
    10.2 +++ b/remoting/ide/api/src/org/netbeans/modules/jackpot30/remotingapi/options/IndexPanel.java	Sun Sep 28 18:40:42 2014 +0200
    10.3 @@ -42,6 +42,7 @@
    10.4  package org.netbeans.modules.jackpot30.remotingapi.options;
    10.5  
    10.6  import java.io.IOException;
    10.7 +import java.net.URL;
    10.8  import java.util.ArrayList;
    10.9  import java.util.Collection;
   10.10  import java.util.Iterator;
   10.11 @@ -338,7 +339,9 @@
   10.12  
   10.13              switch (columnIndex) {
   10.14                  case 0: return idx.enabled;
   10.15 -                case 1: return Utils.toDisplayName(idx.getLocalFolder());
   10.16 +                case 1:
   10.17 +                    URL localFolder = idx.getLocalFolder();
   10.18 +                    return localFolder != null ? Utils.toDisplayName(localFolder) : "";
   10.19                  case 2: return idx.remote.toExternalForm();
   10.20                  case 3: return idx.remoteSegment;
   10.21                  case 4: return idx.useLocalCache;
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/remoting/ide/browsing/build.xml	Sun Sep 28 18:40:42 2014 +0200
    11.3 @@ -0,0 +1,8 @@
    11.4 +<?xml version="1.0" encoding="UTF-8"?>
    11.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    11.6 +<!-- for some information on what you could do (e.g. targets to override). -->
    11.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
    11.8 +<project name="org.netbeans.modules.jackpot30.ide.browsing" default="netbeans" basedir=".">
    11.9 +    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.ide.browsing.</description>
   11.10 +    <import file="nbproject/build-impl.xml"/>
   11.11 +</project>
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/remoting/ide/browsing/manifest.mf	Sun Sep 28 18:40:42 2014 +0200
    12.3 @@ -0,0 +1,6 @@
    12.4 +Manifest-Version: 1.0
    12.5 +OpenIDE-Module: org.netbeans.modules.jackpot30.ide.browsing
    12.6 +OpenIDE-Module-Install: org/netbeans/modules/jackpot30/ide/browsing/Installer.class
    12.7 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/ide/browsing/Bundle.properties
    12.8 +OpenIDE-Module-Specification-Version: 1.0
    12.9 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/remoting/ide/browsing/nbproject/build-impl.xml	Sun Sep 28 18:40:42 2014 +0200
    13.3 @@ -0,0 +1,45 @@
    13.4 +<?xml version="1.0" encoding="UTF-8"?>
    13.5 +<!--
    13.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    13.7 +***         EDIT ../build.xml INSTEAD         ***
    13.8 +-->
    13.9 +<project name="org.netbeans.modules.jackpot30.ide.browsing-impl" basedir="..">
   13.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
   13.11 +        <condition>
   13.12 +            <not>
   13.13 +                <antversion atleast="1.7.1"/>
   13.14 +            </not>
   13.15 +        </condition>
   13.16 +    </fail>
   13.17 +    <property file="nbproject/private/suite-private.properties"/>
   13.18 +    <property file="nbproject/suite.properties"/>
   13.19 +    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
   13.20 +    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
   13.21 +    <property file="${suite.dir}/nbproject/platform.properties"/>
   13.22 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
   13.23 +        <attribute name="name"/>
   13.24 +        <attribute name="value"/>
   13.25 +        <sequential>
   13.26 +            <property name="@{name}" value="${@{value}}"/>
   13.27 +        </sequential>
   13.28 +    </macrodef>
   13.29 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
   13.30 +        <attribute name="property"/>
   13.31 +        <attribute name="value"/>
   13.32 +        <sequential>
   13.33 +            <property name="@{property}" value="@{value}"/>
   13.34 +        </sequential>
   13.35 +    </macrodef>
   13.36 +    <property file="${user.properties.file}"/>
   13.37 +    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   13.38 +    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   13.39 +    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
   13.40 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
   13.41 +        <condition>
   13.42 +            <not>
   13.43 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
   13.44 +            </not>
   13.45 +        </condition>
   13.46 +    </fail>
   13.47 +    <import file="${harness.dir}/build.xml"/>
   13.48 +</project>
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/remoting/ide/browsing/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
    14.3 @@ -0,0 +1,8 @@
    14.4 +build.xml.data.CRC32=d895a237
    14.5 +build.xml.script.CRC32=461c092a
    14.6 +build.xml.stylesheet.CRC32=a56c6a5b@2.61
    14.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    14.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    14.9 +nbproject/build-impl.xml.data.CRC32=d895a237
   14.10 +nbproject/build-impl.xml.script.CRC32=3911055f
   14.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.61
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/remoting/ide/browsing/nbproject/project.properties	Sun Sep 28 18:40:42 2014 +0200
    15.3 @@ -0,0 +1,2 @@
    15.4 +javac.source=1.6
    15.5 +javac.compilerargs=-Xlint -Xlint:-serial
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/remoting/ide/browsing/nbproject/project.xml	Sun Sep 28 18:40:42 2014 +0200
    16.3 @@ -0,0 +1,146 @@
    16.4 +<?xml version="1.0" encoding="UTF-8"?>
    16.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    16.6 +    <type>org.netbeans.modules.apisupport.project</type>
    16.7 +    <configuration>
    16.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
    16.9 +            <code-name-base>org.netbeans.modules.jackpot30.ide.browsing</code-name-base>
   16.10 +            <suite-component/>
   16.11 +            <module-dependencies>
   16.12 +                <dependency>
   16.13 +                    <code-name-base>org.netbeans.modules.editor</code-name-base>
   16.14 +                    <build-prerequisite/>
   16.15 +                    <compile-dependency/>
   16.16 +                    <run-dependency>
   16.17 +                        <release-version>3</release-version>
   16.18 +                        <specification-version>1.70.0.5.21.40</specification-version>
   16.19 +                    </run-dependency>
   16.20 +                </dependency>
   16.21 +                <dependency>
   16.22 +                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
   16.23 +                    <build-prerequisite/>
   16.24 +                    <compile-dependency/>
   16.25 +                    <run-dependency>
   16.26 +                        <release-version>3</release-version>
   16.27 +                        <specification-version>3.33.0.21.40</specification-version>
   16.28 +                    </run-dependency>
   16.29 +                </dependency>
   16.30 +                <dependency>
   16.31 +                    <code-name-base>org.netbeans.modules.editor.lib2</code-name-base>
   16.32 +                    <build-prerequisite/>
   16.33 +                    <compile-dependency/>
   16.34 +                    <run-dependency>
   16.35 +                        <release-version>1</release-version>
   16.36 +                        <specification-version>1.71.0.40</specification-version>
   16.37 +                    </run-dependency>
   16.38 +                </dependency>
   16.39 +                <dependency>
   16.40 +                    <code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base>
   16.41 +                    <build-prerequisite/>
   16.42 +                    <compile-dependency/>
   16.43 +                    <run-dependency>
   16.44 +                        <release-version>1</release-version>
   16.45 +                        <specification-version>1.29</specification-version>
   16.46 +                    </run-dependency>
   16.47 +                </dependency>
   16.48 +                <dependency>
   16.49 +                    <code-name-base>org.netbeans.modules.editor.settings</code-name-base>
   16.50 +                    <build-prerequisite/>
   16.51 +                    <compile-dependency/>
   16.52 +                    <run-dependency>
   16.53 +                        <release-version>1</release-version>
   16.54 +                        <specification-version>1.46</specification-version>
   16.55 +                    </run-dependency>
   16.56 +                </dependency>
   16.57 +                <dependency>
   16.58 +                    <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
   16.59 +                    <build-prerequisite/>
   16.60 +                    <compile-dependency/>
   16.61 +                    <run-dependency>
   16.62 +                        <specification-version>1.11</specification-version>
   16.63 +                    </run-dependency>
   16.64 +                </dependency>
   16.65 +                <dependency>
   16.66 +                    <code-name-base>org.openide.awt</code-name-base>
   16.67 +                    <build-prerequisite/>
   16.68 +                    <compile-dependency/>
   16.69 +                    <run-dependency>
   16.70 +                        <specification-version>7.55</specification-version>
   16.71 +                    </run-dependency>
   16.72 +                </dependency>
   16.73 +                <dependency>
   16.74 +                    <code-name-base>org.openide.dialogs</code-name-base>
   16.75 +                    <build-prerequisite/>
   16.76 +                    <compile-dependency/>
   16.77 +                    <run-dependency>
   16.78 +                        <specification-version>7.28</specification-version>
   16.79 +                    </run-dependency>
   16.80 +                </dependency>
   16.81 +                <dependency>
   16.82 +                    <code-name-base>org.openide.filesystems</code-name-base>
   16.83 +                    <build-prerequisite/>
   16.84 +                    <compile-dependency/>
   16.85 +                    <run-dependency>
   16.86 +                        <specification-version>8.5</specification-version>
   16.87 +                    </run-dependency>
   16.88 +                </dependency>
   16.89 +                <dependency>
   16.90 +                    <code-name-base>org.openide.loaders</code-name-base>
   16.91 +                    <build-prerequisite/>
   16.92 +                    <compile-dependency/>
   16.93 +                    <run-dependency>
   16.94 +                        <specification-version>7.44</specification-version>
   16.95 +                    </run-dependency>
   16.96 +                </dependency>
   16.97 +                <dependency>
   16.98 +                    <code-name-base>org.openide.modules</code-name-base>
   16.99 +                    <build-prerequisite/>
  16.100 +                    <compile-dependency/>
  16.101 +                    <run-dependency>
  16.102 +                        <specification-version>7.39</specification-version>
  16.103 +                    </run-dependency>
  16.104 +                </dependency>
  16.105 +                <dependency>
  16.106 +                    <code-name-base>org.openide.nodes</code-name-base>
  16.107 +                    <build-prerequisite/>
  16.108 +                    <compile-dependency/>
  16.109 +                    <run-dependency>
  16.110 +                        <specification-version>7.33</specification-version>
  16.111 +                    </run-dependency>
  16.112 +                </dependency>
  16.113 +                <dependency>
  16.114 +                    <code-name-base>org.openide.text</code-name-base>
  16.115 +                    <build-prerequisite/>
  16.116 +                    <compile-dependency/>
  16.117 +                    <run-dependency>
  16.118 +                        <specification-version>6.54</specification-version>
  16.119 +                    </run-dependency>
  16.120 +                </dependency>
  16.121 +                <dependency>
  16.122 +                    <code-name-base>org.openide.util</code-name-base>
  16.123 +                    <build-prerequisite/>
  16.124 +                    <compile-dependency/>
  16.125 +                    <run-dependency>
  16.126 +                        <specification-version>8.29</specification-version>
  16.127 +                    </run-dependency>
  16.128 +                </dependency>
  16.129 +                <dependency>
  16.130 +                    <code-name-base>org.openide.util.lookup</code-name-base>
  16.131 +                    <build-prerequisite/>
  16.132 +                    <compile-dependency/>
  16.133 +                    <run-dependency>
  16.134 +                        <specification-version>8.19</specification-version>
  16.135 +                    </run-dependency>
  16.136 +                </dependency>
  16.137 +                <dependency>
  16.138 +                    <code-name-base>org.openide.windows</code-name-base>
  16.139 +                    <build-prerequisite/>
  16.140 +                    <compile-dependency/>
  16.141 +                    <run-dependency>
  16.142 +                        <specification-version>6.60</specification-version>
  16.143 +                    </run-dependency>
  16.144 +                </dependency>
  16.145 +            </module-dependencies>
  16.146 +            <public-packages/>
  16.147 +        </data>
  16.148 +    </configuration>
  16.149 +</project>
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/remoting/ide/browsing/nbproject/suite.properties	Sun Sep 28 18:40:42 2014 +0200
    17.3 @@ -0,0 +1,1 @@
    17.4 +suite.dir=${basedir}/..
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/Bundle.properties	Sun Sep 28 18:40:42 2014 +0200
    18.3 @@ -0,0 +1,1 @@
    18.4 +OpenIDE-Module-Name=Jackpot 3.0 Remote Browsing
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/ColoringManager.java	Sun Sep 28 18:40:42 2014 +0200
    19.3 @@ -0,0 +1,181 @@
    19.4 +/*
    19.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    19.6 + *
    19.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
    19.8 + *
    19.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   19.10 + * Other names may be trademarks of their respective owners.
   19.11 + *
   19.12 + * The contents of this file are subject to the terms of either the GNU
   19.13 + * General Public License Version 2 only ("GPL") or the Common
   19.14 + * Development and Distribution License("CDDL") (collectively, the
   19.15 + * "License"). You may not use this file except in compliance with the
   19.16 + * License. You can obtain a copy of the License at
   19.17 + * http://www.netbeans.org/cddl-gplv2.html
   19.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   19.19 + * specific language governing permissions and limitations under the
   19.20 + * License.  When distributing the software, include this License Header
   19.21 + * Notice in each file and include the License file at
   19.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   19.23 + * particular file as subject to the "Classpath" exception as provided
   19.24 + * by Oracle in the GPL Version 2 section of the License file that
   19.25 + * accompanied this code. If applicable, add the following below the
   19.26 + * License Header, with the fields enclosed by brackets [] replaced by
   19.27 + * your own identifying information:
   19.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   19.29 + *
   19.30 + * Contributor(s):
   19.31 + *
   19.32 + * The Original Software is NetBeans. The Initial Developer of the Original
   19.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
   19.34 + * Microsystems, Inc. All Rights Reserved.
   19.35 + *
   19.36 + * If you wish your version of this file to be governed by only the CDDL
   19.37 + * or only the GPL Version 2, indicate your decision by adding
   19.38 + * "[Contributor] elects to include this software in this distribution
   19.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   19.40 + * single choice of license, a recipient has the option to distribute
   19.41 + * your version of this file under either the CDDL, the GPL Version 2 or
   19.42 + * to extend the choice of license to its licensees as provided above.
   19.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   19.44 + * Version 2 license, then the option applies only if the new code is
   19.45 + * made subject to such option by the copyright holder.
   19.46 + */
   19.47 +package org.netbeans.modules.jackpot30.ide.browsing;
   19.48 +
   19.49 +import java.util.ArrayList;
   19.50 +import java.util.Arrays;
   19.51 +import java.util.Collection;
   19.52 +import java.util.Collections;
   19.53 +import java.util.Enumeration;
   19.54 +import java.util.HashSet;
   19.55 +import java.util.LinkedHashMap;
   19.56 +import java.util.LinkedList;
   19.57 +import java.util.List;
   19.58 +import java.util.Map;
   19.59 +import java.util.Map.Entry;
   19.60 +import java.util.Set;
   19.61 +import java.util.logging.Level;
   19.62 +import java.util.logging.Logger;
   19.63 +import javax.swing.text.AttributeSet;
   19.64 +import org.netbeans.api.editor.mimelookup.MimeLookup;
   19.65 +import org.netbeans.api.editor.mimelookup.MimePath;
   19.66 +import org.netbeans.api.editor.settings.AttributesUtilities;
   19.67 +import org.netbeans.api.editor.settings.FontColorSettings;
   19.68 +
   19.69 +/**Copied from java.editor.
   19.70 + *
   19.71 + * @author Jan Lahoda
   19.72 + */
   19.73 +public final class ColoringManager {
   19.74 +
   19.75 +    public static final String KEY_MARK_OCCURRENCES = "MARK_OCCURRENCES".toLowerCase();
   19.76 +    private static final Map<Set<String>, String> type2Coloring;
   19.77 +
   19.78 +    static {
   19.79 +        type2Coloring = new LinkedHashMap<Set<String>, String>();
   19.80 +
   19.81 +        put("mod-type-parameter-use", "TYPE_PARAMETER_USE");
   19.82 +        put("mod-type-parameter-declaration", "TYPE_PARAMETER_DECLARATION");
   19.83 +        put("mod-enum-declaration", "ENUM", "DECLARATION");
   19.84 +        put("mod-annotation-type-declaration", "ANNOTATION_TYPE", "DECLARATION");
   19.85 +        put("mod-interface-declaration", "INTERFACE", "DECLARATION");
   19.86 +        put("mod-class-declaration", "CLASS", "DECLARATION");
   19.87 +        put("mod-constructor-declaration", "CONSTRUCTOR", "DECLARATION");
   19.88 +        put("mod-method-declaration", "METHOD", "DECLARATION");
   19.89 +        put("mod-parameter-declaration", "PARAMETER", "DECLARATION");
   19.90 +        put("mod-local-variable-declaration", "LOCAL_VARIABLE", "DECLARATION");
   19.91 +        put("mod-field-declaration", "FIELD", "DECLARATION");
   19.92 +        put("mod-enum", "ENUM");
   19.93 +        put("mod-annotation-type", "ANNOTATION_TYPE");
   19.94 +        put("mod-interface", "INTERFACE");
   19.95 +        put("mod-class", "CLASS");
   19.96 +        put("mod-constructor", "CONSTRUCTOR");
   19.97 +        put("mod-method", "METHOD");
   19.98 +        put("mod-parameter", "PARAMETER");
   19.99 +        put("mod-local-variable", "LOCAL_VARIABLE");
  19.100 +        put("mod-field", "FIELD");
  19.101 +        put("mod-public", "PUBLIC");
  19.102 +        put("mod-protected", "PROTECTED");
  19.103 +        put("mod-package-private", "PACKAGE_PRIVATE");
  19.104 +        put("mod-private", "PRIVATE");
  19.105 +        put("mod-static", "STATIC");
  19.106 +        put("mod-abstract", "ABSTRACT");
  19.107 +        put("mod-deprecated", "DEPRECATED");
  19.108 +        put("mod-undefined", "UNDEFINED");
  19.109 +        put("mod-unused", "UNUSED");
  19.110 +        put("javadoc-identifier", "JAVADOC_IDENTIFIER");
  19.111 +        put("mark-occurrences", KEY_MARK_OCCURRENCES);
  19.112 +    }
  19.113 +
  19.114 +    private static void put(String coloring, String... attributes) {
  19.115 +        for (int i = 0; i < attributes.length; i++) {
  19.116 +            attributes[i] = attributes[i].toLowerCase();
  19.117 +        }
  19.118 +        type2Coloring.put(new HashSet<String>(Arrays.asList(attributes)), coloring);
  19.119 +    }
  19.120 +
  19.121 +    public static AttributeSet getColoringImpl(String coloringSpec) {
  19.122 +        FontColorSettings fcs = MimeLookup.getLookup(MimePath.get("text/x-java")).lookup(FontColorSettings.class);
  19.123 +
  19.124 +        if (fcs == null) {
  19.125 +            //in tests:
  19.126 +            return AttributesUtilities.createImmutable();
  19.127 +        }
  19.128 +
  19.129 +        assert fcs != null;
  19.130 +
  19.131 +        List<AttributeSet> attribs = new ArrayList<AttributeSet>();
  19.132 +
  19.133 +        Set<String> spec = new HashSet<String>(Arrays.asList(coloringSpec.split(" ")));
  19.134 +
  19.135 +        for (Entry<Set<String>, String> attribs2Colorings : type2Coloring.entrySet()) {
  19.136 +            if (spec.containsAll(attribs2Colorings.getKey())) {
  19.137 +                String key = attribs2Colorings.getValue();
  19.138 +
  19.139 +                spec.removeAll(attribs2Colorings.getKey());
  19.140 +
  19.141 +                if (key != null) {
  19.142 +                    AttributeSet colors = fcs.getTokenFontColors(key);
  19.143 +
  19.144 +                    if (colors == null) {
  19.145 +                        Logger.getLogger(ColoringManager.class.getName()).log(Level.SEVERE, "no colors for: {0}", key);
  19.146 +                        continue;
  19.147 +                    }
  19.148 +
  19.149 +                    attribs.add(adjustAttributes(colors));
  19.150 +                }
  19.151 +            }
  19.152 +        }
  19.153 +
  19.154 +        for (String tokenSpec : spec) {
  19.155 +            AttributeSet colors = fcs.getTokenFontColors(tokenSpec);
  19.156 +
  19.157 +            if (colors != null) {
  19.158 +                attribs.add(adjustAttributes(colors));
  19.159 +            }
  19.160 +        }
  19.161 +
  19.162 +        Collections.reverse(attribs);
  19.163 +
  19.164 +        AttributeSet result = AttributesUtilities.createComposite(attribs.toArray(new AttributeSet[0]));
  19.165 +
  19.166 +        return result;
  19.167 +    }
  19.168 +
  19.169 +    private static AttributeSet adjustAttributes(AttributeSet as) {
  19.170 +        Collection<Object> attrs = new LinkedList<Object>();
  19.171 +
  19.172 +        for (Enumeration<?> e = as.getAttributeNames(); e.hasMoreElements(); ) {
  19.173 +            Object key = e.nextElement();
  19.174 +            Object value = as.getAttribute(key);
  19.175 +
  19.176 +            if (value != Boolean.FALSE) {
  19.177 +                attrs.add(key);
  19.178 +                attrs.add(value);
  19.179 +            }
  19.180 +        }
  19.181 +
  19.182 +        return AttributesUtilities.createImmutable(attrs.toArray());
  19.183 +    }
  19.184 +}
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/Highlighting.java	Sun Sep 28 18:40:42 2014 +0200
    20.3 @@ -0,0 +1,223 @@
    20.4 +/*
    20.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    20.6 + *
    20.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    20.8 + *
    20.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   20.10 + * Other names may be trademarks of their respective owners.
   20.11 + *
   20.12 + * The contents of this file are subject to the terms of either the GNU
   20.13 + * General Public License Version 2 only ("GPL") or the Common
   20.14 + * Development and Distribution License("CDDL") (collectively, the
   20.15 + * "License"). You may not use this file except in compliance with the
   20.16 + * License. You can obtain a copy of the License at
   20.17 + * http://www.netbeans.org/cddl-gplv2.html
   20.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   20.19 + * specific language governing permissions and limitations under the
   20.20 + * License.  When distributing the software, include this License Header
   20.21 + * Notice in each file and include the License file at
   20.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   20.23 + * particular file as subject to the "Classpath" exception as provided
   20.24 + * by Oracle in the GPL Version 2 section of the License file that
   20.25 + * accompanied this code. If applicable, add the following below the
   20.26 + * License Header, with the fields enclosed by brackets [] replaced by
   20.27 + * your own identifying information:
   20.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   20.29 + *
   20.30 + * If you wish your version of this file to be governed by only the CDDL
   20.31 + * or only the GPL Version 2, indicate your decision by adding
   20.32 + * "[Contributor] elects to include this software in this distribution
   20.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   20.34 + * single choice of license, a recipient has the option to distribute
   20.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   20.36 + * to extend the choice of license to its licensees as provided above.
   20.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   20.38 + * Version 2 license, then the option applies only if the new code is
   20.39 + * made subject to such option by the copyright holder.
   20.40 + *
   20.41 + * Contributor(s):
   20.42 + *
   20.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   20.44 + */
   20.45 +package org.netbeans.modules.jackpot30.ide.browsing;
   20.46 +
   20.47 +import org.netbeans.modules.jackpot30.remoting.api.Utilities;
   20.48 +import java.beans.PropertyChangeEvent;
   20.49 +import java.beans.PropertyChangeListener;
   20.50 +import java.io.IOException;
   20.51 +import java.net.MalformedURLException;
   20.52 +import java.net.URI;
   20.53 +import java.net.URISyntaxException;
   20.54 +import java.util.HashMap;
   20.55 +import java.util.Iterator;
   20.56 +import java.util.List;
   20.57 +import java.util.Map;
   20.58 +import javax.swing.event.CaretEvent;
   20.59 +import javax.swing.event.CaretListener;
   20.60 +import javax.swing.text.Document;
   20.61 +import javax.swing.text.JTextComponent;
   20.62 +import org.codeviation.pojson.Pojson;
   20.63 +import org.netbeans.api.editor.EditorRegistry;
   20.64 +import org.netbeans.api.editor.mimelookup.MimeRegistration;
   20.65 +import org.netbeans.modules.jackpot30.remoting.api.Utilities.RemoteSourceDescription;
   20.66 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   20.67 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   20.68 +import org.netbeans.spi.editor.highlighting.HighlightsLayer;
   20.69 +import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory;
   20.70 +import org.netbeans.spi.editor.highlighting.ZOrder;
   20.71 +import org.netbeans.spi.editor.highlighting.support.OffsetsBag;
   20.72 +import org.openide.util.Exceptions;
   20.73 +import org.openide.util.RequestProcessor;
   20.74 +
   20.75 +/**
   20.76 + *
   20.77 + * @author lahvac
   20.78 + */
   20.79 +public class Highlighting {
   20.80 +
   20.81 +    @MimeRegistration(mimeType = "text/x-rjava", service = HighlightsLayerFactory.class)
   20.82 +    public static class Factory implements HighlightsLayerFactory {
   20.83 +        @Override
   20.84 +        public HighlightsLayer[] createLayers(Context context) {
   20.85 +            return new HighlightsLayer[] {
   20.86 +                HighlightsLayer.create(Highlighting.class.getName() + ".coloring", ZOrder.SYNTAX_RACK, true, getColoringBag(context.getDocument())),
   20.87 +                HighlightsLayer.create(Highlighting.class.getName() + ".occurrences", ZOrder.CARET_RACK, true, getOccurrencesBag(context.getDocument()))
   20.88 +            };
   20.89 +        }
   20.90 +    }
   20.91 +
   20.92 +    private static final RequestProcessor WORKER = new RequestProcessor(Highlighting.class.getName(), 10, false, false);
   20.93 +
   20.94 +    public static void highlight(final Document doc) {
   20.95 +        final RemoteSourceDescription rsd = Utilities.remoteSource(doc);
   20.96 +
   20.97 +        if (rsd == null) return ;
   20.98 +
   20.99 +        WORKER.post(new Runnable() {
  20.100 +            @Override public void run() {
  20.101 +                doHighlight(doc, rsd.idx, rsd.relative);
  20.102 +            }
  20.103 +        });
  20.104 +    }
  20.105 +
  20.106 +    private static void doHighlight(Document doc, RemoteIndex idx, String relativePath) {
  20.107 +        OffsetsBag target = new OffsetsBag(doc);
  20.108 +
  20.109 +        try {
  20.110 +            URI sourceURI = new URI(idx.remote.toExternalForm() + "/ui/highlightData?path=" + WebUtilities.escapeForQuery(idx.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(relativePath));
  20.111 +            HighlightData highlightData = Pojson.load(HighlightData.class, sourceURI.toURL().openStream());
  20.112 +            int o = 0;
  20.113 +            Iterator<String> categoriesIt = highlightData.categories.iterator();
  20.114 +            Iterator<Long> spansIt = highlightData.spans.iterator();
  20.115 +
  20.116 +            while (categoriesIt.hasNext() && spansIt.hasNext()) {
  20.117 +                Long span = spansIt.next();
  20.118 +                target.addHighlight(o, (int) (o + span), ColoringManager.getColoringImpl(categoriesIt.next()));
  20.119 +                o += span;
  20.120 +            }
  20.121 +        } catch (MalformedURLException ex) {
  20.122 +            Exceptions.printStackTrace(ex);
  20.123 +        } catch (URISyntaxException ex) {
  20.124 +            Exceptions.printStackTrace(ex);
  20.125 +        } catch (IOException ex) {
  20.126 +            Exceptions.printStackTrace(ex);
  20.127 +        }
  20.128 +
  20.129 +        getColoringBag(doc).setHighlights(target);
  20.130 +    }
  20.131 +
  20.132 +    private static OffsetsBag getColoringBag(Document doc) {
  20.133 +        OffsetsBag bag = (OffsetsBag) doc.getProperty(Highlighting.class);
  20.134 +
  20.135 +        if (bag == null) {
  20.136 +            doc.putProperty(Highlighting.class, bag = new OffsetsBag(doc));
  20.137 +        }
  20.138 +
  20.139 +        return bag;
  20.140 +    }
  20.141 +
  20.142 +    private static final Object KEY_OCCURRENCES_BAG = new Object();
  20.143 +    private static OffsetsBag getOccurrencesBag(Document doc) {
  20.144 +        OffsetsBag bag = (OffsetsBag) doc.getProperty(KEY_OCCURRENCES_BAG);
  20.145 +
  20.146 +        if (bag == null) {
  20.147 +            doc.putProperty(KEY_OCCURRENCES_BAG, bag = new OffsetsBag(doc));
  20.148 +        }
  20.149 +
  20.150 +        return bag;
  20.151 +    }
  20.152 +
  20.153 +    public static final class HighlightData {
  20.154 +        final List<String> categories;
  20.155 +        final List<Long> spans;
  20.156 +        public HighlightData(List<String> cats, List<Long> spans) {
  20.157 +            this.categories = cats;
  20.158 +            this.spans = spans;
  20.159 +        }
  20.160 +
  20.161 +        public HighlightData() {
  20.162 +            this(null, null);
  20.163 +        }
  20.164 +
  20.165 +    }
  20.166 +
  20.167 +    public static void registerComponentListener() {
  20.168 +        EditorRegistry.addPropertyChangeListener(L);
  20.169 +    }
  20.170 +
  20.171 +    private static final PropertyChangeListener L = new PropertyChangeListener() {
  20.172 +        private JTextComponent old;
  20.173 +        private CaretListener caret;
  20.174 +        @Override public void propertyChange(PropertyChangeEvent evt) {
  20.175 +            JTextComponent current = EditorRegistry.focusedComponent();
  20.176 +
  20.177 +            if (current == old) return ;
  20.178 +
  20.179 +            if (old != null) {
  20.180 +                old.removeCaretListener(caret);
  20.181 +            }
  20.182 +            
  20.183 +            if (current != null) {
  20.184 +                final Document doc = current.getDocument();
  20.185 +                final RemoteSourceDescription rsd = Utilities.remoteSource(doc);
  20.186 +
  20.187 +                if (rsd != null) {
  20.188 +                    current.addCaretListener(caret = new CaretListener() {
  20.189 +                        @Override public void caretUpdate(CaretEvent e) {
  20.190 +                            final int caret = e.getDot();
  20.191 +
  20.192 +                            WORKER.post(new Runnable() {
  20.193 +                                @Override public void run() {
  20.194 +                                    try {
  20.195 +                                        URI sourceURI = new URI(rsd.idx.remote.toExternalForm() + "/ui/target?path=" + WebUtilities.escapeForQuery(rsd.idx.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(rsd.relative) + "&position=" + caret);
  20.196 +                                        Map<Object, Object> targetData = Pojson.load(HashMap.class, sourceURI.toURL().openStream());
  20.197 +                                        Object signature = targetData.get("signature");
  20.198 +
  20.199 +                                        if (signature instanceof String) {
  20.200 +                                            URI localUsagesURI = new URI(rsd.idx.remote.toExternalForm() + "/ui/localUsages?path=" + WebUtilities.escapeForQuery(rsd.idx.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(rsd.relative) + "&signature=" + WebUtilities.escapeForQuery(String.valueOf(signature)) + "&usages=true");
  20.201 +                                            long[][] spans = Pojson.load(long[][].class, localUsagesURI.toURL().openStream());
  20.202 +                                            OffsetsBag bag = new OffsetsBag(doc);
  20.203 +
  20.204 +                                            for (long[] span : spans) {
  20.205 +                                                bag.addHighlight((int) span[0], (int) span[1], ColoringManager.getColoringImpl(ColoringManager.KEY_MARK_OCCURRENCES));
  20.206 +                                            }
  20.207 +
  20.208 +                                            getOccurrencesBag(doc).setHighlights(bag);
  20.209 +                                        }
  20.210 +                                    } catch (URISyntaxException ex) {
  20.211 +                                        Exceptions.printStackTrace(ex);
  20.212 +                                    } catch (IOException ex) {
  20.213 +                                        Exceptions.printStackTrace(ex);
  20.214 +                                    }
  20.215 +                                }
  20.216 +                            }, 300);//should reuse one task...
  20.217 +                        }
  20.218 +                    });
  20.219 +
  20.220 +                }
  20.221 +            }
  20.222 +            
  20.223 +            old = current;
  20.224 +        }
  20.225 +    };
  20.226 +}
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/HyperlinkProviderImpl.java	Sun Sep 28 18:40:42 2014 +0200
    21.3 @@ -0,0 +1,236 @@
    21.4 +/*
    21.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    21.6 + *
    21.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    21.8 + *
    21.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   21.10 + * Other names may be trademarks of their respective owners.
   21.11 + *
   21.12 + * The contents of this file are subject to the terms of either the GNU
   21.13 + * General Public License Version 2 only ("GPL") or the Common
   21.14 + * Development and Distribution License("CDDL") (collectively, the
   21.15 + * "License"). You may not use this file except in compliance with the
   21.16 + * License. You can obtain a copy of the License at
   21.17 + * http://www.netbeans.org/cddl-gplv2.html
   21.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   21.19 + * specific language governing permissions and limitations under the
   21.20 + * License.  When distributing the software, include this License Header
   21.21 + * Notice in each file and include the License file at
   21.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   21.23 + * particular file as subject to the "Classpath" exception as provided
   21.24 + * by Oracle in the GPL Version 2 section of the License file that
   21.25 + * accompanied this code. If applicable, add the following below the
   21.26 + * License Header, with the fields enclosed by brackets [] replaced by
   21.27 + * your own identifying information:
   21.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   21.29 + *
   21.30 + * If you wish your version of this file to be governed by only the CDDL
   21.31 + * or only the GPL Version 2, indicate your decision by adding
   21.32 + * "[Contributor] elects to include this software in this distribution
   21.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   21.34 + * single choice of license, a recipient has the option to distribute
   21.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   21.36 + * to extend the choice of license to its licensees as provided above.
   21.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   21.38 + * Version 2 license, then the option applies only if the new code is
   21.39 + * made subject to such option by the copyright holder.
   21.40 + *
   21.41 + * Contributor(s):
   21.42 + *
   21.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   21.44 + */
   21.45 +package org.netbeans.modules.jackpot30.ide.browsing;
   21.46 +
   21.47 +import java.io.IOException;
   21.48 +import java.net.URI;
   21.49 +import java.net.URISyntaxException;
   21.50 +import java.util.ArrayList;
   21.51 +import java.util.EnumSet;
   21.52 +import java.util.HashMap;
   21.53 +import java.util.List;
   21.54 +import java.util.Map;
   21.55 +import java.util.Set;
   21.56 +import java.util.logging.Level;
   21.57 +import java.util.logging.Logger;
   21.58 +import javax.swing.SwingUtilities;
   21.59 +import javax.swing.text.BadLocationException;
   21.60 +import javax.swing.text.Document;
   21.61 +import javax.swing.text.StyledDocument;
   21.62 +import org.codeviation.pojson.Pojson;
   21.63 +import org.netbeans.api.editor.mimelookup.MimeRegistration;
   21.64 +import org.netbeans.editor.BaseDocument;
   21.65 +import org.netbeans.editor.Utilities;
   21.66 +import org.netbeans.lib.editor.hyperlink.spi.HyperlinkProviderExt;
   21.67 +import org.netbeans.lib.editor.hyperlink.spi.HyperlinkType;
   21.68 +import org.netbeans.modules.editor.NbEditorUtilities;
   21.69 +import org.netbeans.modules.jackpot30.remoting.api.Utilities.RemoteSourceDescription;
   21.70 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   21.71 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   21.72 +import org.openide.DialogDisplayer;
   21.73 +import org.openide.NotifyDescriptor;
   21.74 +import org.openide.cookies.EditorCookie;
   21.75 +import org.openide.cookies.LineCookie;
   21.76 +import org.openide.cookies.OpenCookie;
   21.77 +import org.openide.filesystems.FileObject;
   21.78 +import org.openide.loaders.DataObject;
   21.79 +import org.openide.text.Line;
   21.80 +import org.openide.text.Line.ShowOpenType;
   21.81 +import org.openide.text.Line.ShowVisibilityType;
   21.82 +import org.openide.text.NbDocument;
   21.83 +import org.openide.util.Exceptions;
   21.84 +import org.openide.util.NbBundle.Messages;
   21.85 +import org.openide.util.UserQuestionException;
   21.86 +
   21.87 +/**
   21.88 + *
   21.89 + * @author lahvac
   21.90 + */
   21.91 +@MimeRegistration(mimeType = "text/x-rjava", service = HyperlinkProviderExt.class)
   21.92 +public class HyperlinkProviderImpl implements HyperlinkProviderExt {
   21.93 +
   21.94 +    private static final Logger LOG = Logger.getLogger(HyperlinkProviderImpl.class.getName());
   21.95 +
   21.96 +    @Override
   21.97 +    public Set<HyperlinkType> getSupportedHyperlinkTypes() {
   21.98 +        return EnumSet.of(HyperlinkType.GO_TO_DECLARATION);
   21.99 +    }
  21.100 +
  21.101 +    @Override
  21.102 +    public boolean isHyperlinkPoint(Document doc, int offset, HyperlinkType type) {
  21.103 +        return getHyperlinkSpan(doc, offset, type) != null;
  21.104 +    }
  21.105 +
  21.106 +    @Override
  21.107 +    public int[] getHyperlinkSpan(Document doc, int offset, HyperlinkType type) {
  21.108 +        try {
  21.109 +            int[] span = Utilities.getIdentifierBlock((BaseDocument) doc, offset);
  21.110 +
  21.111 +            return span;
  21.112 +        } catch (BadLocationException ex) {
  21.113 +            return null;
  21.114 +        }
  21.115 +    }
  21.116 +
  21.117 +    @Override
  21.118 +    public void performClickAction(Document doc, int offset, HyperlinkType type) {
  21.119 +        RemoteSourceDescription rsd = org.netbeans.modules.jackpot30.remoting.api.Utilities.remoteSource(doc);
  21.120 +        FileObject file = NbEditorUtilities.getFileObject(doc);
  21.121 +
  21.122 +        if (rsd != null && file != null) {
  21.123 +            try {
  21.124 +                URI sourceURI = new URI(rsd.idx.remote.toExternalForm() + "/ui/target?path=" + WebUtilities.escapeForQuery(rsd.idx.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(rsd.relative) + "&position=" + offset);
  21.125 +                Map<Object, Object> targetData = Pojson.load(HashMap.class, sourceURI.toURL().openStream());
  21.126 +
  21.127 +                if (targetData.containsKey("position")) {
  21.128 +                    open(file, Integer.parseInt(String.valueOf(targetData.get("position"))));
  21.129 +                } else if (targetData.containsKey("source")) {
  21.130 +                    RemoteIndex targetIDX = null;
  21.131 +                    for (RemoteIndex i : RemoteIndex.loadIndices()) {
  21.132 +                        if (i.remote.equals(rsd.idx.remote) && i.remoteSegment.equals(targetData.get("path"))) {
  21.133 +                            targetIDX = i;
  21.134 +                        }
  21.135 +                    }
  21.136 +
  21.137 +                    if (targetIDX == null) {
  21.138 +                        //TODO
  21.139 +                    } else {
  21.140 +                        String relativePath = (String) targetData.get("source");
  21.141 +                        URI declarationSpanURI = new URI(targetIDX.remote.toExternalForm() + "/ui/declarationSpan?path=" + WebUtilities.escapeForQuery(targetIDX.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(relativePath) + "&signature=" + WebUtilities.escapeForQuery(String.valueOf(targetData.get("signature"))));
  21.142 +                        List<Long> span = Pojson.update(new ArrayList<Long>(), declarationSpanURI.toURL().openStream());
  21.143 +                        //TODO: if the target is on disk, should use standard way to open:
  21.144 +                        open(targetIDX.getFile(relativePath), (int) (long) span.get(2));
  21.145 +                    }
  21.146 +                }
  21.147 +            } catch (URISyntaxException ex) {
  21.148 +                Exceptions.printStackTrace(ex);
  21.149 +            } catch (IOException ex) {
  21.150 +                Exceptions.printStackTrace(ex);
  21.151 +            }
  21.152 +        }
  21.153 +    }
  21.154 +
  21.155 +    @Override
  21.156 +    public String getTooltipText(Document doc, int offset, HyperlinkType type) {
  21.157 +        return null;
  21.158 +    }
  21.159 +
  21.160 +    public @Deprecated static boolean open(final FileObject fo, final int offset) {
  21.161 +        return doOpen(fo, offset);
  21.162 +    }
  21.163 +
  21.164 +    @Messages("TXT_Question=Question")
  21.165 +    private static boolean doOpen(FileObject fo, int offset) {
  21.166 +        try {
  21.167 +            DataObject od = DataObject.find(fo);
  21.168 +            EditorCookie ec = od.getLookup().lookup(EditorCookie.class);
  21.169 +            LineCookie lc = od.getLookup().lookup(LineCookie.class);
  21.170 +
  21.171 +            if (ec != null && lc != null && offset != -1) {
  21.172 +                StyledDocument doc = null;
  21.173 +                try {
  21.174 +                    doc = ec.openDocument();
  21.175 +                } catch (UserQuestionException uqe) {
  21.176 +                    final Object value = DialogDisplayer.getDefault().notify(
  21.177 +                            new NotifyDescriptor.Confirmation(uqe.getLocalizedMessage(),
  21.178 +                            Bundle.TXT_Question(),
  21.179 +                            NotifyDescriptor.YES_NO_OPTION));
  21.180 +                    if (value != NotifyDescriptor.YES_OPTION) {
  21.181 +                        return false;
  21.182 +                    }
  21.183 +                    uqe.confirmed();
  21.184 +                    doc = ec.openDocument();
  21.185 +                }
  21.186 +                if (doc != null) {
  21.187 +                    int line = NbDocument.findLineNumber(doc, offset);
  21.188 +                    int lineOffset = NbDocument.findLineOffset(doc, line);
  21.189 +                    int column = offset - lineOffset;
  21.190 +
  21.191 +                    if (line != -1) {
  21.192 +                        Line l = lc.getLineSet().getCurrent(line);
  21.193 +
  21.194 +                        if (l != null) {
  21.195 +                            doShow( l, column);
  21.196 +                            return true;
  21.197 +                        }
  21.198 +                    }
  21.199 +                }
  21.200 +            }
  21.201 +
  21.202 +            OpenCookie oc = od.getLookup().lookup(OpenCookie.class);
  21.203 +
  21.204 +            if (oc != null) {
  21.205 +                doOpen(oc);
  21.206 +                return true;
  21.207 +            }
  21.208 +        } catch (IOException e) {
  21.209 +            if (LOG.isLoggable(Level.INFO))
  21.210 +                LOG.log(Level.INFO, e.getMessage(), e);
  21.211 +        }
  21.212 +
  21.213 +        return false;
  21.214 +    }
  21.215 +
  21.216 +    private static void doShow(final Line l, final int column) {
  21.217 +        if (SwingUtilities.isEventDispatchThread()) {
  21.218 +            l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
  21.219 +        } else {
  21.220 +            SwingUtilities.invokeLater(new Runnable() {
  21.221 +                public void run() {
  21.222 +                    l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
  21.223 +                }
  21.224 +            });
  21.225 +        }
  21.226 +    }
  21.227 +
  21.228 +    private static void doOpen(final OpenCookie oc) {
  21.229 +        if (SwingUtilities.isEventDispatchThread()) {
  21.230 +            oc.open();
  21.231 +        } else {
  21.232 +            SwingUtilities.invokeLater(new Runnable() {
  21.233 +                public void run() {
  21.234 +                    oc.open();
  21.235 +                }
  21.236 +            });
  21.237 +        }
  21.238 +    }
  21.239 +}
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/Installer.java	Sun Sep 28 18:40:42 2014 +0200
    22.3 @@ -0,0 +1,53 @@
    22.4 +/*
    22.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    22.6 + *
    22.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    22.8 + *
    22.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   22.10 + * Other names may be trademarks of their respective owners.
   22.11 + *
   22.12 + * The contents of this file are subject to the terms of either the GNU
   22.13 + * General Public License Version 2 only ("GPL") or the Common
   22.14 + * Development and Distribution License("CDDL") (collectively, the
   22.15 + * "License"). You may not use this file except in compliance with the
   22.16 + * License. You can obtain a copy of the License at
   22.17 + * http://www.netbeans.org/cddl-gplv2.html
   22.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   22.19 + * specific language governing permissions and limitations under the
   22.20 + * License.  When distributing the software, include this License Header
   22.21 + * Notice in each file and include the License file at
   22.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   22.23 + * particular file as subject to the "Classpath" exception as provided
   22.24 + * by Oracle in the GPL Version 2 section of the License file that
   22.25 + * accompanied this code. If applicable, add the following below the
   22.26 + * License Header, with the fields enclosed by brackets [] replaced by
   22.27 + * your own identifying information:
   22.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   22.29 + *
   22.30 + * If you wish your version of this file to be governed by only the CDDL
   22.31 + * or only the GPL Version 2, indicate your decision by adding
   22.32 + * "[Contributor] elects to include this software in this distribution
   22.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   22.34 + * single choice of license, a recipient has the option to distribute
   22.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   22.36 + * to extend the choice of license to its licensees as provided above.
   22.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   22.38 + * Version 2 license, then the option applies only if the new code is
   22.39 + * made subject to such option by the copyright holder.
   22.40 + *
   22.41 + * Contributor(s):
   22.42 + *
   22.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   22.44 + */
   22.45 +package org.netbeans.modules.jackpot30.ide.browsing;
   22.46 +
   22.47 +import org.openide.modules.ModuleInstall;
   22.48 +
   22.49 +public class Installer extends ModuleInstall {
   22.50 +
   22.51 +    @Override
   22.52 +    public void restored() {
   22.53 +        Highlighting.registerComponentListener();
   22.54 +    }
   22.55 +
   22.56 +}
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/RemoteEditorKit.java	Sun Sep 28 18:40:42 2014 +0200
    23.3 @@ -0,0 +1,95 @@
    23.4 +/*
    23.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    23.6 + *
    23.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    23.8 + *
    23.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   23.10 + * Other names may be trademarks of their respective owners.
   23.11 + *
   23.12 + * The contents of this file are subject to the terms of either the GNU
   23.13 + * General Public License Version 2 only ("GPL") or the Common
   23.14 + * Development and Distribution License("CDDL") (collectively, the
   23.15 + * "License"). You may not use this file except in compliance with the
   23.16 + * License. You can obtain a copy of the License at
   23.17 + * http://www.netbeans.org/cddl-gplv2.html
   23.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   23.19 + * specific language governing permissions and limitations under the
   23.20 + * License.  When distributing the software, include this License Header
   23.21 + * Notice in each file and include the License file at
   23.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   23.23 + * particular file as subject to the "Classpath" exception as provided
   23.24 + * by Oracle in the GPL Version 2 section of the License file that
   23.25 + * accompanied this code. If applicable, add the following below the
   23.26 + * License Header, with the fields enclosed by brackets [] replaced by
   23.27 + * your own identifying information:
   23.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   23.29 + *
   23.30 + * If you wish your version of this file to be governed by only the CDDL
   23.31 + * or only the GPL Version 2, indicate your decision by adding
   23.32 + * "[Contributor] elects to include this software in this distribution
   23.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   23.34 + * single choice of license, a recipient has the option to distribute
   23.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   23.36 + * to extend the choice of license to its licensees as provided above.
   23.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   23.38 + * Version 2 license, then the option applies only if the new code is
   23.39 + * made subject to such option by the copyright holder.
   23.40 + *
   23.41 + * Contributor(s):
   23.42 + *
   23.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   23.44 + */
   23.45 +package org.netbeans.modules.jackpot30.ide.browsing;
   23.46 +
   23.47 +import org.netbeans.modules.jackpot30.remoting.api.Utilities;
   23.48 +import java.io.IOException;
   23.49 +import java.io.InputStreamReader;
   23.50 +import java.io.Reader;
   23.51 +import java.net.URI;
   23.52 +import java.net.URISyntaxException;
   23.53 +import javax.swing.text.BadLocationException;
   23.54 +import javax.swing.text.Document;
   23.55 +import javax.swing.text.EditorKit;
   23.56 +import org.netbeans.api.editor.mimelookup.MimeRegistration;
   23.57 +import org.netbeans.editor.GuardedDocument;
   23.58 +import org.netbeans.modules.editor.NbEditorKit;
   23.59 +import org.netbeans.modules.jackpot30.remoting.api.Utilities.RemoteSourceDescription;
   23.60 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   23.61 +
   23.62 +/**
   23.63 + *
   23.64 + * @author lahvac
   23.65 + */
   23.66 +@MimeRegistration(mimeType = "text/x-rjava", service = EditorKit.class)
   23.67 +public class RemoteEditorKit extends NbEditorKit {
   23.68 +
   23.69 +    @Override
   23.70 +    public String getContentType() {
   23.71 +        return "text/x-rjava";
   23.72 +    }
   23.73 +
   23.74 +    @Override
   23.75 +    public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException {
   23.76 +        RemoteSourceDescription rsd = Utilities.remoteSource(doc);
   23.77 +        if (rsd != null) {
   23.78 +            //TODO: cache the content?
   23.79 +            try {
   23.80 +                URI sourceURI = new URI(rsd.idx.remote.toExternalForm() + "/source/cat?path=" + WebUtilities.escapeForQuery(rsd.idx.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(rsd.relative));
   23.81 +
   23.82 +                in = new InputStreamReader(sourceURI.toURL().openStream(), "UTF-8");
   23.83 +            } catch (URISyntaxException ex) {
   23.84 +                throw new IOException(ex);
   23.85 +            }
   23.86 +        }
   23.87 +
   23.88 +        super.read(in, doc, pos);
   23.89 +
   23.90 +        if (doc instanceof GuardedDocument) {
   23.91 +            //XXX: bypassing the standard APIs
   23.92 +            ((GuardedDocument) doc).getGuardedBlockChain().addBlock(0, doc.getLength() + 1, true);
   23.93 +        }
   23.94 +
   23.95 +        Highlighting.highlight(doc);
   23.96 +    }
   23.97 +
   23.98 +}
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/RemoteJavaDataObject.java	Sun Sep 28 18:40:42 2014 +0200
    24.3 @@ -0,0 +1,131 @@
    24.4 +/*
    24.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    24.6 + *
    24.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    24.8 + *
    24.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   24.10 + * Other names may be trademarks of their respective owners.
   24.11 + *
   24.12 + * The contents of this file are subject to the terms of either the GNU
   24.13 + * General Public License Version 2 only ("GPL") or the Common
   24.14 + * Development and Distribution License("CDDL") (collectively, the
   24.15 + * "License"). You may not use this file except in compliance with the
   24.16 + * License. You can obtain a copy of the License at
   24.17 + * http://www.netbeans.org/cddl-gplv2.html
   24.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   24.19 + * specific language governing permissions and limitations under the
   24.20 + * License.  When distributing the software, include this License Header
   24.21 + * Notice in each file and include the License file at
   24.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   24.23 + * particular file as subject to the "Classpath" exception as provided
   24.24 + * by Oracle in the GPL Version 2 section of the License file that
   24.25 + * accompanied this code. If applicable, add the following below the
   24.26 + * License Header, with the fields enclosed by brackets [] replaced by
   24.27 + * your own identifying information:
   24.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   24.29 + *
   24.30 + * If you wish your version of this file to be governed by only the CDDL
   24.31 + * or only the GPL Version 2, indicate your decision by adding
   24.32 + * "[Contributor] elects to include this software in this distribution
   24.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   24.34 + * single choice of license, a recipient has the option to distribute
   24.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   24.36 + * to extend the choice of license to its licensees as provided above.
   24.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   24.38 + * Version 2 license, then the option applies only if the new code is
   24.39 + * made subject to such option by the copyright holder.
   24.40 + *
   24.41 + * Contributor(s):
   24.42 + *
   24.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   24.44 + */
   24.45 +package org.netbeans.modules.jackpot30.ide.browsing;
   24.46 +
   24.47 +import java.io.IOException;
   24.48 +import org.openide.awt.ActionID;
   24.49 +import org.openide.awt.ActionReference;
   24.50 +import org.openide.awt.ActionReferences;
   24.51 +import org.openide.filesystems.FileObject;
   24.52 +import org.openide.filesystems.MIMEResolver;
   24.53 +import org.openide.loaders.DataObject;
   24.54 +import org.openide.loaders.DataObjectExistsException;
   24.55 +import org.openide.loaders.MultiDataObject;
   24.56 +import org.openide.loaders.MultiFileLoader;
   24.57 +import org.openide.util.NbBundle.Messages;
   24.58 +
   24.59 +@Messages({
   24.60 +    "LBL_RemoteJava_LOADER=Files of RemoteJava"
   24.61 +})
   24.62 +@MIMEResolver.ExtensionRegistration(
   24.63 +        displayName = "#LBL_RemoteJava_LOADER",
   24.64 +        mimeType = "text/x-rjava",
   24.65 +        extension = {"rjava"})
   24.66 +@DataObject.Registration(
   24.67 +        mimeType = "text/x-rjava",
   24.68 +        iconBase = "org/netbeans/modules/jackpot30/ide/browsing/class.png",
   24.69 +        displayName = "#LBL_RemoteJava_LOADER",
   24.70 +        position = 300)
   24.71 +@ActionReferences({
   24.72 +    @ActionReference(
   24.73 +            path = "Loaders/text/x-rjava/Actions",
   24.74 +            id =
   24.75 +            @ActionID(category = "System", id = "org.openide.actions.OpenAction"),
   24.76 +            position = 100,
   24.77 +            separatorAfter = 200),
   24.78 +    @ActionReference(
   24.79 +            path = "Loaders/text/x-rjava/Actions",
   24.80 +            id =
   24.81 +            @ActionID(category = "Edit", id = "org.openide.actions.CutAction"),
   24.82 +            position = 300),
   24.83 +    @ActionReference(
   24.84 +            path = "Loaders/text/x-rjava/Actions",
   24.85 +            id =
   24.86 +            @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"),
   24.87 +            position = 400,
   24.88 +            separatorAfter = 500),
   24.89 +    @ActionReference(
   24.90 +            path = "Loaders/text/x-rjava/Actions",
   24.91 +            id =
   24.92 +            @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"),
   24.93 +            position = 600),
   24.94 +    @ActionReference(
   24.95 +            path = "Loaders/text/x-rjava/Actions",
   24.96 +            id =
   24.97 +            @ActionID(category = "System", id = "org.openide.actions.RenameAction"),
   24.98 +            position = 700,
   24.99 +            separatorAfter = 800),
  24.100 +    @ActionReference(
  24.101 +            path = "Loaders/text/x-rjava/Actions",
  24.102 +            id =
  24.103 +            @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"),
  24.104 +            position = 900,
  24.105 +            separatorAfter = 1000),
  24.106 +    @ActionReference(
  24.107 +            path = "Loaders/text/x-rjava/Actions",
  24.108 +            id =
  24.109 +            @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"),
  24.110 +            position = 1100,
  24.111 +            separatorAfter = 1200),
  24.112 +    @ActionReference(
  24.113 +            path = "Loaders/text/x-rjava/Actions",
  24.114 +            id =
  24.115 +            @ActionID(category = "System", id = "org.openide.actions.ToolsAction"),
  24.116 +            position = 1300),
  24.117 +    @ActionReference(
  24.118 +            path = "Loaders/text/x-rjava/Actions",
  24.119 +            id =
  24.120 +            @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"),
  24.121 +            position = 1400)
  24.122 +})
  24.123 +public class RemoteJavaDataObject extends MultiDataObject {
  24.124 +
  24.125 +    public RemoteJavaDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
  24.126 +        super(pf, loader);
  24.127 +        registerEditor("text/x-rjava", false);
  24.128 +    }
  24.129 +
  24.130 +    @Override
  24.131 +    protected int associateLookup() {
  24.132 +        return 1;
  24.133 +    }
  24.134 +}
    25.1 Binary file remoting/ide/browsing/src/org/netbeans/modules/jackpot30/ide/browsing/class.png has changed
    26.1 --- a/remoting/ide/downloadable/src/org/netbeans/modules/jackpot30/remoting/downloadable/IndexDownloaderImpl.java	Sat Aug 30 22:08:25 2014 +0200
    26.2 +++ b/remoting/ide/downloadable/src/org/netbeans/modules/jackpot30/remoting/downloadable/IndexDownloaderImpl.java	Sun Sep 28 18:40:42 2014 +0200
    26.3 @@ -72,7 +72,8 @@
    26.4          if (sourceRootFO == null) return null;
    26.5  
    26.6          for (RemoteIndex ri : RemoteIndex.loadIndices()) {
    26.7 -            FileObject indexRootFO = URLMapper.findFileObject(ri.getLocalFolder());
    26.8 +            URL localFolderURL = ri.getLocalFolder();
    26.9 +            FileObject indexRootFO = localFolderURL != null ? URLMapper.findFileObject(localFolderURL) : null;
   26.10  
   26.11              if (indexRootFO == null) continue;
   26.12  
    27.1 --- a/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToSymbol.java	Sat Aug 30 22:08:25 2014 +0200
    27.2 +++ b/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToSymbol.java	Sun Sep 28 18:40:42 2014 +0200
    27.3 @@ -41,9 +41,6 @@
    27.4   */
    27.5  package org.netbeans.modules.jackpot30.jumpto;
    27.6  
    27.7 -import java.lang.reflect.Field;
    27.8 -import java.lang.reflect.InvocationTargetException;
    27.9 -import java.lang.reflect.Method;
   27.10  import java.net.URI;
   27.11  import java.net.URISyntaxException;
   27.12  import java.util.Collection;
   27.13 @@ -51,8 +48,6 @@
   27.14  import java.util.HashSet;
   27.15  import java.util.Map;
   27.16  import java.util.Set;
   27.17 -import java.util.logging.Level;
   27.18 -import java.util.logging.Logger;
   27.19  import javax.lang.model.element.ElementKind;
   27.20  import javax.lang.model.element.Modifier;
   27.21  import javax.swing.Icon;
   27.22 @@ -63,6 +58,7 @@
   27.23  import org.netbeans.modules.jackpot30.jumpto.RemoteGoToSymbol.RemoteSymbolDescriptor;
   27.24  import org.netbeans.modules.jackpot30.jumpto.RemoteQuery.SimpleNameable;
   27.25  import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   27.26 +import org.netbeans.modules.jackpot30.remoting.api.Utilities;
   27.27  import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   27.28  import org.netbeans.spi.jumpto.symbol.SymbolDescriptor;
   27.29  import org.netbeans.spi.jumpto.symbol.SymbolProvider;
   27.30 @@ -78,7 +74,6 @@
   27.31   */
   27.32  @ServiceProvider(service=SymbolProvider.class)
   27.33  public class RemoteGoToSymbol extends RemoteQuery<RemoteSymbolDescriptor, Map<String, Object>> implements SymbolProvider {
   27.34 -    private static final Logger LOG = Logger.getLogger(RemoteGoToSymbol.class.getName());
   27.35  
   27.36      @Override
   27.37      public String name() {
   27.38 @@ -191,7 +186,7 @@
   27.39              if (file == null) return ; //XXX tell to the user
   27.40  
   27.41              ClasspathInfo cpInfo = ClasspathInfo.create(file);
   27.42 -            ElementHandle<?> handle = createElementHandle(resolveKind(), (String) properties.get("enclosingFQN"), (String) properties.get("simpleName"), (String) properties.get("vmsignature"));
   27.43 +            ElementHandle<?> handle = Utilities.createElementHandle(resolveKind(), (String) properties.get("enclosingFQN"), (String) properties.get("simpleName"), (String) properties.get("vmsignature"));
   27.44  
   27.45              ElementOpen.open(cpInfo, handle);
   27.46          }
   27.47 @@ -203,7 +198,7 @@
   27.48              name.append(properties.get("simpleName"));
   27.49  
   27.50              if (properties.containsKey("signature") && (resolveKind() == ElementKind.METHOD || resolveKind() == ElementKind.CONSTRUCTOR)) {
   27.51 -                methodParameterTypes((String) properties.get("signature"), new int[] {0}, name);
   27.52 +                name.append(Utilities.decodeMethodParameterTypes((String) properties.get("signature")));
   27.53              }
   27.54  
   27.55              return name.toString();
   27.56 @@ -220,144 +215,5 @@
   27.57          }
   27.58  
   27.59      }
   27.60 -
   27.61 -    private static ElementHandle<?> createElementHandle(ElementKind kind, String clazz, String simpleName, String signature) {
   27.62 -        try {
   27.63 -            Class<?> elementHandleAccessor = Class.forName("org.netbeans.modules.java.source.ElementHandleAccessor", false, ElementHandle.class.getClassLoader());
   27.64 -            Field instance = elementHandleAccessor.getDeclaredField("INSTANCE");
   27.65 -            Method m = elementHandleAccessor.getDeclaredMethod("create", ElementKind.class, String.class, String.class, String.class);
   27.66 -            return (ElementHandle<?>) m.invoke(instance.get(null), kind, clazz, simpleName, signature);
   27.67 -        } catch (IllegalAccessException ex) {
   27.68 -            LOG.log(Level.INFO, null, ex);
   27.69 -        } catch (IllegalArgumentException ex) {
   27.70 -            LOG.log(Level.INFO, null, ex);
   27.71 -        } catch (InvocationTargetException ex) {
   27.72 -            LOG.log(Level.INFO, null, ex);
   27.73 -        } catch (NoSuchMethodException ex) {
   27.74 -            LOG.log(Level.INFO, null, ex);
   27.75 -        } catch (NoSuchFieldException ex) {
   27.76 -            LOG.log(Level.INFO, null, ex);
   27.77 -        } catch (SecurityException ex) {
   27.78 -            LOG.log(Level.INFO, null, ex);
   27.79 -        } catch (ClassNotFoundException ex) {
   27.80 -            LOG.log(Level.INFO, null, ex);
   27.81 -        }
   27.82 -
   27.83 -        return ElementHandle.createTypeElementHandle(ElementKind.CLASS, clazz);
   27.84 -    }
   27.85      
   27.86 -    private static char getChar (final String buffer, final int pos) {
   27.87 -        if (pos>=buffer.length()) {
   27.88 -            throw new IllegalStateException ();
   27.89 -        }
   27.90 -        return buffer.charAt(pos);
   27.91 -    }
   27.92 -
   27.93 -    private static String typeArgument (final String jvmTypeId, final int[] pos) {
   27.94 -        char c = getChar (jvmTypeId, pos[0]);
   27.95 -        switch (c) {
   27.96 -            case '*': 
   27.97 -                pos[0]++;
   27.98 -                return ""; //XXX?
   27.99 -            case '+':
  27.100 -                pos[0]++;
  27.101 -                return "? extends " + typeSignatureType(jvmTypeId, pos);
  27.102 -            case '-':
  27.103 -                pos[0]++;
  27.104 -                return "? super " + typeSignatureType(jvmTypeId, pos);
  27.105 -            default:
  27.106 -                return typeSignatureType (jvmTypeId, pos);
  27.107 -        }
  27.108 -    }
  27.109 -
  27.110 -
  27.111 -    private static void typeArgumentsList (final String jvmTypeId, final int[] pos, StringBuilder result) {
  27.112 -        char c = getChar (jvmTypeId, pos[0]++);
  27.113 -        if (c != '<') {
  27.114 -            throw new IllegalStateException (jvmTypeId);
  27.115 -        }
  27.116 -        c = getChar (jvmTypeId, pos[0]);
  27.117 -        boolean first = true;
  27.118 -        while (c !='>') {
  27.119 -            if (!first) result.append(", ");
  27.120 -            first = false;
  27.121 -            result.append(typeArgument (jvmTypeId, pos));
  27.122 -            c = getChar (jvmTypeId, pos[0]);
  27.123 -        }
  27.124 -        pos[0]++;
  27.125 -    }
  27.126 -
  27.127 -    static boolean generateSimpleNames = true;
  27.128 -
  27.129 -    private static String typeSignatureType (final String jvmTypeId, final int[] pos) {
  27.130 -        char c = getChar(jvmTypeId, pos[0]++);
  27.131 -        switch (c) {
  27.132 -            case 'B': return "byte";
  27.133 -            case 'C': return "char";
  27.134 -            case 'D': return "double";
  27.135 -            case 'F': return "float";
  27.136 -            case 'I': return "int";
  27.137 -            case 'J': return "long";
  27.138 -            case 'S': return "short";
  27.139 -            case 'V': return "void";
  27.140 -            case 'Z': return "boolean";
  27.141 -            case 'L': {
  27.142 -                StringBuilder builder = new StringBuilder ();
  27.143 -                c = getChar(jvmTypeId, pos[0]++);
  27.144 -                while (c != ';') {
  27.145 -                    if (c == '/' || c == '$') {
  27.146 -                        if (generateSimpleNames) builder.delete(0, builder.length());
  27.147 -                        else builder.append('.');
  27.148 -                    } else {
  27.149 -                        builder.append(c);
  27.150 -                    }
  27.151 -
  27.152 -                    if (c=='<') {
  27.153 -                        pos[0]--;
  27.154 -                        typeArgumentsList (jvmTypeId, pos, builder);
  27.155 -                        builder.append(">");
  27.156 -                    }
  27.157 -                    c = getChar(jvmTypeId, pos[0]++);
  27.158 -                }
  27.159 -                return builder.toString();
  27.160 -            }
  27.161 -            case 'T': {
  27.162 -                StringBuilder builder = new StringBuilder ();
  27.163 -                c = getChar(jvmTypeId, pos[0]++);
  27.164 -                while (c != ';') {
  27.165 -                    builder.append(c);
  27.166 -                    c = getChar(jvmTypeId, pos[0]++);
  27.167 -                }
  27.168 -                return builder.toString();
  27.169 -            }
  27.170 -            case '[':
  27.171 -                return typeSignatureType (jvmTypeId, pos) + "[]";
  27.172 -            default:
  27.173 -                return "<unknown-type>";
  27.174 -        }
  27.175 -    }
  27.176 -
  27.177 -    private static void methodParameterTypes(final String jvmTypeId, final int[] pos, StringBuilder result) {
  27.178 -        char c = getChar (jvmTypeId, pos[0]);
  27.179 -        if (c == '<') {
  27.180 -            do {
  27.181 -                c = getChar (jvmTypeId, pos[0]++);
  27.182 -            } while (c != '>');
  27.183 -            c = getChar (jvmTypeId, pos[0]);
  27.184 -        }
  27.185 -        if (c!='(') {
  27.186 -            throw new IllegalStateException (jvmTypeId);
  27.187 -        }
  27.188 -        pos[0]++;
  27.189 -        c = getChar (jvmTypeId, pos[0]);
  27.190 -        result.append("(");
  27.191 -        boolean first = true;
  27.192 -        while (c != ')') {
  27.193 -            if (!first) result.append(", ");
  27.194 -            first = false;
  27.195 -            result.append(typeSignatureType (jvmTypeId, pos));
  27.196 -            c = getChar (jvmTypeId, pos[0]);
  27.197 -        }
  27.198 -        result.append(")");
  27.199 -    }
  27.200  }
    28.1 --- a/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Sat Aug 30 22:08:25 2014 +0200
    28.2 +++ b/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Sun Sep 28 18:40:42 2014 +0200
    28.3 @@ -49,6 +49,7 @@
    28.4  import javax.swing.Icon;
    28.5  import org.netbeans.api.java.source.ClasspathInfo;
    28.6  import org.netbeans.api.java.source.ElementHandle;
    28.7 +import org.netbeans.api.java.source.UiUtils;
    28.8  import org.netbeans.api.java.source.ui.ElementIcons;
    28.9  import org.netbeans.api.java.source.ui.ElementOpen;
   28.10  import org.netbeans.modules.jackpot30.jumpto.RemoteGoToType.RemoteTypeDescriptor;
   28.11 @@ -59,6 +60,7 @@
   28.12  import org.netbeans.spi.jumpto.type.TypeDescriptor;
   28.13  import org.netbeans.spi.jumpto.type.TypeProvider;
   28.14  import org.openide.filesystems.FileObject;
   28.15 +import org.openide.filesystems.FileUtil;
   28.16  import org.openide.filesystems.URLMapper;
   28.17  import org.openide.util.Exceptions;
   28.18  import org.openide.util.lookup.ServiceProvider;
   28.19 @@ -130,9 +132,7 @@
   28.20                          fqn = fqn.substring(0, fqn.indexOf("$"));
   28.21                      }
   28.22  
   28.23 -                    FileObject originFolder = URLMapper.findFileObject(origin.getLocalFolder());
   28.24 -
   28.25 -                    return originFolder != null ? originFolder.getFileObject(relativePath + "/" + fqn.replace('.', '/') + ".java") : null;
   28.26 +                    return origin.getFile(relativePath + fqn.replace('.', '/') + ".java");
   28.27                  }
   28.28              };
   28.29          }
   28.30 @@ -206,10 +206,15 @@
   28.31  
   28.32              if (file == null) return ; //XXX tell to the user
   28.33  
   28.34 -            ClasspathInfo cpInfo = ClasspathInfo.create(file);
   28.35 -            ElementHandle<?> handle = ElementHandle.createTypeElementHandle(ElementKind.CLASS, binaryName);
   28.36 +            if ("text/x-java".equals(FileUtil.getMIMEType(file, "text/x-java"))) {
   28.37 +                ClasspathInfo cpInfo = ClasspathInfo.create(file);
   28.38 +                ElementHandle<?> handle = ElementHandle.createTypeElementHandle(ElementKind.CLASS, binaryName);
   28.39  
   28.40 -            ElementOpen.open(cpInfo, handle);
   28.41 +                ElementOpen.open(cpInfo, handle);
   28.42 +            } else {
   28.43 +                //TODO: should jump to the correct place in the file
   28.44 +                UiUtils.open(file, 0);
   28.45 +            }
   28.46          }
   28.47  
   28.48      }
    29.1 --- a/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteQuery.java	Sat Aug 30 22:08:25 2014 +0200
    29.2 +++ b/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteQuery.java	Sun Sep 28 18:40:42 2014 +0200
    29.3 @@ -45,6 +45,7 @@
    29.4  import java.io.Reader;
    29.5  import java.io.StringReader;
    29.6  import java.net.URI;
    29.7 +import java.net.URL;
    29.8  import java.util.ArrayList;
    29.9  import java.util.Collection;
   29.10  import java.util.LinkedHashMap;
   29.11 @@ -144,7 +145,8 @@
   29.12          Set<FileObject> sources = GlobalPathRegistry.getDefault().getSourceRoots();
   29.13          
   29.14          for (RemoteIndex ri : RemoteIndex.loadIndices()) {
   29.15 -            FileObject originFolder = URLMapper.findFileObject(ri.getLocalFolder());
   29.16 +            URL localFolder = ri.getLocalFolder();
   29.17 +            FileObject originFolder = localFolder != null ? URLMapper.findFileObject(localFolder) : null;
   29.18              URI url = computeURL(ri, text, searchType);
   29.19  
   29.20              if (url == null) continue;
    30.1 --- a/remoting/ide/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
    30.2 +++ b/remoting/ide/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
    30.3 @@ -7,5 +7,5 @@
    30.4  nbproject/build-impl.xml.script.CRC32=c2d6d7d2
    30.5  nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.49
    30.6  nbproject/platform.xml.data.CRC32=fa6e1472
    30.7 -nbproject/platform.xml.script.CRC32=db9e1f43
    30.8 -nbproject/platform.xml.stylesheet.CRC32=df8ac4dd@2.49
    30.9 +nbproject/platform.xml.script.CRC32=6dcbd131
   30.10 +nbproject/platform.xml.stylesheet.CRC32=4e1f53d4@2.61
    31.1 --- a/remoting/ide/nbproject/platform.xml	Sat Aug 30 22:08:25 2014 +0200
    31.2 +++ b/remoting/ide/nbproject/platform.xml	Sun Sep 28 18:40:42 2014 +0200
    31.3 @@ -17,7 +17,7 @@
    31.4          </pathconvert>
    31.5          <property name="disabled.modules" value=""/>
    31.6          <pathconvert property="module.includes" pathsep="">
    31.7 -            <mapper type="glob" from="${basedir}${file.separator}*" to="(?!\Q*\E)"/>
    31.8 +            <mapper type="glob" from="${basedir}${file.separator}*" to="(?!^\Q*\E$)"/>
    31.9              <path>
   31.10                  <filelist files="${disabled.modules}" dir="."/>
   31.11              </path>
    32.1 --- a/remoting/ide/nbproject/project.properties	Sat Aug 30 22:08:25 2014 +0200
    32.2 +++ b/remoting/ide/nbproject/project.properties	Sun Sep 28 18:40:42 2014 +0200
    32.3 @@ -4,7 +4,9 @@
    32.4      ${project.org.netbeans.modules.jackpot30.ide.usages}:\
    32.5      ${project.org.netbeans.modules.jackpot30.remoting.kit}:\
    32.6      ${project.org.netbeans.modules.jackpot30.remoting.downloadable}:\
    32.7 -    ${project.org.netbeans.modules.jackpot30.remoting.local}
    32.8 +    ${project.org.netbeans.modules.jackpot30.remoting.local}:\
    32.9 +    ${project.org.netbeans.modules.jackpot30.ide.browsing}
   32.10 +project.org.netbeans.modules.jackpot30.ide.browsing=browsing
   32.11  project.org.netbeans.modules.jackpot30.ide.usages=usages
   32.12  project.org.netbeans.modules.jackpot30.jumpto=jumpto
   32.13  project.org.netbeans.modules.jackpot30.remoting.api=api
    33.1 --- a/remoting/ide/usages/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
    33.2 +++ b/remoting/ide/usages/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
    33.3 @@ -3,6 +3,6 @@
    33.4  build.xml.stylesheet.CRC32=a56c6a5b@2.49
    33.5  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    33.6  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    33.7 -nbproject/build-impl.xml.data.CRC32=e216ee19
    33.8 +nbproject/build-impl.xml.data.CRC32=7d3b2deb
    33.9  nbproject/build-impl.xml.script.CRC32=583fd407
   33.10 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.49
   33.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.61
    34.1 --- a/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Bundle.properties	Sat Aug 30 22:08:25 2014 +0200
    34.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Bundle.properties	Sun Sep 28 18:40:42 2014 +0200
    34.3 @@ -44,6 +44,6 @@
    34.4  OpenIDE-Module-Name=Jackpot 3.0 Usage IDE
    34.5  MethodOptions.usages.text=Usages
    34.6  MethodOptions.overriding.text=Overriding methods
    34.7 -MethodOptions.fromBaseClass.text=<html>Search from base class ({0})
    34.8  ClassOptions.usages.text=Usages
    34.9  ClassOptions.subclasses.text=Subclasses
   34.10 +MethodOptions.jLabel3.text=From:
    35.1 --- a/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/MethodOptions.form	Sat Aug 30 22:08:25 2014 +0200
    35.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/MethodOptions.form	Sun Sep 28 18:40:42 2014 +0200
    35.3 @@ -19,11 +19,15 @@
    35.4            <Group type="102" attributes="0">
    35.5                <EmptySpace max="-2" attributes="0"/>
    35.6                <Group type="103" groupAlignment="0" attributes="0">
    35.7 -                  <Component id="usages" alignment="0" min="-2" max="-2" attributes="0"/>
    35.8 -                  <Component id="overriding" alignment="0" min="-2" max="-2" attributes="0"/>
    35.9 -                  <Component id="fromBaseClass" alignment="0" min="-2" max="-2" attributes="0"/>
   35.10 +                  <Group type="102" attributes="0">
   35.11 +                      <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
   35.12 +                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
   35.13 +                      <Component id="fromClass" max="32767" attributes="0"/>
   35.14 +                  </Group>
   35.15 +                  <Component id="overriding" pref="328" max="32767" attributes="0"/>
   35.16 +                  <Component id="usages" alignment="0" max="32767" attributes="0"/>
   35.17                </Group>
   35.18 -              <EmptySpace max="32767" attributes="0"/>
   35.19 +              <EmptySpace max="-2" attributes="0"/>
   35.20            </Group>
   35.21        </Group>
   35.22      </DimensionLayout>
   35.23 @@ -31,11 +35,14 @@
   35.24        <Group type="103" groupAlignment="0" attributes="0">
   35.25            <Group type="102" alignment="0" attributes="0">
   35.26                <EmptySpace max="-2" attributes="0"/>
   35.27 +              <Group type="103" groupAlignment="3" attributes="0">
   35.28 +                  <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
   35.29 +                  <Component id="fromClass" alignment="3" min="-2" max="-2" attributes="0"/>
   35.30 +              </Group>
   35.31 +              <EmptySpace type="separate" max="-2" attributes="0"/>
   35.32                <Component id="usages" min="-2" max="-2" attributes="0"/>
   35.33                <EmptySpace type="unrelated" max="-2" attributes="0"/>
   35.34                <Component id="overriding" min="-2" max="-2" attributes="0"/>
   35.35 -              <EmptySpace type="separate" max="-2" attributes="0"/>
   35.36 -              <Component id="fromBaseClass" min="-2" max="-2" attributes="0"/>
   35.37                <EmptySpace max="32767" attributes="0"/>
   35.38            </Group>
   35.39        </Group>
   35.40 @@ -62,17 +69,24 @@
   35.41          <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="overridingItemStateChanged"/>
   35.42        </Events>
   35.43      </Component>
   35.44 -    <Component class="javax.swing.JCheckBox" name="fromBaseClass">
   35.45 +    <Component class="javax.swing.JLabel" name="jLabel3">
   35.46        <Properties>
   35.47          <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   35.48 -          <ResourceString bundle="org/netbeans/modules/jackpot30/ide/usages/Bundle.properties" key="MethodOptions.fromBaseClass.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;, {arguments})">
   35.49 -            <Argument index="0" javacode="superMethod"/>
   35.50 -          </ResourceString>
   35.51 +          <ResourceString bundle="org/netbeans/modules/jackpot30/ide/usages/Bundle.properties" key="MethodOptions.jLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;, {arguments})"/>
   35.52          </Property>
   35.53        </Properties>
   35.54 -      <Events>
   35.55 -        <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="fromBaseClassItemStateChanged"/>
   35.56 -      </Events>
   35.57 +    </Component>
   35.58 +    <Component class="javax.swing.JComboBox" name="fromClass">
   35.59 +      <Properties>
   35.60 +        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
   35.61 +          <StringArray count="4">
   35.62 +            <StringItem index="0" value="Item 1"/>
   35.63 +            <StringItem index="1" value="Item 2"/>
   35.64 +            <StringItem index="2" value="Item 3"/>
   35.65 +            <StringItem index="3" value="Item 4"/>
   35.66 +          </StringArray>
   35.67 +        </Property>
   35.68 +      </Properties>
   35.69      </Component>
   35.70    </SubComponents>
   35.71  </Form>
    36.1 --- a/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/MethodOptions.java	Sat Aug 30 22:08:25 2014 +0200
    36.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/MethodOptions.java	Sun Sep 28 18:40:42 2014 +0200
    36.3 @@ -41,7 +41,15 @@
    36.4   */
    36.5  package org.netbeans.modules.jackpot30.ide.usages;
    36.6  
    36.7 +import java.awt.Component;
    36.8 +import java.awt.event.ActionEvent;
    36.9 +import java.awt.event.ActionListener;
   36.10  import java.util.Set;
   36.11 +import javax.swing.DefaultListCellRenderer;
   36.12 +import javax.swing.JList;
   36.13 +import org.netbeans.api.java.source.ElementHandle;
   36.14 +import org.netbeans.api.java.source.SourceUtils;
   36.15 +import org.netbeans.modules.jackpot30.ide.usages.RemoteUsages.SelectionListener;
   36.16  
   36.17  /**
   36.18   *
   36.19 @@ -49,17 +57,42 @@
   36.20   */
   36.21  public class MethodOptions extends javax.swing.JPanel {
   36.22  
   36.23 -    private final String superMethod;
   36.24      private final Set<RemoteUsages.SearchOptions> options;
   36.25  
   36.26 -    public MethodOptions(RemoteUsages.ElementDescription element, Set<RemoteUsages.SearchOptions> options) {
   36.27 -        superMethod = element.superMethodDisplayName != null ? element.superMethodDisplayName : "";
   36.28 +    public MethodOptions(RemoteUsages.ElementDescription element, Set<RemoteUsages.SearchOptions> options, final SelectionListener sl) {
   36.29          this.options = options;
   36.30          
   36.31          initComponents();
   36.32  
   36.33 -        if (element.superMethod == null) fromBaseClass.setVisible(false);
   36.34 -        else fromBaseClass.setSelected(true);
   36.35 +        fromClass.removeAllItems();
   36.36 +        fromClass.addItem(element.element);
   36.37 +
   36.38 +        for (ElementHandle<?> superMethod : element.superMethods) {
   36.39 +            fromClass.addItem(superMethod);
   36.40 +        }
   36.41 +
   36.42 +        fromClass.setRenderer(new DefaultListCellRenderer() {
   36.43 +            @Override
   36.44 +            public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
   36.45 +                if (value instanceof ElementHandle) {
   36.46 +                    ElementHandle<?> m = (ElementHandle<?>) value;
   36.47 +
   36.48 +                    value = SourceUtils.getJVMSignature(m)[0]; //TODO: icon???
   36.49 +                }
   36.50 +                return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
   36.51 +            }
   36.52 +        });
   36.53 +
   36.54 +        fromClass.addActionListener(new ActionListener() {
   36.55 +            @Override
   36.56 +            public void actionPerformed(ActionEvent e) {
   36.57 +                sl.elementSelected((ElementHandle<?>) fromClass.getSelectedItem());
   36.58 +            }
   36.59 +        });
   36.60 +
   36.61 +        if (fromClass.getModel().getSize() == 1) {
   36.62 +            fromClass.setEnabled(false);
   36.63 +        }
   36.64  
   36.65          usages.setSelected(true);
   36.66      }
   36.67 @@ -75,7 +108,8 @@
   36.68  
   36.69          usages = new javax.swing.JCheckBox();
   36.70          overriding = new javax.swing.JCheckBox();
   36.71 -        fromBaseClass = new javax.swing.JCheckBox();
   36.72 +        jLabel3 = new javax.swing.JLabel();
   36.73 +        fromClass = new javax.swing.JComboBox();
   36.74  
   36.75          usages.setText(org.openide.util.NbBundle.getMessage(MethodOptions.class, "MethodOptions.usages.text")); // NOI18N
   36.76          usages.addItemListener(new java.awt.event.ItemListener() {
   36.77 @@ -91,12 +125,9 @@
   36.78              }
   36.79          });
   36.80  
   36.81 -        fromBaseClass.setText(org.openide.util.NbBundle.getMessage(MethodOptions.class, "MethodOptions.fromBaseClass.text", new Object[] {superMethod})); // NOI18N
   36.82 -        fromBaseClass.addItemListener(new java.awt.event.ItemListener() {
   36.83 -            public void itemStateChanged(java.awt.event.ItemEvent evt) {
   36.84 -                fromBaseClassItemStateChanged(evt);
   36.85 -            }
   36.86 -        });
   36.87 +        jLabel3.setText(org.openide.util.NbBundle.getMessage(MethodOptions.class, "MethodOptions.jLabel3.text", new Object[] {})); // NOI18N
   36.88 +
   36.89 +        fromClass.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
   36.90  
   36.91          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
   36.92          this.setLayout(layout);
   36.93 @@ -105,20 +136,25 @@
   36.94              .addGroup(layout.createSequentialGroup()
   36.95                  .addContainerGap()
   36.96                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
   36.97 -                    .addComponent(usages)
   36.98 -                    .addComponent(overriding)
   36.99 -                    .addComponent(fromBaseClass))
  36.100 -                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  36.101 +                    .addGroup(layout.createSequentialGroup()
  36.102 +                        .addComponent(jLabel3)
  36.103 +                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  36.104 +                        .addComponent(fromClass, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  36.105 +                    .addComponent(overriding, javax.swing.GroupLayout.DEFAULT_SIZE, 328, Short.MAX_VALUE)
  36.106 +                    .addComponent(usages, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  36.107 +                .addContainerGap())
  36.108          );
  36.109          layout.setVerticalGroup(
  36.110              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  36.111              .addGroup(layout.createSequentialGroup()
  36.112                  .addContainerGap()
  36.113 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  36.114 +                    .addComponent(jLabel3)
  36.115 +                    .addComponent(fromClass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  36.116 +                .addGap(18, 18, 18)
  36.117                  .addComponent(usages)
  36.118                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  36.119                  .addComponent(overriding)
  36.120 -                .addGap(18, 18, 18)
  36.121 -                .addComponent(fromBaseClass)
  36.122                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  36.123          );
  36.124      }// </editor-fold>//GEN-END:initComponents
  36.125 @@ -137,15 +173,9 @@
  36.126              options.remove(RemoteUsages.SearchOptions.SUB);
  36.127      }//GEN-LAST:event_overridingItemStateChanged
  36.128  
  36.129 -    private void fromBaseClassItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_fromBaseClassItemStateChanged
  36.130 -        if (fromBaseClass.isSelected())
  36.131 -            options.add(RemoteUsages.SearchOptions.FROM_BASE);
  36.132 -        else
  36.133 -            options.remove(RemoteUsages.SearchOptions.FROM_BASE);
  36.134 -    }//GEN-LAST:event_fromBaseClassItemStateChanged
  36.135 -
  36.136      // Variables declaration - do not modify//GEN-BEGIN:variables
  36.137 -    private javax.swing.JCheckBox fromBaseClass;
  36.138 +    private javax.swing.JComboBox fromClass;
  36.139 +    private javax.swing.JLabel jLabel3;
  36.140      private javax.swing.JCheckBox overriding;
  36.141      private javax.swing.JCheckBox usages;
  36.142      // End of variables declaration//GEN-END:variables
    37.1 --- a/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Nodes.java	Sat Aug 30 22:08:25 2014 +0200
    37.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Nodes.java	Sun Sep 28 18:40:42 2014 +0200
    37.3 @@ -110,6 +110,7 @@
    37.4  import org.openide.util.NbBundle;
    37.5  import org.openide.util.lookup.AbstractLookup;
    37.6  import org.openide.util.lookup.InstanceContent;
    37.7 +import org.openide.util.lookup.Lookups;
    37.8  
    37.9  /**
   37.10   *
   37.11 @@ -184,8 +185,22 @@
   37.12                          toPopulate.addAll(e.getValue());
   37.13                          return true;
   37.14                      }
   37.15 -                    @Override protected Node createNodeForKey(String rel) {
   37.16 -                        AbstractNode fileNode = new AbstractNode(Children.LEAF);
   37.17 +                    @Override protected Node createNodeForKey(final String rel) {
   37.18 +                        OpenCookie open = new OpenCookie() {
   37.19 +                            @Override public void open() {
   37.20 +                                UiUtils.open(e.getKey().getFile(rel), 0);
   37.21 +                            }
   37.22 +                        };
   37.23 +                        AbstractNode fileNode = new AbstractNode(Children.LEAF, Lookups.singleton(open)) {
   37.24 +                            @Override public Action[] getActions(boolean context) {
   37.25 +                                return new Action[] {
   37.26 +                                    OpenAction.get(OpenAction.class)
   37.27 +                                };
   37.28 +                            }
   37.29 +                            @Override public Action getPreferredAction() {
   37.30 +                                return OpenAction.get(OpenAction.class);
   37.31 +                            }
   37.32 +                        };
   37.33  
   37.34                          fileNode.setDisplayName(rel);
   37.35                          return fileNode;
    38.1 --- a/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/RemoteUsages.java	Sat Aug 30 22:08:25 2014 +0200
    38.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/RemoteUsages.java	Sun Sep 28 18:40:42 2014 +0200
    38.3 @@ -51,8 +51,11 @@
    38.4  import java.io.IOException;
    38.5  import java.net.URI;
    38.6  import java.net.URISyntaxException;
    38.7 +import java.net.URL;
    38.8  import java.util.ArrayList;
    38.9 +import java.util.Arrays;
   38.10  import java.util.Collection;
   38.11 +import java.util.Collections;
   38.12  import java.util.EnumSet;
   38.13  import java.util.HashMap;
   38.14  import java.util.HashSet;
   38.15 @@ -65,6 +68,11 @@
   38.16  import javax.lang.model.element.Element;
   38.17  import javax.lang.model.element.ElementKind;
   38.18  import javax.lang.model.element.ExecutableElement;
   38.19 +import javax.lang.model.element.TypeElement;
   38.20 +import javax.lang.model.type.DeclaredType;
   38.21 +import javax.lang.model.type.TypeKind;
   38.22 +import javax.lang.model.type.TypeMirror;
   38.23 +import javax.lang.model.util.ElementFilter;
   38.24  import javax.swing.JButton;
   38.25  import javax.swing.JLabel;
   38.26  import javax.swing.JPanel;
   38.27 @@ -77,12 +85,15 @@
   38.28  import org.netbeans.api.java.source.CompilationInfo;
   38.29  import org.netbeans.api.java.source.ElementHandle;
   38.30  import org.netbeans.api.java.source.JavaSource;
   38.31 +import org.netbeans.api.java.source.SourceUtils;
   38.32  import org.netbeans.api.java.source.Task;
   38.33  import org.netbeans.api.java.source.ui.ElementHeaders;
   38.34  import org.netbeans.api.java.source.ui.ScanDialog;
   38.35  import org.netbeans.modules.editor.NbEditorUtilities;
   38.36  import org.netbeans.modules.jackpot30.common.api.JavaUtils;
   38.37  import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
   38.38 +import org.netbeans.modules.jackpot30.remoting.api.Utilities;
   38.39 +import org.netbeans.modules.jackpot30.remoting.api.Utilities.RemoteSourceDescription;
   38.40  import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
   38.41  import org.openide.DialogDescriptor;
   38.42  import org.openide.DialogDisplayer;
   38.43 @@ -93,6 +104,7 @@
   38.44  import org.openide.awt.ActionReferences;
   38.45  import org.openide.awt.ActionRegistration;
   38.46  import org.openide.filesystems.FileObject;
   38.47 +import org.openide.filesystems.FileUtil;
   38.48  import org.openide.filesystems.URLMapper;
   38.49  import org.openide.nodes.Node;
   38.50  import org.openide.util.Cancellable;
   38.51 @@ -129,7 +141,13 @@
   38.52          final Set<SearchOptions> options = EnumSet.noneOf(SearchOptions.class);
   38.53          final JButton okButton = new JButton("OK");
   38.54          JButton cancelButton = new JButton("Cancel");
   38.55 -        JPanel dialogContent = constructDialog(element, options, okButton);
   38.56 +        final ElementHandle[] searchFor = new ElementHandle[1];
   38.57 +        JPanel dialogContent = constructDialog(element, options, new SelectionListener() {
   38.58 +            @Override
   38.59 +            public void elementSelected(ElementHandle<?> selected) {
   38.60 +                searchFor[0] = selected;
   38.61 +            }
   38.62 +        }, okButton);
   38.63  
   38.64          DialogDescriptor dd = new DialogDescriptor(dialogContent, "Remote Find Usages", true, new Object[] {okButton, cancelButton}, okButton, DialogDescriptor.DEFAULT_ALIGN, null, new ActionListener() {
   38.65              @Override public void actionPerformed(ActionEvent e) { }
   38.66 @@ -141,7 +159,7 @@
   38.67          okButton.addActionListener(new ActionListener() {
   38.68              @Override public void actionPerformed(ActionEvent e) {
   38.69                  okButton.setEnabled(false);
   38.70 -                WORKER.post(new FindUsagesWorker(options.contains(SearchOptions.FROM_BASE) ? element.superMethod : element.element, options, d, cancel));
   38.71 +                WORKER.post(new FindUsagesWorker(searchFor[0], options, d, cancel));
   38.72              }
   38.73          });
   38.74  
   38.75 @@ -158,38 +176,78 @@
   38.76      private static ElementDescription findElement(final FileObject file, final int pos) {
   38.77          final ElementDescription[] handle = new ElementDescription[1];
   38.78  
   38.79 -        final JavaSource js = JavaSource.forFileObject(file);
   38.80 +        if ("text/x-java".equals(FileUtil.getMIMEType(file, "text/x-java"))) {
   38.81 +            final JavaSource js = JavaSource.forFileObject(file);
   38.82  
   38.83 -        ScanDialog.runWhenScanFinished(new Runnable() {
   38.84 -            @Override public void run() {
   38.85 +            ScanDialog.runWhenScanFinished(new Runnable() {
   38.86 +                @Override public void run() {
   38.87 +                    try {
   38.88 +                        js.runUserActionTask(new Task<CompilationController>() {
   38.89 +                            @Override public void run(CompilationController parameter) throws Exception {
   38.90 +                                parameter.toPhase(JavaSource.Phase.RESOLVED);
   38.91 +
   38.92 +                                TreePath tp = parameter.getTreeUtilities().pathFor(pos);
   38.93 +                                Element el = parameter.getTrees().getElement(tp);
   38.94 +
   38.95 +                                if (el != null && JavaUtils.SUPPORTED_KINDS.contains(el.getKind())) {
   38.96 +                                    handle[0] = new ElementDescription(parameter, el);
   38.97 +                                }
   38.98 +                            }
   38.99 +                        }, true);
  38.100 +                    } catch (IOException ex) {
  38.101 +                        Exceptions.printStackTrace(ex);
  38.102 +                    }
  38.103 +                }
  38.104 +
  38.105 +            }, "Find Remote Usages");
  38.106 +
  38.107 +            return handle[0];
  38.108 +        } else {
  38.109 +            RemoteSourceDescription rsd = org.netbeans.modules.jackpot30.remoting.api.Utilities.remoteSource(file);
  38.110 +
  38.111 +            if (rsd != null) {
  38.112                  try {
  38.113 -                    js.runUserActionTask(new Task<CompilationController>() {
  38.114 -                        @Override public void run(CompilationController parameter) throws Exception {
  38.115 -                            parameter.toPhase(JavaSource.Phase.RESOLVED);
  38.116 +                    URI sourceURI = new URI(rsd.idx.remote.toExternalForm() + "/ui/target?path=" + WebUtilities.escapeForQuery(rsd.idx.remoteSegment) + "&relative=" + WebUtilities.escapeForQuery(rsd.relative) + "&position=" + pos);
  38.117 +                    Map<Object, Object> targetData = Pojson.load(HashMap.class, sourceURI.toURL().openStream());
  38.118  
  38.119 -                            TreePath tp = parameter.getTreeUtilities().pathFor(pos);
  38.120 -                            Element el = parameter.getTrees().getElement(tp);
  38.121 +                    String signature = (String) targetData.get("signature");
  38.122  
  38.123 -                            if (el != null && JavaUtils.SUPPORTED_KINDS.contains(el.getKind())) {
  38.124 -                                handle[0] = new ElementDescription(parameter, el);
  38.125 -                            }
  38.126 +                    if (signature != null) {
  38.127 +                        List<String> baseMethodsSpec = (List<String>) targetData.get("superMethods");
  38.128 +                        baseMethodsSpec = baseMethodsSpec != null ? baseMethodsSpec : Collections.<String>emptyList();
  38.129 +                        List<ElementHandle<?>> baseMethods = new ArrayList<ElementHandle<?>>(baseMethodsSpec.size());
  38.130 +                        for (String spec : baseMethodsSpec) {
  38.131 +                            baseMethods.add(signature2Handle(spec));
  38.132                          }
  38.133 -                    }, true);
  38.134 +                        return new ElementDescription(signature2Handle(signature),
  38.135 +                                                      baseMethods);
  38.136 +                    }
  38.137 +                } catch (URISyntaxException ex) {
  38.138 +                    Exceptions.printStackTrace(ex);
  38.139                  } catch (IOException ex) {
  38.140                      Exceptions.printStackTrace(ex);
  38.141                  }
  38.142              }
  38.143  
  38.144 -        }, "Find Remote Usages");
  38.145 -
  38.146 -        return handle[0];
  38.147 +            return null;
  38.148 +        }
  38.149      }
  38.150  
  38.151 -    private JPanel constructDialog(ElementDescription toSearch, Set<SearchOptions> options, JButton ok) {
  38.152 +    private static ElementHandle<?> signature2Handle(String signature) {
  38.153 +        if (signature == null) return null;
  38.154 +        String[] parts = signature.split(":");
  38.155 +        ElementHandle<?> h = Utilities.createElementHandle(ElementKind.valueOf(parts[0]),
  38.156 +                                                           parts[1],
  38.157 +                                                           parts.length > 2 ? parts[2] : null,
  38.158 +                                                           parts.length > 3 ? parts[3] : null);
  38.159 +        return h;
  38.160 +    }
  38.161 +
  38.162 +    private JPanel constructDialog(ElementDescription toSearch, Set<SearchOptions> options, SelectionListener sl, JButton ok) {
  38.163          JPanel searchKind;
  38.164  
  38.165          switch (toSearch.element.getKind()) {
  38.166 -            case METHOD: searchKind = new MethodOptions(toSearch, options); break;
  38.167 +            case METHOD: searchKind = new MethodOptions(toSearch, options, sl); break;
  38.168              case CLASS:
  38.169              case INTERFACE:
  38.170              case ANNOTATION_TYPE: searchKind = new ClassOptions(options); break;
  38.171 @@ -216,62 +274,86 @@
  38.172          result.setLayout(new BorderLayout());
  38.173          result.setBorder(new EmptyBorder(new Insets(12, 12, 12, 12)));
  38.174  
  38.175 -        result.add(new JLabel(toSearch.displayName), BorderLayout.NORTH);
  38.176 +        result.add(new JLabel("Usages of: " + toSearch.displayName), BorderLayout.NORTH);
  38.177          result.add(searchKind, BorderLayout.CENTER);
  38.178          result.add(progress, BorderLayout.SOUTH);
  38.179  
  38.180 +        sl.elementSelected(toSearch.element);
  38.181 +        
  38.182          return result;
  38.183      }
  38.184      
  38.185      public static final class ElementDescription {
  38.186          public final ElementHandle<?> element;
  38.187          public final String displayName;
  38.188 -        public final ElementHandle<?> superMethod;
  38.189 -        public final String superMethodDisplayName;
  38.190 +        public final List<ElementHandle<?>> superMethods;
  38.191  
  38.192          public ElementDescription(CompilationInfo info, Element el) {
  38.193 -            this.displayName = displayNameForElement(el, info);
  38.194 +            element = ElementHandle.create(el);
  38.195 +            displayName = displayNameForElement(ElementHandle.create(el));
  38.196  
  38.197              if (el.getKind() == ElementKind.METHOD) {
  38.198 -                ExecutableElement base = (ExecutableElement) el;
  38.199 +                superMethods = superMethods(info, new HashSet<TypeElement>(), (ExecutableElement) el, (TypeElement) el.getEnclosingElement());
  38.200 +            } else {
  38.201 +                superMethods = null;
  38.202 +            }
  38.203 +        }
  38.204  
  38.205 -                while (true) {
  38.206 -                    ExecutableElement current = info.getElementUtilities().getOverriddenMethod(base);
  38.207 +        private List<ElementHandle<?>> superMethods(CompilationInfo info, Set<TypeElement> seenTypes, ExecutableElement baseMethod, TypeElement currentType) {
  38.208 +            if (!seenTypes.add(currentType))
  38.209 +                return Collections.emptyList();
  38.210  
  38.211 -                    if (current == null) break;
  38.212 +            List<ElementHandle<?>> result = new ArrayList<ElementHandle<?>>();
  38.213  
  38.214 -                    base = current;
  38.215 +            for (TypeElement sup : superTypes(info, currentType)) {
  38.216 +                for (ExecutableElement ee : ElementFilter.methodsIn(sup.getEnclosedElements())) {
  38.217 +                    if (info.getElements().overrides(baseMethod, ee, (TypeElement) baseMethod.getEnclosingElement())) {
  38.218 +                        result.add(ElementHandle.create(ee));
  38.219 +                    }
  38.220                  }
  38.221  
  38.222 -                if (base != el) {
  38.223 -                    superMethod = ElementHandle.create(base);
  38.224 -                    superMethodDisplayName = displayNameForElement(base, info);
  38.225 -                } else {
  38.226 -                    superMethod = null;
  38.227 -                    superMethodDisplayName = null;
  38.228 +                result.addAll(superMethods(info, seenTypes, baseMethod, currentType));
  38.229 +            }
  38.230 +            
  38.231 +            return result;
  38.232 +        }
  38.233 +
  38.234 +        private List<TypeElement> superTypes(CompilationInfo info, TypeElement type) {
  38.235 +            List<TypeElement> superTypes = new ArrayList<TypeElement>();
  38.236 +
  38.237 +            for (TypeMirror sup : info.getTypes().directSupertypes(type.asType())) {
  38.238 +                if (sup.getKind() == TypeKind.DECLARED) {
  38.239 +                    superTypes.add((TypeElement) ((DeclaredType) sup).asElement());
  38.240                  }
  38.241 -            } else {
  38.242 -                superMethod = null;
  38.243 -                superMethodDisplayName = null;
  38.244              }
  38.245  
  38.246 -            element = ElementHandle.create(el);
  38.247 +            return superTypes;
  38.248          }
  38.249  
  38.250 -        private String displayNameForElement(Element el, CompilationInfo info) throws UnsupportedOperationException {
  38.251 +        public ElementDescription(ElementHandle<?> element, List<ElementHandle<?>> superMethods) {
  38.252 +            this.element = element;
  38.253 +            displayName = displayNameForElement(element);
  38.254 +            this.superMethods = superMethods;
  38.255 +        }
  38.256 +
  38.257 +        private String displayNameForElement(ElementHandle<?> el) throws UnsupportedOperationException {
  38.258 +            String[] signatures = SourceUtils.getJVMSignature(el);
  38.259 +            String classSimpleName = signatures[0];
  38.260 +            int lastDotDollar = Math.max(classSimpleName.lastIndexOf('.'), classSimpleName.lastIndexOf('$'));
  38.261 +            if (lastDotDollar > (-1)) classSimpleName = classSimpleName.substring(lastDotDollar + 1);
  38.262              switch (el.getKind()) {
  38.263                  case METHOD:
  38.264 -                    return "<html>Method <b>" + ElementHeaders.getHeader(el, info, ElementHeaders.NAME + ElementHeaders.PARAMETERS) + "</b> of class <b>" + ElementHeaders.getHeader(el.getEnclosingElement(), info, ElementHeaders.NAME);
  38.265 +                    return signatures[1] + Utilities.decodeMethodParameterTypes(signatures[2]);
  38.266                  case CONSTRUCTOR:
  38.267 -                    return "<html>Constructor <b>" + ElementHeaders.getHeader(el, info, ElementHeaders.NAME + ElementHeaders.PARAMETERS) + "</b> of class <b>" + ElementHeaders.getHeader(el.getEnclosingElement(), info, ElementHeaders.NAME);
  38.268 +                    return classSimpleName + Utilities.decodeMethodParameterTypes(signatures[2]);
  38.269                  case CLASS:
  38.270                  case INTERFACE:
  38.271                  case ENUM:
  38.272                  case ANNOTATION_TYPE:
  38.273 -                    return "<html>Type <b>" + ElementHeaders.getHeader(el, info, ElementHeaders.NAME);
  38.274 +                    return classSimpleName;
  38.275                  case FIELD:
  38.276                  case ENUM_CONSTANT:
  38.277 -                    return "<html>Field <b>" + ElementHeaders.getHeader(el, info, ElementHeaders.NAME) + " of class " + ElementHeaders.getHeader(el.getEnclosingElement(), info, ElementHeaders.NAME);
  38.278 +                    return signatures[1];
  38.279                  default:
  38.280                      throw new UnsupportedOperationException();
  38.281              }
  38.282 @@ -302,7 +384,8 @@
  38.283                  Map<RemoteIndex, List<String>> unmappable = new HashMap<RemoteIndex, List<String>>();
  38.284  
  38.285                  for (RemoteIndex idx : RemoteIndex.loadIndices()) {
  38.286 -                    FileObject localFolder = URLMapper.findFileObject(idx.getLocalFolder());
  38.287 +                    URL localFolderURL = idx.getLocalFolder();
  38.288 +                    FileObject localFolder = localFolderURL != null ? URLMapper.findFileObject(localFolderURL) : null;
  38.289  
  38.290                      if (options.contains(SearchOptions.USAGES)) {
  38.291                          URI resolved = new URI(idx.remote.toExternalForm() + "/usages/search?path=" + WebUtilities.escapeForQuery(idx.remoteSegment) + "&signatures=" + WebUtilities.escapeForQuery(serialized));
  38.292 @@ -313,7 +396,7 @@
  38.293  
  38.294                          for (String path : response) {
  38.295                              if (path.trim().isEmpty()) continue;
  38.296 -                            FileObject file = localFolder.getFileObject(path);
  38.297 +                            FileObject file = localFolder != null ? localFolder.getFileObject(path) : null;
  38.298  
  38.299                              if (file != null) {
  38.300                                  if (resultSet.add(file)) {
  38.301 @@ -350,7 +433,7 @@
  38.302                          for (Entry<String, List<Map<String, String>>> e : formattedResponse.entrySet()) {
  38.303                              for (Map<String, String> p : e.getValue()) {
  38.304                                  String path = p.get("file");
  38.305 -                                FileObject file = localFolder.getFileObject(path);
  38.306 +                                FileObject file = localFolder != null ? localFolder.getFileObject(path) : null;
  38.307  
  38.308                                  if (file != null) {
  38.309                                      if (resultSet.add(file)) {
  38.310 @@ -399,7 +482,10 @@
  38.311  
  38.312      public enum SearchOptions {
  38.313          USAGES,
  38.314 -        SUB,
  38.315 -        FROM_BASE;
  38.316 +        SUB;
  38.317 +    }
  38.318 +
  38.319 +    public interface SelectionListener {
  38.320 +        public void elementSelected(ElementHandle<?> selected);
  38.321      }
  38.322  }
    39.1 --- a/remoting/server/web/resolve.web.api/build.xml	Sat Aug 30 22:08:25 2014 +0200
    39.2 +++ b/remoting/server/web/resolve.web.api/build.xml	Sun Sep 28 18:40:42 2014 +0200
    39.3 @@ -51,8 +51,7 @@
    39.4        -init-macrodef-junit:     defines macro for junit execution
    39.5        -init-macrodef-debug:     defines macro for class debugging
    39.6        -init-macrodef-java:      defines macro for class execution
    39.7 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
    39.8 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
    39.9 +      -do-jar:                  JAR building
   39.10        run:                      execution of project 
   39.11        -javadoc-build:           Javadoc generation
   39.12        test-report:              JUnit report generation
    40.1 --- a/remoting/server/web/resolve.web.api/nbproject/build-impl.xml	Sat Aug 30 22:08:25 2014 +0200
    40.2 +++ b/remoting/server/web/resolve.web.api/nbproject/build-impl.xml	Sun Sep 28 18:40:42 2014 +0200
    40.3 @@ -79,6 +79,7 @@
    40.4          <property file="nbproject/project.properties"/>
    40.5      </target>
    40.6      <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    40.7 +        <property name="platform.java" value="${java.home}/bin/java"/>
    40.8          <available file="${manifest.file}" property="manifest.available"/>
    40.9          <condition property="splashscreen.available">
   40.10              <and>
   40.11 @@ -96,16 +97,20 @@
   40.12                  </not>
   40.13              </and>
   40.14          </condition>
   40.15 -        <condition property="manifest.available+main.class">
   40.16 +        <condition property="profile.available">
   40.17              <and>
   40.18 -                <isset property="manifest.available"/>
   40.19 -                <isset property="main.class.available"/>
   40.20 +                <isset property="javac.profile"/>
   40.21 +                <length length="0" string="${javac.profile}" when="greater"/>
   40.22 +                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
   40.23              </and>
   40.24          </condition>
   40.25          <condition property="do.archive">
   40.26 -            <not>
   40.27 -                <istrue value="${jar.archive.disabled}"/>
   40.28 -            </not>
   40.29 +            <or>
   40.30 +                <not>
   40.31 +                    <istrue value="${jar.archive.disabled}"/>
   40.32 +                </not>
   40.33 +                <istrue value="${not.archive.disabled}"/>
   40.34 +            </or>
   40.35          </condition>
   40.36          <condition property="do.mkdist">
   40.37              <and>
   40.38 @@ -116,12 +121,6 @@
   40.39                  </not>
   40.40              </and>
   40.41          </condition>
   40.42 -        <condition property="manifest.available+main.class+mkdist.available">
   40.43 -            <and>
   40.44 -                <istrue value="${manifest.available+main.class}"/>
   40.45 -                <isset property="do.mkdist"/>
   40.46 -            </and>
   40.47 -        </condition>
   40.48          <condition property="do.archive+manifest.available">
   40.49              <and>
   40.50                  <isset property="manifest.available"/>
   40.51 @@ -140,24 +139,12 @@
   40.52                  <istrue value="${do.archive}"/>
   40.53              </and>
   40.54          </condition>
   40.55 -        <condition property="do.archive+manifest.available+main.class">
   40.56 +        <condition property="do.archive+profile.available">
   40.57              <and>
   40.58 -                <istrue value="${manifest.available+main.class}"/>
   40.59 +                <isset property="profile.available"/>
   40.60                  <istrue value="${do.archive}"/>
   40.61              </and>
   40.62          </condition>
   40.63 -        <condition property="manifest.available-mkdist.available">
   40.64 -            <or>
   40.65 -                <istrue value="${manifest.available}"/>
   40.66 -                <isset property="do.mkdist"/>
   40.67 -            </or>
   40.68 -        </condition>
   40.69 -        <condition property="manifest.available+main.class-mkdist.available">
   40.70 -            <or>
   40.71 -                <istrue value="${manifest.available+main.class}"/>
   40.72 -                <isset property="do.mkdist"/>
   40.73 -            </or>
   40.74 -        </condition>
   40.75          <condition property="have.tests">
   40.76              <or>
   40.77                  <available file="${test.src.dir}"/>
   40.78 @@ -211,7 +198,15 @@
   40.79          </condition>
   40.80          <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   40.81          <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   40.82 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
   40.83 +            <and>
   40.84 +                <isset property="endorsed.classpath"/>
   40.85 +                <not>
   40.86 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   40.87 +                </not>
   40.88 +            </and>
   40.89 +        </condition>
   40.90 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   40.91 +            <isset property="profile.available"/>
   40.92          </condition>
   40.93          <condition else="false" property="jdkBug6558476">
   40.94              <and>
   40.95 @@ -300,6 +295,7 @@
   40.96                          <path path="@{classpath}"/>
   40.97                      </classpath>
   40.98                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   40.99 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  40.100                      <compilerarg line="${javac.compilerargs}"/>
  40.101                      <compilerarg value="-processorpath"/>
  40.102                      <compilerarg path="@{processorpath}:${empty.dir}"/>
  40.103 @@ -339,6 +335,7 @@
  40.104                          <path path="@{classpath}"/>
  40.105                      </classpath>
  40.106                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  40.107 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  40.108                      <compilerarg line="${javac.compilerargs}"/>
  40.109                      <customize/>
  40.110                  </javac>
  40.111 @@ -471,7 +468,7 @@
  40.112                      </fileset>
  40.113                  </union>
  40.114                  <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
  40.115 -                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="resolve.web.api" testname="TestNG tests" workingDir="${work.dir}">
  40.116 +                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="resolve.web.api" testname="TestNG tests" workingDir="${work.dir}">
  40.117                      <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
  40.118                      <propertyset>
  40.119                          <propertyref prefix="test-sys-prop."/>
  40.120 @@ -862,8 +859,8 @@
  40.121                      </chainedmapper>
  40.122                  </pathconvert>
  40.123                  <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  40.124 -                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  40.125 -                    <fileset dir="${build.classes.dir}"/>
  40.126 +                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  40.127 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  40.128                      <manifest>
  40.129                          <attribute name="Class-Path" value="${jar.classpath}"/>
  40.130                          <customize/>
  40.131 @@ -875,7 +872,7 @@
  40.132      <target name="-init-presetdef-jar">
  40.133          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  40.134              <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  40.135 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
  40.136 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  40.137              </jar>
  40.138          </presetdef>
  40.139      </target>
  40.140 @@ -930,6 +927,7 @@
  40.141              <param location="${project.base_web_api}/build.xml" name="call.script"/>
  40.142              <param name="call.target" value="jar"/>
  40.143              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  40.144 +            <param name="transfer.not.archive.disabled" value="true"/>
  40.145          </antcall>
  40.146          <antcall target="-maybe-call-dep">
  40.147              <param name="call.built.properties" value="${built-jar.properties}"/>
  40.148 @@ -937,6 +935,7 @@
  40.149              <param location="${project.source_web_api}/build.xml" name="call.script"/>
  40.150              <param name="call.target" value="jar"/>
  40.151              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  40.152 +            <param name="transfer.not.archive.disabled" value="true"/>
  40.153          </antcall>
  40.154      </target>
  40.155      <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  40.156 @@ -1005,41 +1004,25 @@
  40.157          <!-- Empty placeholder for easier customization. -->
  40.158          <!-- You can override this target in the ../build.xml file. -->
  40.159      </target>
  40.160 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  40.161 -        <j2seproject1:jar/>
  40.162 -    </target>
  40.163 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
  40.164 -        <j2seproject1:jar manifest="${manifest.file}"/>
  40.165 -    </target>
  40.166 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  40.167 -        <j2seproject1:jar manifest="${manifest.file}">
  40.168 -            <j2seproject1:manifest>
  40.169 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  40.170 -            </j2seproject1:manifest>
  40.171 -        </j2seproject1:jar>
  40.172 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
  40.173 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  40.174 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  40.175 -        <pathconvert property="run.classpath.with.dist.jar">
  40.176 -            <path path="${run.classpath}"/>
  40.177 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  40.178 -        </pathconvert>
  40.179 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  40.180 -    </target>
  40.181 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  40.182 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  40.183          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  40.184          <touch file="${tmp.manifest.file}" verbose="false"/>
  40.185      </target>
  40.186 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  40.187 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  40.188          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  40.189          <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  40.190      </target>
  40.191 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
  40.192 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  40.193          <manifest file="${tmp.manifest.file}" mode="update">
  40.194              <attribute name="Main-Class" value="${main.class}"/>
  40.195          </manifest>
  40.196      </target>
  40.197 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
  40.198 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  40.199 +        <manifest file="${tmp.manifest.file}" mode="update">
  40.200 +            <attribute name="Profile" value="${javac.profile}"/>
  40.201 +        </manifest>
  40.202 +    </target>
  40.203 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  40.204          <basename file="${application.splash}" property="splashscreen.basename"/>
  40.205          <mkdir dir="${build.classes.dir}/META-INF"/>
  40.206          <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  40.207 @@ -1047,23 +1030,41 @@
  40.208              <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  40.209          </manifest>
  40.210      </target>
  40.211 -    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
  40.212 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
  40.213          <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  40.214          <echo level="info">To run this application from the command line without Ant, try:</echo>
  40.215          <property location="${dist.jar}" name="dist.jar.resolved"/>
  40.216          <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  40.217      </target>
  40.218 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  40.219 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
  40.220 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  40.221 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  40.222 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  40.223 +        <pathconvert property="run.classpath.with.dist.jar">
  40.224 +            <path path="${run.classpath}"/>
  40.225 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  40.226 +        </pathconvert>
  40.227 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
  40.228 +            <isset property="main.class.available"/>
  40.229 +        </condition>
  40.230 +        <condition else="debug" property="jar.usage.level" value="info">
  40.231 +            <isset property="main.class.available"/>
  40.232 +        </condition>
  40.233 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  40.234 +    </target>
  40.235 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  40.236          <delete>
  40.237              <fileset file="${tmp.manifest.file}"/>
  40.238          </delete>
  40.239      </target>
  40.240 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
  40.241 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
  40.242 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
  40.243      <target name="-post-jar">
  40.244          <!-- Empty placeholder for easier customization. -->
  40.245          <!-- You can override this target in the ../build.xml file. -->
  40.246      </target>
  40.247 -    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  40.248 +    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  40.249 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
  40.250      <!--
  40.251                  =================
  40.252                  EXECUTION SECTION
  40.253 @@ -1242,11 +1243,14 @@
  40.254                  </not>
  40.255              </and>
  40.256          </condition>
  40.257 -        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  40.258 +        <condition else="" property="bug5101868workaround" value="*.java">
  40.259 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  40.260 +        </condition>
  40.261 +        <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  40.262              <classpath>
  40.263                  <path path="${javac.classpath}"/>
  40.264              </classpath>
  40.265 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  40.266 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  40.267                  <filename name="**/*.java"/>
  40.268              </fileset>
  40.269              <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  40.270 @@ -1320,7 +1324,7 @@
  40.271          <mkdir dir="${build.test.results.dir}"/>
  40.272      </target>
  40.273      <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  40.274 -        <j2seproject3:test testincludes="**/*Test.java"/>
  40.275 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  40.276      </target>
  40.277      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  40.278          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  40.279 @@ -1424,6 +1428,7 @@
  40.280              <param location="${project.base_web_api}/build.xml" name="call.script"/>
  40.281              <param name="call.target" value="clean"/>
  40.282              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  40.283 +            <param name="transfer.not.archive.disabled" value="true"/>
  40.284          </antcall>
  40.285          <antcall target="-maybe-call-dep">
  40.286              <param name="call.built.properties" value="${built-clean.properties}"/>
  40.287 @@ -1431,6 +1436,7 @@
  40.288              <param location="${project.source_web_api}/build.xml" name="call.script"/>
  40.289              <param name="call.target" value="clean"/>
  40.290              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  40.291 +            <param name="transfer.not.archive.disabled" value="true"/>
  40.292          </antcall>
  40.293      </target>
  40.294      <target depends="init" name="-do-clean">
    41.1 --- a/remoting/server/web/resolve.web.api/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
    41.2 +++ b/remoting/server/web/resolve.web.api/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
    41.3 @@ -1,8 +1,8 @@
    41.4  build.xml.data.CRC32=6b9c67e4
    41.5 -build.xml.script.CRC32=7afd01f6
    41.6 -build.xml.stylesheet.CRC32=28e38971@1.56.0.46
    41.7 +build.xml.script.CRC32=7dffd7e8
    41.8 +build.xml.stylesheet.CRC32=8064a381@1.71.0.47
    41.9  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   41.10  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   41.11  nbproject/build-impl.xml.data.CRC32=6b9c67e4
   41.12 -nbproject/build-impl.xml.script.CRC32=ce04aacf
   41.13 -nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.0.46
   41.14 +nbproject/build-impl.xml.script.CRC32=caeda2af
   41.15 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.0.48
    42.1 --- a/remoting/server/web/resolve.web.api/src/org/netbeans/modules/jackpot30/resolve/api/ResolveService.java	Sat Aug 30 22:08:25 2014 +0200
    42.2 +++ b/remoting/server/web/resolve.web.api/src/org/netbeans/modules/jackpot30/resolve/api/ResolveService.java	Sun Sep 28 18:40:42 2014 +0200
    42.3 @@ -210,6 +210,9 @@
    42.4                      return new long[] {-1, -1, -1, -1};
    42.5                  }
    42.6                  name = ((MethodTree) forTree.getLeaf()).getName();
    42.7 +                if (name.contentEquals("<init>")) {
    42.8 +                    name = ((ClassTree) forTree.getParentPath().getLeaf()).getSimpleName();
    42.9 +                }
   42.10                  break;
   42.11              case VARIABLE: name = ((VariableTree) forTree.getLeaf()).getName(); break;
   42.12          }
    43.1 --- a/remoting/server/web/web.main/nbproject/build-impl.xml	Sat Aug 30 22:08:25 2014 +0200
    43.2 +++ b/remoting/server/web/web.main/nbproject/build-impl.xml	Sun Sep 28 18:40:42 2014 +0200
    43.3 @@ -79,6 +79,7 @@
    43.4          <property file="nbproject/project.properties"/>
    43.5      </target>
    43.6      <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    43.7 +        <property name="platform.java" value="${java.home}/bin/java"/>
    43.8          <available file="${manifest.file}" property="manifest.available"/>
    43.9          <condition property="splashscreen.available">
   43.10              <and>
   43.11 @@ -96,16 +97,20 @@
   43.12                  </not>
   43.13              </and>
   43.14          </condition>
   43.15 -        <condition property="manifest.available+main.class">
   43.16 +        <condition property="profile.available">
   43.17              <and>
   43.18 -                <isset property="manifest.available"/>
   43.19 -                <isset property="main.class.available"/>
   43.20 +                <isset property="javac.profile"/>
   43.21 +                <length length="0" string="${javac.profile}" when="greater"/>
   43.22 +                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
   43.23              </and>
   43.24          </condition>
   43.25          <condition property="do.archive">
   43.26 -            <not>
   43.27 -                <istrue value="${jar.archive.disabled}"/>
   43.28 -            </not>
   43.29 +            <or>
   43.30 +                <not>
   43.31 +                    <istrue value="${jar.archive.disabled}"/>
   43.32 +                </not>
   43.33 +                <istrue value="${not.archive.disabled}"/>
   43.34 +            </or>
   43.35          </condition>
   43.36          <condition property="do.mkdist">
   43.37              <and>
   43.38 @@ -116,12 +121,6 @@
   43.39                  </not>
   43.40              </and>
   43.41          </condition>
   43.42 -        <condition property="manifest.available+main.class+mkdist.available">
   43.43 -            <and>
   43.44 -                <istrue value="${manifest.available+main.class}"/>
   43.45 -                <isset property="do.mkdist"/>
   43.46 -            </and>
   43.47 -        </condition>
   43.48          <condition property="do.archive+manifest.available">
   43.49              <and>
   43.50                  <isset property="manifest.available"/>
   43.51 @@ -140,24 +139,12 @@
   43.52                  <istrue value="${do.archive}"/>
   43.53              </and>
   43.54          </condition>
   43.55 -        <condition property="do.archive+manifest.available+main.class">
   43.56 +        <condition property="do.archive+profile.available">
   43.57              <and>
   43.58 -                <istrue value="${manifest.available+main.class}"/>
   43.59 +                <isset property="profile.available"/>
   43.60                  <istrue value="${do.archive}"/>
   43.61              </and>
   43.62          </condition>
   43.63 -        <condition property="manifest.available-mkdist.available">
   43.64 -            <or>
   43.65 -                <istrue value="${manifest.available}"/>
   43.66 -                <isset property="do.mkdist"/>
   43.67 -            </or>
   43.68 -        </condition>
   43.69 -        <condition property="manifest.available+main.class-mkdist.available">
   43.70 -            <or>
   43.71 -                <istrue value="${manifest.available+main.class}"/>
   43.72 -                <isset property="do.mkdist"/>
   43.73 -            </or>
   43.74 -        </condition>
   43.75          <condition property="have.tests">
   43.76              <or>
   43.77                  <available file="${test.src.dir}"/>
   43.78 @@ -211,7 +198,15 @@
   43.79          </condition>
   43.80          <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   43.81          <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   43.82 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
   43.83 +            <and>
   43.84 +                <isset property="endorsed.classpath"/>
   43.85 +                <not>
   43.86 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   43.87 +                </not>
   43.88 +            </and>
   43.89 +        </condition>
   43.90 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   43.91 +            <isset property="profile.available"/>
   43.92          </condition>
   43.93          <condition else="false" property="jdkBug6558476">
   43.94              <and>
   43.95 @@ -300,6 +295,7 @@
   43.96                          <path path="@{classpath}"/>
   43.97                      </classpath>
   43.98                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   43.99 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  43.100                      <compilerarg line="${javac.compilerargs}"/>
  43.101                      <compilerarg value="-processorpath"/>
  43.102                      <compilerarg path="@{processorpath}:${empty.dir}"/>
  43.103 @@ -339,6 +335,7 @@
  43.104                          <path path="@{classpath}"/>
  43.105                      </classpath>
  43.106                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  43.107 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  43.108                      <compilerarg line="${javac.compilerargs}"/>
  43.109                      <customize/>
  43.110                  </javac>
  43.111 @@ -471,7 +468,7 @@
  43.112                      </fileset>
  43.113                  </union>
  43.114                  <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
  43.115 -                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="web.main" testname="TestNG tests" workingDir="${work.dir}">
  43.116 +                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="web.main" testname="TestNG tests" workingDir="${work.dir}">
  43.117                      <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
  43.118                      <propertyset>
  43.119                          <propertyref prefix="test-sys-prop."/>
  43.120 @@ -862,8 +859,8 @@
  43.121                      </chainedmapper>
  43.122                  </pathconvert>
  43.123                  <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  43.124 -                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  43.125 -                    <fileset dir="${build.classes.dir}"/>
  43.126 +                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  43.127 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  43.128                      <manifest>
  43.129                          <attribute name="Class-Path" value="${jar.classpath}"/>
  43.130                          <customize/>
  43.131 @@ -875,7 +872,7 @@
  43.132      <target name="-init-presetdef-jar">
  43.133          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  43.134              <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  43.135 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
  43.136 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  43.137              </jar>
  43.138          </presetdef>
  43.139      </target>
  43.140 @@ -930,6 +927,7 @@
  43.141              <param location="${project.base_web_api}/build.xml" name="call.script"/>
  43.142              <param name="call.target" value="jar"/>
  43.143              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.144 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.145          </antcall>
  43.146          <antcall target="-maybe-call-dep">
  43.147              <param name="call.built.properties" value="${built-jar.properties}"/>
  43.148 @@ -937,6 +935,7 @@
  43.149              <param location="${project.nbindex_web_api}/build.xml" name="call.script"/>
  43.150              <param name="call.target" value="jar"/>
  43.151              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.152 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.153          </antcall>
  43.154          <antcall target="-maybe-call-dep">
  43.155              <param name="call.built.properties" value="${built-jar.properties}"/>
  43.156 @@ -944,6 +943,7 @@
  43.157              <param location="${project.resolve_web_api}/build.xml" name="call.script"/>
  43.158              <param name="call.target" value="jar"/>
  43.159              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.160 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.161          </antcall>
  43.162          <antcall target="-maybe-call-dep">
  43.163              <param name="call.built.properties" value="${built-jar.properties}"/>
  43.164 @@ -951,6 +951,7 @@
  43.165              <param location="${project.source_web_api}/build.xml" name="call.script"/>
  43.166              <param name="call.target" value="jar"/>
  43.167              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.168 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.169          </antcall>
  43.170          <antcall target="-maybe-call-dep">
  43.171              <param name="call.built.properties" value="${built-jar.properties}"/>
  43.172 @@ -958,6 +959,7 @@
  43.173              <param location="${project.type_web_api}/build.xml" name="call.script"/>
  43.174              <param name="call.target" value="jar"/>
  43.175              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.176 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.177          </antcall>
  43.178          <antcall target="-maybe-call-dep">
  43.179              <param name="call.built.properties" value="${built-jar.properties}"/>
  43.180 @@ -965,6 +967,7 @@
  43.181              <param location="${project.usages_web_api}/build.xml" name="call.script"/>
  43.182              <param name="call.target" value="jar"/>
  43.183              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.184 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.185          </antcall>
  43.186          <antcall target="-maybe-call-dep">
  43.187              <param name="call.built.properties" value="${built-jar.properties}"/>
  43.188 @@ -972,6 +975,7 @@
  43.189              <param location="${project.web_ui}/build.xml" name="call.script"/>
  43.190              <param name="call.target" value="jar"/>
  43.191              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  43.192 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.193          </antcall>
  43.194      </target>
  43.195      <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  43.196 @@ -1040,41 +1044,25 @@
  43.197          <!-- Empty placeholder for easier customization. -->
  43.198          <!-- You can override this target in the ../build.xml file. -->
  43.199      </target>
  43.200 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  43.201 -        <j2seproject1:jar/>
  43.202 -    </target>
  43.203 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
  43.204 -        <j2seproject1:jar manifest="${manifest.file}"/>
  43.205 -    </target>
  43.206 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  43.207 -        <j2seproject1:jar manifest="${manifest.file}">
  43.208 -            <j2seproject1:manifest>
  43.209 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  43.210 -            </j2seproject1:manifest>
  43.211 -        </j2seproject1:jar>
  43.212 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
  43.213 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  43.214 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  43.215 -        <pathconvert property="run.classpath.with.dist.jar">
  43.216 -            <path path="${run.classpath}"/>
  43.217 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  43.218 -        </pathconvert>
  43.219 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  43.220 -    </target>
  43.221 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  43.222 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  43.223          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  43.224          <touch file="${tmp.manifest.file}" verbose="false"/>
  43.225      </target>
  43.226 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  43.227 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  43.228          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  43.229          <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  43.230      </target>
  43.231 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
  43.232 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  43.233          <manifest file="${tmp.manifest.file}" mode="update">
  43.234              <attribute name="Main-Class" value="${main.class}"/>
  43.235          </manifest>
  43.236      </target>
  43.237 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
  43.238 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  43.239 +        <manifest file="${tmp.manifest.file}" mode="update">
  43.240 +            <attribute name="Profile" value="${javac.profile}"/>
  43.241 +        </manifest>
  43.242 +    </target>
  43.243 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  43.244          <basename file="${application.splash}" property="splashscreen.basename"/>
  43.245          <mkdir dir="${build.classes.dir}/META-INF"/>
  43.246          <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  43.247 @@ -1082,23 +1070,41 @@
  43.248              <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  43.249          </manifest>
  43.250      </target>
  43.251 -    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
  43.252 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
  43.253          <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  43.254          <echo level="info">To run this application from the command line without Ant, try:</echo>
  43.255          <property location="${dist.jar}" name="dist.jar.resolved"/>
  43.256          <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  43.257      </target>
  43.258 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  43.259 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
  43.260 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  43.261 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  43.262 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  43.263 +        <pathconvert property="run.classpath.with.dist.jar">
  43.264 +            <path path="${run.classpath}"/>
  43.265 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  43.266 +        </pathconvert>
  43.267 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
  43.268 +            <isset property="main.class.available"/>
  43.269 +        </condition>
  43.270 +        <condition else="debug" property="jar.usage.level" value="info">
  43.271 +            <isset property="main.class.available"/>
  43.272 +        </condition>
  43.273 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  43.274 +    </target>
  43.275 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  43.276          <delete>
  43.277              <fileset file="${tmp.manifest.file}"/>
  43.278          </delete>
  43.279      </target>
  43.280 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
  43.281 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
  43.282 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
  43.283      <target name="-post-jar">
  43.284          <!-- Empty placeholder for easier customization. -->
  43.285          <!-- You can override this target in the ../build.xml file. -->
  43.286      </target>
  43.287 -    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  43.288 +    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  43.289 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
  43.290      <!--
  43.291                  =================
  43.292                  EXECUTION SECTION
  43.293 @@ -1277,11 +1283,14 @@
  43.294                  </not>
  43.295              </and>
  43.296          </condition>
  43.297 -        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  43.298 +        <condition else="" property="bug5101868workaround" value="*.java">
  43.299 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  43.300 +        </condition>
  43.301 +        <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  43.302              <classpath>
  43.303                  <path path="${javac.classpath}"/>
  43.304              </classpath>
  43.305 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  43.306 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  43.307                  <filename name="**/*.java"/>
  43.308              </fileset>
  43.309              <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  43.310 @@ -1355,7 +1364,7 @@
  43.311          <mkdir dir="${build.test.results.dir}"/>
  43.312      </target>
  43.313      <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  43.314 -        <j2seproject3:test testincludes="**/*Test.java"/>
  43.315 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  43.316      </target>
  43.317      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  43.318          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  43.319 @@ -1459,6 +1468,7 @@
  43.320              <param location="${project.base_web_api}/build.xml" name="call.script"/>
  43.321              <param name="call.target" value="clean"/>
  43.322              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.323 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.324          </antcall>
  43.325          <antcall target="-maybe-call-dep">
  43.326              <param name="call.built.properties" value="${built-clean.properties}"/>
  43.327 @@ -1466,6 +1476,7 @@
  43.328              <param location="${project.nbindex_web_api}/build.xml" name="call.script"/>
  43.329              <param name="call.target" value="clean"/>
  43.330              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.331 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.332          </antcall>
  43.333          <antcall target="-maybe-call-dep">
  43.334              <param name="call.built.properties" value="${built-clean.properties}"/>
  43.335 @@ -1473,6 +1484,7 @@
  43.336              <param location="${project.resolve_web_api}/build.xml" name="call.script"/>
  43.337              <param name="call.target" value="clean"/>
  43.338              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.339 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.340          </antcall>
  43.341          <antcall target="-maybe-call-dep">
  43.342              <param name="call.built.properties" value="${built-clean.properties}"/>
  43.343 @@ -1480,6 +1492,7 @@
  43.344              <param location="${project.source_web_api}/build.xml" name="call.script"/>
  43.345              <param name="call.target" value="clean"/>
  43.346              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.347 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.348          </antcall>
  43.349          <antcall target="-maybe-call-dep">
  43.350              <param name="call.built.properties" value="${built-clean.properties}"/>
  43.351 @@ -1487,6 +1500,7 @@
  43.352              <param location="${project.type_web_api}/build.xml" name="call.script"/>
  43.353              <param name="call.target" value="clean"/>
  43.354              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.355 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.356          </antcall>
  43.357          <antcall target="-maybe-call-dep">
  43.358              <param name="call.built.properties" value="${built-clean.properties}"/>
  43.359 @@ -1494,6 +1508,7 @@
  43.360              <param location="${project.usages_web_api}/build.xml" name="call.script"/>
  43.361              <param name="call.target" value="clean"/>
  43.362              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.363 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.364          </antcall>
  43.365          <antcall target="-maybe-call-dep">
  43.366              <param name="call.built.properties" value="${built-clean.properties}"/>
  43.367 @@ -1501,6 +1516,7 @@
  43.368              <param location="${project.web_ui}/build.xml" name="call.script"/>
  43.369              <param name="call.target" value="clean"/>
  43.370              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  43.371 +            <param name="transfer.not.archive.disabled" value="true"/>
  43.372          </antcall>
  43.373      </target>
  43.374      <target depends="init" name="-do-clean">
    44.1 --- a/remoting/server/web/web.main/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
    44.2 +++ b/remoting/server/web/web.main/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
    44.3 @@ -4,5 +4,5 @@
    44.4  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    44.5  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    44.6  nbproject/build-impl.xml.data.CRC32=5c807d62
    44.7 -nbproject/build-impl.xml.script.CRC32=10caceb7
    44.8 -nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.0.46
    44.9 +nbproject/build-impl.xml.script.CRC32=4f66efc1
   44.10 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.0.48
    45.1 --- a/remoting/server/web/web.ui.frontend/public_html/index/ui/script.js	Sat Aug 30 22:08:25 2014 +0200
    45.2 +++ b/remoting/server/web/web.ui.frontend/public_html/index/ui/script.js	Sun Sep 28 18:40:42 2014 +0200
    45.3 @@ -283,7 +283,9 @@
    45.4              } else if ("position" in parsedData) {
    45.5                  setHash($location, "p" + parsedData.position);
    45.6              } else if ("source" in parsedData) {
    45.7 -                window.location = "#/showCode?path=" + parsedData.path + "&relative=" + parsedData.source + "&goto=" + parsedData.signature;
    45.8 +                $location.hash("p" + pos);
    45.9 +                $location.replace();
   45.10 +                $location.url("/showCode?path=" + parsedData.path + "&relative=" + parsedData.source + "&goto=" + parsedData.signature);
   45.11              } else if ("targets" in parsedData) {
   45.12                  var popupContent = "The target element is defined in the following files:<br>";
   45.13                  popupContent += "<ul>";
   45.14 @@ -446,8 +448,6 @@
   45.15  function doColoring(path, relative, $highlights, $spans, $scope, $location, $routeParams, $http, sourceCode) {
   45.16      $scope.sourceCode = tokenColoring(sourceCode, $highlights, $spans);
   45.17  
   45.18 -    $location.replace();
   45.19 -
   45.20      if (!$location.hash()) {
   45.21          var goto = $routeParams.goto;
   45.22  
   45.23 @@ -455,6 +455,9 @@
   45.24              $http.get('/index/ui/declarationSpan?path=' + path + '&relative=' + relative + '&signature=' + unescape(goto)).success(function(parsedData) {
   45.25                  if (parsedData[2] !== (-1)) {
   45.26                      setHash($location, "p" + parsedData[2]);
   45.27 +//                    $location.hash("p" + parsedData[2]);
   45.28 +                    $location.replace();
   45.29 +//                    alert(parsedData[2]);
   45.30                  }
   45.31              });
   45.32          }
    46.1 --- a/remoting/server/web/web.ui/build.xml	Sat Aug 30 22:08:25 2014 +0200
    46.2 +++ b/remoting/server/web/web.ui/build.xml	Sun Sep 28 18:40:42 2014 +0200
    46.3 @@ -51,8 +51,7 @@
    46.4        -init-macrodef-junit:     defines macro for junit execution
    46.5        -init-macrodef-debug:     defines macro for class debugging
    46.6        -init-macrodef-java:      defines macro for class execution
    46.7 -      -do-jar-with-manifest:    JAR building (if you are using a manifest)
    46.8 -      -do-jar-without-manifest: JAR building (if you are not using a manifest)
    46.9 +      -do-jar:                  JAR building
   46.10        run:                      execution of project 
   46.11        -javadoc-build:           Javadoc generation
   46.12        test-report:              JUnit report generation
    47.1 --- a/remoting/server/web/web.ui/nbproject/build-impl.xml	Sat Aug 30 22:08:25 2014 +0200
    47.2 +++ b/remoting/server/web/web.ui/nbproject/build-impl.xml	Sun Sep 28 18:40:42 2014 +0200
    47.3 @@ -79,6 +79,7 @@
    47.4          <property file="nbproject/project.properties"/>
    47.5      </target>
    47.6      <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    47.7 +        <property name="platform.java" value="${java.home}/bin/java"/>
    47.8          <available file="${manifest.file}" property="manifest.available"/>
    47.9          <condition property="splashscreen.available">
   47.10              <and>
   47.11 @@ -96,16 +97,20 @@
   47.12                  </not>
   47.13              </and>
   47.14          </condition>
   47.15 -        <condition property="manifest.available+main.class">
   47.16 +        <condition property="profile.available">
   47.17              <and>
   47.18 -                <isset property="manifest.available"/>
   47.19 -                <isset property="main.class.available"/>
   47.20 +                <isset property="javac.profile"/>
   47.21 +                <length length="0" string="${javac.profile}" when="greater"/>
   47.22 +                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
   47.23              </and>
   47.24          </condition>
   47.25          <condition property="do.archive">
   47.26 -            <not>
   47.27 -                <istrue value="${jar.archive.disabled}"/>
   47.28 -            </not>
   47.29 +            <or>
   47.30 +                <not>
   47.31 +                    <istrue value="${jar.archive.disabled}"/>
   47.32 +                </not>
   47.33 +                <istrue value="${not.archive.disabled}"/>
   47.34 +            </or>
   47.35          </condition>
   47.36          <condition property="do.mkdist">
   47.37              <and>
   47.38 @@ -116,12 +121,6 @@
   47.39                  </not>
   47.40              </and>
   47.41          </condition>
   47.42 -        <condition property="manifest.available+main.class+mkdist.available">
   47.43 -            <and>
   47.44 -                <istrue value="${manifest.available+main.class}"/>
   47.45 -                <isset property="do.mkdist"/>
   47.46 -            </and>
   47.47 -        </condition>
   47.48          <condition property="do.archive+manifest.available">
   47.49              <and>
   47.50                  <isset property="manifest.available"/>
   47.51 @@ -140,24 +139,12 @@
   47.52                  <istrue value="${do.archive}"/>
   47.53              </and>
   47.54          </condition>
   47.55 -        <condition property="do.archive+manifest.available+main.class">
   47.56 +        <condition property="do.archive+profile.available">
   47.57              <and>
   47.58 -                <istrue value="${manifest.available+main.class}"/>
   47.59 +                <isset property="profile.available"/>
   47.60                  <istrue value="${do.archive}"/>
   47.61              </and>
   47.62          </condition>
   47.63 -        <condition property="manifest.available-mkdist.available">
   47.64 -            <or>
   47.65 -                <istrue value="${manifest.available}"/>
   47.66 -                <isset property="do.mkdist"/>
   47.67 -            </or>
   47.68 -        </condition>
   47.69 -        <condition property="manifest.available+main.class-mkdist.available">
   47.70 -            <or>
   47.71 -                <istrue value="${manifest.available+main.class}"/>
   47.72 -                <isset property="do.mkdist"/>
   47.73 -            </or>
   47.74 -        </condition>
   47.75          <condition property="have.tests">
   47.76              <or>
   47.77                  <available file="${test.src.dir}"/>
   47.78 @@ -211,7 +198,15 @@
   47.79          </condition>
   47.80          <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   47.81          <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   47.82 -            <length length="0" string="${endorsed.classpath}" when="greater"/>
   47.83 +            <and>
   47.84 +                <isset property="endorsed.classpath"/>
   47.85 +                <not>
   47.86 +                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   47.87 +                </not>
   47.88 +            </and>
   47.89 +        </condition>
   47.90 +        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   47.91 +            <isset property="profile.available"/>
   47.92          </condition>
   47.93          <condition else="false" property="jdkBug6558476">
   47.94              <and>
   47.95 @@ -300,6 +295,7 @@
   47.96                          <path path="@{classpath}"/>
   47.97                      </classpath>
   47.98                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   47.99 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  47.100                      <compilerarg line="${javac.compilerargs}"/>
  47.101                      <compilerarg value="-processorpath"/>
  47.102                      <compilerarg path="@{processorpath}:${empty.dir}"/>
  47.103 @@ -339,6 +335,7 @@
  47.104                          <path path="@{classpath}"/>
  47.105                      </classpath>
  47.106                      <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  47.107 +                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
  47.108                      <compilerarg line="${javac.compilerargs}"/>
  47.109                      <customize/>
  47.110                  </javac>
  47.111 @@ -471,7 +468,7 @@
  47.112                      </fileset>
  47.113                  </union>
  47.114                  <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
  47.115 -                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="web.ui" testname="TestNG tests" workingDir="${work.dir}">
  47.116 +                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="web.ui" testname="TestNG tests" workingDir="${work.dir}">
  47.117                      <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
  47.118                      <propertyset>
  47.119                          <propertyref prefix="test-sys-prop."/>
  47.120 @@ -862,8 +859,8 @@
  47.121                      </chainedmapper>
  47.122                  </pathconvert>
  47.123                  <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  47.124 -                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  47.125 -                    <fileset dir="${build.classes.dir}"/>
  47.126 +                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  47.127 +                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  47.128                      <manifest>
  47.129                          <attribute name="Class-Path" value="${jar.classpath}"/>
  47.130                          <customize/>
  47.131 @@ -875,7 +872,7 @@
  47.132      <target name="-init-presetdef-jar">
  47.133          <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  47.134              <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  47.135 -                <j2seproject1:fileset dir="${build.classes.dir}"/>
  47.136 +                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  47.137              </jar>
  47.138          </presetdef>
  47.139      </target>
  47.140 @@ -930,6 +927,7 @@
  47.141              <param location="${project.base_web_api}/build.xml" name="call.script"/>
  47.142              <param name="call.target" value="jar"/>
  47.143              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  47.144 +            <param name="transfer.not.archive.disabled" value="true"/>
  47.145          </antcall>
  47.146          <antcall target="-maybe-call-dep">
  47.147              <param name="call.built.properties" value="${built-jar.properties}"/>
  47.148 @@ -937,6 +935,7 @@
  47.149              <param location="${project.resolve_web_api}/build.xml" name="call.script"/>
  47.150              <param name="call.target" value="jar"/>
  47.151              <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
  47.152 +            <param name="transfer.not.archive.disabled" value="true"/>
  47.153          </antcall>
  47.154      </target>
  47.155      <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  47.156 @@ -1005,41 +1004,25 @@
  47.157          <!-- Empty placeholder for easier customization. -->
  47.158          <!-- You can override this target in the ../build.xml file. -->
  47.159      </target>
  47.160 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
  47.161 -        <j2seproject1:jar/>
  47.162 -    </target>
  47.163 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
  47.164 -        <j2seproject1:jar manifest="${manifest.file}"/>
  47.165 -    </target>
  47.166 -    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  47.167 -        <j2seproject1:jar manifest="${manifest.file}">
  47.168 -            <j2seproject1:manifest>
  47.169 -                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  47.170 -            </j2seproject1:manifest>
  47.171 -        </j2seproject1:jar>
  47.172 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
  47.173 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  47.174 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  47.175 -        <pathconvert property="run.classpath.with.dist.jar">
  47.176 -            <path path="${run.classpath}"/>
  47.177 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  47.178 -        </pathconvert>
  47.179 -        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
  47.180 -    </target>
  47.181 -    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
  47.182 +    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  47.183          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  47.184          <touch file="${tmp.manifest.file}" verbose="false"/>
  47.185      </target>
  47.186 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
  47.187 +    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  47.188          <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  47.189          <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  47.190      </target>
  47.191 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
  47.192 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  47.193          <manifest file="${tmp.manifest.file}" mode="update">
  47.194              <attribute name="Main-Class" value="${main.class}"/>
  47.195          </manifest>
  47.196      </target>
  47.197 -    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
  47.198 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  47.199 +        <manifest file="${tmp.manifest.file}" mode="update">
  47.200 +            <attribute name="Profile" value="${javac.profile}"/>
  47.201 +        </manifest>
  47.202 +    </target>
  47.203 +    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  47.204          <basename file="${application.splash}" property="splashscreen.basename"/>
  47.205          <mkdir dir="${build.classes.dir}/META-INF"/>
  47.206          <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  47.207 @@ -1047,23 +1030,41 @@
  47.208              <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  47.209          </manifest>
  47.210      </target>
  47.211 -    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
  47.212 +    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
  47.213          <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  47.214          <echo level="info">To run this application from the command line without Ant, try:</echo>
  47.215          <property location="${dist.jar}" name="dist.jar.resolved"/>
  47.216          <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  47.217      </target>
  47.218 -    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
  47.219 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
  47.220 +        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  47.221 +        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  47.222 +        <property location="${dist.jar}" name="dist.jar.resolved"/>
  47.223 +        <pathconvert property="run.classpath.with.dist.jar">
  47.224 +            <path path="${run.classpath}"/>
  47.225 +            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  47.226 +        </pathconvert>
  47.227 +        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
  47.228 +            <isset property="main.class.available"/>
  47.229 +        </condition>
  47.230 +        <condition else="debug" property="jar.usage.level" value="info">
  47.231 +            <isset property="main.class.available"/>
  47.232 +        </condition>
  47.233 +        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  47.234 +    </target>
  47.235 +    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  47.236          <delete>
  47.237              <fileset file="${tmp.manifest.file}"/>
  47.238          </delete>
  47.239      </target>
  47.240 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
  47.241 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
  47.242 +    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
  47.243      <target name="-post-jar">
  47.244          <!-- Empty placeholder for easier customization. -->
  47.245          <!-- You can override this target in the ../build.xml file. -->
  47.246      </target>
  47.247 -    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  47.248 +    <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  47.249 +    <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
  47.250      <!--
  47.251                  =================
  47.252                  EXECUTION SECTION
  47.253 @@ -1242,11 +1243,14 @@
  47.254                  </not>
  47.255              </and>
  47.256          </condition>
  47.257 -        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  47.258 +        <condition else="" property="bug5101868workaround" value="*.java">
  47.259 +            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  47.260 +        </condition>
  47.261 +        <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  47.262              <classpath>
  47.263                  <path path="${javac.classpath}"/>
  47.264              </classpath>
  47.265 -            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
  47.266 +            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  47.267                  <filename name="**/*.java"/>
  47.268              </fileset>
  47.269              <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  47.270 @@ -1320,7 +1324,7 @@
  47.271          <mkdir dir="${build.test.results.dir}"/>
  47.272      </target>
  47.273      <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  47.274 -        <j2seproject3:test testincludes="**/*Test.java"/>
  47.275 +        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  47.276      </target>
  47.277      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  47.278          <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  47.279 @@ -1424,6 +1428,7 @@
  47.280              <param location="${project.base_web_api}/build.xml" name="call.script"/>
  47.281              <param name="call.target" value="clean"/>
  47.282              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  47.283 +            <param name="transfer.not.archive.disabled" value="true"/>
  47.284          </antcall>
  47.285          <antcall target="-maybe-call-dep">
  47.286              <param name="call.built.properties" value="${built-clean.properties}"/>
  47.287 @@ -1431,6 +1436,7 @@
  47.288              <param location="${project.resolve_web_api}/build.xml" name="call.script"/>
  47.289              <param name="call.target" value="clean"/>
  47.290              <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
  47.291 +            <param name="transfer.not.archive.disabled" value="true"/>
  47.292          </antcall>
  47.293      </target>
  47.294      <target depends="init" name="-do-clean">
    48.1 --- a/remoting/server/web/web.ui/nbproject/genfiles.properties	Sat Aug 30 22:08:25 2014 +0200
    48.2 +++ b/remoting/server/web/web.ui/nbproject/genfiles.properties	Sun Sep 28 18:40:42 2014 +0200
    48.3 @@ -1,6 +1,6 @@
    48.4  build.xml.data.CRC32=ea2551e2
    48.5 -build.xml.script.CRC32=7ac0d4d0
    48.6 -build.xml.stylesheet.CRC32=28e38971@1.56.0.46
    48.7 +build.xml.script.CRC32=fd3c69fb
    48.8 +build.xml.stylesheet.CRC32=8064a381@1.69.0.46
    48.9  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
   48.10  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
   48.11  <<<<<<< local
   48.12 @@ -8,6 +8,6 @@
   48.13  nbproject/build-impl.xml.script.CRC32=d8965d3c
   48.14  =======
   48.15  nbproject/build-impl.xml.data.CRC32=ea2551e2
   48.16 -nbproject/build-impl.xml.script.CRC32=46a2f2ec
   48.17 +nbproject/build-impl.xml.script.CRC32=f71a106f
   48.18  >>>>>>> other
   48.19 -nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.0.46
   48.20 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.0.48
    49.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/UI.java	Sat Aug 30 22:08:25 2014 +0200
    49.2 +++ b/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/UI.java	Sun Sep 28 18:40:42 2014 +0200
    49.3 @@ -56,15 +56,23 @@
    49.4  import java.util.Collection;
    49.5  import java.util.Collections;
    49.6  import java.util.HashMap;
    49.7 +import java.util.HashSet;
    49.8  import java.util.Iterator;
    49.9  import java.util.LinkedHashMap;
   49.10  import java.util.List;
   49.11  import java.util.Map;
   49.12  import java.util.Map.Entry;
   49.13 +import java.util.Set;
   49.14  import java.util.concurrent.atomic.AtomicBoolean;
   49.15  import java.util.regex.Pattern;
   49.16  import javax.lang.model.element.Element;
   49.17  import javax.lang.model.element.ElementKind;
   49.18 +import javax.lang.model.element.ExecutableElement;
   49.19 +import javax.lang.model.element.TypeElement;
   49.20 +import javax.lang.model.type.DeclaredType;
   49.21 +import javax.lang.model.type.TypeKind;
   49.22 +import javax.lang.model.type.TypeMirror;
   49.23 +import javax.lang.model.util.ElementFilter;
   49.24  import javax.ws.rs.GET;
   49.25  import javax.ws.rs.Path;
   49.26  import javax.ws.rs.Produces;
   49.27 @@ -377,6 +385,12 @@
   49.28              for (long[] span : ResolveService.usages(info, signature)) {
   49.29                  result.add(new long[] {span[2], span[3]});
   49.30              }
   49.31 +
   49.32 +            long[] declSpans = ResolveService.declarationSpans(info, signature);
   49.33 +
   49.34 +            if (declSpans != null) {
   49.35 +                result.add(new long[] {declSpans[2], declSpans[3]});
   49.36 +            }
   49.37          } else {
   49.38              //look for usages from resources:
   49.39              String[] parts = signature.split(":");
   49.40 @@ -654,8 +668,6 @@
   49.41                  String targetSignature = location.signature;
   49.42                  String source = ResolveService.resolveSource(segment, relative, targetSignature);
   49.43  
   49.44 -                result.put("signature", targetSignature);
   49.45 -
   49.46                  if (source != null) {
   49.47                      result.put("path", segment);
   49.48                      result.put("source", source);
   49.49 @@ -698,6 +710,11 @@
   49.50              }
   49.51          }
   49.52  
   49.53 +        if (location.signature != null) {
   49.54 +            result.put("signature", location.signature);
   49.55 +            result.put("superMethods", location.superMethodsSignatures);
   49.56 +        }
   49.57 +
   49.58          return Pojson.save(result);
   49.59      }
   49.60  
   49.61 @@ -714,6 +731,7 @@
   49.62          final boolean[] declaration = new boolean[1];
   49.63          final long[] targetPosition = new long[] { -2 };
   49.64          final String[] signature = new String[1];
   49.65 +        final String[][] superMethodsSignaturesOut = new String[1][];
   49.66          final ElementKind[] kind = new ElementKind[1];
   49.67  
   49.68          new TreePathScanner<Void, Void>() {
   49.69 @@ -733,9 +751,7 @@
   49.70                  long[] span = ResolveService.nameSpan(info, getCurrentPath());
   49.71  
   49.72                  if (span[0] <= position && position <= span[1]) {
   49.73 -                    if (JavaUtils.SUPPORTED_KINDS.contains(el.getKind())) {
   49.74 -                        signature[0] = JavaUtils.serialize(ElementHandle.create(el));
   49.75 -                    }
   49.76 +                    fillSignature(el);
   49.77  
   49.78                      if (resolveTargetPosition) {
   49.79                          TreePath tp = info.getTrees().getPath(el);
   49.80 @@ -766,19 +782,66 @@
   49.81                  long[] span = ResolveService.nameSpan(info, getCurrentPath());
   49.82  
   49.83                  if (span[2] <= position && position <= span[3]) {
   49.84 -                    if (JavaUtils.SUPPORTED_KINDS.contains(el.getKind())) {
   49.85 -                        signature[0] = JavaUtils.serialize(ElementHandle.create(el));
   49.86 -                    }
   49.87 -
   49.88 +                    fillSignature(el);
   49.89                      declaration[0] = true;
   49.90                      kind[0] = el.getKind();
   49.91                  }
   49.92              }
   49.93 +            private void fillSignature(Element el) {
   49.94 +                if (JavaUtils.SUPPORTED_KINDS.contains(el.getKind())) {
   49.95 +                    signature[0] = JavaUtils.serialize(ElementHandle.create(el));
   49.96 +                    if (el.getKind() == ElementKind.METHOD) {
   49.97 +                        List<ElementHandle<?>> superMethods = superMethods(info, new HashSet<TypeElement>(), (ExecutableElement) el, (TypeElement) el.getEnclosingElement());
   49.98 +
   49.99 +                        String[] superMethodsSignatures = new String[superMethods.size()];
  49.100 +                        int i = 0;
  49.101 +
  49.102 +                        for (ElementHandle<?> m : superMethods) {
  49.103 +                            superMethodsSignatures[i++] = JavaUtils.serialize(m);
  49.104 +                        }
  49.105 +
  49.106 +                        superMethodsSignaturesOut[0] = superMethodsSignatures;
  49.107 +                    }
  49.108 +                }
  49.109 +            }
  49.110          }.scan(info.getCompilationUnit(), null);
  49.111  
  49.112 -        return new ResolvedLocation(signature[0], kind[0], targetPosition[0], declaration[0]);
  49.113 +        return new ResolvedLocation(signature[0], kind[0], targetPosition[0], declaration[0], superMethodsSignaturesOut[0]);
  49.114      }
  49.115  
  49.116 +    //XXX: duplicated here and in RemoteUsages:
  49.117 +    private static List<ElementHandle<?>> superMethods(CompilationInfo info, Set<TypeElement> seenTypes, ExecutableElement baseMethod, TypeElement currentType) {
  49.118 +        if (!seenTypes.add(currentType))
  49.119 +            return Collections.emptyList();
  49.120 +
  49.121 +        List<ElementHandle<?>> result = new ArrayList<ElementHandle<?>>();
  49.122 +
  49.123 +        for (TypeElement sup : superTypes(info, currentType)) {
  49.124 +            for (ExecutableElement ee : ElementFilter.methodsIn(sup.getEnclosedElements())) {
  49.125 +                if (info.getElements().overrides(baseMethod, ee, (TypeElement) baseMethod.getEnclosingElement())) {
  49.126 +                    result.add(ElementHandle.create(ee));
  49.127 +                }
  49.128 +            }
  49.129 +
  49.130 +            result.addAll(superMethods(info, seenTypes, baseMethod, currentType));
  49.131 +        }
  49.132 +
  49.133 +        return result;
  49.134 +    }
  49.135 +
  49.136 +    private static List<TypeElement> superTypes(CompilationInfo info, TypeElement type) {
  49.137 +        List<TypeElement> superTypes = new ArrayList<TypeElement>();
  49.138 +
  49.139 +        for (TypeMirror sup : info.getTypes().directSupertypes(type.asType())) {
  49.140 +            if (sup.getKind() == TypeKind.DECLARED) {
  49.141 +                superTypes.add((TypeElement) ((DeclaredType) sup).asElement());
  49.142 +            }
  49.143 +        }
  49.144 +
  49.145 +        return superTypes;
  49.146 +    }
  49.147 +
  49.148 +
  49.149      @GET
  49.150      @Path("/declarationSpan")
  49.151  //    @Produces("text/html")
  49.152 @@ -799,12 +862,14 @@
  49.153          private final ElementKind kind;
  49.154          private final long position;
  49.155          private final boolean declaration;
  49.156 +        private final String[] superMethodsSignatures;
  49.157  
  49.158 -        public ResolvedLocation(String signature, ElementKind kind, long position, boolean declaration) {
  49.159 +        public ResolvedLocation(String signature, ElementKind kind, long position, boolean declaration, String[] superMethodsSignatures) {
  49.160              this.signature = signature;
  49.161              this.kind = kind;
  49.162              this.position = position;
  49.163              this.declaration = declaration;
  49.164 +            this.superMethodsSignatures = superMethodsSignatures;
  49.165          }
  49.166      }
  49.167  }
    50.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/SemanticHighlighter.java	Sat Aug 30 22:08:25 2014 +0200
    50.2 +++ b/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/SemanticHighlighter.java	Sun Sep 28 18:40:42 2014 +0200
    50.3 @@ -803,15 +803,18 @@
    50.4          @Override
    50.5          public Void visitVariable(VariableTree tree, EnumSet<UseTypes> d) {
    50.6              tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(), tree));
    50.7 -            TreePath type = new TreePath(getCurrentPath(), tree.getType());
    50.8 -            
    50.9 -            if (type.getLeaf() instanceof ArrayTypeTree) {
   50.10 -                type = new TreePath(type, ((ArrayTypeTree) type.getLeaf()).getType());
   50.11 +
   50.12 +            if (tree.getType() != null) {
   50.13 +                TreePath type = new TreePath(getCurrentPath(), tree.getType());
   50.14 +
   50.15 +                if (type.getLeaf() instanceof ArrayTypeTree) {
   50.16 +                    type = new TreePath(type, ((ArrayTypeTree) type.getLeaf()).getType());
   50.17 +                }
   50.18 +
   50.19 +                if (type.getLeaf().getKind() == Kind.IDENTIFIER)
   50.20 +                    handlePossibleIdentifier(type, EnumSet.of(UseTypes.CLASS_USE));
   50.21              }
   50.22              
   50.23 -            if (type.getLeaf().getKind() == Kind.IDENTIFIER)
   50.24 -                handlePossibleIdentifier(type, EnumSet.of(UseTypes.CLASS_USE));
   50.25 -            
   50.26              Collection<UseTypes> uses = null;
   50.27              
   50.28              Element e = info.getTrees().getElement(getCurrentPath());