@Override public String toString() { return "(" + getClass().getSimpleName() + ", " + getDirection() + ") " + getName(); } }
public TextArgumentValueCellEditor(ActionArgument argument, ActionArgumentValue argumentValue) { super(argument, argumentValue); textField.setEditable(argument.getDirection().equals(ActionArgument.Direction.IN)); textField.setText(argumentValue != null ? argumentValue.toString() : ""); }
public Component getTableCellEditorComponent(JTable jTable, Object o, boolean b, int i, int i1) { if (getArgument().getDirection().equals(ActionArgument.Direction.OUT)) { if (textField.getText() != null && textField.getText().length() > 50) { JPanel panel = new JPanel(); panel.setBackground(Color.WHITE); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); JButton expandButton = new JButton("Expand"); expandButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { onExpandText(textField.getText()); } } ); panel.add(textField); panel.add(expandButton); return panel; } return textField; } return textField; }
public Action(String name, ActionArgument[] arguments) { this.name = name; if (arguments != null) { List<ActionArgument> inputList= new ArrayList<>(); List<ActionArgument> outputList = new ArrayList<>(); for (ActionArgument argument : arguments) { argument.setAction(this); if (argument.getDirection().equals(ActionArgument.Direction.IN)) inputList.add(argument); if (argument.getDirection().equals(ActionArgument.Direction.OUT)) outputList.add(argument); } this.arguments = arguments; this.inputArguments = inputList.toArray(new ActionArgument[inputList.size()]); this.outputArguments = outputList.toArray(new ActionArgument[outputList.size()]); } else { this.arguments = new ActionArgument[0]; this.inputArguments = new ActionArgument[0]; this.outputArguments = new ActionArgument[0]; } }
@Override public boolean isCellEditable(int row, int column) { if (column == 1) { ActionArgument argument = argumentValuesModel.getValueAt(row); // TODO: Avoid double instantiation? return (argument.getDirection().equals(ActionArgument.Direction.IN)) || ((ArgumentValueCellEditor) getCellEditor(row, column)).handlesEditability(); } return false; }
private void generateActionArgument(ActionArgument actionArgument, Document descriptor, Element actionElement) { Element actionArgumentElement = appendNewElement(descriptor, actionElement, ELEMENT.argument); appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.name, actionArgument.getName()); appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.direction, actionArgument.getDirection().toString().toLowerCase(Locale.ROOT)); if (actionArgument.isReturnValue()) { // TODO: UPNP VIOLATION: WMP12 will discard RenderingControl service if it contains <retval> tags log.warning("UPnP specification violation: Not producing <retval> element to be compatible with WMP12: " + actionArgument); // appendNewElement(descriptor, actionArgumentElement, ELEMENT.retval); } appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.relatedStateVariable, actionArgument.getRelatedStateVariableName()); }
if (getDirection() == null) { errors.add(new ValidationError( getClass(), if (isReturnValue() && getDirection() != ActionArgument.Direction.OUT) { errors.add(new ValidationError( getClass(),
public ActionArgument<S> deepCopy() { return new ActionArgument<>( getName(), getAliases(), getRelatedStateVariableName(), getDirection(), isReturnValue() ); }
if (actionArgument.getDirection() == ActionArgument.Direction.IN) { log.warning("UPnP specification violation of :" + getService().getDevice()); log.warning("Input argument can not have <retval/>"); for (int j = 0; j < retValueArgumentIndex; j++) { ActionArgument a = getArguments()[j]; if (a.getDirection() == ActionArgument.Direction.OUT) { log.warning("UPnP specification violation of: " + getService().getDevice()); log.warning("Argument '" + retValueArgument.getName() + "' of action '" + getName() + "' is <retval/> but not the first OUT argument");
ActionArgument nodeActionArgument = (ActionArgument) node.getUserObject(); if (nodeActionArgument.getDirection().equals(ActionArgument.Direction.IN)) { setIcon(Application.createImageIcon(Workbench.class, "img/24/argument_in.png")); } else {
@Override public String toString() { return "(" + getClass().getSimpleName() + ", " + getDirection() + ") " + getName(); } }
public Action(String name, ActionArgument[] arguments) { this.name = name; if (arguments != null) { List<ActionArgument> inputList= new ArrayList(); List<ActionArgument> outputList = new ArrayList(); for (ActionArgument argument : arguments) { argument.setAction(this); if (argument.getDirection().equals(ActionArgument.Direction.IN)) inputList.add(argument); if (argument.getDirection().equals(ActionArgument.Direction.OUT)) outputList.add(argument); } this.arguments = arguments; this.inputArguments = inputList.toArray(new ActionArgument[inputList.size()]); this.outputArguments = outputList.toArray(new ActionArgument[outputList.size()]); } else { this.arguments = new ActionArgument[0]; this.inputArguments = new ActionArgument[0]; this.outputArguments = new ActionArgument[0]; } }
actionNode.add(actionArgumentNode); addIfNotNull(actionArgumentNode, i++ + " Direction: ", actionArgument.getDirection()); addIfNotNull(actionArgumentNode, "Related State Variable: ", actionArgument.getRelatedStateVariableName()); addIfNotNull(actionArgumentNode, "Datatype: ", actionArgument.getDatatype().getDisplayString());
private void generateActionArgument(ActionArgument actionArgument, Document descriptor, Element actionElement) { Element actionArgumentElement = appendNewElement(descriptor, actionElement, ELEMENT.argument); appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.name, actionArgument.getName()); appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.direction, actionArgument.getDirection().toString().toLowerCase(Locale.ENGLISH)); if (actionArgument.isReturnValue()) { // TODO: UPNP VIOLATION: WMP12 will discard RenderingControl service if it contains <retval> tags log.warning("UPnP specification violation: Not producing <retval> element to be compatible with WMP12: " + actionArgument); // appendNewElement(descriptor, actionArgumentElement, ELEMENT.retval); } appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.relatedStateVariable, actionArgument.getRelatedStateVariableName()); }
if (getDirection() == null) { errors.add(new ValidationError( getClass(), if (isReturnValue() && getDirection() != ActionArgument.Direction.OUT) { errors.add(new ValidationError( getClass(),
public ActionArgument<S> deepCopy() { return new ActionArgument<S>( getName(), getAliases(), getRelatedStateVariableName(), getDirection(), isReturnValue() ); }
for (int j = 0; j < retValueArgumentIndex; j++) { ActionArgument a = getArguments()[j]; if (a.getDirection() == ActionArgument.Direction.OUT) { log.warning("UPnP specification violation of: " + getService().getDevice()); log.warning("Argument '" + retValueArgument.getName() + "' of action '" + getName() + "' is <retval/> but not the first OUT argument");
@Override public String toString() { return "(" + getClass().getSimpleName() + ", " + getDirection() + ") " + getName(); } }
private void generateActionArgument(ActionArgument actionArgument, Document descriptor, Element actionElement) { Element actionArgumentElement = appendNewElement(descriptor, actionElement, ELEMENT.argument); appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.name, actionArgument.getName()); appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.direction, actionArgument.getDirection().toString().toLowerCase(Locale.ROOT)); if (actionArgument.isReturnValue()) { // TODO: UPNP VIOLATION: WMP12 will discard RenderingControl service if it contains <retval> tags log.warning("UPnP specification violation: Not producing <retval> element to be compatible with WMP12: " + actionArgument); // appendNewElement(descriptor, actionArgumentElement, ELEMENT.retval); } appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.relatedStateVariable, actionArgument.getRelatedStateVariableName()); }
public ActionArgument<S> deepCopy() { return new ActionArgument<>( getName(), getAliases(), getRelatedStateVariableName(), getDirection(), isReturnValue() ); }