KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > editors > report > ReportWorkflows


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.him.editors.report;
20
21 import java.util.Iterator JavaDoc;
22
23 import javax.swing.JPanel JavaDoc;
24
25 import org.openharmonise.him.editors.report.rqom.*;
26
27
28 /**
29  * Panel for the workflow section of the report query editor.
30  *
31  * @author Matthew Large
32  * @version $Revision: 1.1 $
33  *
34  */

35 public class ReportWorkflows extends ReportMultiPanel {
36
37     /**
38      * Constructs a new workflow panel.
39      *
40      * @param query Report query
41      */

42     public ReportWorkflows(ReportQuery query) {
43         super(query, "Workflow stage");
44         this.setup();
45     }
46     
47     /**
48      * Configures this component.
49      *
50      */

51     private void setup() {
52         Iterator JavaDoc itor = this.m_reportQuery.getWorkflowStages().iterator();
53         while (itor.hasNext()) {
54             WorkflowStage workflowStage = (WorkflowStage) itor.next();
55             WorkflowStagePanel workflowStagePanel = new WorkflowStagePanel(this.m_reportQuery, workflowStage);
56             super.addValueComponent(workflowStagePanel);
57         }
58     }
59
60     /* (non-Javadoc)
61      * @see com.simulacramedia.contentmanager.editors.report.ReportMultiPanel#getNewValueComponent()
62      */

63     public JPanel JavaDoc getNewValueComponent() {
64         WorkflowStage workflowStage = new WorkflowStage(null, this.m_reportQuery);
65         this.m_reportQuery.addWorkflowStage(workflowStage);
66         WorkflowStagePanel workflowStagePanel = new WorkflowStagePanel(this.m_reportQuery, workflowStage);
67         return workflowStagePanel;
68     }
69
70     /* (non-Javadoc)
71      * @see com.simulacramedia.contentmanager.editors.report.ReportMultiPanel#removeValueComponent(javax.swing.JPanel)
72      */

73     public void removeValueComponent(JPanel JavaDoc valueComponent) {
74         WorkflowStagePanel panel = (WorkflowStagePanel) valueComponent;
75         this.m_reportQuery.removeWorkflowStage(panel.getStage());
76     }
77
78     /* (non-Javadoc)
79      * @see com.simulacramedia.contentmanager.editors.report.ReportMultiPanel#getValueComponentCount()
80      */

81     public int getValueComponentCount() {
82         return m_reportQuery.getWorkflowStages().size();
83     }
84
85 }
86
Popular Tags