Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.IconImpl


    }

    protected Icons getIcons(String smallIcon, String largeIcon) {
        IconsImpl icons = null;
        if (smallIcon.length() > 0 || largeIcon.length() > 0) {
            IconImpl i = new IconImpl();
            i.setSmallIcon(smallIcon);
            i.setLargeIcon(largeIcon);
            icons = new IconsImpl();
            icons.add(i);
        }
        return icons;
    }
View Full Code Here


      DescriptionGroupMetaData group = result.getDescriptionGroup();
      assertNotNull(group);
      Icons icons = group.getIcons();
      assertNotNull(icons);
     
      IconImpl icon = new IconImpl();
      icon.setSmallIcon("small");
      icon.setLargeIcon("large");
      assertEquals(new Icon[] { icon }, icons.value());
   }
View Full Code Here

      DisplayName[] expecteddns = {endn, frdn, dedn};
      assertEquals(expecteddns, displayNames.value());

      Icons icons = group.getIcons();
      assertNotNull(icons);
      IconImpl enicn = new IconImpl();
      enicn.setId("en-ear-icon-id");
      enicn.setSmallIcon("en-ear-small-icon");
      enicn.setLargeIcon("en-ear-large-icon");
      IconImpl fricn = new IconImpl();
      fricn.setLanguage("fr");
      fricn.setId("fr-ear-icon-id");
      fricn.setSmallIcon("fr-ear-small-icon");
      fricn.setLargeIcon("fr-ear-large-icon");
      IconImpl deicn = new IconImpl();
      deicn.setLanguage("de");
      deicn.setId("de-ear-icon-id");
      deicn.setSmallIcon("de-ear-small-icon");
      deicn.setLargeIcon("de-ear-large-icon");
     
      Icon[] expectedicns = {enicn, fricn, deicn};
      assertEquals(expectedicns, icons.value());
   }
View Full Code Here

      DisplayName[] expecteddns = {endn, frdn, dedn};
      assertEquals(expecteddns, displayNames.value());

      Icons icons = group.getIcons();
      assertNotNull(icons);
      IconImpl enicn = new IconImpl();
      enicn.setId("en-ear-icon-id");
      enicn.setSmallIcon("en-ear-small-icon");
      enicn.setLargeIcon("en-ear-large-icon");
      IconImpl fricn = new IconImpl();
      fricn.setLanguage("fr");
      fricn.setId("fr-ear-icon-id");
      fricn.setSmallIcon("fr-ear-small-icon");
      fricn.setLargeIcon("fr-ear-large-icon");
      IconImpl deicn = new IconImpl();
      deicn.setLanguage("de");
      deicn.setId("de-ear-icon-id");
      deicn.setSmallIcon("de-ear-small-icon");
      deicn.setLargeIcon("de-ear-large-icon");
     
      Icon[] expectedicns = {enicn, fricn, deicn};
      assertEquals(expectedicns, icons.value());
   }
View Full Code Here

      DescriptionGroupMetaData group = ear.getDescriptionGroup();
      assertNotNull(group);
      Icons icons = group.getIcons();
      assertNotNull(icons);
     
      IconImpl en = new IconImpl();
      en.setId("en-ear-icon-id");
      en.setSmallIcon("en-ear-small-icon");
      en.setLargeIcon("en-ear-large-icon");
      IconImpl fr = new IconImpl();
      fr.setLanguage("fr");
      fr.setId("fr-ear-icon-id");
      fr.setSmallIcon("fr-ear-small-icon");
      fr.setLargeIcon("fr-ear-large-icon");
      IconImpl de = new IconImpl();
      de.setLanguage("de");
      de.setId("de-ear-icon-id");
      de.setSmallIcon("de-ear-small-icon");
      de.setLargeIcon("de-ear-large-icon");
     
      Icon[] expected = {en, fr, de};
      assertEquals(expected, icons.value());
   }
View Full Code Here

      DescriptionGroupMetaData group = result.getDescriptionGroup();
      assertNotNull(group);
      Icons icons = group.getIcons();
      assertNotNull(icons);

      IconImpl icon = new IconImpl();
      icon.setSmallIcon("small");
      icon.setLargeIcon("large");
      assertEquals(new Icon[]
      {icon}, icons.value());
   }
View Full Code Here

    }

    protected Icons getIcons(String smallIcon, String largeIcon) {
        IconsImpl icons = null;
        if (smallIcon.length() > 0 || largeIcon.length() > 0) {
            IconImpl i = new IconImpl();
            i.setSmallIcon(smallIcon);
            i.setLargeIcon(largeIcon);
            icons = new IconsImpl();
            icons.add(i);
        }
        return icons;
    }
