Package org.freeplane.features.attribute

Examples of org.freeplane.features.attribute.NodeAttributeTableModel


        getAndCheckNodeAttributeTableModelForIndex(index, "remove:");
    getAttributeController().removeAttribute(getDelegate(), index);
  }

  public void clear() {
    final NodeAttributeTableModel attributeTableModel = getNodeAttributeTableModel();
    final int size = attributeTableModel.getRowCount();
    for (int i = size - 1; i >= 0; i--) {
      getAttributeController().removeAttribute(getDelegate(), i);
    }
  }
View Full Code Here


    final Attribute attribute = new Attribute(name, ProxyUtils.transformObject(value, null));
    getAttributeController().addAttribute(getDelegate(), attribute);
  }

  public int size() {
    final NodeAttributeTableModel attributeTableModel = getNodeAttributeTableModel();
    if (attributeTableModel == null) {
      return 0;
    }
    return attributeTableModel.getRowCount();
  }
View Full Code Here

        return !isEmpty();
    }
   
    @SuppressWarnings("unchecked")
    public Iterator<Map.Entry<String, Object>> iterator() {
        final NodeAttributeTableModel attributeTableModel = getNodeAttributeTableModel();
        if (attributeTableModel == null) {
            return  (Iterator<Map.Entry<String, Object>>) (Object) Collections.emptyMap().entrySet().iterator();
        }
        return new Iterator<Map.Entry<String, Object>>() {
            final private Iterator<Attribute> iterator = attributeTableModel.getAttributes().iterator();

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }
View Full Code Here

  @Override
  public void actionPerformed(final ActionEvent e, final NodeModel node) {
    final AttributeUtilities atrUtil = new AttributeUtilities();
    if (atrUtil.hasAttributes(node)) {
      final NodeAttributeTableModel natm = NodeAttributeTableModel.getModel(node);
      AttributeController.getController().performRemoveRow(natm, 0);
    }
  }
View Full Code Here

  @Override
  public void actionPerformed(final ActionEvent e, final NodeModel node) {
    final AttributeUtilities atrUtil = new AttributeUtilities();
    if (atrUtil.hasAttributes(node)) {
      final NodeAttributeTableModel natm = NodeAttributeTableModel.getModel(node);
      final int j = natm.getRowCount();
      for (int i = 0; i < j; i++) {
        AttributeController.getController().performRemoveRow(natm, 0);
      }
    }
  }
View Full Code Here

  /**
   * @return : the number of attributes attached to the node. 0 for none.
   */
  public int getNumberOfAttributes(final NodeModel node) {
    if (hasAttributes(node)) {
      final NodeAttributeTableModel natm = NodeAttributeTableModel.getModel(node);
      return natm.getRowCount();
    }
    else {
      return 0;
    }
  }
View Full Code Here

  /**
   * @return : true if the node has at least one attribute attached.
   */
  public boolean hasAttributes(final NodeModel node) {
    final NodeAttributeTableModel natm = NodeAttributeTableModel.getModel(node);
    if (natm.getRowCount() > 0) {
      return true;
    }
    else {
      return false;
    }
View Full Code Here

  @Override
  public void actionPerformed(final ActionEvent e, final NodeModel node) {
    final AttributeUtilities atrUtil = new AttributeUtilities();
    if (atrUtil.hasAttributes(node)) {
      final NodeAttributeTableModel natm = NodeAttributeTableModel.getModel(node);
      AttributeController.getController().performRemoveRow(natm, natm.getRowCount() - 1);
    }
  }
View Full Code Here

    createActions();
  }

  public int addAttribute(final NodeModel node, final Attribute pAttribute) {
    createAttributeTableModel(node);
    final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(node);
    final int rowCount = attributes.getRowCount();
    performInsertRow(attributes, rowCount, pAttribute.getName(), pAttribute.getValue());
    return rowCount;
  }
View Full Code Here

  }

  public int editAttribute(final NodeModel pNode, final String pName, final String pNewValue) {
    createAttributeTableModel(pNode);
    final Attribute newAttribute = new Attribute(pName, pNewValue);
    final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(pNode);
    for (int i = 0; i < attributes.getRowCount(); i++) {
      if (pName.equals(attributes.getAttribute(i).getName())) {
        if (pNewValue != null) {
          setAttribute(pNode, i, newAttribute);
        }
        else {
          removeAttribute(pNode, i);
View Full Code Here

TOP

Related Classes of org.freeplane.features.attribute.NodeAttributeTableModel

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.