当前位置: 首页>>代码示例>>Java>>正文


Java ListBoxBuilder类代码示例

本文整理汇总了Java中de.lessvoid.nifty.controls.listbox.builder.ListBoxBuilder的典型用法代码示例。如果您正苦于以下问题:Java ListBoxBuilder类的具体用法?Java ListBoxBuilder怎么用?Java ListBoxBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ListBoxBuilder类属于de.lessvoid.nifty.controls.listbox.builder包,在下文中一共展示了ListBoxBuilder类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bind

import de.lessvoid.nifty.controls.listbox.builder.ListBoxBuilder; //导入依赖的package包/类
@Override
public void bind(Nifty nifty, Screen screen) {
    this.nifty = nifty;
    final ScreenController This = this;
    Screen dialog = new ScreenBuilder(SCREEN_ID) {
        {
            controller(This);
            layer(new LayerBuilder("foreground") {
                {
                    childLayoutCenter();

                    control(new ListBoxBuilder("moleculeList") {
                        {
                            childLayoutVertical();
                            set("horizontal", "false");
                            displayItems(10);
                            selectionModeSingle();
                            optionalVerticalScrollbar();
                            optionalHorizontalScrollbar();
                            width("85%");
                            height("85%");
                            x("8%");
                            y("10%");
                        }
                    });

                }
            });
        }
    }.build(nifty);

    //Element e = dialog.findElementByName("foreground");

    /*CreateListBoxControl clistBox = new CreateListBoxControl("listBoxDynamic");
     clistBox.set("horizontal", "false");
     clistBox.setWidth("85%");
     clistBox.setHeight("85%");
     //clistBox.setY("10%");
     //clistBox.setX("8%");
     clistBox.setChildLayout("vertical");
     clistBox.set("displayItems", "10");
     clistBox.set("vertical", "optional");
     clistBox.set("horizontal", "optional");


     listBox = clistBox.create(nifty, dialog, e);

     File dir = Constants.getMoleculeLocation();
     File[] fs = dir.listFiles();
     if (fs == null) {
     fs = new File[0];
     }
     for (File f : fs) {
     String name = FileTools.getFileName(f);
     listBox.addItem(name);
     }*/
    ListBox box = dialog.findNiftyControl("moleculeList", ListBox.class);
    // add items; box.addItem

    File dir = Constants.getMoleculeLocation();
    String[] fs = FileTools.listSubFiles(dir);

    for (String subF : fs) {
        box.addItem(subF);
    }

    nifty.addScreen(SCREEN_ID, dialog);
    nifty.gotoScreen(SCREEN_ID);
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:70,代码来源:MoleculeDialog.java

示例2: GListBox

import de.lessvoid.nifty.controls.listbox.builder.ListBoxBuilder; //导入依赖的package包/类
public GListBox(String id){
  super(id);
  builder = new ListBoxBuilder(id);
  name="listBox";
}
 
开发者ID:relu91,项目名称:niftyeditor,代码行数:6,代码来源:GListBox.java


注:本文中的de.lessvoid.nifty.controls.listbox.builder.ListBoxBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。