Package org.acme.example.component

Examples of org.acme.example.component.ExampleComponent


    // will be injected through the OSGi declarative services model
    ComponentRegistry registry = ComponentRegistryAccess.getComponentRegistry();
   
    if (registry != null) {
      // use the ComponentRegistry service to create a new instance of a component
      ExampleComponent ec = registry.newInstance(ExampleComponent.class, component);
   
      // additional information can be collected here to populate a model. This simply
      // sets a unique name
      ec.setDisplayName("newComponentFromMenu"+newCount.incrementAndGet());
     
      // show the newly created component in it's own window
      ec.open();
    }
  }
View Full Code Here


    ExecutionResult trueResult = new ExecutionResult(context, true, "");

    if (!checkArguments(context))
      return trueResult; // Return true to skip this policy and pass the context to the next one.
   
    ExampleComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), ExampleComponent.class);
    ViewInfo viewInfo = context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), ViewInfo.class);
    if (viewInfo.getViewClass().equals(PublicInfoView.class))
      return new ExecutionResult(context, false, targetComponent.getDisplayName()
                + " is private, cannot show " + viewInfo.getClass().getName()); //NOI18N
   
    if (viewInfo.getViewClass().equals(PrivateInfoView.class))
      return new ExecutionResult(context, false, targetComponent.getDisplayName()
                + " is public, cannot show " + viewInfo.getClass().getName()); //NOI18N
   
    return trueResult;
  }
View Full Code Here

TOP

Related Classes of org.acme.example.component.ExampleComponent

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.