Examples of MapElement


Examples of com.sun.enterprise.tools.common.dd.connector.MapElement

    public void setAttributeDetail(Object v, int r, int c) {
        String input = null;
        if (c != 3)
            input = (String) v;
        while (r >= getLength()) {
            MapElement nme = new MapElement();
            nme.setBackendPrincipal(true);
            rm.addMapElement(nme);
            Reporter.info("add a MapElement")//NOI18N
        }
        MapElement me = rm.getMapElement(r);
        if ((c != 3 &&(null == input || 0 == input.trim().length())) || (c == 3 && ((Vector)v).size() == 0)) {
            // test for need to delete
            if (r >= getLength())
                return;
           
            boolean rowHasValue = false;
            String value = null;
            if (c != 0) {
                value = me.getAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "user-name"); //NOI18N
                if (null != value && value.trim().length() > 0)
                    rowHasValue = true;
            }
            if (c != 1) {
                value = me.getAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "password"); //NOI18N
                if (null != value && value.trim().length() > 0)
                    rowHasValue = true;
            }
            if (c != 2) {
                value = me.getAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "credential"); //NOI18N
                if (null != value && value.trim().length() > 0)
                    rowHasValue = true;
            }
            if (c != 3) {
                if (0 != me.sizePrincipal())
                    rowHasValue = true;
            }
           
//            int otherDex = c - 1;
//            if (otherDex < 0)
//                otherDex = -otherDex;
//            String otherVal = ra.getAttributeValue(ResourceAdapter.PROPERTY, r, //NOI18N
//                intToAttribute(otherDex));
//            String otherVal = ra.getAttributeValue(ResourceAdapter.PROPERTY, r, //NOI18N
//                intToAttribute(otherDex));
            if (!rowHasValue) {
                Reporter.info("remove a MapElement");   //NOI18N
                rm.removeMapElement(me);
                return;
            }
//                ra.removePropertyElement(r);
//                return;
//            }
//            input = " ";
        }
        while (r >= getLength()) {
            Reporter.info("add a MapElement");   //NOI18N
            me = new MapElement();
            me.setBackendPrincipal(true);
            rm.addMapElement(me);
        }
       if (0 == c)
           me.setAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "user-name", (String) v); //NOI18N
       if (1 == c)
           me.setAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "password", (String) v); //NOI18N
       if (2 == c)
           me.setAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "credential",(String) v); //NOI18N
        if (3 == c) {
/*           
            java.util.StringTokenizer toker =
                new java.util.StringTokenizer((String)v,","); // NOI18N
            Principal[] ps = new Principal[toker.countTokens()];
            int i = 0;
            while (toker.hasMoreTokens()) {
                String tok = toker.nextToken();
                Principal p = new Principal();
                p.setAttributeValue("user-name",tok); //NOI18N
                ps[i] = p;
                i++;
            }
            me.setPrincipal(ps);
*/
            Vector vec = (Vector)v;
            Reporter.info(new Integer(vec.size()));
            Principal[] principals = new Principal[vec.size()];
            for (int i = 0; i < vec.size(); i++) {
                Principal prin = new Principal();
                String[] principal = (String[])vec.elementAt(i);
//                Reporter.info("(" + principal[0] + ")   (" + principal[1] + ")");   //NOI18N
                prin.setAttributeValue("user-name", principal[0])//NOI18N
                prin.setDescription(principal[1]);
                principals[i] = prin;
            }
            me.setPrincipal(principals);
//            Reporter.info(new Integer(me.sizePrincipal()));
        }
            //ra.addPropertyElement(true);
        //System.out.println("SETAttributeDetail on " + ra.hashCode()); //NOI18N
        //ra.setPropertyElement(r,true);
View Full Code Here

Examples of com.sun.enterprise.tools.common.dd.connector.MapElement

            }
        }
        rm = new RoleMap();
        int unameVal = 100;
        for (int i = 0; i < rowCount; i++) {
            MapElement me = new MapElement();
            me.setBackendPrincipal(true);
            me.setAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "user-name", ""+i); //NOI18N
            me.setAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "password", ""+i); //NOI18N
            me.setAttributeValue(MapElement.BACKEND_PRINCIPAL, 0, "credential", ""+i); //NOI18N
            for (int j = 0; j < rowCount; j++) {
                Principal p = new Principal();
                p.setAttributeValue("user-name", ""+unameVal); //NOI18N
                unameVal++;
                me.addPrincipal(p);
            }
            rm.addMapElement(me);
           
            //ra.addPropertyElement(true);
            //ra.setAttributeValue(ResourceAdapter.PROPERTY,i,"name",""+i); //NOI18N
