01: /*
02: * Copyright 2006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: package org.pentaho.designstudio.widgets.flowtable;
14:
15: import org.eclipse.swt.graphics.Image;
16: import org.pentaho.actionsequence.dom.AbstractIOElement;
17: import org.pentaho.actionsequence.dom.ActionControlStatement;
18: import org.pentaho.actionsequence.dom.ActionIfStatement;
19: import org.pentaho.designstudio.messages.Messages;
20:
21: public class TerminatorContent extends FlowContent {
22:
23: ActionControlStatement actionControlStatement;
24:
25: static final AbstractIOElement[] NO_PARAMS = new AbstractIOElement[0];
26:
27: public TerminatorContent(
28: ActionControlStatement actionControlStatement,
29: int indentLevel) {
30: super (indentLevel);
31: this .actionControlStatement = actionControlStatement;
32: }
33:
34: public Image getImage() {
35: return null;
36: }
37:
38: public String getName() {
39: String name = ""; //$NON-NLS-1$
40: if (actionControlStatement instanceof ActionIfStatement) {
41: name = Messages
42: .getString("TerminatorContent.END_IF_STATEMENT"); //$NON-NLS-1$
43: } else {
44: name = Messages
45: .getString("TerminatorContent.END_LOOP_STATEMENT"); //$NON-NLS-1$
46: }
47: return name;
48: }
49:
50: public AbstractIOElement[] getParameters() {
51: return NO_PARAMS;
52: }
53:
54: public String getDescription() {
55: return getName();
56: }
57:
58: public boolean equals(Object arg0) {
59: return (arg0 != null)
60: && (arg0.getClass() == getClass())
61: && ((TerminatorContent) arg0).actionControlStatement
62: .equals(actionControlStatement);
63: }
64:
65: public Object getData() {
66: return actionControlStatement;
67: }
68: }
|