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;
}