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 org.eclipse.swt.widgets.Composite;
13 import org.eclipse.swt.widgets.Control;
14 import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage;
17 * Represents the API for a client extending one of the
18 * variable extension points to provide visual editing
21 * This interface is not to be extended by clients. Clients
22 * may implement this interface.
25 public interface IVariableComponent {
27 * Returns the control to edit the variable
28 * value, otherwise <code>null</code> if no editing
29 * supported or if <code>createContents</code> has
32 * @return the main control for the variable component
33 * or <code>null</code> if none
35 public Control getControl();
38 * Creates the control to edit the variable. Does nothing
39 * if no editing supported.
41 * @param parent the composite to parent all controls to
42 * @param varTag the variable tag name to create the controls for
43 * @param page the dialog page this visual component will be part of
45 public void createContents(Composite parent, String varTag, IGroupDialogPage page);
48 * Returns the variable value as specified by
49 * the user thru the visual component.
51 * @return the variable value as indicated by the visual component
53 public String getVariableValue();
56 * Returns whether the variable's visual component has an
59 * @return <code>true</code> if all value acceptable, or <code>false</code> otherwise
61 public boolean isValid();
64 * Sets the visual component to represent the
65 * given variable value.
67 * @param varValue the variable value the visual component should indicate
69 public void setVariableValue(String varValue);
72 * Validates visual component current values entered by the
73 * user and updates it's valid state if needed
75 public void validate();