Package org.osgi.service.metatype

Examples of org.osgi.service.metatype.ObjectClassDefinition


        if ( mtp == null )
        {
            throw new IllegalArgumentException( "No ObjectClassDefinition for id=" + id );
        }

        ObjectClassDefinition ocd = mtp.getObjectClassDefinition( id, locale );
        if ( ocd == null )
        {
            throw new IllegalArgumentException( "No localized ObjectClassDefinition for id=" + id );
        }
View Full Code Here


                ScrConfiguration.PROP_GLOBAL_EXTENDER,
                "Global Extender",
                "Whether to extend all bundles whether or not visible to this bundle.",
                false ) );

        return new ObjectClassDefinition()
        {

            private final AttributeDefinition[] attrs = adList
                .toArray(new AttributeDefinition[adList.size()]);
View Full Code Here

            adList.add(new AttributeDefinitionImpl(MemoryUsageConstants.PROP_DUMP_LOCATION, "Dumpe Location",
                "The filesystem location where heap dumps are stored. If this is null or empty (the default) the dumps are stored in "
                    + support.getDefaultDumpLocation(), ""));

            ocd = new ObjectClassDefinition()
            {

                private final AttributeDefinition[] attrs = adList.toArray(new AttributeDefinition[adList.size()]);

                public String getName()
View Full Code Here

     
      Arrays.sort(converterNames);
     
     

    ObjectClassDefinition oldDefinition = originalProvider.getObjectClassDefinition(this.pid, null);

    BasicObjectClassDefinition definition;
    try {
      definition = new BasicObjectClassDefinition(oldDefinition.getID(), oldDefinition.getName(), oldDefinition.getDescription(), oldDefinition.getIcon(16));
    } catch (IOException e) {
      definition = new BasicObjectClassDefinition(oldDefinition.getID(), oldDefinition.getName(), oldDefinition.getDescription(), null);
    }

    definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED,
        new BasicAttributeDefinition(SELECTED_CONVERTER_PARAM_ID,
            "Converter To Test",
View Full Code Here

       
        if (provider == null) {
            throw new IllegalArgumentException("Null MetaTypeProvider given");
        }
       
        ObjectClassDefinition ocd = provider.getObjectClassDefinition(id, null);
        this.shell.setText(ocd.getName());

        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 1;
        this.shell.setLayout(gridLayout);

        Font defaultFont = new Font(this.shell.getDisplay(), "SanSerif", 8, SWT.NONE);
       
        //stuff to display a message
        String message = ocd.getDescription();
        if(message != null && !message.equals("")){
            Label msg = new Label(this.shell, SWT.WRAP);
            msg.setText(message);
            msg.pack(true);
            GridData labelData = new GridData();
View Full Code Here

    final GeneralTreeItem paramItem = new GeneralTreeItem("Parameters",
        Constant.Label, dataItem, Utils.getImage("parameters.png",
            brandPluginID));
    dataItem.addChild(paramItem);
    ObjectClassDefinition obj = provider.getObjectClassDefinition(
        metatypePID, null);
    if (obj != null) {
      AttributeDefinition[] attr = obj
          .getAttributeDefinitions(ObjectClassDefinition.ALL);

      for (int i = 0; i < attr.length; i++) {
        String id = attr[i].getID();
        String name = attr[i].getName();
View Full Code Here

    public int compare (Object o1, Object o2) {
      if (! (o1 instanceof PrefPage) || ! (o2 instanceof PrefPage)) {
        throw new ClassCastException("Cannot compare two objects that are not both PrefPages.");
      }
      PrefPage pp1 = (PrefPage) o1;
      ObjectClassDefinition ocd1 = pp1.getPrefOCD();
      if (ocd1 == null) {
        return -1;
      }
      String ocd1Name = ocd1.getName();
     
      PrefPage pp2 = (PrefPage) o2;
      ObjectClassDefinition ocd2 = pp2.getPrefOCD();
      if (ocd2 == null) {
        return 1;
      }
      String ocd2Name = ocd2.getName();
     
      return ocd1Name.compareTo(ocd2Name);
    }
View Full Code Here

  // Convenience method for batching transformations.
  public static ObjectClassDefinition transform(
      ObjectClassDefinition objectClassDefinition,
      Collection<DropdownTransformer> transformers,
      Collection<String> attributesToIgnore) {
    ObjectClassDefinition newObjectClassDefinition = objectClassDefinition;
   
    for (Iterator<DropdownTransformer> it = transformers.iterator(); it.hasNext();) {
      DropdownTransformer transformer = it.next();
      newObjectClassDefinition =
        apply(transformer, newObjectClassDefinition, attributesToIgnore);
View Full Code Here

  }
 
  //returns null if specified OCD does not exist.
  private PreferenceOCD extractOCD(MetaTypeInformation bundleMetaTypeInfo, String ocdID) {
    try {
      ObjectClassDefinition requestedOCD = bundleMetaTypeInfo.getObjectClassDefinition(ocdID, null);
      if (requestedOCD == null) return null;
      PreferenceOCD wrappedOCD = new PreferenceOCDImpl(this.log, requestedOCD);
      return wrappedOCD;
    } catch (IllegalArgumentException e) {
      //requested OCD does not exist
View Full Code Here

        MetaTypeProvider provider = getMetaTypeProvider(providerID);
        ObjectClassDefinitionRegistry ocdRegistry =
            (ObjectClassDefinitionRegistry) ocdReg.getService();
       
        if (provider != null && ocdRegistry != null) {
            ObjectClassDefinition ocd = provider.getObjectClassDefinition(id, locale);
           
            if (ocd != null) {
                ocdID = ocdRegistry.registerObjectClassDefinition(ocd);
            }
        }
View Full Code Here

TOP

Related Classes of org.osgi.service.metatype.ObjectClassDefinition

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.