ko-bck2brwsr/src/main/java/org/apidesign/html/ko2brwsr/BrwsrCntxtPrvdr.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 01 May 2013 07:06:43 +0200
changeset 1194 3213724a4996
parent 1189 9f8b07dcbe79
permissions -rw-r--r--
Making more things private, removing KOList and providing some fake Javadoc
jaroslav@1189
     1
/**
jaroslav@1189
     2
 * HTML via Java(tm) Language Bindings
jaroslav@1189
     3
 * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1189
     4
 *
jaroslav@1189
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1189
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1189
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1189
     8
 *
jaroslav@1189
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1189
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1189
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1189
    12
 * GNU General Public License for more details. apidesign.org
jaroslav@1189
    13
 * designates this particular file as subject to the
jaroslav@1189
    14
 * "Classpath" exception as provided by apidesign.org
jaroslav@1189
    15
 * in the License file that accompanied this code.
jaroslav@1189
    16
 *
jaroslav@1189
    17
 * You should have received a copy of the GNU General Public License
jaroslav@1189
    18
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1189
    19
 * If not, see http://wiki.apidesign.org/wiki/GPLwithClassPathException
jaroslav@1189
    20
 */
jaroslav@1189
    21
package org.apidesign.html.ko2brwsr;
jaroslav@1189
    22
jaroslav@1189
    23
import net.java.html.json.Context;
jaroslav@1189
    24
import org.apidesign.bck2brwsr.core.JavaScriptBody;
jaroslav@1189
    25
import org.apidesign.html.json.spi.ContextProvider;
jaroslav@1189
    26
import org.openide.util.lookup.ServiceProvider;
jaroslav@1189
    27
jaroslav@1194
    28
/** This is an implementation package - just
jaroslav@1194
    29
 * include its JAR on classpath and use official {@link Context} API
jaroslav@1194
    30
 * to access the functionality.
jaroslav@1194
    31
 * <p>
jaroslav@1194
    32
 * Provides binding between models and <a href="http://bck2brwsr.apidesign.org">
jaroslav@1194
    33
 * Bck2Brwsr</a> VM.
jaroslav@1194
    34
 * Registers {@link ContextProvider}, so {@link ServiceLoader} can find it.
jaroslav@1189
    35
 *
jaroslav@1194
    36
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@1189
    37
 */
jaroslav@1189
    38
@ServiceProvider(service = ContextProvider.class)
jaroslav@1189
    39
public final class BrwsrCntxtPrvdr implements ContextProvider {
jaroslav@1189
    40
    @Override
jaroslav@1189
    41
    public Context findContext(Class<?> requestor) {
jaroslav@1189
    42
        return bck2BrwsrVM() ? BrwsrCntxt.DEFAULT : null;
jaroslav@1189
    43
    }
jaroslav@1189
    44
    
jaroslav@1189
    45
    @JavaScriptBody(args = {  }, body = "return true;")
jaroslav@1189
    46
    private static boolean bck2BrwsrVM() {
jaroslav@1189
    47
        return false;
jaroslav@1189
    48
    }
jaroslav@1189
    49
}