Examples of StringProvider


Examples of com.esri.gpt.framework.http.StringProvider

  /**
   * Gets content provider.
   * @return content provider for POST request, <code>null</code> for GET request
   */
  public ContentProvider getContentProvider() {
    return content.length() > 0 ? new StringProvider(content, "UTF-8") : null;
  }
View Full Code Here

Examples of com.sun.jersey.core.impl.provider.entity.StringProvider

  }

  @Test
  public void testCanonicalRepresentation_Client_AllFields_Post() throws Exception {

    MessageBodyWriter<String> messageBodyWriter = new StringProvider();

    // Mock Providers
    Providers providers = mock(Providers.class);
    when(providers.getMessageBodyWriter(String.class, String.class,
      new Annotation[0], MediaType.APPLICATION_JSON_TYPE)).thenReturn(messageBodyWriter);
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

  private class BasicMenuItem extends MenuItem {
    private Runnable _action;

    public BasicMenuItem(String label, Runnable action) {
      super(new StringProvider(label), 0, 100);
      _action = action;
      setIcon(ImageFactory.createImage("img/search.png"));
    }
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

                        "Select 'View Map' from the menu.  The MapView object is set to Zoom Level 3. Location is Ottawa, ON, Canada at Latitude 45.42349, Longitude -75.69792");
        add(instructions);

        // Invokes BlackBerry Maps application using a MapView object
        final MenuItem viewMapItem =
                new MenuItem(new StringProvider("View Map"), 0x230010, 0);
        viewMapItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

                        0);
        _views[5].add(_views[6]);
        add(_views[5]);

        final MenuItem cancelItem =
                new MenuItem(new StringProvider("Cancel spinners "), 0x230020,
                        0);
        cancelItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    _views[i].getModel().cancel();
                }
            }
        }));

        final MenuItem resetItem =
                new MenuItem(new StringProvider("Reset spinners "), 0x230030, 0);
        resetItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    _views[i].getModel().reset();
                }
            }
        }));

        final MenuItem resumeItem =
                new MenuItem(new StringProvider("Resume spinners "), 0x230040,
                        0);
        resumeItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    _views[i].getModel().resume();
                }
            }
        }));

        final MenuItem delayedStop =
                new MenuItem(new StringProvider("Delayed start"), 0x230050, 0);
        delayedStop.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    final DelayedStart ds = new DelayedStart(_views[i]);
                    ds.start();
                }
            }
        }));

        final MenuItem delayedStart =
                new MenuItem(new StringProvider("Delayed stop"), 0x230060, 0);
        delayedStart.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                for (int i = _views.length - 1; i >= 0; --i) {
                    final DelayedStop ds = new DelayedStop(_views[i]);
                    ds.start();
                }
            }
        }));

        final MenuItem showPopupItem =
                new MenuItem(new StringProvider("Show Popup"), 0x230010, 0);
        showPopupItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

         * @param iconResourcePath
         *            Location of icon resource
         */
        public MenuItemWithIcon(final String label, final int priority,
                final String iconResourcePath) {
            super(new StringProvider(label), 0x230100, priority);

            if (iconResourcePath != null) {
                // Retrieve the icon resource and add it to the menu item
                final EncodedImage encodedImage =
                        EncodedImage.getEncodedImageResource(iconResourcePath);
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

            /**
             * Creates a new DemoMenuItem object
             */
            DemoMenuItem(final String text, final int ordinal,
                    final int priority) {
                super(new StringProvider(text), ordinal, priority);
            }
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

        class ImageMenuItem extends MenuItem {
            /**
             * Creates a new MenuDemoMenuItem object
             */
            ImageMenuItem() {
                super(new StringProvider("Image menu item"), 0x230100, 0);

                // Create Image object from project resource
                final Bitmap bitmap = Bitmap.getBitmapResource("img.png");
                final Image image = ImageFactory.createImage(bitmap);

View Full Code Here

Examples of net.rim.device.api.util.StringProvider

        _svg = (SVGSVGElement) _document.getDocumentElement();
        _scalableGraphics = ScalableGraphics.createInstance();

        // A menu item used to erase all elements on the screen
        final MenuItem eraseMenu =
                new MenuItem(new StringProvider("Erase Canvas"), 0x230010, 0);
        eraseMenu.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Reset the last x and y coordinates.
                _lastX = -1;
                _lastY = -1;

                // Remove all children from the svg node.
                SVGElement line = (SVGElement) _svg.getFirstElementChild();
                while (line != null) {
                    _svg.removeChild(line);
                    line = (SVGElement) _svg.getFirstElementChild();
                }

                // Indicate that the screen requires re-painting.
                invalidate();
            }
        }));

        // A menu item used to select a line color
        final MenuItem colourMenu =
                new MenuItem(new StringProvider("Change Colour"), 0x230020, 1);
        colourMenu.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                final ColorChangeDialog dialog =
                        new ColorChangeDialog(_colorIndex);

                if (dialog.doModal() == Dialog.OK) {
                    _colorIndex = dialog.getColorIndex();
                    _color = dialog.getColor(_colorIndex);
                }
            }
        }));

        // A menu item used to select a line color
        final MenuItem widthMenu =
                new MenuItem(new StringProvider("Change Width"), 0x230030, 2);
        widthMenu.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

Examples of net.rim.device.api.util.StringProvider

            add(new LabelField(strBuff.toString()));
            add(bitmapFieldScaled3);

            // Add a menu item to display an animation in a popup screen
            final MenuItem showAnimation =
                    new MenuItem(new StringProvider("Show Animation"),
                            0x230010, 0);
            showAnimation.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.