/** Default constructor */ public CommonEntityModel() { // TextPropertyDescriptor aType = new TextPropertyDescriptor(P_SZ_TYPE, // UMLPlugin.getDefault().getResourceString("property.szType")); // TextPropertyDescriptor aLabel = new TextPropertyDescriptor(P_SZ_LABEL, // UMLPlugin.getDefault().getResourceString("property.szLabel")); // TextPropertyDescriptor aSource = new TextPropertyDescriptor(P_SZ_SOURCE, // UMLPlugin.getDefault().getResourceString("property.szSource")); // TextPropertyDescriptor aSourceDec = new TextPropertyDescriptor(P_SZ_SOURCE_DECORATION, // UMLPlugin.getDefault().getResourceString("property.szSourceDecoration")); // TextPropertyDescriptor aTarget = new TextPropertyDescriptor(P_SZ_TARGET, // UMLPlugin.getDefault().getResourceString("property.szTarget")); // TextPropertyDescriptor aTargetDec = new TextPropertyDescriptor(P_SZ_TARGET_DECORATION, // UMLPlugin.getDefault().getResourceString("property.szTargetDecoration")); // // aType.setCategory("Annotation"); // aLabel.setCategory("Annotation"); // aSource.setCategory("Annotation"); // aSourceDec.setCategory("Annotation"); // aTarget.setCategory("Annotation"); // aTargetDec.setCategory("Annotation"); TextPropertyDescriptor STEREO_TYPE = new TextPropertyDescriptor( StereoTypeModel.P_STEREO_TYPE, UMLPlugin.getDefault().getResourceString("property.stereoType")); PropertyDescriptor SIMPLE_ENTITY_NAME = new PropertyDescriptor( P_SIMPLE_ENTITY_NAME, UMLPlugin.getDefault().getResourceString("property.simpleName")); TextPropertyDescriptor ENTITY_NAME = new TextPropertyDescriptor( P_ENTITY_NAME, UMLPlugin.getDefault().getResourceString("property.name")); ColorPropertyDescriptor BACKGROUND_COLOR = new ColorPropertyDescriptor( P_BACKGROUND_COLOR, UMLPlugin.getDefault().getResourceString("property.background")); PropertyDescriptor ATTRIBUTES = new PropertyDescriptor( P_ATTRIBUTES, UMLPlugin.getDefault().getResourceString("property.attributes")); PropertyDescriptor OPERATTIONS = new PropertyDescriptor( P_OPERATIONS, UMLPlugin.getDefault().getResourceString("property.operations")); STEREO_TYPE.setCategory("Object properties"); SIMPLE_ENTITY_NAME.setCategory("Object properties"); ENTITY_NAME.setCategory("Object properties"); BACKGROUND_COLOR.setCategory("Object properties"); ATTRIBUTES.setCategory("Object properties"); OPERATTIONS.setCategory("Object properties"); propertyDescriptors = new IPropertyDescriptor[] { STEREO_TYPE, SIMPLE_ENTITY_NAME, ENTITY_NAME, BACKGROUND_COLOR, ATTRIBUTES, OPERATTIONS, // aType,aLabel,aSource,aSourceDec,aTarget,aTargetDec, }; }
public void recursiveInitProperties(Node node) { NodeList children = dom.getChildElements(node); for (int j = 0; j < children.getLength(); j++) { if (!children.item(j).getNamespaceURI().equals(rngaURI)) { if (dom.hasQName(children.item(j), "rng:ref")) { if (isCountValue(children.item(j))) { Relax2Hybrid transform1 = new Relax2Hybrid(); try { transform1.transform(srcDoc, dom, children.item(j)); // now resolve the rng:ref transform1.retrieveRelaxNGRef((Element) children.item(j)); } catch (DOMTransformException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } else continue; recursiveInitProperties(node); } else if (dom.hasQName(children.item(j), "swe:value")) { nameDescriptor = new TextPropertyDescriptor(PROPERTY_COUNT_VALUE, "name"); PropertyLabelProvider plp = new PropertyLabelProvider(node, dom); nameDescriptor.setLabelProvider(plp); nameDescriptor.setCategory(node.getLocalName()); } else { recursiveInitProperties(children.item(j)); } } } }
public IPropertyDescriptor[] getPropertyDescriptors() { ArrayList<IPropertyDescriptor> al = new ArrayList<IPropertyDescriptor>(); al.addAll(Arrays.asList(super.getPropertyDescriptors())); PropertyDescriptor a1 = new NoEditableTextPropertyDescriptor(PROP_DATASET, "数据源"); a1.setCategory("高级"); al.add(a1); // PropertyDescriptor a2 = new TextPropertyDescriptor(PROP_POSITION, "位置"); // a2.setCategory("高级"); // al.add(a2); if (formComp.getRenderType() == 1 || formComp.getRenderType() == 3) { PropertyDescriptor a3 = new TextPropertyDescriptor(PROP_COLUMNCOUNT, "列数"); a3.setCategory("高级"); al.add(a3); } PropertyDescriptor a4 = new ObjectComboPropertyDescriptor(PROP_RENDERTYPE, "渲染类型", renderType); a4.setCategory("高级"); al.add(a4); PropertyDescriptor a5 = new TextPropertyDescriptor(PROP_ROWHEIGHT, "每行高度"); a5.setCategory("高级"); al.add(a5); PropertyDescriptor a6 = new ComboBoxPropertyDescriptor(PROP_WITHFORM, "是否是HTML表单", Constant.ISLAZY); a6.setCategory("高级"); al.add(a6); PropertyDescriptor a7 = new TextPropertyDescriptor(PROP_BGCOLOR, "表单背景"); a7.setCategory("高级"); al.add(a7); PropertyDescriptor a8 = new ComboBoxPropertyDescriptor(PROP_RENDERHIDDENELE, "是否渲染隐藏的表单元素", Constant.ISLAZY); a8.setCategory("高级"); al.add(a8); PropertyDescriptor a9 = new TextPropertyDescriptor(PROP_ELEWIDTH, "行宽"); a9.setCategory("高级"); al.add(a9); PropertyDescriptor a10 = new TextPropertyDescriptor(PROP_LABELMINWIDTH, "最小标签宽度"); a10.setCategory("高级"); al.add(a10); TextPropertyDescriptor captionDes = new TextPropertyDescriptor(PROP_CAPTION, "标题"); captionDes.setCategory("基本"); al.add(captionDes); return al.toArray(new IPropertyDescriptor[0]); }