public String getEditableName (DesignComponent component) { DesignComponent refComponent = component.readProperty(PROP_COMMAND).getComponent(); if (refComponent == null || refComponent.readProperty(ClassCD.PROP_INSTANCE_NAME) == null) { Debug.warning("EventSource referenced " + component.toString() + " is null "); //NOI18N return null; } String name = (String) refComponent.readProperty(ClassCD.PROP_INSTANCE_NAME).getPrimitiveValue (); return name; }
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; }
protected void collectRequiredComponents (Collection<DesignComponent> requiredComponents) { PropertyValue propertyValue = getComponent ().readProperty (PROP_COMMAND); DesignComponent component = propertyValue.getComponent(); if (component != null) requiredComponents.add(component); } },
public boolean isAvailable (DesignDocument document) { if (document == null) return false; DesignComponent root = document.getRootComponent (); if (root == null) return false; PropertyValue version = root.readProperty (RootCD.PROP_VERSION); String string = MidpTypes.getString (version); return RootCD.VALUE_MIDP_2_0.equals (string); }
@Override public Collection<DesignComponent> getChildren() { PropertyValue itemsValue = getComponent().readProperty(FormCD.PROP_ITEMS); ArrayList<DesignComponent> items = new ArrayList<DesignComponent>(); Debug.collectAllComponentReferences(itemsValue, items); return items; }
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 run() { PropertyValue pv = _component.readProperty(DateFieldCD.PROP_INPUT_MODE); if (pv.getKind() == PropertyValue.Kind.VALUE) { inputMode[0] = MidpTypes.getInteger(pv); } } });
private int getFitPolicy() { DesignComponent component = getRelatedComponent(). getParentComponent(); if (component != null) { return Integer.parseInt( component.readProperty(ListCD.PROP_FIT_POLICY). getPrimitiveValue().toString()); } return 0; } }
public String getEditableName(DesignComponent component) { PropertyValue value = component.readProperty(propertyName); if (value.getKind() == PropertyValue.Kind.VALUE) return MidpTypes.getString(value); else return ""; // NOI18N }
@Override protected DesignComponent getComponentForAttachingPin () { if (! MidpTypes.getBoolean (getComponent ().readProperty (PROP_SHOW_SELECT_COMMAND))) return null; return super.getComponentForAttachingPin (); } },
protected String generateAccessCode() { DesignComponent component = getComponent(); String instanceName = MidpTypes.getString(component.readProperty(ClassCD.PROP_INSTANCE_NAME)); return generateAccessCode(instanceName); }
@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); }
public static void addEventSource(DesignComponent component, String propertyName, DesignComponent eventSource) { component.addComponent(eventSource); PropertyValue sources = component.readProperty(propertyName); sources = PropertyValueSupport.addArrayValue(sources, PropertyValue.createComponentReference(eventSource)); component.writeProperty(propertyName, sources); }
public JComponent createEditorComponent(final ScreenPropertyDescriptor property) { ScreenTextAreaPropertyEditor.StringTextArea editor = new ScreenTextAreaPropertyEditor.StringTextArea (property); editor.setMinimumSize(new Dimension (128, 21)); PropertyValue value = property.getRelatedComponent ().readProperty(propertyName); String string = MidpTypes.getString(value); editor.setText(string != null ? string : ""); // NOI18N editor.setCaretPosition (editor.getDocument ().getLength ()); return editor; }
@Override public void generateParameterCode(DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty(PROP_TIMEOUT); if (propertyValue.getKind() == PropertyValue.Kind.VALUE) { int timeout = MidpTypes.getInteger(propertyValue); if (timeout == -2) { section.getWriter().write("Alert.FOREVER"); // NOI18N return; } } super.generateParameterCode(component, section, index); }
@Override public void generateParameterCode (DesignComponent component, MultiGuardedSection section, int index) { PropertyValue propertyValue = component.readProperty (PROP_DATE); if (propertyValue.getKind () == PropertyValue.Kind.VALUE) { long date = MidpTypes.getLong (propertyValue); section.getWriter ().write ("new java.util.Date (" + date + "l)"); // NOI18N } else super.generateParameterCode (component, section, index); } }
protected void generateMultiGuardedSectionCode (MultiGuardedSection section) { String code = CodeReferencePresenter.generateAccessCode (getComponent ().readProperty (MethodPointEventHandlerCD.PROP_METHOD_POINT).getComponent ()); if (code != null) section.getWriter ().write (code + ";\n"); // NOI18N } },
protected boolean matches (GuardedSection section) { boolean lazyInit = MidpTypes.getBoolean (getComponent ().readProperty (PROP_LAZY_INIT)); return MultiGuardedSection.matches(section, lazyInit ? getComponent().getComponentID() + "-getter" : getComponent ().getDocument ().getRootComponent ().getComponentID () + "-initialize", 1); // NOI18N } },