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 variable extension
19 * points to provide visual editing of the variable.
21 * This interface is not to be extended by clients. Clients may implement this
25 public interface IVariableComponent {
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
31 * @return the main control for the variable component or <code>null</code>
34 public Control getControl();
37 * Creates the control to edit the variable. Does nothing if no editing
41 * the composite to parent all controls to
43 * the variable tag name to create the controls for
45 * the dialog page this visual component will be part of
47 public void createContents(Composite parent, String varTag,
48 IGroupDialogPage page);
51 * Returns the variable value as specified by the user thru the visual
54 * @return the variable value as indicated by the visual component
56 public String getVariableValue();
59 * Returns whether the variable's visual component has an acceptable value.
61 * @return <code>true</code> if all value acceptable, or
62 * <code>false</code> otherwise
64 public boolean isValid();
67 * Sets the visual component to represent the given variable value.
70 * the variable value the visual component should indicate
72 public void setVariableValue(String varValue);
75 * Validates visual component current values entered by the user and updates
76 * it's valid state if needed
78 public void validate();