1.1 --- a/remoting/ide/nbproject/project.properties Mon Jun 27 18:32:06 2011 +0200
1.2 +++ b/remoting/ide/nbproject/project.properties Mon Jun 27 18:32:08 2011 +0200
1.3 @@ -1,5 +1,7 @@
1.4 modules=\
1.5 ${project.org.netbeans.modules.jackpot30.jumpto}:\
1.6 - ${project.org.netbeans.modules.jackpot30.remoting.api}
1.7 + ${project.org.netbeans.modules.jackpot30.remoting.api}:\
1.8 + ${project.org.netbeans.modules.jackpot30.ide.usages}
1.9 +project.org.netbeans.modules.jackpot30.ide.usages=usages
1.10 project.org.netbeans.modules.jackpot30.jumpto=jumpto
1.11 project.org.netbeans.modules.jackpot30.remoting.api=api
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/remoting/ide/usages/build.xml Mon Jun 27 18:32:08 2011 +0200
2.3 @@ -0,0 +1,8 @@
2.4 +<?xml version="1.0" encoding="UTF-8"?>
2.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
2.6 +<!-- for some information on what you could do (e.g. targets to override). -->
2.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
2.8 +<project name="org.netbeans.modules.jackpot30.ide.usages" default="netbeans" basedir=".">
2.9 + <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.ide.usages.</description>
2.10 + <import file="nbproject/build-impl.xml"/>
2.11 +</project>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/remoting/ide/usages/manifest.mf Mon Jun 27 18:32:08 2011 +0200
3.3 @@ -0,0 +1,6 @@
3.4 +Manifest-Version: 1.0
3.5 +OpenIDE-Module: org.netbeans.modules.jackpot30.ide.usages
3.6 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/ide/usages/Bundle.properties
3.7 +OpenIDE-Module-Requires: org.openide.windows.WindowManager
3.8 +OpenIDE-Module-Specification-Version: 1.0
3.9 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/remoting/ide/usages/nbproject/build-impl.xml Mon Jun 27 18:32:08 2011 +0200
4.3 @@ -0,0 +1,45 @@
4.4 +<?xml version="1.0" encoding="UTF-8"?>
4.5 +<!--
4.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
4.7 +*** EDIT ../build.xml INSTEAD ***
4.8 +-->
4.9 +<project name="org.netbeans.modules.jackpot30.ide.usages-impl" basedir="..">
4.10 + <fail message="Please build using Ant 1.7.1 or higher.">
4.11 + <condition>
4.12 + <not>
4.13 + <antversion atleast="1.7.1"/>
4.14 + </not>
4.15 + </condition>
4.16 + </fail>
4.17 + <property file="nbproject/private/suite-private.properties"/>
4.18 + <property file="nbproject/suite.properties"/>
4.19 + <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
4.20 + <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
4.21 + <property file="${suite.dir}/nbproject/platform.properties"/>
4.22 + <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
4.23 + <attribute name="name"/>
4.24 + <attribute name="value"/>
4.25 + <sequential>
4.26 + <property name="@{name}" value="${@{value}}"/>
4.27 + </sequential>
4.28 + </macrodef>
4.29 + <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
4.30 + <attribute name="property"/>
4.31 + <attribute name="value"/>
4.32 + <sequential>
4.33 + <property name="@{property}" value="@{value}"/>
4.34 + </sequential>
4.35 + </macrodef>
4.36 + <property file="${user.properties.file}"/>
4.37 + <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
4.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"/>
4.39 + <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
4.40 + <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
4.41 + <condition>
4.42 + <not>
4.43 + <contains string="${cluster.path.evaluated}" substring="platform"/>
4.44 + </not>
4.45 + </condition>
4.46 + </fail>
4.47 + <import file="${harness.dir}/build.xml"/>
4.48 +</project>
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/remoting/ide/usages/nbproject/genfiles.properties Mon Jun 27 18:32:08 2011 +0200
5.3 @@ -0,0 +1,8 @@
5.4 +build.xml.data.CRC32=80c6633a
5.5 +build.xml.script.CRC32=58a6b47a
5.6 +build.xml.stylesheet.CRC32=a56c6a5b@1.47
5.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
5.9 +nbproject/build-impl.xml.data.CRC32=80c6633a
5.10 +nbproject/build-impl.xml.script.CRC32=583fd407
5.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/remoting/ide/usages/nbproject/project.properties Mon Jun 27 18:32:08 2011 +0200
6.3 @@ -0,0 +1,2 @@
6.4 +javac.source=1.6
6.5 +javac.compilerargs=-Xlint -Xlint:-serial
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/remoting/ide/usages/nbproject/project.xml Mon Jun 27 18:32:08 2011 +0200
7.3 @@ -0,0 +1,146 @@
7.4 +<?xml version="1.0" encoding="UTF-8"?>
7.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
7.6 + <type>org.netbeans.modules.apisupport.project</type>
7.7 + <configuration>
7.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
7.9 + <code-name-base>org.netbeans.modules.jackpot30.ide.usages</code-name-base>
7.10 + <suite-component/>
7.11 + <module-dependencies>
7.12 + <dependency>
7.13 + <code-name-base>org.netbeans.libs.javacapi</code-name-base>
7.14 + <build-prerequisite/>
7.15 + <compile-dependency/>
7.16 + <run-dependency>
7.17 + <specification-version>7.7.0.3</specification-version>
7.18 + </run-dependency>
7.19 + </dependency>
7.20 + <dependency>
7.21 + <code-name-base>org.netbeans.modules.editor</code-name-base>
7.22 + <build-prerequisite/>
7.23 + <compile-dependency/>
7.24 + <run-dependency>
7.25 + <release-version>3</release-version>
7.26 + <specification-version>1.58.0.5.13.10</specification-version>
7.27 + </run-dependency>
7.28 + </dependency>
7.29 + <dependency>
7.30 + <code-name-base>org.netbeans.modules.editor.lib2</code-name-base>
7.31 + <build-prerequisite/>
7.32 + <compile-dependency/>
7.33 + <run-dependency>
7.34 + <release-version>1</release-version>
7.35 + <specification-version>1.43.0.10</specification-version>
7.36 + </run-dependency>
7.37 + </dependency>
7.38 + <dependency>
7.39 + <code-name-base>org.netbeans.modules.jackpot30.remoting.api</code-name-base>
7.40 + <build-prerequisite/>
7.41 + <compile-dependency/>
7.42 + <run-dependency>
7.43 + <specification-version>1.0</specification-version>
7.44 + </run-dependency>
7.45 + </dependency>
7.46 + <dependency>
7.47 + <code-name-base>org.netbeans.modules.java.source</code-name-base>
7.48 + <build-prerequisite/>
7.49 + <compile-dependency/>
7.50 + <run-dependency>
7.51 + <specification-version>0.81.0.17.15.6</specification-version>
7.52 + </run-dependency>
7.53 + </dependency>
7.54 + <dependency>
7.55 + <code-name-base>org.netbeans.modules.projectapi</code-name-base>
7.56 + <build-prerequisite/>
7.57 + <compile-dependency/>
7.58 + <run-dependency>
7.59 + <release-version>1</release-version>
7.60 + <specification-version>1.37</specification-version>
7.61 + </run-dependency>
7.62 + </dependency>
7.63 + <dependency>
7.64 + <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
7.65 + <build-prerequisite/>
7.66 + <compile-dependency/>
7.67 + <run-dependency>
7.68 + <release-version>1</release-version>
7.69 + <specification-version>1.52.0.8</specification-version>
7.70 + </run-dependency>
7.71 + </dependency>
7.72 + <dependency>
7.73 + <code-name-base>org.netbeans.modules.settings</code-name-base>
7.74 + <build-prerequisite/>
7.75 + <compile-dependency/>
7.76 + <run-dependency>
7.77 + <release-version>1</release-version>
7.78 + <specification-version>1.32</specification-version>
7.79 + </run-dependency>
7.80 + </dependency>
7.81 + <dependency>
7.82 + <code-name-base>org.openide.awt</code-name-base>
7.83 + <build-prerequisite/>
7.84 + <compile-dependency/>
7.85 + <run-dependency>
7.86 + <specification-version>7.35</specification-version>
7.87 + </run-dependency>
7.88 + </dependency>
7.89 + <dependency>
7.90 + <code-name-base>org.openide.explorer</code-name-base>
7.91 + <build-prerequisite/>
7.92 + <compile-dependency/>
7.93 + <run-dependency>
7.94 + <specification-version>6.36</specification-version>
7.95 + </run-dependency>
7.96 + </dependency>
7.97 + <dependency>
7.98 + <code-name-base>org.openide.filesystems</code-name-base>
7.99 + <build-prerequisite/>
7.100 + <compile-dependency/>
7.101 + <run-dependency>
7.102 + <specification-version>7.48</specification-version>
7.103 + </run-dependency>
7.104 + </dependency>
7.105 + <dependency>
7.106 + <code-name-base>org.openide.loaders</code-name-base>
7.107 + <build-prerequisite/>
7.108 + <compile-dependency/>
7.109 + <run-dependency>
7.110 + <specification-version>7.23</specification-version>
7.111 + </run-dependency>
7.112 + </dependency>
7.113 + <dependency>
7.114 + <code-name-base>org.openide.nodes</code-name-base>
7.115 + <build-prerequisite/>
7.116 + <compile-dependency/>
7.117 + <run-dependency>
7.118 + <specification-version>7.23</specification-version>
7.119 + </run-dependency>
7.120 + </dependency>
7.121 + <dependency>
7.122 + <code-name-base>org.openide.util</code-name-base>
7.123 + <build-prerequisite/>
7.124 + <compile-dependency/>
7.125 + <run-dependency>
7.126 + <specification-version>8.16</specification-version>
7.127 + </run-dependency>
7.128 + </dependency>
7.129 + <dependency>
7.130 + <code-name-base>org.openide.util.lookup</code-name-base>
7.131 + <build-prerequisite/>
7.132 + <compile-dependency/>
7.133 + <run-dependency>
7.134 + <specification-version>8.9</specification-version>
7.135 + </run-dependency>
7.136 + </dependency>
7.137 + <dependency>
7.138 + <code-name-base>org.openide.windows</code-name-base>
7.139 + <build-prerequisite/>
7.140 + <compile-dependency/>
7.141 + <run-dependency>
7.142 + <specification-version>6.43</specification-version>
7.143 + </run-dependency>
7.144 + </dependency>
7.145 + </module-dependencies>
7.146 + <public-packages/>
7.147 + </data>
7.148 + </configuration>
7.149 +</project>
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/remoting/ide/usages/nbproject/suite.properties Mon Jun 27 18:32:08 2011 +0200
8.3 @@ -0,0 +1,1 @@
8.4 +suite.dir=${basedir}/..
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Bundle.properties Mon Jun 27 18:32:08 2011 +0200
9.3 @@ -0,0 +1,44 @@
9.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9.5 +#
9.6 +# Copyright 2011 Oracle and/or its affiliates. All rights reserved.
9.7 +#
9.8 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
9.9 +# Other names may be trademarks of their respective owners.
9.10 +#
9.11 +# The contents of this file are subject to the terms of either the GNU
9.12 +# General Public License Version 2 only ("GPL") or the Common
9.13 +# Development and Distribution License("CDDL") (collectively, the
9.14 +# "License"). You may not use this file except in compliance with the
9.15 +# License. You can obtain a copy of the License at
9.16 +# http://www.netbeans.org/cddl-gplv2.html
9.17 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
9.18 +# specific language governing permissions and limitations under the
9.19 +# License. When distributing the software, include this License Header
9.20 +# Notice in each file and include the License file at
9.21 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
9.22 +# particular file as subject to the "Classpath" exception as provided
9.23 +# by Oracle in the GPL Version 2 section of the License file that
9.24 +# accompanied this code. If applicable, add the following below the
9.25 +# License Header, with the fields enclosed by brackets [] replaced by
9.26 +# your own identifying information:
9.27 +# "Portions Copyrighted [year] [name of copyright owner]"
9.28 +#
9.29 +# If you wish your version of this file to be governed by only the CDDL
9.30 +# or only the GPL Version 2, indicate your decision by adding
9.31 +# "[Contributor] elects to include this software in this distribution
9.32 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
9.33 +# single choice of license, a recipient has the option to distribute
9.34 +# your version of this file under either the CDDL, the GPL Version 2 or
9.35 +# to extend the choice of license to its licensees as provided above.
9.36 +# However, if you add GPL Version 2 code and therefore, elected the GPL
9.37 +# Version 2 license, then the option applies only if the new code is
9.38 +# made subject to such option by the copyright holder.
9.39 +#
9.40 +# Contributor(s):
9.41 +#
9.42 +# Portions Copyrighted 2011 Sun Microsystems, Inc.
9.43 +#
9.44 +CTL_RemoteUsagesWindowAction=RemoteUsagesWindow
9.45 +CTL_RemoteUsagesWindowTopComponent=RemoteUsagesWindow Window
9.46 +HINT_RemoteUsagesWindowTopComponent=This is a RemoteUsagesWindow window
9.47 +OpenIDE-Module-Name=Jackpot 3.0 Usage IDE
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Common.java Mon Jun 27 18:32:08 2011 +0200
10.3 @@ -0,0 +1,91 @@
10.4 +/*
10.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
10.6 + *
10.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
10.8 + *
10.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
10.10 + * Other names may be trademarks of their respective owners.
10.11 + *
10.12 + * The contents of this file are subject to the terms of either the GNU
10.13 + * General Public License Version 2 only ("GPL") or the Common
10.14 + * Development and Distribution License("CDDL") (collectively, the
10.15 + * "License"). You may not use this file except in compliance with the
10.16 + * License. You can obtain a copy of the License at
10.17 + * http://www.netbeans.org/cddl-gplv2.html
10.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
10.19 + * specific language governing permissions and limitations under the
10.20 + * License. When distributing the software, include this License Header
10.21 + * Notice in each file and include the License file at
10.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
10.23 + * particular file as subject to the "Classpath" exception as provided
10.24 + * by Oracle in the GPL Version 2 section of the License file that
10.25 + * accompanied this code. If applicable, add the following below the
10.26 + * License Header, with the fields enclosed by brackets [] replaced by
10.27 + * your own identifying information:
10.28 + * "Portions Copyrighted [year] [name of copyright owner]"
10.29 + *
10.30 + * If you wish your version of this file to be governed by only the CDDL
10.31 + * or only the GPL Version 2, indicate your decision by adding
10.32 + * "[Contributor] elects to include this software in this distribution
10.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
10.34 + * single choice of license, a recipient has the option to distribute
10.35 + * your version of this file under either the CDDL, the GPL Version 2 or
10.36 + * to extend the choice of license to its licensees as provided above.
10.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
10.38 + * Version 2 license, then the option applies only if the new code is
10.39 + * made subject to such option by the copyright holder.
10.40 + *
10.41 + * Contributor(s):
10.42 + *
10.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
10.44 + */
10.45 +package org.netbeans.modules.jackpot30.ide.usages;
10.46 +
10.47 +import java.lang.reflect.Field;
10.48 +import java.util.EnumSet;
10.49 +import java.util.Set;
10.50 +import javax.lang.model.element.ElementKind;
10.51 +import org.netbeans.api.java.source.ElementHandle;
10.52 +import org.openide.util.Exceptions;
10.53 +
10.54 +/**XXX: Copied between indexing and ide!
10.55 + *
10.56 + * @author lahvac
10.57 + */
10.58 +public class Common {
10.59 +
10.60 + public static final Set<ElementKind> SUPPORTED_KINDS = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS,
10.61 + ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD,
10.62 + ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT,
10.63 + ElementKind.FIELD, ElementKind.ENUM_CONSTANT);
10.64 +
10.65 + public static String serialize(ElementHandle<?> h) {
10.66 + StringBuilder result = new StringBuilder();
10.67 +
10.68 + result.append(h.getKind());
10.69 +
10.70 + try {
10.71 + Field signaturesField = ElementHandle.class.getDeclaredField("signatures");
10.72 +
10.73 + signaturesField.setAccessible(true);
10.74 +
10.75 + String[] signatures = (String[]) signaturesField.get(h);
10.76 +
10.77 + for (String sig : signatures) {
10.78 + result.append(":");
10.79 + result.append(sig);
10.80 + }
10.81 + } catch (IllegalArgumentException ex) {
10.82 + Exceptions.printStackTrace(ex);
10.83 + } catch (IllegalAccessException ex) {
10.84 + Exceptions.printStackTrace(ex);
10.85 + } catch (NoSuchFieldException ex) {
10.86 + Exceptions.printStackTrace(ex);
10.87 + } catch (SecurityException ex) {
10.88 + Exceptions.printStackTrace(ex);
10.89 + }
10.90 +
10.91 + return result.toString();
10.92 + }
10.93 +
10.94 +}
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/Nodes.java Mon Jun 27 18:32:08 2011 +0200
11.3 @@ -0,0 +1,247 @@
11.4 +/*
11.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
11.6 + *
11.7 + * Copyright 2010-2011 Oracle and/or its affiliates. All rights reserved.
11.8 + *
11.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
11.10 + * Other names may be trademarks of their respective owners.
11.11 + *
11.12 + * The contents of this file are subject to the terms of either the GNU
11.13 + * General Public License Version 2 only ("GPL") or the Common
11.14 + * Development and Distribution License("CDDL") (collectively, the
11.15 + * "License"). You may not use this file except in compliance with the
11.16 + * License. You can obtain a copy of the License at
11.17 + * http://www.netbeans.org/cddl-gplv2.html
11.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
11.19 + * specific language governing permissions and limitations under the
11.20 + * License. When distributing the software, include this License Header
11.21 + * Notice in each file and include the License file at
11.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
11.23 + * particular file as subject to the "Classpath" exception as provided
11.24 + * by Oracle in the GPL Version 2 section of the License file that
11.25 + * accompanied this code. If applicable, add the following below the
11.26 + * License Header, with the fields enclosed by brackets [] replaced by
11.27 + * your own identifying information:
11.28 + * "Portions Copyrighted [year] [name of copyright owner]"
11.29 + *
11.30 + * If you wish your version of this file to be governed by only the CDDL
11.31 + * or only the GPL Version 2, indicate your decision by adding
11.32 + * "[Contributor] elects to include this software in this distribution
11.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
11.34 + * single choice of license, a recipient has the option to distribute
11.35 + * your version of this file under either the CDDL, the GPL Version 2 or
11.36 + * to extend the choice of license to its licensees as provided above.
11.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
11.38 + * Version 2 license, then the option applies only if the new code is
11.39 + * made subject to such option by the copyright holder.
11.40 + *
11.41 + * Contributor(s):
11.42 + *
11.43 + * Portions Copyrighted 2008-2011 Sun Microsystems, Inc.
11.44 + */
11.45 +
11.46 +package org.netbeans.modules.jackpot30.ide.usages;
11.47 +
11.48 +import java.awt.Image;
11.49 +import java.util.ArrayList;
11.50 +import java.util.Collection;
11.51 +import java.util.HashMap;
11.52 +import java.util.LinkedList;
11.53 +import java.util.List;
11.54 +import java.util.Map;
11.55 +import java.util.logging.Level;
11.56 +import java.util.logging.Logger;
11.57 +import javax.swing.Action;
11.58 +import org.netbeans.api.project.FileOwnerQuery;
11.59 +import org.netbeans.api.project.Project;
11.60 +import org.netbeans.api.project.ProjectUtils;
11.61 +import org.netbeans.spi.project.ui.LogicalViewProvider;
11.62 +import org.openide.filesystems.FileObject;
11.63 +import org.openide.filesystems.FileUtil;
11.64 +import org.openide.loaders.DataObject;
11.65 +import org.openide.loaders.DataObjectNotFoundException;
11.66 +import org.openide.nodes.AbstractNode;
11.67 +import org.openide.nodes.Children;
11.68 +import org.openide.nodes.FilterNode;
11.69 +import org.openide.nodes.Node;
11.70 +import org.openide.nodes.NodeOp;
11.71 +import org.openide.util.Exceptions;
11.72 +import org.openide.util.ImageUtilities;
11.73 +import org.openide.util.NbBundle;
11.74 +
11.75 +/**
11.76 + *
11.77 + * @author lahvac
11.78 + */
11.79 +public class Nodes {
11.80 +
11.81 + public static Node constructSemiLogicalView(Iterable<? extends FileObject> filesWithOccurrences) {
11.82 + Map<Project, Collection<FileObject>> projects = new HashMap<Project, Collection<FileObject>>();
11.83 +
11.84 + for (FileObject file : filesWithOccurrences) {
11.85 + Project project = FileOwnerQuery.getOwner(file);
11.86 +
11.87 + if (project == null) {
11.88 + Logger.getLogger(Nodes.class.getName()).log(Level.WARNING, "Cannot find project for: {0}", FileUtil.getFileDisplayName(file));
11.89 + }
11.90 +
11.91 + Collection<FileObject> projectFiles = projects.get(project);
11.92 +
11.93 + if (projectFiles == null) {
11.94 + projects.put(project, projectFiles = new ArrayList<FileObject>());
11.95 + }
11.96 +
11.97 + projectFiles.add(file);
11.98 + }
11.99 +
11.100 + projects.remove(null);//XXX!!!XXX
11.101 +
11.102 + List<Node> nodes = new LinkedList<Node>();
11.103 +
11.104 + for (Project p : projects.keySet()) {
11.105 + nodes.add(constructSemiLogicalView(p, projects.get(p)));
11.106 + }
11.107 +
11.108 + return new AbstractNode(new DirectChildren(nodes));
11.109 + }
11.110 +
11.111 + private static Node constructSemiLogicalView(final Project p, Iterable<? extends FileObject> files) {
11.112 + LogicalViewProvider lvp = p.getLookup().lookup(LogicalViewProvider.class);
11.113 + final Node view;
11.114 +
11.115 + if (lvp != null) {
11.116 + view = lvp.createLogicalView();
11.117 + } else {
11.118 + try {
11.119 + view = DataObject.find(p.getProjectDirectory()).getNodeDelegate();
11.120 + } catch (DataObjectNotFoundException ex) {
11.121 + Exceptions.printStackTrace(ex);
11.122 + return new AbstractNode(Children.LEAF);
11.123 + }
11.124 + }
11.125 +
11.126 + Collection<Node> fileNodes = new ArrayList<Node>();
11.127 +
11.128 + for (FileObject file : files) {
11.129 + Node foundChild = locateChild(view, lvp, file);
11.130 +
11.131 + if (foundChild == null) {
11.132 + Node n = new AbstractNode(Children.LEAF) {
11.133 + @Override
11.134 + public Image getIcon(int type) {
11.135 + return ImageUtilities.icon2Image(ProjectUtils.getInformation(p).getIcon());
11.136 + }
11.137 + @Override
11.138 + public Image getOpenedIcon(int type) {
11.139 + return getIcon(type);
11.140 + }
11.141 + @Override
11.142 + public String getHtmlDisplayName() {
11.143 + return view.getHtmlDisplayName() != null ? NbBundle.getMessage(Nodes.class, "ERR_ProjectNotSupported", view.getHtmlDisplayName()) : null;
11.144 + }
11.145 + @Override
11.146 + public String getDisplayName() {
11.147 + return NbBundle.getMessage(Nodes.class, "ERR_ProjectNotSupported", view.getDisplayName());
11.148 + }
11.149 + };
11.150 +
11.151 + return n;
11.152 + }
11.153 +
11.154 + fileNodes.add(foundChild);
11.155 + }
11.156 +
11.157 + return new Wrapper(view, fileNodes);
11.158 + }
11.159 +
11.160 + private static Node locateChild(Node parent, LogicalViewProvider lvp, FileObject file) {
11.161 + if (lvp != null) {
11.162 + return lvp.findPath(parent, file);
11.163 + }
11.164 +
11.165 + throw new UnsupportedOperationException("Not done yet");
11.166 + }
11.167 +
11.168 + private static class Wrapper extends FilterNode {
11.169 +
11.170 + public Wrapper(Node orig, Collection<? extends Node> fileNodes) {
11.171 + super(orig, new WrapperChildren(orig, fileNodes));
11.172 + }
11.173 +
11.174 + @Override
11.175 + public Action[] getActions(boolean context) {
11.176 + return new Action[0];
11.177 + }
11.178 +
11.179 + }
11.180 +
11.181 + private static boolean isParent(Node parent, Node child) {
11.182 + if (NodeOp.isSon(parent, child)) {
11.183 + return true;
11.184 + }
11.185 +
11.186 + Node p = child.getParentNode();
11.187 +
11.188 + if (p == null) {
11.189 + return false;
11.190 + }
11.191 +
11.192 + return isParent(parent, p);
11.193 + }
11.194 +
11.195 + private static class WrapperChildren extends Children.Keys<Node> {
11.196 +
11.197 + private final Node orig;
11.198 + private final Collection<? extends Node> fileNodes;
11.199 +
11.200 + public WrapperChildren(Node orig, Collection<? extends Node> fileNodes) {
11.201 + this.orig = orig;
11.202 + this.fileNodes = fileNodes;
11.203 +
11.204 + }
11.205 +
11.206 + @Override
11.207 + protected void addNotify() {
11.208 + super.addNotify();
11.209 + doSetKeys();
11.210 + }
11.211 +
11.212 + private void doSetKeys() {
11.213 + Node[] nodes = orig.getChildren().getNodes(true);
11.214 + List<Node> toSet = new LinkedList<Node>();
11.215 +
11.216 + OUTER: for (Node n : nodes) {
11.217 + for (Node c : fileNodes) {
11.218 + if (n == c || isParent(n, c)) {
11.219 + toSet.add(n);
11.220 + continue OUTER;
11.221 + }
11.222 + }
11.223 + }
11.224 +
11.225 + setKeys(toSet);
11.226 + }
11.227 +
11.228 + @Override
11.229 + protected Node[] createNodes(Node key) {
11.230 + if (fileNodes.contains(key)) {
11.231 + return new Node[] {new FilterNode(key)}; //XXX
11.232 + }
11.233 + return new Node[] {new Wrapper(key, fileNodes)};
11.234 + }
11.235 +
11.236 + }
11.237 +
11.238 + private static final class DirectChildren extends Children.Keys<Node> {
11.239 +
11.240 + public DirectChildren(Collection<Node> nodes) {
11.241 + setKeys(nodes);
11.242 + }
11.243 +
11.244 + @Override
11.245 + protected Node[] createNodes(Node key) {
11.246 + return new Node[] {key};
11.247 + }
11.248 + }
11.249 +
11.250 +}
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/RemoteUsages.java Mon Jun 27 18:32:08 2011 +0200
12.3 @@ -0,0 +1,157 @@
12.4 +/*
12.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
12.6 + *
12.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
12.8 + *
12.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
12.10 + * Other names may be trademarks of their respective owners.
12.11 + *
12.12 + * The contents of this file are subject to the terms of either the GNU
12.13 + * General Public License Version 2 only ("GPL") or the Common
12.14 + * Development and Distribution License("CDDL") (collectively, the
12.15 + * "License"). You may not use this file except in compliance with the
12.16 + * License. You can obtain a copy of the License at
12.17 + * http://www.netbeans.org/cddl-gplv2.html
12.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12.19 + * specific language governing permissions and limitations under the
12.20 + * License. When distributing the software, include this License Header
12.21 + * Notice in each file and include the License file at
12.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
12.23 + * particular file as subject to the "Classpath" exception as provided
12.24 + * by Oracle in the GPL Version 2 section of the License file that
12.25 + * accompanied this code. If applicable, add the following below the
12.26 + * License Header, with the fields enclosed by brackets [] replaced by
12.27 + * your own identifying information:
12.28 + * "Portions Copyrighted [year] [name of copyright owner]"
12.29 + *
12.30 + * If you wish your version of this file to be governed by only the CDDL
12.31 + * or only the GPL Version 2, indicate your decision by adding
12.32 + * "[Contributor] elects to include this software in this distribution
12.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
12.34 + * single choice of license, a recipient has the option to distribute
12.35 + * your version of this file under either the CDDL, the GPL Version 2 or
12.36 + * to extend the choice of license to its licensees as provided above.
12.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
12.38 + * Version 2 license, then the option applies only if the new code is
12.39 + * made subject to such option by the copyright holder.
12.40 + *
12.41 + * Contributor(s):
12.42 + *
12.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
12.44 + */
12.45 +package org.netbeans.modules.jackpot30.ide.usages;
12.46 +
12.47 +import com.sun.source.util.TreePath;
12.48 +import java.awt.event.ActionEvent;
12.49 +import java.awt.event.ActionListener;
12.50 +import java.io.File;
12.51 +import java.io.IOException;
12.52 +import java.lang.reflect.Field;
12.53 +import java.net.URI;
12.54 +import java.net.URISyntaxException;
12.55 +import java.util.ArrayList;
12.56 +import java.util.List;
12.57 +import javax.lang.model.element.Element;
12.58 +import javax.swing.text.JTextComponent;
12.59 +import org.netbeans.api.editor.EditorRegistry;
12.60 +import org.netbeans.api.java.source.CompilationController;
12.61 +import org.netbeans.api.java.source.ElementHandle;
12.62 +import org.netbeans.api.java.source.JavaSource;
12.63 +import org.netbeans.api.java.source.Task;
12.64 +import org.netbeans.modules.editor.NbEditorUtilities;
12.65 +import org.netbeans.modules.jackpot30.remoting.api.RemoteIndex;
12.66 +import org.netbeans.modules.jackpot30.remoting.api.WebUtilities;
12.67 +import org.openide.awt.ActionRegistration;
12.68 +import org.openide.awt.ActionReference;
12.69 +import org.openide.awt.ActionReferences;
12.70 +import org.openide.awt.ActionID;
12.71 +import org.openide.filesystems.FileObject;
12.72 +import org.openide.filesystems.FileUtil;
12.73 +import org.openide.util.Exceptions;
12.74 +import org.openide.util.NbBundle.Messages;
12.75 +
12.76 +@ActionID(category = "Refactoring",
12.77 +id = "org.netbeans.modules.jackpot30.ide.usages.RemoteUsages")
12.78 +@ActionRegistration(displayName = "#CTL_RemoteUsages")
12.79 +@ActionReferences({
12.80 + @ActionReference(path = "Menu/Edit", position = 2350)
12.81 +})
12.82 +@Messages("CTL_RemoteUsages=Find Remote Usages...")
12.83 +public final class RemoteUsages implements ActionListener {
12.84 +
12.85 + public void actionPerformed(ActionEvent e) {
12.86 + JTextComponent comp = EditorRegistry.lastFocusedComponent(); //XXX
12.87 +
12.88 + if (comp == null) return;
12.89 +
12.90 + FileObject file = NbEditorUtilities.getFileObject(comp.getDocument());
12.91 + final int pos = comp.getCaretPosition();
12.92 +
12.93 + try {
12.94 + final String[] serialized = new String[1];
12.95 +
12.96 + JavaSource.forFileObject(file).runUserActionTask(new Task<CompilationController>() {
12.97 + @Override public void run(CompilationController parameter) throws Exception {
12.98 + parameter.toPhase(JavaSource.Phase.RESOLVED);
12.99 +
12.100 + TreePath tp = parameter.getTreeUtilities().pathFor(pos);
12.101 + Element el = parameter.getTrees().getElement(tp);
12.102 +
12.103 + if (el != null && Common.SUPPORTED_KINDS.contains(el.getKind())) {
12.104 + serialized[0] = serialize(ElementHandle.create(el));
12.105 + }
12.106 + }
12.107 + }, true);
12.108 +
12.109 + if (serialized[0] == null) return ; //XXX: warn user!
12.110 +
12.111 + List<FileObject> result = new ArrayList<FileObject>();
12.112 +
12.113 + for (RemoteIndex idx : RemoteIndex.loadIndices()) {
12.114 + URI resolved = new URI(idx.remote.toExternalForm() + "/usages/search?path=" + WebUtilities.escapeForQuery(idx.remoteSegment) + "&signatures=" + WebUtilities.escapeForQuery(serialized[0]));
12.115 +
12.116 + for (String path : WebUtilities.requestStringArrayResponse(resolved)) {
12.117 + File f = new File(idx.folder, path);
12.118 +
12.119 + result.add(FileUtil.toFileObject(f));
12.120 + }
12.121 + }
12.122 +
12.123 + RemoteUsagesWindowTopComponent.openFor(Nodes.constructSemiLogicalView(result));
12.124 + } catch (URISyntaxException ex) {
12.125 + Exceptions.printStackTrace(ex);
12.126 + } catch (IOException ex) {
12.127 + Exceptions.printStackTrace(ex);
12.128 + }
12.129 + }
12.130 +
12.131 + //XXX:
12.132 + public static String serialize(ElementHandle<?> h) {
12.133 + StringBuilder result = new StringBuilder();
12.134 +
12.135 + result.append(h.getKind());
12.136 +
12.137 + try {
12.138 + Field signaturesField = ElementHandle.class.getDeclaredField("signatures");
12.139 +
12.140 + signaturesField.setAccessible(true);
12.141 +
12.142 + String[] signatures = (String[]) signaturesField.get(h);
12.143 +
12.144 + for (String sig : signatures) {
12.145 + result.append(":");
12.146 + result.append(sig);
12.147 + }
12.148 + } catch (IllegalArgumentException ex) {
12.149 + Exceptions.printStackTrace(ex);
12.150 + } catch (IllegalAccessException ex) {
12.151 + Exceptions.printStackTrace(ex);
12.152 + } catch (NoSuchFieldException ex) {
12.153 + Exceptions.printStackTrace(ex);
12.154 + } catch (SecurityException ex) {
12.155 + Exceptions.printStackTrace(ex);
12.156 + }
12.157 +
12.158 + return result.toString();
12.159 + }
12.160 +}
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/RemoteUsagesWindowTopComponent.form Mon Jun 27 18:32:08 2011 +0200
13.3 @@ -0,0 +1,17 @@
13.4 +<?xml version="1.1" encoding="UTF-8" ?>
13.5 +
13.6 +<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
13.7 + <AuxValues>
13.8 + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
13.9 + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
13.10 + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
13.11 + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
13.12 + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
13.13 + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
13.14 + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
13.15 + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
13.16 + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
13.17 + </AuxValues>
13.18 +
13.19 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
13.20 +</Form>
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/remoting/ide/usages/src/org/netbeans/modules/jackpot30/ide/usages/RemoteUsagesWindowTopComponent.java Mon Jun 27 18:32:08 2011 +0200
14.3 @@ -0,0 +1,147 @@
14.4 +/*
14.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
14.6 + *
14.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
14.8 + *
14.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
14.10 + * Other names may be trademarks of their respective owners.
14.11 + *
14.12 + * The contents of this file are subject to the terms of either the GNU
14.13 + * General Public License Version 2 only ("GPL") or the Common
14.14 + * Development and Distribution License("CDDL") (collectively, the
14.15 + * "License"). You may not use this file except in compliance with the
14.16 + * License. You can obtain a copy of the License at
14.17 + * http://www.netbeans.org/cddl-gplv2.html
14.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
14.19 + * specific language governing permissions and limitations under the
14.20 + * License. When distributing the software, include this License Header
14.21 + * Notice in each file and include the License file at
14.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
14.23 + * particular file as subject to the "Classpath" exception as provided
14.24 + * by Oracle in the GPL Version 2 section of the License file that
14.25 + * accompanied this code. If applicable, add the following below the
14.26 + * License Header, with the fields enclosed by brackets [] replaced by
14.27 + * your own identifying information:
14.28 + * "Portions Copyrighted [year] [name of copyright owner]"
14.29 + *
14.30 + * If you wish your version of this file to be governed by only the CDDL
14.31 + * or only the GPL Version 2, indicate your decision by adding
14.32 + * "[Contributor] elects to include this software in this distribution
14.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
14.34 + * single choice of license, a recipient has the option to distribute
14.35 + * your version of this file under either the CDDL, the GPL Version 2 or
14.36 + * to extend the choice of license to its licensees as provided above.
14.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
14.38 + * Version 2 license, then the option applies only if the new code is
14.39 + * made subject to such option by the copyright holder.
14.40 + *
14.41 + * Contributor(s):
14.42 + *
14.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
14.44 + */
14.45 +package org.netbeans.modules.jackpot30.ide.usages;
14.46 +
14.47 +import java.awt.BorderLayout;
14.48 +import org.openide.util.NbBundle;
14.49 +import org.openide.windows.Mode;
14.50 +import org.openide.windows.TopComponent;
14.51 +import org.netbeans.api.settings.ConvertAsProperties;
14.52 +import org.openide.awt.ActionID;
14.53 +import org.openide.awt.ActionReference;
14.54 +import org.openide.explorer.ExplorerManager;
14.55 +import org.openide.explorer.view.BeanTreeView;
14.56 +import org.openide.nodes.Node;
14.57 +import org.openide.windows.WindowManager;
14.58 +
14.59 +/**
14.60 + * Top component which displays something.
14.61 + */
14.62 +@ConvertAsProperties(dtd = "-//org.netbeans.modules.jackpot30.ide.usages//RemoteUsagesWindow//EN",
14.63 +autostore = false)
14.64 +@TopComponent.Description(preferredID = "RemoteUsagesWindowTopComponent",
14.65 +//iconBase="SET/PATH/TO/ICON/HERE",
14.66 +persistenceType = TopComponent.PERSISTENCE_ALWAYS)
14.67 +@TopComponent.Registration(mode = "output", openAtStartup = false)
14.68 +@ActionID(category = "Window", id = "org.netbeans.modules.jackpot30.ide.usages.RemoteUsagesWindowTopComponent")
14.69 +@ActionReference(path = "Menu/Window" /*, position = 333 */)
14.70 +@TopComponent.OpenActionRegistration(displayName = "#CTL_RemoteUsagesWindowAction",
14.71 +preferredID = "RemoteUsagesWindowTopComponent")
14.72 +public final class RemoteUsagesWindowTopComponent extends TopComponent implements ExplorerManager.Provider {
14.73 +
14.74 + public RemoteUsagesWindowTopComponent() {
14.75 + initComponents();
14.76 + setName(NbBundle.getMessage(RemoteUsagesWindowTopComponent.class, "CTL_RemoteUsagesWindowTopComponent"));
14.77 + setToolTipText(NbBundle.getMessage(RemoteUsagesWindowTopComponent.class, "HINT_RemoteUsagesWindowTopComponent"));
14.78 +
14.79 + BeanTreeView btv = new BeanTreeView();
14.80 +
14.81 + add(btv, BorderLayout.CENTER);
14.82 +
14.83 + btv.setRootVisible(false);
14.84 + }
14.85 +
14.86 + /** This method is called from within the constructor to
14.87 + * initialize the form.
14.88 + * WARNING: Do NOT modify this code. The content of this method is
14.89 + * always regenerated by the Form Editor.
14.90 + */
14.91 + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
14.92 + private void initComponents() {
14.93 +
14.94 + setLayout(new java.awt.BorderLayout());
14.95 + }// </editor-fold>//GEN-END:initComponents
14.96 +
14.97 + // Variables declaration - do not modify//GEN-BEGIN:variables
14.98 + // End of variables declaration//GEN-END:variables
14.99 + @Override
14.100 + public void componentOpened() {
14.101 + // TODO add custom code on component opening
14.102 + }
14.103 +
14.104 + @Override
14.105 + public void componentClosed() {
14.106 + // TODO add custom code on component closing
14.107 + }
14.108 +
14.109 + void writeProperties(java.util.Properties p) {
14.110 + // better to version settings since initial version as advocated at
14.111 + // http://wiki.apidesign.org/wiki/PropertyFiles
14.112 + p.setProperty("version", "1.0");
14.113 + // TODO store your settings
14.114 + }
14.115 +
14.116 + void readProperties(java.util.Properties p) {
14.117 + String version = p.getProperty("version");
14.118 + // TODO read your settings according to their version
14.119 + }
14.120 +
14.121 + @Override
14.122 + public int getPersistenceType() {
14.123 + return PERSISTENCE_NEVER;
14.124 + }
14.125 +
14.126 + private final ExplorerManager manager = new ExplorerManager();
14.127 +
14.128 + @Override
14.129 + public ExplorerManager getExplorerManager() {
14.130 + return manager;
14.131 + }
14.132 +
14.133 + @Override
14.134 + public void open() {
14.135 + Mode outputMode = WindowManager.getDefault().findMode("output");
14.136 +
14.137 + if (outputMode != null)
14.138 + outputMode.dockInto(this);
14.139 + super.open();
14.140 + requestActive();
14.141 + requestFocusInWindow(false);
14.142 + }
14.143 +
14.144 + public static void openFor(Node n) {
14.145 + RemoteUsagesWindowTopComponent c = new RemoteUsagesWindowTopComponent();
14.146 +
14.147 + c.manager.setRootContext(n);
14.148 + c.open();
14.149 + }
14.150 +}
15.1 --- a/remoting/server/indexer/nbproject/project.properties Mon Jun 27 18:32:06 2011 +0200
15.2 +++ b/remoting/server/indexer/nbproject/project.properties Mon Jun 27 18:32:08 2011 +0200
15.3 @@ -3,6 +3,8 @@
15.4 branding.token=${app.name}
15.5 modules=\
15.6 ${project.org.netbeans.modules.jackpot30.backend.impl}:\
15.7 - ${project.org.netbeans.modules.jackpot30.indexer.source}
15.8 + ${project.org.netbeans.modules.jackpot30.indexer.source}:\
15.9 + ${project.org.netbeans.modules.jackpot30.indexer.usages}
15.10 project.org.netbeans.modules.jackpot30.backend.impl=impl
15.11 project.org.netbeans.modules.jackpot30.indexer.source=source
15.12 +project.org.netbeans.modules.jackpot30.indexer.usages=usages
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/remoting/server/indexer/usages/build.xml Mon Jun 27 18:32:08 2011 +0200
16.3 @@ -0,0 +1,8 @@
16.4 +<?xml version="1.0" encoding="UTF-8"?>
16.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
16.6 +<!-- for some information on what you could do (e.g. targets to override). -->
16.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
16.8 +<project name="org.netbeans.modules.jackpot30.indexer.usages" default="netbeans" basedir=".">
16.9 + <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.indexer.usages.</description>
16.10 + <import file="nbproject/build-impl.xml"/>
16.11 +</project>
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/remoting/server/indexer/usages/manifest.mf Mon Jun 27 18:32:08 2011 +0200
17.3 @@ -0,0 +1,5 @@
17.4 +Manifest-Version: 1.0
17.5 +OpenIDE-Module: org.netbeans.modules.jackpot30.indexer.usages
17.6 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/indexer/usages/Bundle.properties
17.7 +OpenIDE-Module-Specification-Version: 1.0
17.8 +
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/remoting/server/indexer/usages/nbproject/build-impl.xml Mon Jun 27 18:32:08 2011 +0200
18.3 @@ -0,0 +1,45 @@
18.4 +<?xml version="1.0" encoding="UTF-8"?>
18.5 +<!--
18.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
18.7 +*** EDIT ../build.xml INSTEAD ***
18.8 +-->
18.9 +<project name="org.netbeans.modules.jackpot30.indexer.usages-impl" basedir="..">
18.10 + <fail message="Please build using Ant 1.7.1 or higher.">
18.11 + <condition>
18.12 + <not>
18.13 + <antversion atleast="1.7.1"/>
18.14 + </not>
18.15 + </condition>
18.16 + </fail>
18.17 + <property file="nbproject/private/suite-private.properties"/>
18.18 + <property file="nbproject/suite.properties"/>
18.19 + <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
18.20 + <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
18.21 + <property file="${suite.dir}/nbproject/platform.properties"/>
18.22 + <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
18.23 + <attribute name="name"/>
18.24 + <attribute name="value"/>
18.25 + <sequential>
18.26 + <property name="@{name}" value="${@{value}}"/>
18.27 + </sequential>
18.28 + </macrodef>
18.29 + <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
18.30 + <attribute name="property"/>
18.31 + <attribute name="value"/>
18.32 + <sequential>
18.33 + <property name="@{property}" value="@{value}"/>
18.34 + </sequential>
18.35 + </macrodef>
18.36 + <property file="${user.properties.file}"/>
18.37 + <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
18.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"/>
18.39 + <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
18.40 + <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
18.41 + <condition>
18.42 + <not>
18.43 + <contains string="${cluster.path.evaluated}" substring="platform"/>
18.44 + </not>
18.45 + </condition>
18.46 + </fail>
18.47 + <import file="${harness.dir}/build.xml"/>
18.48 +</project>
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/remoting/server/indexer/usages/nbproject/genfiles.properties Mon Jun 27 18:32:08 2011 +0200
19.3 @@ -0,0 +1,8 @@
19.4 +build.xml.data.CRC32=15fd41e2
19.5 +build.xml.script.CRC32=4ae79e41
19.6 +build.xml.stylesheet.CRC32=a56c6a5b@1.47
19.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
19.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
19.9 +nbproject/build-impl.xml.data.CRC32=15fd41e2
19.10 +nbproject/build-impl.xml.script.CRC32=16d3b827
19.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.47
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/remoting/server/indexer/usages/nbproject/project.properties Mon Jun 27 18:32:08 2011 +0200
20.3 @@ -0,0 +1,2 @@
20.4 +javac.source=1.6
20.5 +javac.compilerargs=-Xlint -Xlint:-serial
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/remoting/server/indexer/usages/nbproject/project.xml Mon Jun 27 18:32:08 2011 +0200
21.3 @@ -0,0 +1,98 @@
21.4 +<?xml version="1.0" encoding="UTF-8"?>
21.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
21.6 + <type>org.netbeans.modules.apisupport.project</type>
21.7 + <configuration>
21.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
21.9 + <code-name-base>org.netbeans.modules.jackpot30.indexer.usages</code-name-base>
21.10 + <suite-component/>
21.11 + <module-dependencies>
21.12 + <dependency>
21.13 + <code-name-base>org.netbeans.api.java.classpath</code-name-base>
21.14 + <build-prerequisite/>
21.15 + <compile-dependency/>
21.16 + <run-dependency>
21.17 + <release-version>1</release-version>
21.18 + <specification-version>1.30</specification-version>
21.19 + </run-dependency>
21.20 + </dependency>
21.21 + <dependency>
21.22 + <code-name-base>org.netbeans.libs.javacapi</code-name-base>
21.23 + <build-prerequisite/>
21.24 + <compile-dependency/>
21.25 + <run-dependency>
21.26 + <specification-version>7.7.0.3</specification-version>
21.27 + </run-dependency>
21.28 + </dependency>
21.29 + <dependency>
21.30 + <code-name-base>org.netbeans.libs.lucene</code-name-base>
21.31 + <build-prerequisite/>
21.32 + <compile-dependency/>
21.33 + <run-dependency>
21.34 + <release-version>3</release-version>
21.35 + <specification-version>3.3</specification-version>
21.36 + </run-dependency>
21.37 + </dependency>
21.38 + <dependency>
21.39 + <code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base>
21.40 + <build-prerequisite/>
21.41 + <compile-dependency/>
21.42 + <run-dependency>
21.43 + <release-version>1</release-version>
21.44 + <specification-version>1.23</specification-version>
21.45 + </run-dependency>
21.46 + </dependency>
21.47 + <dependency>
21.48 + <code-name-base>org.netbeans.modules.java.source</code-name-base>
21.49 + <build-prerequisite/>
21.50 + <compile-dependency/>
21.51 + <run-dependency>
21.52 + <specification-version>0.81.0.17.15.6</specification-version>
21.53 + </run-dependency>
21.54 + </dependency>
21.55 + <dependency>
21.56 + <code-name-base>org.netbeans.modules.parsing.api</code-name-base>
21.57 + <build-prerequisite/>
21.58 + <compile-dependency/>
21.59 + <run-dependency>
21.60 + <release-version>1</release-version>
21.61 + <specification-version>1.43.0.6</specification-version>
21.62 + </run-dependency>
21.63 + </dependency>
21.64 + <dependency>
21.65 + <code-name-base>org.netbeans.modules.parsing.lucene</code-name-base>
21.66 + <build-prerequisite/>
21.67 + <compile-dependency/>
21.68 + <run-dependency>
21.69 + <release-version>2</release-version>
21.70 + <implementation-version/>
21.71 + </run-dependency>
21.72 + </dependency>
21.73 + <dependency>
21.74 + <code-name-base>org.openide.filesystems</code-name-base>
21.75 + <build-prerequisite/>
21.76 + <compile-dependency/>
21.77 + <run-dependency>
21.78 + <specification-version>7.48</specification-version>
21.79 + </run-dependency>
21.80 + </dependency>
21.81 + <dependency>
21.82 + <code-name-base>org.openide.util</code-name-base>
21.83 + <build-prerequisite/>
21.84 + <compile-dependency/>
21.85 + <run-dependency>
21.86 + <specification-version>8.16</specification-version>
21.87 + </run-dependency>
21.88 + </dependency>
21.89 + <dependency>
21.90 + <code-name-base>org.openide.util.lookup</code-name-base>
21.91 + <build-prerequisite/>
21.92 + <compile-dependency/>
21.93 + <run-dependency>
21.94 + <specification-version>8.9</specification-version>
21.95 + </run-dependency>
21.96 + </dependency>
21.97 + </module-dependencies>
21.98 + <public-packages/>
21.99 + </data>
21.100 + </configuration>
21.101 +</project>
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/remoting/server/indexer/usages/nbproject/suite.properties Mon Jun 27 18:32:08 2011 +0200
22.3 @@ -0,0 +1,1 @@
22.4 +suite.dir=${basedir}/..
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/remoting/server/indexer/usages/src/org/netbeans/modules/jackpot30/indexer/usages/Bundle.properties Mon Jun 27 18:32:08 2011 +0200
23.3 @@ -0,0 +1,41 @@
23.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
23.5 +#
23.6 +# Copyright 2011 Oracle and/or its affiliates. All rights reserved.
23.7 +#
23.8 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
23.9 +# Other names may be trademarks of their respective owners.
23.10 +#
23.11 +# The contents of this file are subject to the terms of either the GNU
23.12 +# General Public License Version 2 only ("GPL") or the Common
23.13 +# Development and Distribution License("CDDL") (collectively, the
23.14 +# "License"). You may not use this file except in compliance with the
23.15 +# License. You can obtain a copy of the License at
23.16 +# http://www.netbeans.org/cddl-gplv2.html
23.17 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
23.18 +# specific language governing permissions and limitations under the
23.19 +# License. When distributing the software, include this License Header
23.20 +# Notice in each file and include the License file at
23.21 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
23.22 +# particular file as subject to the "Classpath" exception as provided
23.23 +# by Oracle in the GPL Version 2 section of the License file that
23.24 +# accompanied this code. If applicable, add the following below the
23.25 +# License Header, with the fields enclosed by brackets [] replaced by
23.26 +# your own identifying information:
23.27 +# "Portions Copyrighted [year] [name of copyright owner]"
23.28 +#
23.29 +# If you wish your version of this file to be governed by only the CDDL
23.30 +# or only the GPL Version 2, indicate your decision by adding
23.31 +# "[Contributor] elects to include this software in this distribution
23.32 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
23.33 +# single choice of license, a recipient has the option to distribute
23.34 +# your version of this file under either the CDDL, the GPL Version 2 or
23.35 +# to extend the choice of license to its licensees as provided above.
23.36 +# However, if you add GPL Version 2 code and therefore, elected the GPL
23.37 +# Version 2 license, then the option applies only if the new code is
23.38 +# made subject to such option by the copyright holder.
23.39 +#
23.40 +# Contributor(s):
23.41 +#
23.42 +# Portions Copyrighted 2011 Sun Microsystems, Inc.
23.43 +#
23.44 +OpenIDE-Module-Name=Jackpot 3.0 Usages Indexer
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/remoting/server/indexer/usages/src/org/netbeans/modules/jackpot30/indexer/usages/Common.java Mon Jun 27 18:32:08 2011 +0200
24.3 @@ -0,0 +1,91 @@
24.4 +/*
24.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
24.6 + *
24.7 + * Copyright 2011 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 2011 Sun Microsystems, Inc.
24.44 + */
24.45 +package org.netbeans.modules.jackpot30.indexer.usages;
24.46 +
24.47 +import java.lang.reflect.Field;
24.48 +import java.util.EnumSet;
24.49 +import java.util.Set;
24.50 +import javax.lang.model.element.ElementKind;
24.51 +import org.netbeans.api.java.source.ElementHandle;
24.52 +import org.openide.util.Exceptions;
24.53 +
24.54 +/**XXX: Copied between indexing and ide!
24.55 + *
24.56 + * @author lahvac
24.57 + */
24.58 +public class Common {
24.59 +
24.60 + public static final Set<ElementKind> SUPPORTED_KINDS = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS,
24.61 + ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD,
24.62 + ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT,
24.63 + ElementKind.FIELD, ElementKind.ENUM_CONSTANT);
24.64 +
24.65 + public static String serialize(ElementHandle<?> h) {
24.66 + StringBuilder result = new StringBuilder();
24.67 +
24.68 + result.append(h.getKind());
24.69 +
24.70 + try {
24.71 + Field signaturesField = ElementHandle.class.getDeclaredField("signatures");
24.72 +
24.73 + signaturesField.setAccessible(true);
24.74 +
24.75 + String[] signatures = (String[]) signaturesField.get(h);
24.76 +
24.77 + for (String sig : signatures) {
24.78 + result.append(":");
24.79 + result.append(sig);
24.80 + }
24.81 + } catch (IllegalArgumentException ex) {
24.82 + Exceptions.printStackTrace(ex);
24.83 + } catch (IllegalAccessException ex) {
24.84 + Exceptions.printStackTrace(ex);
24.85 + } catch (NoSuchFieldException ex) {
24.86 + Exceptions.printStackTrace(ex);
24.87 + } catch (SecurityException ex) {
24.88 + Exceptions.printStackTrace(ex);
24.89 + }
24.90 +
24.91 + return result.toString();
24.92 + }
24.93 +
24.94 +}
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/remoting/server/indexer/usages/src/org/netbeans/modules/jackpot30/indexer/usages/IndexerImpl.java Mon Jun 27 18:32:08 2011 +0200
25.3 @@ -0,0 +1,206 @@
25.4 +/*
25.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
25.6 + *
25.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
25.8 + *
25.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
25.10 + * Other names may be trademarks of their respective owners.
25.11 + *
25.12 + * The contents of this file are subject to the terms of either the GNU
25.13 + * General Public License Version 2 only ("GPL") or the Common
25.14 + * Development and Distribution License("CDDL") (collectively, the
25.15 + * "License"). You may not use this file except in compliance with the
25.16 + * License. You can obtain a copy of the License at
25.17 + * http://www.netbeans.org/cddl-gplv2.html
25.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
25.19 + * specific language governing permissions and limitations under the
25.20 + * License. When distributing the software, include this License Header
25.21 + * Notice in each file and include the License file at
25.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
25.23 + * particular file as subject to the "Classpath" exception as provided
25.24 + * by Oracle in the GPL Version 2 section of the License file that
25.25 + * accompanied this code. If applicable, add the following below the
25.26 + * License Header, with the fields enclosed by brackets [] replaced by
25.27 + * your own identifying information:
25.28 + * "Portions Copyrighted [year] [name of copyright owner]"
25.29 + *
25.30 + * If you wish your version of this file to be governed by only the CDDL
25.31 + * or only the GPL Version 2, indicate your decision by adding
25.32 + * "[Contributor] elects to include this software in this distribution
25.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
25.34 + * single choice of license, a recipient has the option to distribute
25.35 + * your version of this file under either the CDDL, the GPL Version 2 or
25.36 + * to extend the choice of license to its licensees as provided above.
25.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
25.38 + * Version 2 license, then the option applies only if the new code is
25.39 + * made subject to such option by the copyright holder.
25.40 + *
25.41 + * Contributor(s):
25.42 + *
25.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
25.44 + */
25.45 +package org.netbeans.modules.jackpot30.indexer.usages;
25.46 +
25.47 +import com.sun.source.tree.IdentifierTree;
25.48 +import com.sun.source.tree.MemberSelectTree;
25.49 +import com.sun.source.util.TreePathScanner;
25.50 +import java.io.IOException;
25.51 +import java.util.Collection;
25.52 +import java.util.Collections;
25.53 +import java.util.HashSet;
25.54 +import java.util.LinkedList;
25.55 +import java.util.Set;
25.56 +import javax.lang.model.element.Element;
25.57 +import org.netbeans.api.editor.mimelookup.MimeRegistration;
25.58 +import org.netbeans.api.java.source.ClasspathInfo;
25.59 +import org.netbeans.api.java.source.CompilationController;
25.60 +import org.netbeans.api.java.source.ElementHandle;
25.61 +import org.netbeans.api.java.source.JavaSource;
25.62 +import org.netbeans.api.java.source.JavaSource.Phase;
25.63 +import org.netbeans.api.java.source.Task;
25.64 +import org.netbeans.modules.parsing.lucene.support.DocumentIndex;
25.65 +import org.netbeans.modules.parsing.lucene.support.IndexDocument;
25.66 +import org.netbeans.modules.parsing.lucene.support.IndexManager;
25.67 +import org.netbeans.modules.parsing.spi.indexing.Context;
25.68 +import org.netbeans.modules.parsing.spi.indexing.CustomIndexer;
25.69 +import org.netbeans.modules.parsing.spi.indexing.CustomIndexerFactory;
25.70 +import org.netbeans.modules.parsing.spi.indexing.Indexable;
25.71 +import org.openide.filesystems.FileObject;
25.72 +import org.openide.filesystems.FileUtil;
25.73 +import org.openide.filesystems.URLMapper;
25.74 +import org.openide.util.Exceptions;
25.75 +
25.76 +/**
25.77 + *
25.78 + * @author lahvac
25.79 + */
25.80 +public class IndexerImpl extends CustomIndexer {
25.81 +
25.82 + private static final String KEY_SIGNATURES = "signatures";
25.83 +
25.84 + @Override
25.85 + protected void index(Iterable<? extends Indexable> files, Context context) {
25.86 + Collection<FileObject> toIndex = new LinkedList<FileObject>(); //XXX: better would be to use File
25.87 +
25.88 + for (Indexable i : files) {
25.89 + FileObject f = URLMapper.findFileObject(i.getURL());
25.90 +
25.91 + if (f != null) {
25.92 + toIndex.add(f);
25.93 + }
25.94 + }
25.95 +
25.96 + if (toIndex.isEmpty()) {
25.97 + return ;
25.98 + }
25.99 +
25.100 + doIndex(context, toIndex, Collections.<String>emptyList());
25.101 + }
25.102 +
25.103 + public static void doIndex(final Context context, Collection<? extends FileObject> toIndex, Iterable<? extends String> deleted) {
25.104 + if (toIndex.isEmpty() && !deleted.iterator().hasNext()) {
25.105 + return ;
25.106 + }
25.107 +
25.108 + final DocumentIndex[] idx = new DocumentIndex[1];
25.109 +
25.110 + try {
25.111 + idx[0] = IndexManager.createDocumentIndex(FileUtil.toFile(context.getIndexFolder()));
25.112 +
25.113 + ClasspathInfo cpInfo = ClasspathInfo.create(context.getRoot());
25.114 +
25.115 + for (String path : deleted) {
25.116 + idx[0].removeDocument(path);
25.117 + }
25.118 +
25.119 + if (!toIndex.isEmpty()) {
25.120 + JavaSource.create(cpInfo, toIndex).runUserActionTask(new Task<CompilationController>() {
25.121 + public void run(final CompilationController cc) throws Exception {
25.122 + if (cc.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0)
25.123 + return ;
25.124 +
25.125 + final IndexDocument doc = IndexManager.createDocument(FileUtil.getRelativePath(context.getRoot(), cc.getFileObject()));
25.126 +
25.127 + new TreePathScanner<Void, Void>() {
25.128 + private final Set<String> SEEN_SIGNATURES = new HashSet<String>();
25.129 + @Override public Void visitIdentifier(IdentifierTree node, Void p) {
25.130 + handleNode();
25.131 + return super.visitIdentifier(node, p);
25.132 + }
25.133 + @Override public Void visitMemberSelect(MemberSelectTree node, Void p) {
25.134 + handleNode();
25.135 + return super.visitMemberSelect(node, p);
25.136 + }
25.137 + private void handleNode() {
25.138 + Element el = cc.getTrees().getElement(getCurrentPath());
25.139 +
25.140 + if (el != null && Common.SUPPORTED_KINDS.contains(el.getKind())) {
25.141 + String serialized = Common.serialize(ElementHandle.create(el));
25.142 +
25.143 + if (SEEN_SIGNATURES.add(serialized)) {
25.144 + doc.addPair(KEY_SIGNATURES, serialized, true, true);
25.145 + }
25.146 + }
25.147 + }
25.148 + }.scan(cc.getCompilationUnit(), null);
25.149 +
25.150 + idx[0].addDocument(doc);
25.151 + }
25.152 + }, true);
25.153 + }
25.154 + } catch (IOException ex) {
25.155 + Exceptions.printStackTrace(ex);
25.156 + } finally {
25.157 + if (idx[0] != null) {
25.158 + try {
25.159 + idx[0].store(true);
25.160 + idx[0].close();
25.161 + } catch (IOException ex) {
25.162 + Exceptions.printStackTrace(ex);
25.163 + }
25.164 + }
25.165 + }
25.166 + }
25.167 +
25.168 + @MimeRegistration(mimeType="text/x-java", service=CustomIndexerFactory.class)
25.169 + public static final class FactoryImpl extends CustomIndexerFactory {
25.170 +
25.171 + @Override
25.172 + public CustomIndexer createIndexer() {
25.173 + return new IndexerImpl();
25.174 + }
25.175 +
25.176 + @Override
25.177 + public boolean supportsEmbeddedIndexers() {
25.178 + return false;
25.179 + }
25.180 +
25.181 + @Override
25.182 + public void filesDeleted(Iterable<? extends Indexable> deleted, Context context) {
25.183 + Collection<String> deletedPaths = new LinkedList<String>();
25.184 +
25.185 + for (Indexable i : deleted) {
25.186 + deletedPaths.add(i.getRelativePath());
25.187 +
25.188 + }
25.189 +
25.190 + doIndex(context, Collections.<FileObject>emptyList(), deletedPaths);
25.191 + }
25.192 +
25.193 + @Override
25.194 + public void filesDirty(Iterable<? extends Indexable> dirty, Context context) {
25.195 + }
25.196 +
25.197 + @Override
25.198 + public String getIndexerName() {
25.199 + return "javausages";
25.200 + }
25.201 +
25.202 + @Override
25.203 + public int getIndexVersion() {
25.204 + return 1;
25.205 + }
25.206 +
25.207 + }
25.208 +
25.209 +}
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/remoting/server/web/usages.web.api/build.xml Mon Jun 27 18:32:08 2011 +0200
26.3 @@ -0,0 +1,74 @@
26.4 +<?xml version="1.0" encoding="UTF-8"?>
26.5 +<!-- You may freely edit this file. See commented blocks below for -->
26.6 +<!-- some examples of how to customize the build. -->
26.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
26.8 +<!-- By default, only the Clean and Build commands use this build script. -->
26.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
26.10 +<!-- the Compile on Save feature is turned off for the project. -->
26.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
26.12 +<!-- in the project's Project Properties dialog box.-->
26.13 +<project name="usages.web.api" default="default" basedir=".">
26.14 + <description>Builds, tests, and runs the project usages.web.api.</description>
26.15 + <import file="nbproject/build-impl.xml"/>
26.16 + <!--
26.17 +
26.18 + There exist several targets which are by default empty and which can be
26.19 + used for execution of your tasks. These targets are usually executed
26.20 + before and after some main targets. They are:
26.21 +
26.22 + -pre-init: called before initialization of project properties
26.23 + -post-init: called after initialization of project properties
26.24 + -pre-compile: called before javac compilation
26.25 + -post-compile: called after javac compilation
26.26 + -pre-compile-single: called before javac compilation of single file
26.27 + -post-compile-single: called after javac compilation of single file
26.28 + -pre-compile-test: called before javac compilation of JUnit tests
26.29 + -post-compile-test: called after javac compilation of JUnit tests
26.30 + -pre-compile-test-single: called before javac compilation of single JUnit test
26.31 + -post-compile-test-single: called after javac compilation of single JUunit test
26.32 + -pre-jar: called before JAR building
26.33 + -post-jar: called after JAR building
26.34 + -post-clean: called after cleaning build products
26.35 +
26.36 + (Targets beginning with '-' are not intended to be called on their own.)
26.37 +
26.38 + Example of inserting an obfuscator after compilation could look like this:
26.39 +
26.40 + <target name="-post-compile">
26.41 + <obfuscate>
26.42 + <fileset dir="${build.classes.dir}"/>
26.43 + </obfuscate>
26.44 + </target>
26.45 +
26.46 + For list of available properties check the imported
26.47 + nbproject/build-impl.xml file.
26.48 +
26.49 +
26.50 + Another way to customize the build is by overriding existing main targets.
26.51 + The targets of interest are:
26.52 +
26.53 + -init-macrodef-javac: defines macro for javac compilation
26.54 + -init-macrodef-junit: defines macro for junit execution
26.55 + -init-macrodef-debug: defines macro for class debugging
26.56 + -init-macrodef-java: defines macro for class execution
26.57 + -do-jar-with-manifest: JAR building (if you are using a manifest)
26.58 + -do-jar-without-manifest: JAR building (if you are not using a manifest)
26.59 + run: execution of project
26.60 + -javadoc-build: Javadoc generation
26.61 + test-report: JUnit report generation
26.62 +
26.63 + An example of overriding the target for project execution could look like this:
26.64 +
26.65 + <target name="run" depends="usages.web.api-impl.jar">
26.66 + <exec dir="bin" executable="launcher.exe">
26.67 + <arg file="${dist.jar}"/>
26.68 + </exec>
26.69 + </target>
26.70 +
26.71 + Notice that the overridden target depends on the jar target and not only on
26.72 + the compile target as the regular run target does. Again, for a list of available
26.73 + properties which you can use, check the target you are overriding in the
26.74 + nbproject/build-impl.xml file.
26.75 +
26.76 + -->
26.77 +</project>
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/remoting/server/web/usages.web.api/manifest.mf Mon Jun 27 18:32:08 2011 +0200
27.3 @@ -0,0 +1,3 @@
27.4 +Manifest-Version: 1.0
27.5 +X-COMMENT: Main-Class will be added automatically by build
27.6 +
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/remoting/server/web/usages.web.api/nbproject/build-impl.xml Mon Jun 27 18:32:08 2011 +0200
28.3 @@ -0,0 +1,1082 @@
28.4 +<?xml version="1.0" encoding="UTF-8"?>
28.5 +<!--
28.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
28.7 +*** EDIT ../build.xml INSTEAD ***
28.8 +
28.9 +For the purpose of easier reading the script
28.10 +is divided into following sections:
28.11 +
28.12 + - initialization
28.13 + - compilation
28.14 + - jar
28.15 + - execution
28.16 + - debugging
28.17 + - javadoc
28.18 + - junit compilation
28.19 + - junit execution
28.20 + - junit debugging
28.21 + - applet
28.22 + - cleanup
28.23 +
28.24 + -->
28.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="usages.web.api-impl">
28.26 + <fail message="Please build using Ant 1.8.0 or higher.">
28.27 + <condition>
28.28 + <not>
28.29 + <antversion atleast="1.8.0"/>
28.30 + </not>
28.31 + </condition>
28.32 + </fail>
28.33 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
28.34 + <!--
28.35 + ======================
28.36 + INITIALIZATION SECTION
28.37 + ======================
28.38 + -->
28.39 + <target name="-pre-init">
28.40 + <!-- Empty placeholder for easier customization. -->
28.41 + <!-- You can override this target in the ../build.xml file. -->
28.42 + </target>
28.43 + <target depends="-pre-init" name="-init-private">
28.44 + <property file="nbproject/private/config.properties"/>
28.45 + <property file="nbproject/private/configs/${config}.properties"/>
28.46 + <property file="nbproject/private/private.properties"/>
28.47 + </target>
28.48 + <target name="-pre-init-libraries">
28.49 + <property location="../../../../server/lib/nblibraries.properties" name="libraries.path"/>
28.50 + <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
28.51 + <pathconvert dirsep="/" property="libraries.dir">
28.52 + <path path="${libraries.dir.nativedirsep}"/>
28.53 + </pathconvert>
28.54 + <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
28.55 + <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
28.56 + </target>
28.57 + <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
28.58 + <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
28.59 + <filterchain>
28.60 + <replacestring from="$${base}" to="${libraries.dir}"/>
28.61 + <escapeunicode/>
28.62 + </filterchain>
28.63 + </loadproperties>
28.64 + </target>
28.65 + <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
28.66 + <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
28.67 + <filterchain>
28.68 + <replacestring from="$${base}" to="${libraries.dir}"/>
28.69 + <escapeunicode/>
28.70 + </filterchain>
28.71 + </loadproperties>
28.72 + </target>
28.73 + <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
28.74 + <property file="${user.properties.file}"/>
28.75 + <!-- The two properties below are usually overridden -->
28.76 + <!-- by the active platform. Just a fallback. -->
28.77 + <property name="default.javac.source" value="1.4"/>
28.78 + <property name="default.javac.target" value="1.4"/>
28.79 + </target>
28.80 + <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
28.81 + <property file="nbproject/configs/${config}.properties"/>
28.82 + <property file="nbproject/project.properties"/>
28.83 + </target>
28.84 + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
28.85 + <available file="${manifest.file}" property="manifest.available"/>
28.86 + <condition property="splashscreen.available">
28.87 + <and>
28.88 + <not>
28.89 + <equals arg1="${application.splash}" arg2="" trim="true"/>
28.90 + </not>
28.91 + <available file="${application.splash}"/>
28.92 + </and>
28.93 + </condition>
28.94 + <condition property="main.class.available">
28.95 + <and>
28.96 + <isset property="main.class"/>
28.97 + <not>
28.98 + <equals arg1="${main.class}" arg2="" trim="true"/>
28.99 + </not>
28.100 + </and>
28.101 + </condition>
28.102 + <condition property="manifest.available+main.class">
28.103 + <and>
28.104 + <isset property="manifest.available"/>
28.105 + <isset property="main.class.available"/>
28.106 + </and>
28.107 + </condition>
28.108 + <condition property="do.archive">
28.109 + <not>
28.110 + <istrue value="${jar.archive.disabled}"/>
28.111 + </not>
28.112 + </condition>
28.113 + <condition property="do.mkdist">
28.114 + <and>
28.115 + <isset property="do.archive"/>
28.116 + <isset property="libs.CopyLibs.classpath"/>
28.117 + <not>
28.118 + <istrue value="${mkdist.disabled}"/>
28.119 + </not>
28.120 + </and>
28.121 + </condition>
28.122 + <condition property="manifest.available+main.class+mkdist.available">
28.123 + <and>
28.124 + <istrue value="${manifest.available+main.class}"/>
28.125 + <isset property="do.mkdist"/>
28.126 + </and>
28.127 + </condition>
28.128 + <condition property="do.archive+manifest.available">
28.129 + <and>
28.130 + <isset property="manifest.available"/>
28.131 + <istrue value="${do.archive}"/>
28.132 + </and>
28.133 + </condition>
28.134 + <condition property="do.archive+main.class.available">
28.135 + <and>
28.136 + <isset property="main.class.available"/>
28.137 + <istrue value="${do.archive}"/>
28.138 + </and>
28.139 + </condition>
28.140 + <condition property="do.archive+splashscreen.available">
28.141 + <and>
28.142 + <isset property="splashscreen.available"/>
28.143 + <istrue value="${do.archive}"/>
28.144 + </and>
28.145 + </condition>
28.146 + <condition property="do.archive+manifest.available+main.class">
28.147 + <and>
28.148 + <istrue value="${manifest.available+main.class}"/>
28.149 + <istrue value="${do.archive}"/>
28.150 + </and>
28.151 + </condition>
28.152 + <condition property="manifest.available-mkdist.available">
28.153 + <or>
28.154 + <istrue value="${manifest.available}"/>
28.155 + <isset property="do.mkdist"/>
28.156 + </or>
28.157 + </condition>
28.158 + <condition property="manifest.available+main.class-mkdist.available">
28.159 + <or>
28.160 + <istrue value="${manifest.available+main.class}"/>
28.161 + <isset property="do.mkdist"/>
28.162 + </or>
28.163 + </condition>
28.164 + <condition property="have.tests">
28.165 + <or>
28.166 + <available file="${test.src.dir}"/>
28.167 + </or>
28.168 + </condition>
28.169 + <condition property="have.sources">
28.170 + <or>
28.171 + <available file="${src.dir}"/>
28.172 + </or>
28.173 + </condition>
28.174 + <condition property="netbeans.home+have.tests">
28.175 + <and>
28.176 + <isset property="netbeans.home"/>
28.177 + <isset property="have.tests"/>
28.178 + </and>
28.179 + </condition>
28.180 + <condition property="no.javadoc.preview">
28.181 + <and>
28.182 + <isset property="javadoc.preview"/>
28.183 + <isfalse value="${javadoc.preview}"/>
28.184 + </and>
28.185 + </condition>
28.186 + <property name="run.jvmargs" value=""/>
28.187 + <property name="javac.compilerargs" value=""/>
28.188 + <property name="work.dir" value="${basedir}"/>
28.189 + <condition property="no.deps">
28.190 + <and>
28.191 + <istrue value="${no.dependencies}"/>
28.192 + </and>
28.193 + </condition>
28.194 + <property name="javac.debug" value="true"/>
28.195 + <property name="javadoc.preview" value="true"/>
28.196 + <property name="application.args" value=""/>
28.197 + <property name="source.encoding" value="${file.encoding}"/>
28.198 + <property name="runtime.encoding" value="${source.encoding}"/>
28.199 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
28.200 + <and>
28.201 + <isset property="javadoc.encoding"/>
28.202 + <not>
28.203 + <equals arg1="${javadoc.encoding}" arg2=""/>
28.204 + </not>
28.205 + </and>
28.206 + </condition>
28.207 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
28.208 + <property name="includes" value="**"/>
28.209 + <property name="excludes" value=""/>
28.210 + <property name="do.depend" value="false"/>
28.211 + <condition property="do.depend.true">
28.212 + <istrue value="${do.depend}"/>
28.213 + </condition>
28.214 + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
28.215 + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
28.216 + <length length="0" string="${endorsed.classpath}" when="greater"/>
28.217 + </condition>
28.218 + <condition else="false" property="jdkBug6558476">
28.219 + <and>
28.220 + <matches pattern="1\.[56]" string="${java.specification.version}"/>
28.221 + <not>
28.222 + <os family="unix"/>
28.223 + </not>
28.224 + </and>
28.225 + </condition>
28.226 + <property name="javac.fork" value="${jdkBug6558476}"/>
28.227 + <property name="jar.index" value="false"/>
28.228 + <property name="jar.index.metainf" value="${jar.index}"/>
28.229 + <property name="copylibs.rebase" value="true"/>
28.230 + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
28.231 + </target>
28.232 + <target name="-post-init">
28.233 + <!-- Empty placeholder for easier customization. -->
28.234 + <!-- You can override this target in the ../build.xml file. -->
28.235 + </target>
28.236 + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
28.237 + <fail unless="src.dir">Must set src.dir</fail>
28.238 + <fail unless="test.src.dir">Must set test.src.dir</fail>
28.239 + <fail unless="build.dir">Must set build.dir</fail>
28.240 + <fail unless="dist.dir">Must set dist.dir</fail>
28.241 + <fail unless="build.classes.dir">Must set build.classes.dir</fail>
28.242 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
28.243 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
28.244 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
28.245 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
28.246 + <fail unless="dist.jar">Must set dist.jar</fail>
28.247 + </target>
28.248 + <target name="-init-macrodef-property">
28.249 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
28.250 + <attribute name="name"/>
28.251 + <attribute name="value"/>
28.252 + <sequential>
28.253 + <property name="@{name}" value="${@{value}}"/>
28.254 + </sequential>
28.255 + </macrodef>
28.256 + </target>
28.257 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
28.258 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
28.259 + <attribute default="${src.dir}" name="srcdir"/>
28.260 + <attribute default="${build.classes.dir}" name="destdir"/>
28.261 + <attribute default="${javac.classpath}" name="classpath"/>
28.262 + <attribute default="${javac.processorpath}" name="processorpath"/>
28.263 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
28.264 + <attribute default="${includes}" name="includes"/>
28.265 + <attribute default="${excludes}" name="excludes"/>
28.266 + <attribute default="${javac.debug}" name="debug"/>
28.267 + <attribute default="${empty.dir}" name="sourcepath"/>
28.268 + <attribute default="${empty.dir}" name="gensrcdir"/>
28.269 + <element name="customize" optional="true"/>
28.270 + <sequential>
28.271 + <property location="${build.dir}/empty" name="empty.dir"/>
28.272 + <mkdir dir="${empty.dir}"/>
28.273 + <mkdir dir="@{apgeneratedsrcdir}"/>
28.274 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
28.275 + <src>
28.276 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
28.277 + <include name="*"/>
28.278 + </dirset>
28.279 + </src>
28.280 + <classpath>
28.281 + <path path="@{classpath}"/>
28.282 + </classpath>
28.283 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
28.284 + <compilerarg line="${javac.compilerargs}"/>
28.285 + <compilerarg value="-processorpath"/>
28.286 + <compilerarg path="@{processorpath}:${empty.dir}"/>
28.287 + <compilerarg line="${ap.processors.internal}"/>
28.288 + <compilerarg line="${annotation.processing.processor.options}"/>
28.289 + <compilerarg value="-s"/>
28.290 + <compilerarg path="@{apgeneratedsrcdir}"/>
28.291 + <compilerarg line="${ap.proc.none.internal}"/>
28.292 + <customize/>
28.293 + </javac>
28.294 + </sequential>
28.295 + </macrodef>
28.296 + </target>
28.297 + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
28.298 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
28.299 + <attribute default="${src.dir}" name="srcdir"/>
28.300 + <attribute default="${build.classes.dir}" name="destdir"/>
28.301 + <attribute default="${javac.classpath}" name="classpath"/>
28.302 + <attribute default="${javac.processorpath}" name="processorpath"/>
28.303 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
28.304 + <attribute default="${includes}" name="includes"/>
28.305 + <attribute default="${excludes}" name="excludes"/>
28.306 + <attribute default="${javac.debug}" name="debug"/>
28.307 + <attribute default="${empty.dir}" name="sourcepath"/>
28.308 + <attribute default="${empty.dir}" name="gensrcdir"/>
28.309 + <element name="customize" optional="true"/>
28.310 + <sequential>
28.311 + <property location="${build.dir}/empty" name="empty.dir"/>
28.312 + <mkdir dir="${empty.dir}"/>
28.313 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
28.314 + <src>
28.315 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
28.316 + <include name="*"/>
28.317 + </dirset>
28.318 + </src>
28.319 + <classpath>
28.320 + <path path="@{classpath}"/>
28.321 + </classpath>
28.322 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
28.323 + <compilerarg line="${javac.compilerargs}"/>
28.324 + <customize/>
28.325 + </javac>
28.326 + </sequential>
28.327 + </macrodef>
28.328 + </target>
28.329 + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
28.330 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
28.331 + <attribute default="${src.dir}" name="srcdir"/>
28.332 + <attribute default="${build.classes.dir}" name="destdir"/>
28.333 + <attribute default="${javac.classpath}" name="classpath"/>
28.334 + <sequential>
28.335 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
28.336 + <classpath>
28.337 + <path path="@{classpath}"/>
28.338 + </classpath>
28.339 + </depend>
28.340 + </sequential>
28.341 + </macrodef>
28.342 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
28.343 + <attribute default="${build.classes.dir}" name="destdir"/>
28.344 + <sequential>
28.345 + <fail unless="javac.includes">Must set javac.includes</fail>
28.346 + <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
28.347 + <path>
28.348 + <filelist dir="@{destdir}" files="${javac.includes}"/>
28.349 + </path>
28.350 + <globmapper from="*.java" to="*.class"/>
28.351 + </pathconvert>
28.352 + <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
28.353 + <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
28.354 + <delete>
28.355 + <files includesfile="${javac.includesfile.binary}"/>
28.356 + </delete>
28.357 + <delete>
28.358 + <fileset file="${javac.includesfile.binary}"/>
28.359 + </delete>
28.360 + </sequential>
28.361 + </macrodef>
28.362 + </target>
28.363 + <target name="-init-macrodef-junit">
28.364 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
28.365 + <attribute default="${includes}" name="includes"/>
28.366 + <attribute default="${excludes}" name="excludes"/>
28.367 + <attribute default="**" name="testincludes"/>
28.368 + <sequential>
28.369 + <property name="junit.forkmode" value="perTest"/>
28.370 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
28.371 + <batchtest todir="${build.test.results.dir}">
28.372 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
28.373 + <filename name="@{testincludes}"/>
28.374 + </fileset>
28.375 + </batchtest>
28.376 + <classpath>
28.377 + <path path="${run.test.classpath}"/>
28.378 + </classpath>
28.379 + <syspropertyset>
28.380 + <propertyref prefix="test-sys-prop."/>
28.381 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
28.382 + </syspropertyset>
28.383 + <formatter type="brief" usefile="false"/>
28.384 + <formatter type="xml"/>
28.385 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
28.386 + <jvmarg value="-ea"/>
28.387 + <jvmarg line="${run.jvmargs}"/>
28.388 + </junit>
28.389 + </sequential>
28.390 + </macrodef>
28.391 + </target>
28.392 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
28.393 + <target name="-profile-pre-init">
28.394 + <!-- Empty placeholder for easier customization. -->
28.395 + <!-- You can override this target in the ../build.xml file. -->
28.396 + </target>
28.397 + <target name="-profile-post-init">
28.398 + <!-- Empty placeholder for easier customization. -->
28.399 + <!-- You can override this target in the ../build.xml file. -->
28.400 + </target>
28.401 + <target name="-profile-init-macrodef-profile">
28.402 + <macrodef name="resolve">
28.403 + <attribute name="name"/>
28.404 + <attribute name="value"/>
28.405 + <sequential>
28.406 + <property name="@{name}" value="${env.@{value}}"/>
28.407 + </sequential>
28.408 + </macrodef>
28.409 + <macrodef name="profile">
28.410 + <attribute default="${main.class}" name="classname"/>
28.411 + <element name="customize" optional="true"/>
28.412 + <sequential>
28.413 + <property environment="env"/>
28.414 + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
28.415 + <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
28.416 + <jvmarg value="${profiler.info.jvmargs.agent}"/>
28.417 + <jvmarg line="${profiler.info.jvmargs}"/>
28.418 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
28.419 + <arg line="${application.args}"/>
28.420 + <classpath>
28.421 + <path path="${run.classpath}"/>
28.422 + </classpath>
28.423 + <syspropertyset>
28.424 + <propertyref prefix="run-sys-prop."/>
28.425 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
28.426 + </syspropertyset>
28.427 + <customize/>
28.428 + </java>
28.429 + </sequential>
28.430 + </macrodef>
28.431 + </target>
28.432 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
28.433 + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
28.434 + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
28.435 + </target>
28.436 + <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
28.437 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
28.438 + <attribute default="${main.class}" name="name"/>
28.439 + <attribute default="${debug.classpath}" name="classpath"/>
28.440 + <attribute default="" name="stopclassname"/>
28.441 + <sequential>
28.442 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
28.443 + <classpath>
28.444 + <path path="@{classpath}"/>
28.445 + </classpath>
28.446 + </nbjpdastart>
28.447 + </sequential>
28.448 + </macrodef>
28.449 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
28.450 + <attribute default="${build.classes.dir}" name="dir"/>
28.451 + <sequential>
28.452 + <nbjpdareload>
28.453 + <fileset dir="@{dir}" includes="${fix.classes}">
28.454 + <include name="${fix.includes}*.class"/>
28.455 + </fileset>
28.456 + </nbjpdareload>
28.457 + </sequential>
28.458 + </macrodef>
28.459 + </target>
28.460 + <target name="-init-debug-args">
28.461 + <property name="version-output" value="java version "${ant.java.version}"/>
28.462 + <condition property="have-jdk-older-than-1.4">
28.463 + <or>
28.464 + <contains string="${version-output}" substring="java version "1.0"/>
28.465 + <contains string="${version-output}" substring="java version "1.1"/>
28.466 + <contains string="${version-output}" substring="java version "1.2"/>
28.467 + <contains string="${version-output}" substring="java version "1.3"/>
28.468 + </or>
28.469 + </condition>
28.470 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
28.471 + <istrue value="${have-jdk-older-than-1.4}"/>
28.472 + </condition>
28.473 + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
28.474 + <os family="windows"/>
28.475 + </condition>
28.476 + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
28.477 + <isset property="debug.transport"/>
28.478 + </condition>
28.479 + </target>
28.480 + <target depends="-init-debug-args" name="-init-macrodef-debug">
28.481 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
28.482 + <attribute default="${main.class}" name="classname"/>
28.483 + <attribute default="${debug.classpath}" name="classpath"/>
28.484 + <element name="customize" optional="true"/>
28.485 + <sequential>
28.486 + <java classname="@{classname}" dir="${work.dir}" fork="true">
28.487 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
28.488 + <jvmarg line="${debug-args-line}"/>
28.489 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
28.490 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
28.491 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
28.492 + <jvmarg line="${run.jvmargs}"/>
28.493 + <classpath>
28.494 + <path path="@{classpath}"/>
28.495 + </classpath>
28.496 + <syspropertyset>
28.497 + <propertyref prefix="run-sys-prop."/>
28.498 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
28.499 + </syspropertyset>
28.500 + <customize/>
28.501 + </java>
28.502 + </sequential>
28.503 + </macrodef>
28.504 + </target>
28.505 + <target name="-init-macrodef-java">
28.506 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
28.507 + <attribute default="${main.class}" name="classname"/>
28.508 + <attribute default="${run.classpath}" name="classpath"/>
28.509 + <element name="customize" optional="true"/>
28.510 + <sequential>
28.511 + <java classname="@{classname}" dir="${work.dir}" fork="true">
28.512 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
28.513 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
28.514 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
28.515 + <jvmarg line="${run.jvmargs}"/>
28.516 + <classpath>
28.517 + <path path="@{classpath}"/>
28.518 + </classpath>
28.519 + <syspropertyset>
28.520 + <propertyref prefix="run-sys-prop."/>
28.521 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
28.522 + </syspropertyset>
28.523 + <customize/>
28.524 + </java>
28.525 + </sequential>
28.526 + </macrodef>
28.527 + </target>
28.528 + <target name="-init-macrodef-copylibs">
28.529 + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
28.530 + <attribute default="${manifest.file}" name="manifest"/>
28.531 + <element name="customize" optional="true"/>
28.532 + <sequential>
28.533 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
28.534 + <pathconvert property="run.classpath.without.build.classes.dir">
28.535 + <path path="${run.classpath}"/>
28.536 + <map from="${build.classes.dir.resolved}" to=""/>
28.537 + </pathconvert>
28.538 + <pathconvert pathsep=" " property="jar.classpath">
28.539 + <path path="${run.classpath.without.build.classes.dir}"/>
28.540 + <chainedmapper>
28.541 + <flattenmapper/>
28.542 + <globmapper from="*" to="lib/*"/>
28.543 + </chainedmapper>
28.544 + </pathconvert>
28.545 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
28.546 + <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}">
28.547 + <fileset dir="${build.classes.dir}"/>
28.548 + <manifest>
28.549 + <attribute name="Class-Path" value="${jar.classpath}"/>
28.550 + <customize/>
28.551 + </manifest>
28.552 + </copylibs>
28.553 + </sequential>
28.554 + </macrodef>
28.555 + </target>
28.556 + <target name="-init-presetdef-jar">
28.557 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
28.558 + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
28.559 + <j2seproject1:fileset dir="${build.classes.dir}"/>
28.560 + </jar>
28.561 + </presetdef>
28.562 + </target>
28.563 + <target name="-init-ap-cmdline-properties">
28.564 + <property name="annotation.processing.enabled" value="true"/>
28.565 + <property name="annotation.processing.processors.list" value=""/>
28.566 + <property name="annotation.processing.processor.options" value=""/>
28.567 + <property name="annotation.processing.run.all.processors" value="true"/>
28.568 + <property name="javac.processorpath" value="${javac.classpath}"/>
28.569 + <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
28.570 + <condition property="ap.supported.internal" value="true">
28.571 + <not>
28.572 + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
28.573 + </not>
28.574 + </condition>
28.575 + </target>
28.576 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
28.577 + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
28.578 + <isfalse value="${annotation.processing.run.all.processors}"/>
28.579 + </condition>
28.580 + <condition else="" property="ap.proc.none.internal" value="-proc:none">
28.581 + <isfalse value="${annotation.processing.enabled}"/>
28.582 + </condition>
28.583 + </target>
28.584 + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
28.585 + <property name="ap.cmd.line.internal" value=""/>
28.586 + </target>
28.587 + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
28.588 + <!--
28.589 + ===================
28.590 + COMPILATION SECTION
28.591 + ===================
28.592 + -->
28.593 + <target name="-deps-jar-init" unless="built-jar.properties">
28.594 + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
28.595 + <delete file="${built-jar.properties}" quiet="true"/>
28.596 + </target>
28.597 + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
28.598 + <echo level="warn" message="Cycle detected: usages.web.api was already built"/>
28.599 + </target>
28.600 + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
28.601 + <mkdir dir="${build.dir}"/>
28.602 + <touch file="${built-jar.properties}" verbose="false"/>
28.603 + <property file="${built-jar.properties}" prefix="already.built.jar."/>
28.604 + <antcall target="-warn-already-built-jar"/>
28.605 + <propertyfile file="${built-jar.properties}">
28.606 + <entry key="${basedir}" value=""/>
28.607 + </propertyfile>
28.608 + <antcall target="-maybe-call-dep">
28.609 + <param name="call.built.properties" value="${built-jar.properties}"/>
28.610 + <param location="${project.base_web_api}" name="call.subproject"/>
28.611 + <param location="${project.base_web_api}/build.xml" name="call.script"/>
28.612 + <param name="call.target" value="jar"/>
28.613 + <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
28.614 + </antcall>
28.615 + </target>
28.616 + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
28.617 + <target depends="init" name="-check-automatic-build">
28.618 + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
28.619 + </target>
28.620 + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
28.621 + <antcall target="clean"/>
28.622 + </target>
28.623 + <target depends="init,deps-jar" name="-pre-pre-compile">
28.624 + <mkdir dir="${build.classes.dir}"/>
28.625 + </target>
28.626 + <target name="-pre-compile">
28.627 + <!-- Empty placeholder for easier customization. -->
28.628 + <!-- You can override this target in the ../build.xml file. -->
28.629 + </target>
28.630 + <target if="do.depend.true" name="-compile-depend">
28.631 + <pathconvert property="build.generated.subdirs">
28.632 + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
28.633 + <include name="*"/>
28.634 + </dirset>
28.635 + </pathconvert>
28.636 + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
28.637 + </target>
28.638 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
28.639 + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
28.640 + <copy todir="${build.classes.dir}">
28.641 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
28.642 + </copy>
28.643 + </target>
28.644 + <target if="has.persistence.xml" name="-copy-persistence-xml">
28.645 + <mkdir dir="${build.classes.dir}/META-INF"/>
28.646 + <copy todir="${build.classes.dir}/META-INF">
28.647 + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
28.648 + </copy>
28.649 + </target>
28.650 + <target name="-post-compile">
28.651 + <!-- Empty placeholder for easier customization. -->
28.652 + <!-- You can override this target in the ../build.xml file. -->
28.653 + </target>
28.654 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
28.655 + <target name="-pre-compile-single">
28.656 + <!-- Empty placeholder for easier customization. -->
28.657 + <!-- You can override this target in the ../build.xml file. -->
28.658 + </target>
28.659 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
28.660 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
28.661 + <j2seproject3:force-recompile/>
28.662 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
28.663 + </target>
28.664 + <target name="-post-compile-single">
28.665 + <!-- Empty placeholder for easier customization. -->
28.666 + <!-- You can override this target in the ../build.xml file. -->
28.667 + </target>
28.668 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
28.669 + <!--
28.670 + ====================
28.671 + JAR BUILDING SECTION
28.672 + ====================
28.673 + -->
28.674 + <target depends="init" name="-pre-pre-jar">
28.675 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
28.676 + <mkdir dir="${dist.jar.dir}"/>
28.677 + </target>
28.678 + <target name="-pre-jar">
28.679 + <!-- Empty placeholder for easier customization. -->
28.680 + <!-- You can override this target in the ../build.xml file. -->
28.681 + </target>
28.682 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
28.683 + <j2seproject1:jar/>
28.684 + </target>
28.685 + <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">
28.686 + <j2seproject1:jar manifest="${manifest.file}"/>
28.687 + </target>
28.688 + <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">
28.689 + <j2seproject1:jar manifest="${manifest.file}">
28.690 + <j2seproject1:manifest>
28.691 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
28.692 + </j2seproject1:manifest>
28.693 + </j2seproject1:jar>
28.694 + <echo level="info">To run this application from the command line without Ant, try:</echo>
28.695 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
28.696 + <property location="${dist.jar}" name="dist.jar.resolved"/>
28.697 + <pathconvert property="run.classpath.with.dist.jar">
28.698 + <path path="${run.classpath}"/>
28.699 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
28.700 + </pathconvert>
28.701 + <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
28.702 + </target>
28.703 + <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
28.704 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
28.705 + <touch file="${tmp.manifest.file}" verbose="false"/>
28.706 + </target>
28.707 + <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
28.708 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
28.709 + <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
28.710 + </target>
28.711 + <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">
28.712 + <manifest file="${tmp.manifest.file}" mode="update">
28.713 + <attribute name="Main-Class" value="${main.class}"/>
28.714 + </manifest>
28.715 + </target>
28.716 + <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">
28.717 + <basename file="${application.splash}" property="splashscreen.basename"/>
28.718 + <mkdir dir="${build.classes.dir}/META-INF"/>
28.719 + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
28.720 + <manifest file="${tmp.manifest.file}" mode="update">
28.721 + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
28.722 + </manifest>
28.723 + </target>
28.724 + <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">
28.725 + <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
28.726 + <echo level="info">To run this application from the command line without Ant, try:</echo>
28.727 + <property location="${dist.jar}" name="dist.jar.resolved"/>
28.728 + <echo level="info">java -jar "${dist.jar.resolved}"</echo>
28.729 + </target>
28.730 + <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
28.731 + <delete>
28.732 + <fileset file="${tmp.manifest.file}"/>
28.733 + </delete>
28.734 + </target>
28.735 + <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"/>
28.736 + <target name="-post-jar">
28.737 + <!-- Empty placeholder for easier customization. -->
28.738 + <!-- You can override this target in the ../build.xml file. -->
28.739 + </target>
28.740 + <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"/>
28.741 + <!--
28.742 + =================
28.743 + EXECUTION SECTION
28.744 + =================
28.745 + -->
28.746 + <target depends="init,compile" description="Run a main class." name="run">
28.747 + <j2seproject1:java>
28.748 + <customize>
28.749 + <arg line="${application.args}"/>
28.750 + </customize>
28.751 + </j2seproject1:java>
28.752 + </target>
28.753 + <target name="-do-not-recompile">
28.754 + <property name="javac.includes.binary" value=""/>
28.755 + </target>
28.756 + <target depends="init,compile-single" name="run-single">
28.757 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
28.758 + <j2seproject1:java classname="${run.class}"/>
28.759 + </target>
28.760 + <target depends="init,compile-test-single" name="run-test-with-main">
28.761 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
28.762 + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
28.763 + </target>
28.764 + <!--
28.765 + =================
28.766 + DEBUGGING SECTION
28.767 + =================
28.768 + -->
28.769 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
28.770 + <j2seproject1:nbjpdastart name="${debug.class}"/>
28.771 + </target>
28.772 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
28.773 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
28.774 + </target>
28.775 + <target depends="init,compile" name="-debug-start-debuggee">
28.776 + <j2seproject3:debug>
28.777 + <customize>
28.778 + <arg line="${application.args}"/>
28.779 + </customize>
28.780 + </j2seproject3:debug>
28.781 + </target>
28.782 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
28.783 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
28.784 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
28.785 + </target>
28.786 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
28.787 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
28.788 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
28.789 + <j2seproject3:debug classname="${debug.class}"/>
28.790 + </target>
28.791 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
28.792 + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
28.793 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
28.794 + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
28.795 + </target>
28.796 + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
28.797 + <target depends="init" name="-pre-debug-fix">
28.798 + <fail unless="fix.includes">Must set fix.includes</fail>
28.799 + <property name="javac.includes" value="${fix.includes}.java"/>
28.800 + </target>
28.801 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
28.802 + <j2seproject1:nbjpdareload/>
28.803 + </target>
28.804 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
28.805 + <!--
28.806 + =================
28.807 + PROFILING SECTION
28.808 + =================
28.809 + -->
28.810 + <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
28.811 + <nbprofiledirect>
28.812 + <classpath>
28.813 + <path path="${run.classpath}"/>
28.814 + </classpath>
28.815 + </nbprofiledirect>
28.816 + <profile/>
28.817 + </target>
28.818 + <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
28.819 + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
28.820 + <nbprofiledirect>
28.821 + <classpath>
28.822 + <path path="${run.classpath}"/>
28.823 + </classpath>
28.824 + </nbprofiledirect>
28.825 + <profile classname="${profile.class}"/>
28.826 + </target>
28.827 + <!--
28.828 + =========================
28.829 + APPLET PROFILING SECTION
28.830 + =========================
28.831 + -->
28.832 + <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
28.833 + <nbprofiledirect>
28.834 + <classpath>
28.835 + <path path="${run.classpath}"/>
28.836 + </classpath>
28.837 + </nbprofiledirect>
28.838 + <profile classname="sun.applet.AppletViewer">
28.839 + <customize>
28.840 + <arg value="${applet.url}"/>
28.841 + </customize>
28.842 + </profile>
28.843 + </target>
28.844 + <!--
28.845 + =========================
28.846 + TESTS PROFILING SECTION
28.847 + =========================
28.848 + -->
28.849 + <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
28.850 + <nbprofiledirect>
28.851 + <classpath>
28.852 + <path path="${run.test.classpath}"/>
28.853 + </classpath>
28.854 + </nbprofiledirect>
28.855 + <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
28.856 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
28.857 + <jvmarg value="${profiler.info.jvmargs.agent}"/>
28.858 + <jvmarg line="${profiler.info.jvmargs}"/>
28.859 + <test name="${profile.class}"/>
28.860 + <classpath>
28.861 + <path path="${run.test.classpath}"/>
28.862 + </classpath>
28.863 + <syspropertyset>
28.864 + <propertyref prefix="test-sys-prop."/>
28.865 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
28.866 + </syspropertyset>
28.867 + <formatter type="brief" usefile="false"/>
28.868 + <formatter type="xml"/>
28.869 + </junit>
28.870 + </target>
28.871 + <!--
28.872 + ===============
28.873 + JAVADOC SECTION
28.874 + ===============
28.875 + -->
28.876 + <target depends="init" if="have.sources" name="-javadoc-build">
28.877 + <mkdir dir="${dist.javadoc.dir}"/>
28.878 + <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}">
28.879 + <classpath>
28.880 + <path path="${javac.classpath}"/>
28.881 + </classpath>
28.882 + <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
28.883 + <filename name="**/*.java"/>
28.884 + </fileset>
28.885 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
28.886 + <include name="**/*.java"/>
28.887 + <exclude name="*.java"/>
28.888 + </fileset>
28.889 + </javadoc>
28.890 + <copy todir="${dist.javadoc.dir}">
28.891 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
28.892 + <filename name="**/doc-files/**"/>
28.893 + </fileset>
28.894 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
28.895 + <include name="**/doc-files/**"/>
28.896 + </fileset>
28.897 + </copy>
28.898 + </target>
28.899 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
28.900 + <nbbrowse file="${dist.javadoc.dir}/index.html"/>
28.901 + </target>
28.902 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
28.903 + <!--
28.904 + =========================
28.905 + JUNIT COMPILATION SECTION
28.906 + =========================
28.907 + -->
28.908 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
28.909 + <mkdir dir="${build.test.classes.dir}"/>
28.910 + </target>
28.911 + <target name="-pre-compile-test">
28.912 + <!-- Empty placeholder for easier customization. -->
28.913 + <!-- You can override this target in the ../build.xml file. -->
28.914 + </target>
28.915 + <target if="do.depend.true" name="-compile-test-depend">
28.916 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
28.917 + </target>
28.918 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
28.919 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
28.920 + <copy todir="${build.test.classes.dir}">
28.921 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
28.922 + </copy>
28.923 + </target>
28.924 + <target name="-post-compile-test">
28.925 + <!-- Empty placeholder for easier customization. -->
28.926 + <!-- You can override this target in the ../build.xml file. -->
28.927 + </target>
28.928 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
28.929 + <target name="-pre-compile-test-single">
28.930 + <!-- Empty placeholder for easier customization. -->
28.931 + <!-- You can override this target in the ../build.xml file. -->
28.932 + </target>
28.933 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
28.934 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
28.935 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
28.936 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
28.937 + <copy todir="${build.test.classes.dir}">
28.938 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
28.939 + </copy>
28.940 + </target>
28.941 + <target name="-post-compile-test-single">
28.942 + <!-- Empty placeholder for easier customization. -->
28.943 + <!-- You can override this target in the ../build.xml file. -->
28.944 + </target>
28.945 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
28.946 + <!--
28.947 + =======================
28.948 + JUNIT EXECUTION SECTION
28.949 + =======================
28.950 + -->
28.951 + <target depends="init" if="have.tests" name="-pre-test-run">
28.952 + <mkdir dir="${build.test.results.dir}"/>
28.953 + </target>
28.954 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
28.955 + <j2seproject3:junit testincludes="**/*Test.java"/>
28.956 + </target>
28.957 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
28.958 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
28.959 + </target>
28.960 + <target depends="init" if="have.tests" name="test-report"/>
28.961 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
28.962 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
28.963 + <target depends="init" if="have.tests" name="-pre-test-run-single">
28.964 + <mkdir dir="${build.test.results.dir}"/>
28.965 + </target>
28.966 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
28.967 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
28.968 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
28.969 + </target>
28.970 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
28.971 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
28.972 + </target>
28.973 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
28.974 + <!--
28.975 + =======================
28.976 + JUNIT DEBUGGING SECTION
28.977 + =======================
28.978 + -->
28.979 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
28.980 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
28.981 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
28.982 + <delete file="${test.report.file}"/>
28.983 + <mkdir dir="${build.test.results.dir}"/>
28.984 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
28.985 + <customize>
28.986 + <syspropertyset>
28.987 + <propertyref prefix="test-sys-prop."/>
28.988 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
28.989 + </syspropertyset>
28.990 + <arg value="${test.class}"/>
28.991 + <arg value="showoutput=true"/>
28.992 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
28.993 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
28.994 + </customize>
28.995 + </j2seproject3:debug>
28.996 + </target>
28.997 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
28.998 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
28.999 + </target>
28.1000 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
28.1001 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
28.1002 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
28.1003 + </target>
28.1004 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
28.1005 + <!--
28.1006 + =========================
28.1007 + APPLET EXECUTION SECTION
28.1008 + =========================
28.1009 + -->
28.1010 + <target depends="init,compile-single" name="run-applet">
28.1011 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
28.1012 + <j2seproject1:java classname="sun.applet.AppletViewer">
28.1013 + <customize>
28.1014 + <arg value="${applet.url}"/>
28.1015 + </customize>
28.1016 + </j2seproject1:java>
28.1017 + </target>
28.1018 + <!--
28.1019 + =========================
28.1020 + APPLET DEBUGGING SECTION
28.1021 + =========================
28.1022 + -->
28.1023 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
28.1024 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
28.1025 + <j2seproject3:debug classname="sun.applet.AppletViewer">
28.1026 + <customize>
28.1027 + <arg value="${applet.url}"/>
28.1028 + </customize>
28.1029 + </j2seproject3:debug>
28.1030 + </target>
28.1031 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
28.1032 + <!--
28.1033 + ===============
28.1034 + CLEANUP SECTION
28.1035 + ===============
28.1036 + -->
28.1037 + <target name="-deps-clean-init" unless="built-clean.properties">
28.1038 + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
28.1039 + <delete file="${built-clean.properties}" quiet="true"/>
28.1040 + </target>
28.1041 + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
28.1042 + <echo level="warn" message="Cycle detected: usages.web.api was already built"/>
28.1043 + </target>
28.1044 + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
28.1045 + <mkdir dir="${build.dir}"/>
28.1046 + <touch file="${built-clean.properties}" verbose="false"/>
28.1047 + <property file="${built-clean.properties}" prefix="already.built.clean."/>
28.1048 + <antcall target="-warn-already-built-clean"/>
28.1049 + <propertyfile file="${built-clean.properties}">
28.1050 + <entry key="${basedir}" value=""/>
28.1051 + </propertyfile>
28.1052 + <antcall target="-maybe-call-dep">
28.1053 + <param name="call.built.properties" value="${built-clean.properties}"/>
28.1054 + <param location="${project.base_web_api}" name="call.subproject"/>
28.1055 + <param location="${project.base_web_api}/build.xml" name="call.script"/>
28.1056 + <param name="call.target" value="clean"/>
28.1057 + <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
28.1058 + </antcall>
28.1059 + </target>
28.1060 + <target depends="init" name="-do-clean">
28.1061 + <delete dir="${build.dir}"/>
28.1062 + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
28.1063 + </target>
28.1064 + <target name="-post-clean">
28.1065 + <!-- Empty placeholder for easier customization. -->
28.1066 + <!-- You can override this target in the ../build.xml file. -->
28.1067 + </target>
28.1068 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
28.1069 + <target name="-check-call-dep">
28.1070 + <property file="${call.built.properties}" prefix="already.built."/>
28.1071 + <condition property="should.call.dep">
28.1072 + <not>
28.1073 + <isset property="already.built.${call.subproject}"/>
28.1074 + </not>
28.1075 + </condition>
28.1076 + </target>
28.1077 + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
28.1078 + <ant antfile="${call.script}" inheritall="false" target="${call.target}">
28.1079 + <propertyset>
28.1080 + <propertyref prefix="transfer."/>
28.1081 + <mapper from="transfer.*" to="*" type="glob"/>
28.1082 + </propertyset>
28.1083 + </ant>
28.1084 + </target>
28.1085 +</project>
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/remoting/server/web/usages.web.api/nbproject/genfiles.properties Mon Jun 27 18:32:08 2011 +0200
29.3 @@ -0,0 +1,8 @@
29.4 +build.xml.data.CRC32=9115199c
29.5 +build.xml.script.CRC32=3bd67ab1
29.6 +build.xml.stylesheet.CRC32=28e38971@1.45.0.45
29.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
29.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
29.9 +nbproject/build-impl.xml.data.CRC32=9115199c
29.10 +nbproject/build-impl.xml.script.CRC32=9cf559ef
29.11 +nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/remoting/server/web/usages.web.api/nbproject/project.properties Mon Jun 27 18:32:08 2011 +0200
30.3 @@ -0,0 +1,82 @@
30.4 +annotation.processing.enabled=true
30.5 +annotation.processing.enabled.in.editor=false
30.6 +annotation.processing.processor.options=
30.7 +annotation.processing.processors.list=
30.8 +annotation.processing.run.all.processors=true
30.9 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
30.10 +build.classes.dir=${build.dir}/classes
30.11 +build.classes.excludes=**/*.java,**/*.form
30.12 +# This directory is removed when the project is cleaned:
30.13 +build.dir=build
30.14 +build.generated.dir=${build.dir}/generated
30.15 +build.generated.sources.dir=${build.dir}/generated-sources
30.16 +# Only compile against the classpath explicitly listed here:
30.17 +build.sysclasspath=ignore
30.18 +build.test.classes.dir=${build.dir}/test/classes
30.19 +build.test.results.dir=${build.dir}/test/results
30.20 +# Uncomment to specify the preferred debugger connection transport:
30.21 +#debug.transport=dt_socket
30.22 +debug.classpath=\
30.23 + ${run.classpath}
30.24 +debug.test.classpath=\
30.25 + ${run.test.classpath}
30.26 +# This directory is removed when the project is cleaned:
30.27 +dist.dir=dist
30.28 +dist.jar=${dist.dir}/usages.web.api.jar
30.29 +dist.javadoc.dir=${dist.dir}/javadoc
30.30 +excludes=
30.31 +file.reference.org-netbeans-modules-parsing-api.jar=../../../../server/lib/org-netbeans-modules-parsing-api.jar
30.32 +file.reference.org-netbeans-modules-parsing-lucene.jar=../../../../server/lib/org-netbeans-modules-parsing-lucene.jar
30.33 +file.reference.org-openide-filesystems.jar=../../../../server/lib/org-openide-filesystems.jar
30.34 +includes=**
30.35 +jar.compress=false
30.36 +javac.classpath=\
30.37 + ${libs.jersey.classpath}:\
30.38 + ${libs.lucene.classpath}:\
30.39 + ${reference.base_web_api.jar}:\
30.40 + ${file.reference.org-netbeans-modules-parsing-api.jar}:\
30.41 + ${file.reference.org-openide-filesystems.jar}:\
30.42 + ${file.reference.org-netbeans-modules-parsing-lucene.jar}
30.43 +# Space-separated list of extra javac options
30.44 +javac.compilerargs=
30.45 +javac.deprecation=false
30.46 +javac.processorpath=\
30.47 + ${javac.classpath}
30.48 +javac.source=1.6
30.49 +javac.target=1.6
30.50 +javac.test.classpath=\
30.51 + ${javac.classpath}:\
30.52 + ${build.classes.dir}
30.53 +javac.test.processorpath=\
30.54 + ${javac.test.classpath}
30.55 +javadoc.additionalparam=
30.56 +javadoc.author=false
30.57 +javadoc.encoding=${source.encoding}
30.58 +javadoc.noindex=false
30.59 +javadoc.nonavbar=false
30.60 +javadoc.notree=false
30.61 +javadoc.private=false
30.62 +javadoc.splitindex=true
30.63 +javadoc.use=true
30.64 +javadoc.version=false
30.65 +javadoc.windowtitle=
30.66 +main.class=
30.67 +manifest.file=manifest.mf
30.68 +meta.inf.dir=${src.dir}/META-INF
30.69 +mkdist.disabled=false
30.70 +platform.active=default_platform
30.71 +project.base_web_api=../base.web.api
30.72 +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
30.73 +run.classpath=\
30.74 + ${javac.classpath}:\
30.75 + ${build.classes.dir}
30.76 +# Space-separated list of JVM arguments used when running the project
30.77 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
30.78 +# or test-sys-prop.name=value to set system properties for unit tests):
30.79 +run.jvmargs=
30.80 +run.test.classpath=\
30.81 + ${javac.test.classpath}:\
30.82 + ${build.test.classes.dir}
30.83 +source.encoding=UTF-8
30.84 +src.dir=src
30.85 +test.src.dir=test
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/remoting/server/web/usages.web.api/nbproject/project.xml Mon Jun 27 18:32:08 2011 +0200
31.3 @@ -0,0 +1,28 @@
31.4 +<?xml version="1.0" encoding="UTF-8"?>
31.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
31.6 + <type>org.netbeans.modules.java.j2seproject</type>
31.7 + <configuration>
31.8 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
31.9 + <name>usages.web.api</name>
31.10 + <source-roots>
31.11 + <root id="src.dir"/>
31.12 + </source-roots>
31.13 + <test-roots>
31.14 + <root id="test.src.dir"/>
31.15 + </test-roots>
31.16 + </data>
31.17 + <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
31.18 + <definitions>../../../../server/lib/nblibraries.properties</definitions>
31.19 + </libraries>
31.20 + <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
31.21 + <reference>
31.22 + <foreign-project>base_web_api</foreign-project>
31.23 + <artifact-type>jar</artifact-type>
31.24 + <script>build.xml</script>
31.25 + <target>jar</target>
31.26 + <clean-target>clean</clean-target>
31.27 + <id>jar</id>
31.28 + </reference>
31.29 + </references>
31.30 + </configuration>
31.31 +</project>
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
32.2 +++ b/remoting/server/web/usages.web.api/src/org/netbeans/modules/jackpot30/backend/usages/api/API.java Mon Jun 27 18:32:08 2011 +0200
32.3 @@ -0,0 +1,107 @@
32.4 +/*
32.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
32.6 + *
32.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
32.8 + *
32.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
32.10 + * Other names may be trademarks of their respective owners.
32.11 + *
32.12 + * The contents of this file are subject to the terms of either the GNU
32.13 + * General Public License Version 2 only ("GPL") or the Common
32.14 + * Development and Distribution License("CDDL") (collectively, the
32.15 + * "License"). You may not use this file except in compliance with the
32.16 + * License. You can obtain a copy of the License at
32.17 + * http://www.netbeans.org/cddl-gplv2.html
32.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
32.19 + * specific language governing permissions and limitations under the
32.20 + * License. When distributing the software, include this License Header
32.21 + * Notice in each file and include the License file at
32.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
32.23 + * particular file as subject to the "Classpath" exception as provided
32.24 + * by Oracle in the GPL Version 2 section of the License file that
32.25 + * accompanied this code. If applicable, add the following below the
32.26 + * License Header, with the fields enclosed by brackets [] replaced by
32.27 + * your own identifying information:
32.28 + * "Portions Copyrighted [year] [name of copyright owner]"
32.29 + *
32.30 + * If you wish your version of this file to be governed by only the CDDL
32.31 + * or only the GPL Version 2, indicate your decision by adding
32.32 + * "[Contributor] elects to include this software in this distribution
32.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
32.34 + * single choice of license, a recipient has the option to distribute
32.35 + * your version of this file under either the CDDL, the GPL Version 2 or
32.36 + * to extend the choice of license to its licensees as provided above.
32.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
32.38 + * Version 2 license, then the option applies only if the new code is
32.39 + * made subject to such option by the copyright holder.
32.40 + *
32.41 + * Contributor(s):
32.42 + *
32.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
32.44 + */
32.45 +package org.netbeans.modules.jackpot30.backend.usages.api;
32.46 +
32.47 +import java.io.IOException;
32.48 +import java.net.URL;
32.49 +import java.util.logging.Level;
32.50 +import java.util.logging.Logger;
32.51 +import javax.ws.rs.GET;
32.52 +import javax.ws.rs.Path;
32.53 +import javax.ws.rs.Produces;
32.54 +import javax.ws.rs.QueryParam;
32.55 +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
32.56 +import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
32.57 +import org.netbeans.modules.parsing.lucene.support.DocumentIndex;
32.58 +import org.netbeans.modules.parsing.lucene.support.IndexDocument;
32.59 +import org.netbeans.modules.parsing.lucene.support.IndexManager;
32.60 +import org.netbeans.modules.parsing.lucene.support.Queries.QueryKind;
32.61 +import org.openide.filesystems.FileObject;
32.62 +import org.openide.filesystems.FileUtil;
32.63 +
32.64 +/**
32.65 + *
32.66 + * @author lahvac
32.67 + */
32.68 +@Path("/index/usages")
32.69 +public class API {
32.70 +
32.71 + private static final String KEY_SIGNATURES = "signatures";
32.72 +
32.73 + @GET
32.74 + @Path("/search")
32.75 + @Produces("text/plain")
32.76 + public String search(@QueryParam("path") String segment, @QueryParam("signatures") String signatures) throws IOException {
32.77 + StringBuilder result = new StringBuilder();
32.78 + CategoryStorage srcRoots = CategoryStorage.forId(segment);
32.79 +
32.80 + for (URL srcRoot : srcRoots.getCategoryIndexFolders()) {
32.81 + DocumentIndex idx = null;
32.82 +
32.83 + try {
32.84 + if (!"rel".equals(srcRoot.getProtocol())) continue;
32.85 +
32.86 + FileObject dataFolder = CacheFolder.getDataFolder(srcRoot).getFileObject("javausages/1");//XXX: don't hardcode the constants!
32.87 +
32.88 + if (dataFolder == null) continue;
32.89 +
32.90 + idx = IndexManager.createDocumentIndex(FileUtil.toFile(dataFolder));
32.91 +
32.92 + idx.getStatus(); //XXX: to initialize the index
32.93 +
32.94 + for (IndexDocument d : idx.query(KEY_SIGNATURES, signatures, QueryKind.EXACT)) {
32.95 + result.append(srcRoot.toString().substring("rel:/".length()));
32.96 + result.append(d.getPrimaryKey());
32.97 + result.append("\n");
32.98 + }
32.99 + } catch (InterruptedException ex) {
32.100 + Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
32.101 + } finally {
32.102 + if (idx != null) {
32.103 + idx.close();
32.104 + }
32.105 + }
32.106 + }
32.107 +
32.108 + return result.toString();
32.109 + }
32.110 +}
33.1 --- a/remoting/server/web/web.main/nbproject/build-impl.xml Mon Jun 27 18:32:06 2011 +0200
33.2 +++ b/remoting/server/web/web.main/nbproject/build-impl.xml Mon Jun 27 18:32:08 2011 +0200
33.3 @@ -623,6 +623,13 @@
33.4 <param name="call.target" value="jar"/>
33.5 <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
33.6 </antcall>
33.7 + <antcall target="-maybe-call-dep">
33.8 + <param name="call.built.properties" value="${built-jar.properties}"/>
33.9 + <param location="${project.usages_web_api}" name="call.subproject"/>
33.10 + <param location="${project.usages_web_api}/build.xml" name="call.script"/>
33.11 + <param name="call.target" value="jar"/>
33.12 + <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
33.13 + </antcall>
33.14 </target>
33.15 <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
33.16 <target depends="init" name="-check-automatic-build">
33.17 @@ -1081,6 +1088,13 @@
33.18 <param name="call.target" value="clean"/>
33.19 <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
33.20 </antcall>
33.21 + <antcall target="-maybe-call-dep">
33.22 + <param name="call.built.properties" value="${built-clean.properties}"/>
33.23 + <param location="${project.usages_web_api}" name="call.subproject"/>
33.24 + <param location="${project.usages_web_api}/build.xml" name="call.script"/>
33.25 + <param name="call.target" value="clean"/>
33.26 + <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
33.27 + </antcall>
33.28 </target>
33.29 <target depends="init" name="-do-clean">
33.30 <delete dir="${build.dir}"/>
34.1 --- a/remoting/server/web/web.main/nbproject/genfiles.properties Mon Jun 27 18:32:06 2011 +0200
34.2 +++ b/remoting/server/web/web.main/nbproject/genfiles.properties Mon Jun 27 18:32:08 2011 +0200
34.3 @@ -1,8 +1,8 @@
34.4 -build.xml.data.CRC32=9cd5904e
34.5 +build.xml.data.CRC32=770a9613
34.6 build.xml.script.CRC32=5ddf268c
34.7 build.xml.stylesheet.CRC32=28e38971@1.45.0.45
34.8 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
34.9 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
34.10 -nbproject/build-impl.xml.data.CRC32=9cd5904e
34.11 -nbproject/build-impl.xml.script.CRC32=b4b72cb0
34.12 +nbproject/build-impl.xml.data.CRC32=770a9613
34.13 +nbproject/build-impl.xml.script.CRC32=15e99f57
34.14 nbproject/build-impl.xml.stylesheet.CRC32=cfcde7f8@1.45.0.45
35.1 --- a/remoting/server/web/web.main/nbproject/project.properties Mon Jun 27 18:32:06 2011 +0200
35.2 +++ b/remoting/server/web/web.main/nbproject/project.properties Mon Jun 27 18:32:08 2011 +0200
35.3 @@ -67,7 +67,8 @@
35.4 ${file.reference.org-openide-util.jar}:\
35.5 ${file.reference.util-commons.jar}:\
35.6 ${file.reference.util-pojson.jar}:\
35.7 - ${reference.source_web_api.jar}
35.8 + ${reference.source_web_api.jar}:\
35.9 + ${reference.usages_web_api.jar}
35.10 # Space-separated list of extra javac options
35.11 javac.compilerargs=
35.12 javac.deprecation=false
35.13 @@ -100,9 +101,11 @@
35.14 project.base_web_api=../base.web.api
35.15 project.source_web_api=../source.web.api
35.16 project.type_web_api=../type.web.api
35.17 +project.usages_web_api=../usages.web.api
35.18 reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
35.19 reference.source_web_api.jar=${project.source_web_api}/dist/source.web.api.jar
35.20 reference.type_web_api.jar=${project.type_web_api}/dist/type.web.api.jar
35.21 +reference.usages_web_api.jar=${project.usages_web_api}/dist/usages.web.api.jar
35.22 run.classpath=\
35.23 ${javac.classpath}:\
35.24 ${build.classes.dir}
36.1 --- a/remoting/server/web/web.main/nbproject/project.xml Mon Jun 27 18:32:06 2011 +0200
36.2 +++ b/remoting/server/web/web.main/nbproject/project.xml Mon Jun 27 18:32:08 2011 +0200
36.3 @@ -39,6 +39,14 @@
36.4 <clean-target>clean</clean-target>
36.5 <id>jar</id>
36.6 </reference>
36.7 + <reference>
36.8 + <foreign-project>usages_web_api</foreign-project>
36.9 + <artifact-type>jar</artifact-type>
36.10 + <script>build.xml</script>
36.11 + <target>jar</target>
36.12 + <clean-target>clean</clean-target>
36.13 + <id>jar</id>
36.14 + </reference>
36.15 </references>
36.16 </configuration>
36.17 </project>