Package javax.microedition.content

Examples of javax.microedition.content.ActionNameMap


                throw new IllegalArgumentException("no actions");
            }
            int len = actions.length;
            for (int i = 0; i < actionnames.length; i++) {
                // Verify the actions are the same
                ActionNameMap map = actionnames[i];
                if (len != map.size()) {
                    throw new IllegalArgumentException("actions not identical");
                }

                for (int j = 0; j < len; j++) {
                    if (!actions[j].equals(map.getAction(j))) {
                        throw new
                            IllegalArgumentException("actions not identical");
                    }
                }

                /*
                 * Verify the locale of this ActionNameMap is not the same
                 * as any previous ActionNameMap.
                 */
                for (int j = 0; j < i; j++) {
                    if (map.getLocale().equals(actionnames[j].getLocale())) {
                        throw new IllegalArgumentException("duplicate locale");
                    }
                }
            }
        }
View Full Code Here


                                 index * getActions().length,
                                 temp,
                                 0,
                                 getActions().length);

                actionnames[index] = new ActionNameMap(getActions(),
                                                       temp,
                                                       locales[index]);
            }
        }
        return actionnames;
View Full Code Here

            String localeValue = appl.getProperty(localeAttr);
            if (localeValue == null) {
                throw new IllegalArgumentException("missing locale");
            }
            String[] actionnames = split(localeValue, ',');
            ActionNameMap map =
                new ActionNameMap(actions, actionnames, locales[i]);
            maps.addElement(map);
        }
        if (maps.size() > 0) {
            ActionNameMap[] result = new ActionNameMap[maps.size()];
            maps.copyInto(result);
View Full Code Here

     */
    ContentHandlerImpl makeFull() {

        ActionNameMap [] actionnames = new ActionNameMap[2];
        actionnames[0] =
            new ActionNameMap(actions, enActionNames, "en_US");
        actionnames[1] =
            new ActionNameMap(actions, frActionNames, "fr_CH");

        ContentHandlerImpl ch = new ContentHandlerImpl(types, suffixes, actions,
                                                       actionnames, "ID-1",
                                                       accessRestricted,
                                                       "authority");
View Full Code Here

     * Test NullPointerException cases.
     */
    void test003() {


  ActionNameMap map;
  map = new ActionNameMap(oneString, oneNameString, locale);
 
  try {
      String a = map.getActionName(null);
      fail("getActionName(null) must throw npe");
  } catch (NullPointerException npe) {
      assertNotNull("verify exception occurred", npe);
  }
  try {
      String a = map.getAction(null);
      fail("getActionName(null) must throw npe");
  } catch (NullPointerException npe) {
      assertNotNull("verify exception occurred", npe);
  }

View Full Code Here

     * @param actionnames the array of actionnames
     * @param locale the locale
     */
    void assertLegal(String message,
    String[] actions, String[]actionnames, String locale) {
  ActionNameMap map;
  map = new ActionNameMap(actions, actionnames, locale);

  int size = map.size();
  assertEquals(message, actions.length, size);
  assertEquals(message, actionnames.length, size);
  assertEquals(message, locale, map.getLocale());

  for (int i = 0; i < size; i++) {
      assertEquals(message, actions[i], map.getAction(i));
  }

  for (int i = 0; i < size; i++) {
      assertEquals(message, actionnames[i], map.getActionName(i));
  }

  for (int i = 0; i < size; i++) {
      assertEquals(message, actionnames[i],
       map.getActionName(actions[i]));
  }

  for (int i = 0; i < size; i++) {
      assertEquals(message, actions[i], map.getAction(actionnames[i]));
  }
    }
View Full Code Here

     * @param expected the expected exception
     */
    void assertIllegal(String message,
           String[] actions, String[]actionnames, String locale,
           Exception expected) {
  ActionNameMap map;
  try {
      map = new ActionNameMap(actions, actionnames, locale);
      // Always report an error
      assertEquals("MUST throw an exception", null, map);
   } catch (IllegalArgumentException ill) {
      assertEquals(message, expected.getClass().getName(),
      ill.getClass().getName());
View Full Code Here

TOP

Related Classes of javax.microedition.content.ActionNameMap

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.