A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse.externaltools / src / net / sourceforge / phpdt / externaltools / variable / IVariableComponent.java
1 package net.sourceforge.phpdt.externaltools.variable;
2
3 /**********************************************************************
4  Copyright (c) 2002 IBM Corp. and others. All rights reserved.
5  This file is made available under the terms of the Common Public License v1.0
6  which accompanies this distribution, and is available at
7  http://www.eclipse.org/legal/cpl-v10.html
8  �
9  Contributors:
10  **********************************************************************/
11
12 import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage;
13
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.swt.widgets.Control;
16
17 /**
18  * Represents the API for a client extending one of the variable extension
19  * points to provide visual editing of the variable.
20  * <p>
21  * This interface is not to be extended by clients. Clients may implement this
22  * interface.
23  * </p>
24  */
25 public interface IVariableComponent {
26         /**
27          * Returns the control to edit the variable value, otherwise
28          * <code>null</code> if no editing supported or if
29          * <code>createContents</code> has not been called yet
30          * 
31          * @return the main control for the variable component or <code>null</code>
32          *         if none
33          */
34         public Control getControl();
35
36         /**
37          * Creates the control to edit the variable. Does nothing if no editing
38          * supported.
39          * 
40          * @param parent
41          *            the composite to parent all controls to
42          * @param varTag
43          *            the variable tag name to create the controls for
44          * @param page
45          *            the dialog page this visual component will be part of
46          */
47         public void createContents(Composite parent, String varTag,
48                         IGroupDialogPage page);
49
50         /**
51          * Returns the variable value as specified by the user thru the visual
52          * component.
53          * 
54          * @return the variable value as indicated by the visual component
55          */
56         public String getVariableValue();
57
58         /**
59          * Returns whether the variable's visual component has an acceptable value.
60          * 
61          * @return <code>true</code> if all value acceptable, or
62          *         <code>false</code> otherwise
63          */
64         public boolean isValid();
65
66         /**
67          * Sets the visual component to represent the given variable value.
68          * 
69          * @param varValue
70          *            the variable value the visual component should indicate
71          */
72         public void setVariableValue(String varValue);
73
74         /**
75          * Validates visual component current values entered by the user and updates
76          * it's valid state if needed
77          */
78         public void validate();
79 }