當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。