Package org.openquark.cal.metadata

Examples of org.openquark.cal.metadata.ScopedEntityMetadata


     *
     * @param gemEntity
     * @return Returns true iff the metadata of the gem is suitable.
     */
    private boolean checkMetadata (GemEntity gemEntity) {
        ScopedEntityMetadata metadata = gemEntity.getMetadata(GemManager.getLocaleForMetadata());
       
        return metadata != null && checkMetadata(metadata);
    }
View Full Code Here


     * Set the blessing on a gem
     * @param gem
     * @param blessing the value to set the gem blessing to  - NO_BLESSING to clear existing blessing
     */
    private void blessGem(GemEntity gem, int blessing) {
        ScopedEntityMetadata metadata = gem.getMetadata(GemManager.getLocaleForMetadata());
        metadata.setAttribute(TriggerGemFilter.TRIGGER_ATTRIBUTE_NAME, blessing == TRIGGER_BLESSING ? "trigger" : null);
        metadata.setAttribute(ActionGemFilter.ACTION_ATTRIBUTE_NAME, blessing == ACTION_BLESSING ? "action" : null);
        metadata.setAttribute(MetricGemFilter.METRIC_ATTRIBUTE_NAME, blessing == METRIC_BLESSING ? "metric" : null);

        if (!app.getCalServices().getCALWorkspace().saveMetadata(metadata)) {
            JOptionPane.showMessageDialog(this, "The metadata for the gem could not be updated.\nIs the metadata XML file read-only?", "BAM Sample", JOptionPane.ERROR_MESSAGE);   
        }  
    }  
View Full Code Here

     */
    private ListModel makeGemListModel (Collection<GemEntity> gemEntities) {
        DefaultListModel listModel = new DefaultListModel ();

        for (final GemEntity gemEntity : gemEntities) {
            ScopedEntityMetadata metadata = gemEntity.getMetadata(GemManager.getLocaleForMetadata());
           
            int blessing = NO_BLESSING;
           
            if (metadata.getAttribute(TriggerGemFilter.TRIGGER_ATTRIBUTE_NAME) != null) {
                blessing = TRIGGER_BLESSING;
            } else if (metadata.getAttribute(ActionGemFilter.ACTION_ATTRIBUTE_NAME) != null) {
                blessing = ACTION_BLESSING;
            } else if (metadata.getAttribute(MetricGemFilter.METRIC_ATTRIBUTE_NAME) != null) {
                blessing = METRIC_BLESSING;
            }
           
            listModel.addElement (new GemListItem (gemEntity, blessing));
        }
View Full Code Here

TOP

Related Classes of org.openquark.cal.metadata.ScopedEntityMetadata

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.