本文整理汇总了Java中com.ibm.xsp.extlib.util.ExtLibUtil类的典型用法代码示例。如果您正苦于以下问题:Java ExtLibUtil类的具体用法?Java ExtLibUtil怎么用?Java ExtLibUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtLibUtil类属于com.ibm.xsp.extlib.util包,在下文中一共展示了ExtLibUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemStyleClass
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
protected String getItemStyleClass(final TreeContextImpl tree, final boolean enabled, final boolean selected) {
String clazz = null;
if(tree.getNode().getType() == ITreeNode.NODE_SEPARATOR) {
clazz = "divider";
}
if(!enabled) {
clazz = ExtLibUtil.concatStyleClasses(clazz, "disabled");
}
if(selected) {
// TODO make this look for children
clazz = ExtLibUtil.concatStyleClasses(clazz, (String)getProperty(PROP_MENU_SELECTED));
if(tree.getNode().getType() == ITreeNode.NODE_CONTAINER) {
clazz = ExtLibUtil.concatStyleClasses(clazz, "open");
}
}
return clazz;
}
示例2: writePagerContent
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
protected void writePagerContent(FacesContext context, ResponseWriter w, AbstractPager _pager, FacesDataIterator dataIterator) throws IOException {
UIPagerSizes pager = (UIPagerSizes) _pager;
w.startElement("div", null); // $NON-NLS-1$
w.startElement("ul", null); // $NON-NLS-1$
String styleClass = pager.getStyleClass();
String pgClass = ExtLibUtil.concatStyleClasses("pagination", styleClass); // $NON-NLS-1$
if (StringUtil.isNotEmpty(pgClass)) {
w.writeAttribute("class", pgClass, null); // $NON-NLS-1$
}
String text = pager.getText();
if (StringUtil.isEmpty(text)) {
// "Show {0} items per page";
text = com.ibm.xsp.extlib.controls.ResourceHandler.getString("PagerSizesRenderer.Show0itemsperpage"); //$NON-NLS-1$
}
int pos = text.indexOf("{0}"); //$NON-NLS-1$
writerStartText(context, w, pager, dataIterator, text, pos);
writerPages(context, w, pager, dataIterator, text, pos);
writerEndText(context, w, pager, dataIterator, text, pos);
w.endElement("ul"); // $NON-NLS-1$
w.endElement("div"); // $NON-NLS-1$
}
示例3: axDeleteTab
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
protected int axDeleteTab(FacesContext context, StringBuilder b, Map<String, String> params) throws IOException {
int errorCode = 200; // OK
boolean removed = false;
List<UIComponent> children = TypedUtil.getChildren(getParent());
children.remove(this);
removed = true;
b.append(removed?"true":"false"); // $NON-NLS-1$ $NON-NLS-2$
if(removed) {
ExtLibUtil.saveViewState(context);
}
return errorCode;
}
示例4: UIPagerSaveState
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
public UIPagerSaveState() {
super();
setRendererType(RENDERER_TYPE);
// The state management is done by a global, request scoped, bean.
// This component acts as a proxy to the actual data iterator
FacesContext context = FacesContext.getCurrentInstance();
// try {
ExtLibUtil.assignBindingProperty(context, "#{viewStateBean.dataIterator}", this); //$NON-NLS-1$
// Updated 2011-07-29: the unit tests are initializing
// managed beans correctly, so no need for this catch statement
// } catch(Throwable ex) {
// // catch so can pass unit tests
// ExtlibCoreLogger.COMPONENT_DATA.warnp(this, "<init>", ex,//$NON-NLS-1$
// "This xe:pagerSaveState control cannot bind to the viewStateBean managed bean, when viewing the page {0}.",
// context.getExternalContext().getRequestContextPath());
// }
}
示例5: addEncodeResource
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked") // $NON-NLS-1$
public static void addEncodeResource(UIViewRootEx rootEx, Resource resource) {
if(ExtLibUtil.isXPages852()) {
// The XPages runtime add all the resources and does a check when it starts to
// generate all the resources at the very end.
// For performance reasons, and until the XPages runtime optimizes this, we ensure
// that the same resource (the exact same object - identity comparison) is not
// added multiple times.
// Already optimized in post 852
IdentityHashMap<Resource, Boolean> m = (IdentityHashMap<Resource, Boolean>)rootEx.getEncodeProperty("extlib.EncodeResource"); // $NON-NLS-1$
if(m==null) {
m = new IdentityHashMap<Resource, Boolean>();
} else {
if(m.containsKey(resource)) {
return;
}
}
m.put(resource, Boolean.TRUE);
}
rootEx.addEncodeResource(resource);
}
示例6: writeRightColumn
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
//TODO the small size fix has been applied to super class
// if that is delivered, we can delete this method
protected void writeRightColumn(FacesContext context, ResponseWriter w, UIApplicationLayout c, int size, BasicApplicationConfigurationImpl configuration) throws IOException {
UIComponent right = c.getRightColumn();
if (!isEmptyComponent(right)) {
w.startElement("div", c); // $NON-NLS-1$
String mdCol = (String)getProperty(PROP_COLUMN_MEDIUM);
String smCol = (String)getProperty(PROP_COLUMN_SMALL);
String columnClass = ExtLibUtil.concatStyleClasses(mdCol + size, smCol + (size+1));
w.writeAttribute("class", ExtLibUtil.concatStyleClasses(columnClass, "applayout-column-right"), null); // $NON-NLS-1$ $NON-NLS-2$
FacesUtil.renderComponent(context, right);
w.endElement("div"); // $NON-NLS-1$
}
}
示例7: renderEntryItemLinkAttributes
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
protected void renderEntryItemLinkAttributes(FacesContext context, ResponseWriter writer, TreeContextImpl tree, boolean enabled, boolean selected) throws IOException {
String clazz = null;
String styleClass = tree.getNode().getStyleClass();
if(StringUtil.isNotEmpty(styleClass)) {
clazz = ExtLibUtil.concatStyleClasses(clazz, styleClass);
}
String itemStyle = tree.getNode().getStyle();
if(StringUtil.isNotEmpty(itemStyle)) {
writer.writeAttribute("style",itemStyle,null); // $NON-NLS-1$
}
if(tree.getNode().getType()==ITreeNode.NODE_CONTAINER) {
clazz = ExtLibUtil.concatStyleClasses(clazz, "dropdown-toggle");// $NON-NLS-1$
writer.writeAttribute("data-toggle","dropdown",null); // $NON-NLS-1$ $NON-NLS-2$
writer.writeAttribute("href", "#", null); // $NON-NLS-1$ $NON-NLS-2$
}
if(StringUtil.isNotEmpty(clazz)) {
writer.writeAttribute("class",clazz,null); // $NON-NLS-1$
}
}
示例8: notesColorToCSS
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
private String notesColorToCSS(final int notesColor) {
try {
Session session = ExtLibUtil.getCurrentSession();
ColorObject colorObject = session.createColorObject();
colorObject.setNotesColor(notesColor);
StringBuilder result = new StringBuilder();
result.append("rgb(");
result.append(colorObject.getRed());
result.append(",");
result.append(colorObject.getGreen());
result.append(",");
result.append(colorObject.getBlue());
result.append(")");
return result.toString();
} catch(NotesException ne) {
return "";
}
}
示例9: writeNodeBadge
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
public void writeNodeBadge(FacesContext context, ResponseWriter w, UIDashboard c, DashNode node) throws IOException{
String badgeLabel = node.getBadgeLabel();
String badgeStyle = node.getBadgeStyle();
String badgeClass = node.getBadgeStyleClass();
w.startElement((String)getProperty(PROP_NODE_DEFAULT_BADGE_TAG), c);
String badgeClazz = ExtLibUtil.concatStyleClasses((String)getProperty(PROP_NODE_DEFAULT_BADGE_CLASS), badgeClass);
if(StringUtil.isNotEmpty(badgeClazz)) {
w.writeAttribute("class", badgeClazz, null); // $NON-NLS-1$
}
String badgeMixinStyle = ExtLibUtil.concatStyles((String)getProperty(PROP_NODE_DEFAULT_BADGE_STYLE), badgeStyle);
if(StringUtil.isNotEmpty(badgeMixinStyle)) {
w.writeAttribute("style", badgeMixinStyle, null); // $NON-NLS-1$
}
if(StringUtil.isNotEmpty(badgeLabel)) {
w.writeText(badgeLabel, null);
}
w.endElement((String)getProperty(PROP_NODE_DEFAULT_BADGE_TAG));
}
示例10: preRenderList
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
protected void preRenderList(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
writer.startElement("nav", null); // $NON-NLS-1$
writer.writeAttribute("role", "navigation", null); // $NON-NLS-1$ $NON-NLS-2$
writer.writeAttribute("aria-label", "Breadcrumbs", null);//$NON-NLS-1$ // $NLS-OneUIv302BreadCrumbsRenderer_Breadcrumbs_IndicationOfCurrentNavigationLocation-2$
String style = getContainerStyle(tree);
if(StringUtil.isNotEmpty(style)) {
writer.writeAttribute("style",style,null); // $NON-NLS-1$
}
String styleClass = ExtLibUtil.concatStyleClasses((String)getProperty(PROP_BREADCRUMBS_CONTAINER),getContainerStyleClass(tree));
if(StringUtil.isNotEmpty(styleClass)) {
writer.writeAttribute("class",styleClass,null); // $NON-NLS-1$
}
UIComponent c = tree.getComponent();
if(c instanceof UIOutlineBreadCrumbs) {
String text = ((UIOutlineBreadCrumbs)c).getLabel();
if(StringUtil.isNotEmpty(text)) {
writer.writeText(text, null);
}
}
}
示例11: writeContentColumn
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
//TODO the small size fix has been applied to super class
// if that is delivered, we can delete this method
protected void writeContentColumn(FacesContext context, ResponseWriter w, UIApplicationLayout c, int size, BasicApplicationConfigurationImpl configuration) throws IOException {
if (!isEmptyChildren(c)) {
w.startElement("div", c); // $NON-NLS-1$
String mdCol = (String)getProperty(PROP_COLUMN_MEDIUM);
String smCol = (String)getProperty(PROP_COLUMN_SMALL);
int smallSize = isEmptyComponent(c.getLeftColumn()) ? size : size-1;
smallSize = isEmptyComponent(c.getRightColumn()) ? smallSize : smallSize-1;
String contentClass = ExtLibUtil.concatStyleClasses(mdCol + size, smCol + smallSize);
w.writeAttribute("class", ExtLibUtil.concatStyleClasses(contentClass, "applayout-content"), null); // $NON-NLS-1$ $NON-NLS-2$
renderChildren(context, c);
w.endElement("div"); // $NON-NLS-1$
}
}
示例12: isHybridApplication
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
public boolean isHybridApplication() {
checkOnBluemix();
try{
Session session = ExtLibUtil.getCurrentSession();
String serverName = session.getServerName();
String defaultServerNameFull = "CN=vcap/O=Bluemix"; // $NON-NLS-1$
String defaultServerNameShort = "vcap/Bluemix"; // $NON-NLS-1$
if(serverName != null && !serverName.equals(defaultServerNameFull) && !serverName.equals(defaultServerNameShort)) {
return true;
}
}catch(NotesException ne) {
throw new FacesException(ne.getMessage());
}
return false;
}
示例13: preRenderList
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
protected void preRenderList(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
writer.startElement("div", null); // $NON-NLS-1$
writer.writeAttribute("role", "navigation", null); // $NON-NLS-1$ $NON-NLS-2$
String style = getContainerStyle(tree);
if(StringUtil.isNotEmpty(style)) {
writer.writeAttribute("style",style,null); // $NON-NLS-1$
}
String styleClass = ExtLibUtil.concatStyleClasses((String)getProperty(PROP_BREADCRUMBS_CONTAINER),getContainerStyleClass(tree));
if(StringUtil.isNotEmpty(styleClass)) {
writer.writeAttribute("class",styleClass,null); // $NON-NLS-1$
}
UIComponent c = tree.getComponent();
if(c instanceof UIOutlineBreadCrumbs) {
String text = ((UIOutlineBreadCrumbs)c).getLabel();
if(StringUtil.isNotEmpty(text)) {
writer.startElement("span", null); // $NON-NLS-1$
writer.writeAttribute("class", (String)getProperty(PROP_BREADCRUMBS_LABEL), null); // $NON-NLS-1$
writer.writeAttribute("title", text, null); // $NON-NLS-1$
writer.writeText(text, null);
writer.endElement("span"); // $NON-NLS-1$
}
}
}
示例14: renderEntrySeparator
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
@Override
protected void renderEntrySeparator(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
boolean enabled = tree.getNode().isEnabled();
boolean selected = tree.getNode().isSelected();
writer.startElement("li", null); // $NON-NLS-1$
writer.startElement("div", null); // $NON-NLS-1$
String style = getItemStyle(tree,enabled,selected);
if(StringUtil.isNotEmpty(style)) {
writer.writeAttribute("style",style,null); // $NON-NLS-1$
}
String styleClass = ExtLibUtil.concatStyleClasses((String)getProperty(PROP_MENU_SECTION),getItemStyleClass(tree,enabled,selected));
if(StringUtil.isNotEmpty(styleClass)) {
writer.writeAttribute("class",styleClass,null); // $NON-NLS-1$
}
writer.endElement("div"); // $NON-NLS-1$
writer.endElement("li"); // $NON-NLS-1$
}
示例15: run
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入依赖的package包/类
public void run() throws NotesException, IOException {
Database db = ExtLibUtil.getCurrentDatabase();
if(deleteAllDoc) {
deleteAllDocuments();
}
if(createUsers) {
createUsers(db);
}
if(createStates) {
createStates(db);
}
if(createDiscussionDocuments) {
createDiscussionDocuments(db);
}
if(createAllTypes) {
createAllTypes(db);
}
}