View Full Code Here

Examples of jifx.commons.mapper.domain.MapElement

     * @see jifx.connection.mapper.Mapper#getMap(java.lang.String)
     */
    public MapElement getMapElement(String context, String key) {
        try {
          Query query = manager.createQuery("from MapElement m where m.context='"+context+"' and m.key='"+key+"'");
          MapElement mapElement = (MapElement) query.getSingleResult();
          return mapElement;
        } catch(NoResultException e) {
          return null;
        }
    }
View Full Code Here

Examples of jifx.commons.mapper.domain.MapElement

      env.put("java.naming.factory.initial",
        "org.jboss.naming.NamingContextFactory");
      env.put("java.naming.provider.url", "localhost:1099");
      context = new InitialContext(env);
      IMapper remote = (IMapper) context.lookup("MapperImp/remote");
      MapElement element = new MapElement();
      element.setKey("858");
      element.setValue("UY");
      element.setDescription("C�digo de moneda en pesos");
      remote.addMapping(element);
      MapElement mm = remote.getMapElement("m","858");
      System.out.println("Moneda: " + mm.getValue());
  } catch (NamingException e) {
      e.printStackTrace();
  }
    }
View Full Code Here

Examples of jifx.commons.mapper.domain.MapElement

          if (matcher.matches()) {
            String ctx = matcher.group(1);
            String valKey = matcher.group(2);
            if (matcher.groupCount() > 2) {    //Ejecuta com. de tipo $M{ctx, $valKey(idx)}
              int idx = Integer.valueOf(matcher.group(3));
              MapElement element = mapper.getMapElement(ctx, variables.get(valKey)[idx]);
              if (element != null)
                valorObtenido = element.getValue();
            } else {              //Ejecuta com. de tipo $M{ctx, valKey}
              MapElement element = mapper.getMapElement(ctx, valKey);
              if (element != null)
                valorObtenido = element.getValue();
            }
          }
        }
        else
        if (tipoKey.equals("F")) {          //Ejecuta com. de tipo $F{SYSDATE}
View Full Code Here

Examples of net.alteiar.beans.map.elements.MapElement

    if (!CampaignClient.getInstance().getCurrentPlayer().isDm()) {
      Iterator<MapElement> itt = elements.iterator();

      while (itt.hasNext()) {
        MapElement current = itt.next();
        if (current.isHiddenForPlayer()) {
          itt.remove();
        }
      }
    }
    return elements;
View Full Code Here

Examples of net.alteiar.beans.map.elements.MapElement

    dlg.setLocation(MouseInfo.getPointerInfo().getLocation());
    dlg.pack();
    dlg.setVisible(true);

    if (dlg.getReturnStatus() == DialogOkCancel.RET_OK) {
      MapElement element = dlg.getMainPanel().buildElement(position);
      MapElementFactory.buildMapElement(element, map);
    }
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.MapElement

    dlg.pack();
    dlg.setVisible(true);

    if (dlg.getReturnStatus() == DialogOkCancel.RET_OK) {

      MapElement element = dlg.getMainPanel().buildElement(
          event.getFixToGridPosition());
      MapElementFactory.buildMapElement(element, map);
    }
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.MapElement

    this.state = state;
  }

  @Override
  public void mouseClicked(MouseEvent e, Drawable draw) {
    MapElement element = ((MapElementDrawable) draw).getMapElement();
    state.mouseClicked(e, element);
  }
View Full Code Here

Examples of net.alteiar.beans.map.elements.MapElement

  public List<MapElement> getElementsAt(Point position) {
    ArrayList<MapElement> elementsAt = new ArrayList<MapElement>();
    HashSet<UniqueID> elements = getElements();

    for (UniqueID id : elements) {
      MapElement element = CampaignClient.getInstance().getBean(id);
      if (element != null && element.contain(position)) {
        elementsAt.add(element);
      }
    }

    return elementsAt;
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.