01: package com.opensymphony.workflow.designer.editor;
02:
03: import javax.swing.*;
04:
05: import com.opensymphony.workflow.designer.*;
06: import com.opensymphony.workflow.loader.AbstractDescriptor;
07:
08: /**
09: * @author Hani Suleiman (hani@formicary.net)
10: * Date: May 20, 2003
11: * Time: 10:27:26 AM
12: */
13: public abstract class DetailPanel extends JPanel {
14: private AbstractDescriptor descriptor;
15: private WorkflowGraphModel model;
16: private WorkflowGraph graph;
17:
18: private boolean componentsInited = false;
19:
20: public AbstractDescriptor getDescriptor() {
21: return descriptor;
22: }
23:
24: protected void viewClosed() {
25: }
26:
27: public final void closeView() {
28: viewClosed();
29: }
30:
31: public WorkflowGraphModel getModel() {
32: return model;
33: }
34:
35: public void setModel(WorkflowGraphModel model) {
36: this .model = model;
37: }
38:
39: public WorkflowGraph getGraph() {
40: return graph;
41: }
42:
43: public void setGraph(WorkflowGraph graph) {
44: this .graph = graph;
45: }
46:
47: public final void setDescriptor(AbstractDescriptor descriptor) {
48: if (!componentsInited) {
49: initComponents();
50: componentsInited = true;
51: }
52: this .descriptor = descriptor;
53: setName(descriptor.getClass().getName());
54: updateView();
55: }
56:
57: protected abstract void initComponents();
58:
59: protected abstract void updateView();
60:
61: public String getTitle() {
62: return ResourceManager.getString("details");
63: }
64: }
|