本文整理汇总了Java中com.ibm.xsp.extlib.component.layout.impl.SearchBar类的典型用法代码示例。如果您正苦于以下问题:Java SearchBar类的具体用法?Java SearchBar怎么用?Java SearchBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchBar类属于com.ibm.xsp.extlib.component.layout.impl包,在下文中一共展示了SearchBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeSearchBar
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchBar(final FacesContext context, final ResponseWriter w, final UIApplicationLayout layout, final BasicApplicationConfigurationImpl config, final SearchBar searchBar) throws IOException {
newLine(w);
w.startElement("div", layout);
w.writeAttribute("class", "nav-search", null);
w.writeAttribute("id", "nav-search", null);
newLine(w);
w.startElement("div", layout);
w.writeAttribute("class", "form-search", null);
boolean searchOptions = false;
ITree tree = TreeImpl.get(searchBar.getOptions());
if(tree!=null) {
searchOptions = true;
}
writeSearchBox(context, w, layout, config, searchOptions, searchBar);
newLine(w);
w.endElement("div");
w.writeComment("/.form-search");
newLine(w);
w.endElement("div");
w.writeComment("/.nav-search");
}
示例2: writeSearchBox
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchBox(FacesContext context, ResponseWriter w, UIApplicationLayout c, SimpleResponsiveApplicationConfiguration configuration, SearchBar searchBar, ITree tree, boolean options) throws IOException {
String cid = c.getClientId(context) + "_search"; // $NON-NLS-1$
w.startElement("input", c); // $NON-NLS-1$
w.writeAttribute("id", cid, null); // $NON-NLS-1$
w.writeAttribute("name", cid, null); // $NON-NLS-1$
w.writeAttribute("type", "text", null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("class", "form-control search-query", null); // $NON-NLS-1$ $NON-NLS-2$
String inputTitle = searchBar.getInputTitle();
if (StringUtil.isNotEmpty(inputTitle)) {
w.writeAttribute("title", inputTitle, null); // $NON-NLS-1$
}
String inactiveText = searchBar.getInactiveText();
if (StringUtil.isNotEmpty(inactiveText)) {
w.writeAttribute("placeHolder", inactiveText, null); // $NON-NLS-1$
}
String submitSearch = "_xspAppSearchSubmit"; // $NON-NLS-1$
w.writeAttribute("onkeypress", "javascript:var kc=event.keyCode?event.keyCode:event.which;if(kc==13){"+submitSearch+"(); return false}",null); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
w.endElement("input"); // $NON-NLS-1$
newLine(w);
}
示例3: writeSearchButton
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchButton(FacesContext context, ResponseWriter w, UIApplicationLayout c, SimpleResponsiveApplicationConfiguration configuration, SearchBar searchBar, ITree tree, boolean searchOptions) throws IOException {
String submitSearch = "_xspAppSearchSubmit"; // $NON-NLS-1$
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class","input-group-btn",null); // $NON-NLS-1$ $NON-NLS-2$
newLine(w);
// Write the required script (done here because of Bootstrap 3 last-child selector on the input-group-btn)
writeSearchScript(context, w, c, configuration, searchBar, tree, searchOptions);
newLine(w);
w.startElement("button",c); // $NON-NLS-1$
w.writeAttribute("class","btn btn-default applayout-searchbtn",null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("onclick","javascript:"+submitSearch+"(); return false;",null); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
w.startElement("span",c); // $NON-NLS-1$
w.writeAttribute("class", Resources.get().getIconClass("search"),null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.endElement("button"); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
示例4: writeSearchBox
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchBox(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration, SearchBar searchBar, ITree tree, boolean options) throws IOException {
String cid = c.getClientId(context) + "_search"; // $NON-NLS-1$
w.startElement("input", c); // $NON-NLS-1$
w.writeAttribute("id", cid, null); // $NON-NLS-1$
w.writeAttribute("name", cid, null); // $NON-NLS-1$
w.writeAttribute("type", "text", null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("class", "form-control search-query", null); // $NON-NLS-1$ $NON-NLS-2$
String inputTitle = searchBar.getInputTitle();
if (StringUtil.isNotEmpty(inputTitle)) {
w.writeAttribute("title", inputTitle, null); // $NON-NLS-1$
}
String inactiveText = searchBar.getInactiveText();
if (StringUtil.isNotEmpty(inactiveText)) {
w.writeAttribute("placeHolder", inactiveText, null); // $NON-NLS-1$
}
String submitSearch = "_xspAppSearchSubmit"; // $NON-NLS-1$
w.writeAttribute("onkeypress", "javascript:var kc=event.keyCode?event.keyCode:event.which;if(kc==13){"+submitSearch+"(); return false}",null); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
w.endElement("input"); // $NON-NLS-1$
newLine(w);
}
示例5: writeSearchButton
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchButton(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration, SearchBar searchBar, ITree tree, boolean searchOptions) throws IOException {
String submitSearch = "_xspAppSearchSubmit"; // $NON-NLS-1$
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class","input-group-btn",null); // $NON-NLS-1$ $NON-NLS-2$
newLine(w);
// Write the required script (done here because of Bootstrap 3 last-child selector on the input-group-btn)
writeSearchScript(context, w, c, configuration, searchBar, tree, searchOptions);
newLine(w);
w.startElement("button",c); // $NON-NLS-1$
w.writeAttribute("class","btn btn-default applayout-searchbtn",null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("onclick","javascript:"+submitSearch+"(); return false;",null); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
String searchLabel = com.ibm.xsp.extlib.controls.ResourceHandler.getString("AbstractApplicationLayoutRenderer.Search.1"); // $NON-NLS-1$
w.writeAttribute("aria-label", searchLabel,null); // $NON-NLS-1$
w.startElement("span",c); // $NON-NLS-1$
w.writeAttribute("aria-hidden","true",null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("class", Resources.get().getIconClass("search"),null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.endElement("button"); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
示例6: writeSearchButton
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
@Override
protected void writeSearchButton(FacesContext context, ResponseWriter w, UIApplicationLayout c, SimpleResponsiveApplicationConfiguration configuration, SearchBar searchBar, ITree tree, boolean searchOptions) throws IOException {
String submitSearch = "_xspAppSearchSubmit"; // $NON-NLS-1$
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class","input-group-btn",null); // $NON-NLS-1$ $NON-NLS-2$
newLine(w);
// Write the required script (done here because of Bootstrap 3 last-child selector on the input-group-btn)
writeSearchScript(context, w, c, configuration, searchBar, tree, searchOptions);
w.startElement("button",c); // $NON-NLS-1$
w.writeAttribute("class","btn btn-secondary-outline applayout-searchbtn",null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("onclick","javascript:"+submitSearch+"(); return false;",null); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
w.startElement("span",c); // $NON-NLS-1$
w.writeAttribute("class", Resources.get().getIconClass("search"),null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.endElement("button"); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
示例7: writeBannerContent
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
@Override
protected void writeBannerContent(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration) throws IOException {
boolean hasChildren = c.getChildCount() > 0;
ITree appLinks = TreeImpl.get(configuration.getBannerApplicationLinks());
ITree utilityLinks = TreeImpl.get(configuration.getBannerUtilityLinks());
String productLogo = configuration.getProductLogo();
SearchBar searchBar = configuration.getSearchBar();
boolean bannerHasContent = hasChildren || appLinks != null || utilityLinks != null || productLogo != null || searchBar != null;
if(bannerHasContent) {
writeBannerLink(context, w, c, configuration);
}
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class", ExtLibUtil.concatStyleClasses((String)getProperty(PROP_BANNER_COLLAPSE_CLASS), "collapse navbar-toggleable-sm"), null); // $NON-NLS-1$ $NON-NLS-2$
writeBannerProductlogo(context, w, c, configuration);
writeBannerApplicationLinks(context, w, c, configuration);
writeBannerUtilityLinks(context, w, c, configuration);
w.endElement("div"); // $NON-NLS-1$
}
示例8: writeSearchButton
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
@Override
protected void writeSearchButton(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration, SearchBar searchBar, ITree tree, boolean searchOptions) throws IOException {
String submitSearch = "_xspAppSearchSubmit"; // $NON-NLS-1$
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class","input-group-btn",null); // $NON-NLS-1$ $NON-NLS-2$
newLine(w);
// Write the required script (done here because of Bootstrap 3 last-child selector on the input-group-btn)
writeSearchScript(context, w, c, configuration, searchBar, tree, searchOptions);
newLine(w);
w.startElement("button",c); // $NON-NLS-1$
w.writeAttribute("class","btn btn-secondary-outline applayout-searchbtn",null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("onclick","javascript:"+submitSearch+"(); return false;",null); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
w.startElement("span",c); // $NON-NLS-1$
w.writeAttribute("class", Resources.get().getIconClass("search"),null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.endElement("button"); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
示例9: writeBreadCrumbBar
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeBreadCrumbBar(final FacesContext context, final ResponseWriter w, final UIApplicationLayout layout, final BasicApplicationConfigurationImpl config) throws IOException {
// This should render if breadcrumbs or search are present
SearchBar searchBar = config.getSearchBar();
UIComponent anyOldSearchBar = layout.getFacet("SearchBar");
UIComponent breadCrumbs = layout.getFacet("BreadCrumbs");
boolean rendered = searchBar != null || anyOldSearchBar != null || breadCrumbs != null;
if(rendered) {
newLine(w);
w.startElement("div", layout);
w.writeAttribute("class", "breadcrumbs" + (isFixedLayout(layout) ? " breadcrumbs-fixed" : ""), null);
w.writeAttribute("id", "breadcrumbs", null);
if(breadCrumbs != null) {
writeBreadCrumbs(context, w, layout, config, breadCrumbs);
}
if(anyOldSearchBar != null) {
writeAnyOldSearchBar(context, w, layout, config, anyOldSearchBar);
} else if(searchBar != null) {
writeSearchBar(context, w, layout, config, searchBar);
}
newLine(w);
w.endElement("div");
w.writeComment("/.breadcrumbs");
}
}
示例10: getSearchOptionsRenderer
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected AbstractTreeRenderer getSearchOptionsRenderer(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration, SearchBar searchBar) {
String cid = c.getClientId(context)+"_searchopt"; // $NON-NLS-1$
ComboBoxRenderer renderer = (ComboBoxRenderer)getProperty(PROP_SEARCHBAROPTIONSRENDERER);
renderer.setClientId(cid);
String scopeTitle = searchBar.getScopeTitle();
if(null == scopeTitle) {
scopeTitle = (String) getProperty(PROP_SEARCHSCOPETITLE);
}
if (scopeTitle != null) {
renderer.setAccTitle(scopeTitle);
}
return renderer;
}
示例11: writeNavbarLink
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeNavbarLink(FacesContext context, ResponseWriter w, UIApplicationLayout c, SimpleResponsiveApplicationConfiguration configuration) throws IOException {
List<ITreeNode> utilLinks = configuration.getNavbarUtilityLinks();
List<ITreeNode> appLinks = configuration.getNavbarAppLinks();
SearchBar searchBar = configuration.getSearchBar();
if((utilLinks != null && utilLinks.size() > 0) || (appLinks != null && appLinks.size() > 0) || (searchBar != null && searchBar.isRendered())) {
w.startElement("button", c); // $NON-NLS-1$
w.writeAttribute("type", "button", null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("aria-label",(String)getProperty(PROP_BANNER_COLLAPSE_BUTTON_ARIALABEL), null); // $NON-NLS-1$
w.writeAttribute("class", "navbar-toggle", null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("data-toggle", "collapse", null); // $NON-NLS-1$ $NON-NLS-2$
w.writeAttribute("data-target", "." + getProperty(PROP_BANNER_COLLAPSE_CLASS), null); // $NON-NLS-1$
w.startElement("span", c); // $NON-NLS-1$
w.writeAttribute("class", "sr-only", null); // $NON-NLS-1$ $NON-NLS-2$
w.writeText((String)getProperty(PROP_BANNER_COLLAPSE_BUTTON_ARIALABEL), null); // $NON-NLS-1$
w.endElement("span"); // $NON-NLS-1$
w.startElement("span", c); // $NON-NLS-1$
w.writeAttribute("class", "icon-bar", null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.startElement("span", c); // $NON-NLS-1$
w.writeAttribute("class", "icon-bar", null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.startElement("span", c); // $NON-NLS-1$
w.writeAttribute("class", "icon-bar", null); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.endElement("button"); // $NON-NLS-1$
}
}
示例12: writeSearchOptions
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchOptions(FacesContext context, ResponseWriter w, UIApplicationLayout c, SimpleResponsiveApplicationConfiguration configuration, SearchBar searchBar, ITree tree) throws IOException {
AbstractTreeRenderer renderer = getSearchOptionsRenderer(context, w, c, configuration, searchBar);
if (renderer != null) {
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class","input-group-btn",null); // $NON-NLS-1$ $NON-NLS-2$
// Feels like a hack...
w.writeAttribute("style","width: 30%",null); // $NON-NLS-1$ $NON-NLS-2$
newLine(w);
renderer.render(context, c, "so", tree, w); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
}
示例13: getSearchOptionsRenderer
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected AbstractTreeRenderer getSearchOptionsRenderer(FacesContext context, ResponseWriter w, UIApplicationLayout c, SimpleResponsiveApplicationConfiguration configuration, SearchBar searchBar) {
String cid = c.getClientId(context) + "_searchopt"; // $NON-NLS-1$
ComboBoxRenderer renderer = new SearchOptionsRenderer();
renderer.setClientId(cid);
String scopeTitle = searchBar.getScopeTitle();
if (null == scopeTitle) {
scopeTitle = "";
}
if (StringUtil.isNotEmpty(scopeTitle)) {
renderer.setAccTitle(scopeTitle);
}
return renderer;
}
示例14: writeSearchOptions
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected void writeSearchOptions(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration, SearchBar searchBar, ITree tree) throws IOException {
AbstractTreeRenderer renderer = getSearchOptionsRenderer(context, w, c, configuration, searchBar);
if (renderer != null) {
w.startElement("div", c); // $NON-NLS-1$
w.writeAttribute("class","input-group-btn",null); // $NON-NLS-1$ $NON-NLS-2$
// Feels like a hack...
w.writeAttribute("style","width: 30%",null); // $NON-NLS-1$ $NON-NLS-2$
newLine(w);
renderer.render(context, c, "so", tree, w); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
}
示例15: getSearchOptionsRenderer
import com.ibm.xsp.extlib.component.layout.impl.SearchBar; //导入依赖的package包/类
protected AbstractTreeRenderer getSearchOptionsRenderer(FacesContext context, ResponseWriter w, UIApplicationLayout c, BasicApplicationConfigurationImpl configuration, SearchBar searchBar) {
String cid = c.getClientId(context) + "_searchopt"; // $NON-NLS-1$
ComboBoxRenderer renderer = new SearchOptionsRenderer();
renderer.setClientId(cid);
String scopeTitle = searchBar.getScopeTitle();
if (null == scopeTitle) {
scopeTitle = "";
}
if (StringUtil.isNotEmpty(scopeTitle)) {
renderer.setAccTitle(scopeTitle);
}
return renderer;
}