Package net.rim.device.api.browser.field2

Examples of net.rim.device.api.browser.field2.BrowserFieldHistory


            final boolean enableScriptMenu) {
        super(Manager.HORIZONTAL_SCROLL);

        addKeyListener(new BrowserFieldScreenKeyListener());

        final BrowserFieldConfig config = new BrowserFieldConfig();
        config.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
        _browserField = new BrowserField(config);
        _browserField.addListener(new DemoBrowserListener());
        add(_browserField);
        _request = request;
    }
View Full Code Here


            final String originalUrl) {
        _originalUrl = originalUrl;

        setTitle("Connection Details");

        final BrowserFieldConfig browserFieldConfig = new BrowserFieldConfig();

        // Enable caret navigation mode
        browserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
                BrowserFieldConfig.NAVIGATION_MODE_NODE);

        // Disable JavaScript
        browserFieldConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED,
                Boolean.FALSE);

        _browserField = new BrowserField(browserFieldConfig);

        add(new SeparatorField());
View Full Code Here

    }
   
    public static byte[] requestBitmapBytes(String uri) throws Exception {
        BrowserField browserField = (BrowserField) BBMPlatformExtension._browserField.get();
        final BrowserFieldConfig bfConfig = browserField.getConfig();
        final BrowserFieldController bfController =
                (BrowserFieldController) bfConfig.getProperty(BrowserFieldConfig.CONTROLLER);
       
        InputConnection ic = null;
        DataInputStream is = null;
       
        try {
            final BrowserFieldRequest bfReq = new BrowserFieldRequest(uri);
            ic = bfController.handleResourceRequest(bfReq);
            is = ic.openDataInputStream();
           
            final ByteVector bmpBytes = new ByteVector();
            try {
                while(true) {
View Full Code Here

                DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();

                // Parse
                Object o = bfConfig.getProperty( BrowserFieldConfig.CONTROLLER );
                if( o instanceof BrowserFieldController ) {
                    BrowserFieldController bfController = (BrowserFieldController) o;

                    // Create request for config.xml file
                    BrowserFieldRequest request = new BrowserFieldRequest( WidgetUtil.getLocalPath( _configXML ) );
                    InputConnection inputConn = bfController.handleResourceRequest( request );

                    // Create a Document object out of the config.xml
                    _configXMLDoc = docBuilder.parse( inputConn.openDataInputStream() );
                }
View Full Code Here

                keyChar(final char key, final int status, final int time) {
            if (key == 'n') {
                final Runnable nextRunnable = new Runnable() {
                    public void run() {
                        try {
                            final BrowserFieldHistory browserFieldHistory =
                                    getBrowserField().getHistory();
                            if (browserFieldHistory.canGoForward()) {
                                browserFieldHistory.goForward();
                            }
                        } catch (final Exception e) {
                            System.out.println("Error executing js:next(): "
                                    + e.getMessage());
                        }
                    }
                };
                new Thread(nextRunnable).start();
                return true;
            } else if (key == 'p' || key == Characters.ESCAPE) {
                final Runnable previousRunnable = new Runnable() {
                    public void run() {
                        try {
                            final BrowserFieldHistory browserFieldHistory =
                                    getBrowserField().getHistory();
                            if (browserFieldHistory.canGoBack()) {
                                browserFieldHistory.goBack();
                            } else {
                                if (key == Characters.ESCAPE) {
                                    synchronized (Application.getEventLock()) {
                                        close();
                                    }
View Full Code Here

        // Check if Basic authentication is required to access the resource
        boolean authenticationIsNeeded = false;
        while( isAuthenticationNeeded( ic, request ) ) {
            authenticationIsNeeded = true;
            BrowserFieldRequest authenticationReq = Authenticator.getAuthenticationRequest( (HttpConnection) ic, request );
            if( authenticationReq == request ) {
                break;
            }
            ic = super.handleResourceRequest( authenticationReq );
        }
View Full Code Here

    private static final String LOCAL_PROTOCOL = "local:///";

    public PlayerObject(final String locator, final String type, final boolean async) throws Exception {
        if (isLocalURI(locator)) {
            final BrowserFieldRequest bfRequest = new BrowserFieldRequest(locator);
            final InputStream is = AudioExtension.getBrowserFieldController().handleResourceRequest(bfRequest).openInputStream();
            _playerCtrl = new PlayerController(is, type, async);
        }
        else {
            _playerCtrl = new PlayerController(locator, async);
View Full Code Here

       
        InputConnection ic = null;
        DataInputStream is = null;
       
        try {
            final BrowserFieldRequest bfReq = new BrowserFieldRequest(uri);
            ic = bfController.handleResourceRequest(bfReq);
            is = ic.openDataInputStream();
           
            final ByteVector bmpBytes = new ByteVector();
            try {
View Full Code Here

    public Object execute( Object thiz, Object[] args ) throws Exception {
        DataInputStream dis = null;
        InputConnection ic = null;

        try {
            BrowserFieldRequest bfr = new BrowserFieldRequest( args[ 0 ].toString() );
            ic = ((BrowserFieldController)_weakReferenceBrwoserFieldController.get()).handleResourceRequest( bfr );

            dis = ic.openDataInputStream();
            ByteVector vc = new ByteVector();
View Full Code Here

        String base64AuthCredential = new String( encoded );
        HttpHeaders httpHead = request.getHeaders().cloneHeaders();
        httpHead.setProperty( "Authorization", "Basic " + base64AuthCredential );

        return new BrowserFieldRequest( request.getURL(), request.getPostData(), httpHead );
    }
View Full Code Here

TOP

Related Classes of net.rim.device.api.browser.field2.BrowserFieldHistory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.