Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The PanelCollection API uses several helper objects. They may be used for passing around options, validation or setting up dependencies. This section discusses them in detail.

 

GeneralPanelOptions


This class is used to define general UI rendering options at the Parameter Panel and Section levels. Methods of significance are:

 

MethodsDescription

public void setSaveButton(boolean saveButton)

public void setSaveButtonOptions(Map<String, Object> opts)

public void setSaveText(String saveText)

Setting the setSaveButton option to true displays a save button in the panel or section. Display options may be set using setSaveButtonOptions. Available options are listed under type BUTTON in the section on Input Types. The text on the button can be customised using setSaveText.

public void setExpandable(boolean expandable)

public void setExpanded(boolean expandable)

These are used to make a section expandable and render it expanded.

public void setShowName(boolean showTitle)When this is set to true, the name of the panel or section is displayed at the top of the container.
public void setCssRules(Set<CssRule> cssRules)

This method is used to set custom CSS rules to style a section or panel and everything within its html container.

 

 


 

CssRule


This interface is used to define styling rules in various levels of the PanelCollection API. The levels which support it, accept a set of CssRule objects. Yellowfin has an implementation called CssRuleImpl, which define a single CSS Rule, such as:

 

div.styleExampleCell {
  	border: none;
  	color: #666666;
}

 

Instances will have a selector and one or more of CSS declarations. If a selector isn’t defined, Yellowfin will autogenerate one.

The CssDeclaration interface describes a single declaration such as:

 

border: none;

 

Yellowfin has an implementation called CssDeclarationImpl which accepts a property and value.


Parameter inputField = new ParameterImpl();
inputField.setName("Example Param");
inputField.setProperty("PARAM_PROPERTY");
inputField.setInputType(InputType.TEXTBOX);
 
CssRule cssRule = new CssRuleImpl("input", false);
cssRule.addDeclaration(new CssDeclarationImpl("height", "21px"));
cssRule.addDeclaration(new CssDeclarationImpl("padding", "5px"));
cssRule.addDeclaration(new CssDeclarationImpl("font-size", "16px"));
cssRule.addDeclaration(new CssDeclarationImpl("resize", "none"));
cssRule.addDeclaration(new CssDeclarationImpl("color", "#666666"));
cssRule.addDeclaration(new CssDeclarationImpl("border", "1px solid #e4e4e4"));
Set<CssRule> cssRules = new HashSet<>();
cssRules.add(cssRule);
inputField.setCssRules(cssRules);

 

This created the following CSS rule:

input {
  	height: 21px;
	padding: 5px;
	font-size: 16px;
	resize: none;
  	color: #666666;
  	border: 1px solid #e4e4e4;
}

 

 

 

 

MethodsDescription

 

public void setSaveButton(boolean saveButton)

public void setSaveButtonOptions(Map<String, Object> opts)

public void setSaveText(String saveText)

 

Setting the setSaveButton option to true displays a save button in the panel or section. Display options may be set using setSaveButtonOptions. Available options are listed under type BUTTON in the section on Input Types. The text on the button can be customised using setSaveText.

 

 

 

  • No labels