1 package com.opensymphony.workflow.designer.editor; 2 3 import javax.swing.*; 4 5 import com.opensymphony.workflow.designer.*; 6 7 12 public abstract class DetailPanel extends JPanel 13 { 14 private WorkflowCell cell; 15 private WorkflowEdge edge; 16 private WorkflowGraphModel model; 17 18 private boolean componentsInited = false; 19 20 public WorkflowCell getCell() 21 { 22 return cell; 23 } 24 25 public WorkflowEdge getEdge() 26 { 27 return edge; 28 } 29 30 protected void viewClosed() 31 { 32 } 33 34 public final void closeView() 35 { 36 viewClosed(); 37 } 38 39 public WorkflowGraphModel getModel() 40 { 41 return model; 42 } 43 44 public void setModel(WorkflowGraphModel model) 45 { 46 this.model = model; 47 } 48 49 public final void setCell(WorkflowCell cell) 50 { 51 if(!componentsInited) 52 { 53 initComponents(); 54 componentsInited = true; 55 } 56 this.cell = cell; 57 setName(cell.getClass().getName()); 58 updateView(); 59 } 60 61 protected abstract void initComponents(); 62 63 protected abstract void updateView(); 64 65 public String getTitle() 66 { 67 return ResourceManager.getString("details"); 68 } 69 70 public void setEdge(WorkflowEdge edge) 71 { 72 if(!componentsInited) 73 { 74 initComponents(); 75 componentsInited = true; 76 } 77 componentsInited = true; 78 this.edge = edge; 79 setName(edge.getClass().getName()); 80 updateView(); 81 } 82 } 83 | Popular Tags |