View Full Code Here

            IconsImpl icsImpl = new IconsImpl();
            descGroup.setIcons(icsImpl);
         }
         for (String large : largeIcon)
         {
            IconImpl icImpl = new IconImpl();
            icImpl.setLargeIcon(large);
            ((IconsImpl)descGroup.getIcons()).add(icImpl);
         }
      }

      // License description
      String[] licenseDescription = c.licenseDescription();
      if (licenseDescription != null)
      {
         if (md.getLicense() == null)
            md.setLicense(new LicenseMetaData());

         if (md.getLicense().getDescriptions() == null)
         {
            DescriptionsImpl descsImpl = new DescriptionsImpl();
            md.getLicense().setDescriptions(descsImpl);
         }
         for (String desc : licenseDescription)
         {
            DescriptionImpl descImpl = new DescriptionImpl();
            descImpl.setDescription(desc);
            ((DescriptionsImpl)md.getLicense().getDescriptions()).add(descImpl);
         }
      }

      // License required
      boolean licenseRequired = c.licenseRequired();
      if (md.getLicense() == null)
         md.setLicense(new LicenseMetaData());
      md.getLicense().setRequired(licenseRequired);

      // Reauthentication support
      boolean reauthenticationSupport = c.reauthenticationSupport();
      if (md.getRa() != null && md.getRa().getOutboundRa() != null)
      {
         md.getRa().getOutboundRa().setReAuthSupport(reauthenticationSupport);
      }

      // RequiredWorkContext
      Class<? extends WorkContext>[] requiredWorkContexts = c.requiredWorkContexts();
      if (requiredWorkContexts != null)
      {
         for (Class<? extends WorkContext> requiredWorkContext : requiredWorkContexts)
         {
            if (md instanceof JCA16Base)
            {
               JCA16Base jmd = (JCA16Base)md;
               if (jmd.getRequiredWorkContexts() == null)
                  jmd.setRequiredWorkContexts(new ArrayList<String>());

               if (!jmd.getRequiredWorkContexts().contains(requiredWorkContext.getName()))
               {
                  if (trace)
                     log.trace("RequiredWorkContext=" + requiredWorkContext.getName());

                  jmd.getRequiredWorkContexts().add(requiredWorkContext.getName());
               }
            }
         }
      }

      // Security permission
      SecurityPermission[] securityPermissions = c.securityPermissions();
      if (securityPermissions != null)
      {
         if (md.getRa() == null)
            md.setRa(new ResourceAdapterMetaData());

         if (md.getRa().getSecurityPermissions() == null)
            md.getRa().setSecurityPermissions(new ArrayList<SecurityPermissionMetaData>());

         for (SecurityPermission securityPermission : securityPermissions)
         {
            SecurityPermissionMetaData spmd = new SecurityPermissionMetaData();
            spmd.setSecurityPermissionSpec(securityPermission.permissionSpec());
            md.getRa().getSecurityPermissions().add(spmd);
         }
      }

      // Small icon
      String[] smallIcon = c.smallIcon();
      if (smallIcon != null)
      {
         IconsImpl icsImpl;
         if (descGroup.getIcons() == null)
         {
            icsImpl = new IconsImpl();
            descGroup.setIcons(icsImpl);
         }
         else
         {
            icsImpl = (IconsImpl)descGroup.getIcons();
         }
         IconImpl[] icArray = icsImpl.toArray(new IconImpl[icsImpl.size()]);
         for (int i = 0; i < smallIcon.length; i++)
         {
            if (i < icArray.length)
               icArray[i].setSmallIcon(smallIcon[i]);
            else
            {
               IconImpl icImpl = new IconImpl();
               icImpl.setLargeIcon(smallIcon[i]);
               icsImpl.add(icImpl);
            }
         }
      }
View Full Code Here

    }

    protected Icons getIcons(String smallIcon, String largeIcon) {
        IconsImpl icons = null;
        if (smallIcon.length() > 0 || largeIcon.length() > 0) {
            IconImpl i = new IconImpl();
            i.setSmallIcon(smallIcon);
            i.setLargeIcon(largeIcon);
            icons = new IconsImpl();
            icons.add(i);
        }
        return icons;
    }
View Full Code Here

    }

    protected Icons getIcons(String smallIcon, String largeIcon) {
        IconsImpl icons = null;
        if (smallIcon.length() > 0 || largeIcon.length() > 0) {
            IconImpl i = new IconImpl();
            i.setSmallIcon(smallIcon);
            i.setLargeIcon(largeIcon);
            icons = new IconsImpl();
            icons.add(i);
        }
        return icons;
    }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.IconImpl

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.