1 package net.sourceforge.phpdt.externaltools.variable;
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
10 **********************************************************************/
12 import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.swt.widgets.Control;
18 * Represents the API for a client extending one of the
19 * variable extension points to provide visual editing
22 * This interface is not to be extended by clients. Clients
23 * may implement this interface.
26 public interface IVariableComponent {
28 * Returns the control to edit the variable
29 * value, otherwise <code>null</code> if no editing
30 * supported or if <code>createContents</code> has
33 * @return the main control for the variable component
34 * or <code>null</code> if none
36 public Control getControl();
39 * Creates the control to edit the variable. Does nothing
40 * if no editing supported.
42 * @param parent the composite to parent all controls to
43 * @param varTag the variable tag name to create the controls for
44 * @param page the dialog page this visual component will be part of
46 public void createContents(Composite parent, String varTag, IGroupDialogPage page);
49 * Returns the variable value as specified by
50 * the user thru the visual component.
52 * @return the variable value as indicated by the visual component
54 public String getVariableValue();
57 * Returns whether the variable's visual component has an
60 * @return <code>true</code> if all value acceptable, or <code>false</code> otherwise
62 public boolean isValid();
65 * Sets the visual component to represent the
66 * given variable value.
68 * @param varValue the variable value the visual component should indicate
70 public void setVariableValue(String varValue);
73 * Validates visual component current values entered by the
74 * user and updates it's valid state if needed
76 public void validate();