public int getCount (DesignComponent component) { PropertyValue propertyValue = component.readProperty (ChoiceGroupCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); return array.size (); }
public int getCount (DesignComponent component) { PropertyValue propertyValue = component.readProperty (DisplayableCD.PROP_COMMANDS); List<PropertyValue> array = propertyValue.getArray (); return array.size (); }
public int getCount (DesignComponent component) { PropertyValue propertyValue = component.readProperty (ListCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); return array.size (); }
public int getCount (DesignComponent component) { PropertyValue propertyValue = component.readProperty (ChoiceGroupCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); return array.size (); }
public int getCount (DesignComponent component) { PropertyValue propertyValue = component.readProperty (ChoiceGroupCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); return array.size (); }
public static PropertyValue remove (PropertyValue array, DesignComponent itemToRemove) { ArrayList<PropertyValue> list = new ArrayList<PropertyValue> (array.getArray ()); Iterator<PropertyValue> iterator = list.iterator (); while (iterator.hasNext ()) { PropertyValue value = iterator.next (); if (value.getComponent ().equals (itemToRemove)) iterator.remove (); } array = PropertyValue.createArray (array.getType ().getComponentType (), list); return array; }
public static PropertyValue append (PropertyValue array, PropertyValue itemToAppend) { ArrayList<PropertyValue> list = new ArrayList<PropertyValue> (array.getArray ()); list.add (itemToAppend); array = PropertyValue.createArray (array.getType ().getComponentType (), list); return array; }
protected void collectRequiredComponents(Collection<DesignComponent> requiredComponents) { PropertyValue value = getComponent().readProperty(PROP_ELEMENTS); final List<PropertyValue> array = value.getArray(); for (PropertyValue element : array) { DesignComponent component = element.getComponent(); if (component != null) requiredComponents.add(component); } } },
public boolean isRequiredToBeSet (DesignComponent component, int index) { PropertyValue propertyValue = component.readProperty (ListCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent listElement = array.get (index).getComponent (); PropertyValue string = listElement.readProperty (ListElementEventSourceCD.PROP_FONT); return string.getKind () != PropertyValue.Kind.NULL; }
public static PropertyValue removeArrayValue (PropertyValue array, PropertyValue value) { assert array != null && value != null; assert array.getKind ().equals (PropertyValue.Kind.ARRAY); ArrayList<PropertyValue> values = new ArrayList<PropertyValue> (array.getArray ()); values.remove (value); return PropertyValue.createArray (array.getType ().getComponentType (), values); }
public static PropertyValue addArrayValue (PropertyValue array, PropertyValue value) { assert array != null && value != null; assert array.getKind ().equals (PropertyValue.Kind.ARRAY); TypeID componentType = array.getType ().getComponentType (); assert value.isCompatible (componentType); ArrayList<PropertyValue> values = new ArrayList<PropertyValue> (array.getArray ()); values.add (value); return PropertyValue.createArray (componentType, values); }
public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty (ItemCD.PROP_COMMANDS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent commandEventSource = array.get (index).getComponent (); MidpCodeSupport.generateCodeForPropertyValue (section.getWriter (), commandEventSource.readProperty (CommandEventSourceCD.PROP_COMMAND)); }
public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty(ChoiceGroupCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent choiceElement = array.get (index).getComponent (); PropertyValue string = choiceElement.readProperty(ChoiceElementCD.PROP_FONT); MidpCodeSupport.generateCodeForPropertyValue (section.getWriter (), string); }
public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty(ListCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent listElement = array.get (index).getComponent (); PropertyValue string = listElement.readProperty(ListElementEventSourceCD.PROP_STRING); MidpCodeSupport.generateCodeForPropertyValue (section.getWriter (), string); }
public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty(ListCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent listElement = array.get (index).getComponent (); PropertyValue string = listElement.readProperty(ListElementEventSourceCD.PROP_IMAGE); MidpCodeSupport.generateCodeForPropertyValue (section.getWriter (), string); }
public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty(ChoiceGroupCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent choiceElement = array.get (index).getComponent (); PropertyValue string = choiceElement.readProperty(ChoiceElementCD.PROP_IMAGE); MidpCodeSupport.generateCodeForPropertyValue (section.getWriter (), string); }
public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty(ListCD.PROP_ELEMENTS); List<PropertyValue> array = propertyValue.getArray (); DesignComponent listElement = array.get (index).getComponent (); PropertyValue string = listElement.readProperty(ListElementEventSourceCD.PROP_FONT); MidpCodeSupport.generateCodeForPropertyValue (section.getWriter (), string); }
@Override protected void notifyCreated (DesignComponent component) { super.notifyCreated (component); ArraySupport.append (getComponent (), ListCD.PROP_ELEMENTS, component); if (component.isDefaultValue(ListElementEventSourceCD.PROP_STRING)) { PropertyValue value = getComponent ().readProperty(ListCD.PROP_ELEMENTS); List<PropertyValue> list = value.getArray (); component.writeProperty (ListElementEventSourceCD.PROP_STRING, MidpTypes.createStringValue (NbBundle.getMessage(ListCD.class, "NAME_New_List_Element", list.size()))); // NOI18N } } },
@Override protected void notifyCreated (DesignComponent choiceElement) { super.notifyCreated (choiceElement); DesignComponent choiceGroup = getComponent (); ArraySupport.append (choiceGroup, PROP_ELEMENTS, choiceElement); if (choiceElement.isDefaultValue(ChoiceElementCD.PROP_STRING)) { PropertyValue value = getComponent ().readProperty(PROP_ELEMENTS); List<PropertyValue> list = value.getArray (); choiceElement.writeProperty (ChoiceElementCD.PROP_STRING, MidpTypes.createStringValue (NbBundle.getMessage(ChoiceGroupCD.class, "DISP_New_Choice_Element", list.size()))); // NOI18N } } },
@Override public boolean isRequiredToBeSet (DesignComponent component, int index) { DescriptorRegistry descriptorRegistry = component.getDocument ().getDescriptorRegistry (); List<PropertyValue> array = component.readProperty (DisplayableCD.PROP_COMMANDS).getArray (); DesignComponent commandEventSource = array.get (index).getComponent (); DesignComponent command = commandEventSource.readProperty (CommandEventSourceCD.PROP_COMMAND).getComponent (); if (command != null && descriptorRegistry.isInHierarchy (ListSelectCommandCD.TYPEID, command.getType ())) return false; return super.isRequiredToBeSet (command, index); }