Automated merge with http://hg.netbeans.org/main/contrib
authorTomas Zezula <tzezula@netbeans.org>
Tue, 28 Jan 2014 22:00:22 +0100
changeset 1812403e0b3965817
parent 18121 363fb381d03f
parent 18123 d383d631bbd4
child 18125 0d69935534b3
Automated merge with http://hg.netbeans.org/main/contrib
dew4nb/src/org/netbeans/modules/dew4nb/services/javac/TypeHandler.java
dew4nb/src/org/netbeans/modules/dew4nb/services/javac/debugger/AttachHandler.java
dew4nb/src/org/netbeans/modules/dew4nb/services/javac/debugger/DebugerModels.java
dew4nb/src/org/netbeans/modules/dew4nb/services/javac/debugger/SetBreakpointsHandler.java
dew4nb/src/org/netbeans/modules/dew4nb/services/project/GetFileContentHandler.java
     1.1 --- a/dew4nb/nbproject/project.xml	Tue Jan 28 11:07:53 2014 +0100
     1.2 +++ b/dew4nb/nbproject/project.xml	Tue Jan 28 22:00:22 2014 +0100
     1.3 @@ -15,6 +15,24 @@
     1.4                      </run-dependency>
     1.5                  </dependency>
     1.6                  <dependency>
     1.7 +                    <code-name-base>org.netbeans.api.debugger</code-name-base>
     1.8 +                    <build-prerequisite/>
     1.9 +                    <compile-dependency/>
    1.10 +                    <run-dependency>
    1.11 +                        <release-version>1</release-version>
    1.12 +                        <specification-version>1.45</specification-version>
    1.13 +                    </run-dependency>
    1.14 +                </dependency>
    1.15 +                <dependency>
    1.16 +                    <code-name-base>org.netbeans.api.debugger.jpda</code-name-base>
    1.17 +                    <build-prerequisite/>
    1.18 +                    <compile-dependency/>
    1.19 +                    <run-dependency>
    1.20 +                        <release-version>2</release-version>
    1.21 +                        <specification-version>2.48</specification-version>
    1.22 +                    </run-dependency>
    1.23 +                </dependency>
    1.24 +                <dependency>
    1.25                      <code-name-base>org.netbeans.api.java.classpath</code-name-base>
    1.26                      <build-prerequisite/>
    1.27                      <compile-dependency/>
    1.28 @@ -32,6 +50,15 @@
    1.29                      </run-dependency>
    1.30                  </dependency>
    1.31                  <dependency>
    1.32 +                    <code-name-base>org.netbeans.modules.debugger.jpda</code-name-base>
    1.33 +                    <build-prerequisite/>
    1.34 +                    <compile-dependency/>
    1.35 +                    <run-dependency>
    1.36 +                        <release-version>2</release-version>
    1.37 +                        <implementation-version/>
    1.38 +                    </run-dependency>
    1.39 +                </dependency>
    1.40 +                <dependency>
    1.41                      <code-name-base>org.netbeans.modules.editor.completion</code-name-base>
    1.42                      <build-prerequisite/>
    1.43                      <compile-dependency/>
     2.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/SourceProvider.java	Tue Jan 28 11:07:53 2014 +0100
     2.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/SourceProvider.java	Tue Jan 28 22:00:22 2014 +0100
     2.3 @@ -59,7 +59,6 @@
     2.4  import org.netbeans.api.annotations.common.CheckForNull;
     2.5  import org.netbeans.api.annotations.common.NonNull;
     2.6  import org.netbeans.api.annotations.common.NullAllowed;
     2.7 -import org.netbeans.modules.dew4nb.services.javac.Context;
     2.8  import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
     2.9  import org.netbeans.modules.parsing.api.Source;
    2.10  import org.openide.cookies.EditorCookie;
    2.11 @@ -106,7 +105,7 @@
    2.12  
    2.13      @CheckForNull
    2.14      public Source getSource(
    2.15 -            @NullAllowed Context ctx,
    2.16 +            @NullAllowed WorkspaceResolver.Context ctx,
    2.17              @NullAllowed String content) {
    2.18          FileObject file = null;
    2.19          if (ctx != null) {
    2.20 @@ -114,10 +113,7 @@
    2.21              if (resolver == null) {
    2.22                  LOG.warning("No WorkspaceResolver in Lookup."); //NOI18N
    2.23              } else {
    2.24 -                file = resolver.resolveFile(new WorkspaceResolver.Context(
    2.25 -                    ctx.getUser(),
    2.26 -                    ctx.getWorkspace(),
    2.27 -                    ctx.getPath()));                
    2.28 +                file = resolver.resolveFile(ctx);
    2.29              }
    2.30          }
    2.31          boolean tmpFile = false;
     3.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/api/Server.java	Tue Jan 28 11:07:53 2014 +0100
     3.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/api/Server.java	Tue Jan 28 22:00:22 2014 +0100
     3.3 @@ -73,7 +73,9 @@
     3.4   */
     3.5  public final class Server {
     3.6  
     3.7 -    private final static Charset UTF8 = Charset.forName("UTF-8");  //NOI18N
     3.8 +    private static final Charset UTF8 = Charset.forName("UTF-8");  //NOI18N
     3.9 +    private static final int MAX_CHANNEL_LEN = 256;
    3.10 +    private static final char CHANNEL_SEPARATOR = '|';  //NOI18N
    3.11      private final HttpServer http;
    3.12  
    3.13      private Server(
    3.14 @@ -182,15 +184,26 @@
    3.15  
    3.16          @Override
    3.17          public void onMessage(WebSocket socket, String text) {
    3.18 -            final EndPoint ep = registry.getEndPoint("javac");
    3.19 +            int index = -1;
    3.20 +            for (int i = 0; i < MAX_CHANNEL_LEN; i++) {
    3.21 +                if (text.charAt(i) == CHANNEL_SEPARATOR) {
    3.22 +                    index = i;
    3.23 +                    break;
    3.24 +                }
    3.25 +            }
    3.26              Status status = Status.not_found;
    3.27              Exception ex = null;
    3.28 -            if (ep != null) {
    3.29 -                try {
    3.30 -                    status = ep.handle(socket, text);
    3.31 -                } catch (Exception e) {
    3.32 -                    status = Status.runtime_error;
    3.33 -                    ex = e;
    3.34 +            if (index > 0) {
    3.35 +                final String channel = text.substring(0, index);
    3.36 +                final String message = text.substring(index+1);
    3.37 +                final EndPoint ep = registry.getEndPoint(channel);
    3.38 +                if (ep != null) {
    3.39 +                    try {
    3.40 +                        status = ep.handle(socket, message);
    3.41 +                    } catch (Exception e) {
    3.42 +                        status = Status.runtime_error;
    3.43 +                        ex = e;
    3.44 +                    }
    3.45                  }
    3.46              }
    3.47              if (!status.isSuccess()) {
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ActiveSessions.java	Tue Jan 28 22:00:22 2014 +0100
     4.3 @@ -0,0 +1,133 @@
     4.4 +/*
     4.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4.6 + *
     4.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
     4.8 + *
     4.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    4.10 + * Other names may be trademarks of their respective owners.
    4.11 + *
    4.12 + * The contents of this file are subject to the terms of either the GNU
    4.13 + * General Public License Version 2 only ("GPL") or the Common
    4.14 + * Development and Distribution License("CDDL") (collectively, the
    4.15 + * "License"). You may not use this file except in compliance with the
    4.16 + * License. You can obtain a copy of the License at
    4.17 + * http://www.netbeans.org/cddl-gplv2.html
    4.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    4.19 + * specific language governing permissions and limitations under the
    4.20 + * License.  When distributing the software, include this License Header
    4.21 + * Notice in each file and include the License file at
    4.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    4.23 + * particular file as subject to the "Classpath" exception as provided
    4.24 + * by Oracle in the GPL Version 2 section of the License file that
    4.25 + * accompanied this code. If applicable, add the following below the
    4.26 + * License Header, with the fields enclosed by brackets [] replaced by
    4.27 + * your own identifying information:
    4.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    4.29 + *
    4.30 + * If you wish your version of this file to be governed by only the CDDL
    4.31 + * or only the GPL Version 2, indicate your decision by adding
    4.32 + * "[Contributor] elects to include this software in this distribution
    4.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    4.34 + * single choice of license, a recipient has the option to distribute
    4.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    4.36 + * to extend the choice of license to its licensees as provided above.
    4.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    4.38 + * Version 2 license, then the option applies only if the new code is
    4.39 + * made subject to such option by the copyright holder.
    4.40 + *
    4.41 + * Contributor(s):
    4.42 + *
    4.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
    4.44 + */
    4.45 +
    4.46 +package org.netbeans.modules.dew4nb.services.debugger;
    4.47 +
    4.48 +import java.util.concurrent.ConcurrentHashMap;
    4.49 +import java.util.concurrent.ConcurrentMap;
    4.50 +import java.util.concurrent.atomic.AtomicInteger;
    4.51 +import org.netbeans.api.annotations.common.CheckForNull;
    4.52 +import org.netbeans.api.annotations.common.NonNull;
    4.53 +import org.netbeans.api.debugger.DebuggerManager;
    4.54 +import org.netbeans.api.debugger.Session;
    4.55 +import org.netbeans.modules.dew4nb.endpoint.EndPoint;
    4.56 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
    4.57 +import org.openide.util.Parameters;
    4.58 +
    4.59 +/**
    4.60 + *
    4.61 + * @author Tomas Zezula
    4.62 + */
    4.63 +final class ActiveSessions {
    4.64 +
    4.65 +    //@GuardedBy("ActiveSessions.class")
    4.66 +    private static ActiveSessions instance;
    4.67 +
    4.68 +    private final ConcurrentMap<Integer,Data> active;
    4.69 +    private final AtomicInteger sequencer;
    4.70 +
    4.71 +    private ActiveSessions() {
    4.72 +        this.active = new ConcurrentHashMap<>();
    4.73 +        this.sequencer = new AtomicInteger();
    4.74 +    }
    4.75 +
    4.76 +
    4.77 +    int createSession(
    4.78 +            @NonNull final WorkspaceResolver.Context context,
    4.79 +            @NonNull final EndPoint.Env env) {
    4.80 +        Parameters.notNull("context", context); //NOI18N
    4.81 +        Parameters.notNull("env", env); //NOI18N
    4.82 +        final int id = sequencer.incrementAndGet();
    4.83 +        final Session session = DebuggerManager.getDebuggerManager().getCurrentSession();
    4.84 +        if (active.putIfAbsent(id, new Data(context, env, session)) != null) {
    4.85 +            throw new IllegalStateException("Trying to reuse active session");  //NOI18N
    4.86 +        }
    4.87 +        return id;
    4.88 +    }
    4.89 +
    4.90 +    @CheckForNull
    4.91 +    WorkspaceResolver.Context getContext(final int sessionId) {
    4.92 +        final Data data = active.get(sessionId);
    4.93 +        return data == null ? null : data.ctx;
    4.94 +    }
    4.95 +
    4.96 +    @CheckForNull
    4.97 +    EndPoint.Env getEnv(final int sessionId) {
    4.98 +        final Data data = active.get(sessionId);
    4.99 +        return data == null ? null : data.env;
   4.100 +    }
   4.101 +
   4.102 +    @CheckForNull
   4.103 +    Session getDebugSession(final int sessionId) {
   4.104 +        final Data data = active.get(sessionId);
   4.105 +        return data == null ? null : data.session;
   4.106 +    }
   4.107 +
   4.108 +
   4.109 +    @NonNull
   4.110 +    static synchronized ActiveSessions getInstance() {
   4.111 +        if (instance == null) {
   4.112 +            instance = new ActiveSessions();
   4.113 +        }
   4.114 +        return instance;
   4.115 +    }
   4.116 +
   4.117 +    private static final class Data {
   4.118 +        final WorkspaceResolver.Context ctx;
   4.119 +        final EndPoint.Env env;
   4.120 +        final Session session;
   4.121 +
   4.122 +
   4.123 +        private Data(
   4.124 +            @NonNull final WorkspaceResolver.Context ctx,
   4.125 +            @NonNull final EndPoint.Env env,
   4.126 +            @NonNull final Session session) {
   4.127 +            Parameters.notNull("ctx", ctx); //NOI18N
   4.128 +            Parameters.notNull("env", env); //NOI18N
   4.129 +            Parameters.notNull("session", session); //NOI18N
   4.130 +            this.ctx = ctx;
   4.131 +            this.env = env;
   4.132 +            this.session = session;
   4.133 +        }
   4.134 +    }
   4.135 +
   4.136 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/AttachHandler.java	Tue Jan 28 22:00:22 2014 +0100
     5.3 @@ -0,0 +1,118 @@
     5.4 +/*
     5.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     5.6 + *
     5.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
     5.8 + *
     5.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    5.10 + * Other names may be trademarks of their respective owners.
    5.11 + *
    5.12 + * The contents of this file are subject to the terms of either the GNU
    5.13 + * General Public License Version 2 only ("GPL") or the Common
    5.14 + * Development and Distribution License("CDDL") (collectively, the
    5.15 + * "License"). You may not use this file except in compliance with the
    5.16 + * License. You can obtain a copy of the License at
    5.17 + * http://www.netbeans.org/cddl-gplv2.html
    5.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    5.19 + * specific language governing permissions and limitations under the
    5.20 + * License.  When distributing the software, include this License Header
    5.21 + * Notice in each file and include the License file at
    5.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    5.23 + * particular file as subject to the "Classpath" exception as provided
    5.24 + * by Oracle in the GPL Version 2 section of the License file that
    5.25 + * accompanied this code. If applicable, add the following below the
    5.26 + * License Header, with the fields enclosed by brackets [] replaced by
    5.27 + * your own identifying information:
    5.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    5.29 + *
    5.30 + * If you wish your version of this file to be governed by only the CDDL
    5.31 + * or only the GPL Version 2, indicate your decision by adding
    5.32 + * "[Contributor] elects to include this software in this distribution
    5.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    5.34 + * single choice of license, a recipient has the option to distribute
    5.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    5.36 + * to extend the choice of license to its licensees as provided above.
    5.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    5.38 + * Version 2 license, then the option applies only if the new code is
    5.39 + * made subject to such option by the copyright holder.
    5.40 + *
    5.41 + * Contributor(s):
    5.42 + *
    5.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
    5.44 + */
    5.45 +
    5.46 +package org.netbeans.modules.dew4nb.services.debugger;
    5.47 +
    5.48 +import java.util.concurrent.Executor;
    5.49 +import org.netbeans.api.annotations.common.NonNull;
    5.50 +import org.netbeans.modules.dew4nb.endpoint.AsyncRequestHandler;
    5.51 +import org.netbeans.modules.dew4nb.endpoint.EndPoint;
    5.52 +import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
    5.53 +import org.netbeans.modules.dew4nb.endpoint.Status;
    5.54 +import org.netbeans.modules.dew4nb.services.javac.Context;
    5.55 +import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
    5.56 +import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
    5.57 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
    5.58 +import org.openide.filesystems.FileObject;
    5.59 +import org.openide.util.Lookup;
    5.60 +import org.openide.util.RequestProcessor;
    5.61 +import org.openide.util.lookup.ServiceProvider;
    5.62 +
    5.63 +/**
    5.64 + *
    5.65 + * @author Tomas Zezula
    5.66 + */
    5.67 +@ServiceProvider(service = RequestHandler.class)
    5.68 +public class AttachHandler extends AsyncRequestHandler<JavacQuery, JavacMessageType> {
    5.69 +
    5.70 +    private static final Executor RP = new RequestProcessor(AttachHandler.class);    
    5.71 +
    5.72 +
    5.73 +    public AttachHandler() {
    5.74 +        super(DebugerModels.END_POINT, JavacMessageType.attach, JavacQuery.class);        
    5.75 +    }
    5.76 +
    5.77 +    @Override
    5.78 +    @NonNull
    5.79 +    protected Status handle(@NonNull final JavacQuery request, @NonNull final EndPoint.Env env) {
    5.80 +        final JavacMessageType type = request.getType();
    5.81 +        if (type != JavacMessageType.attach) {
    5.82 +            throw new IllegalStateException("Wrong message type:" + type);  //NOI18N
    5.83 +        }
    5.84 +        final Context ctx = request.getContext();
    5.85 +        if (ctx != null) {
    5.86 +            throw new IllegalArgumentException("Missing context");  //NOI18N
    5.87 +        }
    5.88 +        final String state = request.getState();
    5.89 +        if (state == null) {
    5.90 +            throw new IllegalArgumentException("Missing state");       //NOI18N
    5.91 +        }
    5.92 +        final WorkspaceResolver resolver = Lookup.getDefault().lookup(WorkspaceResolver.class);
    5.93 +        if (resolver == null) {
    5.94 +            throw new IllegalStateException("No WorkspaceResolver");    //NOI18N
    5.95 +        }
    5.96 +        RP.execute(new Runnable() {
    5.97 +            @Override
    5.98 +            public void run() {                
    5.99 +                final WorkspaceResolver.Context serverCtx = new WorkspaceResolver.Context(
   5.100 +                   ctx.getUser(),
   5.101 +                   ctx.getWorkspace(),
   5.102 +                   ""   //NOI18N
   5.103 +                );
   5.104 +                Status status = Status.not_found;
   5.105 +                int id = -1;
   5.106 +                final FileObject workspace = resolver.resolveFile(serverCtx);                
   5.107 +                if (workspace != null) {
   5.108 +                    id = ActiveSessions.getInstance().createSession(serverCtx, env);
   5.109 +                    status = Status.done;
   5.110 +                }
   5.111 +                final AttachResult attachResult = new AttachResult();
   5.112 +                attachResult.setId(id);
   5.113 +                attachResult.setType(type);
   5.114 +                attachResult.setState(state);
   5.115 +                attachResult.setStatus(status);
   5.116 +                env.sendObject(attachResult);
   5.117 +            }
   5.118 +        });
   5.119 +        return Status.accepted;
   5.120 +    }
   5.121 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ContinueHandler.java	Tue Jan 28 22:00:22 2014 +0100
     6.3 @@ -0,0 +1,95 @@
     6.4 +/*
     6.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     6.6 + *
     6.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
     6.8 + *
     6.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    6.10 + * Other names may be trademarks of their respective owners.
    6.11 + *
    6.12 + * The contents of this file are subject to the terms of either the GNU
    6.13 + * General Public License Version 2 only ("GPL") or the Common
    6.14 + * Development and Distribution License("CDDL") (collectively, the
    6.15 + * "License"). You may not use this file except in compliance with the
    6.16 + * License. You can obtain a copy of the License at
    6.17 + * http://www.netbeans.org/cddl-gplv2.html
    6.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    6.19 + * specific language governing permissions and limitations under the
    6.20 + * License.  When distributing the software, include this License Header
    6.21 + * Notice in each file and include the License file at
    6.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    6.23 + * particular file as subject to the "Classpath" exception as provided
    6.24 + * by Oracle in the GPL Version 2 section of the License file that
    6.25 + * accompanied this code. If applicable, add the following below the
    6.26 + * License Header, with the fields enclosed by brackets [] replaced by
    6.27 + * your own identifying information:
    6.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    6.29 + *
    6.30 + * If you wish your version of this file to be governed by only the CDDL
    6.31 + * or only the GPL Version 2, indicate your decision by adding
    6.32 + * "[Contributor] elects to include this software in this distribution
    6.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    6.34 + * single choice of license, a recipient has the option to distribute
    6.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    6.36 + * to extend the choice of license to its licensees as provided above.
    6.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    6.38 + * Version 2 license, then the option applies only if the new code is
    6.39 + * made subject to such option by the copyright holder.
    6.40 + *
    6.41 + * Contributor(s):
    6.42 + *
    6.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
    6.44 + */
    6.45 +
    6.46 +package org.netbeans.modules.dew4nb.services.debugger;
    6.47 +
    6.48 +import org.netbeans.api.annotations.common.NonNull;
    6.49 +import org.netbeans.api.debugger.Session;
    6.50 +import org.netbeans.api.debugger.jpda.JPDADebugger;
    6.51 +import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
    6.52 +import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
    6.53 +import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
    6.54 +import org.netbeans.modules.dew4nb.endpoint.Status;
    6.55 +import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
    6.56 +import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
    6.57 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
    6.58 +import org.openide.util.Parameters;
    6.59 +import org.openide.util.lookup.ServiceProvider;
    6.60 +
    6.61 +/**
    6.62 + *
    6.63 + * @author Tomas Zezula
    6.64 + */
    6.65 +@ServiceProvider(service=RequestHandler.class)
    6.66 +public class ContinueHandler extends BasicRequestHandler<JavacQuery, JavacMessageType, ContinueResult> {
    6.67 +
    6.68 +    public ContinueHandler() {
    6.69 +        super(DebugerModels.END_POINT, JavacMessageType.cont, JavacQuery.class, ContinueResult.class);
    6.70 +    }
    6.71 +
    6.72 +    @Override
    6.73 +    @NonNull
    6.74 +    protected Status handle(@NonNull final JavacQuery request, @NonNull final ContinueResult response) {
    6.75 +        Parameters.notNull("request", request); //NOI18N
    6.76 +        Parameters.notNull("response", response);   //NOI18N
    6.77 +        if (request.getType() != JavacMessageType.cont) {
    6.78 +            throw new IllegalStateException("Invalid message type: " + request.getType());  //NOI18N
    6.79 +        }
    6.80 +        Status status = Status.not_found;
    6.81 +        final int sessionId = request.getOffset();
    6.82 +        final WorkspaceResolver.Context ctx = ActiveSessions.getInstance().getContext(sessionId);
    6.83 +        if (ctx != null) {
    6.84 +            final Session debugSession = ActiveSessions.getInstance().getDebugSession(sessionId);
    6.85 +            if (debugSession == null) {
    6.86 +                throw new IllegalStateException("No debugger session.");    //NOI18N
    6.87 +            }
    6.88 +            final JPDADebugger jpda = debugSession.lookupFirst(null, JPDADebugger.class);
    6.89 +            if (!(jpda instanceof JPDADebuggerImpl)) {
    6.90 +                throw new IllegalStateException("Wrong debugger service.");    //NOI18N
    6.91 +            }
    6.92 +            ((JPDADebuggerImpl)jpda).resume();
    6.93 +            status = Status.done;
    6.94 +        }
    6.95 +        return status;
    6.96 +    }
    6.97 +
    6.98 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/DebugerModels.java	Tue Jan 28 22:00:22 2014 +0100
     7.3 @@ -0,0 +1,89 @@
     7.4 +/*
     7.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     7.6 + *
     7.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
     7.8 + *
     7.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    7.10 + * Other names may be trademarks of their respective owners.
    7.11 + *
    7.12 + * The contents of this file are subject to the terms of either the GNU
    7.13 + * General Public License Version 2 only ("GPL") or the Common
    7.14 + * Development and Distribution License("CDDL") (collectively, the
    7.15 + * "License"). You may not use this file except in compliance with the
    7.16 + * License. You can obtain a copy of the License at
    7.17 + * http://www.netbeans.org/cddl-gplv2.html
    7.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    7.19 + * specific language governing permissions and limitations under the
    7.20 + * License.  When distributing the software, include this License Header
    7.21 + * Notice in each file and include the License file at
    7.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    7.23 + * particular file as subject to the "Classpath" exception as provided
    7.24 + * by Oracle in the GPL Version 2 section of the License file that
    7.25 + * accompanied this code. If applicable, add the following below the
    7.26 + * License Header, with the fields enclosed by brackets [] replaced by
    7.27 + * your own identifying information:
    7.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    7.29 + *
    7.30 + * If you wish your version of this file to be governed by only the CDDL
    7.31 + * or only the GPL Version 2, indicate your decision by adding
    7.32 + * "[Contributor] elects to include this software in this distribution
    7.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    7.34 + * single choice of license, a recipient has the option to distribute
    7.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    7.36 + * to extend the choice of license to its licensees as provided above.
    7.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    7.38 + * Version 2 license, then the option applies only if the new code is
    7.39 + * made subject to such option by the copyright holder.
    7.40 + *
    7.41 + * Contributor(s):
    7.42 + *
    7.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
    7.44 + */
    7.45 +
    7.46 +package org.netbeans.modules.dew4nb.services.debugger;
    7.47 +
    7.48 +import net.java.html.json.Model;
    7.49 +import net.java.html.json.Property;
    7.50 +import org.netbeans.modules.dew4nb.endpoint.Status;
    7.51 +import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
    7.52 +
    7.53 +/**
    7.54 + *
    7.55 + * @author Tomas Zezula
    7.56 + */
    7.57 +public final class DebugerModels {
    7.58 +
    7.59 +    static final String END_POINT = "javac"; //NOI18N
    7.60 +
    7.61 +    private DebugerModels() {
    7.62 +        throw new IllegalStateException("No instance allowed.");    //NOI18N
    7.63 +    }
    7.64 +
    7.65 +
    7.66 +    @Model(className = "AttachResult", properties = {
    7.67 +        @Property(name = "status", type = Status.class),
    7.68 +        @Property(name = "type", type = JavacMessageType.class),
    7.69 +        @Property(name = "state", type = String.class),
    7.70 +        @Property(name = "id", type = int.class)
    7.71 +    })
    7.72 +    static final class AttachResultModel {
    7.73 +    }
    7.74 +
    7.75 +
    7.76 +    @Model(className = "SetBreakpointsResult", properties = {
    7.77 +        @Property(name = "status", type = Status.class),
    7.78 +        @Property(name = "type", type = JavacMessageType.class),
    7.79 +        @Property(name = "state", type = String.class),
    7.80 +    })
    7.81 +    static final class SetBreakpointsResultModel {
    7.82 +    }
    7.83 +
    7.84 +    @Model(className = "ContinueResult", properties = {
    7.85 +        @Property(name = "status", type = Status.class),
    7.86 +        @Property(name = "type", type = JavacMessageType.class),
    7.87 +        @Property(name = "state", type = String.class),
    7.88 +    })
    7.89 +    static final class ContinueResultModel {
    7.90 +    }
    7.91 +
    7.92 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/SetBreakpointsHandler.java	Tue Jan 28 22:00:22 2014 +0100
     8.3 @@ -0,0 +1,128 @@
     8.4 +/*
     8.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     8.6 + *
     8.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
     8.8 + *
     8.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    8.10 + * Other names may be trademarks of their respective owners.
    8.11 + *
    8.12 + * The contents of this file are subject to the terms of either the GNU
    8.13 + * General Public License Version 2 only ("GPL") or the Common
    8.14 + * Development and Distribution License("CDDL") (collectively, the
    8.15 + * "License"). You may not use this file except in compliance with the
    8.16 + * License. You can obtain a copy of the License at
    8.17 + * http://www.netbeans.org/cddl-gplv2.html
    8.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    8.19 + * specific language governing permissions and limitations under the
    8.20 + * License.  When distributing the software, include this License Header
    8.21 + * Notice in each file and include the License file at
    8.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    8.23 + * particular file as subject to the "Classpath" exception as provided
    8.24 + * by Oracle in the GPL Version 2 section of the License file that
    8.25 + * accompanied this code. If applicable, add the following below the
    8.26 + * License Header, with the fields enclosed by brackets [] replaced by
    8.27 + * your own identifying information:
    8.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    8.29 + *
    8.30 + * If you wish your version of this file to be governed by only the CDDL
    8.31 + * or only the GPL Version 2, indicate your decision by adding
    8.32 + * "[Contributor] elects to include this software in this distribution
    8.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    8.34 + * single choice of license, a recipient has the option to distribute
    8.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    8.36 + * to extend the choice of license to its licensees as provided above.
    8.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    8.38 + * Version 2 license, then the option applies only if the new code is
    8.39 + * made subject to such option by the copyright holder.
    8.40 + *
    8.41 + * Contributor(s):
    8.42 + *
    8.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
    8.44 + */
    8.45 +
    8.46 +package org.netbeans.modules.dew4nb.services.debugger;
    8.47 +
    8.48 +import java.util.logging.Level;
    8.49 +import java.util.logging.Logger;
    8.50 +import org.netbeans.api.annotations.common.NonNull;
    8.51 +import org.netbeans.api.debugger.DebuggerManager;
    8.52 +import org.netbeans.api.debugger.jpda.LineBreakpoint;
    8.53 +import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
    8.54 +import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
    8.55 +import org.netbeans.modules.dew4nb.endpoint.Status;
    8.56 +import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
    8.57 +import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
    8.58 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
    8.59 +import org.openide.filesystems.FileObject;
    8.60 +import org.openide.util.Lookup;
    8.61 +import org.openide.util.Parameters;
    8.62 +import org.openide.util.lookup.ServiceProvider;
    8.63 +
    8.64 +/**
    8.65 + *
    8.66 + * @author Tomas Zezula
    8.67 + */
    8.68 +@ServiceProvider(service = RequestHandler.class)
    8.69 +public class SetBreakpointsHandler extends BasicRequestHandler<JavacQuery, JavacMessageType, SetBreakpointsResult> {
    8.70 +    
    8.71 +    private static final Logger LOG = Logger.getLogger(SetBreakpointsHandler.class.getName());
    8.72 +
    8.73 +    public SetBreakpointsHandler() {
    8.74 +        super(DebugerModels.END_POINT, JavacMessageType.breakpoints, JavacQuery.class, SetBreakpointsResult.class);
    8.75 +    }
    8.76 +
    8.77 +    @Override
    8.78 +    protected Status handle(@NonNull final JavacQuery request, @NonNull final SetBreakpointsResult response) {
    8.79 +        Parameters.notNull("request", request); //NOI18N
    8.80 +        Parameters.notNull("response", response);   //NOI18N;
    8.81 +        if (request.getType() != JavacMessageType.breakpoints) {
    8.82 +            throw new IllegalStateException("Wrong message type: " + request.getType());    //NOI18N
    8.83 +        }
    8.84 +        Status status = Status.not_found;
    8.85 +        final int sessionId = request.getOffset();
    8.86 +        final WorkspaceResolver.Context ctx = ActiveSessions.getInstance().getContext(sessionId);
    8.87 +        if (ctx != null) {
    8.88 +            final String lines = request.getJava();
    8.89 +            if (lines != null) {
    8.90 +                final WorkspaceResolver resolver = Lookup.getDefault().lookup(WorkspaceResolver.class);
    8.91 +                if (resolver == null) {
    8.92 +                    throw new IllegalStateException("No WorkspaceResolver."); //NOI18N
    8.93 +                }
    8.94 +                final DebuggerManager dbm = DebuggerManager.getDebuggerManager();
    8.95 +                for (String line : lines.split(",")) {  //NOI18N
    8.96 +                    final int separator = line.lastIndexOf(':');    //NOI18N
    8.97 +                    if (separator > 0 && separator < line.length() - 1) {
    8.98 +                        try {
    8.99 +                            final String path = line.substring(0, separator);
   8.100 +                            final String lineStr = line.substring(separator+1);
   8.101 +                            final int lineNo = Integer.parseInt(lineStr);
   8.102 +                            final FileObject file = resolver.resolveFile(new WorkspaceResolver.Context(ctx.getUser(), ctx.getWorkspace(), path));
   8.103 +                            if (file != null) {
   8.104 +                                final LineBreakpoint lb = LineBreakpoint.create(file.toURL().toExternalForm(), lineNo);
   8.105 +                                dbm.addBreakpoint(lb);
   8.106 +                            } else {
   8.107 +                                LOG.log(
   8.108 +                                    Level.WARNING,
   8.109 +                                    "Ignoring breakpoint in unresolvable file: {0}",   //NOI18N
   8.110 +                                    line);
   8.111 +                            }
   8.112 +                        } catch (NumberFormatException nfe) {
   8.113 +                            LOG.log(
   8.114 +                                Level.WARNING,
   8.115 +                                "Ignoring breakpoint with wrong line number: {0}",   //NOI18N
   8.116 +                                line);
   8.117 +                        }
   8.118 +                    } else {
   8.119 +                        LOG.log(
   8.120 +                            Level.WARNING,
   8.121 +                            "Ignoring wrong breakpoint: {0}",   //NOI18N
   8.122 +                            line);
   8.123 +                    }
   8.124 +                }
   8.125 +            }
   8.126 +            status = Status.done;
   8.127 +        }
   8.128 +        return status;
   8.129 +    }
   8.130 +
   8.131 +}
     9.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/AutocompleteHandler.java	Tue Jan 28 11:07:53 2014 +0100
     9.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/AutocompleteHandler.java	Tue Jan 28 22:00:22 2014 +0100
     9.3 @@ -74,6 +74,7 @@
     9.4  import org.netbeans.modules.dew4nb.SourceProvider;
     9.5  import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
     9.6  import org.netbeans.modules.dew4nb.endpoint.Status;
     9.7 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
     9.8  import org.netbeans.modules.editor.completion.CompletionItemComparator;
     9.9  import org.netbeans.modules.editor.java.JavaCompletionItem;
    9.10  import org.netbeans.modules.editor.java.JavaCompletionItemFactory;
    9.11 @@ -106,7 +107,12 @@
    9.12                  ctx.getPath());
    9.13          Status status = Status.runtime_error;
    9.14          try {
    9.15 -            final Source s = SourceProvider.getInstance().getSource(ctx, java);
    9.16 +            final Source s = SourceProvider.getInstance().getSource(
    9.17 +                new WorkspaceResolver.Context(
    9.18 +                    ctx.getUser(),
    9.19 +                    ctx.getWorkspace(),
    9.20 +                    ctx.getPath()),
    9.21 +                java);
    9.22              if (s != null) {
    9.23                  List<? extends org.netbeans.spi.editor.completion.CompletionItem> items = JavaCompletionProvider.query(s, CompletionProvider.COMPLETION_QUERY_TYPE, offset, offset, new Item.Factory());
    9.24                  Collections.sort(items, CompletionItemComparator.BY_PRIORITY);
    10.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/ErrorHandler.java	Tue Jan 28 11:07:53 2014 +0100
    10.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/ErrorHandler.java	Tue Jan 28 22:00:22 2014 +0100
    10.3 @@ -56,6 +56,7 @@
    10.4  import org.netbeans.modules.dew4nb.SourceProvider;
    10.5  import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
    10.6  import org.netbeans.modules.dew4nb.endpoint.Status;
    10.7 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
    10.8  import org.netbeans.modules.parsing.api.ParserManager;
    10.9  import org.netbeans.modules.parsing.api.ResultIterator;
   10.10  import org.netbeans.modules.parsing.api.Source;
   10.11 @@ -88,7 +89,12 @@
   10.12          }
   10.13          final String java = request.getJava();
   10.14          final Context ctx = request.getContext();
   10.15 -        final Source src = SourceProvider.getInstance().getSource(ctx, java);
   10.16 +        final Source src = SourceProvider.getInstance().getSource(
   10.17 +            new WorkspaceResolver.Context(
   10.18 +                ctx.getUser(),
   10.19 +                ctx.getWorkspace(),
   10.20 +                ctx.getPath()),
   10.21 +            java);
   10.22          Status status = Status.runtime_error;
   10.23          if (src != null) {
   10.24              try {
    11.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/JavacMessageType.java	Tue Jan 28 11:07:53 2014 +0100
    11.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/JavacMessageType.java	Tue Jan 28 22:00:22 2014 +0100
    11.3 @@ -45,15 +45,11 @@
    11.4  public enum JavacMessageType {
    11.5      //javac
    11.6      autocomplete,
    11.7 -    types,
    11.8      symbols,
    11.9      checkForErrors,
   11.10      compile,
   11.11 -    //project
   11.12 -    getfile,
   11.13 -    isActionEnabled,
   11.14 -    invokeAction,
   11.15      //debugger
   11.16      attach,
   11.17      breakpoints,
   11.18 +    cont
   11.19  }
    12.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/JavacModels.java	Tue Jan 28 11:07:53 2014 +0100
    12.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/JavacModels.java	Tue Jan 28 22:00:22 2014 +0100
    12.3 @@ -46,7 +46,6 @@
    12.4  import net.java.html.json.Model;
    12.5  import net.java.html.json.Property;
    12.6  import org.netbeans.modules.dew4nb.endpoint.Status;
    12.7 -import org.netbeans.modules.dew4nb.services.project.BuildResult;
    12.8  
    12.9  /**
   12.10   *
   12.11 @@ -63,7 +62,7 @@
   12.12      @Model(className = "JavacQuery", properties = {
   12.13          @Property(name = "type", type = JavacMessageType.class),
   12.14          @Property(name = "state", type = String.class),
   12.15 -        @Property(name = "context", type=Context.class),
   12.16 +        @Property(name = "context", type = Context.class),
   12.17          @Property(name = "java", type = String.class),
   12.18          @Property(name = "offset", type = int.class)
   12.19      })
   12.20 @@ -116,27 +115,6 @@
   12.21      static final class FileContentResultModel {
   12.22      }
   12.23  
   12.24 -    @Model(className="IsProjectActionEnabledResult", properties = {
   12.25 -        @Property(name = "status", type = Status.class),
   12.26 -        @Property(name = "type", type = JavacMessageType.class),
   12.27 -        @Property(name = "state", type = String.class),
   12.28 -        @Property(name = "enabled", type = Boolean.class)
   12.29 -    })
   12.30 -    static final class IsProjectActionEnabledResultModel {
   12.31 -    }
   12.32 -
   12.33 -    @Model(className = "InvokeProjectActionResult", properties = {
   12.34 -        @Property(name = "status", type = Status.class),
   12.35 -        @Property(name = "type", type = JavacMessageType.class),
   12.36 -        @Property(name = "state", type = String.class),
   12.37 -        @Property(name = "result", type = BuildResult.class),
   12.38 -        @Property(name = "stdout", type = String.class, array = true),
   12.39 -        @Property(name = "stderr", type = String.class, array = true),
   12.40 -        @Property(name = "openUrl", type = String.class, array = true)
   12.41 -    })
   12.42 -    static final class InvokeProjectActionResultModel {
   12.43 -    }    
   12.44 -
   12.45      @Model(className = "Context", properties = {
   12.46          @Property(name="user", type=String.class),
   12.47          @Property(name = "workspace", type = String.class),
   12.48 @@ -145,7 +123,6 @@
   12.49      static final class ContextModel {
   12.50      }
   12.51  
   12.52 -
   12.53      @Model(className = "JavacDiagnostic", properties = {
   12.54          @Property(name = "col", type = long.class),
   12.55          @Property(name = "line", type = long.class),
   12.56 @@ -181,6 +158,4 @@
   12.57      })
   12.58      static final class TypeDescriptorModel {
   12.59      }
   12.60 -
   12.61 -
   12.62  }
    13.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/TypeHandler.java	Tue Jan 28 11:07:53 2014 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,189 +0,0 @@
    13.4 -/*
    13.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    13.6 - *
    13.7 - * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    13.8 - *
    13.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   13.10 - * Other names may be trademarks of their respective owners.
   13.11 - *
   13.12 - * The contents of this file are subject to the terms of either the GNU
   13.13 - * General Public License Version 2 only ("GPL") or the Common
   13.14 - * Development and Distribution License("CDDL") (collectively, the
   13.15 - * "License"). You may not use this file except in compliance with the
   13.16 - * License. You can obtain a copy of the License at
   13.17 - * http://www.netbeans.org/cddl-gplv2.html
   13.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   13.19 - * specific language governing permissions and limitations under the
   13.20 - * License.  When distributing the software, include this License Header
   13.21 - * Notice in each file and include the License file at
   13.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   13.23 - * particular file as subject to the "Classpath" exception as provided
   13.24 - * by Oracle in the GPL Version 2 section of the License file that
   13.25 - * accompanied this code. If applicable, add the following below the
   13.26 - * License Header, with the fields enclosed by brackets [] replaced by
   13.27 - * your own identifying information:
   13.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   13.29 - *
   13.30 - * If you wish your version of this file to be governed by only the CDDL
   13.31 - * or only the GPL Version 2, indicate your decision by adding
   13.32 - * "[Contributor] elects to include this software in this distribution
   13.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   13.34 - * single choice of license, a recipient has the option to distribute
   13.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   13.36 - * to extend the choice of license to its licensees as provided above.
   13.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   13.38 - * Version 2 license, then the option applies only if the new code is
   13.39 - * made subject to such option by the copyright holder.
   13.40 - *
   13.41 - * Contributor(s):
   13.42 - *
   13.43 - * Portions Copyrighted 2013 Sun Microsystems, Inc.
   13.44 - */
   13.45 -
   13.46 -package org.netbeans.modules.dew4nb.services.javac;
   13.47 -
   13.48 -import java.util.ArrayList;
   13.49 -import java.util.Arrays;
   13.50 -import java.util.Collection;
   13.51 -import java.util.Collections;
   13.52 -import java.util.HashSet;
   13.53 -import java.util.List;
   13.54 -import org.netbeans.api.annotations.common.NonNull;
   13.55 -import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
   13.56 -import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
   13.57 -import org.netbeans.modules.dew4nb.endpoint.Status;
   13.58 -import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
   13.59 -import org.netbeans.modules.jumpto.common.Utils;
   13.60 -import org.netbeans.modules.jumpto.type.TypeProviderAccessor;
   13.61 -import org.netbeans.spi.jumpto.type.SearchType;
   13.62 -import org.netbeans.spi.jumpto.type.TypeDescriptor;
   13.63 -import org.netbeans.spi.jumpto.type.TypeProvider;
   13.64 -import org.openide.util.Lookup;
   13.65 -import org.openide.util.Parameters;
   13.66 -import org.openide.util.lookup.ServiceProvider;
   13.67 -
   13.68 -/**
   13.69 - *
   13.70 - * @author Tomas Zezula
   13.71 - */
   13.72 -@ServiceProvider(service = RequestHandler.class)
   13.73 -public class TypeHandler extends BasicRequestHandler<JavacQuery, JavacMessageType, JavacTypeResult> {
   13.74 -    public TypeHandler() {
   13.75 -        super(
   13.76 -            JavacModels.END_POINT,
   13.77 -            JavacMessageType.types,
   13.78 -            JavacQuery.class,
   13.79 -            JavacTypeResult.class);
   13.80 -    }
   13.81 -
   13.82 -    @Override
   13.83 -    protected Status handle(
   13.84 -        @NonNull final JavacQuery request,
   13.85 -        @NonNull final JavacTypeResult response) {
   13.86 -        Parameters.notNull("request", request); //NOI18N
   13.87 -        Parameters.notNull("response", response);  //NOI18N
   13.88 -        final JavacMessageType requestType = request.getType();
   13.89 -        if (requestType != JavacMessageType.types) {
   13.90 -            throw new IllegalStateException(String.valueOf(requestType));
   13.91 -        }
   13.92 -        final String text = request.getJava();
   13.93 -        final Collection<? extends TypeProvider> typeProviders = getTypeProviders();
   13.94 -        try {
   13.95 -            final Collection<? extends TypeDescriptor> types = callTypeProviders(text, typeProviders);
   13.96 -            final WorkspaceResolver resolver = Lookup.getDefault().lookup(WorkspaceResolver.class);
   13.97 -            if (resolver == null) {
   13.98 -                throw new IllegalStateException("No WorkspaceResolver in Lookup");  //NOI18N
   13.99 -            }
  13.100 -            for (TypeDescriptor td : types) {
  13.101 -                final WorkspaceResolver.Context ctx = resolver.resolveContext(td.getFileObject());
  13.102 -                if (ctx != null) {
  13.103 -                    response.getTypes().add(
  13.104 -                        new org.netbeans.modules.dew4nb.services.javac.TypeDescriptor(
  13.105 -                        td.getSimpleName(),
  13.106 -                        td.getContextName(),
  13.107 -                        "", //NOI18N
  13.108 -                        apiToWire(ctx)));
  13.109 -                }
  13.110 -            }
  13.111 -        } finally {
  13.112 -            cleanTypeProviders(typeProviders);
  13.113 -        }
  13.114 -        return Status.done;
  13.115 -    }
  13.116 -
  13.117 -    @NonNull
  13.118 -    private static Collection<? extends TypeProvider> getTypeProviders() {
  13.119 -        final List<TypeProvider> result = new ArrayList<>();
  13.120 -        for (TypeProvider tp : Lookup.getDefault().lookupAll(TypeProvider.class)) {
  13.121 -            result.add(tp);
  13.122 -        }
  13.123 -        return Collections.unmodifiableCollection(result);
  13.124 -    }
  13.125 -
  13.126 -    @NonNull
  13.127 -    private static Collection<? extends TypeDescriptor> callTypeProviders(
  13.128 -            @NonNull final String text,
  13.129 -            @NonNull final Collection<? extends TypeProvider> providers) {
  13.130 -        Parameters.notNull("text", text);   //NOI18N
  13.131 -        Parameters.notNull("providers", providers); //NOI18N
  13.132 -        final Collection<TypeDescriptor> collector = new HashSet<>();
  13.133 -        for (TypeProvider.Context ctx : createContext(text)) {
  13.134 -            final TypeProvider.Result res = createResult(collector, ctx);
  13.135 -            for (TypeProvider tp : providers) {
  13.136 -                tp.computeTypeNames(ctx, res);
  13.137 -            }
  13.138 -        }
  13.139 -        return Collections.unmodifiableCollection(collector);
  13.140 -    }
  13.141 -
  13.142 -    private static void cleanTypeProviders(@NonNull Collection<? extends TypeProvider> providers) {
  13.143 -        Parameters.notNull("providers", providers); //NOI18N
  13.144 -        for (TypeProvider tp : providers) {
  13.145 -            tp.cleanup();
  13.146 -        }
  13.147 -    }
  13.148 -
  13.149 -    @NonNull
  13.150 -    private static Collection< ? extends TypeProvider.Context> createContext(@NonNull String text) {
  13.151 -        Parameters.notNull("text", text);   //NOI18N
  13.152 -        boolean exact = text.endsWith(" "); // NOI18N
  13.153 -        text = text.trim();
  13.154 -        if ( text.length() == 0) {
  13.155 -            return Collections.<TypeProvider.Context>emptySet();
  13.156 -        }
  13.157 -        Collection<? extends TypeProvider.Context> contexts;
  13.158 -        int wildcard = Utils.containsWildCard(text);
  13.159 -        if (exact) {
  13.160 -            contexts = Collections.singleton(
  13.161 -                TypeProviderAccessor.DEFAULT.createContext(null, text, SearchType.CASE_INSENSITIVE_EXACT_NAME));
  13.162 -        } else if ((Utils.isAllUpper(text) && text.length() > 1) || Utils.isCamelCase(text)) {
  13.163 -            contexts = Arrays.asList(
  13.164 -                new TypeProvider.Context[] {
  13.165 -                    TypeProviderAccessor.DEFAULT.createContext(null, text, SearchType.CAMEL_CASE),
  13.166 -                    TypeProviderAccessor.DEFAULT.createContext(null, text, SearchType.CASE_INSENSITIVE_PREFIX)});
  13.167 -        } else if (wildcard != -1) {
  13.168 -            text = Utils.removeNonNeededWildCards(text);
  13.169 -            contexts = Collections.singleton(TypeProviderAccessor.DEFAULT.createContext(null, text, SearchType.CASE_INSENSITIVE_REGEXP));
  13.170 -        } else {
  13.171 -            contexts = Collections.singleton(TypeProviderAccessor.DEFAULT.createContext(null, text,SearchType.CASE_INSENSITIVE_PREFIX));
  13.172 -        }
  13.173 -        return contexts;
  13.174 -    }
  13.175 -
  13.176 -    @NonNull
  13.177 -    private static TypeProvider.Result createResult(
  13.178 -            @NonNull final Collection<? super TypeDescriptor> collector,
  13.179 -            @NonNull final TypeProvider.Context ctx) {
  13.180 -        Parameters.notNull("collector", collector); //NOI18N
  13.181 -        Parameters.notNull("ctx", ctx);   //NOI18N
  13.182 -        return TypeProviderAccessor.DEFAULT.createResult(
  13.183 -             collector,
  13.184 -             new String[1],
  13.185 -             ctx);
  13.186 -    }
  13.187 -
  13.188 -    private Context apiToWire(@NonNull WorkspaceResolver.Context ctx) {
  13.189 -        Parameters.notNull("ctx", ctx); //NOI18N
  13.190 -        return new Context(ctx.getUser(), ctx.getWorkspace(), ctx.getPath());
  13.191 -    }
  13.192 -}
    14.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/debugger/AttachHandler.java	Tue Jan 28 11:07:53 2014 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,128 +0,0 @@
    14.4 -/*
    14.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    14.6 - *
    14.7 - * Copyright 2014 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 2014 Sun Microsystems, Inc.
   14.44 - */
   14.45 -
   14.46 -package org.netbeans.modules.dew4nb.services.javac.debugger;
   14.47 -
   14.48 -import java.util.concurrent.ConcurrentHashMap;
   14.49 -import java.util.concurrent.ConcurrentMap;
   14.50 -import java.util.concurrent.Executor;
   14.51 -import java.util.concurrent.atomic.AtomicInteger;
   14.52 -import org.netbeans.api.annotations.common.NonNull;
   14.53 -import org.netbeans.modules.dew4nb.endpoint.AsyncRequestHandler;
   14.54 -import org.netbeans.modules.dew4nb.endpoint.EndPoint;
   14.55 -import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
   14.56 -import org.netbeans.modules.dew4nb.endpoint.Status;
   14.57 -import org.netbeans.modules.dew4nb.services.javac.Context;
   14.58 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
   14.59 -import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
   14.60 -import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
   14.61 -import org.openide.filesystems.FileObject;
   14.62 -import org.openide.util.Lookup;
   14.63 -import org.openide.util.RequestProcessor;
   14.64 -import org.openide.util.lookup.ServiceProvider;
   14.65 -
   14.66 -/**
   14.67 - *
   14.68 - * @author Tomas Zezula
   14.69 - */
   14.70 -@ServiceProvider(service = RequestHandler.class)
   14.71 -public class AttachHandler extends AsyncRequestHandler<JavacQuery, JavacMessageType> {
   14.72 -
   14.73 -    private static final Executor RP = new RequestProcessor(AttachHandler.class);
   14.74 -    private final AtomicInteger idSequencer;
   14.75 -    private final ConcurrentMap<Integer,WorkspaceResolver.Context> activeSessions;
   14.76 -
   14.77 -
   14.78 -    public AttachHandler() {
   14.79 -        super(DebugerModels.END_POINT, JavacMessageType.attach, JavacQuery.class);
   14.80 -        this.idSequencer = new AtomicInteger();
   14.81 -        this.activeSessions = new ConcurrentHashMap<>();
   14.82 -    }
   14.83 -
   14.84 -    @Override
   14.85 -    @NonNull
   14.86 -    protected Status handle(@NonNull final JavacQuery request, @NonNull final EndPoint.Env env) {
   14.87 -        final JavacMessageType type = request.getType();
   14.88 -        if (type != JavacMessageType.attach) {
   14.89 -            throw new IllegalStateException("Wrong message type:" + type);  //NOI18N
   14.90 -        }
   14.91 -        final Context ctx = request.getContext();
   14.92 -        if (ctx != null) {
   14.93 -            throw new IllegalArgumentException("Missing context");  //NOI18N
   14.94 -        }
   14.95 -        final String state = request.getState();
   14.96 -        if (state == null) {
   14.97 -            throw new IllegalArgumentException("Missing state");       //NOI18N
   14.98 -        }
   14.99 -        final WorkspaceResolver resolver = Lookup.getDefault().lookup(WorkspaceResolver.class);
  14.100 -        if (resolver == null) {
  14.101 -            throw new IllegalStateException("No WorkspaceResolver");    //NOI18N
  14.102 -        }
  14.103 -        RP.execute(new Runnable() {
  14.104 -            @Override
  14.105 -            public void run() {                
  14.106 -                final WorkspaceResolver.Context serverCtx = new WorkspaceResolver.Context(
  14.107 -                   ctx.getUser(),
  14.108 -                   ctx.getWorkspace(),
  14.109 -                   ""   //NOI18N
  14.110 -                );
  14.111 -                final FileObject workspace = resolver.resolveFile(serverCtx);
  14.112 -                Status status = Status.not_found;
  14.113 -                int id = -1;
  14.114 -                if (workspace != null) {
  14.115 -                    id = idSequencer.incrementAndGet();
  14.116 -                    if (activeSessions.putIfAbsent(id, serverCtx) != null) {
  14.117 -                        throw new IllegalStateException("Trying to reuse active session");  //NOI18N
  14.118 -                    }
  14.119 -                    status = Status.done;
  14.120 -                }
  14.121 -                final AttachResult attachResult = new AttachResult();
  14.122 -                attachResult.setId(id);
  14.123 -                attachResult.setType(type);
  14.124 -                attachResult.setState(state);
  14.125 -                attachResult.setStatus(status);
  14.126 -                env.sendObject(attachResult);
  14.127 -            }
  14.128 -        });
  14.129 -        return Status.accepted;
  14.130 -    }
  14.131 -}
    15.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/debugger/DebugerModels.java	Tue Jan 28 11:07:53 2014 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,81 +0,0 @@
    15.4 -/*
    15.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    15.6 - *
    15.7 - * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
    15.8 - *
    15.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   15.10 - * Other names may be trademarks of their respective owners.
   15.11 - *
   15.12 - * The contents of this file are subject to the terms of either the GNU
   15.13 - * General Public License Version 2 only ("GPL") or the Common
   15.14 - * Development and Distribution License("CDDL") (collectively, the
   15.15 - * "License"). You may not use this file except in compliance with the
   15.16 - * License. You can obtain a copy of the License at
   15.17 - * http://www.netbeans.org/cddl-gplv2.html
   15.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   15.19 - * specific language governing permissions and limitations under the
   15.20 - * License.  When distributing the software, include this License Header
   15.21 - * Notice in each file and include the License file at
   15.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   15.23 - * particular file as subject to the "Classpath" exception as provided
   15.24 - * by Oracle in the GPL Version 2 section of the License file that
   15.25 - * accompanied this code. If applicable, add the following below the
   15.26 - * License Header, with the fields enclosed by brackets [] replaced by
   15.27 - * your own identifying information:
   15.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   15.29 - *
   15.30 - * If you wish your version of this file to be governed by only the CDDL
   15.31 - * or only the GPL Version 2, indicate your decision by adding
   15.32 - * "[Contributor] elects to include this software in this distribution
   15.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   15.34 - * single choice of license, a recipient has the option to distribute
   15.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   15.36 - * to extend the choice of license to its licensees as provided above.
   15.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   15.38 - * Version 2 license, then the option applies only if the new code is
   15.39 - * made subject to such option by the copyright holder.
   15.40 - *
   15.41 - * Contributor(s):
   15.42 - *
   15.43 - * Portions Copyrighted 2014 Sun Microsystems, Inc.
   15.44 - */
   15.45 -
   15.46 -package org.netbeans.modules.dew4nb.services.javac.debugger;
   15.47 -
   15.48 -import net.java.html.json.Model;
   15.49 -import net.java.html.json.Property;
   15.50 -import org.netbeans.modules.dew4nb.endpoint.Status;
   15.51 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
   15.52 -
   15.53 -/**
   15.54 - *
   15.55 - * @author Tomas Zezula
   15.56 - */
   15.57 -public final class DebugerModels {
   15.58 -
   15.59 -    static final String END_POINT = "javac"; //NOI18N
   15.60 -
   15.61 -    private DebugerModels() {
   15.62 -        throw new IllegalStateException("No instance allowed.");    //NOI18N
   15.63 -    }
   15.64 -
   15.65 -
   15.66 -    @Model(className = "AttachResult", properties = {
   15.67 -        @Property(name = "status", type = Status.class),
   15.68 -        @Property(name = "type", type = JavacMessageType.class),
   15.69 -        @Property(name = "state", type = String.class),
   15.70 -        @Property(name = "id", type = int.class)
   15.71 -    })
   15.72 -    static final class AttachResultModel {
   15.73 -    }
   15.74 -
   15.75 -
   15.76 -    @Model(className = "SetBreakpointsResult", properties = {
   15.77 -        @Property(name = "status", type = Status.class),
   15.78 -        @Property(name = "type", type = JavacMessageType.class),
   15.79 -        @Property(name = "state", type = String.class),
   15.80 -    })
   15.81 -    static final class SetBreakpointsResultModel {
   15.82 -    }
   15.83 -
   15.84 -}
    16.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/javac/debugger/SetBreakpointsHandler.java	Tue Jan 28 11:07:53 2014 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,76 +0,0 @@
    16.4 -/*
    16.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    16.6 - *
    16.7 - * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
    16.8 - *
    16.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   16.10 - * Other names may be trademarks of their respective owners.
   16.11 - *
   16.12 - * The contents of this file are subject to the terms of either the GNU
   16.13 - * General Public License Version 2 only ("GPL") or the Common
   16.14 - * Development and Distribution License("CDDL") (collectively, the
   16.15 - * "License"). You may not use this file except in compliance with the
   16.16 - * License. You can obtain a copy of the License at
   16.17 - * http://www.netbeans.org/cddl-gplv2.html
   16.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   16.19 - * specific language governing permissions and limitations under the
   16.20 - * License.  When distributing the software, include this License Header
   16.21 - * Notice in each file and include the License file at
   16.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   16.23 - * particular file as subject to the "Classpath" exception as provided
   16.24 - * by Oracle in the GPL Version 2 section of the License file that
   16.25 - * accompanied this code. If applicable, add the following below the
   16.26 - * License Header, with the fields enclosed by brackets [] replaced by
   16.27 - * your own identifying information:
   16.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   16.29 - *
   16.30 - * If you wish your version of this file to be governed by only the CDDL
   16.31 - * or only the GPL Version 2, indicate your decision by adding
   16.32 - * "[Contributor] elects to include this software in this distribution
   16.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   16.34 - * single choice of license, a recipient has the option to distribute
   16.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   16.36 - * to extend the choice of license to its licensees as provided above.
   16.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   16.38 - * Version 2 license, then the option applies only if the new code is
   16.39 - * made subject to such option by the copyright holder.
   16.40 - *
   16.41 - * Contributor(s):
   16.42 - *
   16.43 - * Portions Copyrighted 2014 Sun Microsystems, Inc.
   16.44 - */
   16.45 -
   16.46 -package org.netbeans.modules.dew4nb.services.javac.debugger;
   16.47 -
   16.48 -import org.netbeans.api.annotations.common.NonNull;
   16.49 -import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
   16.50 -import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
   16.51 -import org.netbeans.modules.dew4nb.endpoint.Status;
   16.52 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
   16.53 -import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
   16.54 -import org.openide.util.Parameters;
   16.55 -import org.openide.util.lookup.ServiceProvider;
   16.56 -
   16.57 -/**
   16.58 - *
   16.59 - * @author Tomas Zezula
   16.60 - */
   16.61 -@ServiceProvider(service = RequestHandler.class)
   16.62 -public class SetBreakpointsHandler extends BasicRequestHandler<JavacQuery, JavacMessageType, SetBreakpointsResult> {
   16.63 -
   16.64 -    public SetBreakpointsHandler() {
   16.65 -        super(DebugerModels.END_POINT, JavacMessageType.breakpoints, JavacQuery.class, SetBreakpointsResult.class);
   16.66 -    }
   16.67 -
   16.68 -    @Override
   16.69 -    protected Status handle(@NonNull final JavacQuery request, @NonNull final SetBreakpointsResult response) {
   16.70 -        Parameters.notNull("request", request); //NOI18N
   16.71 -        Parameters.notNull("response", response);   //NOI18N;
   16.72 -        if (request.getType() != JavacMessageType.breakpoints) {
   16.73 -            throw new IllegalStateException("Wrong message type: " + request.getType());    //NOI18N
   16.74 -        }
   16.75 -        Status status = Status.done;
   16.76 -        return status;
   16.77 -    }
   16.78 -
   16.79 -}
    17.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/project/GetFileContentHandler.java	Tue Jan 28 11:07:53 2014 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,97 +0,0 @@
    17.4 -/*
    17.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    17.6 - *
    17.7 - * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    17.8 - *
    17.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   17.10 - * Other names may be trademarks of their respective owners.
   17.11 - *
   17.12 - * The contents of this file are subject to the terms of either the GNU
   17.13 - * General Public License Version 2 only ("GPL") or the Common
   17.14 - * Development and Distribution License("CDDL") (collectively, the
   17.15 - * "License"). You may not use this file except in compliance with the
   17.16 - * License. You can obtain a copy of the License at
   17.17 - * http://www.netbeans.org/cddl-gplv2.html
   17.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   17.19 - * specific language governing permissions and limitations under the
   17.20 - * License.  When distributing the software, include this License Header
   17.21 - * Notice in each file and include the License file at
   17.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   17.23 - * particular file as subject to the "Classpath" exception as provided
   17.24 - * by Oracle in the GPL Version 2 section of the License file that
   17.25 - * accompanied this code. If applicable, add the following below the
   17.26 - * License Header, with the fields enclosed by brackets [] replaced by
   17.27 - * your own identifying information:
   17.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   17.29 - *
   17.30 - * If you wish your version of this file to be governed by only the CDDL
   17.31 - * or only the GPL Version 2, indicate your decision by adding
   17.32 - * "[Contributor] elects to include this software in this distribution
   17.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   17.34 - * single choice of license, a recipient has the option to distribute
   17.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   17.36 - * to extend the choice of license to its licensees as provided above.
   17.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   17.38 - * Version 2 license, then the option applies only if the new code is
   17.39 - * made subject to such option by the copyright holder.
   17.40 - *
   17.41 - * Contributor(s):
   17.42 - *
   17.43 - * Portions Copyrighted 2013 Sun Microsystems, Inc.
   17.44 - */
   17.45 -
   17.46 -package org.netbeans.modules.dew4nb.services.project;
   17.47 -
   17.48 -import java.io.IOException;
   17.49 -import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
   17.50 -import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
   17.51 -import org.netbeans.modules.dew4nb.endpoint.Status;
   17.52 -import org.netbeans.modules.dew4nb.services.javac.Context;
   17.53 -import org.netbeans.modules.dew4nb.services.javac.FileContentResult;
   17.54 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
   17.55 -import org.netbeans.modules.dew4nb.services.javac.JavacModels;
   17.56 -import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
   17.57 -import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
   17.58 -import org.openide.filesystems.FileObject;
   17.59 -import org.openide.util.Lookup;
   17.60 -import org.openide.util.Parameters;
   17.61 -import org.openide.util.lookup.ServiceProvider;
   17.62 -
   17.63 -/**
   17.64 - *
   17.65 - * @author Tomas Zezula
   17.66 - */
   17.67 -@ServiceProvider(service = RequestHandler.class)
   17.68 -public class GetFileContentHandler extends BasicRequestHandler<JavacQuery, JavacMessageType, FileContentResult>{
   17.69 -    public GetFileContentHandler() {
   17.70 -        super(JavacModels.END_POINT, JavacMessageType.getfile, JavacQuery.class, FileContentResult.class);
   17.71 -    }
   17.72 -
   17.73 -    @Override
   17.74 -    protected Status handle(JavacQuery request, FileContentResult response) {
   17.75 -        Parameters.notNull("request", request); //NOI18N
   17.76 -        Parameters.notNull("response", response);   //NOI18N
   17.77 -        final Context ctx = request.getContext();
   17.78 -        Status status = Status.done;
   17.79 -        if (ctx != null) {
   17.80 -            final WorkspaceResolver resolver = Lookup.getDefault().lookup(WorkspaceResolver.class);
   17.81 -            if(resolver == null) {
   17.82 -                throw new IllegalStateException("No WorkspaceResolver in Lookup");  //NOI18N
   17.83 -            }
   17.84 -            final FileObject fo = resolver.resolveFile(new WorkspaceResolver.Context(
   17.85 -                 ctx.getUser(),
   17.86 -                 ctx.getWorkspace(),
   17.87 -                 ctx.getPath()));
   17.88 -            if (fo != null) {
   17.89 -                try {
   17.90 -                    response.setContent(fo.asText("UTF-8"));
   17.91 -                } catch (IOException ex) {
   17.92 -                    status = Status.runtime_error;
   17.93 -                }
   17.94 -            } else {
   17.95 -                status = Status.not_found;
   17.96 -            }
   17.97 -        }
   17.98 -        return status;
   17.99 -    }
  17.100 -}
    18.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/project/IORedirectProvider.java	Tue Jan 28 11:07:53 2014 +0100
    18.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/project/IORedirectProvider.java	Tue Jan 28 22:00:22 2014 +0100
    18.3 @@ -43,7 +43,6 @@
    18.4  package org.netbeans.modules.dew4nb.services.project;
    18.5  
    18.6  import java.io.IOException;
    18.7 -import java.io.OutputStream;
    18.8  import java.io.PrintWriter;
    18.9  import java.io.Reader;
   18.10  import java.io.Writer;
   18.11 @@ -53,9 +52,6 @@
   18.12  import org.netbeans.api.annotations.common.NullAllowed;
   18.13  import org.netbeans.modules.dew4nb.endpoint.EndPoint;
   18.14  import org.netbeans.modules.dew4nb.endpoint.Status;
   18.15 -import org.netbeans.modules.dew4nb.services.javac.InvokeProjectActionResult;
   18.16 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
   18.17 -import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
   18.18  import org.openide.util.Parameters;
   18.19  import org.openide.util.lookup.ServiceProvider;
   18.20  import org.openide.windows.IOProvider;
   18.21 @@ -308,7 +304,7 @@
   18.22              @NullAllowed final String stdOut,
   18.23              @NullAllowed final String stdErr) {
   18.24          Parameters.notNull("env", env); //NOI18N
   18.25 -        final JavacMessageType type = env.getProperty(PROP_TYPE, JavacMessageType.class);
   18.26 +        final ProjectMessageType type = env.getProperty(PROP_TYPE, ProjectMessageType.class);
   18.27          Parameters.notNull("type", type); //NOI18N
   18.28          final String state = env.getProperty(PROP_STATE, String.class);
   18.29          Parameters.notNull("state", state); //NOI18N
    19.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/project/InvokeProjectActionHandler.java	Tue Jan 28 11:07:53 2014 +0100
    19.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/project/InvokeProjectActionHandler.java	Tue Jan 28 22:00:22 2014 +0100
    19.3 @@ -46,13 +46,9 @@
    19.4  import org.netbeans.api.project.FileOwnerQuery;
    19.5  import org.netbeans.api.project.Project;
    19.6  import org.netbeans.modules.dew4nb.endpoint.AsyncRequestHandler;
    19.7 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
    19.8  import org.netbeans.modules.dew4nb.endpoint.EndPoint;
    19.9  import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
   19.10  import org.netbeans.modules.dew4nb.endpoint.Status;
   19.11 -import org.netbeans.modules.dew4nb.services.javac.Context;
   19.12 -import org.netbeans.modules.dew4nb.services.javac.JavacModels;
   19.13 -import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
   19.14  import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
   19.15  import org.netbeans.spi.project.ActionProvider;
   19.16  import org.openide.filesystems.FileObject;
   19.17 @@ -65,15 +61,15 @@
   19.18   * @author Tomas Zezula
   19.19   */
   19.20  @ServiceProvider(service = RequestHandler.class)
   19.21 -public class InvokeProjectActionHandler extends AsyncRequestHandler<JavacQuery, JavacMessageType> {
   19.22 +public class InvokeProjectActionHandler extends AsyncRequestHandler<ProjectAction, ProjectMessageType> {
   19.23  
   19.24      public InvokeProjectActionHandler() {
   19.25 -        super(JavacModels.END_POINT, JavacMessageType.invokeAction, JavacQuery.class);
   19.26 +        super(ProjectModels.END_POINT, ProjectMessageType.invokeAction, ProjectAction.class);
   19.27      }
   19.28  
   19.29      @Override
   19.30 -    protected Status handle(final JavacQuery request, final EndPoint.Env env) {
   19.31 -        if (request.getType() != JavacMessageType.invokeAction) {
   19.32 +    protected Status handle(final ProjectAction request, final EndPoint.Env env) {
   19.33 +        if (request.getType() != ProjectMessageType.invokeAction) {
   19.34              throw new IllegalStateException(String.format(
   19.35                  "Illegal message type: %s", //NOI18N
   19.36                  request.getType()));
   19.37 @@ -106,7 +102,7 @@
   19.38                              IORedirectProvider.bindEnv(env);
   19.39                              try {
   19.40                                  ap.invokeAction(
   19.41 -                                    request.getJava(),
   19.42 +                                    request.getAction(),
   19.43                                      Lookups.fixed(file, prj));
   19.44                              } finally {
   19.45                                  IORedirectProvider.unbindEnv();
    20.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/project/IsProjectActionEnabledHandler.java	Tue Jan 28 11:07:53 2014 +0100
    20.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/project/IsProjectActionEnabledHandler.java	Tue Jan 28 22:00:22 2014 +0100
    20.3 @@ -48,14 +48,9 @@
    20.4  import org.netbeans.api.annotations.common.NonNull;
    20.5  import org.netbeans.api.project.FileOwnerQuery;
    20.6  import org.netbeans.api.project.Project;
    20.7 -import org.netbeans.modules.dew4nb.services.javac.JavacMessageType;
    20.8  import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
    20.9  import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
   20.10  import org.netbeans.modules.dew4nb.endpoint.Status;
   20.11 -import org.netbeans.modules.dew4nb.services.javac.Context;
   20.12 -import org.netbeans.modules.dew4nb.services.javac.IsProjectActionEnabledResult;
   20.13 -import org.netbeans.modules.dew4nb.services.javac.JavacModels;
   20.14 -import org.netbeans.modules.dew4nb.services.javac.JavacQuery;
   20.15  import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
   20.16  import org.netbeans.spi.project.ActionProvider;
   20.17  import org.openide.filesystems.FileObject;
   20.18 @@ -68,16 +63,16 @@
   20.19   * @author Tomas Zezula
   20.20   */
   20.21  @ServiceProvider(service = RequestHandler.class)
   20.22 -public class IsProjectActionEnabledHandler extends BasicRequestHandler<JavacQuery, JavacMessageType, IsProjectActionEnabledResult> {
   20.23 +public class IsProjectActionEnabledHandler extends BasicRequestHandler<ProjectAction, ProjectMessageType, IsProjectActionEnabledResult> {
   20.24  
   20.25      public IsProjectActionEnabledHandler() {
   20.26 -        super(JavacModels.END_POINT, JavacMessageType.isActionEnabled, JavacQuery.class, IsProjectActionEnabledResult.class);
   20.27 +        super(ProjectModels.END_POINT, ProjectMessageType.isActionEnabled, ProjectAction.class, IsProjectActionEnabledResult.class);
   20.28      }
   20.29  
   20.30      @Override
   20.31 -    protected Status handle(@NonNull final JavacQuery request, @NonNull final IsProjectActionEnabledResult response) {
   20.32 -        final JavacMessageType requestType = request.getType();
   20.33 -        if (requestType != JavacMessageType.isActionEnabled) {
   20.34 +    protected Status handle(@NonNull final ProjectAction request, @NonNull final IsProjectActionEnabledResult response) {
   20.35 +        final ProjectMessageType requestType = request.getType();
   20.36 +        if (requestType != ProjectMessageType.isActionEnabled) {
   20.37              throw new IllegalStateException(String.valueOf(requestType));
   20.38          }
   20.39          final WorkspaceResolver resolver = Lookup.getDefault().lookup(WorkspaceResolver.class);
   20.40 @@ -98,7 +93,7 @@
   20.41              if (p != null) {
   20.42                  final ActionProvider ap = p.getLookup().lookup(ActionProvider.class);
   20.43                  if (ap != null) {
   20.44 -                    final String commandName = request.getJava();
   20.45 +                    final String commandName = request.getAction();
   20.46                      if (commandName != null) {
   20.47                          final Collection<String> actions = new HashSet<>(Arrays.asList(ap.getSupportedActions()));
   20.48                          if (actions.contains(commandName)) {
   20.49 @@ -113,5 +108,4 @@
   20.50          response.setEnabled(enabled);
   20.51          return Status.done;
   20.52      }
   20.53 -
   20.54  }
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/project/ProjectEndPoint.java	Tue Jan 28 22:00:22 2014 +0100
    21.3 @@ -0,0 +1,66 @@
    21.4 +/*
    21.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    21.6 + *
    21.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
    21.8 + *
    21.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   21.10 + * Other names may be trademarks of their respective owners.
   21.11 + *
   21.12 + * The contents of this file are subject to the terms of either the GNU
   21.13 + * General Public License Version 2 only ("GPL") or the Common
   21.14 + * Development and Distribution License("CDDL") (collectively, the
   21.15 + * "License"). You may not use this file except in compliance with the
   21.16 + * License. You can obtain a copy of the License at
   21.17 + * http://www.netbeans.org/cddl-gplv2.html
   21.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   21.19 + * specific language governing permissions and limitations under the
   21.20 + * License.  When distributing the software, include this License Header
   21.21 + * Notice in each file and include the License file at
   21.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   21.23 + * particular file as subject to the "Classpath" exception as provided
   21.24 + * by Oracle in the GPL Version 2 section of the License file that
   21.25 + * accompanied this code. If applicable, add the following below the
   21.26 + * License Header, with the fields enclosed by brackets [] replaced by
   21.27 + * your own identifying information:
   21.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   21.29 + *
   21.30 + * If you wish your version of this file to be governed by only the CDDL
   21.31 + * or only the GPL Version 2, indicate your decision by adding
   21.32 + * "[Contributor] elects to include this software in this distribution
   21.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   21.34 + * single choice of license, a recipient has the option to distribute
   21.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   21.36 + * to extend the choice of license to its licensees as provided above.
   21.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   21.38 + * Version 2 license, then the option applies only if the new code is
   21.39 + * made subject to such option by the copyright holder.
   21.40 + *
   21.41 + * Contributor(s):
   21.42 + *
   21.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
   21.44 + */
   21.45 +
   21.46 +package org.netbeans.modules.dew4nb.services.project;
   21.47 +
   21.48 +import org.netbeans.api.annotations.common.NonNull;
   21.49 +import org.netbeans.modules.dew4nb.endpoint.EndPoint;
   21.50 +import org.openide.util.Parameters;
   21.51 +import org.openide.util.lookup.ServiceProvider;
   21.52 +
   21.53 +/**
   21.54 + *
   21.55 + * @author Tomas Zezula
   21.56 + */
   21.57 +@ServiceProvider(service = EndPoint.class)
   21.58 +public final class ProjectEndPoint extends EndPoint<ProjectAction, ProjectMessageType> {
   21.59 +
   21.60 +    public ProjectEndPoint() {
   21.61 +        super(ProjectModels.END_POINT, ProjectAction.class, ProjectMessageType.class);
   21.62 +    }    
   21.63 +
   21.64 +    @Override
   21.65 +    protected ProjectMessageType getRequestKind(@NonNull final ProjectAction query) {
   21.66 +        Parameters.notNull("query", query); //NOI18N
   21.67 +        return query.getType();
   21.68 +    }
   21.69 +}
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/project/ProjectMessageType.java	Tue Jan 28 22:00:22 2014 +0100
    22.3 @@ -0,0 +1,52 @@
    22.4 +/*
    22.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    22.6 + *
    22.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
    22.8 + *
    22.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   22.10 + * Other names may be trademarks of their respective owners.
   22.11 + *
   22.12 + * The contents of this file are subject to the terms of either the GNU
   22.13 + * General Public License Version 2 only ("GPL") or the Common
   22.14 + * Development and Distribution License("CDDL") (collectively, the
   22.15 + * "License"). You may not use this file except in compliance with the
   22.16 + * License. You can obtain a copy of the License at
   22.17 + * http://www.netbeans.org/cddl-gplv2.html
   22.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   22.19 + * specific language governing permissions and limitations under the
   22.20 + * License.  When distributing the software, include this License Header
   22.21 + * Notice in each file and include the License file at
   22.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   22.23 + * particular file as subject to the "Classpath" exception as provided
   22.24 + * by Oracle in the GPL Version 2 section of the License file that
   22.25 + * accompanied this code. If applicable, add the following below the
   22.26 + * License Header, with the fields enclosed by brackets [] replaced by
   22.27 + * your own identifying information:
   22.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   22.29 + *
   22.30 + * If you wish your version of this file to be governed by only the CDDL
   22.31 + * or only the GPL Version 2, indicate your decision by adding
   22.32 + * "[Contributor] elects to include this software in this distribution
   22.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   22.34 + * single choice of license, a recipient has the option to distribute
   22.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   22.36 + * to extend the choice of license to its licensees as provided above.
   22.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   22.38 + * Version 2 license, then the option applies only if the new code is
   22.39 + * made subject to such option by the copyright holder.
   22.40 + *
   22.41 + * Contributor(s):
   22.42 + *
   22.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
   22.44 + */
   22.45 +
   22.46 +package org.netbeans.modules.dew4nb.services.project;
   22.47 +
   22.48 +/**
   22.49 + *
   22.50 + * @author Tomas Zezula
   22.51 + */
   22.52 +public enum ProjectMessageType {
   22.53 +    isActionEnabled,
   22.54 +    invokeAction
   22.55 +}
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/project/ProjectModels.java	Tue Jan 28 22:00:22 2014 +0100
    23.3 @@ -0,0 +1,95 @@
    23.4 +/*
    23.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    23.6 + *
    23.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
    23.8 + *
    23.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   23.10 + * Other names may be trademarks of their respective owners.
   23.11 + *
   23.12 + * The contents of this file are subject to the terms of either the GNU
   23.13 + * General Public License Version 2 only ("GPL") or the Common
   23.14 + * Development and Distribution License("CDDL") (collectively, the
   23.15 + * "License"). You may not use this file except in compliance with the
   23.16 + * License. You can obtain a copy of the License at
   23.17 + * http://www.netbeans.org/cddl-gplv2.html
   23.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   23.19 + * specific language governing permissions and limitations under the
   23.20 + * License.  When distributing the software, include this License Header
   23.21 + * Notice in each file and include the License file at
   23.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   23.23 + * particular file as subject to the "Classpath" exception as provided
   23.24 + * by Oracle in the GPL Version 2 section of the License file that
   23.25 + * accompanied this code. If applicable, add the following below the
   23.26 + * License Header, with the fields enclosed by brackets [] replaced by
   23.27 + * your own identifying information:
   23.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   23.29 + *
   23.30 + * If you wish your version of this file to be governed by only the CDDL
   23.31 + * or only the GPL Version 2, indicate your decision by adding
   23.32 + * "[Contributor] elects to include this software in this distribution
   23.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   23.34 + * single choice of license, a recipient has the option to distribute
   23.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   23.36 + * to extend the choice of license to its licensees as provided above.
   23.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   23.38 + * Version 2 license, then the option applies only if the new code is
   23.39 + * made subject to such option by the copyright holder.
   23.40 + *
   23.41 + * Contributor(s):
   23.42 + *
   23.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
   23.44 + */
   23.45 +
   23.46 +package org.netbeans.modules.dew4nb.services.project;
   23.47 +
   23.48 +import net.java.html.json.Model;
   23.49 +import net.java.html.json.Property;
   23.50 +import org.netbeans.modules.dew4nb.endpoint.Status;
   23.51 +
   23.52 +/**
   23.53 + *
   23.54 + * @author Tomas Zezula
   23.55 + */
   23.56 +class ProjectModels {
   23.57 +
   23.58 +    static final String END_POINT = "project";  //NO_I18N
   23.59 +
   23.60 +    @Model(className = "ProjectAction", properties = {
   23.61 +        @Property(name = "type", type = ProjectMessageType.class),
   23.62 +        @Property(name = "state", type = String.class),
   23.63 +        @Property(name = "context", type = Context.class),
   23.64 +        @Property(name = "action", type = String.class),
   23.65 +    })
   23.66 +    static final class ProjectActionModel {
   23.67 +    }
   23.68 +
   23.69 +
   23.70 +    @Model(className="IsProjectActionEnabledResult", properties = {
   23.71 +        @Property(name = "status", type = Status.class),
   23.72 +        @Property(name = "type", type = ProjectMessageType.class),
   23.73 +        @Property(name = "state", type = String.class),
   23.74 +        @Property(name = "enabled", type = Boolean.class)
   23.75 +    })
   23.76 +    static final class IsProjectActionEnabledResultModel {
   23.77 +    }
   23.78 +
   23.79 +    @Model(className = "InvokeProjectActionResult", properties = {
   23.80 +        @Property(name = "status", type = Status.class),
   23.81 +        @Property(name = "type", type = ProjectMessageType.class),
   23.82 +        @Property(name = "state", type = String.class),
   23.83 +        @Property(name = "result", type = BuildResult.class),
   23.84 +        @Property(name = "stdout", type = String.class, array = true),
   23.85 +        @Property(name = "stderr", type = String.class, array = true),
   23.86 +        @Property(name = "openUrl", type = String.class, array = true)
   23.87 +    })
   23.88 +    static final class InvokeProjectActionResultModel {
   23.89 +    }
   23.90 +
   23.91 +    @Model(className = "Context", properties = {
   23.92 +        @Property(name="user", type=String.class),
   23.93 +        @Property(name = "workspace", type = String.class),
   23.94 +        @Property(name = "path", type = String.class)
   23.95 +    })
   23.96 +    static final class ContextModel {
   23.97 +    }
   23.98 +}