---
title: "Basic UI Set Up"
canonical: "https://wiki.yellowfinbi.com/space/yfcurrent/2195817/Basic%20UI%20Set%20Up"
format: markdown
---
> Macro (anchor)



This section provides information in setting up a basic UI for the UIP API. This type of set up is exceedingly simple and requires very little code. In short, a plug-in may define its UI as a list of Parameter objects which define how to display and persist the required user input data.

The three below methods plus some understanding of the Parameter class and ViewOptions are all that is required to create a simple static UI.

 

- [protected void setupParameters()](#BasicUISetUp-setupParam)
- [protected final void addParameter(Parameter p)](#BasicUISetUp-addParam)
- [<span style="color: #000000">public final Object getParameterValue(String key)</span>](#BasicUISetUp-getParamVal)
- [<span style="color: #000000">public void setParameterValue(String key, Object value)</span>](#BasicUISetUp-setParamVal)
- [<span style="color: #000000">public void clearParameterValue(String key)</span>](#BasicUISetUp-clearParamVal)
- [<span style="color: #000000">public void getParameter(String key)</span>](#BasicUISetUp-getParam)
  
  

 

 

> Macro (anchor)



### <span style="color: #434343">protected void setupParameters()</span>

Plug-ins should implement this method to provide the API with the UI definitions required for configuration. Generally, the plug-in will create Parameter objects and add them by calling addParameter(Parameter).


Example:

 

```java
@Override
protected void setupParameters() {
    Parameter p = new Parameter();
    ... 

    addParameter(p);
}
```

 

 

---


> Macro (anchor)



### <span style="color: #434343">protected final void addParameter(Parameter p)</span>

Plug-ins should use this method to notify the API of any new parameters that it creates. Note that new parameters will not be persisted if they are added outside of the setupParameters method. See above example.



---


> Macro (anchor)



### <span style="color: #434343">public final Object getParameterValue(String key) </span>

This method returns the current value for the parameter with unique key ‘key’.

Example:

```java
Object paramVal = getParameterValue("SOME_KEY");
if (paramVal != null && paramVal.equals("INTERESTING_CONFIG")) {
   // Do something interesting
   ...
}
```



---


> Macro (anchor)



### <span style="color: #434343">public void setParameterValue(String key, Object value)</span>

This method sets the stored value for a parameter key.


Example:

 

```java
Object paramVal = getParameterValue("SOME_KEY");
if (shouldChangeThisValue(paramVal)) {
   Object newValue = new Object();
   setParameterValue("SOME_KEY", newValue);
}
```

 

 

 


---


> Macro (anchor)



### <span style="color: #434343">public void clearParameterValue(String key)</span>

Equivalent to calling setParameterValue(key, null); except that this method also removes the parameter key from the parameter values map.

 

Example:

```java
Object paramVal = getParameterValue("SOME_KEY");
if (shouldRemoveThisValue(paramVal)) {
   clearParameterValue("SOME_KEY");
}
```

 

 

---

 

> Macro (anchor)



### <span style="color: #434343">public void getParameter(String key)</span>

Retrieves a previously set up parameter with the given key. Returns null if no parameter with this key exists.


Example:

 

```java
if (needToUpdateParameter()) {
   Parameter p = getParameter("SOME_KEY");
   ... 
}
```

 

  





> Macro (section)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)