org.fujion.component.Grid类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.fujion.component.Grid类的一些代码示例,展示了Grid类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid类的具体详情如下:
包路径:org.fujion.component.Grid
类名称:Grid

Grid介绍

[英]A grid component.
[中]网格组件。

代码示例

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-ui-reporting

/**
 * Clear the current selection, if any.
 */
protected void clearSelection() {
  grid.getRows().clearSelected();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.help.core

/**
 * Displays the specified message. The list box is hidden if the message is not empty.
 *
 * @param message Message to display.
 */
private void showMessage(String message) {
  message = message == null ? null : StrUtil.getLabel(message);
  lblNoResultsFound.setLabel(message);
  lblNoResultsFound.setVisible(!StringUtils.isEmpty(message));
  tblSrchResults.setVisible(!lblNoResultsFound.isVisible());
}

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-ui-reporting

/**
 * Initializes the controller. Loads user preferences and properties.
 */
@Override
protected void initializeController() {
  if (grid.getRows() == null) {
    grid.addChild(new Rows());
  }
  
  setComponents(grid, grid.getRows());
  super.initializeController();
  
  boolean expandAll = getPropertyValue(Constants.PROPERTY_ID_EXPAND_DETAIL, Boolean.class,
    chkExpandAll != null && chkExpandAll.isChecked());
  
  if (this.chkExpandAll != null) {
    this.chkExpandAll.setChecked(expandAll);
  }
  
}

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-ui-reporting

/**
 * Show the popup dialog, populating it with detail information for the specified data object.
 */
@Override
public void show() {
  addRows();
  
  if (debug) {
    debugObject(dataObject, false);
  }
  
  if (grid.getRows().getChildren().size() > 20) {
    grid.setHeight("600px");
  }
  
  super.show();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.sharedforms

@Test
  public void testForm() throws Exception {
    BaseComponent root = PageUtil.createPage("web/org/carewebframework/ui/sharedforms/listviewForm.fsp", null).get(0);
    TestController controller = new TestController();
    root.wireController(controller);
    ElementPlugin dummy = new ElementPlugin();
    controller.onLoad(dummy);
    controller.requestData();
    assertEquals(10, controller.model.size());
    Grid grid = (Grid) root.findByName("grid");
    Rows rows = grid.getRows();
    assertEquals(10, rows.getChildCount());
    assertEquals("Item #2.3", ((ILabeled) rows.getChildAt(1).getChildAt(2)).getLabel());
    assertEquals("Test Title", controller.getCaption());
    assertEquals("Header3", ((Column) grid.getColumns().getLastChild()).getLabel());
    assertEquals(":1:false;0:33%;1:33%;2:33%", controller.getLayout());
    controller.setLayout(":2:true;0:20%;1:30%;2:50%");
    assertEquals(":2:true;0:20%;1:30%;2:50%", controller.getLayout());
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

grid.getColumns().getChild(Column.class).sort();

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

/**
 * Adds a column to a grid.
 * 
 * @param grid Grid.
 * @param label Label for column.
 * @param width Width for column.
 * @param sortBy Field for sorting.
 * @return Newly created column.
 */
public Column addColumn(Grid grid, String label, String width, String sortBy) {
  Column column = new Column();
  grid.getColumns().addChild(column);
  column.setLabel(label);
  column.setWidth(width);
  column.setSortComparator(sortBy);
  column.setSortOrder(SortOrder.ASCENDING);
  return column;
}

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-ui-reporting

/**
 * Returns the last row added.
 *
 * @return The last row added.
 */
private Row getLastRow() {
  return (Row) grid.getRows().getLastChild();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.sharedforms

protected void status(String message) {
  if (message != null) {
    grid.setVisible(false);
    status.setLabel(StrUtil.piece(message, "^"));
    status.setHint(StrUtil.piece(message, "^", 2, 999));
    status.setVisible(true);
  } else {
    status.setVisible(false);
    status.setLabel(null);
    status.setHint(null);
    grid.setVisible(true);
  }
}

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-ui-patientselection-core

Patient patient = patientListItem.getPatient();
Columns columns = grid.getColumns();
int max = columns == null ? 0 : columns.getChildCount();
String info = patientListItem.getInfo();

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.sharedforms

protected Row getSelectedRow() {
  return grid.getRows().getSelectedRow();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

gridProperties.setVisible(true);
  setPropertyDescription("@cwf.shell.designer.property.grid.propdx.some.caption",
    "@cwf.shell.designer.property.grid.propdx.some.message");
} else {
  gridProperties.setVisible(false);
  setPropertyDescription("@cwf.shell.designer.property.grid.propdx.none.caption",
    "@cwf.shell.designer.property.grid.propdx.none.message");

代码示例来源:origin: org.fujion/fujion-core

/**
 * Returns the model from the associated grid rows.
 *
 * @return The model backing the associated grid rows. May be null.
 */
private IListModel<Object> getRowsModel() {
  Grid grid = getAncestor(Grid.class);
  Rows rows = grid == null ? null : grid.getRows();
  return rows == null ? null : rows.getModel(Object.class);
}

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-ui-reporting

/**
 * Returns a list of rows.
 *
 * @param selectedOnly If true, only selected rows are returned.
 * @return List of rows.
 */
protected Iterable<Row> getRows(boolean selectedOnly) {
  Rows rows = grid.getRows();
  return selectedOnly ? rows.getSelected() : rows.getChildren(Row.class);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.help.core

@Override
public void afterInitialized(BaseComponent comp) {
  super.afterInitialized(comp);
  modelAndView = tblSrchResults.getRows().getModelAndView(HelpSearchHit.class);
}

代码示例来源:origin: org.hspconsortium.carewebframework/cwf-plugin-scenario

private IBaseResource getSelectedResource() {
  Row row = tblResources.getRows().getSelectedRow();
  return row == null ? null : (IBaseResource) row.getData();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.help.core

/**
 * Sets the currently viewed topic when a search result is selected.
 */
@EventHandler(value = "change", target = "@tblSrchResults")
private void onSelect$tblSrchResults() {
  Row row = tblSrchResults.getRows().getSelectedRow();
  setTopic((HelpTopic) row.getData());
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

@Override
public void init(Grid grid) {
  grid.getRows().getModelAndView(AttributeItem.class).setRenderer(this);
  addColumn(grid, "Attribute", "30%", "@name");
  addColumn(grid, "Value", "70%", "@value");
}

代码示例来源:origin: org.carewebframework/org.carewebframework.help.core

/**
 * Perform the search and display the results.
 */
@EventHandler(value = "click", target = "btnSearch")
private void onClick$btnSearch() {
  modelAndView.setModel(null);
  tblSrchResults.getRows().destroyChildren();
  String query = txtSearch.getValue();
  showMessage(null);
  if (query != null && query.trim().length() > 0) {
    HelpUtil.getSearchService().search(query, helpSets, this);
  } else {
    showMessage("cwf.help.tab.search.noentry");
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

/**
 * Returns the editor associated with the named property, or null if none found.
 *
 * @param propName The property name.
 * @param select If true, select editor's the containing row.
 * @return The associated property editor (may be null).
 */
public PropertyEditorBase<?> findEditor(String propName, boolean select) {
  for (Object child : gridProperties.getRows().getChildren()) {
    if (child instanceof Row) {
      Row row = (Row) child;
      PropertyEditorBase<?> editor = (PropertyEditorBase<?>) row.getAttribute(EDITOR_ATTR);
      
      if (editor != null && editor.getPropInfo().getId().equals(propName)) {
        if (select) {
          row.setSelected(true);
        }
        
        return editor;
      }
    }
  }
  
  return null;
}

相关文章