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]; } }
public TextArgumentValueCellEditor(ActionArgument argument, ActionArgumentValue argumentValue) { super(argument, argumentValue); textField.setEditable(argument.getDirection().equals(ActionArgument.Direction.IN)); textField.setText(argumentValue != null ? argumentValue.toString() : ""); }
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]; } }
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]; } }
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 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; }