@Override public boolean accept(String context, CompanionStubFacade element) { if (context == null) { return true; } return context.equals(element.getCompanionType()); }
@Override public void actionPerformed(ActionEvent e) { if (!"null".equals(e.getActionCommand())) { if ("SELECT".equals(e.getActionCommand()) || (JTreeTable.ACTION_DOUBLECLICK == e.getID())) { newCompanion = CharacterManager.createNewCharacter( character.getUIDelegate(), character.getDataSet()); CompanionStubFacade selected = (CompanionStubFacade) raceTable.getSelectedObject(); newCompanion.setRace(selected.getRaceRef().getReference()); character.getCompanionSupport().addCompanion(newCompanion, companionType); setVisible(false); } else { newCompanion = null; setVisible(false); } } }