本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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);
}