/** * Get the initialval. * @return The initialval. */ public String getInitialValueString() { UnparsedExpression exp = getInitialValue(); return exp != null? exp.getValue() : null; }
/** * Legacy conversion from unparsed expression. * * @param name Name * @param exp */ public void setPropertyValue(String name, UnparsedExpression exp) { MProperty mprop = new MProperty(); mprop.setName(name); mprop.setInitialValue(exp); addProperty(mprop); }
/** * Gets the value. * * @param rowIndex The row. * @param columnIndex The column. * @return The value. */ public Object getValueAt(int rowIndex, int columnIndex) { Object ret = null; MProperty prop = getMEvent().getProperties().get(rowIndex); switch (columnIndex) { case 0: default: ret = prop.getName(); break; case 1: ret = prop.getClazz(); break; case 2: ret = prop.getInitialValueString(); } return ret; }
/** * */ public Object getValueAt(int rowIndex, int columnIndex) { MProperty prop = parametercache.get(rowIndex); switch(columnIndex) { case 1: { return prop.getInitialValueString() != null? prop.getInitialValueString() : ""; } case 0: default: { return prop.getName(); } } }
if(!value.equals(getValueAt(rowIndex, columnIndex))) getMEvent().getProperties().removeKey(prop.getName()); prop.setName(createFreeName((String)value, new CollectionContains(getMEvent().getProperties().keySet()))); getMEvent().addProperty(prop); prop.setClazz((ClassInfo)value); break; case 2: prop.setInitialValue((String)value);
prop.setInitialValue(val); modelcontainer.setDirty(true); break; if (!newname.equals(prop.getName())) getMEvent().removeProperty(prop.getName()); prop.setName(newname); getMEvent().addProperty(prop); parametercache.add(rowIndex, newname, prop);
MProperty mprop = new MProperty(exp.getClazz(), exp.getName(), exp); ((MSubProcess) subprocess.getBpmnElement()).addProperty(mprop); MProperty mprop = new MProperty(exp.getClazz(), exp.getName(), exp); ((MSubProcess) subprocess.getBpmnElement()).addProperty(mprop); label.setText(FILE_EXPRESSION_TEXT); UnparsedExpression exp = new UnparsedExpression("file", String.class, val, null); MProperty mprop = new MProperty(exp.getClazz(), exp.getName(), exp); msp.addProperty(mprop); label.setText(FILE_NAME_TEXT); UnparsedExpression exp = new UnparsedExpression("filename", String.class, "\"" + val + "\"", null); MProperty mprop = new MProperty(exp.getClazz(), exp.getName(), exp); msp.addProperty(mprop);
out.print(escapeString(prop.getName())); if (prop.getClazz() != null) out.print(escapeString(prop.getClazz().getTypeName())); String inival = prop.getInitialValue().getValue(); if(inival != null && inival.length() > 0)
public void actionPerformed(ActionEvent e) { Method method = (Method)cbmethodname.getSelectedItem(); // System.out.println("setting: "+method); MProperty mprop = task.getProperties().get(PROPERTY_METHOD); UnparsedExpression uexp = new UnparsedExpression(null, String.class, method!=null? "\""+method.toString()+"\"": "null", null); mprop.setInitialValue(uexp); } });
/** * Remove a property. * @param prop The property. */ public void removeProperty(MProperty prop) { if(properties!=null) removeProperty(prop.getName()); }
public void update(DocumentEvent e) { String triggername = getText(e.getDocument()); if (triggername != null && !triggername.isEmpty()) { UnparsedExpression exp = new UnparsedExpression(MBpmnModel.SIGNAL_EVENT_TRIGGER, (String) null, "\"" + triggername +"\"", null); MProperty prop = new MProperty(null, MBpmnModel.SIGNAL_EVENT_TRIGGER, exp); msighandler.addProperty(prop); } else { msighandler.removeProperty(MBpmnModel.SIGNAL_EVENT_TRIGGER); } modelcontainer.setDirty(true); } });
public void actionPerformed(ActionEvent e) { Method method = (Method)cbmethodname.getSelectedItem(); // System.out.println("setting: "+method); MProperty mprop = task.getProperties().get(PROPERTY_METHOD); UnparsedExpression uexp = new UnparsedExpression(null, String.class, method!=null? "\""+method.toString()+"\"": "null", null); mprop.setInitialValue(uexp); } });
/** * Add a property. * @param prop The property. */ public void addProperty(MProperty prop) { if(properties==null) properties = new IndexMap<String, MProperty>(); properties.put(prop.getName(), prop); }
/** * Add a simple string-based property. * @param name Property name. * @param value The string value. */ public void addProperty(String name, String value) { MProperty mprop = new MProperty(); mprop.setName(name); UnparsedExpression uexp = new UnparsedExpression(name, String.class, "\"" + value + "\"", null); SJavaParser.parseExpression(uexp, null, MActivity.class.getClassLoader()); mprop.setInitialValue(uexp); addProperty(mprop); }
/** * Get a property value from the model. * @param name The name. */ public UnparsedExpression getPropertyValue(String name) { UnparsedExpression ret = null; if(properties!=null) { MProperty mprop = properties.get(name); ret = mprop != null? mprop.getInitialValue() : null; } return ret; }
public void actionPerformed(ActionEvent e) { stopEditing(paramtable); int row = paramtable.getRowCount(); String name = BasePropertyPanel.createFreeName("name", new MapContains(getMEventProperties().getAsMap())); MProperty prop = new MProperty(null, name, null); getMEvent().addProperty(prop); parametercache.put(name, prop); modelcontainer.setDirty(true); ((ParameterTableModel) paramtable.getModel()).fireTableRowsInserted(row, row); } };
UnparsedExpression uexp = new UnparsedExpression(null, String.class, "\""+reqname+"\"", null); mprop.setInitialValue(uexp);
public void actionPerformed(ActionEvent e) { stopEditing(paramtable); int[] ind = paramtable.getSelectedRows(); Arrays.sort(ind); IndexMap<String, MProperty> props = getMEventProperties(); for (int i = ind.length - 1; i >= 0; --i) { MProperty prop = parametercache.remove(ind[i]); props.removeKey(prop.getName()); ((ParameterTableModel) paramtable.getModel()).fireTableRowsDeleted(ind[i], ind[i]); } modelcontainer.setDirty(true); } };
/** * Legacy conversion to unparsed expression. * * @param name Name * @param exp */ public void setPropertyValue(String name, IParsedExpression exp) { if(exp != null) { MProperty mprop = new MProperty(); mprop.setName(name); UnparsedExpression uexp = new UnparsedExpression(name, (String) null, exp.getExpressionText(), null); uexp.setParsedExp(exp); mprop.setInitialValue(uexp); addProperty(mprop); } else { MProperty mprop = new MProperty(); mprop.setName(name); UnparsedExpression uexp = new UnparsedExpression(name, (String) null, null, null); SJavaParser.parseExpression(uexp, null, MActivity.class.getClassLoader()); mprop.setInitialValue(uexp); addProperty(mprop); } }
if(mprop.getInitialValue()!=null) String sername = (String)SJavaParser.parseExpression(mprop.getInitialValue(), model.getAllImports(), cl).getValue(null); cbsername.setSelectedItem(sername); if(mprop.getInitialValue()!=null) String methodname = (String)SJavaParser.parseExpression(mprop.getInitialValue(), model.getAllImports(), cl).getValue(null);