Package org.japura.gui.model

Examples of org.japura.gui.model.ListCheckModel


  public void setModel(ListCheckModel model) {
  if (model == null) {
    throw new IllegalArgumentException("model must be non null");
  }
  ListCheckModel oldValue = this.model;
  this.model = model;
  if (oldValue != null) {
    firePropertyChange("model", oldValue, model);
  }
View Full Code Here


      value = text;
    }
    }
  }

  ListCheckModel m = getModel();

  for (int i = 0; i < m.getSize(); i++) {
    String str = m.getElementAt(i).toString();
    if (value == null) {
    value = str;
    } else if (str.length() > value.length()) {
    value = str;
    }
View Full Code Here

  public Component getListCellRendererComponent(JList list, Object value,
                        int index, boolean isSelected,
                        boolean cellHasFocus) {
  if (list instanceof CheckList) {
    CheckList cbl = (CheckList) list;
    ListCheckModel model = cbl.getModel();
    boolean checked = model.isChecked(value);
    boolean locked = model.isLocked(value);
    setSelected(checked);

    if (locked || cbl.isEnabled() == false) {
    setEnabled(false);
    } else {
View Full Code Here

  public static final DataFlavor CHECKEDS_LIST_FLAVOR = new DataFlavor(
    ArrayList.class, "CHECKEDS_LIST_FLAVOR");

  public static boolean isAvailableToTransfer(CheckList list) {
  ListCheckModel model = list.getModel();
  if (model.getChecksCount() == 0) {
    return false;
  }

  int index = list.getSelectedIndex();
  if (index == -1) {
    return false;
  }

  if (index >= model.getSize()) {
    return false;
  }

  Object selectedElement = model.getElementAt(index);
  return model.isChecked(selectedElement);
  }
View Full Code Here

TOP

Related Classes of org.japura.gui.model.ListCheckModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.