当前位置: 首页>>代码示例>>Java>>正文


Java EmbeddedDataListener类代码示例

本文整理汇总了Java中org.netbeans.modeler.properties.embedded.EmbeddedDataListener的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedDataListener类的具体用法?Java EmbeddedDataListener怎么用?Java EmbeddedDataListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EmbeddedDataListener类属于org.netbeans.modeler.properties.embedded包,在下文中一共展示了EmbeddedDataListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPropertySet

import org.netbeans.modeler.properties.embedded.EmbeddedDataListener; //导入依赖的package包/类
@Override
public void createPropertySet(ElementPropertySet set) {
    super.createPropertySet(set);
    set.put("BASIC_PROP", getProcessTypeProperty());

    GenericEmbedded entity = new GenericEmbedded("completionCondition", "Completion Condition", "");
    entity.setDataListener(new EmbeddedDataListener<TExpression>() {
        TAdHocSubProcess adHocSubProcess;

        @Override
        public void init() {
            adHocSubProcess = (TAdHocSubProcess) AdHocSubProcessWidget.this.getBaseElementSpec();
        }

        @Override
        public TExpression getData() {
            return adHocSubProcess.getCompletionCondition();
        }

        @Override
        public void setData(TExpression data) {
            adHocSubProcess.setCompletionCondition(data);
        }

        @Override
        public String getDisplay() {
            return adHocSubProcess.getCompletionCondition() == null ? "" : adHocSubProcess.getCompletionCondition().getContent();
        }
    });
    entity.setEntityEditor(new ExpressionPanel(this.getModelerScene().getModelerFile()));
    set.put("BASIC_PROP", new EmbeddedPropertySupport(this.getModelerScene().getModelerFile(),entity));

}
 
开发者ID:jGauravGupta,项目名称:jBPMNSuite,代码行数:34,代码来源:AdHocSubProcessWidget.java

示例2: getHashcodeEqualsProperty

import org.netbeans.modeler.properties.embedded.EmbeddedDataListener; //导入依赖的package包/类
public static EmbeddedPropertySupport getHashcodeEqualsProperty(PersistenceClassWidget<? extends ManagedClass> persistenceClassWidget) {
    GenericEmbedded entity = new GenericEmbedded("hashcode_equals", "equals() & hashcode()", "Define equals & hashcode implementation for the Entity");

    final JavaClass javaClassObj = persistenceClassWidget.getBaseElementSpec();
    HashcodeEqualsPanel panel = new HashcodeEqualsPanel(persistenceClassWidget);
    panel.postConstruct();
    entity.setEntityEditor(panel);
    entity.setDataListener(new EmbeddedDataListener<JavaClass>() {
        private JavaClass javaClass;

        @Override
        public void init() {
            javaClass = javaClassObj;
        }

        @Override
        public JavaClass getData() {
            return javaClass;
        }

        @Override
        public void setData(JavaClass classMembers) {
            //IGNORE internal properties are modified
        }

        @Override
        public String getDisplay() {
            int hashcode = javaClass.getHashCodeMethod().getAttributes().size();
            int equals = javaClass.getEqualsMethod().getAttributes().size();
            return String.format("equals{%s} hashcode{%s}", equals, hashcode);
        }

    });
    return new EmbeddedPropertySupport(persistenceClassWidget.getModelerScene().getModelerFile(), entity);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:36,代码来源:PropertiesHandler.java

示例3: getOrderProperty

import org.netbeans.modeler.properties.embedded.EmbeddedDataListener; //导入依赖的package包/类
public static EmbeddedPropertySupport getOrderProperty(AttributeWidget attributeWidget) {

        GenericEmbedded entity = new GenericEmbedded("order", "Order", "");
        OrderPanel orderPanel = new OrderPanel(attributeWidget);
        entity.setEntityEditor(orderPanel);

        entity.setDataListener(new EmbeddedDataListener<SortableAttribute>() {
            private SortableAttribute sortableAttribute;

            @Override
            public void init() {
                sortableAttribute = (SortableAttribute) attributeWidget.getBaseElementSpec();
            }

            @Override
            public SortableAttribute getData() {
                return sortableAttribute;
            }

            @Override
            public void setData(SortableAttribute attribute) {
            }

            @Override
            public String getDisplay() {
                return OrderPanel.getStateDisplay(sortableAttribute);
            }

        });
        return new EmbeddedPropertySupport(attributeWidget.getModelerScene().getModelerFile(), entity);
    }
 
开发者ID:jeddict,项目名称:jeddict,代码行数:32,代码来源:PropertiesHandler.java

示例4: getGeneratorProperty

import org.netbeans.modeler.properties.embedded.EmbeddedDataListener; //导入依赖的package包/类
public static EmbeddedPropertySupport getGeneratorProperty(IdAttributeWidget attributeWidget) {

        GenericEmbedded entity = new GenericEmbedded("generator", "Id Generator", "");
        entity.setEntityEditor(new IdGeneratorPanel());

        entity.setDataListener(new EmbeddedDataListener<Id>() {
            private Id idAttribute;

            @Override
            public void init() {
                idAttribute = attributeWidget.getBaseElementSpec();
            }

            @Override
            public Id getData() {
                if (idAttribute.getGeneratedValue() == null) {
                    idAttribute.setGeneratedValue(new GeneratedValue());
                }
                return idAttribute;
            }

            @Override
            public void setData(Id classSpec) {
                if (attributeWidget.getClassWidget() instanceof EntityWidget) {
                    ((EntityWidget) attributeWidget.getClassWidget()).scanKeyError();
                } else {
                    attributeWidget.getClassWidget().getAllSubclassWidgets().stream()
                            .filter(cw -> cw instanceof EntityWidget).findFirst().ifPresent(ew -> ((EntityWidget) ew).scanKeyError());
                }

//                attributeWidget.setBaseElementSpec(classSpec);
            }

            @Override
            public String getDisplay() {
                if (idAttribute.getGeneratedValue() != null && idAttribute.getGeneratedValue().getStrategy() != null) {
                    return firstLetterCaps(idAttribute.getGeneratedValue().getStrategy().toString());
                } else if (idAttribute.getGeneratedValue() == null || idAttribute.getGeneratedValue().getStrategy() == null) {
                    return NONE_TYPE;
                } else {
                    return "";
                }
            }

        });
        return new EmbeddedPropertySupport(attributeWidget.getModelerScene().getModelerFile(), entity);
    }
 
开发者ID:jeddict,项目名称:jeddict,代码行数:48,代码来源:PropertiesHandler.java


注:本文中的org.netbeans.modeler.properties.embedded.EmbeddedDataListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。