package com.c2kernel.gui.tabs.execution; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import com.c2kernel.entity.agent.Job; import com.c2kernel.lifecycle.instance.stateMachine.Transitions; /** * Each job gets a RequestButton */ public class RequestButton extends JButton implements ActionListener { Job myJob; ActivityViewer parent; public RequestButton(Job myJob, ActivityViewer parent) { super(); this.myJob = myJob; this.parent = parent; String label = Transitions.getTransitionName(myJob.getPossibleTransition()); label = Character.toUpperCase(label.charAt(0))+label.substring(1); if (myJob.isOutcomeUsed()) setBackground(Color.white); super.setText(label); addActionListener(this); } public void actionPerformed(ActionEvent event) { parent.execute(myJob); } }